@haklex/rich-editor 0.0.104 → 0.0.105
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-C_Cb063D.js → AlertQuoteEditNode-CPb1jFUY.js} +1 -1
- package/dist/{MermaidPlugin-DI86n71x.js → MermaidPlugin-CJ0tqr0F.js} +8 -4
- package/dist/{SubmitShortcutPlugin-CDqj7KHO.js → SubmitShortcutPlugin-BmTJ4o1C.js} +665 -8
- package/dist/commands-entry.mjs +3 -3
- package/dist/components/RichEditor.d.ts.map +1 -1
- package/dist/components/RichEditorShell.d.ts.map +1 -1
- package/dist/{config-mAejoug-.js → config-DjJiU65k.js} +1 -1
- package/dist/context/TextSelectionContext.d.ts +18 -0
- package/dist/context/TextSelectionContext.d.ts.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +38 -171
- package/dist/{node-registry-BOSH1oBi.js → node-registry-CJe4Pjdm.js} +3 -3
- package/dist/nodes/KaTeXBlockNode.d.ts +7 -2
- package/dist/nodes/KaTeXBlockNode.d.ts.map +1 -1
- package/dist/nodes/KaTeXInlineNode.d.ts +7 -2
- package/dist/nodes/KaTeXInlineNode.d.ts.map +1 -1
- package/dist/nodes-entry.mjs +4 -4
- package/dist/plugins/KaTeXPlugin.d.ts.map +1 -1
- package/dist/plugins/TextSelectionPlugin.d.ts +2 -0
- package/dist/plugins/TextSelectionPlugin.d.ts.map +1 -0
- package/dist/plugins/text-selection.css.d.ts +3 -0
- package/dist/plugins/text-selection.css.d.ts.map +1 -0
- package/dist/plugins-entry.d.ts +1 -0
- package/dist/plugins-entry.d.ts.map +1 -1
- package/dist/plugins-entry.mjs +3 -2
- package/dist/rich-editor.css +1 -1
- package/dist/static-entry.mjs +3 -3
- package/dist/{theme-CrJbATnf.js → theme-I0pMTSBW.js} +78 -10
- package/dist/utils/getRegisteredNodeKlass.d.ts +3 -0
- package/dist/utils/getRegisteredNodeKlass.d.ts.map +1 -0
- package/dist/utils/katex-defaults.d.ts +5 -0
- package/dist/utils/katex-defaults.d.ts.map +1 -0
- package/dist/utils/text-selection-constants.d.ts +3 -0
- package/dist/utils/text-selection-constants.d.ts.map +1 -0
- package/dist/utils/text-selection.d.ts +22 -0
- package/dist/utils/text-selection.d.ts.map +1 -0
- package/package.json +4 -4
package/dist/commands-entry.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a, b, c, d, e } from "./MermaidPlugin-
|
|
2
|
-
import { q as $createSpoilerNode, r as $isSpoilerNode } from "./theme-
|
|
3
|
-
import { O, o } from "./theme-
|
|
1
|
+
import { a, b, c, d, e } from "./MermaidPlugin-CJ0tqr0F.js";
|
|
2
|
+
import { q as $createSpoilerNode, r as $isSpoilerNode } from "./theme-I0pMTSBW.js";
|
|
3
|
+
import { O, o } from "./theme-I0pMTSBW.js";
|
|
4
4
|
import { $getSelection, $isRangeSelection, $createTextNode } from "lexical";
|
|
5
5
|
function collectCommandItems(editor) {
|
|
6
6
|
const items = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichEditor.d.ts","sourceRoot":"","sources":["../../src/components/RichEditor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RichEditor.d.ts","sourceRoot":"","sources":["../../src/components/RichEditor.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD,wBAAgB,UAAU,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,UAAU,EAAE,EAAE,eAAe,+BAsB/F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RichEditorShell.d.ts","sourceRoot":"","sources":["../../src/components/RichEditorShell.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS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IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,OAAO,CAAC,EAAE,iBAAiB,CAAC;CAC7B;AAED,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,YAAY,EACZ,QAAQ,EACR,OAAmB,EACnB,KAAe,EACf,WAAkC,EAClC,QAAQ,EACR,SAAiB,EACjB,SAAS,EACT,gBAAgB,EAChB,KAAK,EACL,OAAO,EACP,MAAM,EACN,aAAa,EACb,cAAc,EACd,UAAU,EACV,QAAQ,GACT,EAAE,oBAAoB,+BAsDtB"}
|
|
@@ -7,7 +7,7 @@ import { LinkNode, AutoLinkNode } from "@lexical/link";
|
|
|
7
7
|
import { ListNode, ListItemNode } from "@lexical/list";
|
|
8
8
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
9
9
|
import { TableNode, TableCellNode, TableRowNode } from "@lexical/table";
|
|
10
|
-
import { u as useNestedContentRenderer, o as extractTextContent, S as SpoilerNode, M as MentionNode, k as KaTeXInlineNode, K as KaTeXBlockNode, I as ImageNode, v as AlertQuoteNode, F as FootnoteNode, l as MermaidNode, T as TagNode } from "./theme-
|
|
10
|
+
import { u as useNestedContentRenderer, o as extractTextContent, S as SpoilerNode, M as MentionNode, k as KaTeXInlineNode, K as KaTeXBlockNode, I as ImageNode, v as AlertQuoteNode, F as FootnoteNode, l as MermaidNode, T as TagNode } from "./theme-I0pMTSBW.js";
|
|
11
11
|
import { DecoratorNode, $insertNodes, TextNode, ElementNode, $createTextNode } from "lexical";
|
|
12
12
|
import { createElement, createContext, use, useState, useRef, useEffect, useCallback } from "react";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TextSelectionSnapshot } from '../utils/text-selection';
|
|
3
|
+
export interface TextSelectionStoreState {
|
|
4
|
+
snapshot: TextSelectionSnapshot | null;
|
|
5
|
+
}
|
|
6
|
+
export interface TextSelectionStore {
|
|
7
|
+
clearSnapshot: () => void;
|
|
8
|
+
getState: () => TextSelectionStoreState;
|
|
9
|
+
setSnapshot: (snapshot: TextSelectionSnapshot | null) => void;
|
|
10
|
+
subscribe: (listener: () => void) => () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createTextSelectionStore(initialState?: TextSelectionStoreState): TextSelectionStore;
|
|
13
|
+
export declare function TextSelectionStoreProvider({ children }: {
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function useTextSelectionStore(): TextSelectionStore;
|
|
17
|
+
export declare function useTextSelectionSnapshot(): TextSelectionSnapshot | null;
|
|
18
|
+
//# sourceMappingURL=TextSelectionContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextSelectionContext.d.ts","sourceRoot":"","sources":["../../src/context/TextSelectionContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAErE,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,kBAAkB;IACjC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,uBAAuB,CAAC;IACxC,WAAW,EAAE,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9D,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC;CACjD;AAkBD,wBAAgB,wBAAwB,CACtC,YAAY,GAAE,uBAA4C,GACzD,kBAAkB,CAmCpB;AAID,wBAAgB,0BAA0B,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,+BAW/E;AAED,wBAAgB,qBAAqB,IAAI,kBAAkB,CAM1D;AAED,wBAAgB,wBAAwB,IAAI,qBAAqB,GAAG,IAAI,CAOvE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -16,10 +16,15 @@ export type { PresentDialogFn, PresentDialogProps } from './context/PresentDialo
|
|
|
16
16
|
export { PresentDialogProvider, usePresentDialog } from './context/PresentDialogContext';
|
|
17
17
|
export type { RendererMode } from './context/RendererConfigContext';
|
|
18
18
|
export { RendererConfigProvider, useRendererConfig, useRendererMode, useVariant, } from './context/RendererConfigContext';
|
|
19
|
+
export type { TextSelectionStore, TextSelectionStoreState } from './context/TextSelectionContext';
|
|
20
|
+
export { createTextSelectionStore, TextSelectionStoreProvider, useTextSelectionSnapshot, useTextSelectionStore, } from './context/TextSelectionContext';
|
|
19
21
|
export { blockIdState } from './plugins/BlockIdPlugin';
|
|
20
22
|
export * from './styles';
|
|
21
23
|
export type { RichEditorProps, RichEditorVariant } from './types';
|
|
22
24
|
export type { RendererConfig } from './types/renderer-config';
|
|
23
25
|
export type { AnchorError, AnchorResult, BlockAnchor, CommentAnchor, RangeAnchor, } from './utils/comment-anchor';
|
|
24
26
|
export { $getRootBlock, $getTextOffsetInBlock, $resolveSelectionPoint, buildBlockAnchor, buildRangeAnchor, } from './utils/comment-anchor';
|
|
27
|
+
export type { DOMSelectionTarget, TextSelectionSnapshot } from './utils/text-selection';
|
|
28
|
+
export { TEXT_SELECTION_HIGHLIGHT_NAME } from './utils/text-selection-constants';
|
|
29
|
+
export { $captureTextSelection, $captureTextSelectionFromRangeSelection, $restoreTextSelection, createDOMRangeFromTextSelection, findDOMPointByTextOffset, getBlockElementById, getDOMRectFromTextSelection, getTextOffsetFromDOMPoint, } from './utils/text-selection';
|
|
25
30
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B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gCAAgC,CAAC;AACzF,YAAY,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EACL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,EACf,UAAU,GACX,MAAM,iCAAiC,CAAC;AACzC,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AAClG,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,cAAc,UAAU,CAAC;AACzB,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAClE,YAAY,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,aAAa,EACb,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,uCAAuC,EACvC,qBAAqB,EACrB,+BAA+B,EAC/B,wBAAwB,EACxB,mBAAmB,EACnB,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { F as FootnotePlugin, O as OnChangePlugin, S as SubmitShortcutPlugin, E as EditorRefPlugin, a as AutoFocusPlugin, d as ImageUploadProvider, g as defaultImageUpload, C as CorePlugins, I as ImageUploadPlugin, L as LinkFaviconPlugin, c as BlockIdPlugin,
|
|
1
|
+
import { h as TextSelectionStoreProvider, F as FootnotePlugin, O as OnChangePlugin, S as SubmitShortcutPlugin, E as EditorRefPlugin, a as AutoFocusPlugin, d as ImageUploadProvider, g as defaultImageUpload, C as CorePlugins, I as ImageUploadPlugin, L as LinkFaviconPlugin, c as BlockIdPlugin, T as TextSelectionPlugin } from "./SubmitShortcutPlugin-BmTJ4o1C.js";
|
|
2
|
+
import { $, i, j, k, l, m, n, f, o, p, q, r, s, t, v, w, x, y } from "./SubmitShortcutPlugin-BmTJ4o1C.js";
|
|
2
3
|
import { E as ExtraNodesProvider } from "./PresentDialogContext-DRroMIoK.js";
|
|
3
4
|
import { L, P, u, a } from "./PresentDialogContext-DRroMIoK.js";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { s as setResolvedEditNodes, a as allEditNodes } from "./node-registry-
|
|
6
|
-
import { I as ImagePlugin, K as KaTeXPlugin, A as AlertPlugin, M as MermaidPlugin } from "./MermaidPlugin-
|
|
6
|
+
import { s as setResolvedEditNodes, a as allEditNodes } from "./node-registry-CJe4Pjdm.js";
|
|
7
|
+
import { I as ImagePlugin, K as KaTeXPlugin, A as AlertPlugin, M as MermaidPlugin } from "./MermaidPlugin-CJ0tqr0F.js";
|
|
7
8
|
import { PortalThemeProvider } from "@haklex/rich-style-token";
|
|
8
9
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
9
10
|
import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
|
|
10
11
|
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
11
12
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
12
|
-
import { n as ColorSchemeProvider } from "./config-
|
|
13
|
-
import { u as u2 } from "./config-
|
|
13
|
+
import { n as ColorSchemeProvider } from "./config-DjJiU65k.js";
|
|
14
|
+
import { u as u2 } from "./config-DjJiU65k.js";
|
|
14
15
|
import { R as RendererConfigProvider } from "./KaTeXRenderer-CQyQzNTJ.js";
|
|
15
|
-
import { F, u as u3, b, d, e, f, g } from "./KaTeXRenderer-CQyQzNTJ.js";
|
|
16
|
-
import { n as editorTheme } from "./theme-
|
|
17
|
-
import { N, u as u4, p } from "./theme-
|
|
16
|
+
import { F, u as u3, b, d, e, f as f2, g } from "./KaTeXRenderer-CQyQzNTJ.js";
|
|
17
|
+
import { n as editorTheme } from "./theme-I0pMTSBW.js";
|
|
18
|
+
import { N, u as u4, p as p2 } from "./theme-I0pMTSBW.js";
|
|
18
19
|
import { ContentEditable as ContentEditable$1 } from "@lexical/react/LexicalContentEditable";
|
|
19
20
|
import { e as clsx, g as getVariantClass } from "./katex.css-Csc-7N7u.js";
|
|
20
|
-
import { a as a2, c, k, b as b2, n, r, s, d as d2 } from "./katex.css-Csc-7N7u.js";
|
|
21
|
+
import { a as a2, c, k as k2, b as b2, n as n2, r as r2, s as s2, d as d2 } from "./katex.css-Csc-7N7u.js";
|
|
21
22
|
import { d as d3, a as a3, g as g2, b as b3 } from "./grid.css-Md5-Cfx_.js";
|
|
22
23
|
import { articleTheme, commentTheme, noteTheme, vars } from "@haklex/rich-style-token/styles";
|
|
23
|
-
import { $getRoot, $isElementNode, $isTextNode, $getSelection, $isRangeSelection, $getState, $isLineBreakNode } from "lexical";
|
|
24
24
|
var contentWrapper = "b94s950";
|
|
25
25
|
var content = "b94s951";
|
|
26
26
|
var placeholder = "b94s952";
|
|
@@ -80,7 +80,7 @@ function RichEditorShell({
|
|
|
80
80
|
...initialValue ? { editorState: JSON.stringify(initialValue) } : {}
|
|
81
81
|
};
|
|
82
82
|
const variantClass = getVariantClass(variant);
|
|
83
|
-
return /* @__PURE__ */ jsx(PortalThemeProvider, { className: variantClass, theme, children: /* @__PURE__ */ jsx(ColorSchemeProvider, { colorScheme: theme, children: /* @__PURE__ */ jsx(RendererConfigProvider, { config: rendererConfig, mode: "editor", variant, children: /* @__PURE__ */ jsx(LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsx(FootnotePlugin, { children: /* @__PURE__ */ jsxs(
|
|
83
|
+
return /* @__PURE__ */ jsx(PortalThemeProvider, { className: variantClass, theme, children: /* @__PURE__ */ jsx(ColorSchemeProvider, { colorScheme: theme, children: /* @__PURE__ */ jsx(RendererConfigProvider, { config: rendererConfig, mode: "editor", variant, children: /* @__PURE__ */ jsx(LexicalComposer, { initialConfig, children: /* @__PURE__ */ jsx(TextSelectionStoreProvider, { children: /* @__PURE__ */ jsx(FootnotePlugin, { children: /* @__PURE__ */ jsxs(
|
|
84
84
|
"div",
|
|
85
85
|
{
|
|
86
86
|
suppressHydrationWarning: true,
|
|
@@ -112,7 +112,7 @@ function RichEditorShell({
|
|
|
112
112
|
actions && /* @__PURE__ */ jsx("div", { className: "rich-editor__actions", children: actions })
|
|
113
113
|
]
|
|
114
114
|
}
|
|
115
|
-
) }) }) }) }) });
|
|
115
|
+
) }) }) }) }) }) });
|
|
116
116
|
}
|
|
117
117
|
function RichEditor({ extraNodes, imageUpload, children, ...shellProps }) {
|
|
118
118
|
const nodes = extraNodes ? [...allEditNodes, ...extraNodes] : allEditNodes;
|
|
@@ -126,160 +126,17 @@ function RichEditor({ extraNodes, imageUpload, children, ...shellProps }) {
|
|
|
126
126
|
/* @__PURE__ */ jsx(MermaidPlugin, {}),
|
|
127
127
|
/* @__PURE__ */ jsx(LinkFaviconPlugin, {}),
|
|
128
128
|
/* @__PURE__ */ jsx(BlockIdPlugin, {}),
|
|
129
|
+
/* @__PURE__ */ jsx(TextSelectionPlugin, {}),
|
|
129
130
|
children
|
|
130
131
|
] }) }) });
|
|
131
132
|
}
|
|
132
|
-
function computeBlockFingerprint(block) {
|
|
133
|
-
const text = block.getTextContent();
|
|
134
|
-
const input = text.slice(0, 200) + String(text.length);
|
|
135
|
-
let hash = 5381;
|
|
136
|
-
for (let i = 0; i < input.length; i++) {
|
|
137
|
-
hash = (hash << 5) + hash + (input.codePointAt(i) ?? 0) | 0;
|
|
138
|
-
}
|
|
139
|
-
return (hash >>> 0).toString(16);
|
|
140
|
-
}
|
|
141
|
-
function $getRootBlock(node) {
|
|
142
|
-
const root = $getRoot();
|
|
143
|
-
let current = node;
|
|
144
|
-
while (current) {
|
|
145
|
-
const parent = current.getParent();
|
|
146
|
-
if (parent === root && "getChildren" in current) {
|
|
147
|
-
return current;
|
|
148
|
-
}
|
|
149
|
-
current = parent;
|
|
150
|
-
}
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
function $resolveSelectionPoint(selection, which) {
|
|
154
|
-
const point = selection[which];
|
|
155
|
-
const node = point.getNode();
|
|
156
|
-
if ($isElementNode(node)) {
|
|
157
|
-
const children = node.getChildren();
|
|
158
|
-
if (point.offset < children.length) {
|
|
159
|
-
return { node: children[point.offset], offset: 0 };
|
|
160
|
-
}
|
|
161
|
-
const last = children.at(-1);
|
|
162
|
-
if (last && $isTextNode(last)) {
|
|
163
|
-
return { node: last, offset: last.getTextContentSize() };
|
|
164
|
-
}
|
|
165
|
-
return { node, offset: 0 };
|
|
166
|
-
}
|
|
167
|
-
return { node, offset: point.offset };
|
|
168
|
-
}
|
|
169
|
-
function $getTextOffsetInBlock(block, targetNode, targetOffset) {
|
|
170
|
-
let offset = 0;
|
|
171
|
-
function walk(node) {
|
|
172
|
-
if (node.is(targetNode)) {
|
|
173
|
-
offset += targetOffset;
|
|
174
|
-
return true;
|
|
175
|
-
}
|
|
176
|
-
if ($isTextNode(node)) {
|
|
177
|
-
offset += node.getTextContentSize();
|
|
178
|
-
} else if ($isLineBreakNode(node)) {
|
|
179
|
-
offset += 1;
|
|
180
|
-
} else if ($isElementNode(node)) {
|
|
181
|
-
for (const child of node.getChildren()) {
|
|
182
|
-
if (walk(child)) return true;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
return false;
|
|
186
|
-
}
|
|
187
|
-
for (const child of block.getChildren()) {
|
|
188
|
-
if (walk(child)) break;
|
|
189
|
-
}
|
|
190
|
-
return offset;
|
|
191
|
-
}
|
|
192
|
-
function $buildBlockAnchorData(block) {
|
|
193
|
-
const blockId = $getState(block, blockIdState);
|
|
194
|
-
if (!blockId) {
|
|
195
|
-
return { ok: false, error: "no-block-id" };
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
ok: true,
|
|
199
|
-
anchor: {
|
|
200
|
-
mode: "block",
|
|
201
|
-
blockId,
|
|
202
|
-
blockType: block.getType(),
|
|
203
|
-
blockFingerprint: computeBlockFingerprint(block),
|
|
204
|
-
snapshotText: block.getTextContent().slice(0, 300)
|
|
205
|
-
}
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
function buildBlockAnchor(editor, blockKey) {
|
|
209
|
-
return editor.read(() => {
|
|
210
|
-
if (blockKey) {
|
|
211
|
-
const node = $getRoot().getChildren().find((c2) => c2.getKey() === blockKey);
|
|
212
|
-
if (!node || !("getChildren" in node)) {
|
|
213
|
-
return { ok: false, error: "not-root-block" };
|
|
214
|
-
}
|
|
215
|
-
return $buildBlockAnchorData(node);
|
|
216
|
-
}
|
|
217
|
-
const selection = $getSelection();
|
|
218
|
-
if (!$isRangeSelection(selection)) {
|
|
219
|
-
return { ok: false, error: "no-selection" };
|
|
220
|
-
}
|
|
221
|
-
const anchorNode = selection.anchor.getNode();
|
|
222
|
-
const block = $getRootBlock(anchorNode);
|
|
223
|
-
if (!block) {
|
|
224
|
-
return { ok: false, error: "not-root-block" };
|
|
225
|
-
}
|
|
226
|
-
return $buildBlockAnchorData(block);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
function buildRangeAnchor(editor) {
|
|
230
|
-
return editor.read(() => {
|
|
231
|
-
const selection = $getSelection();
|
|
232
|
-
if (!$isRangeSelection(selection)) {
|
|
233
|
-
return { ok: false, error: "no-selection" };
|
|
234
|
-
}
|
|
235
|
-
if (selection.isCollapsed()) {
|
|
236
|
-
return { ok: false, error: "collapsed" };
|
|
237
|
-
}
|
|
238
|
-
const anchorBlock = $getRootBlock(selection.anchor.getNode());
|
|
239
|
-
const focusBlock = $getRootBlock(selection.focus.getNode());
|
|
240
|
-
if (!anchorBlock || !focusBlock) {
|
|
241
|
-
return { ok: false, error: "not-root-block" };
|
|
242
|
-
}
|
|
243
|
-
if (anchorBlock !== focusBlock) {
|
|
244
|
-
return { ok: false, error: "cross-block" };
|
|
245
|
-
}
|
|
246
|
-
const block = anchorBlock;
|
|
247
|
-
const blockId = $getState(block, blockIdState);
|
|
248
|
-
if (!blockId) {
|
|
249
|
-
return { ok: false, error: "no-block-id" };
|
|
250
|
-
}
|
|
251
|
-
const anchorPoint = $resolveSelectionPoint(selection, "anchor");
|
|
252
|
-
const focusPoint = $resolveSelectionPoint(selection, "focus");
|
|
253
|
-
let startOffset = $getTextOffsetInBlock(block, anchorPoint.node, anchorPoint.offset);
|
|
254
|
-
let endOffset = $getTextOffsetInBlock(block, focusPoint.node, focusPoint.offset);
|
|
255
|
-
if (startOffset > endOffset) {
|
|
256
|
-
[startOffset, endOffset] = [endOffset, startOffset];
|
|
257
|
-
}
|
|
258
|
-
const text = block.getTextContent();
|
|
259
|
-
const quote = text.slice(startOffset, endOffset);
|
|
260
|
-
const prefix = text.slice(Math.max(0, startOffset - 50), startOffset);
|
|
261
|
-
const suffix = text.slice(endOffset, endOffset + 50);
|
|
262
|
-
return {
|
|
263
|
-
ok: true,
|
|
264
|
-
anchor: {
|
|
265
|
-
mode: "range",
|
|
266
|
-
blockId,
|
|
267
|
-
blockType: block.getType(),
|
|
268
|
-
blockFingerprint: computeBlockFingerprint(block),
|
|
269
|
-
snapshotText: text.slice(0, 300),
|
|
270
|
-
quote,
|
|
271
|
-
prefix,
|
|
272
|
-
suffix,
|
|
273
|
-
startOffset,
|
|
274
|
-
endOffset
|
|
275
|
-
}
|
|
276
|
-
};
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
133
|
export {
|
|
280
|
-
$
|
|
281
|
-
$
|
|
282
|
-
$
|
|
134
|
+
$ as $captureTextSelection,
|
|
135
|
+
i as $captureTextSelectionFromRangeSelection,
|
|
136
|
+
j as $getRootBlock,
|
|
137
|
+
k as $getTextOffsetInBlock,
|
|
138
|
+
l as $resolveSelectionPoint,
|
|
139
|
+
m as $restoreTextSelection,
|
|
283
140
|
ColorSchemeProvider,
|
|
284
141
|
CorePlugins,
|
|
285
142
|
ExtraNodesProvider,
|
|
@@ -290,25 +147,33 @@ export {
|
|
|
290
147
|
RendererConfigProvider,
|
|
291
148
|
RichEditor,
|
|
292
149
|
RichEditorShell,
|
|
150
|
+
n as TEXT_SELECTION_HIGHLIGHT_NAME,
|
|
151
|
+
TextSelectionStoreProvider,
|
|
293
152
|
articleTheme,
|
|
294
153
|
a2 as articleVariant,
|
|
295
|
-
blockIdState,
|
|
296
|
-
buildBlockAnchor,
|
|
297
|
-
buildRangeAnchor,
|
|
154
|
+
f as blockIdState,
|
|
155
|
+
o as buildBlockAnchor,
|
|
156
|
+
p as buildRangeAnchor,
|
|
298
157
|
commentTheme,
|
|
299
158
|
c as commentVariant,
|
|
159
|
+
q as createDOMRangeFromTextSelection,
|
|
160
|
+
r as createTextSelectionStore,
|
|
300
161
|
d3 as detailsClassNames,
|
|
301
162
|
a3 as detailsStyles,
|
|
302
163
|
editorTheme,
|
|
164
|
+
s as findDOMPointByTextOffset,
|
|
165
|
+
t as getBlockElementById,
|
|
166
|
+
v as getDOMRectFromTextSelection,
|
|
167
|
+
w as getTextOffsetFromDOMPoint,
|
|
303
168
|
getVariantClass,
|
|
304
169
|
g2 as gridClassNames,
|
|
305
170
|
b3 as gridStyles,
|
|
306
|
-
|
|
171
|
+
k2 as katexClassNames,
|
|
307
172
|
b2 as katexStyles,
|
|
308
173
|
noteTheme,
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
174
|
+
n2 as noteVariant,
|
|
175
|
+
r2 as richContent,
|
|
176
|
+
s2 as semanticClassNames,
|
|
312
177
|
d2 as sharedStyles,
|
|
313
178
|
u2 as useColorScheme,
|
|
314
179
|
u as useExtraNodes,
|
|
@@ -316,10 +181,12 @@ export {
|
|
|
316
181
|
b as useFootnoteDefinitions,
|
|
317
182
|
d as useFootnoteDisplayNumber,
|
|
318
183
|
u4 as useNestedContentRenderer,
|
|
319
|
-
|
|
184
|
+
p2 as useOptionalNestedContentRenderer,
|
|
320
185
|
a as usePresentDialog,
|
|
321
186
|
e as useRendererConfig,
|
|
322
|
-
|
|
187
|
+
f2 as useRendererMode,
|
|
188
|
+
x as useTextSelectionSnapshot,
|
|
189
|
+
y as useTextSelectionStore,
|
|
323
190
|
g as useVariant,
|
|
324
191
|
vars
|
|
325
192
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
import { o as $isBannerNode, p as BannerRenderer, q as BannerNode, r as normalizeBannerType, s as $isCodeBlockNode, t as CodeBlockRenderer, v as CodeBlockNode, F as FootnoteSectionNode, g as $isGridContainerNode, G as GridContainerNode, l as builtinNodes, V as VideoNode, L as LinkCardNode, C as CommentNode, D as DetailsNode, R as RubyNode } from "./config-
|
|
5
|
-
import { N as NESTED_EDITOR_NODES, A as AlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
4
|
+
import { o as $isBannerNode, p as BannerRenderer, q as BannerNode, r as normalizeBannerType, s as $isCodeBlockNode, t as CodeBlockRenderer, v as CodeBlockNode, F as FootnoteSectionNode, g as $isGridContainerNode, G as GridContainerNode, l as builtinNodes, V as VideoNode, L as LinkCardNode, C as CommentNode, D as DetailsNode, R as RubyNode } from "./config-DjJiU65k.js";
|
|
5
|
+
import { N as NESTED_EDITOR_NODES, A as AlertQuoteEditNode } from "./AlertQuoteEditNode-CPb1jFUY.js";
|
|
6
6
|
import { $getNodeByKey, $insertNodes, createEditor, $getSelection, $isNodeSelection, $isElementNode, $isDecoratorNode, $createNodeSelection, $setSelection, $createParagraphNode, $nodesOfType, $getRoot } from "lexical";
|
|
7
7
|
import { Flag, LayoutGrid, Plus, Minus } from "lucide-react";
|
|
8
8
|
import { useCallback, createElement, useState, useEffect } from "react";
|
|
@@ -15,7 +15,7 @@ import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
|
15
15
|
import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
|
|
16
16
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
17
17
|
import { a as RendererWrapper, b as useFootnoteDefinitions } from "./KaTeXRenderer-CQyQzNTJ.js";
|
|
18
|
-
import { n as editorTheme, S as SpoilerNode, M as MentionNode, k as KaTeXInlineNode, K as KaTeXBlockNode, I as ImageNode, F as FootnoteNode, l as MermaidNode, T as TagNode } from "./theme-
|
|
18
|
+
import { n as editorTheme, S as SpoilerNode, M as MentionNode, k as KaTeXInlineNode, K as KaTeXBlockNode, I as ImageNode, F as FootnoteNode, l as MermaidNode, T as TagNode } from "./theme-I0pMTSBW.js";
|
|
19
19
|
import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection";
|
|
20
20
|
import { e as clsx, d as sharedStyles, s as semanticClassNames } from "./katex.css-Csc-7N7u.js";
|
|
21
21
|
import { b as gridStyles, g as gridClassNames } from "./grid.css-Md5-Cfx_.js";
|
|
@@ -6,10 +6,11 @@ export type SerializedKaTeXBlockNode = Spread<{
|
|
|
6
6
|
}, SerializedLexicalNode>;
|
|
7
7
|
export declare class KaTeXBlockNode extends DecoratorNode<ReactElement> {
|
|
8
8
|
__equation: string;
|
|
9
|
+
__autoOpenOnMount: boolean;
|
|
9
10
|
static slashMenuItems: SlashMenuItemConfig[];
|
|
10
11
|
static getType(): string;
|
|
11
12
|
static clone(node: KaTeXBlockNode): KaTeXBlockNode;
|
|
12
|
-
constructor(equation: string, key?: NodeKey);
|
|
13
|
+
constructor(equation: string, key?: NodeKey, autoOpenOnMount?: boolean);
|
|
13
14
|
createDOM(_config: EditorConfig): HTMLElement;
|
|
14
15
|
updateDOM(): boolean;
|
|
15
16
|
isInline(): boolean;
|
|
@@ -17,8 +18,12 @@ export declare class KaTeXBlockNode extends DecoratorNode<ReactElement> {
|
|
|
17
18
|
exportJSON(): SerializedKaTeXBlockNode;
|
|
18
19
|
getEquation(): string;
|
|
19
20
|
setEquation(equation: string): void;
|
|
21
|
+
getShouldAutoOpenOnMount(): boolean;
|
|
22
|
+
setShouldAutoOpenOnMount(autoOpenOnMount: boolean): void;
|
|
20
23
|
decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement;
|
|
21
24
|
}
|
|
22
|
-
export declare function $createKaTeXBlockNode(equation: string
|
|
25
|
+
export declare function $createKaTeXBlockNode(equation: string, options?: {
|
|
26
|
+
autoOpenOnMount?: boolean;
|
|
27
|
+
}): KaTeXBlockNode;
|
|
23
28
|
export declare function $isKaTeXBlockNode(node: LexicalNode | null | undefined): node is KaTeXBlockNode;
|
|
24
29
|
//# sourceMappingURL=KaTeXBlockNode.d.ts.map
|
|
@@ -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,CAAA;AAChB,OAAO,EAAgB,aAAa,EAAE,MAAM,SAAS,CAAA;AAErD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAKzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;
|
|
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,CAA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AAG,SAAS,GACnC,IAAI,IAAI,cAAc,CAExB"}
|
|
@@ -5,9 +5,10 @@ export type SerializedKaTeXInlineNode = Spread<{
|
|
|
5
5
|
}, SerializedLexicalNode>;
|
|
6
6
|
export declare class KaTeXInlineNode extends DecoratorNode<ReactElement> {
|
|
7
7
|
__equation: string;
|
|
8
|
+
__autoOpenOnMount: boolean;
|
|
8
9
|
static getType(): string;
|
|
9
10
|
static clone(node: KaTeXInlineNode): KaTeXInlineNode;
|
|
10
|
-
constructor(equation: string, key?: NodeKey);
|
|
11
|
+
constructor(equation: string, key?: NodeKey, autoOpenOnMount?: boolean);
|
|
11
12
|
createDOM(_config: EditorConfig): HTMLElement;
|
|
12
13
|
updateDOM(): boolean;
|
|
13
14
|
isInline(): boolean;
|
|
@@ -15,8 +16,12 @@ export declare class KaTeXInlineNode extends DecoratorNode<ReactElement> {
|
|
|
15
16
|
exportJSON(): SerializedKaTeXInlineNode;
|
|
16
17
|
getEquation(): string;
|
|
17
18
|
setEquation(equation: string): void;
|
|
19
|
+
getShouldAutoOpenOnMount(): boolean;
|
|
20
|
+
setShouldAutoOpenOnMount(autoOpenOnMount: boolean): void;
|
|
18
21
|
decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement;
|
|
19
22
|
}
|
|
20
|
-
export declare function $createKaTeXInlineNode(equation: string
|
|
23
|
+
export declare function $createKaTeXInlineNode(equation: string, options?: {
|
|
24
|
+
autoOpenOnMount?: boolean;
|
|
25
|
+
}): KaTeXInlineNode;
|
|
21
26
|
export declare function $isKaTeXInlineNode(node: LexicalNode | null | undefined): node is KaTeXInlineNode;
|
|
22
27
|
//# sourceMappingURL=KaTeXInlineNode.d.ts.map
|
|
@@ -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,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,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAMtE;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,eAAe,CAUjB;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,eAAe,CAEzB"}
|
package/dist/nodes-entry.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { $, a, b, c, d, e, f, g, h, i, B, j, C, F, G, L, R, k, l, m } from "./config-
|
|
2
|
-
import { F as F2, a as a2, c as c2, g as g2, s } from "./node-registry-
|
|
3
|
-
import { N } from "./AlertQuoteEditNode-
|
|
4
|
-
import { $ as $2, a as a3, b as b2, c as c3, d as d2, e as e2, f as f2, g as g3, h as h2, i as i2, A, j as j2, I, K, k as k2, M, l as l2, T } from "./theme-
|
|
1
|
+
import { $, a, b, c, d, e, f, g, h, i, B, j, C, F, G, L, R, k, l, m } from "./config-DjJiU65k.js";
|
|
2
|
+
import { F as F2, a as a2, c as c2, g as g2, s } from "./node-registry-CJe4Pjdm.js";
|
|
3
|
+
import { N } from "./AlertQuoteEditNode-CPb1jFUY.js";
|
|
4
|
+
import { $ as $2, a as a3, b as b2, c as c3, d as d2, e as e2, f as f2, g as g3, h as h2, i as i2, A, j as j2, I, K, k as k2, M, l as l2, T } from "./theme-I0pMTSBW.js";
|
|
5
5
|
export {
|
|
6
6
|
$ as $createCommentNode,
|
|
7
7
|
a as $createFootnoteSectionNode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KaTeXPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/KaTeXPlugin.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,2BAA2B,0CAEvC,CAAA;AACD,eAAO,MAAM,0BAA0B,0CACM,CAAA;AAE7C,wBAAgB,WAAW,
|
|
1
|
+
{"version":3,"file":"KaTeXPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/KaTeXPlugin.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,2BAA2B,0CAEvC,CAAA;AACD,eAAO,MAAM,0BAA0B,0CACM,CAAA;AAE7C,wBAAgB,WAAW,SAmC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextSelectionPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/TextSelectionPlugin.tsx"],"names":[],"mappings":"AAqCA,wBAAgB,mBAAmB,SAqLlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-selection.css.d.ts","sourceRoot":"","sources":["../../src/plugins/text-selection.css.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,qBAAqB,QAAY,CAAC;AAC/C,eAAO,MAAM,uBAAuB,QAAY,CAAC"}
|
package/dist/plugins-entry.d.ts
CHANGED
|
@@ -18,5 +18,6 @@ export { MarkdownShortcutsPlugin } from './plugins/MarkdownShortcutsPlugin';
|
|
|
18
18
|
export { MermaidPlugin } from './plugins/MermaidPlugin';
|
|
19
19
|
export { OnChangePlugin } from './plugins/OnChangePlugin';
|
|
20
20
|
export { SubmitShortcutPlugin } from './plugins/SubmitShortcutPlugin';
|
|
21
|
+
export { TextSelectionPlugin } from './plugins/TextSelectionPlugin';
|
|
21
22
|
export { ALL_TRANSFORMERS } from './transformers';
|
|
22
23
|
//# sourceMappingURL=plugins-entry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins-entry.d.ts","sourceRoot":"","sources":["../src/plugins-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAA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AE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/plugins-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A, a, b, B, c, C, E, F, H, I, d, L, M, e, O, S, f, g, u } from "./SubmitShortcutPlugin-
|
|
2
|
-
import { A as A2, I as I2, K, M as M2 } from "./MermaidPlugin-
|
|
1
|
+
import { A, a, b, B, c, C, E, F, H, I, d, L, M, e, O, S, T, f, g, u } from "./SubmitShortcutPlugin-BmTJ4o1C.js";
|
|
2
|
+
import { A as A2, I as I2, K, M as M2 } from "./MermaidPlugin-CJ0tqr0F.js";
|
|
3
3
|
export {
|
|
4
4
|
A as ALL_TRANSFORMERS,
|
|
5
5
|
A2 as AlertPlugin,
|
|
@@ -21,6 +21,7 @@ export {
|
|
|
21
21
|
M2 as MermaidPlugin,
|
|
22
22
|
O as OnChangePlugin,
|
|
23
23
|
S as SubmitShortcutPlugin,
|
|
24
|
+
T as TextSelectionPlugin,
|
|
24
25
|
f as blockIdState,
|
|
25
26
|
g as defaultImageUpload,
|
|
26
27
|
u as useImageUpload
|