@haklex/rich-editor 0.4.0 → 0.4.1
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/README.md +9 -9
- package/dist/{AlertQuoteEditNode-C55sxsR3.js → AlertQuoteEditNode-bJolZMh7.js} +1 -1
- package/dist/{MermaidPlugin-BrOr-wQi.js → MermaidPlugin-BRyrtUBj.js} +2 -2
- package/dist/{SubmitShortcutPlugin-u9xqY3GU.js → SubmitShortcutPlugin-DtHHlBnh.js} +4 -4
- package/dist/commands-entry.mjs +2 -2
- package/dist/{config-B5BuLljq.js → config-CTD7-xAy.js} +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{node-registry-DsyIROEM.js → node-registry-BmeHYCtG.js} +3 -3
- package/dist/nodes/KaTeXBlockNode.d.ts.map +1 -1
- package/dist/nodes-entry.mjs +4 -4
- package/dist/plugins-entry.mjs +2 -2
- package/dist/static-entry.mjs +2 -2
- package/dist/utils/text-selection.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/{theme-B5B2EOWM.js → theme-QqiMxW5u.js} +7 -7
package/README.md
CHANGED
|
@@ -10,19 +10,19 @@ pnpm add @haklex/rich-editor lexical @lexical/react react react-dom
|
|
|
10
10
|
|
|
11
11
|
## Peer Dependencies
|
|
12
12
|
|
|
13
|
-
Lexical 0.
|
|
13
|
+
Lexical 0.44+ exposes code blocks in `@lexical/code-core` (no Prism). This package depends on it; add `@lexical/code-core` to your app only if you import it yourself (e.g. custom code-block tooling).
|
|
14
14
|
|
|
15
15
|
| Package | Version | Required |
|
|
16
16
|
| -------------------- | ---------- | -------- |
|
|
17
17
|
| `@base-ui/react` | `^1.1.0` | Yes |
|
|
18
|
-
| `@lexical/extension` | `^0.
|
|
19
|
-
| `@lexical/link` | `^0.
|
|
20
|
-
| `@lexical/list` | `^0.
|
|
21
|
-
| `@lexical/markdown` | `^0.
|
|
22
|
-
| `@lexical/react` | `^0.
|
|
23
|
-
| `@lexical/rich-text` | `^0.
|
|
24
|
-
| `@lexical/table` | `^0.
|
|
25
|
-
| `lexical` | `^0.
|
|
18
|
+
| `@lexical/extension` | `^0.44.0` | Yes |
|
|
19
|
+
| `@lexical/link` | `^0.44.0` | Yes |
|
|
20
|
+
| `@lexical/list` | `^0.44.0` | Yes |
|
|
21
|
+
| `@lexical/markdown` | `^0.44.0` | Yes |
|
|
22
|
+
| `@lexical/react` | `^0.44.0` | Yes |
|
|
23
|
+
| `@lexical/rich-text` | `^0.44.0` | Yes |
|
|
24
|
+
| `@lexical/table` | `^0.44.0` | Yes |
|
|
25
|
+
| `lexical` | `^0.44.0` | Yes |
|
|
26
26
|
| `lucide-react` | `^0.574.0` | Yes |
|
|
27
27
|
| `react` | `>=19` | Yes |
|
|
28
28
|
| `react-dom` | `>=19` | Yes |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AlertQuoteNode, D as $isAlertQuoteNode, E as FootnoteNode, N as AlertRenderer, _ as KaTeXInlineNode, c as SpoilerNode, i as TagNode, j as _defineProperty, m as MentionNode, t as editorTheme } from "./theme-
|
|
1
|
+
import { A as AlertQuoteNode, D as $isAlertQuoteNode, E as FootnoteNode, N as AlertRenderer, _ as KaTeXInlineNode, c as SpoilerNode, i as TagNode, j as _defineProperty, m as MentionNode, t as editorTheme } from "./theme-QqiMxW5u.js";
|
|
2
2
|
import { l as RendererWrapper } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
3
3
|
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
4
4
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as $createKaTeXInlineNode, l as $createMermaidNode, v as $createKaTeXBlockNode, x as $createImageNode } from "./theme-
|
|
2
|
-
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
1
|
+
import { h as $createKaTeXInlineNode, l as $createMermaidNode, v as $createKaTeXBlockNode, x as $createImageNode } from "./theme-QqiMxW5u.js";
|
|
2
|
+
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-bJolZMh7.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,9 +1,9 @@
|
|
|
1
|
-
import { d as setCodeBlockCursorIntent, l as $createCodeBlockEditNode, t as getResolvedEditNodes, u as $createBannerEditNode } from "./node-registry-
|
|
2
|
-
import { A as AlertQuoteNode, E as FootnoteNode, M as extractTextContent, T as $createFootnoteNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, f as $createMentionNode, h as $createKaTeXInlineNode, m as MentionNode, o as $createSpoilerNode, v as $createKaTeXBlockNode, w as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, x as $createImageNode } from "./theme-
|
|
1
|
+
import { d as setCodeBlockCursorIntent, l as $createCodeBlockEditNode, t as getResolvedEditNodes, u as $createBannerEditNode } from "./node-registry-BmeHYCtG.js";
|
|
2
|
+
import { A as AlertQuoteNode, E as FootnoteNode, M as extractTextContent, T as $createFootnoteNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, f as $createMentionNode, h as $createKaTeXInlineNode, m as MentionNode, o as $createSpoilerNode, v as $createKaTeXBlockNode, w as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, x as $createImageNode } from "./theme-QqiMxW5u.js";
|
|
3
3
|
import { a as FootnoteDefinitionsProvider, n as computeImageMeta } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
4
4
|
import "./katex.css-CIOEOXyd.js";
|
|
5
|
-
import { A as $createCommentPlaceholderNode, D as $createDetailsNode, E as FootnoteSectionNode, M as CommentNode, O as DetailsNode, P as CodeBlockNode, S as $isGridContainerNode, T as $isFootnoteSectionNode, V as BannerNode, a as $createRubyNode, k as $createCommentNode, s as RubyNode, w as $createFootnoteSectionNode } from "./config-
|
|
6
|
-
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
5
|
+
import { A as $createCommentPlaceholderNode, D as $createDetailsNode, E as FootnoteSectionNode, M as CommentNode, O as DetailsNode, P as CodeBlockNode, S as $isGridContainerNode, T as $isFootnoteSectionNode, V as BannerNode, a as $createRubyNode, k as $createCommentNode, s as RubyNode, w as $createFootnoteSectionNode } from "./config-CTD7-xAy.js";
|
|
6
|
+
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-bJolZMh7.js";
|
|
7
7
|
import { n as getHostname, r as probeFavicon, t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-B-1wmGzd.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 { M as extractTextContent, o as $createSpoilerNode, s as $isSpoilerNode, w as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND } 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 { M as extractTextContent, o as $createSpoilerNode, s as $isSpoilerNode, w as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND } from "./theme-QqiMxW5u.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-BRyrtUBj.js";
|
|
3
3
|
import { $createTextNode, $getSelection, $isRangeSelection } from "lexical";
|
|
4
4
|
//#region src/utils/collect-command-items.ts
|
|
5
5
|
function collectCommandItems(editor) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as AlertQuoteNode, C as ImageNode, E as FootnoteNode, F as useNestedContentRenderer, M as extractTextContent, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, d as MermaidNode, i as TagNode, j as _defineProperty, m as MentionNode } from "./theme-
|
|
1
|
+
import { A as AlertQuoteNode, C as ImageNode, E as FootnoteNode, F as useNestedContentRenderer, M as extractTextContent, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, d as MermaidNode, i as TagNode, j as _defineProperty, m as MentionNode } from "./theme-QqiMxW5u.js";
|
|
2
2
|
import { l as RendererWrapper, m as useVariant, s as useFootnoteDefinitions, u as createRendererDecoration } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
3
3
|
import { l as semanticClassNames, r as clsx, u as sharedStyles } from "./katex.css-CIOEOXyd.js";
|
|
4
4
|
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-CJCkLTZc.js";
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { A as ImageUploadProvider, C as useTextSelectionSnapshot, D as defaultImageUpload, E as ImageUploadPlugin, M as CorePlugins, O as BlockIdPlugin, S as createTextSelectionStore, T as LinkFaviconPlugin, _ as $getTextOffsetInBlock, a as AutoFocusPlugin, b as buildRangeAnchor, c as $captureTextSelectionFromRangeSelection, d as findDOMPointByTextOffset, f as getBlockElementById, g as $getRootBlock, h as TEXT_SELECTION_HIGHLIGHT_NAME, i as EditorRefPlugin, k as blockIdState, l as $restoreTextSelection, m as getTextOffsetFromDOMPoint, n as OnChangePlugin, o as TextSelectionPlugin, p as getDOMRectFromTextSelection, r as FootnotePlugin, s as $captureTextSelection, t as SubmitShortcutPlugin, u as createDOMRangeFromTextSelection, v as $resolveSelectionPoint, w as useTextSelectionStore, x as TextSelectionStoreProvider, y as buildBlockAnchor } from "./SubmitShortcutPlugin-
|
|
2
|
-
import { n as setResolvedEditNodes, r as allEditNodes, s as pollEditClasses } from "./node-registry-
|
|
3
|
-
import { F as useNestedContentRenderer, I as useOptionalNestedContentRenderer, P as NestedContentRendererProvider, t as editorTheme } from "./theme-
|
|
1
|
+
import { A as ImageUploadProvider, C as useTextSelectionSnapshot, D as defaultImageUpload, E as ImageUploadPlugin, M as CorePlugins, O as BlockIdPlugin, S as createTextSelectionStore, T as LinkFaviconPlugin, _ as $getTextOffsetInBlock, a as AutoFocusPlugin, b as buildRangeAnchor, c as $captureTextSelectionFromRangeSelection, d as findDOMPointByTextOffset, f as getBlockElementById, g as $getRootBlock, h as TEXT_SELECTION_HIGHLIGHT_NAME, i as EditorRefPlugin, k as blockIdState, l as $restoreTextSelection, m as getTextOffsetFromDOMPoint, n as OnChangePlugin, o as TextSelectionPlugin, p as getDOMRectFromTextSelection, r as FootnotePlugin, s as $captureTextSelection, t as SubmitShortcutPlugin, u as createDOMRangeFromTextSelection, v as $resolveSelectionPoint, w as useTextSelectionStore, x as TextSelectionStoreProvider, y as buildBlockAnchor } from "./SubmitShortcutPlugin-DtHHlBnh.js";
|
|
2
|
+
import { n as setResolvedEditNodes, r as allEditNodes, s as pollEditClasses } from "./node-registry-BmeHYCtG.js";
|
|
3
|
+
import { F as useNestedContentRenderer, I as useOptionalNestedContentRenderer, P as NestedContentRendererProvider, t as editorTheme } from "./theme-QqiMxW5u.js";
|
|
4
4
|
import { a as FootnoteDefinitionsProvider, c as useFootnoteDisplayNumber, d as RendererConfigProvider, f as useRendererConfig, m as useVariant, o as useFootnoteContent, p as useRendererMode, s as useFootnoteDefinitions } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
5
5
|
import { a as noteVariant, c as richContent, i as getVariantClass, l as semanticClassNames, n as katexStyles, o as commentVariant, r as clsx, s as articleVariant, t as katexClassNames, u as sharedStyles } from "./katex.css-CIOEOXyd.js";
|
|
6
|
-
import { I as ColorSchemeProvider, L as useColorScheme, _ as usePollDataAdapter, g as useInitialPollState, h as PollDataProvider, m as pollClasses } from "./config-
|
|
6
|
+
import { I as ColorSchemeProvider, L as useColorScheme, _ as usePollDataAdapter, g as useInitialPollState, h as PollDataProvider, m as pollClasses } from "./config-CTD7-xAy.js";
|
|
7
7
|
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-CJCkLTZc.js";
|
|
8
8
|
import { a as useExtraNodes, i as ExtraNodesProvider, n as PresentDialogProvider, o as LinkFavicon, r as usePresentDialog, t as extractPolls } from "./extractPolls-DO31LNrp.js";
|
|
9
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
9
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BRyrtUBj.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
11
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
12
12
|
import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { C as ImageNode, E as FootnoteNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, d as MermaidNode, i as TagNode, j as _defineProperty, m as MentionNode, t as editorTheme } from "./theme-
|
|
1
|
+
import { C as ImageNode, E as FootnoteNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, c as SpoilerNode, d as MermaidNode, i as TagNode, j as _defineProperty, m as MentionNode, t as editorTheme } from "./theme-QqiMxW5u.js";
|
|
2
2
|
import { l as RendererWrapper, s as useFootnoteDefinitions } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
3
3
|
import { l as semanticClassNames, r as clsx, u as sharedStyles } from "./katex.css-CIOEOXyd.js";
|
|
4
|
-
import { C as GridContainerNode, E as FootnoteSectionNode, F as CodeBlockRenderer, H as normalizeBannerType, M as CommentNode, N as $isCodeBlockNode, O as DetailsNode, P as CodeBlockNode, R as $isBannerNode, S as $isGridContainerNode, U as BannerRenderer, V as BannerNode, b as LinkCardNode, i as VideoNode, l as $isPollNode, n as builtinNodes, s as RubyNode, u as PollNode } from "./config-
|
|
4
|
+
import { C as GridContainerNode, E as FootnoteSectionNode, F as CodeBlockRenderer, H as normalizeBannerType, M as CommentNode, N as $isCodeBlockNode, O as DetailsNode, P as CodeBlockNode, R as $isBannerNode, S as $isGridContainerNode, U as BannerRenderer, V as BannerNode, b as LinkCardNode, i as VideoNode, l as $isPollNode, n as builtinNodes, s as RubyNode, u as PollNode } from "./config-CTD7-xAy.js";
|
|
5
5
|
import { n as gridStyles, t as gridClassNames } from "./grid.css-CJCkLTZc.js";
|
|
6
|
-
import { n as AlertQuoteEditNode, r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-
|
|
6
|
+
import { n as AlertQuoteEditNode, r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-bJolZMh7.js";
|
|
7
7
|
import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";
|
|
8
8
|
import { ListPlugin } from "@lexical/react/LexicalListPlugin";
|
|
9
9
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
@@ -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,
|
|
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,CAAC,cAAc,EAAE,wBAAwB,GAAG,cAAc;IAI3E,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"}
|
package/dist/nodes-entry.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as $createPollEditNode, c as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, o as PollEditNode, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-
|
|
2
|
-
import { C as ImageNode, O as ALERT_LABELS, S as $isImageNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, d as MermaidNode, f as $createMentionNode, g as $isKaTeXInlineNode, i as TagNode, k as ALERT_TYPES, l as $createMermaidNode, m as MentionNode, n as $createTagNode, p as $isMentionNode, r as $isTagNode, u as $isMermaidNode, x as $createImageNode, y as $isKaTeXBlockNode } from "./theme-
|
|
3
|
-
import { B as BANNER_TYPES, C as GridContainerNode, E as FootnoteSectionNode, M as CommentNode, S as $isGridContainerNode, T as $isFootnoteSectionNode, a as $createRubyNode, b as LinkCardNode, c as $createPollNode, d as createOptionId, f as createPollId, j as $isCommentNode, k as $createCommentNode, l as $isPollNode, n as builtinNodes, o as $isRubyNode, r as customNodes, s as RubyNode, t as allNodes, u as PollNode, v as $createLinkCardNode, w as $createFootnoteSectionNode, x as $createGridContainerNode, y as $isLinkCardNode, z as BANNER_LABELS } from "./config-
|
|
4
|
-
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-
|
|
1
|
+
import { a as $createPollEditNode, c as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, o as PollEditNode, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-BmeHYCtG.js";
|
|
2
|
+
import { C as ImageNode, O as ALERT_LABELS, S as $isImageNode, _ as KaTeXInlineNode, b as KaTeXBlockNode, d as MermaidNode, f as $createMentionNode, g as $isKaTeXInlineNode, i as TagNode, k as ALERT_TYPES, l as $createMermaidNode, m as MentionNode, n as $createTagNode, p as $isMentionNode, r as $isTagNode, u as $isMermaidNode, x as $createImageNode, y as $isKaTeXBlockNode } from "./theme-QqiMxW5u.js";
|
|
3
|
+
import { B as BANNER_TYPES, C as GridContainerNode, E as FootnoteSectionNode, M as CommentNode, S as $isGridContainerNode, T as $isFootnoteSectionNode, a as $createRubyNode, b as LinkCardNode, c as $createPollNode, d as createOptionId, f as createPollId, j as $isCommentNode, k as $createCommentNode, l as $isPollNode, n as builtinNodes, o as $isRubyNode, r as customNodes, s as RubyNode, t as allNodes, u as PollNode, v as $createLinkCardNode, w as $createFootnoteSectionNode, x as $createGridContainerNode, y as $isLinkCardNode, z as BANNER_LABELS } from "./config-CTD7-xAy.js";
|
|
4
|
+
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-bJolZMh7.js";
|
|
5
5
|
export { $createCommentNode, $createFootnoteSectionNode, $createGridContainerNode, $createImageNode, $createLinkCardNode, $createMentionNode, $createMermaidNode, $createPollEditNode, $createPollNode, $createRubyNode, $createTagNode, $isCommentNode, $isFootnoteSectionNode, $isGridContainerNode, $isImageNode, $isKaTeXBlockNode, $isKaTeXInlineNode, $isLinkCardNode, $isMentionNode, $isMermaidNode, $isPollNode, $isRubyNode, $isTagNode, ALERT_LABELS, ALERT_TYPES, BANNER_LABELS, BANNER_TYPES, CommentNode, FootnoteSectionEditNode, FootnoteSectionNode, GridContainerNode, ImageNode, KaTeXBlockNode, KaTeXInlineNode, LinkCardNode, MentionNode, MermaidNode, NESTED_EDITOR_NODES, PollEditNode, PollNode, RubyNode, TagNode, allEditNodes, allNodes, builtinNodes, createOptionId, createPollId, customEditNodes, customNodes, getResolvedEditNodes, setResolvedEditNodes };
|
package/dist/plugins-entry.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { A as ImageUploadProvider, D as defaultImageUpload, E as ImageUploadPlugin, F as ALL_TRANSFORMERS, I as HorizontalRulePlugin, L as BlockExitPlugin, M as CorePlugins, N as MarkdownShortcutsPlugin, O as BlockIdPlugin, P as MarkdownPastePlugin, R as AutoLinkPlugin, T as LinkFaviconPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as useImageUpload, k as blockIdState, n as OnChangePlugin, o as TextSelectionPlugin, r as FootnotePlugin, t as SubmitShortcutPlugin } from "./SubmitShortcutPlugin-
|
|
2
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
1
|
+
import { A as ImageUploadProvider, D as defaultImageUpload, E as ImageUploadPlugin, F as ALL_TRANSFORMERS, I as HorizontalRulePlugin, L as BlockExitPlugin, M as CorePlugins, N as MarkdownShortcutsPlugin, O as BlockIdPlugin, P as MarkdownPastePlugin, R as AutoLinkPlugin, T as LinkFaviconPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as useImageUpload, k as blockIdState, n as OnChangePlugin, o as TextSelectionPlugin, r as FootnotePlugin, t as SubmitShortcutPlugin } from "./SubmitShortcutPlugin-DtHHlBnh.js";
|
|
2
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BRyrtUBj.js";
|
|
3
3
|
export { ALL_TRANSFORMERS, AlertPlugin, AutoFocusPlugin, AutoLinkPlugin, BlockExitPlugin, BlockIdPlugin, CorePlugins, EditorRefPlugin, FootnotePlugin, HorizontalRulePlugin, ImagePlugin, ImageUploadPlugin, ImageUploadProvider, KaTeXPlugin, LinkFaviconPlugin, MarkdownPastePlugin, MarkdownShortcutsPlugin, MermaidPlugin, OnChangePlugin, SubmitShortcutPlugin, TextSelectionPlugin, blockIdState, defaultImageUpload, useImageUpload };
|
package/dist/static-entry.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { F as useNestedContentRenderer, I as useOptionalNestedContentRenderer, M as extractTextContent, P as NestedContentRendererProvider, a as getTagBgColor, t as editorTheme } from "./theme-
|
|
1
|
+
import { F as useNestedContentRenderer, I as useOptionalNestedContentRenderer, M as extractTextContent, P as NestedContentRendererProvider, a as getTagBgColor, t as editorTheme } from "./theme-QqiMxW5u.js";
|
|
2
2
|
import { a as FootnoteDefinitionsProvider, c as useFootnoteDisplayNumber, d as RendererConfigProvider, f as useRendererConfig, l as RendererWrapper, m as useVariant, o as useFootnoteContent, p as useRendererMode, s as useFootnoteDefinitions, u as createRendererDecoration } from "./KaTeXRenderer-CQQT3BMw.js";
|
|
3
3
|
import { a as noteVariant, c as richContent, i as getVariantClass, l as semanticClassNames, n as katexStyles, o as commentVariant, r as clsx, s as articleVariant, t as katexClassNames, u as sharedStyles } from "./katex.css-CIOEOXyd.js";
|
|
4
|
-
import { I as ColorSchemeProvider, L as useColorScheme, _ as usePollDataAdapter, g as useInitialPollState, h as PollDataProvider, n as builtinNodes, p as PollRenderer, r as customNodes, t as allNodes } from "./config-
|
|
4
|
+
import { I as ColorSchemeProvider, L as useColorScheme, _ as usePollDataAdapter, g as useInitialPollState, h as PollDataProvider, n as builtinNodes, p as PollRenderer, r as customNodes, t as allNodes } from "./config-CTD7-xAy.js";
|
|
5
5
|
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-CJCkLTZc.js";
|
|
6
6
|
import { t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-B-1wmGzd.js";
|
|
7
7
|
import { a as useExtraNodes, i as ExtraNodesProvider, n as PresentDialogProvider, o as LinkFavicon, r as usePresentDialog, t as extractPolls } from "./extractPolls-DO31LNrp.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text-selection.d.ts","sourceRoot":"","sources":["../../src/utils/text-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,cAAc,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"text-selection.d.ts","sourceRoot":"","sources":["../../src/utils/text-selection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,cAAc,EAAE,MAAM,SAAS,CAAC;AAgBxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,4BAA4B,CAAC;AAE3E,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAQD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,IAAI,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;CAChB;AAsID,wBAAgB,uCAAuC,CACrD,SAAS,EAAE,cAAc,GACxB,qBAAqB,GAAG,IAAI,CA2B9B;AAED,wBAAgB,qBAAqB,IAAI,qBAAqB,GAAG,IAAI,CAOpE;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,OAAO,CAe9E;AAED,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,OAAO,EAClB,UAAU,EAAE,IAAI,EAChB,YAAY,EAAE,MAAM,GACnB,MAAM,CA4CR;AAED,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,OAAO,EAClB,eAAe,EAAE,MAAM,GACtB,kBAAkB,GAAG,IAAI,CAiD3B;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI,CAEjG;AAED,wBAAgB,+BAA+B,CAC7C,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,qBAAqB,GAC9B,KAAK,GAAG,IAAI,CA6Bd;AAED,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,GAAG,IAAI,CAYhB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
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.44.0",
|
|
49
49
|
"nanoid": "^5.1.9",
|
|
50
50
|
"thumbhash": "^0.1.1",
|
|
51
|
-
"@haklex/rich-
|
|
52
|
-
"@haklex/rich-
|
|
53
|
-
"@haklex/rich-style-token": "0.4.
|
|
51
|
+
"@haklex/rich-editor-ui": "0.4.1",
|
|
52
|
+
"@haklex/rich-headless": "0.4.1",
|
|
53
|
+
"@haklex/rich-style-token": "0.4.1"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@lexical/extension": "^0.44.0",
|
|
@@ -510,13 +510,6 @@ function $isImageNode(node) {
|
|
|
510
510
|
return node instanceof ImageNode;
|
|
511
511
|
}
|
|
512
512
|
//#endregion
|
|
513
|
-
//#region src/utils/katex-defaults.ts
|
|
514
|
-
var DEFAULT_KATEX_EQUATION = "x^2 + y^2 = z^2";
|
|
515
|
-
function resolveKaTeXEquation(equation, options) {
|
|
516
|
-
if (options?.autoOpenOnMount && !equation.trim()) return DEFAULT_KATEX_EQUATION;
|
|
517
|
-
return equation;
|
|
518
|
-
}
|
|
519
|
-
//#endregion
|
|
520
513
|
//#region src/utils/getRegisteredNodeKlass.ts
|
|
521
514
|
function isMissingActiveEditorError(error) {
|
|
522
515
|
return error instanceof Error && error.message.includes("Unable to find an active editor");
|
|
@@ -531,6 +524,13 @@ function getRegisteredNodeKlass(nodeType, fallbackKlass) {
|
|
|
531
524
|
return fallbackKlass;
|
|
532
525
|
}
|
|
533
526
|
//#endregion
|
|
527
|
+
//#region src/utils/katex-defaults.ts
|
|
528
|
+
var DEFAULT_KATEX_EQUATION = "x^2 + y^2 = z^2";
|
|
529
|
+
function resolveKaTeXEquation(equation, options) {
|
|
530
|
+
if (options?.autoOpenOnMount && !equation.trim()) return DEFAULT_KATEX_EQUATION;
|
|
531
|
+
return equation;
|
|
532
|
+
}
|
|
533
|
+
//#endregion
|
|
534
534
|
//#region src/nodes/KaTeXBlockNode.ts
|
|
535
535
|
var KaTeXBlockNode = class KaTeXBlockNode extends DecoratorNode {
|
|
536
536
|
static getType() {
|