@haklex/rich-editor 0.44.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AlertQuoteEditNode-DtwITriP.js → AlertQuoteEditNode-mtnerxRw.js} +2 -2
- package/dist/{config-ruOEZI0Y.js → ColorSchemeContext-Bt6P4qsM.js} +19 -99
- package/dist/{ExtraNodesContext-Cjb_L5rP.js → ExtraNodesContext-Cy0doqRV.js} +1 -1
- package/dist/{MermaidPlugin-BRM8cjN-.js → MermaidPlugin-BBhXo9yA.js} +2 -2
- package/dist/{RubyRenderer-B76PPUga.js → RubyRenderer-DaPuZNZG.js} +1 -1
- package/dist/{SubmitShortcutPlugin-DOaljnBp.js → SubmitShortcutPlugin-BGwZfLQg.js} +6 -6
- package/dist/commands-entry.mjs +2 -2
- package/dist/{grid.css-ClPR9Sd5.js → grid.css-O_ACZKTG.js} +1 -1
- package/dist/index.mjs +11 -10
- package/dist/katex.css-DcnoSfYf.js +14 -0
- package/dist/{node-registry-B_vm9FD7.js → node-registry-D3ag2sc0.js} +87 -7
- package/dist/nodes/CodeBlockNode.d.ts.map +1 -1
- package/dist/nodes/KaTeXBlockNode.d.ts.map +1 -1
- package/dist/nodes/KaTeXInlineNode.d.ts.map +1 -1
- package/dist/nodes-entry.mjs +4 -4
- package/dist/plugins-entry.mjs +4 -4
- package/dist/renderers-entry.mjs +52 -4
- package/dist/static-entry.mjs +8 -7
- package/dist/styles-entry.mjs +3 -2
- package/dist/{theme-CxcaORbp.js → theme-DybCgfCO.js} +4 -4
- package/dist/{KaTeXRenderer-DvxFML1l.js → thumbhash-rpJmKhGu.js} +3 -50
- package/dist/{katex.css-0TJGE4On.js → utils-CWdXq6zB.js} +1 -13
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { B as FootnoteNode, G as AlertQuoteNode, H as $isAlertQuoteNode, J as AlertRenderer, K as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, i as TagNode, t as editorTheme } from "./theme-
|
|
2
|
-
import {
|
|
1
|
+
import { B as FootnoteNode, G as AlertQuoteNode, H as $isAlertQuoteNode, J as AlertRenderer, K as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, i as TagNode, t as editorTheme } from "./theme-DybCgfCO.js";
|
|
2
|
+
import { c as RendererWrapper, m as ALERT_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
3
3
|
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
4
4
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
5
5
|
import { AutoLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, G as AlertQuoteNode, K as _defineProperty, V as OPEN_FILE_PICKER_COMMAND, X as useNestedContentRenderer, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, et as markInlineDraggable, i as TagNode, m as MermaidNode, q as extractTextContent } from "./theme-
|
|
3
|
-
import {
|
|
4
|
-
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, G as AlertQuoteNode, K as _defineProperty, V as OPEN_FILE_PICKER_COMMAND, X as useNestedContentRenderer, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, et as markInlineDraggable, i as TagNode, m as MermaidNode, q as extractTextContent } from "./theme-DybCgfCO.js";
|
|
3
|
+
import { D as VIDEO_NODE_KEY, S as LINK_CARD_NODE_KEY, _ as FILE_NODE_KEY, c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, l as createRendererDecoration, o as useFootnoteDefinitions, y as FOOTNOTE_SECTION_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
4
|
+
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-O_ACZKTG.js";
|
|
5
5
|
import { n as FileRenderer, t as LinkCardRenderer } from "./LinkCardRenderer-BT8P5aJC.js";
|
|
6
6
|
import { AutoLinkNode, LinkNode } from "@lexical/link";
|
|
7
|
-
import { createContext, createElement, use, useCallback
|
|
7
|
+
import { createContext, createElement, use, useCallback } from "react";
|
|
8
8
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
9
9
|
import { $createParagraphNode, $createTextNode, $insertNodes, DecoratorNode, ElementNode, TextNode } from "lexical";
|
|
10
10
|
import { HorizontalRuleNode } from "@lexical/extension";
|
|
@@ -155,98 +155,6 @@ function $isBannerNode(node) {
|
|
|
155
155
|
return node instanceof BannerNode;
|
|
156
156
|
}
|
|
157
157
|
//#endregion
|
|
158
|
-
//#region src/context/ColorSchemeContext.tsx
|
|
159
|
-
var ColorSchemeContext = createContext("light");
|
|
160
|
-
function ColorSchemeProvider({ colorScheme, children }) {
|
|
161
|
-
return /* @__PURE__ */ jsx(ColorSchemeContext.Provider, {
|
|
162
|
-
value: colorScheme,
|
|
163
|
-
children
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function useColorScheme() {
|
|
167
|
-
return use(ColorSchemeContext);
|
|
168
|
-
}
|
|
169
|
-
//#endregion
|
|
170
|
-
//#region src/utils/shiki.ts
|
|
171
|
-
var codeToHtmlFn = null;
|
|
172
|
-
var shikiLoadPromise = null;
|
|
173
|
-
function loadCodeToHtml() {
|
|
174
|
-
if (codeToHtmlFn) return Promise.resolve(codeToHtmlFn);
|
|
175
|
-
if (!shikiLoadPromise) shikiLoadPromise = import("shiki/bundle/full").then((mod) => {
|
|
176
|
-
codeToHtmlFn = mod.codeToHtml;
|
|
177
|
-
return mod.codeToHtml;
|
|
178
|
-
}).catch((err) => {
|
|
179
|
-
shikiLoadPromise = null;
|
|
180
|
-
throw err;
|
|
181
|
-
});
|
|
182
|
-
return shikiLoadPromise;
|
|
183
|
-
}
|
|
184
|
-
//#endregion
|
|
185
|
-
//#region src/components/renderers/CodeBlockRenderer.tsx
|
|
186
|
-
function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersProp }) {
|
|
187
|
-
const variant = useVariant();
|
|
188
|
-
const showLineNumbers = showLineNumbersProp ?? variant !== "comment";
|
|
189
|
-
const shikiTheme = useColorScheme() === "dark" ? "github-dark" : "github-light";
|
|
190
|
-
const [highlightedHtml, setHighlightedHtml] = useState(null);
|
|
191
|
-
const [copied, setCopied] = useState(false);
|
|
192
|
-
const copyTimerRef = useRef(void 0);
|
|
193
|
-
useEffect(() => {
|
|
194
|
-
let cancelled = false;
|
|
195
|
-
setHighlightedHtml(null);
|
|
196
|
-
loadCodeToHtml().then((toHtml) => toHtml(code, {
|
|
197
|
-
lang: language,
|
|
198
|
-
theme: shikiTheme
|
|
199
|
-
})).then((html) => {
|
|
200
|
-
if (!cancelled) setHighlightedHtml(html);
|
|
201
|
-
}).catch(() => {
|
|
202
|
-
if (!cancelled) setHighlightedHtml(null);
|
|
203
|
-
});
|
|
204
|
-
return () => {
|
|
205
|
-
cancelled = true;
|
|
206
|
-
};
|
|
207
|
-
}, [
|
|
208
|
-
code,
|
|
209
|
-
language,
|
|
210
|
-
shikiTheme
|
|
211
|
-
]);
|
|
212
|
-
useEffect(() => {
|
|
213
|
-
return () => clearTimeout(copyTimerRef.current);
|
|
214
|
-
}, []);
|
|
215
|
-
const handleCopy = useCallback(() => {
|
|
216
|
-
navigator.clipboard.writeText(code).then(() => {
|
|
217
|
-
setCopied(true);
|
|
218
|
-
clearTimeout(copyTimerRef.current);
|
|
219
|
-
copyTimerRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
220
|
-
}).catch(() => {});
|
|
221
|
-
}, [code]);
|
|
222
|
-
const header = language ? /* @__PURE__ */ jsxs("div", {
|
|
223
|
-
className: "rich-code-block-header",
|
|
224
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
225
|
-
className: "rich-code-block-lang",
|
|
226
|
-
children: language
|
|
227
|
-
}), /* @__PURE__ */ jsx("button", {
|
|
228
|
-
"aria-label": copied ? "Copied to clipboard" : "Copy code",
|
|
229
|
-
className: "rich-code-block-copy",
|
|
230
|
-
type: "button",
|
|
231
|
-
onClick: handleCopy,
|
|
232
|
-
children: copied ? "Copied" : "Copy"
|
|
233
|
-
})]
|
|
234
|
-
}) : null;
|
|
235
|
-
const wrapperClass = showLineNumbers ? "rich-code-block rich-code-block-numbered" : "rich-code-block";
|
|
236
|
-
if (highlightedHtml) return /* @__PURE__ */ jsxs("div", {
|
|
237
|
-
className: wrapperClass,
|
|
238
|
-
children: [header, /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: highlightedHtml } })]
|
|
239
|
-
});
|
|
240
|
-
const lines = code.split("\n");
|
|
241
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
242
|
-
className: wrapperClass,
|
|
243
|
-
children: [header, /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("span", {
|
|
244
|
-
className: "line",
|
|
245
|
-
children: [line, i < lines.length - 1 ? "\n" : ""]
|
|
246
|
-
}, i)) }) })]
|
|
247
|
-
});
|
|
248
|
-
}
|
|
249
|
-
//#endregion
|
|
250
158
|
//#region src/nodes/CodeBlockNode.ts
|
|
251
159
|
var CodeBlockNode = class CodeBlockNode extends DecoratorNode {
|
|
252
160
|
static getType() {
|
|
@@ -304,7 +212,7 @@ var CodeBlockNode = class CodeBlockNode extends DecoratorNode {
|
|
|
304
212
|
writable.__language = language;
|
|
305
213
|
}
|
|
306
214
|
decorate(_editor, _config) {
|
|
307
|
-
return createRendererDecoration(CODE_BLOCK_NODE_KEY,
|
|
215
|
+
return createRendererDecoration(CODE_BLOCK_NODE_KEY, void 0, {
|
|
308
216
|
code: this.__code,
|
|
309
217
|
language: this.__language
|
|
310
218
|
});
|
|
@@ -1412,4 +1320,16 @@ var customNodes = [
|
|
|
1412
1320
|
];
|
|
1413
1321
|
var allNodes = [...builtinNodes, ...customNodes];
|
|
1414
1322
|
//#endregion
|
|
1415
|
-
|
|
1323
|
+
//#region src/context/ColorSchemeContext.tsx
|
|
1324
|
+
var ColorSchemeContext = createContext("light");
|
|
1325
|
+
function ColorSchemeProvider({ colorScheme, children }) {
|
|
1326
|
+
return /* @__PURE__ */ jsx(ColorSchemeContext.Provider, {
|
|
1327
|
+
value: colorScheme,
|
|
1328
|
+
children
|
|
1329
|
+
});
|
|
1330
|
+
}
|
|
1331
|
+
function useColorScheme() {
|
|
1332
|
+
return use(ColorSchemeContext);
|
|
1333
|
+
}
|
|
1334
|
+
//#endregion
|
|
1335
|
+
export { $isCodeBlockNode as A, fileExtFromName as C, $createCommentPlaceholderNode as D, $createCommentNode as E, BannerNode as F, normalizeBannerType as I, BannerRenderer as L, $isBannerNode as M, BANNER_LABELS as N, $isCommentNode as O, BANNER_TYPES as P, FileNode as S, DetailsNode as T, $createFootnoteSectionNode as _, customNodes as a, $createFileNode as b, $createRubyNode as c, $createLinkCardNode as d, $isLinkCardNode as f, GridContainerNode as g, $isGridContainerNode as h, builtinNodes as i, CodeBlockNode as j, CommentNode as k, $isRubyNode as l, $createGridContainerNode as m, useColorScheme as n, $createVideoNode as o, LinkCardNode as p, allNodes as r, VideoNode as s, ColorSchemeProvider as t, RubyNode as u, $isFootnoteSectionNode as v, $createDetailsNode as w, $isFileNode as x, FootnoteSectionNode as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
2
|
import { n as getHostname, r as probeFavicon } from "./normalizeSerializedEditorState-VaI73T09.js";
|
|
3
3
|
import { createContext, use, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as $withAdaptiveImageDisplayWidth, f as $createMermaidNode, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode } from "./theme-
|
|
2
|
-
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
1
|
+
import { O as $withAdaptiveImageDisplayWidth, f as $createMermaidNode, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode } from "./theme-DybCgfCO.js";
|
|
2
|
+
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
3
3
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
4
4
|
import { useEffect } from "react";
|
|
5
5
|
import { $insertNodes, COMMAND_PRIORITY_EDITOR, createCommand } from "lexical";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/renderers/RubyRenderer.tsx
|
|
4
4
|
function RubyRenderer({ reading, children }) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { c as setCodeBlockCursorIntent, o as $createCodeBlockEditNode, s as $createBannerEditNode, t as getResolvedEditNodes } from "./node-registry-
|
|
2
|
-
import "./
|
|
3
|
-
import { $ as INLINE_DRAG_MIME, B as FootnoteNode, C as KaTeXBlockNode, G as AlertQuoteNode, O as $withAdaptiveImageDisplayWidth, Q as INLINE_DRAG_ATTR, V as OPEN_FILE_PICKER_COMMAND, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, h as $createMentionNode, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, q as extractTextContent, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode, z as $createFootnoteNode } from "./theme-
|
|
4
|
-
import {
|
|
5
|
-
import { C as
|
|
6
|
-
import { o as PasteLinkPlugin, t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
1
|
+
import { c as setCodeBlockCursorIntent, o as $createCodeBlockEditNode, s as $createBannerEditNode, t as getResolvedEditNodes } from "./node-registry-D3ag2sc0.js";
|
|
2
|
+
import "./utils-CWdXq6zB.js";
|
|
3
|
+
import { $ as INLINE_DRAG_MIME, B as FootnoteNode, C as KaTeXBlockNode, G as AlertQuoteNode, O as $withAdaptiveImageDisplayWidth, Q as INLINE_DRAG_ATTR, V as OPEN_FILE_PICKER_COMMAND, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, h as $createMentionNode, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, q as extractTextContent, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode, z as $createFootnoteNode } from "./theme-DybCgfCO.js";
|
|
4
|
+
import { i as FootnoteDefinitionsProvider, t as computeImageMeta } from "./thumbhash-rpJmKhGu.js";
|
|
5
|
+
import { C as fileExtFromName, D as $createCommentPlaceholderNode, E as $createCommentNode, F as BannerNode, T as DetailsNode, _ as $createFootnoteSectionNode, b as $createFileNode, c as $createRubyNode, h as $isGridContainerNode, j as CodeBlockNode, k as CommentNode, o as $createVideoNode, u as RubyNode, v as $isFootnoteSectionNode, w as $createDetailsNode, x as $isFileNode, y as FootnoteSectionNode } from "./ColorSchemeContext-Bt6P4qsM.js";
|
|
6
|
+
import { o as PasteLinkPlugin, t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
7
7
|
import { n as getHostname, r as probeFavicon, t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-VaI73T09.js";
|
|
8
8
|
import { CheckListPlugin } from "@lexical/react/LexicalCheckListPlugin";
|
|
9
9
|
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
package/dist/commands-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { V as OPEN_FILE_PICKER_COMMAND, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, q as extractTextContent, s as $isSpoilerNode } from "./theme-
|
|
2
|
-
import { i as INSERT_KATEX_INLINE_COMMAND, l as INSERT_ALERT_COMMAND, o as INSERT_IMAGE_COMMAND, r as INSERT_KATEX_BLOCK_COMMAND, t as INSERT_MERMAID_COMMAND } from "./MermaidPlugin-
|
|
1
|
+
import { V as OPEN_FILE_PICKER_COMMAND, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, q as extractTextContent, s as $isSpoilerNode } from "./theme-DybCgfCO.js";
|
|
2
|
+
import { i as INSERT_KATEX_INLINE_COMMAND, l as INSERT_ALERT_COMMAND, o as INSERT_IMAGE_COMMAND, r as INSERT_KATEX_BLOCK_COMMAND, t as INSERT_MERMAID_COMMAND } from "./MermaidPlugin-BBhXo9yA.js";
|
|
3
3
|
import { $createTextNode, $getSelection, $isRangeSelection } from "lexical";
|
|
4
4
|
//#region src/utils/collect-command-items.ts
|
|
5
5
|
function collectCommandItems(editor) {
|
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { A as FileUploadPlugin, C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as VideoUploadProvider, L as ImageUploadProvider, N as BlockIdPlugin, O as defaultImageUpload, P as blockIdState, S as TextSelectionStoreProvider, T as useTextSelectionStore, U as CorePlugins, V as FileUploadProvider, _ as $getRootBlock, a as AutoFocusPlugin, b as buildBlockAnchor, c as $captureTextSelection, d as createDOMRangeFromTextSelection, f as findDOMPointByTextOffset, g as TEXT_SELECTION_HIGHLIGHT_NAME, h as getTextOffsetFromDOMPoint, i as EditorRefPlugin, l as $captureTextSelectionFromRangeSelection, m as getDOMRectFromTextSelection, n as OnChangePlugin, o as VideoUploadPlugin, p as getBlockElementById, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, u as $restoreTextSelection, v as $getTextOffsetInBlock, w as useTextSelectionSnapshot, x as buildRangeAnchor, y as $resolveSelectionPoint, z as ImagePreprocessProvider } from "./SubmitShortcutPlugin-
|
|
2
|
-
import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-
|
|
3
|
-
import { a as
|
|
4
|
-
import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, t as editorTheme } from "./theme-
|
|
5
|
-
import { C as
|
|
6
|
-
import {
|
|
7
|
-
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-
|
|
8
|
-
import { c as useNestedEditorPlugins, s as NestedEditorPluginsProvider } from "./AlertQuoteEditNode-
|
|
1
|
+
import { A as FileUploadPlugin, C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as VideoUploadProvider, L as ImageUploadProvider, N as BlockIdPlugin, O as defaultImageUpload, P as blockIdState, S as TextSelectionStoreProvider, T as useTextSelectionStore, U as CorePlugins, V as FileUploadProvider, _ as $getRootBlock, a as AutoFocusPlugin, b as buildBlockAnchor, c as $captureTextSelection, d as createDOMRangeFromTextSelection, f as findDOMPointByTextOffset, g as TEXT_SELECTION_HIGHLIGHT_NAME, h as getTextOffsetFromDOMPoint, i as EditorRefPlugin, l as $captureTextSelectionFromRangeSelection, m as getDOMRectFromTextSelection, n as OnChangePlugin, o as VideoUploadPlugin, p as getBlockElementById, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, u as $restoreTextSelection, v as $getTextOffsetInBlock, w as useTextSelectionSnapshot, x as buildRangeAnchor, y as $resolveSelectionPoint, z as ImagePreprocessProvider } from "./SubmitShortcutPlugin-BGwZfLQg.js";
|
|
2
|
+
import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-D3ag2sc0.js";
|
|
3
|
+
import { a as articleVariant, c as sharedStyles, i as commentVariant, n as getVariantClass, o as richContent, r as noteVariant, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
4
|
+
import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, t as editorTheme } from "./theme-DybCgfCO.js";
|
|
5
|
+
import { C as MENTION_NODE_KEY, D as VIDEO_NODE_KEY, E as TAG_NODE_KEY, S as LINK_CARD_NODE_KEY, T as RUBY_NODE_KEY, _ as FILE_NODE_KEY, a as useFootnoteContent, b as IMAGE_NODE_KEY, d as useRendererConfig, f as useRendererMode, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, i as FootnoteDefinitionsProvider, m as ALERT_NODE_KEY, o as useFootnoteDefinitions, p as useVariant, s as useFootnoteDisplayNumber, u as RendererConfigProvider, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY, y as FOOTNOTE_SECTION_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
6
|
+
import { n as useColorScheme, t as ColorSchemeProvider } from "./ColorSchemeContext-Bt6P4qsM.js";
|
|
7
|
+
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-O_ACZKTG.js";
|
|
8
|
+
import { c as useNestedEditorPlugins, s as NestedEditorPluginsProvider } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
9
9
|
import { t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-VaI73T09.js";
|
|
10
|
-
import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-
|
|
11
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
10
|
+
import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-Cy0doqRV.js";
|
|
11
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BBhXo9yA.js";
|
|
12
|
+
import { n as katexStyles, t as katexClassNames } from "./katex.css-DcnoSfYf.js";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
14
15
|
import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./utils-CWdXq6zB.js";
|
|
2
|
+
//#region src/styles/katex.css.ts
|
|
3
|
+
var katexClassNames = {
|
|
4
|
+
inline: "rich-katex-inline",
|
|
5
|
+
block: "rich-katex-block",
|
|
6
|
+
fallback: "rich-katex-fallback"
|
|
7
|
+
};
|
|
8
|
+
var katexStyles = {
|
|
9
|
+
inline: "egstxq0",
|
|
10
|
+
block: "egstxq1",
|
|
11
|
+
fallback: "egstxq2"
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { katexStyles as n, katexClassNames as t };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, K as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-
|
|
3
|
-
import {
|
|
4
|
-
import { A as
|
|
5
|
-
import { n as gridStyles, t as gridClassNames } from "./grid.css-
|
|
6
|
-
import { a as NestedEditorCorePlugins, i as createNestedEditor, n as AlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, K as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-DybCgfCO.js";
|
|
3
|
+
import { c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, o as useFootnoteDefinitions, p as useVariant } from "./thumbhash-rpJmKhGu.js";
|
|
4
|
+
import { A as $isCodeBlockNode, F as BannerNode, I as normalizeBannerType, L as BannerRenderer, M as $isBannerNode, S as FileNode, T as DetailsNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, j as CodeBlockNode, k as CommentNode, n as useColorScheme, p as LinkCardNode, s as VideoNode, u as RubyNode, y as FootnoteSectionNode } from "./ColorSchemeContext-Bt6P4qsM.js";
|
|
5
|
+
import { n as gridStyles, t as gridClassNames } from "./grid.css-O_ACZKTG.js";
|
|
6
|
+
import { a as NestedEditorCorePlugins, i as createNestedEditor, n as AlertQuoteEditNode } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
7
7
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
|
-
import { createElement, useCallback, useEffect, useState } from "react";
|
|
8
|
+
import { createElement, useCallback, useEffect, useRef, useState } from "react";
|
|
9
9
|
import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection } from "lexical";
|
|
10
10
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { Flag, LayoutGrid, Minus, Plus } from "lucide-react";
|
|
@@ -143,6 +143,86 @@ function $createBannerEditNode(bannerType, contentState) {
|
|
|
143
143
|
return new BannerEditNode(bannerType, contentState);
|
|
144
144
|
}
|
|
145
145
|
//#endregion
|
|
146
|
+
//#region src/utils/shiki.ts
|
|
147
|
+
var codeToHtmlFn = null;
|
|
148
|
+
var shikiLoadPromise = null;
|
|
149
|
+
function loadCodeToHtml() {
|
|
150
|
+
if (codeToHtmlFn) return Promise.resolve(codeToHtmlFn);
|
|
151
|
+
if (!shikiLoadPromise) shikiLoadPromise = import("shiki/bundle/full").then((mod) => {
|
|
152
|
+
codeToHtmlFn = mod.codeToHtml;
|
|
153
|
+
return mod.codeToHtml;
|
|
154
|
+
}).catch((err) => {
|
|
155
|
+
shikiLoadPromise = null;
|
|
156
|
+
throw err;
|
|
157
|
+
});
|
|
158
|
+
return shikiLoadPromise;
|
|
159
|
+
}
|
|
160
|
+
//#endregion
|
|
161
|
+
//#region src/components/renderers/CodeBlockRenderer.tsx
|
|
162
|
+
function CodeBlockRenderer({ code, language, showLineNumbers: showLineNumbersProp }) {
|
|
163
|
+
const variant = useVariant();
|
|
164
|
+
const showLineNumbers = showLineNumbersProp ?? variant !== "comment";
|
|
165
|
+
const shikiTheme = useColorScheme() === "dark" ? "github-dark" : "github-light";
|
|
166
|
+
const [highlightedHtml, setHighlightedHtml] = useState(null);
|
|
167
|
+
const [copied, setCopied] = useState(false);
|
|
168
|
+
const copyTimerRef = useRef(void 0);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
let cancelled = false;
|
|
171
|
+
setHighlightedHtml(null);
|
|
172
|
+
loadCodeToHtml().then((toHtml) => toHtml(code, {
|
|
173
|
+
lang: language,
|
|
174
|
+
theme: shikiTheme
|
|
175
|
+
})).then((html) => {
|
|
176
|
+
if (!cancelled) setHighlightedHtml(html);
|
|
177
|
+
}).catch(() => {
|
|
178
|
+
if (!cancelled) setHighlightedHtml(null);
|
|
179
|
+
});
|
|
180
|
+
return () => {
|
|
181
|
+
cancelled = true;
|
|
182
|
+
};
|
|
183
|
+
}, [
|
|
184
|
+
code,
|
|
185
|
+
language,
|
|
186
|
+
shikiTheme
|
|
187
|
+
]);
|
|
188
|
+
useEffect(() => {
|
|
189
|
+
return () => clearTimeout(copyTimerRef.current);
|
|
190
|
+
}, []);
|
|
191
|
+
const handleCopy = useCallback(() => {
|
|
192
|
+
navigator.clipboard.writeText(code).then(() => {
|
|
193
|
+
setCopied(true);
|
|
194
|
+
clearTimeout(copyTimerRef.current);
|
|
195
|
+
copyTimerRef.current = setTimeout(() => setCopied(false), 2e3);
|
|
196
|
+
}).catch(() => {});
|
|
197
|
+
}, [code]);
|
|
198
|
+
const header = language ? /* @__PURE__ */ jsxs("div", {
|
|
199
|
+
className: "rich-code-block-header",
|
|
200
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
201
|
+
className: "rich-code-block-lang",
|
|
202
|
+
children: language
|
|
203
|
+
}), /* @__PURE__ */ jsx("button", {
|
|
204
|
+
"aria-label": copied ? "Copied to clipboard" : "Copy code",
|
|
205
|
+
className: "rich-code-block-copy",
|
|
206
|
+
type: "button",
|
|
207
|
+
onClick: handleCopy,
|
|
208
|
+
children: copied ? "Copied" : "Copy"
|
|
209
|
+
})]
|
|
210
|
+
}) : null;
|
|
211
|
+
const wrapperClass = showLineNumbers ? "rich-code-block rich-code-block-numbered" : "rich-code-block";
|
|
212
|
+
if (highlightedHtml) return /* @__PURE__ */ jsxs("div", {
|
|
213
|
+
className: wrapperClass,
|
|
214
|
+
children: [header, /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: highlightedHtml } })]
|
|
215
|
+
});
|
|
216
|
+
const lines = code.split("\n");
|
|
217
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
218
|
+
className: wrapperClass,
|
|
219
|
+
children: [header, /* @__PURE__ */ jsx("pre", { children: /* @__PURE__ */ jsx("code", { children: lines.map((line, i) => /* @__PURE__ */ jsxs("span", {
|
|
220
|
+
className: "line",
|
|
221
|
+
children: [line, i < lines.length - 1 ? "\n" : ""]
|
|
222
|
+
}, i)) }) })]
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
//#endregion
|
|
146
226
|
//#region src/components/decorators/CodeBlockEditDecorator.tsx
|
|
147
227
|
function CodeBlockEditDecorator({ nodeKey, code, language }) {
|
|
148
228
|
const [editor] = useLexicalComposerContext();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockNode.d.ts","sourceRoot":"","sources":["../../src/nodes/CodeBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeBlockNode.d.ts","sourceRoot":"","sources":["../../src/nodes/CodeBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAC1C;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB,EACD,qBAAqB,CACtB,CAAC;AAEF,qBAAa,aAAc,SAAQ,aAAa,CAAC,YAAY,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,CAAC,YAAY,EAAE,iBAAiB,EAAE,CAetC;IAEF,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa;gBAIpC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO;IAMzD,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW;IAM7C,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,OAAO;IAInB,oBAAoB,IAAI,OAAO;IAI/B,MAAM,CAAC,UAAU,CACf,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,aAAa;IAOhB,UAAU,IAAI,uBAAuB;IAUrC,OAAO,IAAI,MAAM;IAIjB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAK3B,WAAW,IAAI,MAAM;IAIrB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAMtE;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,aAAa,CAElF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,aAAa,CAE5F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXBlockNode.d.ts","sourceRoot":"","sources":["../../src/nodes/KaTeXBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KaTeXBlockNode.d.ts","sourceRoot":"","sources":["../../src/nodes/KaTeXBlockNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAI/D,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAC3C;IACE,QAAQ,EAAE,MAAM,CAAC;CAClB,EACD,qBAAqB,CACtB,CAAC;AAEF,qBAAa,cAAe,SAAQ,aAAa,CAAC,YAAY,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAE3B,MAAM,CAAC,cAAc,EAAE,mBAAmB,EAAE,CAa1C;IAEF,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,cAAc,GAAG,cAAc;gBAItC,QAAQ,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,eAAe,UAAQ;IAMpE,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW;IAM7C,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,OAAO;IAInB,MAAM,CAAC,UAAU,CACf,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,cAAc;IAKjB,UAAU,IAAI,wBAAwB;IAStC,WAAW,IAAI,MAAM;IAIrB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC,wBAAwB,IAAI,OAAO;IAInC,wBAAwB,CAAC,eAAe,EAAE,OAAO,GAAG,IAAI;IAKxD,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAMtE;AAED,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,cAAc,CAOhB;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,cAAc,CAE9F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXInlineNode.d.ts","sourceRoot":"","sources":["../../src/nodes/KaTeXInlineNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"KaTeXInlineNode.d.ts","sourceRoot":"","sources":["../../src/nodes/KaTeXInlineNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAS1C,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAC5C;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,EACD,qBAAqB,CACtB,CAAC;AAEF,qBAAa,eAAgB,SAAQ,aAAa,CAAC,YAAY,CAAC;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe;gBAKlD,QAAQ,EAAE,MAAM,EAChB,GAAG,CAAC,EAAE,OAAO,EACb,eAAe,UAAQ,EACvB,KAAK,GAAE,MAAM,GAAG,IAAW;IAQ7B,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW;IAM7C,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,OAAO;IAInB,MAAM,CAAC,UAAU,CACf,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,eAAe;IAOlB,UAAU,IAAI,yBAAyB;IAUvC,WAAW,IAAI,MAAM;IAIrB,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC,wBAAwB,IAAI,OAAO;IAInC,wBAAwB,CAAC,eAAe,EAAE,OAAO,GAAG,IAAI;IAKxD,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAKpC,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAQtE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,eAAe,CAOjB;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,eAAe,CAEhG"}
|
package/dist/nodes-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-
|
|
2
|
-
import { A as computeImageDisplayPixels, C as KaTeXBlockNode, D as sanitizeImageLayout, E as ImageNode, F as imageDisplaySizeAfterResize, I as resolveImageDisplaySize, L as sanitizeImageDisplayWidth, M as imageDisplayCssVars, N as imageDisplayDataAttr, P as imageDisplayFieldsFromSize, R as sanitizeImageFixedPx, S as $isKaTeXBlockNode, T as $isImageNode, U as ALERT_LABELS, W as ALERT_TYPES, _ as MentionNode, b as KaTeXInlineNode, d as RichQuoteNode, f as $createMermaidNode, g as $isMentionNode, h as $createMentionNode, i as TagNode, j as convertImageDisplaySize, l as $createRichQuoteNode, m as MermaidNode, n as $createTagNode, p as $isMermaidNode, r as $isTagNode, u as $isRichQuoteNode, w as $createImageNode, y as $isKaTeXInlineNode } from "./theme-
|
|
3
|
-
import {
|
|
4
|
-
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-
|
|
1
|
+
import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-D3ag2sc0.js";
|
|
2
|
+
import { A as computeImageDisplayPixels, C as KaTeXBlockNode, D as sanitizeImageLayout, E as ImageNode, F as imageDisplaySizeAfterResize, I as resolveImageDisplaySize, L as sanitizeImageDisplayWidth, M as imageDisplayCssVars, N as imageDisplayDataAttr, P as imageDisplayFieldsFromSize, R as sanitizeImageFixedPx, S as $isKaTeXBlockNode, T as $isImageNode, U as ALERT_LABELS, W as ALERT_TYPES, _ as MentionNode, b as KaTeXInlineNode, d as RichQuoteNode, f as $createMermaidNode, g as $isMentionNode, h as $createMentionNode, i as TagNode, j as convertImageDisplaySize, l as $createRichQuoteNode, m as MermaidNode, n as $createTagNode, p as $isMermaidNode, r as $isTagNode, u as $isRichQuoteNode, w as $createImageNode, y as $isKaTeXInlineNode } from "./theme-DybCgfCO.js";
|
|
3
|
+
import { C as fileExtFromName, E as $createCommentNode, N as BANNER_LABELS, O as $isCommentNode, P as BANNER_TYPES, S as FileNode, _ as $createFootnoteSectionNode, a as customNodes, b as $createFileNode, c as $createRubyNode, d as $createLinkCardNode, f as $isLinkCardNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, k as CommentNode, l as $isRubyNode, m as $createGridContainerNode, p as LinkCardNode, r as allNodes, u as RubyNode, v as $isFootnoteSectionNode, x as $isFileNode, y as FootnoteSectionNode } from "./ColorSchemeContext-Bt6P4qsM.js";
|
|
4
|
+
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
5
5
|
export { $createCommentNode, $createFileNode, $createFootnoteSectionNode, $createGridContainerNode, $createImageNode, $createLinkCardNode, $createMentionNode, $createMermaidNode, $createRichQuoteNode, $createRubyNode, $createTagNode, $isCommentNode, $isFileNode, $isFootnoteSectionNode, $isGridContainerNode, $isImageNode, $isKaTeXBlockNode, $isKaTeXInlineNode, $isLinkCardNode, $isMentionNode, $isMermaidNode, $isRichQuoteNode, $isRubyNode, $isTagNode, ALERT_LABELS, ALERT_TYPES, BANNER_LABELS, BANNER_TYPES, CommentNode, FileNode, FootnoteSectionEditNode, FootnoteSectionNode, GridContainerNode, ImageNode, KaTeXBlockNode, KaTeXInlineNode, LinkCardNode, MentionNode, MermaidNode, NESTED_EDITOR_NODES, RichQuoteNode, RubyNode, TagNode, allEditNodes, allNodes, builtinNodes, computeImageDisplayPixels, convertImageDisplaySize, customEditNodes, customNodes, fileExtFromName, getResolvedEditNodes, imageDisplayCssVars, imageDisplayDataAttr, imageDisplayFieldsFromSize, imageDisplaySizeAfterResize, resolveImageDisplaySize, sanitizeImageDisplayWidth, sanitizeImageFixedPx, sanitizeImageLayout, setResolvedEditNodes };
|
package/dist/plugins-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as FileUploadPlugin, B as useImagePreprocess, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as VideoUploadProvider, G as MarkdownPastePlugin, H as useFileUpload, I as useVideoUpload, J as HorizontalRulePlugin, K as ALL_TRANSFORMERS, L as ImageUploadProvider, M as useFileUploadEntry, N as BlockIdPlugin, O as defaultImageUpload, P as blockIdState, Q as AutoLinkPlugin, R as useImageUpload, U as CorePlugins, V as FileUploadProvider, W as MarkdownShortcutsPlugin, X as registerClickBelowCommand, Y as ClickBelowPlugin, Z as BlockExitPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as setFileUploadEntry, k as resolvePreprocessTargets, n as OnChangePlugin, o as VideoUploadPlugin, q as InlineDndPlugin, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, z as ImagePreprocessProvider } from "./SubmitShortcutPlugin-
|
|
2
|
-
import { Q as INLINE_DRAG_ATTR, et as markInlineDraggable } from "./theme-
|
|
3
|
-
import { o as PasteLinkPlugin } from "./AlertQuoteEditNode-
|
|
4
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
1
|
+
import { A as FileUploadPlugin, B as useImagePreprocess, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as VideoUploadProvider, G as MarkdownPastePlugin, H as useFileUpload, I as useVideoUpload, J as HorizontalRulePlugin, K as ALL_TRANSFORMERS, L as ImageUploadProvider, M as useFileUploadEntry, N as BlockIdPlugin, O as defaultImageUpload, P as blockIdState, Q as AutoLinkPlugin, R as useImageUpload, U as CorePlugins, V as FileUploadProvider, W as MarkdownShortcutsPlugin, X as registerClickBelowCommand, Y as ClickBelowPlugin, Z as BlockExitPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as setFileUploadEntry, k as resolvePreprocessTargets, n as OnChangePlugin, o as VideoUploadPlugin, q as InlineDndPlugin, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, z as ImagePreprocessProvider } from "./SubmitShortcutPlugin-BGwZfLQg.js";
|
|
2
|
+
import { Q as INLINE_DRAG_ATTR, et as markInlineDraggable } from "./theme-DybCgfCO.js";
|
|
3
|
+
import { o as PasteLinkPlugin } from "./AlertQuoteEditNode-mtnerxRw.js";
|
|
4
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BBhXo9yA.js";
|
|
5
5
|
export { ALL_TRANSFORMERS, AlertPlugin, AutoFocusPlugin, AutoLinkPlugin, BlockExitPlugin, BlockIdPlugin, ClickBelowPlugin, CorePlugins, EditorRefPlugin, FileUploadPlugin, FileUploadProvider, FootnotePlugin, HorizontalRulePlugin, INLINE_DRAG_ATTR, ImagePlugin, ImagePreprocessProvider, ImageUploadPlugin, ImageUploadProvider, InlineDndPlugin, KaTeXPlugin, LinkFaviconPlugin, MarkdownPastePlugin, MarkdownShortcutsPlugin, MermaidPlugin, OnChangePlugin, PasteLinkPlugin, SubmitShortcutPlugin, TextSelectionPlugin, VideoUploadPlugin, VideoUploadProvider, blockIdState, defaultImageUpload, markInlineDraggable, registerClickBelowCommand, resolvePreprocessTargets, setFileUploadEntry, useFileUpload, useFileUploadEntry, useImagePreprocess, useImageUpload, useVideoUpload };
|
package/dist/renderers-entry.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { C as
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { C as MENTION_NODE_KEY, D as VIDEO_NODE_KEY, E as TAG_NODE_KEY, S as LINK_CARD_NODE_KEY, T as RUBY_NODE_KEY, _ as FILE_NODE_KEY, a as useFootnoteContent, b as IMAGE_NODE_KEY, c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, l as createRendererDecoration, m as ALERT_NODE_KEY, n as decodeThumbHash, r as FootnoteStaticRenderer, s as useFootnoteDisplayNumber, t as computeImageMeta, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY, y as FOOTNOTE_SECTION_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
3
3
|
import { a as formatFileSize, i as fileMetaText, n as FileRenderer, r as fileExtension, t as LinkCardRenderer } from "./LinkCardRenderer-BT8P5aJC.js";
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
4
|
+
import { n as katexStyles, t as katexClassNames } from "./katex.css-DcnoSfYf.js";
|
|
5
|
+
import { t as RubyRenderer } from "./RubyRenderer-DaPuZNZG.js";
|
|
6
|
+
import { useCallback, useEffect, useState } from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { TooltipContent, TooltipRoot, TooltipTrigger } from "@haklex/rich-editor-ui";
|
|
8
9
|
//#region src/components/renderers/FootnoteRenderer.tsx
|
|
@@ -41,4 +42,51 @@ function FootnoteRenderer({ identifier }) {
|
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
//#endregion
|
|
45
|
+
//#region src/components/renderers/KaTeXRenderer.tsx
|
|
46
|
+
var katexModule = null;
|
|
47
|
+
var katexLoadPromise = null;
|
|
48
|
+
function loadKaTeX() {
|
|
49
|
+
if (katexModule) return Promise.resolve(katexModule);
|
|
50
|
+
if (!katexLoadPromise) katexLoadPromise = import("katex").then((mod) => {
|
|
51
|
+
katexModule = mod;
|
|
52
|
+
return katexModule;
|
|
53
|
+
});
|
|
54
|
+
return katexLoadPromise;
|
|
55
|
+
}
|
|
56
|
+
function KaTeXRenderer({ equation, displayMode }) {
|
|
57
|
+
const [html, setHtml] = useState(null);
|
|
58
|
+
const [error, setError] = useState(null);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
let cancelled = false;
|
|
61
|
+
loadKaTeX().then((katex) => {
|
|
62
|
+
if (cancelled) return;
|
|
63
|
+
const rendered = katex.default.renderToString(equation, {
|
|
64
|
+
displayMode,
|
|
65
|
+
throwOnError: false
|
|
66
|
+
});
|
|
67
|
+
setHtml(rendered);
|
|
68
|
+
setError(null);
|
|
69
|
+
}).catch(() => {
|
|
70
|
+
if (cancelled) return;
|
|
71
|
+
setHtml(null);
|
|
72
|
+
setError("KaTeX is not available");
|
|
73
|
+
});
|
|
74
|
+
return () => {
|
|
75
|
+
cancelled = true;
|
|
76
|
+
};
|
|
77
|
+
}, [equation, displayMode]);
|
|
78
|
+
if (error) return /* @__PURE__ */ jsx("code", {
|
|
79
|
+
className: clsx(katexClassNames.fallback, katexStyles.fallback),
|
|
80
|
+
children: equation
|
|
81
|
+
});
|
|
82
|
+
if (html) return /* @__PURE__ */ jsx("span", {
|
|
83
|
+
dangerouslySetInnerHTML: { __html: html },
|
|
84
|
+
className: displayMode ? clsx(katexClassNames.block, katexStyles.block) : clsx(katexClassNames.inline, katexStyles.inline)
|
|
85
|
+
});
|
|
86
|
+
return /* @__PURE__ */ jsx("code", {
|
|
87
|
+
className: clsx(katexClassNames.fallback, katexStyles.fallback),
|
|
88
|
+
children: equation
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
//#endregion
|
|
44
92
|
export { ALERT_NODE_KEY, BANNER_NODE_KEY, CODE_BLOCK_NODE_KEY, FILE_NODE_KEY, FOOTNOTE_NODE_KEY, FOOTNOTE_SECTION_NODE_KEY, FileRenderer, FootnoteRenderer, FootnoteStaticRenderer, IMAGE_NODE_KEY, KATEX_NODE_KEY, KaTeXRenderer, LINK_CARD_NODE_KEY, LinkCardRenderer, MENTION_NODE_KEY, MERMAID_NODE_KEY, RUBY_NODE_KEY, RendererWrapper, RubyRenderer, TAG_NODE_KEY, VIDEO_NODE_KEY, computeImageMeta, createRendererDecoration, decodeThumbHash, fileExtension, fileMetaText, formatFileSize };
|
package/dist/static-entry.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, a as getTagBgColor, q as extractTextContent, t as editorTheme } from "./theme-
|
|
3
|
-
import { C as
|
|
4
|
-
import {
|
|
5
|
-
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-
|
|
1
|
+
import { a as articleVariant, c as sharedStyles, i as commentVariant, n as getVariantClass, o as richContent, r as noteVariant, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, a as getTagBgColor, q as extractTextContent, t as editorTheme } from "./theme-DybCgfCO.js";
|
|
3
|
+
import { C as MENTION_NODE_KEY, D as VIDEO_NODE_KEY, E as TAG_NODE_KEY, S as LINK_CARD_NODE_KEY, T as RUBY_NODE_KEY, a as useFootnoteContent, b as IMAGE_NODE_KEY, c as RendererWrapper, d as useRendererConfig, f as useRendererMode, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, i as FootnoteDefinitionsProvider, l as createRendererDecoration, m as ALERT_NODE_KEY, o as useFootnoteDefinitions, p as useVariant, s as useFootnoteDisplayNumber, u as RendererConfigProvider, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY, y as FOOTNOTE_SECTION_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
4
|
+
import { a as customNodes, i as builtinNodes, n as useColorScheme, r as allNodes, t as ColorSchemeProvider } from "./ColorSchemeContext-Bt6P4qsM.js";
|
|
5
|
+
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-O_ACZKTG.js";
|
|
6
6
|
import { t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-VaI73T09.js";
|
|
7
|
-
import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-
|
|
8
|
-
import { t as
|
|
7
|
+
import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-Cy0doqRV.js";
|
|
8
|
+
import { n as katexStyles, t as katexClassNames } from "./katex.css-DcnoSfYf.js";
|
|
9
|
+
import { t as RubyRenderer } from "./RubyRenderer-DaPuZNZG.js";
|
|
9
10
|
import { jsx } from "react/jsx-runtime";
|
|
10
11
|
import { articleTheme, commentTheme, noteTheme, vars } from "@haklex/rich-style-token/styles";
|
|
11
12
|
//#region src/components/renderers/TagRenderer.tsx
|
package/dist/styles-entry.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-
|
|
1
|
+
import { a as articleVariant, c as sharedStyles, i as commentVariant, n as getVariantClass, o as richContent, r as noteVariant, s as semanticClassNames } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-O_ACZKTG.js";
|
|
3
|
+
import { n as katexStyles, t as katexClassNames } from "./katex.css-DcnoSfYf.js";
|
|
3
4
|
import { articleTheme, commentTheme, noteTheme, vars } from "@haklex/rich-style-token/styles";
|
|
4
5
|
export { articleTheme, articleVariant, commentTheme, commentVariant, detailsClassNames, detailsStyles, getVariantClass, gridClassNames, gridStyles, katexClassNames, katexStyles, noteTheme, noteVariant, richContent, semanticClassNames, sharedStyles, vars };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { C as MENTION_NODE_KEY, b as IMAGE_NODE_KEY, c as RendererWrapper, l as createRendererDecoration, m as ALERT_NODE_KEY, n as decodeThumbHash, r as FootnoteStaticRenderer, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY } from "./thumbhash-rpJmKhGu.js";
|
|
3
3
|
import { createContext, createElement, use, useCallback, useEffect, useMemo, useState } from "react";
|
|
4
4
|
import { QuoteNode } from "@lexical/rich-text";
|
|
5
5
|
import { $getEditor, $getNodeByKey, $getSelection, $insertNodes, $isNodeSelection, $isRangeSelection, DecoratorNode, ElementNode, TextNode, createCommand, getRegisteredNode } from "lexical";
|
|
@@ -870,7 +870,7 @@ var KaTeXBlockNode = class KaTeXBlockNode extends DecoratorNode {
|
|
|
870
870
|
writable.__autoOpenOnMount = autoOpenOnMount;
|
|
871
871
|
}
|
|
872
872
|
decorate(_editor, _config) {
|
|
873
|
-
return createRendererDecoration(KATEX_NODE_KEY,
|
|
873
|
+
return createRendererDecoration(KATEX_NODE_KEY, void 0, {
|
|
874
874
|
equation: this.__equation,
|
|
875
875
|
displayMode: true
|
|
876
876
|
});
|
|
@@ -967,7 +967,7 @@ var KaTeXInlineNode = class KaTeXInlineNode extends DecoratorNode {
|
|
|
967
967
|
writable.__color = color;
|
|
968
968
|
}
|
|
969
969
|
decorate(_editor, _config) {
|
|
970
|
-
const decoration = createRendererDecoration(KATEX_NODE_KEY,
|
|
970
|
+
const decoration = createRendererDecoration(KATEX_NODE_KEY, void 0, {
|
|
971
971
|
equation: this.__equation,
|
|
972
972
|
displayMode: false
|
|
973
973
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createContext, createElement, use, useCallback,
|
|
1
|
+
import { c as sharedStyles, s as semanticClassNames, t as clsx } from "./utils-CWdXq6zB.js";
|
|
2
|
+
import { createContext, createElement, use, useCallback, useMemo } from "react";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { rgbaToThumbHash, thumbHashToDataURL } from "thumbhash";
|
|
5
5
|
//#region src/types/renderer-keys.ts
|
|
@@ -203,51 +203,4 @@ function base64ToUint8(str) {
|
|
|
203
203
|
return bytes;
|
|
204
204
|
}
|
|
205
205
|
//#endregion
|
|
206
|
-
|
|
207
|
-
var katexModule = null;
|
|
208
|
-
var katexLoadPromise = null;
|
|
209
|
-
function loadKaTeX() {
|
|
210
|
-
if (katexModule) return Promise.resolve(katexModule);
|
|
211
|
-
if (!katexLoadPromise) katexLoadPromise = import("katex").then((mod) => {
|
|
212
|
-
katexModule = mod;
|
|
213
|
-
return katexModule;
|
|
214
|
-
});
|
|
215
|
-
return katexLoadPromise;
|
|
216
|
-
}
|
|
217
|
-
function KaTeXRenderer({ equation, displayMode }) {
|
|
218
|
-
const [html, setHtml] = useState(null);
|
|
219
|
-
const [error, setError] = useState(null);
|
|
220
|
-
useEffect(() => {
|
|
221
|
-
let cancelled = false;
|
|
222
|
-
loadKaTeX().then((katex) => {
|
|
223
|
-
if (cancelled) return;
|
|
224
|
-
const rendered = katex.default.renderToString(equation, {
|
|
225
|
-
displayMode,
|
|
226
|
-
throwOnError: false
|
|
227
|
-
});
|
|
228
|
-
setHtml(rendered);
|
|
229
|
-
setError(null);
|
|
230
|
-
}).catch(() => {
|
|
231
|
-
if (cancelled) return;
|
|
232
|
-
setHtml(null);
|
|
233
|
-
setError("KaTeX is not available");
|
|
234
|
-
});
|
|
235
|
-
return () => {
|
|
236
|
-
cancelled = true;
|
|
237
|
-
};
|
|
238
|
-
}, [equation, displayMode]);
|
|
239
|
-
if (error) return /* @__PURE__ */ jsx("code", {
|
|
240
|
-
className: clsx(katexClassNames.fallback, katexStyles.fallback),
|
|
241
|
-
children: equation
|
|
242
|
-
});
|
|
243
|
-
if (html) return /* @__PURE__ */ jsx("span", {
|
|
244
|
-
dangerouslySetInnerHTML: { __html: html },
|
|
245
|
-
className: displayMode ? clsx(katexClassNames.block, katexStyles.block) : clsx(katexClassNames.inline, katexStyles.inline)
|
|
246
|
-
});
|
|
247
|
-
return /* @__PURE__ */ jsx("code", {
|
|
248
|
-
className: clsx(katexClassNames.fallback, katexStyles.fallback),
|
|
249
|
-
children: equation
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
//#endregion
|
|
253
|
-
export { LINK_CARD_NODE_KEY as C, TAG_NODE_KEY as D, RUBY_NODE_KEY as E, VIDEO_NODE_KEY as O, KATEX_NODE_KEY as S, MERMAID_NODE_KEY as T, CODE_BLOCK_NODE_KEY as _, FootnoteDefinitionsProvider as a, FOOTNOTE_SECTION_NODE_KEY as b, useFootnoteDisplayNumber as c, RendererConfigProvider as d, useRendererConfig as f, BANNER_NODE_KEY as g, ALERT_NODE_KEY as h, FootnoteStaticRenderer as i, RendererWrapper as l, useVariant as m, computeImageMeta as n, useFootnoteContent as o, useRendererMode as p, decodeThumbHash as r, useFootnoteDefinitions as s, KaTeXRenderer as t, createRendererDecoration as u, FILE_NODE_KEY as v, MENTION_NODE_KEY as w, IMAGE_NODE_KEY as x, FOOTNOTE_NODE_KEY as y };
|
|
206
|
+
export { MENTION_NODE_KEY as C, VIDEO_NODE_KEY as D, TAG_NODE_KEY as E, LINK_CARD_NODE_KEY as S, RUBY_NODE_KEY as T, FILE_NODE_KEY as _, useFootnoteContent as a, IMAGE_NODE_KEY as b, RendererWrapper as c, useRendererConfig as d, useRendererMode as f, CODE_BLOCK_NODE_KEY as g, BANNER_NODE_KEY as h, FootnoteDefinitionsProvider as i, createRendererDecoration as l, ALERT_NODE_KEY as m, decodeThumbHash as n, useFootnoteDefinitions as o, useVariant as p, FootnoteStaticRenderer as r, useFootnoteDisplayNumber as s, computeImageMeta as t, RendererConfigProvider as u, FOOTNOTE_NODE_KEY as v, MERMAID_NODE_KEY as w, KATEX_NODE_KEY as x, FOOTNOTE_SECTION_NODE_KEY as y };
|
|
@@ -132,16 +132,4 @@ function getVariantClass(variant) {
|
|
|
132
132
|
return articleVariant;
|
|
133
133
|
}
|
|
134
134
|
//#endregion
|
|
135
|
-
|
|
136
|
-
var katexClassNames = {
|
|
137
|
-
inline: "rich-katex-inline",
|
|
138
|
-
block: "rich-katex-block",
|
|
139
|
-
fallback: "rich-katex-fallback"
|
|
140
|
-
};
|
|
141
|
-
var katexStyles = {
|
|
142
|
-
inline: "egstxq0",
|
|
143
|
-
block: "egstxq1",
|
|
144
|
-
fallback: "egstxq2"
|
|
145
|
-
};
|
|
146
|
-
//#endregion
|
|
147
|
-
export { noteVariant as a, richContent as c, getVariantClass as i, semanticClassNames as l, katexStyles as n, commentVariant as o, clsx as r, articleVariant as s, katexClassNames as t, sharedStyles as u };
|
|
135
|
+
export { articleVariant as a, sharedStyles as c, commentVariant as i, getVariantClass as n, richContent as o, noteVariant as r, semanticClassNames as s, clsx as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "Core rich text editor based on Lexical",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@lexical/code-core": "^0.49.0",
|
|
49
49
|
"nanoid": "^6.0.1",
|
|
50
50
|
"thumbhash": "^0.1.1",
|
|
51
|
-
"@haklex/rich-
|
|
52
|
-
"@haklex/rich-
|
|
53
|
-
"@haklex/rich-
|
|
51
|
+
"@haklex/rich-style-token": "0.45.0",
|
|
52
|
+
"@haklex/rich-editor-ui": "0.45.0",
|
|
53
|
+
"@haklex/rich-headless": "0.45.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@lexical/extension": "^0.49.0",
|