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/CHANGELOG.md +33 -0
- package/README.md +3 -3
- package/dist/{Editor-CbHCJZ6R.mjs → Editor-DQg2tfne.mjs} +15537 -14542
- package/dist/{constants-D8PSgkwi.mjs → constants-DWJbJpt5.mjs} +76 -8
- package/dist/{index-C3vzW1Mv.d.mts → index-DLLPjOP5.d.mts} +20 -206
- package/dist/index-G44JW36p.d.mts +236 -0
- package/dist/index.d.mts +114 -49
- package/dist/index.mjs +4 -4
- package/dist/mermaid/index.d.mts +1 -1
- package/dist/mermaid/index.mjs +210 -147
- package/dist/pdf/index.d.mts +1 -1
- package/dist/pdf/index.mjs +421 -362
- package/package.json +1 -1
- package/dist/index-YJcgf8Hh.d.mts +0 -39
package/package.json
CHANGED
|
@@ -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 };
|