@haklex/rich-editor 0.60.0 → 0.61.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/dist/{VirtualizationPlugin-eHBms1eF.js → VirtualizationPlugin-qZs8amcc.js} +1 -1
- package/dist/components/decorators/CodeBlockEditDecorator.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{node-registry-jRE4LqH-.js → node-registry-8OWu2S8i.js} +21 -1
- package/dist/nodes-entry.mjs +1 -1
- package/dist/plugins-entry.mjs +1 -1
- package/package.json +23 -23
|
@@ -1,4 +1,4 @@
|
|
|
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-8OWu2S8i.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import { B as FootnoteNode, C as KaTeXBlockNode, G as AlertQuoteNode, K as extractTextContent, O as $withAdaptiveImageDisplayWidth, Q as INLINE_DRAG_MIME, V as OPEN_FILE_PICKER_COMMAND, Z as INLINE_DRAG_ATTR, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, h as $createMentionNode, k as OPEN_IMAGE_UPLOAD_DIALOG_COMMAND, o as $createSpoilerNode, v as $createKaTeXInlineNode, w as $createImageNode, x as $createKaTeXBlockNode, z as $createFootnoteNode } from "./theme-DH4xzxU-.js";
|
|
4
4
|
import { i as FootnoteDefinitionsProvider, t as computeImageMeta } from "./thumbhash-GjK8OYAb.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeBlockEditDecorator.d.ts","sourceRoot":"","sources":["../../../src/components/decorators/CodeBlockEditDecorator.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeBlockEditDecorator.d.ts","sourceRoot":"","sources":["../../../src/components/decorators/CodeBlockEditDecorator.tsx"],"names":[],"mappings":"AAyBA,UAAU,2BAA2B;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,2BAA2B,+BA4M9F"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, G as CorePlugins, L as VideoUploadProvider, O as defaultImageUpload, P as FileUploadPlugin, S as TextSelectionStoreProvider, T as useTextSelectionStore, U as FileUploadProvider, V as ImagePreprocessProvider, _ as $getRootBlock, a as EditorRefPlugin, b as buildBlockAnchor, c as $captureTextSelection, d as createDOMRangeFromTextSelection, f as findDOMPointByTextOffset, g as TEXT_SELECTION_HIGHLIGHT_NAME, h as getTextOffsetFromDOMPoint, i as FootnotePlugin, l as $captureTextSelectionFromRangeSelection, m as getDOMRectFromTextSelection, n as SubmitShortcutPlugin, o as VideoUploadPlugin, p as getBlockElementById, r as OnChangePlugin, s as TextSelectionPlugin, t as AutoFocusPlugin, u as $restoreTextSelection, v as $getTextOffsetInBlock, w as useTextSelectionSnapshot, x as buildRangeAnchor, y as $resolveSelectionPoint, z as ImageUploadProvider } from "./VirtualizationPlugin-
|
|
2
|
-
import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-
|
|
1
|
+
import { C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, G as CorePlugins, L as VideoUploadProvider, O as defaultImageUpload, P as FileUploadPlugin, S as TextSelectionStoreProvider, T as useTextSelectionStore, U as FileUploadProvider, V as ImagePreprocessProvider, _ as $getRootBlock, a as EditorRefPlugin, b as buildBlockAnchor, c as $captureTextSelection, d as createDOMRangeFromTextSelection, f as findDOMPointByTextOffset, g as TEXT_SELECTION_HIGHLIGHT_NAME, h as getTextOffsetFromDOMPoint, i as FootnotePlugin, l as $captureTextSelectionFromRangeSelection, m as getDOMRectFromTextSelection, n as SubmitShortcutPlugin, o as VideoUploadPlugin, p as getBlockElementById, r as OnChangePlugin, s as TextSelectionPlugin, t as AutoFocusPlugin, u as $restoreTextSelection, v as $getTextOffsetInBlock, w as useTextSelectionSnapshot, x as buildRangeAnchor, y as $resolveSelectionPoint, z as ImageUploadProvider } from "./VirtualizationPlugin-qZs8amcc.js";
|
|
2
|
+
import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-8OWu2S8i.js";
|
|
3
3
|
import { J as NestedContentRendererProvider, X as useOptionalNestedContentRenderer, Y as useNestedContentRenderer, t as editorTheme } from "./theme-DH4xzxU-.js";
|
|
4
4
|
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-GjK8OYAb.js";
|
|
5
5
|
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-E6qVk-NR.js";
|
|
@@ -7,7 +7,7 @@ import { n as gridStyles, t as gridClassNames } from "./grid.css-DJWKdYpz.js";
|
|
|
7
7
|
import { a as useNestedEditorSync, i as createNestedEditor, n as AlertQuoteEditNode, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-Ck4v29Wg.js";
|
|
8
8
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
9
9
|
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
10
|
-
import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection } from "lexical";
|
|
10
|
+
import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection, COMMAND_PRIORITY_HIGH, KEY_DOWN_COMMAND } from "lexical";
|
|
11
11
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
12
|
import { Flag, LayoutGrid, Minus, Plus } from "lucide-react";
|
|
13
13
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
@@ -240,6 +240,26 @@ function CodeBlockEditDecorator({ nodeKey, code, language }) {
|
|
|
240
240
|
isSelected,
|
|
241
241
|
nodeKey
|
|
242
242
|
]);
|
|
243
|
+
useEffect(() => {
|
|
244
|
+
if (!editable || !isSelected) return;
|
|
245
|
+
return editor.registerCommand(KEY_DOWN_COMMAND, (event) => {
|
|
246
|
+
if (event.key.length !== 1 || event.metaKey || event.ctrlKey || event.altKey) return false;
|
|
247
|
+
if (event.isComposing) return false;
|
|
248
|
+
if (!editor.getEditorState().read(() => {
|
|
249
|
+
const selection = $getSelection();
|
|
250
|
+
if (!$isNodeSelection(selection)) return false;
|
|
251
|
+
const nodes = selection.getNodes();
|
|
252
|
+
return nodes.length === 1 && nodes[0]?.getKey() === nodeKey;
|
|
253
|
+
})) return false;
|
|
254
|
+
editor.getElementByKey(nodeKey)?.querySelector("[contenteditable=\"true\"]")?.focus();
|
|
255
|
+
return false;
|
|
256
|
+
}, COMMAND_PRIORITY_HIGH);
|
|
257
|
+
}, [
|
|
258
|
+
editable,
|
|
259
|
+
editor,
|
|
260
|
+
isSelected,
|
|
261
|
+
nodeKey
|
|
262
|
+
]);
|
|
243
263
|
const handleCodeChange = useCallback((newCode) => {
|
|
244
264
|
editor.update(() => {
|
|
245
265
|
const node = $getNodeByKey(nodeKey);
|
package/dist/nodes-entry.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-8OWu2S8i.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-DH4xzxU-.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-Dc_HebHd.js";
|
|
4
4
|
import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-Ck4v29Wg.js";
|
package/dist/plugins-entry.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as BlockExitPlugin, A as ImageDialog, B as useImageUpload, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as setFileUploadEntry, G as CorePlugins, H as useImagePreprocess, I as useFileUploadEntry, J as ALL_TRANSFORMERS, K as MarkdownShortcutsPlugin, L as VideoUploadProvider, M as registerImageEditor, N as resolvePreprocessTargets, O as defaultImageUpload, P as FileUploadPlugin, Q as registerClickBelowCommand, R as useVideoUpload, U as FileUploadProvider, V as ImagePreprocessProvider, W as useFileUpload, X as HorizontalRulePlugin, Y as InlineDndPlugin, Z as ClickBelowPlugin, a as EditorRefPlugin, et as AutoLinkPlugin, i as FootnotePlugin, j as getImageEditor, k as presentImageDialog, n as SubmitShortcutPlugin, o as VideoUploadPlugin, q as MarkdownPastePlugin, r as OnChangePlugin, s as TextSelectionPlugin, t as AutoFocusPlugin, z as ImageUploadProvider } from "./VirtualizationPlugin-
|
|
1
|
+
import { $ as BlockExitPlugin, A as ImageDialog, B as useImageUpload, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as setFileUploadEntry, G as CorePlugins, H as useImagePreprocess, I as useFileUploadEntry, J as ALL_TRANSFORMERS, K as MarkdownShortcutsPlugin, L as VideoUploadProvider, M as registerImageEditor, N as resolvePreprocessTargets, O as defaultImageUpload, P as FileUploadPlugin, Q as registerClickBelowCommand, R as useVideoUpload, U as FileUploadProvider, V as ImagePreprocessProvider, W as useFileUpload, X as HorizontalRulePlugin, Y as InlineDndPlugin, Z as ClickBelowPlugin, a as EditorRefPlugin, et as AutoLinkPlugin, i as FootnotePlugin, j as getImageEditor, k as presentImageDialog, n as SubmitShortcutPlugin, o as VideoUploadPlugin, q as MarkdownPastePlugin, r as OnChangePlugin, s as TextSelectionPlugin, t as AutoFocusPlugin, z as ImageUploadProvider } from "./VirtualizationPlugin-qZs8amcc.js";
|
|
2
2
|
import { $ as markInlineDraggable, Z as INLINE_DRAG_ATTR } from "./theme-DH4xzxU-.js";
|
|
3
3
|
import { c as PasteLinkPlugin } from "./AlertQuoteEditNode-Ck4v29Wg.js";
|
|
4
4
|
import { i as EditorSurfacePlugins, n as ActiveEditorScope, o as useActiveEditor, r as EditorSurfacePlugin, t as VirtualizationPlugin } from "./VirtualizationPlugin-BA7YFDRN.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haklex/rich-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.1",
|
|
4
4
|
"description": "Core rich text editor based on Lexical",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,45 +57,45 @@
|
|
|
57
57
|
"dist"
|
|
58
58
|
],
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@haklex/rich-editor-ui": "0.
|
|
61
|
-
"@haklex/rich-headless": "0.
|
|
62
|
-
"@haklex/rich-style-token": "0.
|
|
63
|
-
"@lexical/code-core": "^0.
|
|
60
|
+
"@haklex/rich-editor-ui": "0.61.1",
|
|
61
|
+
"@haklex/rich-headless": "0.61.1",
|
|
62
|
+
"@haklex/rich-style-token": "0.61.1",
|
|
63
|
+
"@lexical/code-core": "^0.53.0",
|
|
64
64
|
"nanoid": "^6.0.2",
|
|
65
65
|
"thumbhash": "^0.1.1"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@lexical/extension": "^0.
|
|
69
|
-
"@lexical/link": "^0.
|
|
70
|
-
"@lexical/list": "^0.
|
|
71
|
-
"@lexical/markdown": "^0.
|
|
72
|
-
"@lexical/react": "^0.
|
|
73
|
-
"@lexical/rich-text": "^0.
|
|
74
|
-
"@lexical/table": "^0.
|
|
68
|
+
"@lexical/extension": "^0.53.0",
|
|
69
|
+
"@lexical/link": "^0.53.0",
|
|
70
|
+
"@lexical/list": "^0.53.0",
|
|
71
|
+
"@lexical/markdown": "^0.53.0",
|
|
72
|
+
"@lexical/react": "^0.53.0",
|
|
73
|
+
"@lexical/rich-text": "^0.53.0",
|
|
74
|
+
"@lexical/table": "^0.53.0",
|
|
75
75
|
"@types/react": "^19.3.0",
|
|
76
76
|
"@types/react-dom": "^19.3.0",
|
|
77
77
|
"@vanilla-extract/css": "^1.21.3",
|
|
78
78
|
"@vanilla-extract/vite-plugin": "^5.2.6",
|
|
79
|
-
"katex": "^0.19.
|
|
80
|
-
"lexical": "^0.
|
|
79
|
+
"katex": "^0.19.1",
|
|
80
|
+
"lexical": "^0.53.0",
|
|
81
81
|
"lucide-react": "^1.59.0",
|
|
82
82
|
"react": "^19.3.1",
|
|
83
83
|
"react-dom": "^19.3.1",
|
|
84
84
|
"typescript": "^7.0.2",
|
|
85
85
|
"unplugin-dts": "^1.1.2",
|
|
86
|
-
"vite": "^8.3.
|
|
86
|
+
"vite": "^8.3.5"
|
|
87
87
|
},
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"@base-ui/react": ">=1.5.0",
|
|
90
|
-
"@lexical/extension": "^0.
|
|
91
|
-
"@lexical/link": "^0.
|
|
92
|
-
"@lexical/list": "^0.
|
|
93
|
-
"@lexical/markdown": "^0.
|
|
94
|
-
"@lexical/react": "^0.
|
|
95
|
-
"@lexical/rich-text": "^0.
|
|
96
|
-
"@lexical/table": "^0.
|
|
90
|
+
"@lexical/extension": "^0.53.0",
|
|
91
|
+
"@lexical/link": "^0.53.0",
|
|
92
|
+
"@lexical/list": "^0.53.0",
|
|
93
|
+
"@lexical/markdown": "^0.53.0",
|
|
94
|
+
"@lexical/react": "^0.53.0",
|
|
95
|
+
"@lexical/rich-text": "^0.53.0",
|
|
96
|
+
"@lexical/table": "^0.53.0",
|
|
97
97
|
"katex": ">=0.16.0",
|
|
98
|
-
"lexical": "^0.
|
|
98
|
+
"lexical": "^0.53.0",
|
|
99
99
|
"lucide-react": "^1.0.0",
|
|
100
100
|
"react": ">=19",
|
|
101
101
|
"react-dom": ">=19"
|