docblocks-react-ui 0.17.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -1,39 +0,0 @@
1
- import { ComponentType, ReactNode } from "react";
2
- import { Block, BlockId, BlockType, Doc, TextRun } from "docblocks-core";
3
- //#region src/blocks/renderers.d.ts
4
- /** The props a block renderer receives: the block id and its plain snapshot. */
5
- interface BlockRendererProps {
6
- id: BlockId;
7
- block: Block;
8
- }
9
- /**
10
- * A consumer renderer for a block type; resolved in place of the built-in
11
- * renderer. Replacing a text-editable type swaps the whole block view,
12
- * including the wrapper, the contenteditable element, and its editing
13
- * affordance — a renderer that needs editing drives the core commands
14
- * through the hooks (the consumer builds its own UI on top of them).
15
- *
16
- * The built-in text renderers read the per-block context (the page
17
- * context — the root, a table cell, or a frame — and the flat page
18
- * sequence) for the keyboard gestures; a consumer renderer does not read
19
- * it — the context is part of the built-in rendering, not of the renderer
20
- * contract. Nesting is a derived notion (the flat page model: a block's
21
- * `indent` attr relative to its preceding block, not a data field), so a
22
- * replaced block does not receive its derived nested content — the
23
- * sequence rendering stands a block's deeper followers as a nested slot
24
- * AFTER the replaced view (the content is never dropped); a renderer that
25
- * wants to render them itself drives the doc through the hooks.
26
- *
27
- * A renderer is a plain render function, not a component: it is invoked
28
- * during the block view's render, so it must not call hooks itself —
29
- * return a component's output from a wrapper component if needed.
30
- */
31
- type BlockRenderer = (props: BlockRendererProps) => ReactNode;
32
- /**
33
- * Per-instance consumer renderers, keyed by block type. A type without an
34
- * entry keeps its built-in renderer; a type with neither renders the
35
- * placeholder (future block types keep working).
36
- */
37
- type BlockRendererMap = Partial<Record<BlockType, BlockRenderer>>;
38
- //#endregion
39
- export { BlockRendererMap as n, BlockRendererProps as r, BlockRenderer as t };