-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* chore: make the message source app origin configurable via an env var * feat: define component definition types aligned with the proposal * refactor: mvp component definition structure * chore: prettify * chore: update inline comment * chore: clarify readme
- Loading branch information
Showing
8 changed files
with
155 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
import React from 'react' | ||
import { useComponents } from './hooks' | ||
import { ComponentDefinitionVariableArrayItemType, ComponentDefinitionVariableType } from './types' | ||
|
||
const Com = () => { | ||
return null | ||
} | ||
|
||
export const Test = () => { | ||
const { defineComponent } = useComponents() | ||
|
||
defineComponent(Com, { | ||
id: 'Com', | ||
name: 'Com', | ||
variables: { | ||
name: { | ||
type: ComponentDefinitionVariableType.LINK, | ||
linkType: 'Asset', | ||
}, | ||
isChecked: { | ||
type: ComponentDefinitionVariableType.BOOLEAN, | ||
}, | ||
elements: { | ||
type: ComponentDefinitionVariableType.ARRAY, | ||
items: { | ||
linkType: 'Entry', | ||
type: ComponentDefinitionVariableArrayItemType.LINK, | ||
}, | ||
}, | ||
elementsSymbol: { | ||
type: ComponentDefinitionVariableType.ARRAY, | ||
items: { | ||
type: ComponentDefinitionVariableArrayItemType.SYMBOL, | ||
}, | ||
}, | ||
elementsComponent: { | ||
type: ComponentDefinitionVariableType.ARRAY, | ||
items: { | ||
type: ComponentDefinitionVariableArrayItemType.COMPONENT, | ||
}, | ||
}, | ||
}, | ||
}) | ||
return <div data-test-id="test">Test</div> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const CONTENTFUL_WEB_APP_ORIGIN = 'https://app.contentful.com' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
export { VisualEditorRoot } from './blocks' | ||
export { useExperienceBuilder, useComponents as useExperienceBuilderComponents } from './hooks' | ||
export type { ComponentDefinition, ComponentDefinitionVariable } from './types' | ||
export { ComponentDefinitionVariableType, ComponentDefinitionVariableArrayItemType } from './types' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters