@haklex/rich-editor 0.58.0 → 0.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +35 -0
  2. package/dist/{AlertQuoteEditNode-DQt5pIZ8.js → AlertQuoteEditNode-Ck4v29Wg.js} +9 -20
  3. package/dist/BlockIdPlugin-Cwv8aV9g.js +106 -0
  4. package/dist/{ColorSchemeContext-RLg0uDRt.js → ColorSchemeContext-Dc_HebHd.js} +5 -4
  5. package/dist/ContentEditable.css--lQ6ekTS.js +7 -0
  6. package/dist/EditorBlockContext-DytAx9Tg.js +9 -0
  7. package/dist/{ExtraNodesContext-DdU7MZwS.js → ExtraNodesContext-xQ2RNsqH.js} +1 -1
  8. package/dist/{MermaidPlugin-BpoGXa9D.js → MermaidPlugin-BCoGsdi3.js} +3 -3
  9. package/dist/NestedEditorPluginsContext-D78UZkmx.js +16 -0
  10. package/dist/{RubyRenderer-CnTFvt0b.js → RubyRenderer-8HMSMaZz.js} +1 -1
  11. package/dist/VirtualizationPlugin-C8TJ4HJN.js +178 -0
  12. package/dist/{SubmitShortcutPlugin-BuRxU6WD.js → VirtualizationPlugin-Crc0cLUx.js} +969 -532
  13. package/dist/VirtualizedEditor-CIGYcIfr.js +818 -0
  14. package/dist/command-registry-entry.d.ts +3 -0
  15. package/dist/command-registry-entry.d.ts.map +1 -0
  16. package/dist/command-registry-entry.mjs +343 -0
  17. package/dist/commands/registry.d.ts +24 -0
  18. package/dist/commands/registry.d.ts.map +1 -0
  19. package/dist/commands-entry.mjs +2 -2
  20. package/dist/components/EditorSurfaceHost.d.ts +3 -0
  21. package/dist/components/EditorSurfaceHost.d.ts.map +1 -0
  22. package/dist/components/RichEditor.d.ts.map +1 -1
  23. package/dist/components/RichEditorShell.d.ts +3 -1
  24. package/dist/components/RichEditorShell.d.ts.map +1 -1
  25. package/dist/components/VirtualizationFromProps.d.ts +6 -0
  26. package/dist/components/VirtualizationFromProps.d.ts.map +1 -0
  27. package/dist/components/decorators/GridEditDecorator.d.ts.map +1 -1
  28. package/dist/components/renderers/ImageRenderer.d.ts +1 -0
  29. package/dist/components/renderers/ImageRenderer.d.ts.map +1 -1
  30. package/dist/context/EditorBlockContext.d.ts +12 -0
  31. package/dist/context/EditorBlockContext.d.ts.map +1 -0
  32. package/dist/context/EditorSurfaceContext.d.ts +42 -0
  33. package/dist/context/EditorSurfaceContext.d.ts.map +1 -0
  34. package/dist/defineProperty-BYhxpJwd.js +39 -0
  35. package/dist/{grid.css-CUb_icKZ.js → grid.css-DJWKdYpz.js} +2 -1
  36. package/dist/index.d.ts +5 -0
  37. package/dist/index.d.ts.map +1 -1
  38. package/dist/index.mjs +95 -43
  39. package/dist/{katex.css-9tq8FN8h.js → katex.css-9crOcnIa.js} +2 -1
  40. package/dist/{node-registry-CH2oHfO4.js → node-registry-jRE4LqH-.js} +37 -21
  41. package/dist/nodes/ImageNode.d.ts +7 -1
  42. package/dist/nodes/ImageNode.d.ts.map +1 -1
  43. package/dist/nodes/RichQuoteNode.d.ts +4 -1
  44. package/dist/nodes/RichQuoteNode.d.ts.map +1 -1
  45. package/dist/nodes-entry.mjs +4 -4
  46. package/dist/plugins/FileUploadPlugin.d.ts.map +1 -1
  47. package/dist/plugins/ImageDialog.d.ts +13 -0
  48. package/dist/plugins/ImageDialog.d.ts.map +1 -0
  49. package/dist/plugins/ImageDialogReview.d.ts +13 -0
  50. package/dist/plugins/ImageDialogReview.d.ts.map +1 -0
  51. package/dist/plugins/ImageDialogSource.d.ts +12 -0
  52. package/dist/plugins/ImageDialogSource.d.ts.map +1 -0
  53. package/dist/plugins/ImagePlugin.d.ts.map +1 -1
  54. package/dist/plugins/ImageUploadPlugin.d.ts +1 -1
  55. package/dist/plugins/ImageUploadPlugin.d.ts.map +1 -1
  56. package/dist/plugins/VideoUploadPlugin.d.ts +1 -1
  57. package/dist/plugins/VideoUploadPlugin.d.ts.map +1 -1
  58. package/dist/plugins/VirtualizationPlugin.d.ts +2 -0
  59. package/dist/plugins/VirtualizationPlugin.d.ts.map +1 -0
  60. package/dist/plugins/image-dialog-model.d.ts +65 -0
  61. package/dist/plugins/image-dialog-model.d.ts.map +1 -0
  62. package/dist/plugins/image-dialog.css.d.ts +30 -0
  63. package/dist/plugins/image-dialog.css.d.ts.map +1 -0
  64. package/dist/plugins/image-upload-toast.d.ts +2 -0
  65. package/dist/plugins/image-upload-toast.d.ts.map +1 -0
  66. package/dist/plugins/image-upload.css.d.ts +0 -23
  67. package/dist/plugins/image-upload.css.d.ts.map +1 -1
  68. package/dist/plugins/insertion-cursor.d.ts +20 -0
  69. package/dist/plugins/insertion-cursor.d.ts.map +1 -0
  70. package/dist/plugins/present-image-dialog.d.ts +14 -0
  71. package/dist/plugins/present-image-dialog.d.ts.map +1 -0
  72. package/dist/plugins-entry.d.ts +5 -0
  73. package/dist/plugins-entry.d.ts.map +1 -1
  74. package/dist/plugins-entry.mjs +7 -5
  75. package/dist/recycler-entry.d.ts +8 -0
  76. package/dist/recycler-entry.d.ts.map +1 -0
  77. package/dist/recycler-entry.mjs +3 -0
  78. package/dist/renderers-entry.mjs +4 -4
  79. package/dist/rich-editor.css +1 -1
  80. package/dist/static-entry.d.ts +1 -0
  81. package/dist/static-entry.d.ts.map +1 -1
  82. package/dist/static-entry.mjs +10 -9
  83. package/dist/styles/grid.css.d.ts.map +1 -1
  84. package/dist/styles/shared.css.d.ts.map +1 -1
  85. package/dist/styles-entry.mjs +3 -3
  86. package/dist/{theme-Blq1EG_t.js → theme-DH4xzxU-.js} +63 -48
  87. package/dist/{thumbhash-DHHqtr0c.js → thumbhash-GjK8OYAb.js} +1 -1
  88. package/dist/types.d.ts +3 -0
  89. package/dist/types.d.ts.map +1 -1
  90. package/dist/{utils-CdxPji5z.js → utils-E6qVk-NR.js} +1 -0
  91. package/dist/viewport-BvO92tse.js +210 -0
  92. package/dist/virtualization/VirtualizationPlugin.d.ts +5 -0
  93. package/dist/virtualization/VirtualizationPlugin.d.ts.map +1 -0
  94. package/dist/virtualization/VirtualizedEditor.d.ts +6 -0
  95. package/dist/virtualization/VirtualizedEditor.d.ts.map +1 -0
  96. package/dist/virtualization/controller.d.ts +73 -0
  97. package/dist/virtualization/controller.d.ts.map +1 -0
  98. package/dist/virtualization/document.d.ts +26 -0
  99. package/dist/virtualization/document.d.ts.map +1 -0
  100. package/dist/virtualization/layout.d.ts +42 -0
  101. package/dist/virtualization/layout.d.ts.map +1 -0
  102. package/dist/virtualization/preserve.d.ts +21 -0
  103. package/dist/virtualization/preserve.d.ts.map +1 -0
  104. package/dist/virtualization/style.css.d.ts +4 -0
  105. package/dist/virtualization/style.css.d.ts.map +1 -0
  106. package/dist/virtualization/sync.d.ts +4 -0
  107. package/dist/virtualization/sync.d.ts.map +1 -0
  108. package/dist/virtualization/types.d.ts +13 -0
  109. package/dist/virtualization/types.d.ts.map +1 -0
  110. package/dist/virtualization/viewport.d.ts +3 -0
  111. package/dist/virtualization/viewport.d.ts.map +1 -0
  112. package/dist/virtualization-entry.d.ts +3 -0
  113. package/dist/virtualization-entry.d.ts.map +1 -0
  114. package/dist/virtualization-entry.mjs +1 -0
  115. package/package.json +17 -5
package/dist/index.mjs CHANGED
@@ -1,16 +1,23 @@
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
- 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
- import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, t as editorTheme } from "./theme-Blq1EG_t.js";
5
- import { C as MENTION_NODE_KEY, D as VIDEO_NODE_KEY, E as TAG_NODE_KEY, S as LINK_CARD_NODE_KEY, T as RUBY_NODE_KEY, _ as FILE_NODE_KEY, a as useFootnoteContent, b as IMAGE_NODE_KEY, d as useRendererConfig, f as useRendererMode, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, i as FootnoteDefinitionsProvider, m as ALERT_NODE_KEY, o as useFootnoteDefinitions, p as useVariant, s as useFootnoteDisplayNumber, u as RendererConfigProvider, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY, y as FOOTNOTE_SECTION_NODE_KEY } from "./thumbhash-DHHqtr0c.js";
6
- import { n as useColorScheme, t as ColorSchemeProvider } from "./ColorSchemeContext-RLg0uDRt.js";
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-DQt5pIZ8.js";
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-Crc0cLUx.js";
2
+ import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-jRE4LqH-.js";
3
+ import { J as NestedContentRendererProvider, X as useOptionalNestedContentRenderer, Y as useNestedContentRenderer, t as editorTheme } from "./theme-DH4xzxU-.js";
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
+ 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";
6
+ import { n as useColorScheme, t as ColorSchemeProvider } from "./ColorSchemeContext-Dc_HebHd.js";
7
+ import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-DJWKdYpz.js";
8
+ import { n as useNestedEditorPlugins, t as NestedEditorPluginsProvider } from "./NestedEditorPluginsContext-D78UZkmx.js";
9
+ import { a as useNestedEditorSync, i as createNestedEditor, o as registerNestedEditorSync, r as NESTED_EDITOR_NODES, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-Ck4v29Wg.js";
9
10
  import { t as normalizeSerializedEditorState } from "./normalizeSerializedEditorState-VaI73T09.js";
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-BpoGXa9D.js";
12
- import { n as katexStyles, t as katexClassNames } from "./katex.css-9tq8FN8h.js";
13
- import { jsx, jsxs } from "react/jsx-runtime";
11
+ import { n as useExtraNodes, r as LinkFavicon, t as ExtraNodesProvider } from "./ExtraNodesContext-xQ2RNsqH.js";
12
+ import { a as EditorSurfaceProvider, i as EditorSurfacePlugins, n as ActiveEditorScope, o as useActiveEditor, r as EditorSurfacePlugin, s as useEditorSurface, t as VirtualizationPlugin } from "./VirtualizationPlugin-C8TJ4HJN.js";
13
+ import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BCoGsdi3.js";
14
+ import { n as blockIdState, t as BlockIdPlugin } from "./BlockIdPlugin-Cwv8aV9g.js";
15
+ import { n as useEditorBlock } from "./EditorBlockContext-DytAx9Tg.js";
16
+ import { n as contentWrapper, r as placeholder, t as content } from "./ContentEditable.css--lQ6ekTS.js";
17
+ import { n as katexStyles, t as katexClassNames } from "./katex.css-9crOcnIa.js";
18
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
19
+ import { useCallback, useLayoutEffect, useMemo, useRef, useState } from "react";
20
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
14
21
  import { ContentEditable } from "@lexical/react/LexicalContentEditable";
15
22
  import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
16
23
  import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
@@ -19,11 +26,6 @@ import { PortalThemeProvider } from "@haklex/rich-style-token";
19
26
  import { LexicalComposer } from "@lexical/react/LexicalComposer";
20
27
  import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
21
28
  import { articleTheme, chatTheme, commentTheme, noteTheme, vars } from "@haklex/rich-style-token/styles";
22
- //#region src/components/ContentEditable.css.ts
23
- var contentWrapper = "b94s950";
24
- var content = "b94s951";
25
- var placeholder = "b94s952";
26
- //#endregion
27
29
  //#region src/components/ContentEditable.tsx
28
30
  function ContentEditable$1({ className, placeholder: placeholder$1, hasHeader }) {
29
31
  const paddingTop = hasHeader ? 40 : 12;
@@ -42,10 +44,61 @@ function ContentEditable$1({ className, placeholder: placeholder$1, hasHeader })
42
44
  });
43
45
  }
44
46
  //#endregion
47
+ //#region src/components/EditorSurfaceHost.tsx
48
+ function StandardSurface({ className, hasHeader, placeholder, plugins, autoFocus, onActiveEditorChange }) {
49
+ const [editor] = useLexicalComposerContext();
50
+ useLayoutEffect(() => {
51
+ onActiveEditorChange(editor);
52
+ return () => onActiveEditorChange(null);
53
+ }, [editor, onActiveEditorChange]);
54
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
55
+ /* @__PURE__ */ jsx(RichTextPlugin, {
56
+ ErrorBoundary: LexicalErrorBoundary,
57
+ contentEditable: /* @__PURE__ */ jsx(ContentEditable$1, {
58
+ className,
59
+ hasHeader,
60
+ placeholder
61
+ })
62
+ }),
63
+ plugins,
64
+ autoFocus && /* @__PURE__ */ jsx(AutoFocusPlugin, {})
65
+ ] });
66
+ }
67
+ function EditorSurfaceHost(props) {
68
+ const { surface, plugins, setActiveEditor, retainSurface } = useEditorSurface();
69
+ const current = useRef(surface);
70
+ current.current = surface;
71
+ const onActiveEditorChange = useCallback((editor) => {
72
+ if (current.current === surface) setActiveEditor(editor);
73
+ }, [setActiveEditor, surface]);
74
+ const [ready, setReady] = useState(false);
75
+ useLayoutEffect(() => setReady(true), []);
76
+ if (!ready) return null;
77
+ return /* @__PURE__ */ jsx(surface ?? StandardSurface, {
78
+ ...props,
79
+ plugins,
80
+ retainSurface,
81
+ onActiveEditorChange
82
+ });
83
+ }
84
+ //#endregion
85
+ //#region src/components/VirtualizationFromProps.tsx
86
+ /** Convenience adapter. The core surface host never inspects virtualization options. */
87
+ function VirtualizationFromProps({ value }) {
88
+ if (value === void 0) return null;
89
+ return value === false ? /* @__PURE__ */ jsx(EditorSurfacePlugin, {
90
+ priority: 1,
91
+ surface: null
92
+ }) : /* @__PURE__ */ jsx(VirtualizationPlugin, {
93
+ ...value === true ? {} : value,
94
+ priority: 1
95
+ });
96
+ }
97
+ //#endregion
45
98
  //#region src/components/RichEditorShell.tsx
46
- function RichEditorShell({ nodes, initialValue, onChange, variant = "article", theme = "light", placeholder = "Write something...", onSubmit, autoFocus = false, className, contentClassName, style, actions, header, onEditorReady, rendererConfig, debounceMs, children }) {
99
+ function RichEditorShell({ nodes, initialValue, onChange, variant = "article", theme = "light", placeholder = "Write something...", onSubmit, autoFocus = false, className, contentClassName, style, actions, header, onEditorReady, rendererConfig, debounceMs, children, virtualization }) {
47
100
  setResolvedEditNodes(nodes);
48
- const normalizedInitialValue = initialValue ? normalizeSerializedEditorState(initialValue) : void 0;
101
+ const normalizedInitialValue = useMemo(() => initialValue ? normalizeSerializedEditorState(initialValue) : void 0, [initialValue]);
49
102
  const initialConfig = {
50
103
  namespace: "RichEditor",
51
104
  theme: editorTheme,
@@ -68,7 +121,7 @@ function RichEditorShell({ nodes, initialValue, onChange, variant = "article", t
68
121
  variant,
69
122
  children: /* @__PURE__ */ jsx(LexicalComposer, {
70
123
  initialConfig,
71
- children: /* @__PURE__ */ jsx(TextSelectionStoreProvider, { children: /* @__PURE__ */ jsx(FootnotePlugin, { children: /* @__PURE__ */ jsxs("div", {
124
+ children: /* @__PURE__ */ jsxs(EditorSurfaceProvider, { children: [/* @__PURE__ */ jsx(VirtualizationFromProps, { value: virtualization }), /* @__PURE__ */ jsx(TextSelectionStoreProvider, { children: /* @__PURE__ */ jsx(FootnotePlugin, { children: /* @__PURE__ */ jsxs("div", {
72
125
  suppressHydrationWarning: true,
73
126
  className: clsx("rich-editor", variantClass, className),
74
127
  "data-theme": theme,
@@ -77,14 +130,12 @@ function RichEditorShell({ nodes, initialValue, onChange, variant = "article", t
77
130
  maxWidth: "none"
78
131
  },
79
132
  children: [
80
- header,
81
- /* @__PURE__ */ jsx(RichTextPlugin, {
82
- ErrorBoundary: LexicalErrorBoundary,
83
- contentEditable: /* @__PURE__ */ jsx(ContentEditable$1, {
84
- className: contentClassName,
85
- hasHeader: !!header,
86
- placeholder
87
- })
133
+ /* @__PURE__ */ jsx(ActiveEditorScope, { children: header }),
134
+ /* @__PURE__ */ jsx(EditorSurfaceHost, {
135
+ autoFocus,
136
+ className: contentClassName,
137
+ hasHeader: !!header,
138
+ placeholder
88
139
  }),
89
140
  /* @__PURE__ */ jsx(HistoryPlugin, {}),
90
141
  /* @__PURE__ */ jsx(OnChangePlugin, {
@@ -93,15 +144,14 @@ function RichEditorShell({ nodes, initialValue, onChange, variant = "article", t
93
144
  }),
94
145
  /* @__PURE__ */ jsx(SubmitShortcutPlugin, { onSubmit }),
95
146
  /* @__PURE__ */ jsx(EditorRefPlugin, { onEditorReady }),
96
- /* @__PURE__ */ jsx(QuoteAttributionPlugin, {}),
97
- autoFocus && /* @__PURE__ */ jsx(AutoFocusPlugin, {}),
147
+ /* @__PURE__ */ jsx(EditorSurfacePlugins, { children: /* @__PURE__ */ jsx(QuoteAttributionPlugin, {}) }),
98
148
  children,
99
149
  actions && /* @__PURE__ */ jsx("div", {
100
150
  className: "rich-editor__actions",
101
- children: actions
151
+ children: /* @__PURE__ */ jsx(ActiveEditorScope, { children: actions })
102
152
  })
103
153
  ]
104
- }) }) })
154
+ }) }) })] })
105
155
  })
106
156
  })
107
157
  })
@@ -124,17 +174,19 @@ function RichEditor({ extraNodes, imageUpload, videoUpload, fileUpload, children
124
174
  nodes,
125
175
  ...shellProps,
126
176
  children: [
127
- /* @__PURE__ */ jsx(CorePlugins, {}),
128
- /* @__PURE__ */ jsx(ImagePlugin, {}),
129
- /* @__PURE__ */ jsx(ImageUploadPlugin, { onUpload: resolvedImageUpload }),
130
- videoUpload ? /* @__PURE__ */ jsx(VideoUploadPlugin, { onUpload: videoUpload }) : null,
131
- fileUpload ? /* @__PURE__ */ jsx(FileUploadPlugin, { onUpload: fileUpload }) : null,
132
- /* @__PURE__ */ jsx(KaTeXPlugin, {}),
133
- /* @__PURE__ */ jsx(AlertPlugin, {}),
134
- /* @__PURE__ */ jsx(MermaidPlugin, {}),
135
- /* @__PURE__ */ jsx(LinkFaviconPlugin, {}),
177
+ /* @__PURE__ */ jsxs(EditorSurfacePlugins, { children: [
178
+ /* @__PURE__ */ jsx(CorePlugins, {}),
179
+ /* @__PURE__ */ jsx(ImagePlugin, {}),
180
+ /* @__PURE__ */ jsx(ImageUploadPlugin, { onUpload: resolvedImageUpload }),
181
+ videoUpload ? /* @__PURE__ */ jsx(VideoUploadPlugin, { onUpload: videoUpload }) : null,
182
+ fileUpload ? /* @__PURE__ */ jsx(FileUploadPlugin, { onUpload: fileUpload }) : null,
183
+ /* @__PURE__ */ jsx(KaTeXPlugin, {}),
184
+ /* @__PURE__ */ jsx(AlertPlugin, {}),
185
+ /* @__PURE__ */ jsx(MermaidPlugin, {}),
186
+ /* @__PURE__ */ jsx(LinkFaviconPlugin, {}),
187
+ /* @__PURE__ */ jsx(TextSelectionPlugin, {})
188
+ ] }),
136
189
  /* @__PURE__ */ jsx(BlockIdPlugin, {}),
137
- /* @__PURE__ */ jsx(TextSelectionPlugin, {}),
138
190
  children
139
191
  ]
140
192
  })
@@ -144,4 +196,4 @@ function RichEditor({ extraNodes, imageUpload, videoUpload, fileUpload, children
144
196
  }) });
145
197
  }
146
198
  //#endregion
147
- export { $captureTextSelection, $captureTextSelectionFromRangeSelection, $getRootBlock, $getTextOffsetInBlock, $resolveSelectionPoint, $restoreTextSelection, ALERT_NODE_KEY, BANNER_NODE_KEY, CODE_BLOCK_NODE_KEY, ColorSchemeProvider, CorePlugins, ExtraNodesProvider, FILE_NODE_KEY, FOOTNOTE_NODE_KEY, FOOTNOTE_SECTION_NODE_KEY, FootnoteDefinitionsProvider, IMAGE_NODE_KEY, KATEX_NODE_KEY, LINK_CARD_NODE_KEY, LinkFavicon, MENTION_NODE_KEY, MERMAID_NODE_KEY, NESTED_EDITOR_NODES, NestedContentRendererProvider, NestedEditorCorePlugins, NestedEditorPluginsProvider, RUBY_NODE_KEY, RendererConfigProvider, RichEditor, RichEditorShell, TAG_NODE_KEY, TEXT_SELECTION_HIGHLIGHT_NAME, TextSelectionStoreProvider, VIDEO_NODE_KEY, articleTheme, articleVariant, blockIdState, buildBlockAnchor, buildRangeAnchor, chatTheme, chatVariant, commentTheme, commentVariant, createDOMRangeFromTextSelection, createNestedEditor, createTextSelectionStore, detailsClassNames, detailsStyles, editorTheme, findDOMPointByTextOffset, getBlockElementById, getDOMRectFromTextSelection, getTextOffsetFromDOMPoint, getVariantClass, gridClassNames, gridStyles, katexClassNames, katexStyles, noteTheme, noteVariant, registerNestedEditorSync, richContent, semanticClassNames, sharedStyles, useColorScheme, useExtraNodes, useFootnoteContent, useFootnoteDefinitions, useFootnoteDisplayNumber, useNestedContentRenderer, useNestedEditorPlugins, useNestedEditorSync, useOptionalNestedContentRenderer, useRendererConfig, useRendererMode, useTextSelectionSnapshot, useTextSelectionStore, useVariant, vars };
199
+ export { $captureTextSelection, $captureTextSelectionFromRangeSelection, $getRootBlock, $getTextOffsetInBlock, $resolveSelectionPoint, $restoreTextSelection, ALERT_NODE_KEY, ActiveEditorScope, BANNER_NODE_KEY, CODE_BLOCK_NODE_KEY, ColorSchemeProvider, CorePlugins, EditorSurfacePlugin, EditorSurfacePlugins, ExtraNodesProvider, FILE_NODE_KEY, FOOTNOTE_NODE_KEY, FOOTNOTE_SECTION_NODE_KEY, FootnoteDefinitionsProvider, IMAGE_NODE_KEY, KATEX_NODE_KEY, LINK_CARD_NODE_KEY, LinkFavicon, MENTION_NODE_KEY, MERMAID_NODE_KEY, NESTED_EDITOR_NODES, NestedContentRendererProvider, NestedEditorCorePlugins, NestedEditorPluginsProvider, RUBY_NODE_KEY, RendererConfigProvider, RichEditor, RichEditorShell, TAG_NODE_KEY, TEXT_SELECTION_HIGHLIGHT_NAME, TextSelectionStoreProvider, VIDEO_NODE_KEY, VirtualizationPlugin, articleTheme, articleVariant, blockIdState, buildBlockAnchor, buildRangeAnchor, chatTheme, chatVariant, commentTheme, commentVariant, createDOMRangeFromTextSelection, createNestedEditor, createTextSelectionStore, detailsClassNames, detailsStyles, editorTheme, findDOMPointByTextOffset, getBlockElementById, getDOMRectFromTextSelection, getTextOffsetFromDOMPoint, getVariantClass, gridClassNames, gridStyles, katexClassNames, katexStyles, noteTheme, noteVariant, registerNestedEditorSync, richContent, semanticClassNames, sharedStyles, useActiveEditor, useColorScheme, useEditorBlock, useEditorBlock as useVirtualizedBlock, useExtraNodes, useFootnoteContent, useFootnoteDefinitions, useFootnoteDisplayNumber, useNestedContentRenderer, useNestedEditorPlugins, useNestedEditorSync, useOptionalNestedContentRenderer, useRendererConfig, useRendererMode, useTextSelectionSnapshot, useTextSelectionStore, useVariant, vars };
@@ -1,4 +1,5 @@
1
- import "./utils-CdxPji5z.js";
1
+ /* empty css */
2
+ import "./utils-E6qVk-NR.js";
2
3
  //#region src/styles/katex.css.ts
3
4
  var katexClassNames = {
4
5
  inline: "rich-katex-inline",
@@ -1,20 +1,21 @@
1
- import { c as semanticClassNames, l as sharedStyles, t as clsx } from "./utils-CdxPji5z.js";
2
- import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, K as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-Blq1EG_t.js";
3
- import { c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, o as useFootnoteDefinitions, p as useVariant } from "./thumbhash-DHHqtr0c.js";
4
- import { A as $isCodeBlockNode, F as BannerNode, I as normalizeBannerType, L as BannerRenderer, M as $isBannerNode, S as FileNode, T as DetailsNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, j as CodeBlockNode, k as CommentNode, n as useColorScheme, p as LinkCardNode, s as VideoNode, u as RubyNode, y as FootnoteSectionNode } from "./ColorSchemeContext-RLg0uDRt.js";
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-DQt5pIZ8.js";
1
+ import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-DH4xzxU-.js";
2
+ import { c as RendererWrapper, g as CODE_BLOCK_NODE_KEY, h as BANNER_NODE_KEY, o as useFootnoteDefinitions, p as useVariant } from "./thumbhash-GjK8OYAb.js";
3
+ import { c as semanticClassNames, l as sharedStyles, t as clsx } from "./utils-E6qVk-NR.js";
4
+ import { t as _defineProperty } from "./defineProperty-BYhxpJwd.js";
5
+ 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-Dc_HebHd.js";
6
+ import { n as gridStyles, t as gridClassNames } from "./grid.css-DJWKdYpz.js";
7
+ import { a as useNestedEditorSync, i as createNestedEditor, n as AlertQuoteEditNode, s as NestedEditorCorePlugins } from "./AlertQuoteEditNode-Ck4v29Wg.js";
7
8
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
8
9
  import { createElement, useCallback, useEffect, useMemo, useRef, useState } from "react";
9
10
  import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection } from "lexical";
10
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
11
12
  import { Flag, LayoutGrid, Minus, Plus } from "lucide-react";
12
13
  import { ContentEditable } from "@lexical/react/LexicalContentEditable";
13
14
  import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
14
15
  import { LexicalNestedComposer } from "@lexical/react/LexicalNestedComposer";
15
16
  import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
16
17
  import { useLexicalNodeSelection } from "@lexical/react/useLexicalNodeSelection";
17
- import { highlightCode } from "@haklex/rich-editor-ui";
18
+ import { TooltipContent, TooltipRoot, TooltipTrigger, highlightCode } from "@haklex/rich-editor-ui";
18
19
  //#region src/utils/codeBlockSelectionIntent.ts
19
20
  var codeBlockCursorIntentMap = /* @__PURE__ */ new Map();
20
21
  function setCodeBlockCursorIntent(nodeKey, placement) {
@@ -482,6 +483,21 @@ var COL_OPTIONS = [
482
483
  3,
483
484
  4
484
485
  ];
486
+ function GridToolbarButton({ children, className, label, pressed, onClick }) {
487
+ return /* @__PURE__ */ jsxs(TooltipRoot, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
488
+ render: /* @__PURE__ */ jsx("button", {
489
+ "aria-label": label,
490
+ "aria-pressed": pressed,
491
+ className,
492
+ type: "button",
493
+ onClick
494
+ }),
495
+ children
496
+ }), /* @__PURE__ */ jsx(TooltipContent, {
497
+ side: "top",
498
+ children: label
499
+ })] });
500
+ }
485
501
  function GridEditDecorator({ nodeKey, autoFocusOnMount, cols: initialCols, gap, cellEditors }) {
486
502
  const [editor] = useLexicalComposerContext();
487
503
  const [currentCols, setCurrentCols] = useState(initialCols);
@@ -534,35 +550,35 @@ function GridEditDecorator({ nodeKey, autoFocusOnMount, cols: initialCols, gap,
534
550
  node.removeCells(cols);
535
551
  });
536
552
  }, [editor, nodeKey]);
537
- return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
553
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
554
+ "aria-label": "Grid",
538
555
  className: clsx(gridClassNames.toolbar, gridStyles.toolbar),
556
+ role: "toolbar",
539
557
  onMouseDown: (e) => e.preventDefault(),
540
558
  children: [
541
559
  /* @__PURE__ */ jsx("span", {
542
560
  className: clsx(gridClassNames.toolbarIcon, gridStyles.toolbarIcon),
543
- children: /* @__PURE__ */ jsx(LayoutGrid, { size: 14 })
561
+ children: /* @__PURE__ */ jsx(LayoutGrid, { size: 16 })
544
562
  }),
545
- COL_OPTIONS.map((n) => /* @__PURE__ */ jsx("button", {
546
- "aria-label": `${n} columns`,
547
- type: "button",
563
+ COL_OPTIONS.map((n) => /* @__PURE__ */ jsx(GridToolbarButton, {
564
+ label: `${n} columns`,
565
+ pressed: n === currentCols,
548
566
  className: clsx(gridClassNames.colButton, gridStyles.colButton, n === currentCols && gridClassNames.colButtonActive, n === currentCols && gridStyles.colButtonActive),
549
567
  onClick: () => handleSetCols(n),
550
568
  children: n
551
569
  }, n)),
552
570
  /* @__PURE__ */ jsx("div", { className: clsx(gridClassNames.toolbarDivider, gridStyles.toolbarDivider) }),
553
- /* @__PURE__ */ jsx("button", {
554
- "aria-label": "Add row",
571
+ /* @__PURE__ */ jsx(GridToolbarButton, {
555
572
  className: clsx(gridClassNames.actionButton, gridStyles.actionButton),
556
- type: "button",
573
+ label: "Add row",
557
574
  onClick: handleAddRow,
558
- children: /* @__PURE__ */ jsx(Plus, { size: 14 })
575
+ children: /* @__PURE__ */ jsx(Plus, { size: 16 })
559
576
  }),
560
- /* @__PURE__ */ jsx("button", {
561
- "aria-label": "Remove row",
577
+ /* @__PURE__ */ jsx(GridToolbarButton, {
562
578
  className: clsx(gridClassNames.actionButton, gridStyles.actionButton),
563
- type: "button",
579
+ label: "Remove last row",
564
580
  onClick: handleRemoveRow,
565
- children: /* @__PURE__ */ jsx(Minus, { size: 14 })
581
+ children: /* @__PURE__ */ jsx(Minus, { size: 16 })
566
582
  })
567
583
  ]
568
584
  }), /* @__PURE__ */ jsx("div", {
@@ -43,10 +43,12 @@ export declare class ImageNode extends DecoratorNode<ReactElement> {
43
43
  __fixedHeight?: number;
44
44
  __fixedWidth?: number;
45
45
  __layout?: ImageLayout;
46
+ __autoOpenOnMount: boolean;
46
47
  static commandItems: CommandItemConfig[];
47
48
  static getType(): string;
48
49
  static clone(node: ImageNode): ImageNode;
49
50
  constructor(payload: ImageNodePayload, key?: NodeKey);
51
+ afterCloneFrom(prevNode: this): void;
50
52
  createDOM(_config: EditorConfig): HTMLElement;
51
53
  updateDOM(prevNode: this, dom: HTMLElement): boolean;
52
54
  isInline(): boolean;
@@ -75,8 +77,12 @@ export declare class ImageNode extends DecoratorNode<ReactElement> {
75
77
  getFixedHeight(): number | undefined;
76
78
  getDisplaySize(): ImageDisplaySize;
77
79
  getLayout(): ImageLayout | undefined;
80
+ getShouldAutoOpenOnMount(): boolean;
81
+ setShouldAutoOpenOnMount(autoOpenOnMount: boolean): void;
78
82
  decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement;
79
83
  }
80
- export declare function $createImageNode(payload: ImageNodePayload): ImageNode;
84
+ export declare function $createImageNode(payload: ImageNodePayload, options?: {
85
+ autoOpenOnMount?: boolean;
86
+ }): ImageNode;
81
87
  export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
82
88
  //# sourceMappingURL=ImageNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageNode.d.ts","sourceRoot":"","sources":["../../src/n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YAAY,GAAG,YAAY;CAgBtE;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACtC,SAAS,CAIX;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,SAAS,CAEpF"}
@@ -1,5 +1,5 @@
1
1
  import { QuoteNode, SerializedQuoteNode } from '@lexical/rich-text';
2
- import { LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
2
+ import { DOMExportOutput, EditorConfig, ElementDOMSlot, LexicalEditor, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical';
3
3
  export type SerializedRichQuoteNode = Spread<{
4
4
  attribution: string | null;
5
5
  }, SerializedQuoteNode>;
@@ -9,6 +9,9 @@ export declare class RichQuoteNode extends QuoteNode {
9
9
  static getType(): string;
10
10
  static clone(node: RichQuoteNode): RichQuoteNode;
11
11
  static importJSON(_serializedNode: SerializedLexicalNode & Record<string, unknown>): RichQuoteNode;
12
+ createDOM(config: EditorConfig): HTMLElement;
13
+ getDOMSlot(element: HTMLElement): ElementDOMSlot<HTMLElement>;
14
+ exportDOM(editor: LexicalEditor): DOMExportOutput;
12
15
  exportJSON(): SerializedRichQuoteNode;
13
16
  getAttribution(): string | null;
14
17
  setAttribution(value: string | null): this;
@@ -1 +1 @@
1
- {"version":3,"file":"RichQuoteNode.d.ts","sourceRoot":"","sources":["../../src/nodes/RichQuoteNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEnF,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC;IAAE,WAAW,EAAE,MAAM,GAAG,IAA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AAE,GAAG,CAAC,EAAE,OAAO;IAK5D,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa;IAIhD,MAAM,CAAC,UAAU,CACf,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/D,aAAa;IAMhB,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,WAAW;IAU5C,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,cAAc,CAAC,WAAW,CAAC;IAI7D,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,eAAe;IAqBjD,UAAU,IAAI,uBAAuB;IAQrC,cAAc,IAAI,MAAM,GAAG,IAAI;IAI/B,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;CAK3C;AAED,wBAAgB,oBAAoB,CAAC,WAAW,GAAE,MAAM,GAAG,IAAW,GAAG,aAAa,CAErF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,aAAa,CAE5F"}
@@ -1,5 +1,5 @@
1
- import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-CH2oHfO4.js";
2
- import { A as computeImageDisplayPixels, C as KaTeXBlockNode, D as sanitizeImageLayout, E as ImageNode, F as imageDisplaySizeAfterResize, I as resolveImageDisplaySize, L as sanitizeImageDisplayWidth, M as imageDisplayCssVars, N as imageDisplayDataAttr, P as imageDisplayFieldsFromSize, R as sanitizeImageFixedPx, S as $isKaTeXBlockNode, T as $isImageNode, U as ALERT_LABELS, W as ALERT_TYPES, _ as MentionNode, b as KaTeXInlineNode, d as RichQuoteNode, f as $createMermaidNode, g as $isMentionNode, h as $createMentionNode, i as TagNode, j as convertImageDisplaySize, l as $createRichQuoteNode, m as MermaidNode, n as $createTagNode, p as $isMermaidNode, r as $isTagNode, u as $isRichQuoteNode, w as $createImageNode, y as $isKaTeXInlineNode } from "./theme-Blq1EG_t.js";
3
- import { C as fileExtFromName, E as $createCommentNode, N as BANNER_LABELS, O as $isCommentNode, P as BANNER_TYPES, S as FileNode, _ as $createFootnoteSectionNode, a as customNodes, b as $createFileNode, c as $createRubyNode, d as $createLinkCardNode, f as $isLinkCardNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, k as CommentNode, l as $isRubyNode, m as $createGridContainerNode, p as LinkCardNode, r as allNodes, u as RubyNode, v as $isFootnoteSectionNode, x as $isFileNode, y as FootnoteSectionNode } from "./ColorSchemeContext-RLg0uDRt.js";
4
- import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-DQt5pIZ8.js";
1
+ import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-jRE4LqH-.js";
2
+ import { A as computeImageDisplayPixels, C as KaTeXBlockNode, D as sanitizeImageLayout, E as ImageNode, F as imageDisplaySizeAfterResize, I as resolveImageDisplaySize, L as sanitizeImageDisplayWidth, M as imageDisplayCssVars, N as imageDisplayDataAttr, P as imageDisplayFieldsFromSize, R as sanitizeImageFixedPx, S as $isKaTeXBlockNode, T as $isImageNode, U as ALERT_LABELS, W as ALERT_TYPES, _ as MentionNode, b as KaTeXInlineNode, d as RichQuoteNode, f as $createMermaidNode, g as $isMentionNode, h as $createMentionNode, i as TagNode, j as convertImageDisplaySize, l as $createRichQuoteNode, m as MermaidNode, n as $createTagNode, p as $isMermaidNode, r as $isTagNode, u as $isRichQuoteNode, w as $createImageNode, y as $isKaTeXInlineNode } from "./theme-DH4xzxU-.js";
3
+ import { C as fileExtFromName, E as $createCommentNode, N as BANNER_LABELS, O as $isCommentNode, P as BANNER_TYPES, S as FileNode, _ as $createFootnoteSectionNode, a as customNodes, b as $createFileNode, c as $createRubyNode, d as $createLinkCardNode, f as $isLinkCardNode, g as GridContainerNode, h as $isGridContainerNode, i as builtinNodes, k as CommentNode, l as $isRubyNode, m as $createGridContainerNode, p as LinkCardNode, r as allNodes, u as RubyNode, v as $isFootnoteSectionNode, x as $isFileNode, y as FootnoteSectionNode } from "./ColorSchemeContext-Dc_HebHd.js";
4
+ import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-Ck4v29Wg.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 };
@@ -1 +1 @@
1
- {"version":3,"file":"FileUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/FileUploadPlugin.tsx"],"names":[],"mappings":"AAgBA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,KAC9C,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAM/B,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BA4HnE"}
1
+ {"version":3,"file":"FileUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/FileUploadPlugin.tsx"],"names":[],"mappings":"AAiBA,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,KAC9C,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAM/B,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,YAAY,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,QAAQ,EAAE,EAAE,qBAAqB,+BAkInE"}
@@ -0,0 +1,13 @@
1
+ import { ImageDialogEntry, ImageDialogMode, ImageEditorCapability } from './image-dialog-model';
2
+ export interface ImageDialogProps {
3
+ allowUrl?: boolean;
4
+ editor?: ImageEditorCapability | null;
5
+ initialFiles?: File[];
6
+ mode?: ImageDialogMode;
7
+ onCancel: () => void;
8
+ onDirtyChange?: (dirty: boolean) => void;
9
+ onSubmit: (entries: ImageDialogEntry[]) => void;
10
+ onTitleChange?: (title: string) => void;
11
+ }
12
+ export declare function ImageDialog({ allowUrl, editor, initialFiles, mode, onCancel, onDirtyChange, onSubmit, onTitleChange, }: ImageDialogProps): import('react').JSX.Element;
13
+ //# sourceMappingURL=ImageDialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageDialog.d.ts","sourceRoot":"","sources":["../../src/plugins/ImageDialog.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAGV,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EAEtB,MAAM,sBAAsB,CAAC;AAU9B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAC;IACtB,IAAI,CAAC,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,QAAQ,EAAE,CAAC,OAAO,EAAE,gBAAgB,EAAE,KAAK,IAAI,CAAC;IAChD,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AA2BD,wBAAgB,WAAW,CAAC,EAC1B,QAAe,EACf,MAAa,EACb,YAAY,EACZ,IAAe,EACf,QAAQ,EACR,aAAa,EACb,QAAQ,EACR,aAAa,GACd,EAAE,gBAAgB,+BAsMlB"}
@@ -0,0 +1,13 @@
1
+ import { FileRow, ReviewRow } from './image-dialog-model';
2
+ export interface ImageDialogReviewProps {
3
+ canAddMore: boolean;
4
+ canEdit: boolean;
5
+ failedIds: string[];
6
+ onAddMore: () => void;
7
+ onEdit: (row: FileRow) => void;
8
+ onRemove: (id: string) => void;
9
+ onToggleGps: (id: string, removeGps: boolean) => void;
10
+ rows: ReviewRow[];
11
+ }
12
+ export declare function ImageDialogReview({ canAddMore, canEdit, failedIds, onAddMore, onEdit, onRemove, onToggleGps, rows, }: ImageDialogReviewProps): import('react').JSX.Element;
13
+ //# sourceMappingURL=ImageDialogReview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageDialogReview.d.ts","sourceRoot":"","sources":["../../src/plugins/ImageDialogReview.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAqH/D,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/B,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACtD,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,UAAU,EACV,OAAO,EACP,SAAS,EACT,SAAS,EACT,MAAM,EACN,QAAQ,EACR,WAAW,EACX,IAAI,GACL,EAAE,sBAAsB,+BAuCxB"}
@@ -0,0 +1,12 @@
1
+ export interface ImageDialogSourceProps {
2
+ allowUrl: boolean;
3
+ onAddUrl: (entry: {
4
+ height: number;
5
+ src: string;
6
+ width: number;
7
+ }) => void;
8
+ onPickFiles: () => void;
9
+ onReceiveFiles: (files: File[]) => void;
10
+ }
11
+ export declare function ImageDialogSource({ allowUrl, onAddUrl, onPickFiles, onReceiveFiles, }: ImageDialogSourceProps): import('react').JSX.Element;
12
+ //# sourceMappingURL=ImageDialogSource.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageDialogSource.d.ts","sourceRoot":"","sources":["../../src/plugins/ImageDialogSource.tsx"],"names":[],"mappings":"AAwDA,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAC1E,WAAW,EAAE,MAAM,IAAI,CAAC;IACxB,cAAc,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,GACf,EAAE,sBAAsB,+BAyGxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"ImagePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ImagePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAElD,eAAO,MAAM,oBAAoB,oDAA4D,CAAC;AAE9F,wBAAgB,WAAW,SAgB1B"}
1
+ {"version":3,"file":"ImagePlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ImagePlugin.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,MAAM,MAAM,kBAAkB,GAAG,gBAAgB,CAAC;AAElD,eAAO,MAAM,oBAAoB,oDAA4D,CAAC;AAE9F,wBAAgB,WAAW,SAkB1B"}
@@ -10,6 +10,6 @@ export declare function defaultImageUpload(file: File): Promise<ImageUploadResul
10
10
  interface ImageUploadPluginProps {
11
11
  onUpload: ImageUploadFn;
12
12
  }
13
- export declare function ImageUploadPlugin({ onUpload }: ImageUploadPluginProps): import('react').JSX.Element;
13
+ export declare function ImageUploadPlugin({ onUpload }: ImageUploadPluginProps): null;
14
14
  export {};
15
15
  //# sourceMappingURL=ImageUploadPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ImageUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ImageUploadPlugin.tsx"],"names":[],"mappings":"AA4BA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AA0CvE,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAK/E;AAED,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,+BA6crE"}
1
+ {"version":3,"file":"ImageUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/ImageUploadPlugin.tsx"],"names":[],"mappings":"AAwBA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAkBvE,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAK/E;AAED,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,QAqNrE"}
@@ -7,6 +7,6 @@ export type VideoUploadFn = (file: File, opts?: {
7
7
  interface VideoUploadPluginProps {
8
8
  onUpload: VideoUploadFn;
9
9
  }
10
- export declare function VideoUploadPlugin({ onUpload }: VideoUploadPluginProps): import('react').JSX.Element | null;
10
+ export declare function VideoUploadPlugin({ onUpload }: VideoUploadPluginProps): null;
11
11
  export {};
12
12
  //# sourceMappingURL=VideoUploadPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VideoUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/VideoUploadPlugin.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,KAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAahC,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,sCAiLrE"}
1
+ {"version":3,"file":"VideoUploadPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/VideoUploadPlugin.tsx"],"names":[],"mappings":"AAWA,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,aAAa,GAAG,CAC1B,IAAI,EAAE,IAAI,EACV,IAAI,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,KAC9C,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAehC,UAAU,sBAAsB;IAC9B,QAAQ,EAAE,aAAa,CAAC;CACzB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,QAAQ,EAAE,EAAE,sBAAsB,QA8HrE"}
@@ -0,0 +1,2 @@
1
+ export { VirtualizationPlugin } from '../virtualization/VirtualizationPlugin';
2
+ //# sourceMappingURL=VirtualizationPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VirtualizationPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/VirtualizationPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,65 @@
1
+ import { ImagePreprocessContextValue } from '../context/ImagePreprocessContext';
2
+ export interface GpsInfo {
3
+ latitude: number;
4
+ longitude: number;
5
+ }
6
+ export interface ImageEditPrivacy {
7
+ detectGps: (file: File) => Promise<GpsInfo | null>;
8
+ stripGps: (file: File) => Promise<File>;
9
+ }
10
+ export interface ImageEditorCapability {
11
+ edit: (file: File) => Promise<{
12
+ file: File;
13
+ summary?: string;
14
+ } | null>;
15
+ privacy?: ImageEditPrivacy;
16
+ }
17
+ export type ImageDialogMode = 'insert' | 'replace';
18
+ export type ImageDialogEntry = {
19
+ file: File;
20
+ kind: 'file';
21
+ } | {
22
+ height: number;
23
+ kind: 'url';
24
+ src: string;
25
+ width: number;
26
+ };
27
+ export interface FileRow {
28
+ current: File;
29
+ gps: GpsInfo | null;
30
+ id: string;
31
+ kind: 'file';
32
+ original: File;
33
+ removeGps: boolean;
34
+ summary: string;
35
+ }
36
+ export interface UrlRow {
37
+ height: number;
38
+ id: string;
39
+ kind: 'url';
40
+ src: string;
41
+ width: number;
42
+ }
43
+ export type ReviewRow = FileRow | UrlRow;
44
+ export declare const IMAGE_DIALOG_WIDTH = 520;
45
+ export declare const IMAGE_FORMATS_HINT = "PNG, JPG, GIF, WebP, AVIF";
46
+ export declare function isImageFile(file: File): boolean;
47
+ export declare function isSafeImageUrl(url: string): boolean;
48
+ export declare function isEditableImage(file: File): boolean;
49
+ export declare function formatBytes(bytes: number): string;
50
+ export declare function loadImageByUrl(src: string): Promise<{
51
+ width: number;
52
+ height: number;
53
+ }>;
54
+ export declare function urlFileName(src: string): string;
55
+ export declare function imageDialogCopy(mode: ImageDialogMode, count: number): {
56
+ action: string;
57
+ title: string;
58
+ };
59
+ export declare function finalizeRows(rows: ReviewRow[], stripGps: ImageEditPrivacy['stripGps'] | undefined): Promise<{
60
+ entries: ImageDialogEntry[];
61
+ failedIds: string[];
62
+ }>;
63
+ export declare function registerImageEditor(scope: ImagePreprocessContextValue, capability: ImageEditorCapability): () => void;
64
+ export declare function getImageEditor(scope: ImagePreprocessContextValue | null | undefined): ImageEditorCapability | null;
65
+ //# sourceMappingURL=image-dialog-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"image-dialog-model.d.ts","sourceRoot":"","sources":["../../src/plugins/image-dialog-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAErF,MAAM,WAAW,OAAO;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC;IACnD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC,CAAC;IACvE,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAC1B;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7F,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,IAAI,CAAC;IACd,GAAG,EAAE,OAAO,GAAG,IAAI,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,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