@haklex/rich-editor 0.54.1 → 0.54.3
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-DE7sLkBy.js → AlertQuoteEditNode-DQt5pIZ8.js} +5 -1
- package/dist/{MermaidPlugin-DMvK1lvi.js → MermaidPlugin-BpoGXa9D.js} +1 -1
- package/dist/{SubmitShortcutPlugin-BvGB9w6w.js → SubmitShortcutPlugin-BuRxU6WD.js} +2 -2
- package/dist/commands-entry.mjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{node-registry-8UieYyS_.js → node-registry-CH2oHfO4.js} +1 -1
- package/dist/nodes-entry.mjs +2 -2
- package/dist/plugins-entry.mjs +3 -3
- package/dist/utils/nested-editor-sync.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -81,8 +81,12 @@ function NestedEditorCorePlugins() {
|
|
|
81
81
|
//#endregion
|
|
82
82
|
//#region src/utils/nested-editor-sync.ts
|
|
83
83
|
function registerNestedEditorSync(parentEditor, nestedEditor, ownerKey) {
|
|
84
|
-
|
|
84
|
+
let synced = JSON.stringify(nestedEditor.getEditorState().toJSON());
|
|
85
|
+
return nestedEditor.registerUpdateListener(({ dirtyElements, dirtyLeaves, editorState }) => {
|
|
85
86
|
if (dirtyElements.size === 0 && dirtyLeaves.size === 0) return;
|
|
87
|
+
const content = JSON.stringify(editorState.toJSON());
|
|
88
|
+
if (content === synced) return;
|
|
89
|
+
synced = content;
|
|
86
90
|
parentEditor.update(() => {
|
|
87
91
|
const owner = $getNodeByKey(ownerKey);
|
|
88
92
|
if (!owner) return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { O as $withAdaptiveImageDisplayWidth, f as $createMermaidNode, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode } from "./theme-Blq1EG_t.js";
|
|
2
|
-
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
2
|
+
import { t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-DQt5pIZ8.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 { c as setCodeBlockCursorIntent, o as $createCodeBlockEditNode, s as $createBannerEditNode, t as getResolvedEditNodes } from "./node-registry-
|
|
1
|
+
import { c as setCodeBlockCursorIntent, o as $createCodeBlockEditNode, s as $createBannerEditNode, t as getResolvedEditNodes } from "./node-registry-CH2oHfO4.js";
|
|
2
2
|
import "./utils-CdxPji5z.js";
|
|
3
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-Blq1EG_t.js";
|
|
4
4
|
import { i as FootnoteDefinitionsProvider, t as computeImageMeta } from "./thumbhash-DHHqtr0c.js";
|
|
5
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-RLg0uDRt.js";
|
|
6
|
-
import { c as PasteLinkPlugin, t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-
|
|
6
|
+
import { c as PasteLinkPlugin, t as $createAlertQuoteEditNode } from "./AlertQuoteEditNode-DQt5pIZ8.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
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-Blq1EG_t.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-
|
|
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-BpoGXa9D.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,14 @@
|
|
|
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-
|
|
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-BuRxU6WD.js";
|
|
2
|
+
import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-CH2oHfO4.js";
|
|
3
3
|
import { a as chatVariant, c as semanticClassNames, i as commentVariant, l as sharedStyles, n as getVariantClass, o as articleVariant, r as noteVariant, s as richContent, t as clsx } from "./utils-CdxPji5z.js";
|
|
4
4
|
import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, t as editorTheme } from "./theme-Blq1EG_t.js";
|
|
5
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-DHHqtr0c.js";
|
|
6
6
|
import { n as useColorScheme, t as ColorSchemeProvider } from "./ColorSchemeContext-RLg0uDRt.js";
|
|
7
7
|
import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-CUb_icKZ.js";
|
|
8
|
-
import { a as useNestedEditorSync, i as createNestedEditor, l as NestedEditorPluginsProvider, o as registerNestedEditorSync, r as NESTED_EDITOR_NODES, s as NestedEditorCorePlugins, u as useNestedEditorPlugins } from "./AlertQuoteEditNode-
|
|
8
|
+
import { a as useNestedEditorSync, i as createNestedEditor, l as NestedEditorPluginsProvider, o as registerNestedEditorSync, r as NESTED_EDITOR_NODES, s as NestedEditorCorePlugins, u as useNestedEditorPlugins } from "./AlertQuoteEditNode-DQt5pIZ8.js";
|
|
9
9
|
import { t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-VaI73T09.js";
|
|
10
10
|
import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-DdU7MZwS.js";
|
|
11
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
11
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BpoGXa9D.js";
|
|
12
12
|
import { n as katexStyles, t as katexClassNames } from "./katex.css-9tq8FN8h.js";
|
|
13
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
@@ -3,7 +3,7 @@ import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, K as _definePro
|
|
|
3
3
|
import { c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, o as useFootnoteDefinitions, p as useVariant } from "./thumbhash-DHHqtr0c.js";
|
|
4
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-RLg0uDRt.js";
|
|
5
5
|
import { n as gridStyles, t as gridClassNames } from "./grid.css-CUb_icKZ.js";
|
|
6
|
-
import { a as useNestedEditorSync, i as createNestedEditor, n as AlertQuoteEditNode, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-
|
|
6
|
+
import { a as useNestedEditorSync, i as createNestedEditor, n as AlertQuoteEditNode, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-DQt5pIZ8.js";
|
|
7
7
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
8
8
|
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
9
9
|
import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection } from "lexical";
|
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-
|
|
1
|
+
import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-CH2oHfO4.js";
|
|
2
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-Blq1EG_t.js";
|
|
3
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-RLg0uDRt.js";
|
|
4
|
-
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-
|
|
4
|
+
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-DQt5pIZ8.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-
|
|
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-BuRxU6WD.js";
|
|
2
2
|
import { Q as INLINE_DRAG_ATTR, et as markInlineDraggable } from "./theme-Blq1EG_t.js";
|
|
3
|
-
import { c as PasteLinkPlugin } from "./AlertQuoteEditNode-
|
|
4
|
-
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-
|
|
3
|
+
import { c as PasteLinkPlugin } from "./AlertQuoteEditNode-DQt5pIZ8.js";
|
|
4
|
+
import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BpoGXa9D.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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested-editor-sync.d.ts","sourceRoot":"","sources":["../../src/utils/nested-editor-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"nested-editor-sync.d.ts","sourceRoot":"","sources":["../../src/utils/nested-editor-sync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAStD,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,aAAa,EAC3B,YAAY,EAAE,aAAa,EAC3B,QAAQ,EAAE,OAAO,GAChB,MAAM,IAAI,CAeZ"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor",
|
|
3
|
-
"version": "0.54.
|
|
3
|
+
"version": "0.54.3",
|
|
4
4
|
"description": "Core rich text editor based on Lexical",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"dist"
|
|
46
46
|
],
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@haklex/rich-editor-ui": "0.54.
|
|
49
|
-
"@haklex/rich-headless": "0.54.
|
|
50
|
-
"@haklex/rich-style-token": "0.54.
|
|
48
|
+
"@haklex/rich-editor-ui": "0.54.3",
|
|
49
|
+
"@haklex/rich-headless": "0.54.3",
|
|
50
|
+
"@haklex/rich-style-token": "0.54.3",
|
|
51
51
|
"@lexical/code-core": "^0.52.0",
|
|
52
52
|
"nanoid": "^6.0.2",
|
|
53
53
|
"thumbhash": "^0.1.1"
|