@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.
- package/dist/RichRenderer.d.ts +1 -1
- package/dist/RichRenderer.d.ts.map +1 -1
- package/dist/components/HtmlComment.d.ts +6 -0
- package/dist/components/HtmlComment.d.ts.map +1 -0
- package/dist/engine/renderBuiltinNode.d.ts +1 -1
- package/dist/engine/renderBuiltinNode.d.ts.map +1 -1
- package/dist/engine/renderTextNode.d.ts.map +1 -1
- package/dist/index.mjs +464 -354
- package/dist/rich-static-renderer.css +1 -2
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/RichRenderer.d.ts
CHANGED
|
@@ -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":"
|
|
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 @@
|
|
|
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>,
|
|
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":"
|
|
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":"
|
|
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 {
|
|
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 {
|
|
6
|
+
import { useRef, useEffect, createElement, useMemo, isValidElement, cloneElement } from "react";
|
|
6
7
|
import { Link } from "lucide-react";
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
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
|
-
|
|
237
|
-
//#region src/RichRenderer.tsx
|
|
298
|
+
const alertClassName = (type) => `${semanticClassNames.alert} ${sharedStyles.alert} rich-alert-${type}`;
|
|
238
299
|
function wrapDecoration(serialized, key, decoration) {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
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
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
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({
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
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
|
-
|
|
383
|
-
|
|
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;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -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.
|
|
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.
|
|
27
|
-
"@haklex/rich-style-token": "0.0.
|
|
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",
|