PluginProbe
Tableberg – Simple Gutenberg Table Block / 1.1.5
Tableberg – Simple Gutenberg Table Block v1.1.5
1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.5 1.0.4 1.0.3 1.0.2 1.0.1 trunk 0.0.2 0.2.1 0.3.2 0.3.3 0.4.1 0.5.0 0.5.1 0.5.2 0.5.3 0.5.4 0.5.5 0.5.6 0.5.7 All 42 releases
tableberg / src / blocks / list / index.tsx

index.tsx in Tableberg – Simple Gutenberg Table Block 1.1.5, at src/blocks/list/index.tsx

24 lines 943 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { registerBlockType } from "@wordpress/blocks";
2 import listIcon from "@tableberg/shared/icons/styled-list";
3
4 import metadata from "./block.json";
5 import { ListElement } from "./element";
6 import { createBridgedElementEdit } from "../element-bridge";
7
8 /**
9 * The edit is the shared ListElement — the same component pro's styled list
10 * runs — so the block gets its keyboard handling (Enter for a new item,
11 * Tab/Shift+Tab to indent, Backspace to outdent or remove), its indent and
12 * outdent toolbar buttons, and its real nested rendering. The block used to
13 * have a hand-written edit that rendered a flat list of RichTexts with no key
14 * handling at all, so Enter only inserted a line break.
15 */
16 export function registerListBlock() {
17 registerBlockType(metadata.name, {
18 ...(metadata as any),
19 icon: listIcon,
20 edit: createBridgedElementEdit(metadata.name, ListElement),
21 save: () => null,
22 });
23 }
24