@haklex/rich-compose 0.39.7 → 0.40.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/README.md +36 -0
- package/dist/{compose-BC3hv8cT.js → compose-7SEahaEz.js} +44 -20
- package/dist/core/compose.d.ts.map +1 -1
- package/dist/core/types.d.ts +4 -3
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core-entry.d.ts +1 -1
- package/dist/core-entry.d.ts.map +1 -1
- package/dist/core.mjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/litexml-html-preview-client.js +44 -20
- package/dist/static-renderer/RichRenderer.d.ts +1 -1
- package/dist/static-renderer/RichRenderer.d.ts.map +1 -1
- package/dist/static-renderer/index.d.ts +1 -1
- package/dist/static-renderer/index.d.ts.map +1 -1
- package/dist/static-renderer/types.d.ts +4 -2
- package/dist/static-renderer/types.d.ts.map +1 -1
- package/package.json +25 -25
package/README.md
CHANGED
|
@@ -177,6 +177,42 @@ composeRenderer({
|
|
|
177
177
|
|
|
178
178
|
The lazy chunk is still emitted but never fetched at runtime.
|
|
179
179
|
|
|
180
|
+
## Platform-agnostic rendering
|
|
181
|
+
|
|
182
|
+
`RichRenderer` (and `composeRenderer`) emit DOM by default, but every DOM touchpoint is injectable so the same tree walk can target another React renderer (React Native, ink, a test harness):
|
|
183
|
+
|
|
184
|
+
| Hook | Covers |
|
|
185
|
+
| ------------------------------- | --------------------------------------------------------------------------------------------- |
|
|
186
|
+
| `builtinNodeOverrides[type]` | Element nodes (`paragraph`, `heading`, `list`, …) and decorator nodes (`image`, `mermaid`, …) |
|
|
187
|
+
| `builtinNodeOverrides.text` | Text leaves — receives the serialized text node (`text`, `format`, `style`) |
|
|
188
|
+
| `blockAnchor(el, blockId, key)` | Root-level block wrapper carrying `$.blockId`; defaults to a `data-block-id` div |
|
|
189
|
+
| `as` | Host container — any `ElementType`; non-string hosts receive only `style` and `children` |
|
|
190
|
+
|
|
191
|
+
A decorator override receives the default decoration as its single child and may drop it:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
<RichRenderer
|
|
195
|
+
as={View}
|
|
196
|
+
blockAnchor={(el, blockId, key) => (
|
|
197
|
+
<View key={key} nativeID={blockId}>
|
|
198
|
+
{el}
|
|
199
|
+
</View>
|
|
200
|
+
)}
|
|
201
|
+
builtinNodeOverrides={{
|
|
202
|
+
text: (node, key) => (
|
|
203
|
+
<Text key={key} style={textStyle(node.format)}>
|
|
204
|
+
{node.text}
|
|
205
|
+
</Text>
|
|
206
|
+
),
|
|
207
|
+
paragraph: (_node, key, children) => <Text key={key}>{children}</Text>,
|
|
208
|
+
mermaid: (node, key) => <NativeMermaid key={key} diagram={node.diagram} />,
|
|
209
|
+
}}
|
|
210
|
+
value={state}
|
|
211
|
+
/>
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Decorator slots (`rendererConfig` / module `renderers`) accept any React component, so `Image`, `CodeBlock`, `LinkCard` etc. can be replaced the same way.
|
|
215
|
+
|
|
180
216
|
## Module catalog
|
|
181
217
|
|
|
182
218
|
| Module | Base Klass | Edit Klass | Mode | Source |
|
|
@@ -320,8 +320,7 @@ function wrapDecoration(serialized, key, decoration) {
|
|
|
320
320
|
return decoration;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
|
-
function
|
|
324
|
-
if (!blockId) return element;
|
|
323
|
+
function domBlockAnchor(element, blockId, nodeKey) {
|
|
325
324
|
if (isValidElement(element) && typeof element.type === "string") return cloneElement(element, { "data-block-id": blockId });
|
|
326
325
|
return /* @__PURE__ */ jsx("div", {
|
|
327
326
|
className: "rich-block-anchor",
|
|
@@ -329,27 +328,43 @@ function applyBlockId(element, blockId, nodeKey) {
|
|
|
329
328
|
children: element
|
|
330
329
|
}, `${nodeKey}-block-anchor`);
|
|
331
330
|
}
|
|
332
|
-
function
|
|
331
|
+
function applyBlockId(element, blockId, nodeKey, options) {
|
|
332
|
+
if (!blockId) return element;
|
|
333
|
+
return (options.blockAnchor ?? domBlockAnchor)(element, blockId, nodeKey);
|
|
334
|
+
}
|
|
335
|
+
function renderTree(node, editor, editorConfig, headingSlugs, key, blockId, options) {
|
|
333
336
|
const nodeKey = node.getKey ? node.getKey() : key;
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
337
|
+
const { builtinNodeOverrides } = options;
|
|
338
|
+
if (typeof node.decorate === "function") {
|
|
339
|
+
let decoration = null;
|
|
340
|
+
try {
|
|
341
|
+
decoration = node.decorate(editor, editorConfig);
|
|
342
|
+
} catch {}
|
|
343
|
+
if (decoration != null) {
|
|
344
|
+
const serialized = node.exportJSON ? node.exportJSON() : {};
|
|
345
|
+
const override = builtinNodeOverrides?.[serialized.type];
|
|
346
|
+
return applyBlockId(override ? override(serialized, nodeKey, [decoration], () => wrapDecoration(serialized, nodeKey, decoration)) : wrapDecoration(serialized, nodeKey, decoration), blockId, nodeKey, options);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
338
349
|
const serialized = node.exportJSON ? node.exportJSON() : {};
|
|
339
|
-
if (serialized.type === "text")
|
|
350
|
+
if (serialized.type === "text") {
|
|
351
|
+
const override = builtinNodeOverrides?.text;
|
|
352
|
+
if (override) return override(serialized, nodeKey, null, () => renderTextNode(serialized, nodeKey));
|
|
353
|
+
return renderTextNode(serialized, nodeKey);
|
|
354
|
+
}
|
|
340
355
|
const childNodes = typeof node.getChildren === "function" ? node.getChildren() : [];
|
|
341
356
|
if (Array.isArray(serialized.children) && serialized.children.length === 0 && childNodes.length > 0) serialized.children = childNodes.map((c) => ({ type: typeof c.getType === "function" ? c.getType() : c.__type }));
|
|
342
357
|
let children = null;
|
|
343
|
-
if (childNodes.length > 0) children = childNodes.map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `${nodeKey}-${i}`, void 0,
|
|
358
|
+
if (childNodes.length > 0) children = childNodes.map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `${nodeKey}-${i}`, void 0, options));
|
|
344
359
|
const textContent = node.getTextContent ? node.getTextContent() : void 0;
|
|
345
360
|
const override = builtinNodeOverrides?.[serialized.type];
|
|
346
361
|
if (override) {
|
|
347
362
|
const defaultRenderer = () => renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent);
|
|
348
|
-
return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey);
|
|
363
|
+
return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey, options);
|
|
349
364
|
}
|
|
350
|
-
return applyBlockId(renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent), blockId, nodeKey);
|
|
365
|
+
return applyBlockId(renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent), blockId, nodeKey, options);
|
|
351
366
|
}
|
|
352
|
-
function renderEditorToReact(value, nodes,
|
|
367
|
+
function renderEditorToReact(value, nodes, options) {
|
|
353
368
|
const editor = createHeadlessEditor({
|
|
354
369
|
nodes,
|
|
355
370
|
theme: editorTheme,
|
|
@@ -371,7 +386,7 @@ function renderEditorToReact(value, nodes, builtinNodeOverrides) {
|
|
|
371
386
|
editorState.read(() => {
|
|
372
387
|
const root = $getRoot();
|
|
373
388
|
const headingSlugs = /* @__PURE__ */ new Map();
|
|
374
|
-
const children = root.getChildren().map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `ssr-${i}`, rawRootChildren?.[i]?.$?.blockId,
|
|
389
|
+
const children = root.getChildren().map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `ssr-${i}`, rawRootChildren?.[i]?.$?.blockId, options));
|
|
375
390
|
content = /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
376
391
|
});
|
|
377
392
|
const renderNestedContent = (state) => {
|
|
@@ -395,7 +410,7 @@ function renderEditorToReact(value, nodes, builtinNodeOverrides) {
|
|
|
395
410
|
nestedState.read(() => {
|
|
396
411
|
const root = $getRoot();
|
|
397
412
|
const headingSlugs = /* @__PURE__ */ new Map();
|
|
398
|
-
const ch = root.getChildren().map((child, i) => renderTree(child, nestedEditor, nestedEditorConfig, headingSlugs, `nested-${i}`, nestedRawChildren?.[i]?.$?.blockId,
|
|
413
|
+
const ch = root.getChildren().map((child, i) => renderTree(child, nestedEditor, nestedEditorConfig, headingSlugs, `nested-${i}`, nestedRawChildren?.[i]?.$?.blockId, options));
|
|
399
414
|
nested = /* @__PURE__ */ jsx(Fragment$1, { children: ch });
|
|
400
415
|
});
|
|
401
416
|
return nested;
|
|
@@ -406,12 +421,16 @@ function renderEditorToReact(value, nodes, builtinNodeOverrides) {
|
|
|
406
421
|
renderNestedContent
|
|
407
422
|
};
|
|
408
423
|
}
|
|
409
|
-
function RichRenderer({ value, variant = "article", theme = "light", className, style, as: Component = "div", nested = false, rendererConfig, extraNodes, builtinNodeOverrides }) {
|
|
424
|
+
function RichRenderer({ value, variant = "article", theme = "light", className, style, as: Component = "div", nested = false, rendererConfig, extraNodes, builtinNodeOverrides, blockAnchor }) {
|
|
410
425
|
const variantClass = getVariantClass(variant);
|
|
411
426
|
const outerRenderNestedContent = useOptionalNestedContentRenderer();
|
|
412
427
|
const { content, footnoteData, renderNestedContent } = useMemo(() => {
|
|
413
|
-
return renderEditorToReact(value, extraNodes ? [...allNodes, ...extraNodes] : allNodes,
|
|
428
|
+
return renderEditorToReact(value, extraNodes ? [...allNodes, ...extraNodes] : allNodes, {
|
|
429
|
+
blockAnchor,
|
|
430
|
+
builtinNodeOverrides
|
|
431
|
+
});
|
|
414
432
|
}, [
|
|
433
|
+
blockAnchor,
|
|
415
434
|
builtinNodeOverrides,
|
|
416
435
|
extraNodes,
|
|
417
436
|
value
|
|
@@ -421,6 +440,12 @@ function RichRenderer({ value, variant = "article", theme = "light", className,
|
|
|
421
440
|
variantClass,
|
|
422
441
|
className
|
|
423
442
|
].filter(Boolean).join(" ");
|
|
443
|
+
const hostProps = typeof Component === "string" ? {
|
|
444
|
+
"suppressHydrationWarning": true,
|
|
445
|
+
"className": classes,
|
|
446
|
+
"data-rich-nested": nested ? "true" : void 0,
|
|
447
|
+
"data-theme": theme
|
|
448
|
+
} : {};
|
|
424
449
|
return /* @__PURE__ */ jsx(PortalThemeProvider, {
|
|
425
450
|
className: variantClass,
|
|
426
451
|
theme,
|
|
@@ -436,10 +461,7 @@ function RichRenderer({ value, variant = "article", theme = "light", className,
|
|
|
436
461
|
children: /* @__PURE__ */ jsx(NestedContentRendererProvider, {
|
|
437
462
|
value: outerRenderNestedContent ?? renderNestedContent,
|
|
438
463
|
children: /* @__PURE__ */ jsx(Component, {
|
|
439
|
-
|
|
440
|
-
className: classes,
|
|
441
|
-
"data-rich-nested": nested ? "true" : void 0,
|
|
442
|
-
"data-theme": theme,
|
|
464
|
+
...hostProps,
|
|
443
465
|
style,
|
|
444
466
|
children: content
|
|
445
467
|
})
|
|
@@ -578,6 +600,7 @@ function composeRenderer(opts) {
|
|
|
578
600
|
};
|
|
579
601
|
const ComposedProviders = composeProviders(merged);
|
|
580
602
|
const builtinNodeOverrides = opts.builtinNodeOverrides;
|
|
603
|
+
const blockAnchor = opts.blockAnchor;
|
|
581
604
|
function ComposedRenderer(props) {
|
|
582
605
|
const { theme, variant } = props;
|
|
583
606
|
const renderNested = useCallback((value, overrideVariant) => /* @__PURE__ */ jsx(ComposedRenderer, {
|
|
@@ -590,6 +613,7 @@ function composeRenderer(opts) {
|
|
|
590
613
|
value: renderNested,
|
|
591
614
|
children: /* @__PURE__ */ jsx(ComposedProviders, { children: /* @__PURE__ */ jsx(RichRenderer, {
|
|
592
615
|
as: props.as,
|
|
616
|
+
blockAnchor,
|
|
593
617
|
builtinNodeOverrides,
|
|
594
618
|
className: props.className,
|
|
595
619
|
extraNodes: allNodes,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/core/compose.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAA+C,MAAM,OAAO,CAAC;AAKxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAsB,MAAM,SAAS,CAAC;AAkCjG,wBAAgB,eAAe,CAC7B,IAAI,EAAE,sBAAsB,GAC3B,aAAa,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"compose.d.ts","sourceRoot":"","sources":["../../src/core/compose.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,aAAa,EAA+C,MAAM,OAAO,CAAC;AAKxF,OAAO,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAsB,MAAM,SAAS,CAAC;AAkCjG,wBAAgB,eAAe,CAC7B,IAAI,EAAE,sBAAsB,GAC3B,aAAa,CAAC,qBAAqB,CAAC,CA8CtC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RendererConfig, RichEditorVariant } from '@haklex/rich-editor/static';
|
|
2
2
|
import { Klass, LexicalNode, SerializedEditorState } from 'lexical';
|
|
3
|
-
import { ComponentType, CSSProperties, ReactNode } from 'react';
|
|
4
|
-
import { BuiltinNodeRenderer } from '../static-renderer/types';
|
|
3
|
+
import { ComponentType, CSSProperties, ElementType, ReactNode } from 'react';
|
|
4
|
+
import { BlockAnchorRenderer, BuiltinNodeRenderer } from '../static-renderer/types';
|
|
5
5
|
export type RendererKey = keyof RendererConfig;
|
|
6
6
|
export interface RichRendererModule {
|
|
7
7
|
lazyRenderers?: Partial<{
|
|
@@ -28,6 +28,7 @@ export interface RichEditorModule extends RichRendererModule {
|
|
|
28
28
|
plugins?: ReactNode;
|
|
29
29
|
}
|
|
30
30
|
export interface ComposeRendererOptions {
|
|
31
|
+
blockAnchor?: BlockAnchorRenderer;
|
|
31
32
|
builtinNodeOverrides?: Record<string, BuiltinNodeRenderer>;
|
|
32
33
|
modules?: RichRendererModule[];
|
|
33
34
|
overrides?: Partial<RendererConfig>;
|
|
@@ -39,7 +40,7 @@ export interface ComposeEditorOptions {
|
|
|
39
40
|
preset?: RichEditorModule[];
|
|
40
41
|
}
|
|
41
42
|
export interface RichRendererBaseProps {
|
|
42
|
-
as?:
|
|
43
|
+
as?: ElementType;
|
|
43
44
|
className?: string;
|
|
44
45
|
nested?: boolean;
|
|
45
46
|
style?: CSSProperties;
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElF,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEzF,MAAM,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC;AAE/C,MAAM,WAAW,kBAAkB;IACjC,aAAa,CAAC,EAAE,OAAO,CAAC;SACrB,CAAC,IAAI,WAAW,GAAG,MAAM,OAAO,CAAC;YAAE,OAAO,EAAE,WAAW,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;SAAE,CAAC;KAC/E,CAAC,CAAC;IACH,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;CACvD;AAED,MAAM,WAAW,gBAAiB,SAAQ,kBAAkB;IAC1D,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC;IACjC,cAAc,CAAC,EAAE,aAAa,CAAC;QAAE,QAAQ,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACxD,aAAa,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACxC,mBAAmB,CAAC,EAAE,SAAS,CAAC;IAChC,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC3D,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAC/B,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,kBAAkB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,qBAAqB;IACpC,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACzB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
|
package/dist/core-entry.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { composeRenderer } from './core/compose';
|
|
|
2
2
|
export { dedupNodes, mergeModules } from './core/dedup';
|
|
3
3
|
export { wrapLazy } from './core/lazy';
|
|
4
4
|
export type { ComposeRendererOptions, RendererKey, RichRendererBaseProps, RichRendererModule, } from './core/types';
|
|
5
|
-
export type { BuiltinNodeRenderer, RichRendererProps } from './static-renderer';
|
|
5
|
+
export type { BlockAnchorRenderer, BuiltinNodeRenderer, RichRendererProps, } from './static-renderer';
|
|
6
6
|
export { RichRenderer } from './static-renderer';
|
|
7
7
|
//# sourceMappingURL=core-entry.d.ts.map
|
package/dist/core-entry.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-entry.d.ts","sourceRoot":"","sources":["../src/core-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EACV,sBAAsB,EACtB,WAAW,EACX,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,
|
|
1
|
+
{"version":3,"file":"core-entry.d.ts","sourceRoot":"","sources":["../src/core-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,YAAY,EACV,sBAAsB,EACtB,WAAW,EACX,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/core.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as RichRenderer, i as mergeModules, n as wrapLazy, r as dedupNodes, t as composeRenderer } from "./compose-
|
|
1
|
+
import { a as RichRenderer, i as mergeModules, n as wrapLazy, r as dedupNodes, t as composeRenderer } from "./compose-7SEahaEz.js";
|
|
2
2
|
export { RichRenderer, composeRenderer, dedupNodes, mergeModules, wrapLazy };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ComposeEditorOptions, ComposeRendererOptions, ConfigurableModule, DefineConfigurableModuleResult, RendererKey, RichEditorModule, RichRendererBaseProps, RichRendererModule, } from './core';
|
|
2
2
|
export { composeEditor, composeRenderer, dedupNodes, defineConfigurableModule, mergeModules, wrapLazy, } from './core';
|
|
3
3
|
export type { ImageClickPayload, ImageModuleConfig, OnImageClick, RichImageInfo, } from './modules/image/types';
|
|
4
|
-
export type { BuiltinNodeRenderer, RichRendererProps } from './static-renderer';
|
|
4
|
+
export type { BlockAnchorRenderer, BuiltinNodeRenderer, RichRendererProps, } from './static-renderer';
|
|
5
5
|
export { RichRenderer } from './static-renderer';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,8BAA8B,EAC9B,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,wBAAwB,EACxB,YAAY,EACZ,QAAQ,GACT,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,oBAAoB,EACpB,sBAAsB,EACtB,kBAAkB,EAClB,8BAA8B,EAC9B,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,aAAa,EACb,eAAe,EACf,UAAU,EACV,wBAAwB,EACxB,YAAY,EACZ,QAAQ,GACT,MAAM,QAAQ,CAAC;AAChB,YAAY,EACV,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,aAAa,GACd,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as RichRenderer, i as mergeModules, n as wrapLazy, r as dedupNodes, t as composeRenderer } from "./compose-
|
|
1
|
+
import { a as RichRenderer, i as mergeModules, n as wrapLazy, r as dedupNodes, t as composeRenderer } from "./compose-7SEahaEz.js";
|
|
2
2
|
import { t as defineConfigurableModule } from "./configurable-module-Bur4JaI3.js";
|
|
3
3
|
import { Fragment, memo, useCallback, useMemo } from "react";
|
|
4
4
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -32618,8 +32618,7 @@
|
|
|
32618
32618
|
return decoration;
|
|
32619
32619
|
}
|
|
32620
32620
|
}
|
|
32621
|
-
function
|
|
32622
|
-
if (!blockId) return element;
|
|
32621
|
+
function domBlockAnchor(element, blockId, nodeKey) {
|
|
32623
32622
|
if ((0, import_react$182.isValidElement)(element) && typeof element.type === "string") return (0, import_react$182.cloneElement)(element, { "data-block-id": blockId });
|
|
32624
32623
|
return /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)("div", {
|
|
32625
32624
|
className: "rich-block-anchor",
|
|
@@ -32627,27 +32626,43 @@
|
|
|
32627
32626
|
children: element
|
|
32628
32627
|
}, `${nodeKey}-block-anchor`);
|
|
32629
32628
|
}
|
|
32630
|
-
function
|
|
32629
|
+
function applyBlockId(element, blockId, nodeKey, options) {
|
|
32630
|
+
if (!blockId) return element;
|
|
32631
|
+
return (options.blockAnchor ?? domBlockAnchor)(element, blockId, nodeKey);
|
|
32632
|
+
}
|
|
32633
|
+
function renderTree(node, editor, editorConfig, headingSlugs, key, blockId, options) {
|
|
32631
32634
|
const nodeKey = node.getKey ? node.getKey() : key;
|
|
32632
|
-
|
|
32633
|
-
|
|
32634
|
-
|
|
32635
|
-
|
|
32635
|
+
const { builtinNodeOverrides } = options;
|
|
32636
|
+
if (typeof node.decorate === "function") {
|
|
32637
|
+
let decoration = null;
|
|
32638
|
+
try {
|
|
32639
|
+
decoration = node.decorate(editor, editorConfig);
|
|
32640
|
+
} catch {}
|
|
32641
|
+
if (decoration != null) {
|
|
32642
|
+
const serialized = node.exportJSON ? node.exportJSON() : {};
|
|
32643
|
+
const override = builtinNodeOverrides?.[serialized.type];
|
|
32644
|
+
return applyBlockId(override ? override(serialized, nodeKey, [decoration], () => wrapDecoration(serialized, nodeKey, decoration)) : wrapDecoration(serialized, nodeKey, decoration), blockId, nodeKey, options);
|
|
32645
|
+
}
|
|
32646
|
+
}
|
|
32636
32647
|
const serialized = node.exportJSON ? node.exportJSON() : {};
|
|
32637
|
-
if (serialized.type === "text")
|
|
32648
|
+
if (serialized.type === "text") {
|
|
32649
|
+
const override = builtinNodeOverrides?.text;
|
|
32650
|
+
if (override) return override(serialized, nodeKey, null, () => renderTextNode(serialized, nodeKey));
|
|
32651
|
+
return renderTextNode(serialized, nodeKey);
|
|
32652
|
+
}
|
|
32638
32653
|
const childNodes = typeof node.getChildren === "function" ? node.getChildren() : [];
|
|
32639
32654
|
if (Array.isArray(serialized.children) && serialized.children.length === 0 && childNodes.length > 0) serialized.children = childNodes.map((c) => ({ type: typeof c.getType === "function" ? c.getType() : c.__type }));
|
|
32640
32655
|
let children = null;
|
|
32641
|
-
if (childNodes.length > 0) children = childNodes.map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `${nodeKey}-${i}`, void 0,
|
|
32656
|
+
if (childNodes.length > 0) children = childNodes.map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `${nodeKey}-${i}`, void 0, options));
|
|
32642
32657
|
const textContent = node.getTextContent ? node.getTextContent() : void 0;
|
|
32643
32658
|
const override = builtinNodeOverrides?.[serialized.type];
|
|
32644
32659
|
if (override) {
|
|
32645
32660
|
const defaultRenderer = () => renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent);
|
|
32646
|
-
return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey);
|
|
32661
|
+
return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey, options);
|
|
32647
32662
|
}
|
|
32648
|
-
return applyBlockId(renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent), blockId, nodeKey);
|
|
32663
|
+
return applyBlockId(renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent), blockId, nodeKey, options);
|
|
32649
32664
|
}
|
|
32650
|
-
function renderEditorToReact(value, nodes,
|
|
32665
|
+
function renderEditorToReact(value, nodes, options) {
|
|
32651
32666
|
const editor = t$42({
|
|
32652
32667
|
nodes,
|
|
32653
32668
|
theme: editorTheme,
|
|
@@ -32669,7 +32684,7 @@
|
|
|
32669
32684
|
editorState.read(() => {
|
|
32670
32685
|
const root = nl$1();
|
|
32671
32686
|
const headingSlugs = /* @__PURE__ */ new Map();
|
|
32672
|
-
const children = root.getChildren().map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `ssr-${i}`, rawRootChildren?.[i]?.$?.blockId,
|
|
32687
|
+
const children = root.getChildren().map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `ssr-${i}`, rawRootChildren?.[i]?.$?.blockId, options));
|
|
32673
32688
|
content = /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(import_jsx_runtime$222.Fragment, { children });
|
|
32674
32689
|
});
|
|
32675
32690
|
const renderNestedContent = (state) => {
|
|
@@ -32693,7 +32708,7 @@
|
|
|
32693
32708
|
nestedState.read(() => {
|
|
32694
32709
|
const root = nl$1();
|
|
32695
32710
|
const headingSlugs = /* @__PURE__ */ new Map();
|
|
32696
|
-
const ch = root.getChildren().map((child, i) => renderTree(child, nestedEditor, nestedEditorConfig, headingSlugs, `nested-${i}`, nestedRawChildren?.[i]?.$?.blockId,
|
|
32711
|
+
const ch = root.getChildren().map((child, i) => renderTree(child, nestedEditor, nestedEditorConfig, headingSlugs, `nested-${i}`, nestedRawChildren?.[i]?.$?.blockId, options));
|
|
32697
32712
|
nested = /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(import_jsx_runtime$222.Fragment, { children: ch });
|
|
32698
32713
|
});
|
|
32699
32714
|
return nested;
|
|
@@ -32704,12 +32719,16 @@
|
|
|
32704
32719
|
renderNestedContent
|
|
32705
32720
|
};
|
|
32706
32721
|
}
|
|
32707
|
-
function RichRenderer({ value, variant = "article", theme = "light", className, style, as: Component = "div", nested = false, rendererConfig, extraNodes, builtinNodeOverrides }) {
|
|
32722
|
+
function RichRenderer({ value, variant = "article", theme = "light", className, style, as: Component = "div", nested = false, rendererConfig, extraNodes, builtinNodeOverrides, blockAnchor }) {
|
|
32708
32723
|
const variantClass = getVariantClass(variant);
|
|
32709
32724
|
const outerRenderNestedContent = useOptionalNestedContentRenderer();
|
|
32710
32725
|
const { content, footnoteData, renderNestedContent } = (0, import_react$182.useMemo)(() => {
|
|
32711
|
-
return renderEditorToReact(value, extraNodes ? [...allNodes, ...extraNodes] : allNodes,
|
|
32726
|
+
return renderEditorToReact(value, extraNodes ? [...allNodes, ...extraNodes] : allNodes, {
|
|
32727
|
+
blockAnchor,
|
|
32728
|
+
builtinNodeOverrides
|
|
32729
|
+
});
|
|
32712
32730
|
}, [
|
|
32731
|
+
blockAnchor,
|
|
32713
32732
|
builtinNodeOverrides,
|
|
32714
32733
|
extraNodes,
|
|
32715
32734
|
value
|
|
@@ -32719,6 +32738,12 @@
|
|
|
32719
32738
|
variantClass,
|
|
32720
32739
|
className
|
|
32721
32740
|
].filter(Boolean).join(" ");
|
|
32741
|
+
const hostProps = typeof Component === "string" ? {
|
|
32742
|
+
"suppressHydrationWarning": true,
|
|
32743
|
+
"className": classes,
|
|
32744
|
+
"data-rich-nested": nested ? "true" : void 0,
|
|
32745
|
+
"data-theme": theme
|
|
32746
|
+
} : {};
|
|
32722
32747
|
return /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(PortalThemeProvider, {
|
|
32723
32748
|
className: variantClass,
|
|
32724
32749
|
theme,
|
|
@@ -32734,10 +32759,7 @@
|
|
|
32734
32759
|
children: /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(NestedContentRendererProvider, {
|
|
32735
32760
|
value: outerRenderNestedContent ?? renderNestedContent,
|
|
32736
32761
|
children: /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(Component, {
|
|
32737
|
-
|
|
32738
|
-
className: classes,
|
|
32739
|
-
"data-rich-nested": nested ? "true" : void 0,
|
|
32740
|
-
"data-theme": theme,
|
|
32762
|
+
...hostProps,
|
|
32741
32763
|
style,
|
|
32742
32764
|
children: content
|
|
32743
32765
|
})
|
|
@@ -32878,6 +32900,7 @@
|
|
|
32878
32900
|
};
|
|
32879
32901
|
const ComposedProviders = composeProviders(merged);
|
|
32880
32902
|
const builtinNodeOverrides = opts.builtinNodeOverrides;
|
|
32903
|
+
const blockAnchor = opts.blockAnchor;
|
|
32881
32904
|
function ComposedRenderer(props) {
|
|
32882
32905
|
const { theme, variant } = props;
|
|
32883
32906
|
const renderNested = (0, import_react$182.useCallback)((value, overrideVariant) => /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(ComposedRenderer, {
|
|
@@ -32890,6 +32913,7 @@
|
|
|
32890
32913
|
value: renderNested,
|
|
32891
32914
|
children: /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(ComposedProviders, { children: /* @__PURE__ */ (0, import_jsx_runtime$222.jsx)(RichRenderer, {
|
|
32892
32915
|
as: props.as,
|
|
32916
|
+
blockAnchor,
|
|
32893
32917
|
builtinNodeOverrides,
|
|
32894
32918
|
className: props.className,
|
|
32895
32919
|
extraNodes: allNodes,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RichRendererProps } from './types';
|
|
2
|
-
export declare function RichRenderer({ value, variant, theme, className, style, as: Component, nested, rendererConfig, extraNodes, builtinNodeOverrides, }: RichRendererProps): import("react").JSX.Element;
|
|
2
|
+
export declare function RichRenderer({ value, variant, theme, className, style, as: Component, nested, rendererConfig, extraNodes, builtinNodeOverrides, blockAnchor, }: RichRendererProps): import("react").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=RichRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichRenderer.d.ts","sourceRoot":"","sources":["../../src/static-renderer/RichRenderer.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"RichRenderer.d.ts","sourceRoot":"","sources":["../../src/static-renderer/RichRenderer.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAA4C,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAwP3F,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAmB,EACnB,KAAe,EACf,SAAS,EACT,KAAK,EACL,EAAE,EAAE,SAAiB,EACrB,MAAc,EACd,cAAc,EACd,UAAU,EACV,oBAAoB,EACpB,WAAW,GACZ,EAAE,iBAAiB,+BAuCnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/static-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/static-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { ColorScheme, RendererConfig, RichEditorVariant } from '@haklex/rich-editor/static';
|
|
2
2
|
import { Klass, LexicalNode, SerializedEditorState } from 'lexical';
|
|
3
|
-
import { CSSProperties, ReactNode } from 'react';
|
|
3
|
+
import { CSSProperties, ElementType, ReactNode } from 'react';
|
|
4
4
|
export type BuiltinNodeRenderer = (node: any, key: string, children: ReactNode[] | null, defaultRenderer: () => ReactNode) => ReactNode;
|
|
5
|
+
export type BlockAnchorRenderer = (element: ReactNode, blockId: string, nodeKey: string) => ReactNode;
|
|
5
6
|
export interface RichRendererProps {
|
|
6
|
-
as?:
|
|
7
|
+
as?: ElementType;
|
|
8
|
+
blockAnchor?: BlockAnchorRenderer;
|
|
7
9
|
builtinNodeOverrides?: Record<string, BuiltinNodeRenderer>;
|
|
8
10
|
className?: string;
|
|
9
11
|
extraNodes?: Array<Klass<LexicalNode>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/static-renderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/static-renderer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnE,MAAM,MAAM,mBAAmB,GAAG,CAChC,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5B,eAAe,EAAE,MAAM,SAAS,KAC7B,SAAS,CAAC;AAEf,MAAM,MAAM,mBAAmB,GAAG,CAChC,OAAO,EAAE,SAAS,EAClB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,KACZ,SAAS,CAAC;AAEf,MAAM,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,WAAW,CAAC,EAAE,mBAAmB,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IACvC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-compose",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0",
|
|
4
4
|
"description": "Compose primitives for haklex rich content renderers — Gundam-style assembly of Lexical nodes, sync/lazy renderers, and Provider stacks.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -293,28 +293,28 @@
|
|
|
293
293
|
],
|
|
294
294
|
"dependencies": {
|
|
295
295
|
"@lexical/headless": "^0.49.0",
|
|
296
|
-
"@haklex/rich-ext-
|
|
297
|
-
"@haklex/rich-ext-code-snippet": "0.
|
|
298
|
-
"@haklex/rich-ext-
|
|
299
|
-
"@haklex/rich-ext-excalidraw": "0.
|
|
300
|
-
"@haklex/rich-ext-
|
|
301
|
-
"@haklex/rich-ext-gallery": "0.
|
|
302
|
-
"@haklex/rich-
|
|
303
|
-
"@haklex/rich-
|
|
304
|
-
"@haklex/rich-
|
|
305
|
-
"@haklex/rich-
|
|
306
|
-
"@haklex/rich-renderer-
|
|
307
|
-
"@haklex/rich-renderer-
|
|
308
|
-
"@haklex/rich-
|
|
309
|
-
"@haklex/rich-renderer-
|
|
310
|
-
"@haklex/rich-renderer-
|
|
311
|
-
"@haklex/rich-renderer-
|
|
312
|
-
"@haklex/rich-renderer-
|
|
313
|
-
"@haklex/rich-renderer-
|
|
314
|
-
"@haklex/rich-renderer-
|
|
315
|
-
"@haklex/rich-renderer-
|
|
316
|
-
"@haklex/rich-
|
|
317
|
-
"@haklex/rich-
|
|
296
|
+
"@haklex/rich-ext-chat": "0.40.0",
|
|
297
|
+
"@haklex/rich-ext-code-snippet": "0.40.0",
|
|
298
|
+
"@haklex/rich-ext-nested-doc": "0.40.0",
|
|
299
|
+
"@haklex/rich-ext-excalidraw": "0.40.0",
|
|
300
|
+
"@haklex/rich-ext-dynamic": "0.40.0",
|
|
301
|
+
"@haklex/rich-ext-gallery": "0.40.0",
|
|
302
|
+
"@haklex/rich-ext-embed": "0.40.0",
|
|
303
|
+
"@haklex/rich-litexml": "0.40.0",
|
|
304
|
+
"@haklex/rich-ext-poll": "0.40.0",
|
|
305
|
+
"@haklex/rich-plugin-slash-menu": "0.40.0",
|
|
306
|
+
"@haklex/rich-renderer-alert": "0.40.0",
|
|
307
|
+
"@haklex/rich-renderer-codeblock": "0.40.0",
|
|
308
|
+
"@haklex/rich-renderer-banner": "0.40.0",
|
|
309
|
+
"@haklex/rich-renderer-image": "0.40.0",
|
|
310
|
+
"@haklex/rich-renderer-mermaid": "0.40.0",
|
|
311
|
+
"@haklex/rich-renderer-file": "0.40.0",
|
|
312
|
+
"@haklex/rich-renderer-video": "0.40.0",
|
|
313
|
+
"@haklex/rich-renderer-katex": "0.40.0",
|
|
314
|
+
"@haklex/rich-renderer-linkcard": "0.40.0",
|
|
315
|
+
"@haklex/rich-renderer-ruby": "0.40.0",
|
|
316
|
+
"@haklex/rich-renderer-mention": "0.40.0",
|
|
317
|
+
"@haklex/rich-style-token": "0.40.0"
|
|
318
318
|
},
|
|
319
319
|
"devDependencies": {
|
|
320
320
|
"@lexical/react": "^0.49.0",
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
"unplugin-dts": "^1.0.3",
|
|
331
331
|
"vite": "^8.2.2",
|
|
332
332
|
"vitest": "^4.1.11",
|
|
333
|
-
"@haklex/rich-editor": "0.
|
|
333
|
+
"@haklex/rich-editor": "0.40.0"
|
|
334
334
|
},
|
|
335
335
|
"peerDependencies": {
|
|
336
336
|
"@lexical/react": "^0.49.0",
|
|
@@ -338,7 +338,7 @@
|
|
|
338
338
|
"lucide-react": "^1.0.0",
|
|
339
339
|
"react": ">=19",
|
|
340
340
|
"react-dom": ">=19",
|
|
341
|
-
"@haklex/rich-editor": "^0.
|
|
341
|
+
"@haklex/rich-editor": "^0.40.0"
|
|
342
342
|
},
|
|
343
343
|
"publishConfig": {
|
|
344
344
|
"access": "public"
|