@haklex/rich-editor 0.36.0 → 0.37.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 (57) hide show
  1. package/dist/{AlertQuoteEditNode-C4NKE1Lt.js → AlertQuoteEditNode-DUvNEyjw.js} +3 -3
  2. package/dist/{KaTeXRenderer-DLtnsRSv.js → KaTeXRenderer-DvxFML1l.js} +2 -1
  3. package/dist/LinkCardRenderer-BT8P5aJC.js +100 -0
  4. package/dist/{MermaidPlugin-BOP4CFU_.js → MermaidPlugin-DgIAgFH8.js} +2 -2
  5. package/dist/{SubmitShortcutPlugin-DQLW3pPC.js → SubmitShortcutPlugin-DuKGB15Q.js} +286 -7
  6. package/dist/commands-entry.d.ts +1 -0
  7. package/dist/commands-entry.d.ts.map +1 -1
  8. package/dist/commands-entry.mjs +3 -3
  9. package/dist/components/CorePlugins.d.ts.map +1 -1
  10. package/dist/components/RichEditor.d.ts +1 -1
  11. package/dist/components/RichEditor.d.ts.map +1 -1
  12. package/dist/components/renderers/FileRenderer.d.ts +14 -0
  13. package/dist/components/renderers/FileRenderer.d.ts.map +1 -0
  14. package/dist/{config-CwZ9fwU0.js → config-D8JJ7F11.js} +154 -8
  15. package/dist/config-edit.d.ts.map +1 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/context/FileUploadContext.d.ts +8 -0
  18. package/dist/context/FileUploadContext.d.ts.map +1 -0
  19. package/dist/index.mjs +30 -26
  20. package/dist/{node-registry-BOe08y9j.js → node-registry-BFDycNE-.js} +5 -4
  21. package/dist/nodes/FileNode.d.ts +49 -0
  22. package/dist/nodes/FileNode.d.ts.map +1 -0
  23. package/dist/nodes/KaTeXInlineNode.d.ts.map +1 -1
  24. package/dist/nodes/MentionNode.d.ts.map +1 -1
  25. package/dist/nodes-entry.d.ts +2 -0
  26. package/dist/nodes-entry.d.ts.map +1 -1
  27. package/dist/nodes-entry.mjs +5 -5
  28. package/dist/plugins/FileUploadPlugin.d.ts +12 -0
  29. package/dist/plugins/FileUploadPlugin.d.ts.map +1 -0
  30. package/dist/plugins/InlineDndPlugin.d.ts +2 -0
  31. package/dist/plugins/InlineDndPlugin.d.ts.map +1 -0
  32. package/dist/plugins/file-upload-command.d.ts +3 -0
  33. package/dist/plugins/file-upload-command.d.ts.map +1 -0
  34. package/dist/plugins/file-upload-store.d.ts +11 -0
  35. package/dist/plugins/file-upload-store.d.ts.map +1 -0
  36. package/dist/plugins/image-upload.css.d.ts +1 -1
  37. package/dist/plugins/inline-dnd-shared.d.ts +4 -0
  38. package/dist/plugins/inline-dnd-shared.d.ts.map +1 -0
  39. package/dist/plugins/inline-dnd.css.d.ts +3 -0
  40. package/dist/plugins/inline-dnd.css.d.ts.map +1 -0
  41. package/dist/plugins-entry.d.ts +5 -0
  42. package/dist/plugins-entry.d.ts.map +1 -1
  43. package/dist/plugins-entry.mjs +5 -4
  44. package/dist/renderers-entry.d.ts +3 -1
  45. package/dist/renderers-entry.d.ts.map +1 -1
  46. package/dist/renderers-entry.mjs +3 -3
  47. package/dist/rich-editor.css +1 -1
  48. package/dist/static-entry.mjs +3 -3
  49. package/dist/{theme-CnNR-Ttt.js → theme-Vu_9D3oG.js} +22 -8
  50. package/dist/types/renderer-config.d.ts +3 -0
  51. package/dist/types/renderer-config.d.ts.map +1 -1
  52. package/dist/types/renderer-keys.d.ts +1 -0
  53. package/dist/types/renderer-keys.d.ts.map +1 -1
  54. package/dist/types.d.ts +5 -0
  55. package/dist/types.d.ts.map +1 -1
  56. package/package.json +6 -6
  57. package/dist/LinkCardRenderer-DPV1JP0X.js +0 -45
@@ -1,18 +1,18 @@
1
- import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, G as _defineProperty, K as extractTextContent, W as AlertQuoteNode, Y as useNestedContentRenderer, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, i as TagNode, m as MermaidNode } from "./theme-CnNR-Ttt.js";
2
- import { D as VIDEO_NODE_KEY, S as LINK_CARD_NODE_KEY, _ as CODE_BLOCK_NODE_KEY, g as BANNER_NODE_KEY, l as RendererWrapper, m as useVariant, s as useFootnoteDefinitions, u as createRendererDecoration, y as FOOTNOTE_SECTION_NODE_KEY } from "./KaTeXRenderer-DLtnsRSv.js";
3
1
  import { l as semanticClassNames, r as clsx, u as sharedStyles } from "./katex.css-0TJGE4On.js";
2
+ import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, G as AlertQuoteNode, K as _defineProperty, V as OPEN_FILE_PICKER_COMMAND, X as useNestedContentRenderer, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, d as RichQuoteNode, et as markInlineDraggable, i as TagNode, m as MermaidNode, q as extractTextContent } from "./theme-Vu_9D3oG.js";
3
+ import { C as LINK_CARD_NODE_KEY, O as VIDEO_NODE_KEY, _ as CODE_BLOCK_NODE_KEY, b as FOOTNOTE_SECTION_NODE_KEY, g as BANNER_NODE_KEY, l as RendererWrapper, m as useVariant, s as useFootnoteDefinitions, u as createRendererDecoration, v as FILE_NODE_KEY } from "./KaTeXRenderer-DvxFML1l.js";
4
4
  import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-ClPR9Sd5.js";
5
- import { t as LinkCardRenderer } from "./LinkCardRenderer-DPV1JP0X.js";
5
+ import { n as FileRenderer, t as LinkCardRenderer } from "./LinkCardRenderer-BT8P5aJC.js";
6
6
  import { AutoLinkNode, LinkNode } from "@lexical/link";
7
7
  import { createContext, createElement, use, useCallback, useEffect, useRef, useState } from "react";
8
8
  import { HeadingNode, QuoteNode } from "@lexical/rich-text";
9
9
  import { $createParagraphNode, $createTextNode, $insertNodes, DecoratorNode, ElementNode, TextNode } from "lexical";
10
10
  import { HorizontalRuleNode } from "@lexical/extension";
11
+ import { jsx, jsxs } from "react/jsx-runtime";
11
12
  import { CodeNode } from "@lexical/code-core";
12
13
  import { ListItemNode, ListNode } from "@lexical/list";
13
14
  import { TableCellNode, TableNode, TableRowNode } from "@lexical/table";
14
- import { jsx, jsxs } from "react/jsx-runtime";
15
- import { ChevronRight, Code, Link, MessageSquareQuote, Video } from "lucide-react";
15
+ import { ChevronRight, Code, Link, MessageSquareQuote, Paperclip, Video } from "lucide-react";
16
16
  //#region src/components/renderers/BannerRenderer.tsx
17
17
  var BannerRenderer = ({ type }) => {
18
18
  return /* @__PURE__ */ jsx("span", { className: `rich-banner-icon rich-banner-icon-${type}` });
@@ -574,6 +574,149 @@ function $createDetailsNode(summary, open = false) {
574
574
  return new DetailsNode(summary, open);
575
575
  }
576
576
  //#endregion
577
+ //#region src/nodes/FileNode.ts
578
+ function fileExtFromName(name) {
579
+ const index = name.lastIndexOf(".");
580
+ if (index <= 0 || index === name.length - 1) return void 0;
581
+ const ext = name.slice(index + 1).toLowerCase();
582
+ return ext.length > 8 ? void 0 : ext;
583
+ }
584
+ var FileNode = class FileNode extends DecoratorNode {
585
+ static getType() {
586
+ return "file";
587
+ }
588
+ static clone(node) {
589
+ return new FileNode({
590
+ src: node.__src,
591
+ name: node.__name,
592
+ size: node.__size,
593
+ mimeType: node.__mimeType,
594
+ ext: node.__ext,
595
+ display: node.__display
596
+ }, node.__key);
597
+ }
598
+ constructor(payload, key) {
599
+ super(key);
600
+ _defineProperty(this, "__src", void 0);
601
+ _defineProperty(this, "__name", void 0);
602
+ _defineProperty(this, "__size", void 0);
603
+ _defineProperty(this, "__mimeType", void 0);
604
+ _defineProperty(this, "__ext", void 0);
605
+ _defineProperty(this, "__display", void 0);
606
+ this.__src = payload.src;
607
+ this.__name = payload.name;
608
+ this.__size = payload.size;
609
+ this.__mimeType = payload.mimeType;
610
+ this.__ext = payload.ext;
611
+ this.__display = payload.display ?? "block";
612
+ }
613
+ createDOM(_config) {
614
+ const el = document.createElement(this.__display === "inline" ? "span" : "div");
615
+ el.className = "rich-file-wrapper";
616
+ if (this.__display === "inline") markInlineDraggable(el, this.getKey());
617
+ return el;
618
+ }
619
+ updateDOM() {
620
+ return false;
621
+ }
622
+ isInline() {
623
+ return this.__display === "inline";
624
+ }
625
+ static importJSON(_serializedNode) {
626
+ const serializedNode = _serializedNode;
627
+ return $createFileNode({
628
+ src: serializedNode.src,
629
+ name: serializedNode.name,
630
+ size: serializedNode.size,
631
+ mimeType: serializedNode.mimeType,
632
+ ext: serializedNode.ext,
633
+ display: serializedNode.display
634
+ });
635
+ }
636
+ exportJSON() {
637
+ return {
638
+ ...super.exportJSON(),
639
+ type: "file",
640
+ src: this.__src,
641
+ name: this.__name,
642
+ size: this.__size,
643
+ mimeType: this.__mimeType,
644
+ ext: this.__ext,
645
+ display: this.__display,
646
+ version: 1
647
+ };
648
+ }
649
+ getSrc() {
650
+ return this.getLatest().__src;
651
+ }
652
+ setSrc(src) {
653
+ this.getWritable().__src = src;
654
+ }
655
+ getName() {
656
+ return this.getLatest().__name;
657
+ }
658
+ setName(name) {
659
+ this.getWritable().__name = name;
660
+ }
661
+ getDisplay() {
662
+ return this.getLatest().__display;
663
+ }
664
+ getPayload() {
665
+ const latest = this.getLatest();
666
+ return {
667
+ src: latest.__src,
668
+ name: latest.__name,
669
+ size: latest.__size,
670
+ mimeType: latest.__mimeType,
671
+ ext: latest.__ext,
672
+ display: latest.__display
673
+ };
674
+ }
675
+ setFilePayload(payload) {
676
+ const writable = this.getWritable();
677
+ if (payload.src !== void 0) writable.__src = payload.src;
678
+ if (payload.name !== void 0) writable.__name = payload.name;
679
+ writable.__size = payload.size;
680
+ writable.__mimeType = payload.mimeType;
681
+ writable.__ext = payload.ext;
682
+ }
683
+ decorate(_editor, _config) {
684
+ return createRendererDecoration(FILE_NODE_KEY, FileRenderer, {
685
+ src: this.__src,
686
+ name: this.__name,
687
+ size: this.__size,
688
+ mimeType: this.__mimeType,
689
+ ext: this.__ext,
690
+ display: this.__display,
691
+ nodeKey: this.getKey()
692
+ });
693
+ }
694
+ };
695
+ _defineProperty(FileNode, "commandItems", [{
696
+ title: "File",
697
+ icon: createElement(Paperclip, { size: 20 }),
698
+ description: "Attach a file",
699
+ keywords: [
700
+ "file",
701
+ "attachment",
702
+ "upload",
703
+ "wenjian",
704
+ "fujian"
705
+ ],
706
+ section: "MEDIA",
707
+ placement: ["slash", "toolbar"],
708
+ group: "insert",
709
+ onSelect: (editor) => {
710
+ editor.dispatchCommand(OPEN_FILE_PICKER_COMMAND, void 0);
711
+ }
712
+ }]);
713
+ function $createFileNode(payload) {
714
+ return new FileNode(payload);
715
+ }
716
+ function $isFileNode(node) {
717
+ return node instanceof FileNode;
718
+ }
719
+ //#endregion
577
720
  //#region src/components/renderers/FootnoteSectionRenderer.tsx
578
721
  function FootnoteSectionRenderer({ definitions }) {
579
722
  const { displayNumberMap } = useFootnoteDefinitions();
@@ -1084,8 +1227,10 @@ var RubyNode = class RubyNode extends ElementNode {
1084
1227
  return span;
1085
1228
  }
1086
1229
  updateDOM(prevNode, dom) {
1087
- if (prevNode.__reading !== this.__reading) if (this.__reading) dom.dataset.ruby = this.__reading;
1088
- else delete dom.dataset.ruby;
1230
+ if (prevNode.__reading !== this.__reading) {
1231
+ if (this.__reading) dom.dataset.ruby = this.__reading;
1232
+ else delete dom.dataset.ruby;
1233
+ }
1089
1234
  return false;
1090
1235
  }
1091
1236
  canInsertTextBefore() {
@@ -1254,6 +1399,7 @@ var customNodes = [
1254
1399
  FootnoteNode,
1255
1400
  FootnoteSectionNode,
1256
1401
  VideoNode,
1402
+ FileNode,
1257
1403
  LinkCardNode,
1258
1404
  CommentNode,
1259
1405
  DetailsNode,
@@ -1265,4 +1411,4 @@ var customNodes = [
1265
1411
  ];
1266
1412
  var allNodes = [...builtinNodes, ...customNodes];
1267
1413
  //#endregion
1268
- export { BANNER_LABELS as A, CommentNode as C, ColorSchemeProvider as D, CodeBlockRenderer as E, BannerNode as M, normalizeBannerType as N, useColorScheme as O, BannerRenderer as P, $isCommentNode as S, CodeBlockNode as T, FootnoteSectionNode as _, VideoNode as a, $createCommentNode as b, RubyNode as c, LinkCardNode as d, $createGridContainerNode as f, $isFootnoteSectionNode as g, $createFootnoteSectionNode as h, $createVideoNode as i, BANNER_TYPES as j, $isBannerNode as k, $createLinkCardNode as l, GridContainerNode as m, builtinNodes as n, $createRubyNode as o, $isGridContainerNode as p, customNodes as r, $isRubyNode as s, allNodes as t, $isLinkCardNode as u, $createDetailsNode as v, $isCodeBlockNode as w, $createCommentPlaceholderNode as x, DetailsNode as y };
1414
+ export { CodeBlockRenderer as A, DetailsNode as C, CommentNode as D, $isCommentNode as E, BANNER_TYPES as F, BannerNode as I, normalizeBannerType as L, useColorScheme as M, $isBannerNode as N, $isCodeBlockNode as O, BANNER_LABELS as P, BannerRenderer as R, $createDetailsNode as S, $createCommentPlaceholderNode as T, FootnoteSectionNode as _, VideoNode as a, FileNode as b, RubyNode as c, LinkCardNode as d, $createGridContainerNode as f, $isFootnoteSectionNode as g, $createFootnoteSectionNode as h, $createVideoNode as i, ColorSchemeProvider as j, CodeBlockNode as k, $createLinkCardNode as l, GridContainerNode as m, builtinNodes as n, $createRubyNode as o, $isGridContainerNode as p, customNodes as r, $isRubyNode as s, allNodes as t, $isLinkCardNode as u, $createFileNode as v, $createCommentNode as w, fileExtFromName as x, $isFileNode as y };
@@ -1 +1 @@
1
- {"version":3,"file":"config-edit.d.ts","sourceRoot":"","sources":["../src/config-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAsB1E,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAmB9E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAG3E,CAAC"}
1
+ {"version":3,"file":"config-edit.d.ts","sourceRoot":"","sources":["../src/config-edit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAuB1E,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAoB9E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAG3E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAsB1E,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAc3E,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAmB1E,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAGvE,CAAC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAuB1E,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAc3E,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAoB1E,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAGvE,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ import { FileUploadFn } from '../plugins/FileUploadPlugin';
3
+ export declare function FileUploadProvider({ upload, children, }: {
4
+ upload: FileUploadFn | null;
5
+ children: ReactNode;
6
+ }): import("react").JSX.Element;
7
+ export declare function useFileUpload(): FileUploadFn | null;
8
+ //# sourceMappingURL=FileUploadContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileUploadContext.d.ts","sourceRoot":"","sources":["../../src/context/FileUploadContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,GACT,EAAE;IACD,MAAM,EAAE,YAAY,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAEA;AAED,wBAAgB,aAAa,IAAI,YAAY,GAAG,IAAI,CAEnD"}
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { A as blockIdState, C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as ImagePreprocessProvider, L as CorePlugins, N as ImageUploadProvider, O as defaultImageUpload, S as TextSelectionStoreProvider, T as useTextSelectionStore, _ 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, j as VideoUploadProvider, k as BlockIdPlugin, 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 } from "./SubmitShortcutPlugin-DQLW3pPC.js";
2
- import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-BOe08y9j.js";
3
- import { J as NestedContentRendererProvider, X as useOptionalNestedContentRenderer, Y as useNestedContentRenderer, t as editorTheme } from "./theme-CnNR-Ttt.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 CODE_BLOCK_NODE_KEY, a as FootnoteDefinitionsProvider, b as IMAGE_NODE_KEY, c as useFootnoteDisplayNumber, d as RendererConfigProvider, f as useRendererConfig, g as BANNER_NODE_KEY, h as ALERT_NODE_KEY, m as useVariant, o as useFootnoteContent, p as useRendererMode, s as useFootnoteDefinitions, v as FOOTNOTE_NODE_KEY, w as MERMAID_NODE_KEY, x as KATEX_NODE_KEY, y as FOOTNOTE_SECTION_NODE_KEY } from "./KaTeXRenderer-DLtnsRSv.js";
1
+ import { B as FileUploadProvider, C as createTextSelectionStore, D as ImageUploadPlugin, E as LinkFaviconPlugin, H as CorePlugins, I as ImageUploadProvider, M as BlockIdPlugin, N as blockIdState, O as defaultImageUpload, P as VideoUploadProvider, R as ImagePreprocessProvider, S as TextSelectionStoreProvider, T as useTextSelectionStore, _ 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, k as FileUploadPlugin, 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 } from "./SubmitShortcutPlugin-DuKGB15Q.js";
2
+ import { n as setResolvedEditNodes, r as allEditNodes } from "./node-registry-BFDycNE-.js";
5
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-0TJGE4On.js";
6
- import { D as ColorSchemeProvider, O as useColorScheme } from "./config-CwZ9fwU0.js";
4
+ import { X as useNestedContentRenderer, Y as NestedContentRendererProvider, Z as useOptionalNestedContentRenderer, t as editorTheme } from "./theme-Vu_9D3oG.js";
5
+ import { C as LINK_CARD_NODE_KEY, D as TAG_NODE_KEY, E as RUBY_NODE_KEY, O as VIDEO_NODE_KEY, S as KATEX_NODE_KEY, T as MERMAID_NODE_KEY, _ as CODE_BLOCK_NODE_KEY, a as FootnoteDefinitionsProvider, b as FOOTNOTE_SECTION_NODE_KEY, c as useFootnoteDisplayNumber, d as RendererConfigProvider, f as useRendererConfig, g as BANNER_NODE_KEY, h as ALERT_NODE_KEY, m as useVariant, o as useFootnoteContent, p as useRendererMode, s as useFootnoteDefinitions, w as MENTION_NODE_KEY, x as IMAGE_NODE_KEY, y as FOOTNOTE_NODE_KEY } from "./KaTeXRenderer-DvxFML1l.js";
6
+ import { M as useColorScheme, j as ColorSchemeProvider } from "./config-D8JJ7F11.js";
7
7
  import { i as detailsStyles, n as gridStyles, r as detailsClassNames, t as gridClassNames } from "./grid.css-ClPR9Sd5.js";
8
- import { c as useNestedEditorPlugins, s as NestedEditorPluginsProvider } from "./AlertQuoteEditNode-C4NKE1Lt.js";
8
+ import { c as useNestedEditorPlugins, s as NestedEditorPluginsProvider } from "./AlertQuoteEditNode-DUvNEyjw.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-Cjb_L5rP.js";
11
- import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BOP4CFU_.js";
11
+ import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-DgIAgFH8.js";
12
12
  import { jsx, jsxs } from "react/jsx-runtime";
13
13
  import { ContentEditable } from "@lexical/react/LexicalContentEditable";
14
14
  import { LexicalErrorBoundary } from "@lexical/react/LexicalErrorBoundary";
@@ -108,31 +108,35 @@ function RichEditorShell({ nodes, initialValue, onChange, variant = "article", t
108
108
  }
109
109
  //#endregion
110
110
  //#region src/components/RichEditor.tsx
111
- function RichEditor({ extraNodes, imageUpload, videoUpload, children, ...shellProps }) {
111
+ function RichEditor({ extraNodes, imageUpload, videoUpload, fileUpload, children, ...shellProps }) {
112
112
  const nodes = extraNodes ? [...allEditNodes, ...extraNodes] : allEditNodes;
113
113
  const resolvedImageUpload = imageUpload ?? defaultImageUpload;
114
114
  return /* @__PURE__ */ jsx(ImagePreprocessProvider, { children: /* @__PURE__ */ jsx(ImageUploadProvider, {
115
115
  upload: resolvedImageUpload,
116
116
  children: /* @__PURE__ */ jsx(VideoUploadProvider, {
117
117
  upload: videoUpload ?? null,
118
- children: /* @__PURE__ */ jsx(ExtraNodesProvider, {
119
- extraNodes,
120
- children: /* @__PURE__ */ jsxs(RichEditorShell, {
121
- nodes,
122
- ...shellProps,
123
- children: [
124
- /* @__PURE__ */ jsx(CorePlugins, {}),
125
- /* @__PURE__ */ jsx(ImagePlugin, {}),
126
- /* @__PURE__ */ jsx(ImageUploadPlugin, { onUpload: resolvedImageUpload }),
127
- videoUpload ? /* @__PURE__ */ jsx(VideoUploadPlugin, { onUpload: videoUpload }) : null,
128
- /* @__PURE__ */ jsx(KaTeXPlugin, {}),
129
- /* @__PURE__ */ jsx(AlertPlugin, {}),
130
- /* @__PURE__ */ jsx(MermaidPlugin, {}),
131
- /* @__PURE__ */ jsx(LinkFaviconPlugin, {}),
132
- /* @__PURE__ */ jsx(BlockIdPlugin, {}),
133
- /* @__PURE__ */ jsx(TextSelectionPlugin, {}),
134
- children
135
- ]
118
+ children: /* @__PURE__ */ jsx(FileUploadProvider, {
119
+ upload: fileUpload ?? null,
120
+ children: /* @__PURE__ */ jsx(ExtraNodesProvider, {
121
+ extraNodes,
122
+ children: /* @__PURE__ */ jsxs(RichEditorShell, {
123
+ nodes,
124
+ ...shellProps,
125
+ children: [
126
+ /* @__PURE__ */ jsx(CorePlugins, {}),
127
+ /* @__PURE__ */ jsx(ImagePlugin, {}),
128
+ /* @__PURE__ */ jsx(ImageUploadPlugin, { onUpload: resolvedImageUpload }),
129
+ videoUpload ? /* @__PURE__ */ jsx(VideoUploadPlugin, { onUpload: videoUpload }) : null,
130
+ fileUpload ? /* @__PURE__ */ jsx(FileUploadPlugin, { onUpload: fileUpload }) : null,
131
+ /* @__PURE__ */ jsx(KaTeXPlugin, {}),
132
+ /* @__PURE__ */ jsx(AlertPlugin, {}),
133
+ /* @__PURE__ */ jsx(MermaidPlugin, {}),
134
+ /* @__PURE__ */ jsx(LinkFaviconPlugin, {}),
135
+ /* @__PURE__ */ jsx(BlockIdPlugin, {}),
136
+ /* @__PURE__ */ jsx(TextSelectionPlugin, {}),
137
+ children
138
+ ]
139
+ })
136
140
  })
137
141
  })
138
142
  })
@@ -1,9 +1,9 @@
1
- import { B as FootnoteNode, C as KaTeXBlockNode, E as ImageNode, G as _defineProperty, _ as MentionNode, b as KaTeXInlineNode, c as SpoilerNode, i as TagNode, m as MermaidNode } from "./theme-CnNR-Ttt.js";
2
- import { _ as CODE_BLOCK_NODE_KEY, g as BANNER_NODE_KEY, l as RendererWrapper, s as useFootnoteDefinitions } from "./KaTeXRenderer-DLtnsRSv.js";
3
1
  import { l as semanticClassNames, r as clsx, u as sharedStyles } from "./katex.css-0TJGE4On.js";
4
- import { C as CommentNode, E as CodeBlockRenderer, M as BannerNode, N as normalizeBannerType, P as BannerRenderer, T as CodeBlockNode, _ as FootnoteSectionNode, a as VideoNode, c as RubyNode, d as LinkCardNode, k as $isBannerNode, m as GridContainerNode, n as builtinNodes, p as $isGridContainerNode, w as $isCodeBlockNode, y as DetailsNode } from "./config-CwZ9fwU0.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-Vu_9D3oG.js";
3
+ import { _ as CODE_BLOCK_NODE_KEY, g as BANNER_NODE_KEY, l as RendererWrapper, s as useFootnoteDefinitions } from "./KaTeXRenderer-DvxFML1l.js";
4
+ import { A as CodeBlockRenderer, C as DetailsNode, D as CommentNode, I as BannerNode, L as normalizeBannerType, N as $isBannerNode, O as $isCodeBlockNode, R as BannerRenderer, _ as FootnoteSectionNode, a as VideoNode, b as FileNode, c as RubyNode, d as LinkCardNode, k as CodeBlockNode, m as GridContainerNode, n as builtinNodes, p as $isGridContainerNode } from "./config-D8JJ7F11.js";
5
5
  import { n as gridStyles, t as gridClassNames } from "./grid.css-ClPR9Sd5.js";
6
- import { a as NestedEditorCorePlugins, i as createNestedEditor, n as AlertQuoteEditNode } from "./AlertQuoteEditNode-C4NKE1Lt.js";
6
+ import { a as NestedEditorCorePlugins, i as createNestedEditor, n as AlertQuoteEditNode } from "./AlertQuoteEditNode-DUvNEyjw.js";
7
7
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
8
8
  import { createElement, useCallback, useEffect, useState } from "react";
9
9
  import { $createNodeSelection, $createParagraphNode, $getNodeByKey, $getRoot, $getSelection, $insertNodes, $isDecoratorNode, $isElementNode, $isNodeSelection, $nodesOfType, $setSelection } from "lexical";
@@ -693,6 +693,7 @@ var customEditNodes = [
693
693
  FootnoteNode,
694
694
  FootnoteSectionEditNode,
695
695
  VideoNode,
696
+ FileNode,
696
697
  LinkCardNode,
697
698
  CommentNode,
698
699
  DetailsNode,
@@ -0,0 +1,49 @@
1
+ import { EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedLexicalNode, Spread, DecoratorNode } from 'lexical';
2
+ import { ReactElement } from 'react';
3
+ import { CommandItemConfig } from '../types/slash-menu';
4
+ export type FileDisplay = 'block' | 'inline';
5
+ export type SerializedFileNode = Spread<{
6
+ src: string;
7
+ name: string;
8
+ size?: number;
9
+ mimeType?: string;
10
+ ext?: string;
11
+ display?: FileDisplay;
12
+ }, SerializedLexicalNode>;
13
+ export interface FileNodePayload {
14
+ display?: FileDisplay;
15
+ ext?: string;
16
+ mimeType?: string;
17
+ name: string;
18
+ size?: number;
19
+ src: string;
20
+ }
21
+ export declare function fileExtFromName(name: string): string | undefined;
22
+ export declare class FileNode extends DecoratorNode<ReactElement> {
23
+ __src: string;
24
+ __name: string;
25
+ __size?: number;
26
+ __mimeType?: string;
27
+ __ext?: string;
28
+ __display: FileDisplay;
29
+ static commandItems: CommandItemConfig[];
30
+ static getType(): string;
31
+ static clone(node: FileNode): FileNode;
32
+ constructor(payload: FileNodePayload, key?: NodeKey);
33
+ createDOM(_config: EditorConfig): HTMLElement;
34
+ updateDOM(): boolean;
35
+ isInline(): boolean;
36
+ static importJSON(_serializedNode: SerializedLexicalNode & Record<string, unknown>): FileNode;
37
+ exportJSON(): SerializedFileNode;
38
+ getSrc(): string;
39
+ setSrc(src: string): void;
40
+ getName(): string;
41
+ setName(name: string): void;
42
+ getDisplay(): FileDisplay;
43
+ getPayload(): FileNodePayload;
44
+ setFilePayload(payload: Partial<Omit<FileNodePayload, 'display'>>): void;
45
+ decorate(_editor: LexicalEditor, _config: EditorConfig): ReactElement;
46
+ }
47
+ export declare function $createFileNode(payload: FileNodePayload): FileNode;
48
+ export declare function $isFileNode(node: LexicalNode | null | undefined): node is FileNode;
49
+ //# sourceMappingURL=FileNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileNode.d.ts","sourceRoot":"","sources":["../../src/nodes/FileNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,WAAW,EACX,OAAO,EACP,qBAAqB,EACrB,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAQ1C,OAAO,KAAK,EAAE,iBAAiB,EAAE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AC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,MAAM,CAAC,cAAc,EAAE,mBAAmB,EAAE,CAgB1C;IAEF,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;gBAIhC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO;IAOjF,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,WAAW;IAS7C,SAAS,IAAI,OAAO;IAIpB,QAAQ,IAAI,OAAO;IAInB,WAAW,IAAI,MAAM;IAIrB,SAAS,IAAI,MAAM;IAInB,cAAc,IAAI,MAAM,GAAG,SAAS;IAIpC,MAAM,CAAC,UAAU,CAAC,eAAe,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW;IAShG,UAAU,IAAI,qBAAqB;IAWnC,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,GAAG,YAAY;CAOtE;AAED,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM,GACnB,WAAW,CAEb;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,WAAW,CAExF"}
@@ -2,6 +2,8 @@ export { allNodes, builtinNodes, customNodes } from './config';
2
2
  export { allEditNodes, customEditNodes } from './config-edit';
3
3
  export { getResolvedEditNodes, setResolvedEditNodes } from './node-registry';
4
4
  export { NESTED_EDITOR_NODES } from './nodes/shared';
5
+ export type { FileDisplay, FileNodePayload, SerializedFileNode } from './nodes/FileNode';
6
+ export { $createFileNode, $isFileNode, fileExtFromName, FileNode } from './nodes/FileNode';
5
7
  export type { ImageLayout, ImageNodePayload, SerializedImageNode } from './nodes/ImageNode';
6
8
  export { $createImageNode, $isImageNode, ImageNode, sanitizeImageDisplayWidth, sanitizeImageLayout, } from './nodes/ImageNode';
7
9
  export type { ImageDisplayConvertContext, ImageDisplayFields, ImageDisplayMode, ImageDisplaySize, } from './utils/image-display-size';
@@ -1 +1 @@
1
- {"version":3,"file":"nodes-entry.d.ts","sourceRoot":"","sources":["../src/nodes-entry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAGrD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5F,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,SAAS,EACT,yBAAyB,EACzB,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACV,0BAA0B,EAC1B,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,yBAAyB,EACzB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,uBAAuB,EACvB,oBAAoB,GACrB,MAAM,4BAA4B,CAAC;AAGpC,YAAY,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC3E,YAAY,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAG9E,YAAY,EAAE,mBAAmB,EAAE,s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AU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGtE,YAAY,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGjE,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAG9F,YAAY,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-BOe08y9j.js";
2
- import { A as computeImageDisplayPixels, C as KaTeXBlockNode, D as sanitizeImageLayout, E as ImageNode, F as imageDisplaySizeAfterResize, H as ALERT_LABELS, 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_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-CnNR-Ttt.js";
3
- import { A as BANNER_LABELS, C as CommentNode, S as $isCommentNode, _ as FootnoteSectionNode, b as $createCommentNode, c as RubyNode, d as LinkCardNode, f as $createGridContainerNode, g as $isFootnoteSectionNode, h as $createFootnoteSectionNode, j as BANNER_TYPES, l as $createLinkCardNode, m as GridContainerNode, n as builtinNodes, o as $createRubyNode, p as $isGridContainerNode, r as customNodes, s as $isRubyNode, t as allNodes, u as $isLinkCardNode } from "./config-CwZ9fwU0.js";
4
- import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-C4NKE1Lt.js";
5
- export { $createCommentNode, $createFootnoteSectionNode, $createGridContainerNode, $createImageNode, $createLinkCardNode, $createMentionNode, $createMermaidNode, $createRichQuoteNode, $createRubyNode, $createTagNode, $isCommentNode, $isFootnoteSectionNode, $isGridContainerNode, $isImageNode, $isKaTeXBlockNode, $isKaTeXInlineNode, $isLinkCardNode, $isMentionNode, $isMermaidNode, $isRichQuoteNode, $isRubyNode, $isTagNode, ALERT_LABELS, ALERT_TYPES, BANNER_LABELS, BANNER_TYPES, CommentNode, FootnoteSectionEditNode, FootnoteSectionNode, GridContainerNode, ImageNode, KaTeXBlockNode, KaTeXInlineNode, LinkCardNode, MentionNode, MermaidNode, NESTED_EDITOR_NODES, RichQuoteNode, RubyNode, TagNode, allEditNodes, allNodes, builtinNodes, computeImageDisplayPixels, convertImageDisplaySize, customEditNodes, customNodes, getResolvedEditNodes, imageDisplayCssVars, imageDisplayDataAttr, imageDisplayFieldsFromSize, imageDisplaySizeAfterResize, resolveImageDisplaySize, sanitizeImageDisplayWidth, sanitizeImageFixedPx, sanitizeImageLayout, setResolvedEditNodes };
1
+ import { a as FootnoteSectionEditNode, i as customEditNodes, n as setResolvedEditNodes, r as allEditNodes, t as getResolvedEditNodes } from "./node-registry-BFDycNE-.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-Vu_9D3oG.js";
3
+ import { D as CommentNode, E as $isCommentNode, F as BANNER_TYPES, P as BANNER_LABELS, _ as FootnoteSectionNode, b as FileNode, c as RubyNode, d as LinkCardNode, f as $createGridContainerNode, g as $isFootnoteSectionNode, h as $createFootnoteSectionNode, l as $createLinkCardNode, m as GridContainerNode, n as builtinNodes, o as $createRubyNode, p as $isGridContainerNode, r as customNodes, s as $isRubyNode, t as allNodes, u as $isLinkCardNode, v as $createFileNode, w as $createCommentNode, x as fileExtFromName, y as $isFileNode } from "./config-D8JJ7F11.js";
4
+ import { r as NESTED_EDITOR_NODES } from "./AlertQuoteEditNode-DUvNEyjw.js";
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 };
@@ -0,0 +1,12 @@
1
+ export interface FileUploadResult {
2
+ src: string;
3
+ }
4
+ export type FileUploadFn = (file: File, opts?: {
5
+ onProgress?: (percent: number) => void;
6
+ }) => Promise<FileUploadResult>;
7
+ interface FileUploadPluginProps {
8
+ onUpload: FileUploadFn;
9
+ }
10
+ export declare function FileUploadPlugin({ onUpload }: FileUploadPluginProps): import("react").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=FileUploadPlugin.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,2 @@
1
+ export declare function InlineDndPlugin(): import('react').ReactPortal | null;
2
+ //# sourceMappingURL=InlineDndPlugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineDndPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/InlineDndPlugin.tsx"],"names":[],"mappings":"AA4DA,wBAAgB,eAAe,uCAkG9B"}
@@ -0,0 +1,3 @@
1
+ import { LexicalCommand } from 'lexical';
2
+ export declare const OPEN_FILE_PICKER_COMMAND: LexicalCommand<void>;
3
+ //# sourceMappingURL=file-upload-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload-command.d.ts","sourceRoot":"","sources":["../../src/plugins/file-upload-command.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG9C,eAAO,MAAM,wBAAwB,EAAE,cAAc,CAAC,IAAI,CAEzD,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { LexicalEditor } from 'lexical';
2
+ export interface FileUploadEntry {
3
+ error?: string;
4
+ percent: number;
5
+ remove: () => void;
6
+ retry: () => void;
7
+ status: 'uploading' | 'error';
8
+ }
9
+ export declare function setFileUploadEntry(editor: LexicalEditor, nodeKey: string, entry: FileUploadEntry | null): void;
10
+ export declare function useFileUploadEntry(editor: LexicalEditor, nodeKey: string | undefined): FileUploadEntry | undefined;
11
+ //# sourceMappingURL=file-upload-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-upload-store.d.ts","sourceRoot":"","sources":["../../src/plugins/file-upload-store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,MAAM,WAAW,eAAe;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC;CAC/B;AAkBD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,eAAe,GAAG,IAAI,GAC5B,IAAI,CAQN;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,eAAe,GAAG,SAAS,CAU7B"}
@@ -1,7 +1,7 @@
1
1
  export declare const draggingWrapperClass = "rich-image-upload-dragging";
2
2
  export declare const toastStack: string;
3
3
  export declare const toast: string;
4
- export declare const toastVariant: Record<"info" | "success" | "error", string>;
4
+ export declare const toastVariant: Record<"error" | "info" | "success", string>;
5
5
  export declare const spinner: string;
6
6
  export declare const dialogPopup: string;
7
7
  export declare const dialogHeader: string;
@@ -0,0 +1,4 @@
1
+ export declare const INLINE_DRAG_ATTR = "data-inline-drag";
2
+ export declare const INLINE_DRAG_MIME = "application/x-haklex-inline-node";
3
+ export declare function markInlineDraggable(el: HTMLElement, nodeKey: string): void;
4
+ //# sourceMappingURL=inline-dnd-shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-dnd-shared.d.ts","sourceRoot":"","sources":["../../src/plugins/inline-dnd-shared.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,gBAAgB,qCAAqC,CAAC;AAEnE,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAG1E"}
@@ -0,0 +1,3 @@
1
+ export declare const dropCaret: string;
2
+ export declare const draggingSource: string;
3
+ //# sourceMappingURL=inline-dnd.css.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inline-dnd.css.d.ts","sourceRoot":"","sources":["../../src/plugins/inline-dnd.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS,QAOpB,CAAC;AAEH,eAAO,MAAM,cAAc,QAEzB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export { CorePlugins } from './components/CorePlugins';
2
+ export { FileUploadProvider, useFileUpload } from './context/FileUploadContext';
2
3
  export { type ImagePreprocessContextValue, type ImagePreprocessFn, ImagePreprocessProvider, type ImagePreprocessResult, useImagePreprocess, } from './context/ImagePreprocessContext';
3
4
  export { ImageUploadProvider, useImageUpload } from './context/ImageUploadContext';
4
5
  export { useVideoUpload, VideoUploadProvider } from './context/VideoUploadContext';
@@ -10,10 +11,14 @@ export { BlockIdPlugin } from './plugins/BlockIdPlugin';
10
11
  export { blockIdState } from './plugins/BlockIdPlugin';
11
12
  export { ClickBelowPlugin, registerClickBelowCommand } from './plugins/ClickBelowPlugin';
12
13
  export { EditorRefPlugin } from './plugins/EditorRefPlugin';
14
+ export { type FileUploadEntry, setFileUploadEntry, useFileUploadEntry, } from './plugins/file-upload-store';
15
+ export { type FileUploadFn, FileUploadPlugin, type FileUploadResult, } from './plugins/FileUploadPlugin';
13
16
  export { FootnotePlugin } from './plugins/FootnotePlugin';
14
17
  export { HorizontalRulePlugin } from './plugins/HorizontalRulePlugin';
15
18
  export { ImagePlugin } from './plugins/ImagePlugin';
16
19
  export { defaultImageUpload, type ImageUploadFn, ImageUploadPlugin, type ImageUploadResult, } from './plugins/ImageUploadPlugin';
20
+ export { INLINE_DRAG_ATTR, markInlineDraggable } from './plugins/inline-dnd-shared';
21
+ export { InlineDndPlugin } from './plugins/InlineDndPlugin';
17
22
  export { KaTeXPlugin } from './plugins/KaTeXPlugin';
18
23
  export { LinkFaviconPlugin } from './plugins/LinkFaviconPlugin';
19
24
  export { MarkdownPastePlugin } from './plugins/MarkdownPastePlugin';
@@ -1 +1 @@
1
- {"version":3,"file":"plugins-entry.d.ts","sourceRoot":"","sources":["../src/plugins-entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,iBAAiB,EACtB,uBAAuB,EACvB,KAAK,qBAAqB,EAC1B,kBAAkB,GACnB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,C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AM,6BAA6B,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EACL,KAAK,aAAa,EAClB,iBAAiB,EACjB,KAAK,iBAAiB,GACvB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,4 +1,5 @@
1
- import { A as blockIdState, B as ALL_TRANSFORMERS, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as ImagePreprocessProvider, G as AutoLinkPlugin, H as ClickBelowPlugin, I as useImagePreprocess, L as CorePlugins, M as useVideoUpload, N as ImageUploadProvider, O as defaultImageUpload, P as useImageUpload, R as MarkdownShortcutsPlugin, U as registerClickBelowCommand, V as HorizontalRulePlugin, W as BlockExitPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as VideoUploadProvider, k as BlockIdPlugin, n as OnChangePlugin, o as VideoUploadPlugin, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, z as MarkdownPastePlugin } from "./SubmitShortcutPlugin-DQLW3pPC.js";
2
- import { o as PasteLinkPlugin } from "./AlertQuoteEditNode-C4NKE1Lt.js";
3
- import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-BOP4CFU_.js";
4
- export { ALL_TRANSFORMERS, AlertPlugin, AutoFocusPlugin, AutoLinkPlugin, BlockExitPlugin, BlockIdPlugin, ClickBelowPlugin, CorePlugins, EditorRefPlugin, FootnotePlugin, HorizontalRulePlugin, ImagePlugin, ImagePreprocessProvider, ImageUploadPlugin, ImageUploadProvider, KaTeXPlugin, LinkFaviconPlugin, MarkdownPastePlugin, MarkdownShortcutsPlugin, MermaidPlugin, OnChangePlugin, PasteLinkPlugin, SubmitShortcutPlugin, TextSelectionPlugin, VideoUploadPlugin, VideoUploadProvider, blockIdState, defaultImageUpload, registerClickBelowCommand, useImagePreprocess, useImageUpload, useVideoUpload };
1
+ import { A as setFileUploadEntry, B as FileUploadProvider, D as ImageUploadPlugin, E as LinkFaviconPlugin, F as useVideoUpload, G as ALL_TRANSFORMERS, H as CorePlugins, I as ImageUploadProvider, J as ClickBelowPlugin, K as InlineDndPlugin, L as useImageUpload, M as BlockIdPlugin, N as blockIdState, O as defaultImageUpload, P as VideoUploadProvider, R as ImagePreprocessProvider, U as MarkdownShortcutsPlugin, V as useFileUpload, W as MarkdownPastePlugin, X as BlockExitPlugin, Y as registerClickBelowCommand, Z as AutoLinkPlugin, a as AutoFocusPlugin, i as EditorRefPlugin, j as useFileUploadEntry, k as FileUploadPlugin, n as OnChangePlugin, o as VideoUploadPlugin, q as HorizontalRulePlugin, r as FootnotePlugin, s as TextSelectionPlugin, t as SubmitShortcutPlugin, z as useImagePreprocess } from "./SubmitShortcutPlugin-DuKGB15Q.js";
2
+ import { Q as INLINE_DRAG_ATTR, et as markInlineDraggable } from "./theme-Vu_9D3oG.js";
3
+ import { o as PasteLinkPlugin } from "./AlertQuoteEditNode-DUvNEyjw.js";
4
+ import { a as KaTeXPlugin, c as AlertPlugin, n as MermaidPlugin, s as ImagePlugin } from "./MermaidPlugin-DgIAgFH8.js";
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, setFileUploadEntry, useFileUpload, useFileUploadEntry, useImagePreprocess, useImageUpload, useVideoUpload };
@@ -1,6 +1,8 @@
1
1
  export type { AlertRendererProps } from './components/renderers/AlertRenderer';
2
2
  export type { BannerRendererProps } from './components/renderers/BannerRenderer';
3
3
  export type { CodeBlockRendererProps } from './components/renderers/CodeBlockRenderer';
4
+ export type { FileRendererProps } from './components/renderers/FileRenderer';
5
+ export { fileExtension, fileMetaText, FileRenderer, formatFileSize, } from './components/renderers/FileRenderer';
4
6
  export type { FootnoteRendererProps } from './components/renderers/FootnoteRenderer';
5
7
  export { FootnoteRenderer } from './components/renderers/FootnoteRenderer';
6
8
  export type { FootnoteSectionRendererProps } from './components/renderers/FootnoteSectionRenderer';
@@ -18,6 +20,6 @@ export { RubyRenderer } from './components/renderers/RubyRenderer';
18
20
  export type { VideoRendererProps } from './components/renderers/VideoRenderer';
19
21
  export type { RendererKey } from './components/RendererWrapper';
20
22
  export { createRendererDecoration, RendererWrapper } from './components/RendererWrapper';
21
- export { ALERT_NODE_KEY, BANNER_NODE_KEY, CODE_BLOCK_NODE_KEY, FOOTNOTE_NODE_KEY, FOOTNOTE_SECTION_NODE_KEY, IMAGE_NODE_KEY, KATEX_NODE_KEY, LINK_CARD_NODE_KEY, MENTION_NODE_KEY, MERMAID_NODE_KEY, RUBY_NODE_KEY, TAG_NODE_KEY, VIDEO_NODE_KEY, } from './types/renderer-keys';
23
+ export { ALERT_NODE_KEY, BANNER_NODE_KEY, CODE_BLOCK_NODE_KEY, FILE_NODE_KEY, FOOTNOTE_NODE_KEY, FOOTNOTE_SECTION_NODE_KEY, IMAGE_NODE_KEY, KATEX_NODE_KEY, LINK_CARD_NODE_KEY, MENTION_NODE_KEY, MERMAID_NODE_KEY, RUBY_NODE_KEY, TAG_NODE_KEY, VIDEO_NODE_KEY, } from './types/renderer-keys';
22
24
  export { computeImageMeta, decodeThumbHash } from './utils/thumbhash';
23
25
  //# sourceMappingURL=renderers-entry.d.ts.map