@haklex/rich-renderer-katex 0.0.61 → 0.0.63
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/KaTeXEditDecorator.d.ts.map +1 -1
- package/dist/index.mjs +374 -91
- package/dist/rich-renderer-katex.css +1 -1
- package/dist/snippets.d.ts +18 -0
- package/dist/snippets.d.ts.map +1 -0
- package/dist/styles.css.d.ts +26 -0
- package/dist/styles.css.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXEditDecorator.d.ts","sourceRoot":"","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"KaTeXEditDecorator.d.ts","sourceRoot":"","sources":["../src/KaTeXEditDecorator.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAUzC,UAAU,uBAAuB;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,OAAO,CAAA;IACpB,QAAQ,EAAE,YAAY,CAAA;CACvB;AASD,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,QAAQ,EACR,WAAW,EACX,QAAQ,GACT,EAAE,uBAAuB,2CAoZzB"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { $isKaTeXInlineNode, $isKaTeXBlockNode, KaTeXRenderer, KaTeXBlockNode, createRendererDecoration, KaTeXInlineNode } from "@haklex/rich-editor";
|
|
2
|
-
import { useState, useRef, useEffect,
|
|
2
|
+
import { useState, useRef, useCallback, useEffect, useMemo, createElement } from "react";
|
|
3
3
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
4
4
|
import { Popover, PopoverTrigger, PopoverPanel, AnimatedTabs } from "@haklex/rich-editor-ui";
|
|
5
5
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import { $getNodeByKey } from "lexical";
|
|
7
|
-
import { Terminal, Trash2, Check, Copy, RotateCcw } from "lucide-react";
|
|
8
|
-
var semanticClassNames = { editWrapper: "rich-katex-edit-wrapper", panel: "rich-katex-editor-panel", header: "rich-katex-editor-header", headerLeft: "rich-katex-editor-header-left", iconWrap: "rich-katex-editor-icon-wrap", title: "rich-katex-editor-title", headerRight: "rich-katex-editor-header-right", mode: "rich-katex-editor-mode", deleteButton: "rich-katex-editor-delete", tabs: "rich-katex-editor-tabs", body: "rich-katex-editor-body", field: "rich-katex-editor-field", label: "rich-katex-editor-label", inputWrap: "rich-katex-editor-input-wrap", textarea: "rich-katex-editor-textarea", inputActions: "rich-katex-editor-input-actions", actionButton: "rich-katex-editor-action-btn", preview: "rich-katex-editor-preview", previewEmpty: "rich-katex-editor-preview-empty", snippetsPlaceholder: "rich-katex-editor-snippets-placeholder", footer: "rich-katex-editor-footer", charCount: "rich-katex-editor-charcount", footerActions: "rich-katex-editor-footer-actions", footerButton: "rich-katex-editor-btn", footerButtonPrimary: "rich-katex-editor-btn-primary" };
|
|
7
|
+
import { Terminal, Trash2, Check, Copy, RotateCcw, Search } from "lucide-react";
|
|
8
|
+
var semanticClassNames = { editWrapper: "rich-katex-edit-wrapper", panel: "rich-katex-editor-panel", header: "rich-katex-editor-header", headerLeft: "rich-katex-editor-header-left", iconWrap: "rich-katex-editor-icon-wrap", title: "rich-katex-editor-title", headerRight: "rich-katex-editor-header-right", mode: "rich-katex-editor-mode", deleteButton: "rich-katex-editor-delete", tabs: "rich-katex-editor-tabs", bodyScrollArea: "rich-katex-editor-body-scroll-area", body: "rich-katex-editor-body", field: "rich-katex-editor-field", label: "rich-katex-editor-label", inputWrap: "rich-katex-editor-input-wrap", textarea: "rich-katex-editor-textarea", inputActions: "rich-katex-editor-input-actions", actionButton: "rich-katex-editor-action-btn", preview: "rich-katex-editor-preview", previewEmpty: "rich-katex-editor-preview-empty", snippetSearchWrap: "rich-katex-editor-snippet-search-wrap", snippetSearchIcon: "rich-katex-editor-snippet-search-icon", snippetSearchInput: "rich-katex-editor-snippet-search-input", snippetGroups: "rich-katex-editor-snippet-groups", snippetGroup: "rich-katex-editor-snippet-group", snippetGroupLabel: "rich-katex-editor-snippet-group-label", snippetList: "rich-katex-editor-snippet-list", snippetButton: "rich-katex-editor-snippet-button", snippetMeta: "rich-katex-editor-snippet-meta", snippetName: "rich-katex-editor-snippet-name", snippetHint: "rich-katex-editor-snippet-hint", snippetPreview: "rich-katex-editor-snippet-preview", snippetsPlaceholder: "rich-katex-editor-snippets-placeholder", footer: "rich-katex-editor-footer", charCount: "rich-katex-editor-charcount", footerActions: "rich-katex-editor-footer-actions", footerButton: "rich-katex-editor-btn", footerButtonPrimary: "rich-katex-editor-btn-primary" };
|
|
9
9
|
var editWrapper = "mkenhu0";
|
|
10
10
|
var panel = "mkenhu1";
|
|
11
11
|
var header = "mkenhu2";
|
|
@@ -16,21 +16,136 @@ var headerRight = "mkenhu6";
|
|
|
16
16
|
var mode = "mkenhu7";
|
|
17
17
|
var deleteButton = "mkenhu8";
|
|
18
18
|
var tabs = "mkenhu9";
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
var
|
|
22
|
-
var
|
|
23
|
-
var
|
|
24
|
-
var
|
|
25
|
-
var
|
|
26
|
-
var
|
|
27
|
-
var
|
|
28
|
-
var
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
var
|
|
19
|
+
var bodyScrollArea = "mkenhua";
|
|
20
|
+
var body = "mkenhub";
|
|
21
|
+
var field = "mkenhuc";
|
|
22
|
+
var label = "mkenhud";
|
|
23
|
+
var inputWrap = "mkenhue";
|
|
24
|
+
var textarea = "mkenhuf";
|
|
25
|
+
var inputActions = "mkenhug";
|
|
26
|
+
var actionButton = "mkenhuh";
|
|
27
|
+
var preview = "mkenhui";
|
|
28
|
+
var previewEmpty = "mkenhuj";
|
|
29
|
+
var snippetSearchWrap = "mkenhuk";
|
|
30
|
+
var snippetSearchIcon = "mkenhul";
|
|
31
|
+
var snippetSearchInput = "mkenhum";
|
|
32
|
+
var snippetGroups = "mkenhun";
|
|
33
|
+
var snippetGroup = "mkenhuo";
|
|
34
|
+
var snippetGroupLabel = "mkenhup";
|
|
35
|
+
var snippetList = "mkenhuq";
|
|
36
|
+
var snippetButton = "mkenhur";
|
|
37
|
+
var snippetMeta = "mkenhus";
|
|
38
|
+
var snippetName = "mkenhut";
|
|
39
|
+
var snippetHint = "mkenhuu";
|
|
40
|
+
var snippetPreview = "mkenhuv";
|
|
41
|
+
var snippetsPlaceholder = "mkenhuw";
|
|
42
|
+
var footer = "mkenhux";
|
|
43
|
+
var charCount = "mkenhuy";
|
|
44
|
+
var footerActions = "mkenhuz";
|
|
45
|
+
var footerButton = "mkenhu10";
|
|
46
|
+
var footerButtonPrimary = "mkenhu11";
|
|
47
|
+
const CURSOR_TOKEN = "__cursor__";
|
|
48
|
+
const katexSnippets = [
|
|
49
|
+
{
|
|
50
|
+
id: "frac",
|
|
51
|
+
title: "Fraction",
|
|
52
|
+
template: `\\frac{1}{${CURSOR_TOKEN}}`,
|
|
53
|
+
previewEquation: "\\frac{a}{b}",
|
|
54
|
+
category: "Basic",
|
|
55
|
+
keywords: ["fraction", "divide", "ratio"]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "sqrt",
|
|
59
|
+
title: "Square Root",
|
|
60
|
+
template: `\\sqrt{${CURSOR_TOKEN}}`,
|
|
61
|
+
previewEquation: "\\sqrt{x}",
|
|
62
|
+
category: "Basic",
|
|
63
|
+
keywords: ["root", "radical"]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
id: "alpha",
|
|
67
|
+
title: "Alpha",
|
|
68
|
+
template: `\\alpha${CURSOR_TOKEN}`,
|
|
69
|
+
previewEquation: "\\alpha",
|
|
70
|
+
category: "Greek",
|
|
71
|
+
keywords: ["greek", "letter"]
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
id: "theta",
|
|
75
|
+
title: "Theta",
|
|
76
|
+
template: `\\theta${CURSOR_TOKEN}`,
|
|
77
|
+
previewEquation: "\\theta",
|
|
78
|
+
category: "Greek",
|
|
79
|
+
keywords: ["greek", "angle", "letter"]
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "sum",
|
|
83
|
+
title: "Summation",
|
|
84
|
+
template: `\\sum_{i=1}^{n} ${CURSOR_TOKEN}`,
|
|
85
|
+
previewEquation: "\\sum_{i=1}^{n} x_i",
|
|
86
|
+
category: "Operators",
|
|
87
|
+
keywords: ["series", "sigma", "total"]
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: "int",
|
|
91
|
+
title: "Integral",
|
|
92
|
+
template: `\\int_{a}^{b} ${CURSOR_TOKEN} \\, dx`,
|
|
93
|
+
previewEquation: "\\int_{a}^{b} f(x) \\, dx",
|
|
94
|
+
category: "Operators",
|
|
95
|
+
keywords: ["integral", "calculus"]
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: "matrix",
|
|
99
|
+
title: "Matrix",
|
|
100
|
+
template: `\\begin{bmatrix}${CURSOR_TOKEN}\\end{bmatrix}`,
|
|
101
|
+
previewEquation: "\\begin{bmatrix} a & b \\\\ c & d \\end{bmatrix}",
|
|
102
|
+
category: "Structures",
|
|
103
|
+
keywords: ["array", "linear algebra"]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
id: "cases",
|
|
107
|
+
title: "Cases",
|
|
108
|
+
template: `\\begin{cases}${CURSOR_TOKEN}\\end{cases}`,
|
|
109
|
+
previewEquation: "\\begin{cases} x & x > 0 \\\\ 0 & x = 0 \\end{cases}",
|
|
110
|
+
category: "Structures",
|
|
111
|
+
keywords: ["piecewise", "conditional"]
|
|
112
|
+
}
|
|
113
|
+
];
|
|
114
|
+
function filterKaTeXSnippets(query) {
|
|
115
|
+
const normalizedQuery = query.trim().toLowerCase();
|
|
116
|
+
if (!normalizedQuery) {
|
|
117
|
+
return katexSnippets;
|
|
118
|
+
}
|
|
119
|
+
return katexSnippets.filter((snippet) => {
|
|
120
|
+
const haystack = [
|
|
121
|
+
snippet.id,
|
|
122
|
+
snippet.title,
|
|
123
|
+
snippet.category,
|
|
124
|
+
snippet.previewEquation,
|
|
125
|
+
...snippet.keywords
|
|
126
|
+
].join(" ").toLowerCase();
|
|
127
|
+
return haystack.includes(normalizedQuery);
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
function insertSnippetAtSelection(value, template, selectionStart, selectionEnd) {
|
|
131
|
+
const start = selectionStart ?? value.length;
|
|
132
|
+
const end = selectionEnd ?? start;
|
|
133
|
+
const cursorOffset = template.indexOf(CURSOR_TOKEN);
|
|
134
|
+
const sanitizedTemplate = template.replace(CURSOR_TOKEN, "");
|
|
135
|
+
const nextValue = value.slice(0, start) + sanitizedTemplate + value.slice(Math.max(start, end));
|
|
136
|
+
const nextCursorPosition = start + (cursorOffset >= 0 ? cursorOffset : sanitizedTemplate.length);
|
|
137
|
+
return {
|
|
138
|
+
value: nextValue,
|
|
139
|
+
selectionStart: nextCursorPosition,
|
|
140
|
+
selectionEnd: nextCursorPosition
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const SNIPPET_CATEGORY_ORDER = [
|
|
144
|
+
"Basic",
|
|
145
|
+
"Greek",
|
|
146
|
+
"Operators",
|
|
147
|
+
"Structures"
|
|
148
|
+
];
|
|
34
149
|
function KaTeXEditDecorator({
|
|
35
150
|
nodeKey,
|
|
36
151
|
equation,
|
|
@@ -43,7 +158,19 @@ function KaTeXEditDecorator({
|
|
|
43
158
|
const [value, setValue] = useState(equation);
|
|
44
159
|
const [copied, setCopied] = useState(false);
|
|
45
160
|
const [activeTab, setActiveTab] = useState("editor");
|
|
161
|
+
const [snippetQuery, setSnippetQuery] = useState("");
|
|
46
162
|
const inputRef = useRef(null);
|
|
163
|
+
const selectionRef = useRef({
|
|
164
|
+
start: null,
|
|
165
|
+
end: null
|
|
166
|
+
});
|
|
167
|
+
const syncSelection = useCallback((target) => {
|
|
168
|
+
if (!target) return;
|
|
169
|
+
selectionRef.current = {
|
|
170
|
+
start: target.selectionStart,
|
|
171
|
+
end: target.selectionEnd
|
|
172
|
+
};
|
|
173
|
+
}, []);
|
|
47
174
|
useEffect(() => {
|
|
48
175
|
setValue(equation);
|
|
49
176
|
}, [equation]);
|
|
@@ -51,8 +178,9 @@ function KaTeXEditDecorator({
|
|
|
51
178
|
if (open && inputRef.current) {
|
|
52
179
|
inputRef.current.focus();
|
|
53
180
|
inputRef.current.select();
|
|
181
|
+
syncSelection(inputRef.current);
|
|
54
182
|
}
|
|
55
|
-
}, [open]);
|
|
183
|
+
}, [open, syncSelection]);
|
|
56
184
|
const commit = useCallback(() => {
|
|
57
185
|
const trimmed = value.trim();
|
|
58
186
|
if (!trimmed) return;
|
|
@@ -85,6 +213,42 @@ function KaTeXEditDecorator({
|
|
|
85
213
|
setValue(equation);
|
|
86
214
|
inputRef.current?.focus();
|
|
87
215
|
}, [equation]);
|
|
216
|
+
const handleInsertSnippet = useCallback(
|
|
217
|
+
(template) => {
|
|
218
|
+
const next = insertSnippetAtSelection(
|
|
219
|
+
value,
|
|
220
|
+
template,
|
|
221
|
+
selectionRef.current.start,
|
|
222
|
+
selectionRef.current.end
|
|
223
|
+
);
|
|
224
|
+
setValue(next.value);
|
|
225
|
+
setActiveTab("editor");
|
|
226
|
+
requestAnimationFrame(() => {
|
|
227
|
+
const input = inputRef.current;
|
|
228
|
+
if (!input) return;
|
|
229
|
+
input.focus();
|
|
230
|
+
input.setSelectionRange(next.selectionStart, next.selectionEnd);
|
|
231
|
+
selectionRef.current = {
|
|
232
|
+
start: next.selectionStart,
|
|
233
|
+
end: next.selectionEnd
|
|
234
|
+
};
|
|
235
|
+
});
|
|
236
|
+
},
|
|
237
|
+
[value]
|
|
238
|
+
);
|
|
239
|
+
const filteredSnippets = useMemo(
|
|
240
|
+
() => filterKaTeXSnippets(snippetQuery),
|
|
241
|
+
[snippetQuery]
|
|
242
|
+
);
|
|
243
|
+
const groupedSnippets = useMemo(
|
|
244
|
+
() => SNIPPET_CATEGORY_ORDER.map((category) => ({
|
|
245
|
+
category,
|
|
246
|
+
items: filteredSnippets.filter(
|
|
247
|
+
(snippet) => snippet.category === category
|
|
248
|
+
)
|
|
249
|
+
})).filter((group) => group.items.length > 0),
|
|
250
|
+
[filteredSnippets]
|
|
251
|
+
);
|
|
88
252
|
const handleKeyDown = useCallback(
|
|
89
253
|
(e) => {
|
|
90
254
|
if (e.key === "Escape") {
|
|
@@ -186,65 +350,79 @@ function KaTeXEditDecorator({
|
|
|
186
350
|
className: `${tabs} ${semanticClassNames.tabs}`
|
|
187
351
|
}
|
|
188
352
|
),
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
{
|
|
193
|
-
|
|
194
|
-
children: [
|
|
195
|
-
/* @__PURE__ */ jsx(
|
|
196
|
-
"label",
|
|
197
|
-
{
|
|
198
|
-
className: `${label} ${semanticClassNames.label}`,
|
|
199
|
-
children: "LaTeX Input"
|
|
200
|
-
}
|
|
201
|
-
),
|
|
353
|
+
/* @__PURE__ */ jsxs(
|
|
354
|
+
"div",
|
|
355
|
+
{
|
|
356
|
+
className: `${bodyScrollArea} ${semanticClassNames.bodyScrollArea}`,
|
|
357
|
+
children: [
|
|
358
|
+
activeTab === "editor" && /* @__PURE__ */ jsxs("div", { className: `${body} ${semanticClassNames.body}`, children: [
|
|
202
359
|
/* @__PURE__ */ jsxs(
|
|
203
360
|
"div",
|
|
204
361
|
{
|
|
205
|
-
className: `${
|
|
362
|
+
className: `${field} ${semanticClassNames.field}`,
|
|
206
363
|
children: [
|
|
207
364
|
/* @__PURE__ */ jsx(
|
|
208
|
-
"
|
|
365
|
+
"label",
|
|
209
366
|
{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
value,
|
|
213
|
-
onChange: (e) => setValue(e.target.value),
|
|
214
|
-
onKeyDown: handleKeyDown,
|
|
215
|
-
rows: displayMode ? 4 : 3,
|
|
216
|
-
spellCheck: false,
|
|
217
|
-
autoComplete: "off",
|
|
218
|
-
autoCorrect: "off",
|
|
219
|
-
autoCapitalize: "off",
|
|
220
|
-
placeholder: "e.g. \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}"
|
|
367
|
+
className: `${label} ${semanticClassNames.label}`,
|
|
368
|
+
children: "LaTeX Input"
|
|
221
369
|
}
|
|
222
370
|
),
|
|
223
371
|
/* @__PURE__ */ jsxs(
|
|
224
372
|
"div",
|
|
225
373
|
{
|
|
226
|
-
className: `${
|
|
374
|
+
className: `${inputWrap} ${semanticClassNames.inputWrap}`,
|
|
227
375
|
children: [
|
|
228
376
|
/* @__PURE__ */ jsx(
|
|
229
|
-
"
|
|
377
|
+
"textarea",
|
|
230
378
|
{
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
379
|
+
ref: inputRef,
|
|
380
|
+
className: `${textarea} ${semanticClassNames.textarea}`,
|
|
381
|
+
value,
|
|
382
|
+
onChange: (e) => {
|
|
383
|
+
setValue(e.target.value);
|
|
384
|
+
syncSelection(e.target);
|
|
385
|
+
},
|
|
386
|
+
onKeyDown: handleKeyDown,
|
|
387
|
+
onSelect: (e) => syncSelection(e.currentTarget),
|
|
388
|
+
onClick: (e) => syncSelection(e.currentTarget),
|
|
389
|
+
onKeyUp: (e) => syncSelection(e.currentTarget),
|
|
390
|
+
rows: displayMode ? 4 : 3,
|
|
391
|
+
spellCheck: false,
|
|
392
|
+
autoComplete: "off",
|
|
393
|
+
autoCorrect: "off",
|
|
394
|
+
autoCapitalize: "off",
|
|
395
|
+
placeholder: "e.g. \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}"
|
|
237
396
|
}
|
|
238
397
|
),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
"
|
|
398
|
+
/* @__PURE__ */ jsxs(
|
|
399
|
+
"div",
|
|
241
400
|
{
|
|
242
|
-
className: `${
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
401
|
+
className: `${inputActions} ${semanticClassNames.inputActions}`,
|
|
402
|
+
children: [
|
|
403
|
+
/* @__PURE__ */ jsx(
|
|
404
|
+
"button",
|
|
405
|
+
{
|
|
406
|
+
className: `${actionButton} ${semanticClassNames.actionButton}`,
|
|
407
|
+
type: "button",
|
|
408
|
+
onClick: handleCopy,
|
|
409
|
+
title: "Copy LaTeX",
|
|
410
|
+
disabled: !value.trim(),
|
|
411
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { size: 12, style: { color: "#22c55e" } }) : /* @__PURE__ */ jsx(Copy, { size: 12 })
|
|
412
|
+
}
|
|
413
|
+
),
|
|
414
|
+
/* @__PURE__ */ jsx(
|
|
415
|
+
"button",
|
|
416
|
+
{
|
|
417
|
+
className: `${actionButton} ${semanticClassNames.actionButton}`,
|
|
418
|
+
type: "button",
|
|
419
|
+
onClick: handleReset,
|
|
420
|
+
title: "Reset",
|
|
421
|
+
disabled: value === equation,
|
|
422
|
+
children: /* @__PURE__ */ jsx(RotateCcw, { size: 12 })
|
|
423
|
+
}
|
|
424
|
+
)
|
|
425
|
+
]
|
|
248
426
|
}
|
|
249
427
|
)
|
|
250
428
|
]
|
|
@@ -252,46 +430,151 @@ function KaTeXEditDecorator({
|
|
|
252
430
|
)
|
|
253
431
|
]
|
|
254
432
|
}
|
|
433
|
+
),
|
|
434
|
+
/* @__PURE__ */ jsxs(
|
|
435
|
+
"div",
|
|
436
|
+
{
|
|
437
|
+
className: `${field} ${semanticClassNames.field}`,
|
|
438
|
+
children: [
|
|
439
|
+
/* @__PURE__ */ jsx(
|
|
440
|
+
"label",
|
|
441
|
+
{
|
|
442
|
+
className: `${label} ${semanticClassNames.label}`,
|
|
443
|
+
children: "Preview"
|
|
444
|
+
}
|
|
445
|
+
),
|
|
446
|
+
/* @__PURE__ */ jsx(
|
|
447
|
+
"div",
|
|
448
|
+
{
|
|
449
|
+
className: `${preview} ${semanticClassNames.preview}`,
|
|
450
|
+
children: value.trim() ? /* @__PURE__ */ jsx(KaTeXRenderer, { equation: value, displayMode }) : /* @__PURE__ */ jsx(
|
|
451
|
+
"span",
|
|
452
|
+
{
|
|
453
|
+
className: `${previewEmpty} ${semanticClassNames.previewEmpty}`,
|
|
454
|
+
children: "Enter a formula"
|
|
455
|
+
}
|
|
456
|
+
)
|
|
457
|
+
}
|
|
458
|
+
)
|
|
459
|
+
]
|
|
460
|
+
}
|
|
255
461
|
)
|
|
256
|
-
]
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
"div",
|
|
261
|
-
{
|
|
262
|
-
className: `${field} ${semanticClassNames.field}`,
|
|
263
|
-
children: [
|
|
264
|
-
/* @__PURE__ */ jsx(
|
|
265
|
-
"label",
|
|
462
|
+
] }),
|
|
463
|
+
activeTab === "snippets" && /* @__PURE__ */ jsxs("div", { className: `${body} ${semanticClassNames.body}`, children: [
|
|
464
|
+
/* @__PURE__ */ jsxs(
|
|
465
|
+
"div",
|
|
266
466
|
{
|
|
267
|
-
className: `${
|
|
268
|
-
children:
|
|
467
|
+
className: `${snippetSearchWrap} ${semanticClassNames.snippetSearchWrap}`,
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx(
|
|
470
|
+
Search,
|
|
471
|
+
{
|
|
472
|
+
size: 14,
|
|
473
|
+
className: `${snippetSearchIcon} ${semanticClassNames.snippetSearchIcon}`
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
/* @__PURE__ */ jsx(
|
|
477
|
+
"input",
|
|
478
|
+
{
|
|
479
|
+
className: `${snippetSearchInput} ${semanticClassNames.snippetSearchInput}`,
|
|
480
|
+
type: "text",
|
|
481
|
+
value: snippetQuery,
|
|
482
|
+
onChange: (e) => setSnippetQuery(e.target.value),
|
|
483
|
+
placeholder: "Search snippets: frac, matrix, sum...",
|
|
484
|
+
autoComplete: "off"
|
|
485
|
+
}
|
|
486
|
+
)
|
|
487
|
+
]
|
|
269
488
|
}
|
|
270
489
|
),
|
|
271
|
-
/* @__PURE__ */ jsx(
|
|
490
|
+
groupedSnippets.length > 0 ? /* @__PURE__ */ jsx(
|
|
272
491
|
"div",
|
|
273
492
|
{
|
|
274
|
-
className: `${
|
|
275
|
-
children:
|
|
276
|
-
"
|
|
493
|
+
className: `${snippetGroups} ${semanticClassNames.snippetGroups}`,
|
|
494
|
+
children: groupedSnippets.map((group) => /* @__PURE__ */ jsxs(
|
|
495
|
+
"section",
|
|
277
496
|
{
|
|
278
|
-
className: `${
|
|
279
|
-
children:
|
|
280
|
-
|
|
281
|
-
|
|
497
|
+
className: `${snippetGroup} ${semanticClassNames.snippetGroup}`,
|
|
498
|
+
children: [
|
|
499
|
+
/* @__PURE__ */ jsx(
|
|
500
|
+
"div",
|
|
501
|
+
{
|
|
502
|
+
className: `${snippetGroupLabel} ${semanticClassNames.snippetGroupLabel}`,
|
|
503
|
+
children: group.category
|
|
504
|
+
}
|
|
505
|
+
),
|
|
506
|
+
/* @__PURE__ */ jsx(
|
|
507
|
+
"div",
|
|
508
|
+
{
|
|
509
|
+
className: `${snippetList} ${semanticClassNames.snippetList}`,
|
|
510
|
+
children: group.items.map((snippet) => /* @__PURE__ */ jsxs(
|
|
511
|
+
"button",
|
|
512
|
+
{
|
|
513
|
+
className: `${snippetButton} ${semanticClassNames.snippetButton}`,
|
|
514
|
+
type: "button",
|
|
515
|
+
onClick: () => handleInsertSnippet(snippet.template),
|
|
516
|
+
children: [
|
|
517
|
+
/* @__PURE__ */ jsxs(
|
|
518
|
+
"div",
|
|
519
|
+
{
|
|
520
|
+
className: `${snippetMeta} ${semanticClassNames.snippetMeta}`,
|
|
521
|
+
children: [
|
|
522
|
+
/* @__PURE__ */ jsx(
|
|
523
|
+
"span",
|
|
524
|
+
{
|
|
525
|
+
className: `${snippetName} ${semanticClassNames.snippetName}`,
|
|
526
|
+
children: snippet.title
|
|
527
|
+
}
|
|
528
|
+
),
|
|
529
|
+
/* @__PURE__ */ jsx(
|
|
530
|
+
"span",
|
|
531
|
+
{
|
|
532
|
+
className: `${snippetHint} ${semanticClassNames.snippetHint}`,
|
|
533
|
+
children: snippet.template.replace(CURSOR_TOKEN, "")
|
|
534
|
+
}
|
|
535
|
+
)
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
/* @__PURE__ */ jsx(
|
|
540
|
+
"span",
|
|
541
|
+
{
|
|
542
|
+
className: `${snippetPreview} ${semanticClassNames.snippetPreview}`,
|
|
543
|
+
children: /* @__PURE__ */ jsx(
|
|
544
|
+
KaTeXRenderer,
|
|
545
|
+
{
|
|
546
|
+
equation: snippet.previewEquation,
|
|
547
|
+
displayMode: false
|
|
548
|
+
}
|
|
549
|
+
)
|
|
550
|
+
}
|
|
551
|
+
)
|
|
552
|
+
]
|
|
553
|
+
},
|
|
554
|
+
snippet.id
|
|
555
|
+
))
|
|
556
|
+
}
|
|
557
|
+
)
|
|
558
|
+
]
|
|
559
|
+
},
|
|
560
|
+
group.category
|
|
561
|
+
))
|
|
562
|
+
}
|
|
563
|
+
) : /* @__PURE__ */ jsxs(
|
|
564
|
+
"div",
|
|
565
|
+
{
|
|
566
|
+
className: `${snippetsPlaceholder} ${semanticClassNames.snippetsPlaceholder}`,
|
|
567
|
+
children: [
|
|
568
|
+
"No snippets match “",
|
|
569
|
+
snippetQuery.trim(),
|
|
570
|
+
"”"
|
|
571
|
+
]
|
|
282
572
|
}
|
|
283
573
|
)
|
|
284
|
-
]
|
|
285
|
-
|
|
286
|
-
)
|
|
287
|
-
] }),
|
|
288
|
-
activeTab === "snippets" && /* @__PURE__ */ jsx("div", { className: `${body} ${semanticClassNames.body}`, children: /* @__PURE__ */ jsx(
|
|
289
|
-
"div",
|
|
290
|
-
{
|
|
291
|
-
className: `${snippetsPlaceholder} ${semanticClassNames.snippetsPlaceholder}`,
|
|
292
|
-
children: "Snippets coming soon"
|
|
574
|
+
] })
|
|
575
|
+
]
|
|
293
576
|
}
|
|
294
|
-
)
|
|
577
|
+
),
|
|
295
578
|
/* @__PURE__ */ jsxs("div", { className: `${footer} ${semanticClassNames.footer}`, children: [
|
|
296
579
|
/* @__PURE__ */ jsx(
|
|
297
580
|
"span",
|
|
@@ -1 +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}.x1ktjw0{--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}.x1ktjw1{--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}.x1ktjw2{--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: 8px}.dark .x1ktjw0,[data-theme=dark] .x1ktjw0,.dark.x1ktjw0,[data-theme=dark].x1ktjw0,.dark .x1ktjw1,[data-theme=dark] .x1ktjw1,.dark.x1ktjw1,[data-theme=dark].x1ktjw1,.dark .x1ktjw2,[data-theme=dark] .x1ktjw2,.dark.x1ktjw2,[data-theme=dark].x1ktjw2{--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)}.mkenhu0{cursor:pointer;border-radius:var(--rc-radius-sm);transition:background-color .15s ease}.mkenhu0:hover{background-color:var(--rc-accent-light)}.mkenhu1{width:min(420px,90vw);padding:0;overflow:hidden;box-shadow:var(--rc-shadow-modal);font-family:var(--rc-font-family)}.mkenhu2{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent)}.mkenhu3{display:flex;align-items:center;gap:8px}.mkenhu4{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--rc-radius-sm);background-color:var(--rc-accent-light);color:var(--rc-accent)}.mkenhu5{font-weight:600;font-size:var(--rc-font-size-md);color:var(--rc-text)}.mkenhu6{display:flex;align-items:center;gap:4px}.mkenhu7{font-size:var(--rc-font-size-2xs);font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--rc-text-secondary);padding:1px 6px;border-radius:var(--rc-radius-sm);background-color:var(--rc-bg-secondary)}.mkenhu8{display:flex;align-items:center;justify-content:center;appearance:none;border:none;background:none;color:var(--rc-text-secondary);cursor:pointer;width:28px;height:28px;border-radius:var(--rc-radius-sm);transition:color .15s ease,background-color .15s ease;flex-shrink:0}.mkenhu8:hover{color:var(--rc-alert-caution);background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent)}.mkenhu9{padding:0 16px}.mkenhua{padding:12px;display:flex;flex-direction:column;gap:12px}.mkenhub{display:flex;flex-direction:column}.mkenhuc{font-size:var(--rc-font-size-2xs);font-weight:500;text-transform:uppercase;letter-spacing:.06em;color:var(--rc-text-secondary);margin-bottom:6px;padding-left:2px}.mkenhud{position:relative}.mkenhue{display:block;width:100%;padding:10px 56px 10px 12px;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-md);line-height:1.5;background-color:color-mix(in srgb,var(--rc-bg-secondary) 30%,transparent);color:var(--rc-text);border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);border-radius:var(--rc-radius-md);outline:none;resize:none;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}.mkenhue::placeholder{color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent)}.mkenhue:focus{border-color:color-mix(in srgb,var(--rc-accent) 50%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--rc-accent) 25%,transparent)}.mkenhuf{position:absolute;right:6px;top:6px;display:flex;gap:2px}.mkenhug{display:flex;align-items:center;justify-content:center;appearance:none;border:none;background:none;color:color-mix(in srgb,var(--rc-text-secondary) 60%,transparent);cursor:pointer;width:24px;height:24px;border-radius:var(--rc-radius-sm);transition:color .15s ease,background-color .15s ease}.mkenhug:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}.mkenhug:disabled{opacity:.3;cursor:default;pointer-events:none}.mkenhuh{border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);border-radius:var(--rc-radius-md);padding:var(--rc-space-md);min-height:60px;display:flex;align-items:center;justify-content:center;overflow-x:auto;background-color:var(--rc-bg)}.mkenhui{color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent);font-size:var(--rc-font-size-md)}.mkenhuj{color:var(--rc-text-secondary);font-size:var(--rc-font-size-md);text-align:center;padding:var(--rc-space-lg) 0}.mkenhuk{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-top:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);background-color:color-mix(in srgb,var(--rc-bg-secondary) 20%,transparent)}.mkenhul{color:var(--rc-text-secondary);font-size:var(--rc-font-size-2xs);font-family:var(--rc-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.mkenhum{display:flex;align-items:center;gap:8px}.mkenhun{appearance:none;border:none;background:none;color:var(--rc-text-secondary);cursor:pointer;padding:4px 10px;border-radius:var(--rc-radius-sm);font-size:var(--rc-font-size-xs);font-weight:500;line-height:1.4;height:28px;display:inline-flex;align-items:center;transition:color .15s ease,background-color .15s ease}.mkenhun:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}.mkenhuo{background-color:var(--rc-accent);color:#fff}.mkenhuo:hover{background-color:var(--rc-accent);filter:brightness(.9);color:#fff}.mkenhuo:disabled{opacity:.5;cursor:default;pointer-events:none}
|
|
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}.x1ktjw0{--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}.x1ktjw1{--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}.x1ktjw2{--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: 8px}.dark .x1ktjw0,[data-theme=dark] .x1ktjw0,.dark.x1ktjw0,[data-theme=dark].x1ktjw0,.dark .x1ktjw1,[data-theme=dark] .x1ktjw1,.dark.x1ktjw1,[data-theme=dark].x1ktjw1,.dark .x1ktjw2,[data-theme=dark] .x1ktjw2,.dark.x1ktjw2,[data-theme=dark].x1ktjw2{--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)}.mkenhu0{cursor:pointer;border-radius:var(--rc-radius-sm);transition:background-color .15s ease}.mkenhu0:hover{background-color:var(--rc-accent-light)}.mkenhu1{width:min(420px,90vw);padding:0;overflow:hidden;box-shadow:var(--rc-shadow-modal);font-family:var(--rc-font-family)}.mkenhu2{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-bottom:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent)}.mkenhu3{display:flex;align-items:center;gap:8px}.mkenhu4{display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:var(--rc-radius-sm);background-color:var(--rc-accent-light);color:var(--rc-accent)}.mkenhu5{font-weight:600;font-size:var(--rc-font-size-md);color:var(--rc-text)}.mkenhu6{display:flex;align-items:center;gap:4px}.mkenhu7{font-size:var(--rc-font-size-2xs);font-weight:500;text-transform:uppercase;letter-spacing:.04em;color:var(--rc-text-secondary);padding:1px 6px;border-radius:var(--rc-radius-sm);background-color:var(--rc-bg-secondary)}.mkenhu8{display:flex;align-items:center;justify-content:center;appearance:none;border:none;background:none;color:var(--rc-text-secondary);cursor:pointer;width:28px;height:28px;border-radius:var(--rc-radius-sm);transition:color .15s ease,background-color .15s ease;flex-shrink:0}.mkenhu8:hover{color:var(--rc-alert-caution);background-color:color-mix(in srgb,var(--rc-alert-caution) 10%,transparent)}.mkenhu9{padding:0 16px}.mkenhua{max-height:320px;overflow-y:auto;overflow-x:hidden;flex-shrink:0}.mkenhub{padding:12px;display:flex;flex-direction:column;gap:12px}.mkenhuc{display:flex;flex-direction:column}.mkenhud{font-size:var(--rc-font-size-2xs);font-weight:500;text-transform:uppercase;letter-spacing:.06em;color:var(--rc-text-secondary);margin-bottom:6px;padding-left:2px}.mkenhue{position:relative}.mkenhuf{display:block;width:100%;padding:10px 56px 10px 12px;font-family:var(--rc-font-mono);font-size:var(--rc-font-size-md);line-height:1.5;background-color:color-mix(in srgb,var(--rc-bg-secondary) 30%,transparent);color:var(--rc-text);border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);border-radius:var(--rc-radius-md);outline:none;resize:none;box-sizing:border-box;transition:border-color .15s ease,box-shadow .15s ease}.mkenhuf::placeholder{color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent)}.mkenhuf:focus{border-color:color-mix(in srgb,var(--rc-accent) 50%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--rc-accent) 25%,transparent)}.mkenhug{position:absolute;right:6px;top:6px;display:flex;gap:2px}.mkenhuh{display:flex;align-items:center;justify-content:center;appearance:none;border:none;background:none;color:color-mix(in srgb,var(--rc-text-secondary) 60%,transparent);cursor:pointer;width:24px;height:24px;border-radius:var(--rc-radius-sm);transition:color .15s ease,background-color .15s ease}.mkenhuh:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}.mkenhuh:disabled{opacity:.3;cursor:default;pointer-events:none}.mkenhui{border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);border-radius:var(--rc-radius-md);padding:var(--rc-space-md);min-height:60px;display:flex;align-items:center;justify-content:center;overflow-x:auto;background-color:var(--rc-bg)}.mkenhuj{color:color-mix(in srgb,var(--rc-text-secondary) 50%,transparent);font-size:var(--rc-font-size-md)}.mkenhuk{position:relative}.mkenhul{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:color-mix(in srgb,var(--rc-text-secondary) 70%,transparent);pointer-events:none}.mkenhum{width:100%;height:34px;padding:0 12px 0 32px;border-radius:var(--rc-radius-md);border:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);background-color:color-mix(in srgb,var(--rc-bg-secondary) 24%,transparent);color:var(--rc-text);outline:none;box-sizing:border-box;font-size:var(--rc-font-size-sm)}.mkenhum::placeholder{color:color-mix(in srgb,var(--rc-text-secondary) 55%,transparent)}.mkenhum:focus{border-color:color-mix(in srgb,var(--rc-accent) 45%,transparent);box-shadow:0 0 0 2px color-mix(in srgb,var(--rc-accent) 18%,transparent)}.mkenhun{display:flex;flex-direction:column;gap:12px}.mkenhuo{display:flex;flex-direction:column;gap:6px}.mkenhup{font-size:var(--rc-font-size-2xs);font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--rc-text-secondary);padding-left:2px}.mkenhuq{display:flex;flex-direction:column;gap:6px}.mkenhur{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;border:1px solid color-mix(in srgb,var(--rc-border) 55%,transparent);border-radius:var(--rc-radius-md);background-color:color-mix(in srgb,var(--rc-bg-secondary) 18%,transparent);padding:10px 12px;cursor:pointer;transition:border-color .15s ease,background-color .15s ease,transform .15s ease}.mkenhur:hover{border-color:color-mix(in srgb,var(--rc-accent) 30%,var(--rc-border));background-color:color-mix(in srgb,var(--rc-accent-light) 30%,var(--rc-bg-secondary));transform:translateY(-1px)}.mkenhus{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.mkenhut{font-size:var(--rc-font-size-sm);font-weight:600;color:var(--rc-text)}.mkenhuu{font-size:var(--rc-font-size-2xs);font-family:var(--rc-font-mono);color:var(--rc-text-secondary);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mkenhuv{display:inline-flex;align-items:center;justify-content:center;min-width:72px;min-height:32px;padding:0 8px;border-radius:var(--rc-radius-sm);background-color:var(--rc-bg);color:var(--rc-text);overflow:hidden;flex-shrink:0}.mkenhuw{color:var(--rc-text-secondary);font-size:var(--rc-font-size-sm);text-align:center;padding:var(--rc-space-lg) var(--rc-space-md);border:1px dashed color-mix(in srgb,var(--rc-border) 60%,transparent);border-radius:var(--rc-radius-md);background-color:color-mix(in srgb,var(--rc-bg-secondary) 16%,transparent)}.mkenhux{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-top:1px solid color-mix(in srgb,var(--rc-border) 60%,transparent);background-color:color-mix(in srgb,var(--rc-bg-secondary) 20%,transparent)}.mkenhuy{color:var(--rc-text-secondary);font-size:var(--rc-font-size-2xs);font-family:var(--rc-font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:200px}.mkenhuz{display:flex;align-items:center;gap:8px}.mkenhu10{appearance:none;border:none;background:none;color:var(--rc-text-secondary);cursor:pointer;padding:4px 10px;border-radius:var(--rc-radius-sm);font-size:var(--rc-font-size-xs);font-weight:500;line-height:1.4;height:28px;display:inline-flex;align-items:center;transition:color .15s ease,background-color .15s ease}.mkenhu10:hover{color:var(--rc-text);background-color:var(--rc-fill-secondary)}.mkenhu11{background-color:var(--rc-accent);color:#fff}.mkenhu11:hover{background-color:var(--rc-accent);filter:brightness(.9);color:#fff}.mkenhu11:disabled{opacity:.5;cursor:default;pointer-events:none}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const CURSOR_TOKEN = "__cursor__";
|
|
2
|
+
export interface KaTeXSnippet {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
template: string;
|
|
6
|
+
previewEquation: string;
|
|
7
|
+
category: 'Basic' | 'Greek' | 'Operators' | 'Structures';
|
|
8
|
+
keywords: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface SnippetInsertionResult {
|
|
11
|
+
value: string;
|
|
12
|
+
selectionStart: number;
|
|
13
|
+
selectionEnd: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const katexSnippets: KaTeXSnippet[];
|
|
16
|
+
export declare function filterKaTeXSnippets(query: string): KaTeXSnippet[];
|
|
17
|
+
export declare function insertSnippetAtSelection(value: string, template: string, selectionStart: number | null, selectionEnd: number | null): SnippetInsertionResult;
|
|
18
|
+
//# sourceMappingURL=snippets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"snippets.d.ts","sourceRoot":"","sources":["../src/snippets.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,eAAe,CAAA;AAExC,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,MAAM,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,OAAO,GAAG,OAAO,GAAG,WAAW,GAAG,YAAY,CAAA;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,eAAO,MAAM,aAAa,EAAE,YAAY,EAiEvC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,EAAE,CAoBjE;AAED,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,GAAG,IAAI,EAC7B,YAAY,EAAE,MAAM,GAAG,IAAI,GAC1B,sBAAsB,CAmBxB"}
|
package/dist/styles.css.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export declare const semanticClassNames: {
|
|
|
9
9
|
readonly mode: "rich-katex-editor-mode";
|
|
10
10
|
readonly deleteButton: "rich-katex-editor-delete";
|
|
11
11
|
readonly tabs: "rich-katex-editor-tabs";
|
|
12
|
+
readonly bodyScrollArea: "rich-katex-editor-body-scroll-area";
|
|
12
13
|
readonly body: "rich-katex-editor-body";
|
|
13
14
|
readonly field: "rich-katex-editor-field";
|
|
14
15
|
readonly label: "rich-katex-editor-label";
|
|
@@ -18,6 +19,18 @@ export declare const semanticClassNames: {
|
|
|
18
19
|
readonly actionButton: "rich-katex-editor-action-btn";
|
|
19
20
|
readonly preview: "rich-katex-editor-preview";
|
|
20
21
|
readonly previewEmpty: "rich-katex-editor-preview-empty";
|
|
22
|
+
readonly snippetSearchWrap: "rich-katex-editor-snippet-search-wrap";
|
|
23
|
+
readonly snippetSearchIcon: "rich-katex-editor-snippet-search-icon";
|
|
24
|
+
readonly snippetSearchInput: "rich-katex-editor-snippet-search-input";
|
|
25
|
+
readonly snippetGroups: "rich-katex-editor-snippet-groups";
|
|
26
|
+
readonly snippetGroup: "rich-katex-editor-snippet-group";
|
|
27
|
+
readonly snippetGroupLabel: "rich-katex-editor-snippet-group-label";
|
|
28
|
+
readonly snippetList: "rich-katex-editor-snippet-list";
|
|
29
|
+
readonly snippetButton: "rich-katex-editor-snippet-button";
|
|
30
|
+
readonly snippetMeta: "rich-katex-editor-snippet-meta";
|
|
31
|
+
readonly snippetName: "rich-katex-editor-snippet-name";
|
|
32
|
+
readonly snippetHint: "rich-katex-editor-snippet-hint";
|
|
33
|
+
readonly snippetPreview: "rich-katex-editor-snippet-preview";
|
|
21
34
|
readonly snippetsPlaceholder: "rich-katex-editor-snippets-placeholder";
|
|
22
35
|
readonly footer: "rich-katex-editor-footer";
|
|
23
36
|
readonly charCount: "rich-katex-editor-charcount";
|
|
@@ -35,6 +48,7 @@ export declare const headerRight: string;
|
|
|
35
48
|
export declare const mode: string;
|
|
36
49
|
export declare const deleteButton: string;
|
|
37
50
|
export declare const tabs: string;
|
|
51
|
+
export declare const bodyScrollArea: string;
|
|
38
52
|
export declare const body: string;
|
|
39
53
|
export declare const field: string;
|
|
40
54
|
export declare const label: string;
|
|
@@ -44,6 +58,18 @@ export declare const inputActions: string;
|
|
|
44
58
|
export declare const actionButton: string;
|
|
45
59
|
export declare const preview: string;
|
|
46
60
|
export declare const previewEmpty: string;
|
|
61
|
+
export declare const snippetSearchWrap: string;
|
|
62
|
+
export declare const snippetSearchIcon: string;
|
|
63
|
+
export declare const snippetSearchInput: string;
|
|
64
|
+
export declare const snippetGroups: string;
|
|
65
|
+
export declare const snippetGroup: string;
|
|
66
|
+
export declare const snippetGroupLabel: string;
|
|
67
|
+
export declare const snippetList: string;
|
|
68
|
+
export declare const snippetButton: string;
|
|
69
|
+
export declare const snippetMeta: string;
|
|
70
|
+
export declare const snippetName: string;
|
|
71
|
+
export declare const snippetHint: string;
|
|
72
|
+
export declare const snippetPreview: string;
|
|
47
73
|
export declare const snippetsPlaceholder: string;
|
|
48
74
|
export declare const footer: string;
|
|
49
75
|
export declare const charCount: string;
|
package/dist/styles.css.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"styles.css.d.ts","sourceRoot":"","sources":["../src/styles.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuCrB,CAAA;AAEV,eAAO,MAAM,WAAW,QAStB,CAAA;AAEF,eAAO,MAAM,KAAK,QAMhB,CAAA;AAEF,eAAO,MAAM,MAAM,QAMjB,CAAA;AAEF,eAAO,MAAM,UAAU,QAIrB,CAAA;AAEF,eAAO,MAAM,QAAQ,QASnB,CAAA;AAEF,eAAO,MAAM,KAAK,QAIhB,CAAA;AAEF,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,IAAI,QASf,CAAA;AAEF,eAAO,MAAM,YAAY,QAoBvB,CAAA;AAEF,eAAO,MAAM,IAAI,QAEf,CAAA;AAEF,eAAO,MAAM,cAAc,QAKzB,CAAA;AAEF,eAAO,MAAM,IAAI,QAKf,CAAA;AAEF,eAAO,MAAM,KAAK,QAGhB,CAAA;AAEF,eAAO,MAAM,KAAK,QAQhB,CAAA;AAEF,eAAO,MAAM,SAAS,QAEpB,CAAA;AAEF,eAAO,MAAM,QAAQ,QAyBnB,CAAA;AAEF,eAAO,MAAM,YAAY,QAMvB,CAAA;AAEF,eAAO,MAAM,YAAY,QAwBvB,CAAA;AAEF,eAAO,MAAM,OAAO,QAUlB,CAAA;AAEF,eAAO,MAAM,YAAY,QAGvB,CAAA;AAEF,eAAO,MAAM,iBAAiB,QAE5B,CAAA;AAEF,eAAO,MAAM,iBAAiB,QAO5B,CAAA;AAEF,eAAO,MAAM,kBAAkB,QAoB7B,CAAA;AAEF,eAAO,MAAM,aAAa,QAIxB,CAAA;AAEF,eAAO,MAAM,YAAY,QAIvB,CAAA;AAEF,eAAO,MAAM,iBAAiB,QAO5B,CAAA;AAEF,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,aAAa,QAqBxB,CAAA;AAEF,eAAO,MAAM,WAAW,QAMtB,CAAA;AAEF,eAAO,MAAM,WAAW,QAItB,CAAA;AAEF,eAAO,MAAM,WAAW,QAOtB,CAAA;AAEF,eAAO,MAAM,cAAc,QAYzB,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAQ9B,CAAA;AAEF,eAAO,MAAM,MAAM,QAOjB,CAAA;AAEF,eAAO,MAAM,SAAS,QAQpB,CAAA;AAEF,eAAO,MAAM,aAAa,QAIxB,CAAA;AAEF,eAAO,MAAM,YAAY,QAqBvB,CAAA;AAEF,eAAO,MAAM,mBAAmB,QAe9B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-renderer-katex",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.63",
|
|
5
5
|
"description": "KaTeX math renderer for haklex rich editor",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"exports": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"lucide-react": "^0.577.0",
|
|
32
|
-
"@haklex/rich-editor": "0.0.
|
|
33
|
-
"@haklex/rich-
|
|
34
|
-
"@haklex/rich-
|
|
32
|
+
"@haklex/rich-editor": "0.0.63",
|
|
33
|
+
"@haklex/rich-style-token": "0.0.63",
|
|
34
|
+
"@haklex/rich-editor-ui": "0.0.63"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@lexical/react": "^0.41.0",
|