-
Notifications
You must be signed in to change notification settings - Fork 73
Refactor JanDit #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Refactor JanDit #18
Conversation
src/shared/astro/page.astro
Outdated
| <main id="main-content" tabindex="-1" data-editable="array" data-prop="contentBlocks" data-id-key="_name"> | ||
| { | ||
| contentBlocks.map((block: any) => { | ||
| const key = block._name; | ||
| const Component = components[key]; | ||
| if (!Component) { | ||
| console.warn(`Unknown component for block key '${key}'`, block); | ||
| return null; | ||
| } | ||
| return ( | ||
| <div data-editable="array-item" data-id={block._name}> | ||
| <Component {...block} /> | ||
| </div> | ||
| ); | ||
| }) | ||
| } | ||
| </main> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For page building to work fully this will need data-component-key and data-component
| <main id="main-content" tabindex="-1" data-editable="array" data-prop="contentBlocks" data-id-key="_name"> | |
| { | |
| contentBlocks.map((block: any) => { | |
| const key = block._name; | |
| const Component = components[key]; | |
| if (!Component) { | |
| console.warn(`Unknown component for block key '${key}'`, block); | |
| return null; | |
| } | |
| return ( | |
| <div data-editable="array-item" data-id={block._name}> | |
| <Component {...block} /> | |
| </div> | |
| ); | |
| }) | |
| } | |
| </main> | |
| <main id="main-content" tabindex="-1" data-editable="array" data-prop="contentBlocks" data-id-key="_name" data-component-key="_name"> | |
| { | |
| contentBlocks.map((block: any) => { | |
| const key = block._name; | |
| const Component = components[key]; | |
| if (!Component) { | |
| console.warn(`Unknown component for block key '${key}'`, block); | |
| return null; | |
| } | |
| return ( | |
| <div data-editable="array-item" data-id={key} data-component={key}> | |
| <Component {...block} /> | |
| </div> | |
| ); | |
| }) | |
| } | |
| </main> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Tate-CC This change actually breaks some components when rendered in the Visual Editor. Could you explain what this change is intended to do? I wasn’t able to understand the purpose of the Component Editable Region from the CloudCannon documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be fixed by Tate in an upcoming release. For now I've pinned the astro version
|
Wow 🤩 thanks Tate. I'll work through your comments and suggestions first thing next week. |
condense to single blob Co-authored-by: Tate-CC <[email protected]>
…onents and pages
remove unused prop Co-authored-by: Tate-CC <[email protected]>
… to parent `h3` and `p` tags.
…ent, defaulting to an empty string if no value is present.
This reverts commit 70ed216.
Co-authored-by: Tate-CC <[email protected]>
…tributes instead of `label` for CloudCannon editing.
…and paginated collection schemas
…add null-safe access
…BlogList` component
…redundant post-pagination filtering.
…passed to `BlogList`.
Uh oh!
There was an error while loading. Please reload this page.