https://github.com/wcatron/foobar2
Concepts:
- Simple key/value content store.
- Identify content by the current
path
,contentType
andcontentId
. The path is just stripped from the URL,contentType
is specified by the component and thecontentId
is specified by the container component that is using the authorable component. (Not thrilled with how much goes into this, especially when you start considering versioning the contentType.) AuthoringContext
andContentStoreContext
are the only 'MUI' specific code in the demo, currently mocked with a basic store.useContent
hook that takes a default if the content doesn't exist.- A seperate
useContentEditor
hook which is used to determine if the user is an authoring context and store the content (based on path, contentType, and contentId). - Nested authorable components MultiTab.
- JSON objects as content structures.
- AuthorableArea component with the ability to specify a custom editor.
- Supports inline editing by the component using
useContentEditor
directly instead of wrapping the component inAuthorableArea
. (AuthorableArea
could also have aninline
flag.)