Skip to content

Commit f13b2b7

Browse files
committed
refactor(container-blocks): simplify rendering, editing, and exports
1 parent c0626cf commit f13b2b7

42 files changed

Lines changed: 480 additions & 1807 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/content/docs/features/custom-schemas/container-blocks.mdx‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ At runtime the contained blocks live on `block.children`, the same field used fo
3737

3838
```json
3939
{
40-
"id": "panel-1",
41-
"type": "panel",
40+
"id": "panel-1",
41+
"type": "panel",
4242
"props": {},
4343
"children": [
4444
{
@@ -111,9 +111,7 @@ const createAlert = createBlockSpec(
111111
);
112112
```
113113

114-
Editing gestures treat the title and the body as one unit: Enter at the end of the title starts the body, Enter on an empty last body block leaves it, Backspace at the start of the first body block merges back into the title, and Shift-Tab stops at the body's edge instead of lifting the block out of it. An alert without a title needs no title row — it is just a pure container drawing its box in `render`. The demos below show both side by side in vanilla JS, followed by the same title-and-body idea in React — a callout whose title is real rich text:
115-
116-
<Example name="custom-schema/alert-blocks" />
114+
Editing gestures treat the title and the body as one unit: Enter at the end of the title starts the body, Enter on an empty last body block leaves it, Backspace at the start of the first body block merges back into the title, and Shift-Tab stops at the body's edge instead of lifting the block out of it. An alert without a title needs no title row — it is just a pure container drawing its box in `render`. The React example below shows a callout whose title is real rich text:
117115

118116
<Example name="custom-schema/callout-block" />
119117

‎examples/06-custom-schema/12-alert-blocks/.bnexample.json‎

Lines changed: 0 additions & 15 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/README.md‎

Lines changed: 0 additions & 19 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/index.html‎

Lines changed: 0 additions & 14 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/main.tsx‎

Lines changed: 0 additions & 11 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/package.json‎

Lines changed: 0 additions & 31 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/src/Alert.tsx‎

Lines changed: 0 additions & 88 deletions
This file was deleted.

‎examples/06-custom-schema/12-alert-blocks/src/App.tsx‎

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)