@haklex/rich-compose 0.7.0 → 0.9.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 +127 -75
- package/dist/core/compose-editor.d.ts +5 -0
- package/dist/core/compose-editor.d.ts.map +1 -0
- package/dist/core/dedup.d.ts +5 -4
- package/dist/core/dedup.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/types.d.ts +14 -27
- package/dist/core/types.d.ts.map +1 -1
- package/dist/editor.d.ts +20 -0
- package/dist/editor.d.ts.map +1 -0
- package/dist/editor.mjs +39 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +104 -14
- package/dist/module-7OFwgDvr.js +8 -0
- package/dist/module-B-aCJYWf.js +8 -0
- package/dist/module-B-j9xcYZ.js +29 -0
- package/dist/module-BEeJOlCj.js +8 -0
- package/dist/module-BNXS9cXW.js +8 -0
- package/dist/module-BdF2K0Q_.js +8 -0
- package/dist/module-BgRES6Iz.js +8 -0
- package/dist/module-Bzx-kcbg.js +8 -0
- package/dist/module-CG73r8KF.js +9 -0
- package/dist/module-CoX2HXw7.js +26 -0
- package/dist/module-CzzVTOfw.js +9 -0
- package/dist/module-DO20vUA2.js +9 -0
- package/dist/module-DTPNIUqA.js +9 -0
- package/dist/module-D_1K8V59.js +8 -0
- package/dist/module-DmFLjjSK.js +8 -0
- package/dist/module-LSK-rHcR.js +8 -0
- package/dist/modules/alert/edit.d.ts +3 -0
- package/dist/modules/alert/edit.d.ts.map +1 -0
- package/dist/modules/alert/edit.mjs +9 -0
- package/dist/modules/alert/index.d.ts.map +1 -1
- package/dist/modules/alert/index.mjs +1 -8
- package/dist/modules/banner/edit.d.ts +3 -0
- package/dist/modules/banner/edit.d.ts.map +1 -0
- package/dist/modules/banner/edit.mjs +9 -0
- package/dist/modules/banner/index.d.ts.map +1 -1
- package/dist/modules/banner/index.mjs +1 -8
- package/dist/modules/chat/edit.d.ts +3 -0
- package/dist/modules/chat/edit.d.ts.map +1 -0
- package/dist/modules/chat/edit.mjs +10 -0
- package/dist/modules/chat/index.d.ts.map +1 -1
- package/dist/modules/chat/index.mjs +1 -16
- package/dist/modules/chat/module.d.ts +0 -7
- package/dist/modules/chat/module.d.ts.map +1 -1
- package/dist/modules/code-block/edit.d.ts +3 -0
- package/dist/modules/code-block/edit.d.ts.map +1 -0
- package/dist/modules/code-block/edit.mjs +9 -0
- package/dist/modules/code-block/index.d.ts.map +1 -1
- package/dist/modules/code-block/index.mjs +1 -38
- package/dist/modules/code-block/module.d.ts +0 -9
- package/dist/modules/code-block/module.d.ts.map +1 -1
- package/dist/modules/code-snippet/edit.d.ts +3 -0
- package/dist/modules/code-snippet/edit.d.ts.map +1 -0
- package/dist/modules/code-snippet/edit.mjs +10 -0
- package/dist/modules/code-snippet/index.d.ts.map +1 -1
- package/dist/modules/code-snippet/index.mjs +1 -14
- package/dist/modules/code-snippet/module.d.ts +0 -5
- package/dist/modules/code-snippet/module.d.ts.map +1 -1
- package/dist/modules/embed/edit.d.ts +3 -0
- package/dist/modules/embed/edit.d.ts.map +1 -0
- package/dist/modules/embed/edit.mjs +9 -0
- package/dist/modules/embed/index.d.ts.map +1 -1
- package/dist/modules/embed/index.mjs +1 -16
- package/dist/modules/embed/module.d.ts +0 -8
- package/dist/modules/embed/module.d.ts.map +1 -1
- package/dist/modules/excalidraw/edit.d.ts +3 -0
- package/dist/modules/excalidraw/edit.d.ts.map +1 -0
- package/dist/modules/excalidraw/edit.mjs +12 -0
- package/dist/modules/excalidraw/index.d.ts.map +1 -1
- package/dist/modules/excalidraw/index.mjs +1 -16
- package/dist/modules/excalidraw/module.d.ts +0 -9
- package/dist/modules/excalidraw/module.d.ts.map +1 -1
- package/dist/modules/gallery/edit.d.ts +3 -0
- package/dist/modules/gallery/edit.d.ts.map +1 -0
- package/dist/modules/gallery/edit.mjs +10 -0
- package/dist/modules/gallery/index.d.ts.map +1 -1
- package/dist/modules/gallery/index.mjs +1 -14
- package/dist/modules/gallery/module.d.ts +0 -5
- package/dist/modules/gallery/module.d.ts.map +1 -1
- package/dist/modules/image/edit.d.ts +3 -0
- package/dist/modules/image/edit.d.ts.map +1 -0
- package/dist/modules/image/edit.mjs +9 -0
- package/dist/modules/image/index.d.ts.map +1 -1
- package/dist/modules/image/index.mjs +1 -8
- package/dist/modules/katex/edit.d.ts +3 -0
- package/dist/modules/katex/edit.d.ts.map +1 -0
- package/dist/modules/katex/edit.mjs +8 -0
- package/dist/modules/link-card/edit.d.ts +3 -0
- package/dist/modules/link-card/edit.d.ts.map +1 -0
- package/dist/modules/link-card/edit.mjs +11 -0
- package/dist/modules/link-card/index.d.ts.map +1 -1
- package/dist/modules/link-card/index.mjs +1 -14
- package/dist/modules/link-card/module.d.ts +0 -6
- package/dist/modules/link-card/module.d.ts.map +1 -1
- package/dist/modules/mention/edit.d.ts +3 -0
- package/dist/modules/mention/edit.d.ts.map +1 -0
- package/dist/modules/mention/edit.mjs +9 -0
- package/dist/modules/mention/index.d.ts.map +1 -1
- package/dist/modules/mention/index.mjs +2 -8
- package/dist/modules/mermaid/edit.d.ts +3 -0
- package/dist/modules/mermaid/edit.d.ts.map +1 -0
- package/dist/modules/mermaid/edit.mjs +9 -0
- package/dist/modules/mermaid/index.d.ts.map +1 -1
- package/dist/modules/mermaid/index.mjs +1 -32
- package/dist/modules/mermaid/module.d.ts +0 -6
- package/dist/modules/mermaid/module.d.ts.map +1 -1
- package/dist/modules/nested-doc/edit.d.ts +3 -0
- package/dist/modules/nested-doc/edit.d.ts.map +1 -0
- package/dist/modules/nested-doc/edit.mjs +9 -0
- package/dist/modules/nested-doc/index.d.ts.map +1 -1
- package/dist/modules/nested-doc/index.mjs +1 -14
- package/dist/modules/nested-doc/module.d.ts +0 -7
- package/dist/modules/nested-doc/module.d.ts.map +1 -1
- package/dist/modules/poll/edit.d.ts +3 -0
- package/dist/modules/poll/edit.d.ts.map +1 -0
- package/dist/modules/poll/edit.mjs +9 -0
- package/dist/modules/poll/index.d.ts.map +1 -1
- package/dist/modules/poll/index.mjs +1 -18
- package/dist/modules/poll/module.d.ts +0 -9
- package/dist/modules/poll/module.d.ts.map +1 -1
- package/dist/modules/ruby/edit.d.ts +3 -0
- package/dist/modules/ruby/edit.d.ts.map +1 -0
- package/dist/modules/ruby/edit.mjs +9 -0
- package/dist/modules/ruby/index.d.ts.map +1 -1
- package/dist/modules/ruby/index.mjs +1 -8
- package/dist/modules/video/edit.d.ts +3 -0
- package/dist/modules/video/edit.d.ts.map +1 -0
- package/dist/modules/video/edit.mjs +9 -0
- package/dist/modules/video/index.d.ts.map +1 -1
- package/dist/modules/video/index.mjs +1 -8
- package/dist/renderer.d.ts +19 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.mjs +53 -0
- package/dist/style/alert.css +2 -0
- package/dist/style/banner.css +2 -0
- package/dist/style/chat.css +2 -0
- package/dist/style/code-block.css +2 -0
- package/dist/style/code-snippet.css +2 -0
- package/dist/style/embed.css +2 -0
- package/dist/style/excalidraw.css +2 -0
- package/dist/style/foundation.css +9 -0
- package/dist/style/gallery.css +2 -0
- package/dist/style/image.css +2 -0
- package/dist/style/katex.css +2 -0
- package/dist/style/link-card.css +2 -0
- package/dist/style/mention.css +2 -0
- package/dist/style/mermaid.css +2 -0
- package/dist/style/nested-doc.css +2 -0
- package/dist/style/poll.css +2 -0
- package/dist/{rich-compose.css → style/ruby.css} +1 -1
- package/dist/style/table.css +11 -0
- package/dist/style/video.css +2 -0
- package/dist/style.css +92 -0
- package/package.json +100 -23
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NestedContentRendererProvider } from "@haklex/rich-editor";
|
|
1
|
+
import { NestedContentRendererProvider, RichEditor } from "@haklex/rich-editor";
|
|
2
2
|
import { Fragment, Suspense, cloneElement, createElement, isValidElement, lazy, memo, useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { ColorSchemeProvider, FootnoteDefinitionsProvider, LinkFavicon, NestedContentRendererProvider as NestedContentRendererProvider$1, RendererConfigProvider, RendererWrapper, RubyRenderer, allNodes, detailsClassNames, detailsStyles, editorTheme, getTagBgColor, getVariantClass, gridClassNames, gridStyles, normalizeSerializedEditorState, semanticClassNames, sharedStyles, useOptionalNestedContentRenderer } from "@haklex/rich-editor/static";
|
|
4
4
|
import { PortalThemeProvider } from "@haklex/rich-style-token";
|
|
@@ -454,9 +454,10 @@ function mergeModules(preset, modules) {
|
|
|
454
454
|
return result;
|
|
455
455
|
}
|
|
456
456
|
/**
|
|
457
|
-
* Dedup by class reference.
|
|
458
|
-
*
|
|
459
|
-
*
|
|
457
|
+
* Dedup by class reference. When two Klasses share the same `getType()`,
|
|
458
|
+
* a subclass relationship (edit Klass extends base Klass) auto-resolves:
|
|
459
|
+
* the subclass replaces its parent. Unrelated collisions throw — `instanceof`
|
|
460
|
+
* would break across module boundaries.
|
|
460
461
|
*/
|
|
461
462
|
function dedupNodes(nodes) {
|
|
462
463
|
const seen = /* @__PURE__ */ new Set();
|
|
@@ -466,12 +467,24 @@ function dedupNodes(nodes) {
|
|
|
466
467
|
if (seen.has(Node)) continue;
|
|
467
468
|
seen.add(Node);
|
|
468
469
|
const type = typeof Node.getType === "function" ? Node.getType() : void 0;
|
|
469
|
-
if (type
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
if (type === void 0) {
|
|
471
|
+
result.push(Node);
|
|
472
|
+
continue;
|
|
473
|
+
}
|
|
474
|
+
const prevIdx = byType.get(type);
|
|
475
|
+
if (prevIdx === void 0) {
|
|
476
|
+
byType.set(type, result.length);
|
|
477
|
+
result.push(Node);
|
|
478
|
+
continue;
|
|
473
479
|
}
|
|
474
|
-
result
|
|
480
|
+
const prev = result[prevIdx];
|
|
481
|
+
if (Node === prev) continue;
|
|
482
|
+
if (Node.prototype instanceof prev) {
|
|
483
|
+
result[prevIdx] = Node;
|
|
484
|
+
continue;
|
|
485
|
+
}
|
|
486
|
+
if (prev.prototype instanceof Node) continue;
|
|
487
|
+
throw new Error(`[rich-compose] node type collision on "${type}": two distinct Klass references registered. This breaks \`instanceof\` checks. Ensure peerDeps/lexical version are pinned and a single module exports each type.`);
|
|
475
488
|
}
|
|
476
489
|
return result;
|
|
477
490
|
}
|
|
@@ -508,7 +521,7 @@ function wrapLazy(modules) {
|
|
|
508
521
|
function flattenNodes(modules) {
|
|
509
522
|
return dedupNodes(modules.flatMap((m) => m.nodes ?? []));
|
|
510
523
|
}
|
|
511
|
-
function mergeSyncRenderers(modules) {
|
|
524
|
+
function mergeSyncRenderers$1(modules) {
|
|
512
525
|
const out = {};
|
|
513
526
|
for (const m of modules) {
|
|
514
527
|
if (!m.renderers) continue;
|
|
@@ -516,7 +529,7 @@ function mergeSyncRenderers(modules) {
|
|
|
516
529
|
}
|
|
517
530
|
return out;
|
|
518
531
|
}
|
|
519
|
-
function composeProviders(modules) {
|
|
532
|
+
function composeProviders$1(modules) {
|
|
520
533
|
const providers = modules.map((m) => m.Provider).filter((P) => Boolean(P));
|
|
521
534
|
if (providers.length === 0) return Fragment;
|
|
522
535
|
const ComposedProviders = ({ children }) => {
|
|
@@ -533,14 +546,14 @@ function composeProviders(modules) {
|
|
|
533
546
|
function composeRenderer(opts) {
|
|
534
547
|
const merged = mergeModules(opts.preset, opts.modules);
|
|
535
548
|
const allNodes = flattenNodes(merged);
|
|
536
|
-
const syncMap = mergeSyncRenderers(merged);
|
|
549
|
+
const syncMap = mergeSyncRenderers$1(merged);
|
|
537
550
|
const lazyMap = wrapLazy(merged);
|
|
538
551
|
const finalConfig = {
|
|
539
552
|
...syncMap,
|
|
540
553
|
...lazyMap,
|
|
541
554
|
...opts.overrides
|
|
542
555
|
};
|
|
543
|
-
const ComposedProviders = composeProviders(merged);
|
|
556
|
+
const ComposedProviders = composeProviders$1(merged);
|
|
544
557
|
const builtinNodeOverrides = opts.builtinNodeOverrides;
|
|
545
558
|
function ComposedRenderer(props) {
|
|
546
559
|
const { theme, variant } = props;
|
|
@@ -568,4 +581,81 @@ function composeRenderer(opts) {
|
|
|
568
581
|
return memo(ComposedRenderer);
|
|
569
582
|
}
|
|
570
583
|
//#endregion
|
|
571
|
-
|
|
584
|
+
//#region src/core/compose-editor.tsx
|
|
585
|
+
function mergeSyncRenderers(modules) {
|
|
586
|
+
const out = {};
|
|
587
|
+
for (const m of modules) if (m.renderers) Object.assign(out, m.renderers);
|
|
588
|
+
return out;
|
|
589
|
+
}
|
|
590
|
+
function mergeEditRenderers(modules) {
|
|
591
|
+
const out = {};
|
|
592
|
+
for (const m of modules) if (m.editRenderers) Object.assign(out, m.editRenderers);
|
|
593
|
+
return out;
|
|
594
|
+
}
|
|
595
|
+
function composeProviders(modules, key) {
|
|
596
|
+
const providers = modules.map((m) => m[key]).filter((P) => Boolean(P));
|
|
597
|
+
if (providers.length === 0) return Fragment;
|
|
598
|
+
const Composed = ({ children }) => {
|
|
599
|
+
let acc = children;
|
|
600
|
+
for (let i = providers.length - 1; i >= 0; i--) {
|
|
601
|
+
const P = providers[i];
|
|
602
|
+
acc = /* @__PURE__ */ jsx(P, { children: acc });
|
|
603
|
+
}
|
|
604
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: acc });
|
|
605
|
+
};
|
|
606
|
+
Composed.displayName = key === "Provider" ? "ComposedProviders" : "ComposedEditorProviders";
|
|
607
|
+
return Composed;
|
|
608
|
+
}
|
|
609
|
+
function composeEditor(opts) {
|
|
610
|
+
const merged = mergeModules(opts.preset, opts.modules);
|
|
611
|
+
const baseNodes = merged.flatMap((m) => m.nodes ?? []);
|
|
612
|
+
const editNodes = merged.flatMap((m) => m.editNodes ?? []);
|
|
613
|
+
const allNodes = dedupNodes([...baseNodes, ...editNodes]);
|
|
614
|
+
const syncR = mergeSyncRenderers(merged);
|
|
615
|
+
const lazyR = wrapLazy(merged);
|
|
616
|
+
const editR = mergeEditRenderers(merged);
|
|
617
|
+
const finalConfig = {
|
|
618
|
+
...syncR,
|
|
619
|
+
...lazyR,
|
|
620
|
+
...editR,
|
|
621
|
+
...opts.overrides
|
|
622
|
+
};
|
|
623
|
+
const ComposedProviders = composeProviders(merged, "Provider");
|
|
624
|
+
const ComposedEditorProviders = composeProviders(merged, "EditorProvider");
|
|
625
|
+
const modulePlugins = [];
|
|
626
|
+
const moduleActions = [];
|
|
627
|
+
for (const m of merged) {
|
|
628
|
+
if (m.plugins) modulePlugins.push(/* @__PURE__ */ jsx(Fragment, { children: m.plugins }, `p:${m.name}`));
|
|
629
|
+
if (m.actions) moduleActions.push(/* @__PURE__ */ jsx(Fragment, { children: m.actions }, `a:${m.name}`));
|
|
630
|
+
}
|
|
631
|
+
const NestedRenderer = composeRenderer({
|
|
632
|
+
preset: opts.preset,
|
|
633
|
+
modules: opts.modules,
|
|
634
|
+
overrides: opts.overrides
|
|
635
|
+
});
|
|
636
|
+
function ComposedEditor(props) {
|
|
637
|
+
const { extraNodes: userExtraNodes, actions, children, theme, variant, ...rest } = props;
|
|
638
|
+
const mergedExtraNodes = useMemo(() => userExtraNodes ? dedupNodes([...allNodes, ...userExtraNodes]) : allNodes, [userExtraNodes]);
|
|
639
|
+
return /* @__PURE__ */ jsx(NestedContentRendererProvider, {
|
|
640
|
+
value: useCallback((value, overrideVariant) => /* @__PURE__ */ jsx(NestedRenderer, {
|
|
641
|
+
nested: true,
|
|
642
|
+
theme,
|
|
643
|
+
value,
|
|
644
|
+
variant: overrideVariant ?? variant
|
|
645
|
+
}), [theme, variant]),
|
|
646
|
+
children: /* @__PURE__ */ jsx(ComposedProviders, { children: /* @__PURE__ */ jsx(ComposedEditorProviders, { children: /* @__PURE__ */ jsxs(RichEditor, {
|
|
647
|
+
...rest,
|
|
648
|
+
extraNodes: mergedExtraNodes,
|
|
649
|
+
rendererConfig: finalConfig,
|
|
650
|
+
theme,
|
|
651
|
+
variant,
|
|
652
|
+
actions: /* @__PURE__ */ jsxs(Fragment$1, { children: [moduleActions, actions] }),
|
|
653
|
+
children: [modulePlugins, children]
|
|
654
|
+
}) }) })
|
|
655
|
+
});
|
|
656
|
+
}
|
|
657
|
+
ComposedEditor.displayName = "ComposedEditor";
|
|
658
|
+
return memo(ComposedEditor);
|
|
659
|
+
}
|
|
660
|
+
//#endregion
|
|
661
|
+
export { RichRenderer, composeEditor, composeRenderer, dedupNodes, mergeModules, wrapLazy };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/modules/code-block/ssr-fallback.tsx
|
|
3
|
+
/**
|
|
4
|
+
* SSR / Suspense fallback for the lazy CodeBlock renderer.
|
|
5
|
+
*
|
|
6
|
+
* Determinism requirement: identical output server-side and client-side
|
|
7
|
+
* to avoid hydration mismatches. No Date, no random, no client-only API.
|
|
8
|
+
*
|
|
9
|
+
* Renders a placeholder `<pre>` shell. The lazy renderer replaces it with
|
|
10
|
+
* shiki-tokenized output once the chunk resolves. Even without code text
|
|
11
|
+
* (the fallback runs before props are routed through the lazy boundary),
|
|
12
|
+
* the empty pre keeps layout stable.
|
|
13
|
+
*/
|
|
14
|
+
function CodeBlockSsrFallback() {
|
|
15
|
+
return /* @__PURE__ */ jsx("pre", {
|
|
16
|
+
className: "rich-codeblock-skeleton",
|
|
17
|
+
"data-rich-skeleton": "codeblock",
|
|
18
|
+
children: /* @__PURE__ */ jsx("code", {})
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/modules/code-block/module.tsx
|
|
23
|
+
var codeBlockModule = {
|
|
24
|
+
name: "code-block",
|
|
25
|
+
lazyRenderers: { CodeBlock: () => import("./modules/code-block/renderer.mjs") },
|
|
26
|
+
ssrFallback: { CodeBlock: /* @__PURE__ */ jsx(CodeBlockSsrFallback, {}) }
|
|
27
|
+
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { codeBlockModule as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { pollNodes } from "@haklex/rich-ext-poll/node";
|
|
2
|
+
//#region src/modules/poll/module.ts
|
|
3
|
+
var pollModule = {
|
|
4
|
+
name: "poll",
|
|
5
|
+
nodes: pollNodes,
|
|
6
|
+
lazyRenderers: { Poll: () => import("@haklex/rich-ext-poll/renderer") }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { pollModule as t };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
//#region src/modules/mermaid/ssr-fallback.tsx
|
|
3
|
+
/**
|
|
4
|
+
* SSR / Suspense fallback for the lazy Mermaid renderer.
|
|
5
|
+
*
|
|
6
|
+
* Determinism requirement: identical output server-side and client-side
|
|
7
|
+
* to avoid hydration mismatches. No Date, no random, no client-only API.
|
|
8
|
+
*
|
|
9
|
+
* Renders an empty placeholder shell sized via CSS so layout stays stable
|
|
10
|
+
* before mermaid's heavy chunk resolves and replaces it.
|
|
11
|
+
*/
|
|
12
|
+
function MermaidSsrFallback() {
|
|
13
|
+
return /* @__PURE__ */ jsx("div", {
|
|
14
|
+
className: "rich-mermaid-skeleton",
|
|
15
|
+
"data-rich-skeleton": "mermaid"
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/modules/mermaid/module.tsx
|
|
20
|
+
var mermaidModule = {
|
|
21
|
+
name: "mermaid",
|
|
22
|
+
lazyRenderers: { Mermaid: () => import("./modules/mermaid/renderer.mjs") },
|
|
23
|
+
ssrFallback: { Mermaid: /* @__PURE__ */ jsx(MermaidSsrFallback, {}) }
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { mermaidModule as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { galleryNodes } from "@haklex/rich-ext-gallery/node";
|
|
2
|
+
//#region src/modules/gallery/module.ts
|
|
3
|
+
var galleryModule = {
|
|
4
|
+
name: "gallery",
|
|
5
|
+
nodes: galleryNodes,
|
|
6
|
+
lazyRenderers: { Gallery: () => import("@haklex/rich-ext-gallery/renderer") }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { galleryModule as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { codeSnippetNodes } from "@haklex/rich-ext-code-snippet/node";
|
|
2
|
+
//#region src/modules/code-snippet/module.ts
|
|
3
|
+
var codeSnippetModule = {
|
|
4
|
+
name: "code-snippet",
|
|
5
|
+
nodes: codeSnippetNodes,
|
|
6
|
+
lazyRenderers: { CodeSnippet: () => import("@haklex/rich-ext-code-snippet/renderer") }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { codeSnippetModule as t };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { chatNodes } from "@haklex/rich-ext-chat/node";
|
|
2
|
+
//#region src/modules/chat/module.ts
|
|
3
|
+
var chatModule = {
|
|
4
|
+
name: "chat",
|
|
5
|
+
nodes: chatNodes,
|
|
6
|
+
lazyRenderers: { Chat: () => import("@haklex/rich-ext-chat/renderer") }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { chatModule as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/modules/alert/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,eAAO,MAAM,eAAe,EAAE,gBAG7B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as alertModule } from "../../module-LSK-rHcR.js";
|
|
2
|
+
import { AlertEditRenderer } from "@haklex/rich-renderer-alert";
|
|
3
|
+
//#region src/modules/alert/edit.ts
|
|
4
|
+
var alertEditModule = {
|
|
5
|
+
...alertModule,
|
|
6
|
+
editRenderers: { Alert: AlertEditRenderer }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { alertEditModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/alert/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
+
import { t as alertModule } from "../../module-LSK-rHcR.js";
|
|
1
2
|
import { AlertRenderer } from "./renderer.mjs";
|
|
2
|
-
import "@haklex/rich-renderer-alert/style.css";
|
|
3
|
-
import { AlertRenderer as AlertRenderer$1 } from "@haklex/rich-renderer-alert/static";
|
|
4
|
-
//#region src/modules/alert/module.ts
|
|
5
|
-
var alertModule = {
|
|
6
|
-
name: "alert",
|
|
7
|
-
renderers: { Alert: AlertRenderer$1 }
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
3
|
export { AlertRenderer, alertModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/modules/banner/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,eAAO,MAAM,gBAAgB,EAAE,gBAG9B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as bannerModule } from "../../module-BNXS9cXW.js";
|
|
2
|
+
import { BannerEditRenderer } from "@haklex/rich-renderer-banner";
|
|
3
|
+
//#region src/modules/banner/edit.ts
|
|
4
|
+
var bannerEditModule = {
|
|
5
|
+
...bannerModule,
|
|
6
|
+
editRenderers: { Banner: BannerEditRenderer }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { bannerEditModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/banner/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/banner/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
+
import { t as bannerModule } from "../../module-BNXS9cXW.js";
|
|
1
2
|
import { BannerRenderer } from "./renderer.mjs";
|
|
2
|
-
import "@haklex/rich-renderer-banner/style.css";
|
|
3
|
-
import { BannerRenderer as BannerRenderer$1 } from "@haklex/rich-renderer-banner/static";
|
|
4
|
-
//#region src/modules/banner/module.ts
|
|
5
|
-
var bannerModule = {
|
|
6
|
-
name: "banner",
|
|
7
|
-
renderers: { Banner: BannerRenderer$1 }
|
|
8
|
-
};
|
|
9
|
-
//#endregion
|
|
10
3
|
export { BannerRenderer, bannerModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/modules/chat/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,eAAO,MAAM,cAAc,EAAE,gBAI5B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as chatModule } from "../../module-DTPNIUqA.js";
|
|
2
|
+
import { ChatEditRenderer, chatEditNodes } from "@haklex/rich-ext-chat/edit";
|
|
3
|
+
//#region src/modules/chat/edit.ts
|
|
4
|
+
var chatEditModule = {
|
|
5
|
+
...chatModule,
|
|
6
|
+
editNodes: chatEditNodes,
|
|
7
|
+
editRenderers: { Chat: ChatEditRenderer }
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { chatEditModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/chat/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,YAAY,EACV,WAAW,EACX,eAAe,EACf,mBAAmB,EACnB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,GACnB,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
+
import { t as chatModule } from "../../module-DTPNIUqA.js";
|
|
1
2
|
import { $createChatNode, $isChatNode, ChatNode, chatNodes } from "./node.mjs";
|
|
2
3
|
import { ChatRenderer } from "./renderer.mjs";
|
|
3
|
-
import "@haklex/rich-ext-chat/style.css";
|
|
4
|
-
import { chatNodes as chatNodes$1 } from "@haklex/rich-ext-chat/node";
|
|
5
|
-
//#region src/modules/chat/module.ts
|
|
6
|
-
/**
|
|
7
|
-
* Chat module — registers ChatNode (light) and lazy-loads ChatRenderer.
|
|
8
|
-
*
|
|
9
|
-
* Consumers can write a thin override module using `chatNodes` from
|
|
10
|
-
* `@haklex/rich-ext-chat/node` plus a custom `renderers: { Chat: ... }` to
|
|
11
|
-
* keep the default ChatRenderer chunk out of their bundle.
|
|
12
|
-
*/
|
|
13
|
-
var chatModule = {
|
|
14
|
-
name: "chat",
|
|
15
|
-
nodes: chatNodes$1,
|
|
16
|
-
lazyRenderers: { Chat: () => import("@haklex/rich-ext-chat/renderer") }
|
|
17
|
-
};
|
|
18
|
-
//#endregion
|
|
19
4
|
export { $createChatNode, $isChatNode, ChatNode, ChatRenderer, chatModule, chatNodes };
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import { RichRendererModule } from '../../core/types';
|
|
2
|
-
/**
|
|
3
|
-
* Chat module — registers ChatNode (light) and lazy-loads ChatRenderer.
|
|
4
|
-
*
|
|
5
|
-
* Consumers can write a thin override module using `chatNodes` from
|
|
6
|
-
* `@haklex/rich-ext-chat/node` plus a custom `renderers: { Chat: ... }` to
|
|
7
|
-
* keep the default ChatRenderer chunk out of their bundle.
|
|
8
|
-
*/
|
|
9
2
|
export declare const chatModule: RichRendererModule;
|
|
10
3
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/modules/chat/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/modules/chat/module.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,eAAO,MAAM,UAAU,EAAE,kBAMxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/modules/code-block/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,eAAO,MAAM,mBAAmB,EAAE,gBAGjC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { t as codeBlockModule } from "../../module-B-j9xcYZ.js";
|
|
2
|
+
import { CodeBlockEditRenderer } from "@haklex/rich-renderer-codeblock";
|
|
3
|
+
//#region src/modules/code-block/edit.ts
|
|
4
|
+
var codeBlockEditModule = {
|
|
5
|
+
...codeBlockModule,
|
|
6
|
+
editRenderers: { CodeBlock: CodeBlockEditRenderer }
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { codeBlockEditModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/code-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/code-block/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,40 +1,3 @@
|
|
|
1
|
+
import { t as codeBlockModule } from "../../module-B-j9xcYZ.js";
|
|
1
2
|
import { CodeBlockRenderer } from "./renderer.mjs";
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import "@haklex/rich-renderer-codeblock/style.css";
|
|
4
|
-
//#region src/modules/code-block/ssr-fallback.tsx
|
|
5
|
-
/**
|
|
6
|
-
* SSR / Suspense fallback for the lazy CodeBlock renderer.
|
|
7
|
-
*
|
|
8
|
-
* Determinism requirement: identical output server-side and client-side
|
|
9
|
-
* to avoid hydration mismatches. No Date, no random, no client-only API.
|
|
10
|
-
*
|
|
11
|
-
* Renders a placeholder `<pre>` shell. The lazy renderer replaces it with
|
|
12
|
-
* shiki-tokenized output once the chunk resolves. Even without code text
|
|
13
|
-
* (the fallback runs before props are routed through the lazy boundary),
|
|
14
|
-
* the empty pre keeps layout stable.
|
|
15
|
-
*/
|
|
16
|
-
function CodeBlockSsrFallback() {
|
|
17
|
-
return /* @__PURE__ */ jsx("pre", {
|
|
18
|
-
className: "rich-codeblock-skeleton",
|
|
19
|
-
"data-rich-skeleton": "codeblock",
|
|
20
|
-
children: /* @__PURE__ */ jsx("code", {})
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/modules/code-block/module.tsx
|
|
25
|
-
/**
|
|
26
|
-
* Code-block module — uses Lexical's builtin `code` node, so no `nodes`
|
|
27
|
-
* field. The default renderer (`@haklex/rich-renderer-codeblock`) is heavy
|
|
28
|
-
* (shiki) and ships in a separate lazy chunk.
|
|
29
|
-
*
|
|
30
|
-
* The SSR fallback emits a `<pre>` shell so server-rendered HTML keeps
|
|
31
|
-
* layout stable before the lazy chunk resolves. The lazy renderer replaces
|
|
32
|
-
* it with shiki-tokenized output after hydration.
|
|
33
|
-
*/
|
|
34
|
-
var codeBlockModule = {
|
|
35
|
-
name: "code-block",
|
|
36
|
-
lazyRenderers: { CodeBlock: () => import("./renderer.mjs") },
|
|
37
|
-
ssrFallback: { CodeBlock: /* @__PURE__ */ jsx(CodeBlockSsrFallback, {}) }
|
|
38
|
-
};
|
|
39
|
-
//#endregion
|
|
40
3
|
export { CodeBlockRenderer, codeBlockModule };
|
|
@@ -1,12 +1,3 @@
|
|
|
1
1
|
import { RichRendererModule } from '../../core/types';
|
|
2
|
-
/**
|
|
3
|
-
* Code-block module — uses Lexical's builtin `code` node, so no `nodes`
|
|
4
|
-
* field. The default renderer (`@haklex/rich-renderer-codeblock`) is heavy
|
|
5
|
-
* (shiki) and ships in a separate lazy chunk.
|
|
6
|
-
*
|
|
7
|
-
* The SSR fallback emits a `<pre>` shell so server-rendered HTML keeps
|
|
8
|
-
* layout stable before the lazy chunk resolves. The lazy renderer replaces
|
|
9
|
-
* it with shiki-tokenized output after hydration.
|
|
10
|
-
*/
|
|
11
2
|
export declare const codeBlockModule: RichRendererModule;
|
|
12
3
|
//# sourceMappingURL=module.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/modules/code-block/module.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG3D
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/modules/code-block/module.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG3D,eAAO,MAAM,eAAe,EAAE,kBAQ7B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/modules/code-snippet/edit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,eAAO,MAAM,qBAAqB,EAAE,gBAInC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { t as codeSnippetModule } from "../../module-DO20vUA2.js";
|
|
2
|
+
import { CodeSnippetEditRenderer, codeSnippetEditNodes } from "@haklex/rich-ext-code-snippet/edit";
|
|
3
|
+
//#region src/modules/code-snippet/edit.ts
|
|
4
|
+
var codeSnippetEditModule = {
|
|
5
|
+
...codeSnippetModule,
|
|
6
|
+
editNodes: codeSnippetEditNodes,
|
|
7
|
+
editRenderers: { CodeSnippet: CodeSnippetEditRenderer }
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { codeSnippetEditModule };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/code-snippet/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/modules/code-snippet/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,YAAY,EAAE,yBAAyB,EAAE,MAAM,QAAQ,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,gBAAgB,GACjB,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,17 +1,4 @@
|
|
|
1
|
+
import { t as codeSnippetModule } from "../../module-DO20vUA2.js";
|
|
1
2
|
import { $createCodeSnippetNode, $isCodeSnippetNode, CodeSnippetNode, codeSnippetNodes } from "./node.mjs";
|
|
2
3
|
import { CodeSnippetRenderer } from "./renderer.mjs";
|
|
3
|
-
import "@haklex/rich-ext-code-snippet/style.css";
|
|
4
|
-
import { codeSnippetNodes as codeSnippetNodes$1 } from "@haklex/rich-ext-code-snippet/node";
|
|
5
|
-
//#region src/modules/code-snippet/module.ts
|
|
6
|
-
/**
|
|
7
|
-
* Code-snippet module — registers CodeSnippetNode (light) and lazy-loads
|
|
8
|
-
* CodeSnippetRenderer (shiki). Consumers can supply a thin override module
|
|
9
|
-
* to keep the heavy shiki-based default out of the bundle.
|
|
10
|
-
*/
|
|
11
|
-
var codeSnippetModule = {
|
|
12
|
-
name: "code-snippet",
|
|
13
|
-
nodes: codeSnippetNodes$1,
|
|
14
|
-
lazyRenderers: { CodeSnippet: () => import("@haklex/rich-ext-code-snippet/renderer") }
|
|
15
|
-
};
|
|
16
|
-
//#endregion
|
|
17
4
|
export { $createCodeSnippetNode, $isCodeSnippetNode, CodeSnippetNode, CodeSnippetRenderer, codeSnippetModule, codeSnippetNodes };
|