markdown-wysiwyg-editor 0.2.4 → 0.2.6

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 (79) hide show
  1. package/README.md +143 -67
  2. package/dist/components/EditorChrome.d.ts +25 -0
  3. package/dist/components/EditorChrome.d.ts.map +1 -0
  4. package/dist/components/EmojiPicker.d.ts +1 -1
  5. package/dist/components/EmojiPicker.d.ts.map +1 -1
  6. package/dist/components/ImagePicker.d.ts +1 -1
  7. package/dist/components/ImagePicker.d.ts.map +1 -1
  8. package/dist/components/LinkContextMenu.d.ts +8 -1
  9. package/dist/components/LinkContextMenu.d.ts.map +1 -1
  10. package/dist/components/MarkdownEditor.d.ts +2 -2
  11. package/dist/components/MarkdownEditor.d.ts.map +1 -1
  12. package/dist/components/MarkdownSyntaxStatus.d.ts +2 -2
  13. package/dist/components/MarkdownToolbar.d.ts +7 -2
  14. package/dist/components/MarkdownToolbar.d.ts.map +1 -1
  15. package/dist/components/TableContextMenu.d.ts +4 -1
  16. package/dist/components/TableEdgeControls.d.ts +3 -2
  17. package/dist/components/TableToolbar.d.ts +3 -2
  18. package/dist/components/toolbar/DownloadMenu.d.ts +13 -0
  19. package/dist/components/toolbar/DownloadMenu.d.ts.map +1 -0
  20. package/dist/components/toolbar/HeadingMenu.d.ts +13 -0
  21. package/dist/components/toolbar/HeadingMenu.d.ts.map +1 -0
  22. package/dist/components/toolbar/LinkModal.d.ts +12 -0
  23. package/dist/components/toolbar/LinkModal.d.ts.map +1 -0
  24. package/dist/components/toolbar/ToolbarButton.d.ts +11 -0
  25. package/dist/components/toolbar/ToolbarButton.d.ts.map +1 -0
  26. package/dist/components/ui/icons.d.ts +30 -0
  27. package/dist/components/ui/icons.d.ts.map +1 -0
  28. package/dist/constants/emojiData.d.ts +1 -1
  29. package/dist/converters/JsonToMarkdownConverter.d.ts +5 -2
  30. package/dist/converters/JsonToMarkdownConverter.d.ts.map +1 -1
  31. package/dist/converters/MarkdownTipTapConverter.d.ts +13 -7
  32. package/dist/converters/MarkdownTipTapConverter.d.ts.map +1 -1
  33. package/dist/converters/markdown/BlockExtractor.d.ts +20 -0
  34. package/dist/converters/markdown/BlockExtractor.d.ts.map +1 -0
  35. package/dist/converters/markdown/BlockParser.d.ts +9 -0
  36. package/dist/converters/markdown/BlockParser.d.ts.map +1 -0
  37. package/dist/converters/markdown/InlineParser.d.ts +10 -0
  38. package/dist/converters/markdown/InlineParser.d.ts.map +1 -0
  39. package/dist/extensions/CodeBlockNodeView/IconButton.d.ts +9 -0
  40. package/dist/extensions/CodeBlockNodeView/IconButton.d.ts.map +1 -0
  41. package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts +12 -0
  42. package/dist/extensions/CodeBlockNodeView/MermaidCodeBlockView.d.ts.map +1 -0
  43. package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts +10 -0
  44. package/dist/extensions/CodeBlockNodeView/RegularCodeBlockView.d.ts.map +1 -0
  45. package/dist/extensions/CodeBlockNodeView/constants.d.ts +5 -0
  46. package/dist/extensions/CodeBlockNodeView/constants.d.ts.map +1 -0
  47. package/dist/extensions/CodeBlockNodeView.d.ts +1 -1
  48. package/dist/extensions/CodeBlockNodeView.d.ts.map +1 -1
  49. package/dist/extensions/CustomCodeBlock.d.ts +1 -1
  50. package/dist/extensions/LinkClickExtension.d.ts +3 -1
  51. package/dist/extensions/LinkClickExtension.d.ts.map +1 -1
  52. package/dist/extensions/TableRightClickExtension.d.ts +1 -1
  53. package/dist/extensions/mermaidRegistry.d.ts +2 -2
  54. package/dist/hooks/useEditorContextMenus.d.ts +34 -0
  55. package/dist/hooks/useEditorContextMenus.d.ts.map +1 -0
  56. package/dist/hooks/useEditorState.d.ts +3 -3
  57. package/dist/hooks/useMarkdownEditor.d.ts +4 -2
  58. package/dist/hooks/useMarkdownEditor.d.ts.map +1 -1
  59. package/dist/hooks/useMarkdownInsertion.d.ts +11 -0
  60. package/dist/hooks/useMarkdownInsertion.d.ts.map +1 -0
  61. package/dist/hooks/useTableToolbar.d.ts +1 -1
  62. package/dist/i18n/I18nContext.d.ts +1 -1
  63. package/dist/index.css +704 -1
  64. package/dist/index.d.ts +4 -0
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +33640 -27167
  67. package/dist/index.js.map +150 -1
  68. package/dist/lib/utils.d.ts +8 -0
  69. package/dist/lib/utils.d.ts.map +1 -0
  70. package/dist/setupTests.d.ts +2 -0
  71. package/dist/setupTests.d.ts.map +1 -0
  72. package/dist/theme.css +96 -0
  73. package/dist/types/editor.d.ts +1 -1
  74. package/dist/types/index.d.ts +1 -1
  75. package/dist/utils/pasteHandler.d.ts +2 -2
  76. package/dist/utils/pasteHandler.d.ts.map +1 -1
  77. package/dist/utils/selectionUtils.d.ts +2 -3
  78. package/dist/utils/selectionUtils.d.ts.map +1 -1
  79. package/package.json +40 -16
@@ -0,0 +1,20 @@
1
+ export interface TableData {
2
+ headers: string[];
3
+ rows: string[][];
4
+ }
5
+ export declare class BlockExtractor {
6
+ private constructor();
7
+ static extractCodeBlocks(markdown: string): {
8
+ text: string;
9
+ blocks: Map<string, {
10
+ language: string;
11
+ code: string;
12
+ }>;
13
+ };
14
+ static extractTables(markdown: string): {
15
+ text: string;
16
+ tables: Map<string, TableData>;
17
+ };
18
+ private static parseTableLines;
19
+ }
20
+ //# sourceMappingURL=BlockExtractor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockExtractor.d.ts","sourceRoot":"","sources":["../../../src/converters/markdown/BlockExtractor.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC;CAClB;AAED,qBAAa,cAAc;IACzB,OAAO;IAIP,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG;QAC1C,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE;YAAE,QAAQ,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACzD;IA2CD,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG;QACtC,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;KAChC;IAgDD,OAAO,CAAC,MAAM,CAAC,eAAe;CAqC/B"}
@@ -0,0 +1,9 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ import { type MarkdownToTipTapOptions } from './InlineParser';
3
+ export declare class BlockParser {
4
+ private constructor();
5
+ private static getIndentLength;
6
+ private static parseListAt;
7
+ static parseBlocks(markdown: string, options?: MarkdownToTipTapOptions): JSONContent[];
8
+ }
9
+ //# sourceMappingURL=BlockParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockParser.d.ts","sourceRoot":"","sources":["../../../src/converters/markdown/BlockParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAgB,KAAK,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE5E,qBAAa,WAAW;IACtB,OAAO;IAIP,OAAO,CAAC,MAAM,CAAC,eAAe;IAiB9B,OAAO,CAAC,MAAM,CAAC,WAAW;IA4H1B,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,EAAE;CAoGvF"}
@@ -0,0 +1,10 @@
1
+ import type { JSONContent } from '@tiptap/core';
2
+ export interface MarkdownToTipTapOptions {
3
+ publicImagePathPrefix?: string;
4
+ }
5
+ export declare class InlineParser {
6
+ private constructor();
7
+ static parseInline(text: string, options?: MarkdownToTipTapOptions): JSONContent[];
8
+ private static convertToNodes;
9
+ }
10
+ //# sourceMappingURL=InlineParser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineParser.d.ts","sourceRoot":"","sources":["../../../src/converters/markdown/InlineParser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIhD,MAAM,WAAW,uBAAuB;IACtC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,qBAAa,YAAY;IACvB,OAAO;IAIP,MAAM,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,uBAAuB,GAAG,WAAW,EAAE;IAoDlF,OAAO,CAAC,MAAM,CAAC,cAAc;CAqH9B"}
@@ -0,0 +1,9 @@
1
+ import type React from 'react';
2
+ interface IconButtonProps {
3
+ onClick: (e: React.MouseEvent) => void;
4
+ title: string;
5
+ children: React.ReactNode;
6
+ }
7
+ export declare const IconButton: ({ onClick, title, children }: IconButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=IconButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../../src/extensions/CodeBlockNodeView/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,eAAe;IACvB,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,GAAI,8BAA8B,eAAe,4CASvE,CAAC"}
@@ -0,0 +1,12 @@
1
+ interface MermaidCodeBlockViewProps {
2
+ code: string;
3
+ selected: boolean;
4
+ editable: boolean;
5
+ updateAttributes: (attrs: Record<string, unknown>) => void;
6
+ deleteNode: () => void;
7
+ mermaidLib: typeof import('mermaid').default;
8
+ mermaidLibVersion: number;
9
+ }
10
+ export declare const MermaidCodeBlockView: ({ code, selected, editable, updateAttributes, deleteNode, mermaidLib, mermaidLibVersion, }: MermaidCodeBlockViewProps) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=MermaidCodeBlockView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MermaidCodeBlockView.d.ts","sourceRoot":"","sources":["../../../src/extensions/CodeBlockNodeView/MermaidCodeBlockView.tsx"],"names":[],"mappings":"AAUA,UAAU,yBAAyB;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,UAAU,EAAE,cAAc,SAAS,EAAE,OAAO,CAAC;IAC7C,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,oBAAoB,GAAI,4FAQlC,yBAAyB,4CA0R3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ interface RegularCodeBlockViewProps {
2
+ language: string;
3
+ selected: boolean;
4
+ editable: boolean;
5
+ updateAttributes: (attrs: Record<string, unknown>) => void;
6
+ deleteNode: () => void;
7
+ }
8
+ export declare const RegularCodeBlockView: ({ language, selected, editable, updateAttributes, deleteNode, }: RegularCodeBlockViewProps) => import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=RegularCodeBlockView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RegularCodeBlockView.d.ts","sourceRoot":"","sources":["../../../src/extensions/CodeBlockNodeView/RegularCodeBlockView.tsx"],"names":[],"mappings":"AASA,UAAU,yBAAyB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;IAC3D,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,oBAAoB,GAAI,iEAMlC,yBAAyB,4CAmD3B,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const SUPPORTED_LANGUAGES: {
2
+ value: string;
3
+ label: string;
4
+ }[];
5
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/extensions/CodeBlockNodeView/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;GAsB/B,CAAC"}
@@ -1,3 +1,3 @@
1
- import { NodeViewProps } from '@tiptap/core';
1
+ import type { NodeViewProps } from '@tiptap/core';
2
2
  export declare const CodeBlockNodeView: ({ node, selected, editor, updateAttributes, deleteNode, }: NodeViewProps) => import("react/jsx-runtime").JSX.Element;
3
3
  //# sourceMappingURL=CodeBlockNodeView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CodeBlockNodeView.d.ts","sourceRoot":"","sources":["../../src/extensions/CodeBlockNodeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAuElD,eAAO,MAAM,iBAAiB,GAAI,2DAM/B,aAAa,4CAuCf,CAAC"}
1
+ {"version":3,"file":"CodeBlockNodeView.d.ts","sourceRoot":"","sources":["../../src/extensions/CodeBlockNodeView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAyBlD,eAAO,MAAM,iBAAiB,GAAI,2DAM/B,aAAa,4CAqCf,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const CustomCodeBlock: import('@tiptap/core').Node<import('@tiptap/extension-code-block-lowlight').CodeBlockLowlightOptions, any>;
1
+ export declare const CustomCodeBlock: import("@tiptap/core").Node<import("@tiptap/extension-code-block-lowlight").CodeBlockLowlightOptions, any>;
2
2
  //# sourceMappingURL=CustomCodeBlock.d.ts.map
@@ -1,7 +1,9 @@
1
1
  import { Extension } from '@tiptap/core';
2
- import { default as React } from 'react';
2
+ import type React from 'react';
3
3
  export declare const createLinkClickExtension: (handleContextMenu: (event: React.MouseEvent, linkData: {
4
4
  href: string;
5
5
  text: string;
6
+ from: number;
7
+ to: number;
6
8
  }) => void) => Extension<any, any>;
7
9
  //# sourceMappingURL=LinkClickExtension.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkClickExtension.d.ts","sourceRoot":"","sources":["../../src/extensions/LinkClickExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,wBAAwB,GACnC,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,EAAE,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,KAAK,IAAI,wBA2D5F,CAAC"}
1
+ {"version":3,"file":"LinkClickExtension.d.ts","sourceRoot":"","sources":["../../src/extensions/LinkClickExtension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAgB,MAAM,cAAc,CAAC;AAEvD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,eAAO,MAAM,wBAAwB,GACnC,mBAAmB,CACjB,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,KAC/D,IAAI,wBA0FP,CAAC"}
@@ -1,4 +1,4 @@
1
1
  import { Extension } from '@tiptap/core';
2
- import { default as React } from 'react';
2
+ import type React from 'react';
3
3
  export declare const createTableRightClickExtension: (handleContextMenu: (event: React.MouseEvent) => void) => Extension<any, any>;
4
4
  //# sourceMappingURL=TableRightClickExtension.d.ts.map
@@ -1,5 +1,5 @@
1
- export declare const setMermaidLib: (lib: typeof import('mermaid').default | null) => void;
2
- export declare const getMermaidLib: () => import('mermaid').Mermaid | null;
1
+ export declare const setMermaidLib: (lib: typeof import("mermaid").default | null) => void;
2
+ export declare const getMermaidLib: () => import("mermaid").Mermaid | null;
3
3
  export declare const getMermaidLibVersion: () => number;
4
4
  export declare const subscribeMermaidLib: (listener: () => void) => () => void;
5
5
  //# sourceMappingURL=mermaidRegistry.d.ts.map
@@ -0,0 +1,34 @@
1
+ export interface LinkContextMenuState {
2
+ visible: boolean;
3
+ position: {
4
+ x: number;
5
+ y: number;
6
+ };
7
+ linkData: {
8
+ href: string;
9
+ text: string;
10
+ from: number;
11
+ to: number;
12
+ } | null;
13
+ }
14
+ export interface TableContextMenuState {
15
+ visible: boolean;
16
+ position: {
17
+ x: number;
18
+ y: number;
19
+ };
20
+ }
21
+ export declare const useEditorContextMenus: () => {
22
+ linkContextMenu: LinkContextMenuState;
23
+ tableContextMenu: TableContextMenuState;
24
+ handleLinkContextMenu: (event: React.MouseEvent, linkData: {
25
+ href: string;
26
+ text: string;
27
+ from: number;
28
+ to: number;
29
+ }) => void;
30
+ handleTableContextMenu: (event: React.MouseEvent) => void;
31
+ handleCloseLinkContextMenu: () => void;
32
+ handleCloseTableContextMenu: () => void;
33
+ };
34
+ //# sourceMappingURL=useEditorContextMenus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditorContextMenus.d.ts","sourceRoot":"","sources":["../../src/hooks/useEditorContextMenus.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3E;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC;AAED,eAAO,MAAM,qBAAqB;;;mCAcrB,KAAK,CAAC,UAAU,YACb;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE;oCAcnB,KAAK,CAAC,UAAU;;;CA2DpE,CAAC"}
@@ -4,11 +4,11 @@ interface ProcessingProgress {
4
4
  }
5
5
  export declare const useEditorState: () => {
6
6
  readonly isUpdating: boolean;
7
- readonly setIsUpdating: import('react').Dispatch<import('react').SetStateAction<boolean>>;
7
+ readonly setIsUpdating: import("react").Dispatch<import("react").SetStateAction<boolean>>;
8
8
  readonly isProcessing: boolean;
9
- readonly setIsProcessing: import('react').Dispatch<import('react').SetStateAction<boolean>>;
9
+ readonly setIsProcessing: import("react").Dispatch<import("react").SetStateAction<boolean>>;
10
10
  readonly processingProgress: ProcessingProgress;
11
- readonly setProcessingProgress: import('react').Dispatch<import('react').SetStateAction<ProcessingProgress>>;
11
+ readonly setProcessingProgress: import("react").Dispatch<import("react").SetStateAction<ProcessingProgress>>;
12
12
  };
13
13
  export {};
14
14
  //# sourceMappingURL=useEditorState.d.ts.map
@@ -1,5 +1,5 @@
1
- import { Editor, JSONContent } from '@tiptap/react';
2
- import { ISelectionInfo } from '../utils/selectionUtils';
1
+ import { type Editor, type JSONContent } from '@tiptap/react';
2
+ import { type ISelectionInfo } from '../utils/selectionUtils';
3
3
  interface UseMarkdownEditorProps {
4
4
  value?: string;
5
5
  initialContent?: string;
@@ -23,6 +23,8 @@ interface UseMarkdownEditorProps {
23
23
  handleLinkContextMenu: (event: React.MouseEvent, linkData: {
24
24
  href: string;
25
25
  text: string;
26
+ from: number;
27
+ to: number;
26
28
  }) => void;
27
29
  handleTableContextMenu: (event: React.MouseEvent) => void;
28
30
  }
@@ -1 +1 @@
1
- {"version":3,"file":"useMarkdownEditor.d.ts","sourceRoot":"","sources":["../../src/hooks/useMarkdownEditor.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAa,MAAM,eAAe,CAAC;AAYzE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAC;AAI9E,UAAU,sBAAsB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IACxD,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,qBAAqB,EAAE,CAAC,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,KACrC,IAAI,CAAC;IACV,sBAAsB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC3D;AAKD,eAAO,MAAM,iBAAiB,GAAI,wSAmB/B,sBAAsB,WAuJxB,CAAC"}
1
+ {"version":3,"file":"useMarkdownEditor.d.ts","sourceRoot":"","sources":["../../src/hooks/useMarkdownEditor.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,WAAW,EAAa,MAAM,eAAe,CAAC;AAczE,OAAO,EAAE,KAAK,cAAc,EAAkB,MAAM,yBAAyB,CAAC;AAI9E,UAAU,sBAAsB;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IACjD,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,cAAc,KAAK,IAAI,CAAC;IACxD,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,UAAU,EAAE,OAAO,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,eAAe,EAAE,CAAC,YAAY,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,qBAAqB,EAAE,CAAC,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;IAChF,gBAAgB,EAAE,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,KAAK,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CACrB,KAAK,EAAE,KAAK,CAAC,UAAU,EACvB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,KAC/D,IAAI,CAAC;IACV,sBAAsB,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,KAAK,IAAI,CAAC;CAC3D;AAKD,eAAO,MAAM,iBAAiB,GAAI,wSAmB/B,sBAAsB,WA2JxB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ExtendedEditor } from '../types/editor';
2
+ interface UseMarkdownInsertionOptions {
3
+ editor: ExtendedEditor | null;
4
+ publicImagePathPrefix?: string;
5
+ setIsUpdating: (value: boolean) => void;
6
+ }
7
+ export declare const useMarkdownInsertion: ({ editor, publicImagePathPrefix, setIsUpdating, }: UseMarkdownInsertionOptions) => {
8
+ handleInsertMarkdown: (markdown: string, cursorOffset?: number) => Promise<void>;
9
+ };
10
+ export {};
11
+ //# sourceMappingURL=useMarkdownInsertion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMarkdownInsertion.d.ts","sourceRoot":"","sources":["../../src/hooks/useMarkdownInsertion.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMtD,UAAU,2BAA2B;IACnC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;IAC9B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,aAAa,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,oBAAoB,GAAI,mDAIlC,2BAA2B;qCAkBT,MAAM,iBAAiB,MAAM;CAuQjD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Editor } from '@tiptap/react';
1
+ import type { Editor } from '@tiptap/react';
2
2
  export declare const useTableToolbar: (editor: Editor | null) => {
3
3
  visible: boolean;
4
4
  position: {
@@ -1,4 +1,4 @@
1
- import { default as React } from 'react';
1
+ import React from 'react';
2
2
  export type Translator = (key: string, fallback?: string) => string;
3
3
  export declare const defaultT: Translator;
4
4
  type I18nContextValue = {