@haklex/rich-static-renderer 0.0.82 → 0.0.84

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,3 +1,3 @@
1
1
  import { RichRendererProps } from './types';
2
- export declare function RichRenderer({ value, variant, theme, className, style, as: Component, rendererConfig, extraNodes, builtinNodeOverrides, }: RichRendererProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function RichRenderer({ value, variant, theme, className, style, as: Component, nested, rendererConfig, extraNodes, builtinNodeOverrides, }: RichRendererProps): import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=RichRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichRenderer.d.ts","sourceRoot":"","sources":["../src/RichRenderer.tsx"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAwMtE,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,OAAmB,EACnB,KAAe,EACf,SAAS,EACT,KAAK,EACL,EAAE,EAAE,SAAiB,EACrB,cAAc,EACd,UAAU,EACV,oBAAoB,GACrB,EAAE,iBAAiB,2CAmCnB"}
1
+ {"version":3,"file":"RichRenderer.d.ts","sourceRoot":"","sources":["../src/RichRenderer.tsx"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAuB,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkNtE,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,GACrB,EAAE,iBAAiB,2CAoCnB"}
@@ -0,0 +1,6 @@
1
+ interface HtmlCommentProps {
2
+ text: string;
3
+ }
4
+ export declare function HtmlComment({ text }: HtmlCommentProps): import("react/jsx-runtime").JSX.Element;
5
+ export {};
6
+ //# sourceMappingURL=HtmlComment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HtmlComment.d.ts","sourceRoot":"","sources":["../../src/components/HtmlComment.tsx"],"names":[],"mappings":"AAEA,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,gBAAgB,2CA6BrD"}
@@ -1,3 +1,3 @@
1
1
  import { ReactNode } from 'react';
2
- export declare function renderBuiltinNode(node: any, key: string, children: ReactNode[] | null, headingSlugs: Map<string, number>, textContent?: string): ReactNode;
2
+ export declare function renderBuiltinNode(node: any, key: string, children: ReactNode[] | null, headingSlugs: Map<string, number>, _textContent?: string): ReactNode;
3
3
  //# sourceMappingURL=renderBuiltinNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderBuiltinNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderBuiltinNode.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAsBtD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,WAAW,CAAC,EAAE,MAAM,GACnB,SAAS,CAgMX"}
1
+ {"version":3,"file":"renderBuiltinNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderBuiltinNode.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAkCtD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,YAAY,CAAC,EAAE,MAAM,GACpB,SAAS,CAiNX"}
@@ -1 +1 @@
1
- {"version":3,"file":"renderTextNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderTextNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AA2BtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAuBhE"}
1
+ {"version":3,"file":"renderTextNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderTextNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAC;AA6BtD,wBAAgB,cAAc,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,SAAS,CAuBhE"}
package/dist/index.mjs CHANGED
@@ -1,383 +1,493 @@
1
- import { ColorSchemeProvider, FootnoteDefinitionsProvider, LinkFavicon, NestedContentRendererProvider, RendererConfigProvider, RendererWrapper, RubyRenderer, allNodes, editorTheme, getTagBgColor, getVariantClass, useOptionalNestedContentRenderer } from "@haklex/rich-editor/static";
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { semanticClassNames, sharedStyles, RendererWrapper, RubyRenderer, getTagBgColor, detailsClassNames, detailsStyles, LinkFavicon, getVariantClass, useOptionalNestedContentRenderer, allNodes, ColorSchemeProvider, RendererConfigProvider, FootnoteDefinitionsProvider, NestedContentRendererProvider, editorTheme, gridClassNames, gridStyles } from "@haklex/rich-editor/static";
2
3
  import { PortalThemeProvider } from "@haklex/rich-style-token";
3
4
  import { createHeadlessEditor } from "@lexical/headless";
4
5
  import { $getRoot } from "lexical";
5
- import { cloneElement, createElement, isValidElement, useMemo } from "react";
6
+ import { useRef, useEffect, createElement, useMemo, isValidElement, cloneElement } from "react";
6
7
  import { Link } from "lucide-react";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
- //#region src/table.css.ts
8
+ function HtmlComment({ text }) {
9
+ const anchorRef = useRef(null);
10
+ const commentRef = useRef(null);
11
+ useEffect(() => {
12
+ const anchor = anchorRef.current;
13
+ if (!anchor) return;
14
+ const parent = anchor.parentNode;
15
+ if (!parent) return;
16
+ let comment = commentRef.current;
17
+ if (!comment || comment.parentNode !== parent) {
18
+ comment = document.createComment(text);
19
+ parent.insertBefore(comment, anchor);
20
+ commentRef.current = comment;
21
+ } else if (comment.data !== text) {
22
+ comment.data = text;
23
+ }
24
+ return () => {
25
+ if (commentRef.current?.parentNode) {
26
+ commentRef.current.parentNode.removeChild(commentRef.current);
27
+ }
28
+ commentRef.current = null;
29
+ };
30
+ }, [text]);
31
+ return /* @__PURE__ */ jsx("template", { suppressHydrationWarning: true, "data-rich-comment-anchor": "", ref: anchorRef });
32
+ }
9
33
  var tableWrapper = "_1v9yxw30";
10
34
  var table = "_1v9yxw31";
11
35
  var tableHead = "_1v9yxw32";
12
36
  var tableCell = "_1v9yxw33";
13
- //#endregion
14
- //#region src/engine/renderBuiltinNode.tsx
37
+ const shared$1 = (key) => `${semanticClassNames[key]} ${sharedStyles[key]}`;
38
+ const headingClassNames = {
39
+ h1: shared$1("headingH1"),
40
+ h2: shared$1("headingH2"),
41
+ h3: shared$1("headingH3"),
42
+ h4: shared$1("headingH4"),
43
+ h5: shared$1("headingH5"),
44
+ h6: shared$1("headingH6")
45
+ };
15
46
  function textToSlug(text) {
16
- return text.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g, "").replaceAll(/[\s_]+/g, "-").replaceAll(/^-+|-+$/g, "");
47
+ return text.toLowerCase().trim().replaceAll(/[^\s\w\u3000-\u9FFF\uAC00-\uD7AF\uFF00-\uFFEF-]/g, "").replaceAll(/[\s_]+/g, "-").replaceAll(/^-+|-+$/g, "");
17
48
  }
18
49
  function extractText(node) {
19
- if (node.text) return node.text;
20
- if (node.children) return node.children.map(extractText).join("");
21
- return "";
50
+ if (node.type === "comment") return "";
51
+ if (node.text) return node.text;
52
+ if (node.children) return node.children.map(extractText).join("");
53
+ return "";
22
54
  }
23
- function renderBuiltinNode(node, key, children, headingSlugs, textContent) {
24
- switch (node.type) {
25
- case "root": return /* @__PURE__ */ jsx(Fragment, { children });
26
- case "paragraph": return /* @__PURE__ */ jsx("p", {
27
- className: "rich-paragraph",
28
- style: node.format ? { textAlign: node.format } : void 0,
29
- children
30
- }, key);
31
- case "heading": {
32
- const Tag = node.tag;
33
- const baseSlug = textToSlug(textContent || extractText(node));
34
- let slug = baseSlug;
35
- if (baseSlug) {
36
- const count = headingSlugs.get(baseSlug);
37
- if (count !== void 0) {
38
- slug = `${baseSlug}-${count}`;
39
- headingSlugs.set(baseSlug, count + 1);
40
- } else headingSlugs.set(baseSlug, 1);
41
- }
42
- return /* @__PURE__ */ jsxs(Tag, {
43
- className: `rich-heading-${Tag}`,
44
- id: slug || void 0,
45
- children: [slug && /* @__PURE__ */ jsx("a", {
46
- className: "rich-heading-anchor",
47
- href: `#${slug}`,
48
- tabIndex: 0,
49
- children: /* @__PURE__ */ jsx(Link, {
50
- "aria-hidden": true,
51
- size: 14,
52
- strokeWidth: 2
53
- })
54
- }), children]
55
- }, key);
56
- }
57
- case "quote": return /* @__PURE__ */ jsx("blockquote", {
58
- className: "rich-quote",
59
- children
60
- }, key);
61
- case "list": return /* @__PURE__ */ jsx(node.listType === "number" ? "ol" : "ul", {
62
- className: node.listType === "number" ? "rich-list-ol" : node.listType === "check" ? "rich-checklist rich-list-ul" : "rich-list-ul",
63
- start: node.start !== 1 ? node.start : void 0,
64
- children
65
- }, key);
66
- case "listitem": {
67
- const isChecklist = node.checked !== void 0;
68
- const hasNestedList = node.children?.some((c) => c.type === "list");
69
- let cls;
70
- if (hasNestedList) cls = "rich-list-nested-item";
71
- else if (isChecklist) cls = node.checked ? "rich-list-item rich-list-item-checked" : "rich-list-item rich-list-item-unchecked";
72
- else cls = "rich-list-item";
73
- return /* @__PURE__ */ jsx("li", {
74
- className: cls,
75
- value: node.value,
76
- children
77
- }, key);
78
- }
79
- case "link": return /* @__PURE__ */ jsxs("a", {
80
- className: "rich-link",
81
- href: node.url,
82
- rel: node.rel || "noopener",
83
- target: node.target || "_blank",
84
- children: [/* @__PURE__ */ jsx(LinkFavicon, { href: node.url }), children]
85
- }, key);
86
- case "autolink": return /* @__PURE__ */ jsxs("a", {
87
- className: "rich-link",
88
- href: node.url,
89
- rel: "noopener",
90
- target: "_blank",
91
- children: [/* @__PURE__ */ jsx(LinkFavicon, { href: node.url }), children]
92
- }, key);
93
- case "horizontalrule": return /* @__PURE__ */ jsx("hr", { className: "rich-hr" }, key);
94
- case "table": return /* @__PURE__ */ jsx("div", {
95
- className: tableWrapper,
96
- children: /* @__PURE__ */ jsx("table", {
97
- className: table,
98
- children
99
- })
100
- }, key);
101
- case "tablerow": return /* @__PURE__ */ jsx("tr", { children }, key);
102
- case "tablecell": return /* @__PURE__ */ jsx(node.headerState ? "th" : "td", {
103
- className: node.headerState ? tableHead : tableCell,
104
- colSpan: node.colSpan > 1 ? node.colSpan : void 0,
105
- children
106
- }, key);
107
- case "details": {
108
- const summary = node.summary || "";
109
- return /* @__PURE__ */ jsxs("details", {
110
- className: "rich-details",
111
- open: node.open || void 0,
112
- children: [/* @__PURE__ */ jsxs("summary", {
113
- className: "rich-details-summary",
114
- children: [/* @__PURE__ */ jsx("span", {
115
- "aria-hidden": "true",
116
- className: "rich-details-chevron",
117
- children: /* @__PURE__ */ jsx("svg", {
118
- fill: "none",
119
- height: "20",
120
- stroke: "currentColor",
121
- strokeLinecap: "round",
122
- strokeLinejoin: "round",
123
- strokeWidth: "1.5",
124
- viewBox: "0 0 20 20",
125
- width: "20",
126
- children: /* @__PURE__ */ jsx("path", { d: "M8 6L12 10L8 14" })
127
- })
128
- }), /* @__PURE__ */ jsx("span", {
129
- className: "rich-details-summary-text",
130
- children: summary
131
- })]
132
- }), /* @__PURE__ */ jsx("div", {
133
- className: "rich-details-content",
134
- children
135
- })]
136
- }, key);
137
- }
138
- case "spoiler": return /* @__PURE__ */ jsx("span", {
139
- className: "rich-spoiler",
140
- role: "button",
141
- tabIndex: 0,
142
- children
143
- }, key);
144
- case "tag": return /* @__PURE__ */ jsx("span", {
145
- className: "rich-tag",
146
- style: { backgroundColor: getTagBgColor(node.text) },
147
- children: node.text
148
- }, key);
149
- case "ruby": return createElement(RendererWrapper, {
150
- key,
151
- rendererKey: "Ruby",
152
- defaultRenderer: RubyRenderer,
153
- props: {
154
- reading: node.reading ?? "",
155
- children
156
- }
157
- });
158
- case "code": return /* @__PURE__ */ jsx("pre", {
159
- className: "rich-code-block",
160
- children: /* @__PURE__ */ jsx("code", { children })
161
- }, key);
162
- case "code-highlight": return /* @__PURE__ */ jsx("span", { children: node.text }, key);
163
- case "linebreak": return /* @__PURE__ */ jsx("br", {}, key);
164
- case "tab": return /* @__PURE__ */ jsx("span", { children: " " }, key);
165
- default: return null;
166
- }
55
+ function renderBuiltinNode(node, key, children, headingSlugs, _textContent) {
56
+ switch (node.type) {
57
+ case "root": {
58
+ return /* @__PURE__ */ jsx(Fragment, { children });
59
+ }
60
+ case "paragraph": {
61
+ const align = node.format ? { textAlign: node.format } : void 0;
62
+ return /* @__PURE__ */ jsx("p", { className: shared$1("paragraph"), style: align, children }, key);
63
+ }
64
+ case "heading": {
65
+ const Tag = node.tag;
66
+ const text = extractText(node);
67
+ const baseSlug = textToSlug(text);
68
+ let slug = baseSlug;
69
+ if (baseSlug) {
70
+ const count = headingSlugs.get(baseSlug);
71
+ if (count !== void 0) {
72
+ slug = `${baseSlug}-${count}`;
73
+ headingSlugs.set(baseSlug, count + 1);
74
+ } else {
75
+ headingSlugs.set(baseSlug, 1);
76
+ }
77
+ }
78
+ return /* @__PURE__ */ jsxs(Tag, { className: headingClassNames[Tag], id: slug || void 0, children: [
79
+ slug && /* @__PURE__ */ jsx("a", { className: shared$1("headingAnchor"), href: `#${slug}`, tabIndex: 0, children: /* @__PURE__ */ jsx(Link, { "aria-hidden": true, size: 14, strokeWidth: 2 }) }),
80
+ children
81
+ ] }, key);
82
+ }
83
+ case "quote": {
84
+ return /* @__PURE__ */ jsx("blockquote", { className: shared$1("quote"), children }, key);
85
+ }
86
+ case "list": {
87
+ const Tag = node.listType === "number" ? "ol" : "ul";
88
+ const cls = node.listType === "number" ? shared$1("listOl") : node.listType === "check" ? `${shared$1("checklist")} ${shared$1("listUl")}` : shared$1("listUl");
89
+ return /* @__PURE__ */ jsx(Tag, { className: cls, start: node.start !== 1 ? node.start : void 0, children }, key);
90
+ }
91
+ case "listitem": {
92
+ const isChecklist = node.checked !== void 0;
93
+ const hasNestedList = node.children?.some((c) => c.type === "list");
94
+ const value = typeof node.value === "number" && node.value > 1 ? node.value : void 0;
95
+ let cls;
96
+ if (hasNestedList) {
97
+ cls = shared$1("listNestedItem");
98
+ } else if (isChecklist) {
99
+ cls = node.checked ? `${shared$1("listItem")} ${shared$1("listItemChecked")}` : `${shared$1("listItem")} ${shared$1("listItemUnchecked")}`;
100
+ } else {
101
+ cls = shared$1("listItem");
102
+ }
103
+ return /* @__PURE__ */ jsx("li", { className: cls, value, children }, key);
104
+ }
105
+ case "link": {
106
+ return /* @__PURE__ */ jsxs(
107
+ "a",
108
+ {
109
+ className: shared$1("link"),
110
+ href: node.url,
111
+ rel: node.rel || "noopener",
112
+ target: node.target || "_blank",
113
+ children: [
114
+ /* @__PURE__ */ jsx(LinkFavicon, { href: node.url }),
115
+ children
116
+ ]
117
+ },
118
+ key
119
+ );
120
+ }
121
+ case "autolink": {
122
+ return /* @__PURE__ */ jsxs("a", { className: shared$1("link"), href: node.url, rel: "noopener", target: "_blank", children: [
123
+ /* @__PURE__ */ jsx(LinkFavicon, { href: node.url }),
124
+ children
125
+ ] }, key);
126
+ }
127
+ case "horizontalrule": {
128
+ return /* @__PURE__ */ jsx("hr", { className: shared$1("hr") }, key);
129
+ }
130
+ case "table": {
131
+ return /* @__PURE__ */ jsx("div", { className: tableWrapper, children: /* @__PURE__ */ jsx("table", { className: table, children }) }, key);
132
+ }
133
+ case "tablerow": {
134
+ return /* @__PURE__ */ jsx("tr", { children }, key);
135
+ }
136
+ case "tablecell": {
137
+ const CellTag = node.headerState ? "th" : "td";
138
+ const cls = node.headerState ? tableHead : tableCell;
139
+ return /* @__PURE__ */ jsx(CellTag, { className: cls, colSpan: node.colSpan > 1 ? node.colSpan : void 0, children }, key);
140
+ }
141
+ case "details": {
142
+ const summary = node.summary || "";
143
+ return /* @__PURE__ */ jsxs(
144
+ "details",
145
+ {
146
+ className: `${detailsClassNames.details} ${detailsStyles.details}`,
147
+ open: node.open || void 0,
148
+ children: [
149
+ /* @__PURE__ */ jsxs("summary", { className: `${detailsClassNames.summary} ${detailsStyles.summary}`, children: [
150
+ /* @__PURE__ */ jsx(
151
+ "span",
152
+ {
153
+ "aria-hidden": "true",
154
+ className: `${detailsClassNames.chevron} ${detailsStyles.chevron}`,
155
+ children: /* @__PURE__ */ jsx(
156
+ "svg",
157
+ {
158
+ fill: "none",
159
+ height: "20",
160
+ stroke: "currentColor",
161
+ strokeLinecap: "round",
162
+ strokeLinejoin: "round",
163
+ strokeWidth: "1.5",
164
+ viewBox: "0 0 20 20",
165
+ width: "20",
166
+ children: /* @__PURE__ */ jsx("path", { d: "M8 6L12 10L8 14" })
167
+ }
168
+ )
169
+ }
170
+ ),
171
+ /* @__PURE__ */ jsx("span", { className: `${detailsClassNames.summaryText} ${detailsStyles.summaryText}`, children: summary })
172
+ ] }),
173
+ /* @__PURE__ */ jsx("div", { className: `${detailsClassNames.content} ${detailsStyles.content}`, children })
174
+ ]
175
+ },
176
+ key
177
+ );
178
+ }
179
+ case "spoiler": {
180
+ return /* @__PURE__ */ jsx("span", { className: shared$1("spoiler"), role: "button", tabIndex: 0, children }, key);
181
+ }
182
+ case "tag": {
183
+ return /* @__PURE__ */ jsx(
184
+ "span",
185
+ {
186
+ className: shared$1("tag"),
187
+ style: { backgroundColor: getTagBgColor(node.text) },
188
+ children: node.text
189
+ },
190
+ key
191
+ );
192
+ }
193
+ case "comment": {
194
+ return /* @__PURE__ */ jsx(HtmlComment, { text: node.text ?? "" }, key);
195
+ }
196
+ case "ruby": {
197
+ return createElement(RendererWrapper, {
198
+ key,
199
+ rendererKey: "Ruby",
200
+ defaultRenderer: RubyRenderer,
201
+ props: {
202
+ reading: node.reading ?? "",
203
+ children
204
+ }
205
+ });
206
+ }
207
+ case "code": {
208
+ return /* @__PURE__ */ jsx("pre", { className: "rich-code-block", children: /* @__PURE__ */ jsx("code", { children }) }, key);
209
+ }
210
+ case "code-highlight": {
211
+ return /* @__PURE__ */ jsx("span", { children: node.text }, key);
212
+ }
213
+ case "linebreak": {
214
+ return /* @__PURE__ */ jsx("br", {}, key);
215
+ }
216
+ case "tab": {
217
+ return /* @__PURE__ */ jsx("span", { children: " " }, key);
218
+ }
219
+ default: {
220
+ return null;
221
+ }
222
+ }
167
223
  }
168
- //#endregion
169
- //#region src/engine/renderTextNode.tsx
170
- var FORMAT_FLAGS = [
171
- [1, "rich-text-bold"],
172
- [2, "rich-text-italic"],
173
- [4, "rich-text-strikethrough"],
174
- [8, "rich-text-underline"],
175
- [16, "rich-text-code"],
176
- [32, "rich-text-subscript"],
177
- [64, "rich-text-superscript"],
178
- [128, "rich-text-highlight"]
224
+ const shared = (key) => `${semanticClassNames[key]} ${sharedStyles[key]}`;
225
+ const FORMAT_FLAGS = [
226
+ [1, "textBold"],
227
+ [2, "textItalic"],
228
+ [4, "textStrikethrough"],
229
+ [8, "textUnderline"],
230
+ [16, "textCode"],
231
+ [32, "textSubscript"],
232
+ [64, "textSuperscript"],
233
+ [128, "textHighlight"]
179
234
  ];
180
235
  function parseCSSText(cssText) {
181
- const style = {};
182
- for (const part of cssText.split(";")) {
183
- const colonIndex = part.indexOf(":");
184
- if (colonIndex === -1) continue;
185
- const prop = part.slice(0, colonIndex).trim();
186
- const value = part.slice(colonIndex + 1).trim();
187
- if (!prop || !value) continue;
188
- const camelProp = prop.replaceAll(/-([a-z])/g, (_, c) => c.toUpperCase());
189
- style[camelProp] = value;
190
- }
191
- return style;
236
+ const style = {};
237
+ for (const part of cssText.split(";")) {
238
+ const colonIndex = part.indexOf(":");
239
+ if (colonIndex === -1) continue;
240
+ const prop = part.slice(0, colonIndex).trim();
241
+ const value = part.slice(colonIndex + 1).trim();
242
+ if (!prop || !value) continue;
243
+ const camelProp = prop.replaceAll(/-([a-z])/g, (_, c) => c.toUpperCase());
244
+ style[camelProp] = value;
245
+ }
246
+ return style;
192
247
  }
193
248
  function renderTextNode(node, key) {
194
- let element = node.text;
195
- const format = node.format || 0;
196
- for (const [flag, className] of FORMAT_FLAGS) if (format & flag) element = /* @__PURE__ */ jsx("span", {
197
- className,
198
- children: element
199
- }, `${key}-${flag}`);
200
- if (node.style) element = /* @__PURE__ */ jsx("span", {
201
- style: parseCSSText(node.style),
202
- children: element
203
- }, key);
204
- return element;
249
+ let element = node.text;
250
+ const format = node.format || 0;
251
+ for (const [flag, styleKey] of FORMAT_FLAGS) {
252
+ if (format & flag) {
253
+ element = /* @__PURE__ */ jsx("span", { className: shared(styleKey), children: element }, `${key}-${flag}`);
254
+ }
255
+ }
256
+ if (node.style) {
257
+ element = /* @__PURE__ */ jsx("span", { style: parseCSSText(node.style), children: element }, key);
258
+ }
259
+ return element;
205
260
  }
206
- //#endregion
207
- //#region src/preprocess/footnote.ts
208
261
  function preprocessFootnotes(state) {
209
- const definitions = {};
210
- const seen = /* @__PURE__ */ new Set();
211
- const displayNumberMap = {};
212
- let counter = 1;
213
- function walk(node) {
214
- if (node.type === "footnote" && node.identifier) {
215
- const id = node.identifier;
216
- if (!seen.has(id)) {
217
- seen.add(id);
218
- displayNumberMap[id] = counter++;
219
- }
220
- }
221
- if (node.type === "footnote-section" && node.definitions) Object.assign(definitions, node.definitions);
222
- if (node.children) for (const child of node.children) walk(child);
223
- if (node.root) walk(node.root);
224
- if (node.content && typeof node.content === "object" && node.content.root) walk(node.content);
225
- if (node.cells && Array.isArray(node.cells)) {
226
- for (const cell of node.cells) if (cell && cell.root) walk(cell);
227
- }
228
- }
229
- walk(state);
230
- for (const id of seen) if (!(id in definitions)) definitions[id] = "";
231
- return {
232
- definitions,
233
- displayNumberMap
234
- };
262
+ const definitions = {};
263
+ const seen = /* @__PURE__ */ new Set();
264
+ const displayNumberMap = {};
265
+ let counter = 1;
266
+ function walk(node) {
267
+ if (node.type === "footnote" && node.identifier) {
268
+ const id = node.identifier;
269
+ if (!seen.has(id)) {
270
+ seen.add(id);
271
+ displayNumberMap[id] = counter++;
272
+ }
273
+ }
274
+ if (node.type === "footnote-section" && node.definitions) {
275
+ Object.assign(definitions, node.definitions);
276
+ }
277
+ if (node.children) {
278
+ for (const child of node.children) walk(child);
279
+ }
280
+ if (node.root) walk(node.root);
281
+ if (node.content && typeof node.content === "object" && node.content.root) {
282
+ walk(node.content);
283
+ }
284
+ if (node.cells && Array.isArray(node.cells)) {
285
+ for (const cell of node.cells) {
286
+ if (cell && cell.root) walk(cell);
287
+ }
288
+ }
289
+ }
290
+ walk(state);
291
+ for (const id of seen) {
292
+ if (!(id in definitions)) {
293
+ definitions[id] = "";
294
+ }
295
+ }
296
+ return { definitions, displayNumberMap };
235
297
  }
236
- //#endregion
237
- //#region src/RichRenderer.tsx
298
+ const alertClassName = (type) => `${semanticClassNames.alert} ${sharedStyles.alert} rich-alert-${type}`;
238
299
  function wrapDecoration(serialized, key, decoration) {
239
- switch (serialized.type) {
240
- case "alert-quote": return createElement("div", {
241
- key,
242
- className: `rich-alert rich-alert-${serialized.alertType}`
243
- }, decoration);
244
- case "banner": return createElement("div", {
245
- key,
246
- className: `rich-banner rich-banner-${serialized.bannerType}`
247
- }, decoration);
248
- case "grid-container": return createElement("div", {
249
- key,
250
- className: "rich-grid-container"
251
- }, decoration);
252
- default:
253
- if (isValidElement(decoration)) return cloneElement(decoration, { key });
254
- return decoration;
255
- }
300
+ switch (serialized.type) {
301
+ case "alert-quote": {
302
+ return createElement(
303
+ "div",
304
+ { key, className: alertClassName(serialized.alertType) },
305
+ decoration
306
+ );
307
+ }
308
+ case "banner": {
309
+ return createElement(
310
+ "div",
311
+ { key, className: `rich-banner rich-banner-${serialized.bannerType}` },
312
+ decoration
313
+ );
314
+ }
315
+ case "grid-container": {
316
+ return createElement(
317
+ "div",
318
+ {
319
+ key,
320
+ className: `${gridClassNames.container} ${gridStyles.container}`
321
+ },
322
+ decoration
323
+ );
324
+ }
325
+ default: {
326
+ if (isValidElement(decoration)) {
327
+ return cloneElement(decoration, { key });
328
+ }
329
+ return decoration;
330
+ }
331
+ }
256
332
  }
257
333
  function applyBlockId(element, blockId, nodeKey) {
258
- if (!blockId) return element;
259
- if (isValidElement(element) && typeof element.type === "string") return cloneElement(element, { "data-block-id": blockId });
260
- return /* @__PURE__ */ jsx("div", {
261
- className: "rich-block-anchor",
262
- "data-block-id": blockId,
263
- children: element
264
- }, `${nodeKey}-block-anchor`);
334
+ if (!blockId) return element;
335
+ if (isValidElement(element) && typeof element.type === "string") {
336
+ return cloneElement(element, { "data-block-id": blockId });
337
+ }
338
+ return /* @__PURE__ */ jsx("div", { className: "rich-block-anchor", "data-block-id": blockId, children: element }, `${nodeKey}-block-anchor`);
265
339
  }
266
340
  function renderTree(node, editor, editorConfig, headingSlugs, key, blockId, builtinNodeOverrides) {
267
- const nodeKey = node.getKey ? node.getKey() : key;
268
- if (typeof node.decorate === "function") try {
269
- const decoration = node.decorate(editor, editorConfig);
270
- if (decoration != null) return applyBlockId(wrapDecoration(node.exportJSON ? node.exportJSON() : {}, nodeKey, decoration), blockId, nodeKey);
271
- } catch {}
272
- const serialized = node.exportJSON ? node.exportJSON() : {};
273
- if (serialized.type === "text") return renderTextNode(serialized, nodeKey);
274
- let children = null;
275
- if (node.getChildren) {
276
- const childNodes = node.getChildren();
277
- if (childNodes.length > 0) children = childNodes.map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `${nodeKey}-${i}`, void 0, builtinNodeOverrides));
278
- }
279
- const textContent = node.getTextContent ? node.getTextContent() : void 0;
280
- const override = builtinNodeOverrides?.[serialized.type];
281
- if (override) {
282
- const defaultRenderer = () => renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent);
283
- return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey);
284
- }
285
- return applyBlockId(renderBuiltinNode(serialized, nodeKey, children, headingSlugs, textContent), blockId, nodeKey);
341
+ const nodeKey = node.getKey ? node.getKey() : key;
342
+ if (typeof node.decorate === "function") {
343
+ try {
344
+ const decoration = node.decorate(editor, editorConfig);
345
+ if (decoration != null) {
346
+ const serialized2 = node.exportJSON ? node.exportJSON() : {};
347
+ return applyBlockId(wrapDecoration(serialized2, nodeKey, decoration), blockId, nodeKey);
348
+ }
349
+ } catch {
350
+ }
351
+ }
352
+ const serialized = node.exportJSON ? node.exportJSON() : {};
353
+ if (serialized.type === "text") {
354
+ return renderTextNode(serialized, nodeKey);
355
+ }
356
+ let children = null;
357
+ if (node.getChildren) {
358
+ const childNodes = node.getChildren();
359
+ if (childNodes.length > 0) {
360
+ children = childNodes.map(
361
+ (child, i) => renderTree(
362
+ child,
363
+ editor,
364
+ editorConfig,
365
+ headingSlugs,
366
+ `${nodeKey}-${i}`,
367
+ void 0,
368
+ builtinNodeOverrides
369
+ )
370
+ );
371
+ }
372
+ }
373
+ node.getTextContent ? node.getTextContent() : void 0;
374
+ const override = builtinNodeOverrides?.[serialized.type];
375
+ if (override) {
376
+ const defaultRenderer = () => renderBuiltinNode(serialized, nodeKey, children, headingSlugs);
377
+ return applyBlockId(override(serialized, nodeKey, children, defaultRenderer), blockId, nodeKey);
378
+ }
379
+ return applyBlockId(
380
+ renderBuiltinNode(serialized, nodeKey, children, headingSlugs),
381
+ blockId,
382
+ nodeKey
383
+ );
286
384
  }
287
385
  function renderEditorToReact(value, nodes, builtinNodeOverrides) {
288
- const editor = createHeadlessEditor({
289
- nodes,
290
- theme: editorTheme,
291
- editable: false,
292
- onError: (error) => {
293
- console.error("[RichRenderer]", error);
294
- }
295
- });
296
- const editorConfig = {
297
- namespace: "ssr",
298
- theme: editorTheme
299
- };
300
- const editorState = editor.parseEditorState(value);
301
- editor.setEditorState(editorState);
302
- const footnoteData = preprocessFootnotes(value);
303
- const rawRootChildren = value.root?.children;
304
- let content = null;
305
- editorState.read(() => {
306
- const root = $getRoot();
307
- const headingSlugs = /* @__PURE__ */ new Map();
308
- content = /* @__PURE__ */ jsx(Fragment, { children: root.getChildren().map((child, i) => renderTree(child, editor, editorConfig, headingSlugs, `ssr-${i}`, rawRootChildren?.[i]?.$?.blockId, builtinNodeOverrides)) });
309
- });
310
- const renderNestedContent = (state) => {
311
- const nestedEditor = createHeadlessEditor({
312
- nodes,
313
- theme: editorTheme,
314
- editable: false,
315
- onError: (error) => {
316
- console.error("[RichRenderer:nested]", error);
317
- }
318
- });
319
- const nestedEditorConfig = {
320
- namespace: "ssr-nested",
321
- theme: editorTheme
322
- };
323
- const nestedState = nestedEditor.parseEditorState(state);
324
- nestedEditor.setEditorState(nestedState);
325
- let nested = null;
326
- const nestedRawChildren = state.root?.children;
327
- nestedState.read(() => {
328
- const root = $getRoot();
329
- const headingSlugs = /* @__PURE__ */ new Map();
330
- nested = /* @__PURE__ */ jsx(Fragment, { children: root.getChildren().map((child, i) => renderTree(child, nestedEditor, nestedEditorConfig, headingSlugs, `nested-${i}`, nestedRawChildren?.[i]?.$?.blockId, builtinNodeOverrides)) });
331
- });
332
- return nested;
333
- };
334
- return {
335
- content,
336
- footnoteData,
337
- renderNestedContent
338
- };
386
+ const editor = createHeadlessEditor({
387
+ nodes,
388
+ theme: editorTheme,
389
+ editable: false,
390
+ onError: (error) => {
391
+ console.error("[RichRenderer]", error);
392
+ }
393
+ });
394
+ const editorConfig = { namespace: "ssr", theme: editorTheme };
395
+ const editorState = editor.parseEditorState(value);
396
+ editor.setEditorState(editorState);
397
+ const footnoteData = preprocessFootnotes(value);
398
+ const rawRootChildren = value.root?.children;
399
+ let content = null;
400
+ editorState.read(() => {
401
+ const root = $getRoot();
402
+ const headingSlugs = /* @__PURE__ */ new Map();
403
+ const children = root.getChildren().map(
404
+ (child, i) => renderTree(
405
+ child,
406
+ editor,
407
+ editorConfig,
408
+ headingSlugs,
409
+ `ssr-${i}`,
410
+ rawRootChildren?.[i]?.$?.blockId,
411
+ builtinNodeOverrides
412
+ )
413
+ );
414
+ content = /* @__PURE__ */ jsx(Fragment, { children });
415
+ });
416
+ const renderNestedContent = (state) => {
417
+ const nestedEditor = createHeadlessEditor({
418
+ nodes,
419
+ theme: editorTheme,
420
+ editable: false,
421
+ onError: (error) => {
422
+ console.error("[RichRenderer:nested]", error);
423
+ }
424
+ });
425
+ const nestedEditorConfig = {
426
+ namespace: "ssr-nested",
427
+ theme: editorTheme
428
+ };
429
+ const nestedState = nestedEditor.parseEditorState(state);
430
+ nestedEditor.setEditorState(nestedState);
431
+ let nested = null;
432
+ const nestedRawChildren = state.root?.children;
433
+ nestedState.read(() => {
434
+ const root = $getRoot();
435
+ const headingSlugs = /* @__PURE__ */ new Map();
436
+ const ch = root.getChildren().map(
437
+ (child, i) => renderTree(
438
+ child,
439
+ nestedEditor,
440
+ nestedEditorConfig,
441
+ headingSlugs,
442
+ `nested-${i}`,
443
+ nestedRawChildren?.[i]?.$?.blockId,
444
+ builtinNodeOverrides
445
+ )
446
+ );
447
+ nested = /* @__PURE__ */ jsx(Fragment, { children: ch });
448
+ });
449
+ return nested;
450
+ };
451
+ return { content, footnoteData, renderNestedContent };
339
452
  }
340
- function RichRenderer({ value, variant = "article", theme = "light", className, style, as: Component = "div", rendererConfig, extraNodes, builtinNodeOverrides }) {
341
- const variantClass = getVariantClass(variant);
342
- const outerRenderNestedContent = useOptionalNestedContentRenderer();
343
- const { content, footnoteData, renderNestedContent } = useMemo(() => {
344
- return renderEditorToReact(value, extraNodes ? [...allNodes, ...extraNodes] : allNodes, builtinNodeOverrides);
345
- }, [
346
- builtinNodeOverrides,
347
- extraNodes,
348
- value
349
- ]);
350
- const classes = [
351
- "rich-content",
352
- variantClass,
353
- className
354
- ].filter(Boolean).join(" ");
355
- return /* @__PURE__ */ jsx(PortalThemeProvider, {
356
- className: variantClass,
357
- theme,
358
- children: /* @__PURE__ */ jsx(ColorSchemeProvider, {
359
- colorScheme: theme,
360
- children: /* @__PURE__ */ jsx(RendererConfigProvider, {
361
- config: rendererConfig,
362
- mode: "renderer",
363
- variant,
364
- children: /* @__PURE__ */ jsx(FootnoteDefinitionsProvider, {
365
- definitions: footnoteData.definitions,
366
- displayNumberMap: footnoteData.displayNumberMap,
367
- children: /* @__PURE__ */ jsx(NestedContentRendererProvider, {
368
- value: outerRenderNestedContent ?? renderNestedContent,
369
- children: /* @__PURE__ */ jsx(Component, {
370
- suppressHydrationWarning: true,
371
- className: classes,
372
- "data-theme": theme,
373
- style,
374
- children: content
375
- })
376
- })
377
- })
378
- })
379
- })
380
- });
453
+ function RichRenderer({
454
+ value,
455
+ variant = "article",
456
+ theme = "light",
457
+ className,
458
+ style,
459
+ as: Component = "div",
460
+ nested = false,
461
+ rendererConfig,
462
+ extraNodes,
463
+ builtinNodeOverrides
464
+ }) {
465
+ const variantClass = getVariantClass(variant);
466
+ const outerRenderNestedContent = useOptionalNestedContentRenderer();
467
+ const { content, footnoteData, renderNestedContent } = useMemo(() => {
468
+ const nodes = extraNodes ? [...allNodes, ...extraNodes] : allNodes;
469
+ return renderEditorToReact(value, nodes, builtinNodeOverrides);
470
+ }, [builtinNodeOverrides, extraNodes, value]);
471
+ const classes = ["rich-content", variantClass, className].filter(Boolean).join(" ");
472
+ return /* @__PURE__ */ jsx(PortalThemeProvider, { className: variantClass, theme, children: /* @__PURE__ */ jsx(ColorSchemeProvider, { colorScheme: theme, children: /* @__PURE__ */ jsx(RendererConfigProvider, { config: rendererConfig, mode: "renderer", variant, children: /* @__PURE__ */ jsx(
473
+ FootnoteDefinitionsProvider,
474
+ {
475
+ definitions: footnoteData.definitions,
476
+ displayNumberMap: footnoteData.displayNumberMap,
477
+ children: /* @__PURE__ */ jsx(NestedContentRendererProvider, { value: outerRenderNestedContent ?? renderNestedContent, children: /* @__PURE__ */ jsx(
478
+ Component,
479
+ {
480
+ suppressHydrationWarning: true,
481
+ className: classes,
482
+ "data-rich-nested": nested ? "true" : void 0,
483
+ "data-theme": theme,
484
+ style,
485
+ children: content
486
+ }
487
+ ) })
488
+ }
489
+ ) }) }) });
381
490
  }
382
- //#endregion
383
- export { RichRenderer };
491
+ export {
492
+ RichRenderer
493
+ };
@@ -1,2 +1 @@
1
- :root{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}:root.dark{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.km6fx0{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.7;--rc-line-height-tight:1.4;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.km6fx1{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#2563eb;--rc-quote-bg:#eff6ff;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:700px;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:4px;--rc-space-sm:8px;--rc-space-md:16px;--rc-space-lg:24px;--rc-space-xl:32px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:16px;--rc-font-size-small:14px;--rc-line-height:1.8;--rc-line-height-tight:1.4;--rc-font-family:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm:4px;--rc-radius-md:8px;--rc-radius-lg:12px}.km6fx2{--rc-text:#000;--rc-text-secondary:#27272a;--rc-text-tertiary:#71717a;--rc-text-quaternary:#a1a1aa;--rc-bg:#fff;--rc-bg-secondary:#fafafa;--rc-bg-tertiary:#f4f4f5;--rc-fill:#e8e8ec;--rc-fill-secondary:#eeeeef;--rc-fill-tertiary:#f4f4f6;--rc-fill-quaternary:#f9f9fa;--rc-border:#f4f4f5;--rc-accent:#2563eb;--rc-accent-light:#2563eb20;--rc-link:#2563eb;--rc-code-text:#3f3f46;--rc-code-bg:#f4f4f5;--rc-hr-border:#e4e4e7;--rc-quote-border:#a1a1aa;--rc-quote-bg:#fafafa;--rc-alert-info:#006bb7;--rc-alert-warning:#c50;--rc-alert-tip:#1c0;--rc-alert-caution:#c01;--rc-alert-important:#50c;--rc-max-width:none;--rc-shadow-top-bar:0 8px 30px #0000001f, 0 2px 8px #0000000f;--rc-shadow-modal:0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a;--rc-shadow-menu:0 1px 4px #0000000a, 0 4px 16px #00000014;--rc-space-xs:2px;--rc-space-sm:4px;--rc-space-md:10px;--rc-space-lg:16px;--rc-space-xl:20px;--rc-font-family-sans:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif:"Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono:"SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs:.625em;--rc-font-size-xs:.75em;--rc-font-size-sm:.8125em;--rc-font-size-md:.875em;--rc-font-size-lg:1.25em;--rc-font-size-base:14px;--rc-font-size-small:12px;--rc-line-height:1.5;--rc-line-height-tight:1.3;--rc-font-family:"PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm:3px;--rc-radius-md:6px;--rc-radius-lg:12px}.dark .km6fx0,[data-theme=dark] .km6fx0,.dark.km6fx0,[data-theme=dark].km6fx0,.dark .km6fx1,[data-theme=dark] .km6fx1,.dark.km6fx1,[data-theme=dark].km6fx1,.dark .km6fx2,[data-theme=dark] .km6fx2,.dark.km6fx2,[data-theme=dark].km6fx2{--rc-text:#fafafa;--rc-text-secondary:#a1a1aa;--rc-text-tertiary:#71717a;--rc-text-quaternary:#52525b;--rc-bg:#09090b;--rc-bg-secondary:#18181b;--rc-bg-tertiary:#27272a;--rc-fill:#2a2a2f;--rc-fill-secondary:#222226;--rc-fill-tertiary:#1b1b1f;--rc-fill-quaternary:#131316;--rc-border:#27272a;--rc-accent:#60a5fa;--rc-accent-light:#60a5fa20;--rc-link:#60a5fa;--rc-code-text:#e4e4e7;--rc-code-bg:#27272a;--rc-hr-border:#27272a;--rc-quote-border:#60a5fa;--rc-quote-bg:#1e3a5f;--rc-alert-info:#7db9e5;--rc-alert-warning:#da864a;--rc-alert-tip:#54da48;--rc-alert-caution:#e16973;--rc-alert-important:#9966e0;--rc-shadow-top-bar:0 8px 30px #00000073, 0 2px 8px #0000004d;--rc-shadow-modal:0 10px 15px -3px #0006, 0 4px 6px -4px #00000059;--rc-shadow-menu:0 1px 4px #00000040, 0 4px 16px #0006}._1v9yxw30{overflow-x:auto}._1v9yxw31{caption-side:bottom;border-collapse:collapse;width:100%;font-size:var(--rc-font-size-small)}._1v9yxw32{height:2.5rem;padding:0 var(--rc-space-lg);vertical-align:middle;white-space:nowrap;color:var(--rc-text-secondary);font-weight:500;line-height:1.5}._1v9yxw33{padding:var(--rc-space-lg);vertical-align:middle;line-height:1.5}._1v9yxw31 tr:has(._1v9yxw32){border-bottom:1px solid var(--rc-border)}._1v9yxw31 tr:has(._1v9yxw33):nth-child(2n){background-color:var(--rc-bg-secondary)}._1v9yxw31:has(tr:hover) tr:has(._1v9yxw33):nth-child(2n):not(:hover){background-color:#0000}._1v9yxw31 tr:has(._1v9yxw33){transition:background-color .15s}._1v9yxw31 tr:has(._1v9yxw33):hover{background-color:var(--rc-fill-tertiary)}._1v9yxw31 .rich-paragraph{line-height:inherit;margin:0;padding:0}
2
- /*$vite$:1*/
1
+ :root{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}:root.dark{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.km6fx0{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.7;--rc-line-height-tight: 1.4;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.km6fx1{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #2563eb;--rc-quote-bg: #eff6ff;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: 700px;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 4px;--rc-space-sm: 8px;--rc-space-md: 16px;--rc-space-lg: 24px;--rc-space-xl: 32px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 16px;--rc-font-size-small: 14px;--rc-line-height: 1.8;--rc-line-height-tight: 1.4;--rc-font-family: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-radius-sm: 4px;--rc-radius-md: 8px;--rc-radius-lg: 12px}.km6fx2{--rc-text: #000;--rc-text-secondary: #27272a;--rc-text-tertiary: #71717a;--rc-text-quaternary: #a1a1aa;--rc-bg: #ffffff;--rc-bg-secondary: #fafafa;--rc-bg-tertiary: #f4f4f5;--rc-fill: #e8e8ec;--rc-fill-secondary: #eeeeef;--rc-fill-tertiary: #f4f4f6;--rc-fill-quaternary: #f9f9fa;--rc-border: #f4f4f5;--rc-accent: #2563eb;--rc-accent-light: #2563eb20;--rc-link: #2563eb;--rc-code-text: #3f3f46;--rc-code-bg: #f4f4f5;--rc-hr-border: #e4e4e7;--rc-quote-border: #a1a1aa;--rc-quote-bg: #fafafa;--rc-alert-info: #006bb7;--rc-alert-warning: #cc5500;--rc-alert-tip: #11cc00;--rc-alert-caution: #cc0011;--rc-alert-important: #5500cc;--rc-max-width: none;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .12), 0 2px 8px rgba(0, 0, 0, .06);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.08);--rc-space-xs: 2px;--rc-space-sm: 4px;--rc-space-md: 10px;--rc-space-lg: 16px;--rc-space-xl: 20px;--rc-font-family-sans: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-font-family-serif: "Noto Serif CJK SC", "Source Han Serif SC", "Source Han Serif", "source-han-serif-sc", "Songti SC", STSong, "华文宋体", serif;--rc-font-mono: "SF Mono", SFMono-Regular, ui-monospace, "DejaVu Sans Mono", Menlo, Consolas, monospace;--rc-font-size-2xs: .625em;--rc-font-size-xs: .75em;--rc-font-size-sm: .8125em;--rc-font-size-md: .875em;--rc-font-size-lg: 1.25em;--rc-font-size-base: 14px;--rc-font-size-small: 12px;--rc-line-height: 1.5;--rc-line-height-tight: 1.3;--rc-font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, "noto sans sc", "hiragino sans gb", -apple-system, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Not Color Emoji;--rc-radius-sm: 3px;--rc-radius-md: 6px;--rc-radius-lg: 12px}.dark .km6fx0,[data-theme=dark] .km6fx0,.dark.km6fx0,[data-theme=dark].km6fx0,.dark .km6fx1,[data-theme=dark] .km6fx1,.dark.km6fx1,[data-theme=dark].km6fx1,.dark .km6fx2,[data-theme=dark] .km6fx2,.dark.km6fx2,[data-theme=dark].km6fx2{--rc-text: #fafafa;--rc-text-secondary: #a1a1aa;--rc-text-tertiary: #71717a;--rc-text-quaternary: #52525b;--rc-bg: #09090b;--rc-bg-secondary: #18181b;--rc-bg-tertiary: #27272a;--rc-fill: #2a2a2f;--rc-fill-secondary: #222226;--rc-fill-tertiary: #1b1b1f;--rc-fill-quaternary: #131316;--rc-border: #27272a;--rc-accent: #60a5fa;--rc-accent-light: #60a5fa20;--rc-link: #60a5fa;--rc-code-text: #e4e4e7;--rc-code-bg: #27272a;--rc-hr-border: #27272a;--rc-quote-border: #60a5fa;--rc-quote-bg: #1e3a5f;--rc-alert-info: #7db9e5;--rc-alert-warning: #da864a;--rc-alert-tip: #54da48;--rc-alert-caution: #e16973;--rc-alert-important: #9966e0;--rc-shadow-top-bar: 0 8px 30px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .3);--rc-shadow-modal: 0 10px 15px -3px rgba(0,0,0,.4), 0 4px 6px -4px rgba(0,0,0,.35);--rc-shadow-menu: 0 1px 4px rgba(0,0,0,.25), 0 4px 16px rgba(0,0,0,.4)}._1v9yxw30{overflow-x:auto}._1v9yxw31{width:100%;caption-side:bottom;border-collapse:collapse;font-size:var(--rc-font-size-small)}._1v9yxw32{height:2.5rem;padding:0 var(--rc-space-lg);vertical-align:middle;font-weight:500;white-space:nowrap;color:var(--rc-text-secondary);line-height:1.5}._1v9yxw33{padding:var(--rc-space-lg);vertical-align:middle;line-height:1.5}._1v9yxw31 tr:has(._1v9yxw32){border-bottom:1px solid var(--rc-border)}._1v9yxw31 tr:has(._1v9yxw33):nth-child(2n){background-color:var(--rc-bg-secondary)}._1v9yxw31:has(tr:hover) tr:has(._1v9yxw33):nth-child(2n):not(:hover){background-color:transparent}._1v9yxw31 tr:has(._1v9yxw33){transition:background-color .15s}._1v9yxw31 tr:has(._1v9yxw33):hover{background-color:var(--rc-fill-tertiary)}._1v9yxw31 .rich-paragraph{margin:0;padding:0;line-height:inherit}
package/dist/types.d.ts CHANGED
@@ -7,6 +7,7 @@ export interface RichRendererProps {
7
7
  builtinNodeOverrides?: Record<string, BuiltinNodeRenderer>;
8
8
  className?: string;
9
9
  extraNodes?: Array<Klass<LexicalNode>>;
10
+ nested?: boolean;
10
11
  rendererConfig?: RendererConfig;
11
12
  style?: CSSProperties;
12
13
  theme?: ColorScheme;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/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;AAEtD,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,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACvC,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,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"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/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;AAEtD,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,WAAW,iBAAiB;IAChC,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACvC,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-static-renderer",
3
- "version": "0.0.82",
3
+ "version": "0.0.84",
4
4
  "description": "Headless SSR engine for Lexical rich content",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,8 +23,8 @@
23
23
  "@lexical/code": "npm:lexical-code-no-prism@0.41.0",
24
24
  "@lexical/headless": "^0.41.0",
25
25
  "lucide-react": "^0.577.0",
26
- "@haklex/rich-editor": "0.0.82",
27
- "@haklex/rich-style-token": "0.0.82"
26
+ "@haklex/rich-editor": "0.0.84",
27
+ "@haklex/rich-style-token": "0.0.84"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@lexical/extension": "^0.41.0",