@haklex/rich-ext-nested-doc 0.0.81 → 0.0.82
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedDocRenderer.d.ts","sourceRoot":"","sources":["../src/NestedDocRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,
|
|
1
|
+
{"version":3,"file":"NestedDocRenderer.d.ts","sourceRoot":"","sources":["../src/NestedDocRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAIvB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,OAAmB,GACpB,EAAE;IACD,KAAK,EAAE,qBAAqB,CAAC;IAC7B,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B,2CAYA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NestedDocStaticDecorator.d.ts","sourceRoot":"","sources":["../src/NestedDocStaticDecorator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"NestedDocStaticDecorator.d.ts","sourceRoot":"","sources":["../src/NestedDocStaticDecorator.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAUrD,UAAU,6BAA6B;IACrC,YAAY,EAAE,qBAAqB,CAAC;CACrC;AAED,wBAAgB,wBAAwB,CAAC,EAAE,YAAY,EAAE,EAAE,6BAA6B,kDAqFvF"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as rendererContent, S as previewSurface, _ as dialogTitle, a as _defineProperty, b as editorArea, c as truncateEditorState, d as dialogHeader, f as dialogHeaderCloseBtn, g as dialogShell, h as dialogPopup, i as NestedDocNode, l as NestedDocRenderer, m as dialogHeaderRight, n as $createNestedDocNode, o as NestedDocStaticDecorator, p as dialogHeaderLeft, r as $isNestedDocNode, s as hasRenderableEditorState, t as NESTED_DOC_BLOCK_TRANSFORMER, u as dialogFooter, v as editOverlay, x as previewEmpty, y as editOverlayRoot } from "./transformer-
|
|
1
|
+
import { C as rendererContent, S as previewSurface, _ as dialogTitle, a as _defineProperty, b as editorArea, c as truncateEditorState, d as dialogHeader, f as dialogHeaderCloseBtn, g as dialogShell, h as dialogPopup, i as NestedDocNode, l as NestedDocRenderer, m as dialogHeaderRight, n as $createNestedDocNode, o as NestedDocStaticDecorator, p as dialogHeaderLeft, r as $isNestedDocNode, s as hasRenderableEditorState, t as NESTED_DOC_BLOCK_TRANSFORMER, u as dialogFooter, v as editOverlay, x as previewEmpty, y as editOverlayRoot } from "./transformer-DP8QjptG.js";
|
|
2
2
|
import { editorTheme, useColorScheme } from "@haklex/rich-editor";
|
|
3
3
|
import { getResolvedEditNodes } from "@haklex/rich-editor/nodes";
|
|
4
4
|
import { $getNodeByKey, $insertNodes, COMMAND_PRIORITY_EDITOR, createCommand, createEditor } from "lexical";
|
package/dist/static.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as NestedDocNode, l as NestedDocRenderer, n as $createNestedDocNode, o as NestedDocStaticDecorator, r as $isNestedDocNode, t as NESTED_DOC_BLOCK_TRANSFORMER } from "./transformer-
|
|
1
|
+
import { i as NestedDocNode, l as NestedDocRenderer, n as $createNestedDocNode, o as NestedDocStaticDecorator, r as $isNestedDocNode, t as NESTED_DOC_BLOCK_TRANSFORMER } from "./transformer-DP8QjptG.js";
|
|
2
2
|
//#region src/static.ts
|
|
3
3
|
var nestedDocNodes = [NestedDocNode];
|
|
4
4
|
//#endregion
|
|
@@ -2,9 +2,9 @@ import { DecoratorNode } from "lexical";
|
|
|
2
2
|
import { Maximize2 } from "lucide-react";
|
|
3
3
|
import { createElement, useCallback, useMemo } from "react";
|
|
4
4
|
import { usePortalTheme } from "@haklex/rich-style-token";
|
|
5
|
-
import { ColorSchemeProvider, extractTextContent, useColorScheme, usePresentDialog, useRendererConfig, useVariant } from "@haklex/rich-editor/static";
|
|
5
|
+
import { ColorSchemeProvider, NestedContentRendererProvider, extractTextContent, useColorScheme, useOptionalNestedContentRenderer, usePresentDialog, useRendererConfig, useVariant } from "@haklex/rich-editor/static";
|
|
6
6
|
import { RichRenderer } from "@haklex/rich-static-renderer";
|
|
7
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { extractTextContent as extractTextContent$1 } from "@haklex/rich-editor/commands";
|
|
9
9
|
//#region src/styles.css.ts
|
|
10
10
|
var editOverlayRoot = "_1an6v8d0";
|
|
@@ -28,9 +28,12 @@ var previewEmpty = "_1an6v8dn";
|
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/NestedDocRenderer.tsx
|
|
30
30
|
function NestedDocRenderer({ value, variant = "comment" }) {
|
|
31
|
+
const renderNestedContent = useOptionalNestedContentRenderer();
|
|
31
32
|
const theme = useColorScheme();
|
|
33
|
+
const rendererConfig = useRendererConfig();
|
|
34
|
+
if (renderNestedContent) return /* @__PURE__ */ jsx(Fragment, { children: renderNestedContent(value, variant) });
|
|
32
35
|
return /* @__PURE__ */ jsx(RichRenderer, {
|
|
33
|
-
rendererConfig
|
|
36
|
+
rendererConfig,
|
|
34
37
|
theme,
|
|
35
38
|
value,
|
|
36
39
|
variant
|
|
@@ -68,6 +71,7 @@ function NestedDocStaticDecorator({ contentState }) {
|
|
|
68
71
|
const colorScheme = useColorScheme();
|
|
69
72
|
const { className: portalClassName } = usePortalTheme();
|
|
70
73
|
const presentDialogFromCtx = usePresentDialog();
|
|
74
|
+
const renderNestedContent = useOptionalNestedContentRenderer();
|
|
71
75
|
const children = contentState.root?.children ?? [];
|
|
72
76
|
const needsTruncation = children.length > PREVIEW_NODE_LIMIT;
|
|
73
77
|
const previewState = useMemo(() => truncateEditorState(contentState, PREVIEW_NODE_LIMIT), [contentState]);
|
|
@@ -88,11 +92,14 @@ function NestedDocStaticDecorator({ contentState }) {
|
|
|
88
92
|
title: title || void 0,
|
|
89
93
|
content: () => /* @__PURE__ */ jsx(ColorSchemeProvider, {
|
|
90
94
|
colorScheme,
|
|
91
|
-
children: /* @__PURE__ */ jsx(
|
|
92
|
-
|
|
93
|
-
children: /* @__PURE__ */ jsx(
|
|
94
|
-
|
|
95
|
-
|
|
95
|
+
children: /* @__PURE__ */ jsx(NestedContentRendererProvider, {
|
|
96
|
+
value: renderNestedContent,
|
|
97
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: staticDialogBody,
|
|
99
|
+
children: /* @__PURE__ */ jsx(NestedDocRenderer, {
|
|
100
|
+
value: contentState,
|
|
101
|
+
variant: contextVariant
|
|
102
|
+
})
|
|
96
103
|
})
|
|
97
104
|
})
|
|
98
105
|
}),
|
|
@@ -108,6 +115,7 @@ function NestedDocStaticDecorator({ contentState }) {
|
|
|
108
115
|
contentState,
|
|
109
116
|
portalClassName,
|
|
110
117
|
presentDialogFromCtx,
|
|
118
|
+
renderNestedContent,
|
|
111
119
|
title,
|
|
112
120
|
contextVariant
|
|
113
121
|
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-ext-nested-doc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.82",
|
|
4
4
|
"description": "Nested document extension for haklex rich editor",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@haklex/rich-editor": "0.0.
|
|
29
|
-
"@haklex/rich-
|
|
30
|
-
"@haklex/rich-
|
|
31
|
-
"@haklex/rich-
|
|
28
|
+
"@haklex/rich-editor-ui": "0.0.82",
|
|
29
|
+
"@haklex/rich-editor": "0.0.82",
|
|
30
|
+
"@haklex/rich-static-renderer": "0.0.82",
|
|
31
|
+
"@haklex/rich-style-token": "0.0.82"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@lexical/react": "^0.41.0",
|