@halo-dev/richtext-editor 2.16.0 → 2.17.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 (60) hide show
  1. package/dist/components/EditorBubbleMenu.vue.d.ts +1 -1
  2. package/dist/components/bubble/BubbleItem.vue.d.ts +3 -3
  3. package/dist/components/bubble/BubbleMenuPlugin.d.ts +1 -1
  4. package/dist/components/index.d.ts +1 -1
  5. package/dist/components/toolbar/ToolbarItem.vue.d.ts +4 -4
  6. package/dist/components/toolbar/ToolbarSubItem.vue.d.ts +2 -2
  7. package/dist/components/toolbox/ToolboxItem.vue.d.ts +2 -2
  8. package/dist/extensions/audio/AudioView.vue.d.ts +1 -1
  9. package/dist/extensions/audio/index.d.ts +1 -1
  10. package/dist/extensions/blockquote/index.d.ts +1 -1
  11. package/dist/extensions/bold/index.d.ts +1 -1
  12. package/dist/extensions/bullet-list/index.d.ts +1 -1
  13. package/dist/extensions/code/index.d.ts +1 -1
  14. package/dist/extensions/code-block/CodeBlockViewRenderer.vue.d.ts +1 -1
  15. package/dist/extensions/color/ColorToolbarItem.vue.d.ts +3 -3
  16. package/dist/extensions/columns/index.d.ts +1 -1
  17. package/dist/extensions/commands-menu/CommandsView.vue.d.ts +1 -1
  18. package/dist/extensions/draggable/index.d.ts +1 -1
  19. package/dist/extensions/gap-cursor/gap-cursor-selection.d.ts +45 -0
  20. package/dist/extensions/gap-cursor/index.d.ts +42 -0
  21. package/dist/extensions/heading/index.d.ts +1 -1
  22. package/dist/extensions/highlight/HighlightToolbarItem.vue.d.ts +3 -3
  23. package/dist/extensions/highlight/index.d.ts +1 -1
  24. package/dist/extensions/history/index.d.ts +1 -1
  25. package/dist/extensions/iframe/IframeView.vue.d.ts +1 -1
  26. package/dist/extensions/iframe/index.d.ts +1 -1
  27. package/dist/extensions/image/ImageView.vue.d.ts +1 -1
  28. package/dist/extensions/image/index.d.ts +1 -1
  29. package/dist/extensions/indent/index.d.ts +1 -1
  30. package/dist/extensions/index.d.ts +34 -33
  31. package/dist/extensions/italic/index.d.ts +1 -1
  32. package/dist/extensions/link/LinkBubbleButton.vue.d.ts +1 -1
  33. package/dist/extensions/link/index.d.ts +1 -1
  34. package/dist/extensions/ordered-list/index.d.ts +1 -1
  35. package/dist/extensions/paragraph/index.d.ts +4 -1
  36. package/dist/extensions/range-selection/index.d.ts +23 -0
  37. package/dist/extensions/range-selection/range-selection.d.ts +65 -0
  38. package/dist/extensions/search-and-replace/SearchAndReplace.vue.d.ts +1 -1
  39. package/dist/extensions/strike/index.d.ts +1 -1
  40. package/dist/extensions/subscript/index.d.ts +1 -1
  41. package/dist/extensions/superscript/index.d.ts +1 -1
  42. package/dist/extensions/table/index.d.ts +1 -1
  43. package/dist/extensions/table/util.d.ts +1 -1
  44. package/dist/extensions/task-list/index.d.ts +1 -1
  45. package/dist/extensions/text-align/index.d.ts +1 -1
  46. package/dist/extensions/underline/index.d.ts +1 -1
  47. package/dist/extensions/video/VideoView.vue.d.ts +1 -1
  48. package/dist/extensions/video/index.d.ts +1 -1
  49. package/dist/index.d.ts +2 -2
  50. package/dist/rich-text-editor.es.js +27608 -26880
  51. package/dist/rich-text-editor.iife.js +57 -57
  52. package/dist/style.css +5 -5
  53. package/dist/tiptap/index.d.ts +4 -4
  54. package/dist/tiptap/pm/index.d.ts +3 -3
  55. package/dist/types/index.d.ts +1 -1
  56. package/dist/utils/delete-node.d.ts +2 -0
  57. package/dist/utils/index.d.ts +1 -1
  58. package/dist/utils/is-allowed-uri.d.ts +1 -0
  59. package/dist/utils/isNodeEmpty.d.ts +5 -0
  60. package/package.json +1 -2
@@ -1,5 +1,5 @@
1
- import { PropType } from 'vue';
2
1
  import { Editor } from '../tiptap/vue-3';
2
+ import { PropType } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<{
5
5
  editor: {
@@ -44,15 +44,15 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
44
44
  icon: undefined;
45
45
  iconStyle: undefined;
46
46
  }>>>, {
47
- title: string;
48
- visible: ({ editor }: {
47
+ isActive: ({ editor }: {
49
48
  editor: Editor;
50
49
  }) => boolean;
51
- isActive: ({ editor }: {
50
+ visible: ({ editor }: {
52
51
  editor: Editor;
53
52
  }) => boolean;
54
53
  icon: Component;
55
54
  iconStyle: string;
55
+ title: string;
56
56
  action: ({ editor }: {
57
57
  editor: Editor;
58
58
  }) => Component | void;
@@ -1,5 +1,5 @@
1
+ import { EditorView, EditorState, Plugin, PluginKey } from '../../tiptap/pm';
1
2
  import { Editor } from '../../tiptap/vue-3';
2
- import { EditorState, Plugin, PluginKey, EditorView } from '../../tiptap/pm';
3
3
  import { Instance, Props } from 'tippy.js';
4
4
 
5
5
  export interface TippyOptionProps extends Props {
@@ -3,5 +3,5 @@ export * from './bubble';
3
3
  export * from './toolbar';
4
4
  export * from './toolbox';
5
5
  export { default as RichTextEditor } from './Editor.vue';
6
- export * from './EditorHeader.vue';
7
6
  export * from './EditorBubbleMenu.vue';
7
+ export * from './EditorHeader.vue';
@@ -1,5 +1,5 @@
1
- import { Component } from 'vue';
2
1
  import { ToolbarItem } from '../../types';
2
+ import { Component } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
5
  isActive?: boolean | undefined;
@@ -30,12 +30,12 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
30
30
  icon: undefined;
31
31
  children: undefined;
32
32
  }>>>, {
33
- disabled: boolean;
34
- title: string;
35
- children: ToolbarItem[];
36
33
  isActive: boolean;
37
34
  icon: Component;
35
+ title: string;
38
36
  action: () => void;
37
+ disabled: boolean;
38
+ children: ToolbarItem[];
39
39
  }, {}>;
40
40
  export default _default;
41
41
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -25,11 +25,11 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
25
25
  action: undefined;
26
26
  icon: undefined;
27
27
  }>>>, {
28
- disabled: boolean;
29
- title: string;
30
28
  isActive: boolean;
31
29
  icon: Component;
30
+ title: string;
32
31
  action: () => void;
32
+ disabled: boolean;
33
33
  }, {}>;
34
34
  export default _default;
35
35
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,5 +1,5 @@
1
- import { Component } from 'vue';
2
1
  import { Editor } from '../../tiptap/vue-3';
2
+ import { Component } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
5
  editor?: Editor | undefined;
@@ -27,8 +27,8 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
27
27
  icon: undefined;
28
28
  }>>>, {
29
29
  editor: Editor;
30
- title: string;
31
30
  icon: Component;
31
+ title: string;
32
32
  action: () => void;
33
33
  description: string;
34
34
  }, {}>;
@@ -1,4 +1,4 @@
1
- import { Node as ProseMirrorNode, Decoration } from '../../tiptap/pm';
1
+ import { Decoration, Node as ProseMirrorNode } from '../../tiptap/pm';
2
2
  import { Editor, Node } from '../../tiptap/vue-3';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
@@ -1,5 +1,5 @@
1
- import { ExtensionOptions } from '../../types';
2
1
  import { Node } from '../../tiptap/vue-3';
2
+ import { ExtensionOptions } from '../../types';
3
3
 
4
4
  declare module "@/tiptap" {
5
5
  interface Commands<ReturnType> {
@@ -1,5 +1,5 @@
1
- import { BlockquoteOptions } from '@tiptap/extension-blockquote';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { BlockquoteOptions } from '@tiptap/extension-blockquote';
3
3
 
4
4
  declare const Blockquote: import('../../tiptap/vue-3').Node<ExtensionOptions & BlockquoteOptions, any>;
5
5
  export default Blockquote;
@@ -1,5 +1,5 @@
1
- import { BoldOptions } from '@tiptap/extension-bold';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { BoldOptions } from '@tiptap/extension-bold';
3
3
 
4
4
  declare const Bold: import('../../tiptap/vue-3').Mark<ExtensionOptions & BoldOptions, any>;
5
5
  export default Bold;
@@ -1,5 +1,5 @@
1
- import { BulletListOptions } from '@tiptap/extension-bullet-list';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { BulletListOptions } from '@tiptap/extension-bullet-list';
3
3
 
4
4
  declare const BulletList: import('../../tiptap/vue-3').Node<ExtensionOptions & BulletListOptions, any>;
5
5
  export default BulletList;
@@ -1,5 +1,5 @@
1
- import { CodeOptions } from '@tiptap/extension-code';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { CodeOptions } from '@tiptap/extension-code';
3
3
 
4
4
  declare const Code: import('../../tiptap/vue-3').Mark<ExtensionOptions & CodeOptions, any>;
5
5
  export default Code;
@@ -1,4 +1,4 @@
1
- import { Node as ProseMirrorNode, Decoration } from '../../tiptap/pm';
1
+ import { Decoration, Node as ProseMirrorNode } from '../../tiptap/pm';
2
2
  import { Editor, Node } from '../../tiptap/vue-3';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
@@ -1,5 +1,5 @@
1
- import { Component } from 'vue';
2
1
  import { Editor } from '../../tiptap/vue-3';
2
+ import { Component } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
5
  editor?: Editor | undefined;
@@ -31,11 +31,11 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
31
31
  icon: undefined;
32
32
  }>>>, {
33
33
  editor: Editor;
34
- disabled: boolean;
35
- title: string;
36
34
  isActive: boolean;
37
35
  icon: Component;
36
+ title: string;
38
37
  action: () => void;
38
+ disabled: boolean;
39
39
  }, {}>;
40
40
  export default _default;
41
41
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,2 +1,2 @@
1
- export { default as ExtensionColumns } from './columns';
2
1
  export { default as ExtensionColumn } from './column';
2
+ export { default as ExtensionColumns } from './columns';
@@ -1,5 +1,5 @@
1
- import { PropType } from 'vue';
2
1
  import { CommandMenuItem } from '../../types';
2
+ import { PropType } from 'vue';
3
3
 
4
4
  declare function onKeyDown({ event }: {
5
5
  event: KeyboardEvent;
@@ -1,5 +1,5 @@
1
+ import { EditorView, Node, ResolvedPos } from '../../tiptap/pm';
1
2
  import { Extension } from '../../tiptap/vue-3';
2
- import { Node, ResolvedPos, EditorView } from '../../tiptap/pm';
3
3
 
4
4
  export interface ActiveNode {
5
5
  $pos: ResolvedPos;
@@ -0,0 +1,45 @@
1
+ import { PMNode } from '../../tiptap';
2
+ import { ResolvedPos, Selection, Slice, Mappable } from '../../tiptap/pm';
3
+
4
+ declare class GapCursorSelection extends Selection {
5
+ private start;
6
+ constructor($pos: ResolvedPos);
7
+ map(doc: PMNode, mapping: Mappable): Selection;
8
+ content(): Slice;
9
+ eq(other: Selection): boolean;
10
+ toJSON(): any;
11
+ get isStart(): boolean | null;
12
+ static fromJSON(doc: PMNode, json: any): GapCursorSelection;
13
+ getBookmark(): GapBookmark;
14
+ /**
15
+ * Validates if a GapCursor can be placed at the given position
16
+ *
17
+ * This function checks whether a GapCursor can be placed at the specified position in the document.
18
+ * It ensures that the position is not within a text block, and that the node at the position allows a GapCursor.
19
+ *
20
+ * @param {ResolvedPos} $pos - The resolved position in the document to validate.
21
+ * @returns {boolean} - Returns true if a GapCursor can be placed at the given position, false otherwise.
22
+ */
23
+ static valid($pos: ResolvedPos): boolean;
24
+ static findGapCursorFrom($pos: ResolvedPos, dir: number, mustMove?: boolean): ResolvedPos | null;
25
+ }
26
+ declare class GapBookmark {
27
+ readonly pos: number;
28
+ constructor(pos: number);
29
+ map(mapping: Mappable): GapBookmark;
30
+ resolve(doc: PMNode): Selection | GapCursorSelection;
31
+ }
32
+ /**
33
+ * Checks if the position before the given resolved position is closed
34
+ *
35
+ * This function traverses up the document tree from the given resolved position and checks if the position
36
+ * immediately before it is closed. A position is considered closed if the previous node is closed or
37
+ * if the parent node is isolating.
38
+ *
39
+ * @param {ResolvedPos} $pos - The resolved position in the document to check.
40
+ * @returns {boolean} - Returns true if the position before the given position is closed, false otherwise.
41
+ */
42
+ export declare function closedBefore($pos: ResolvedPos): boolean;
43
+ export declare function closedAfter($pos: ResolvedPos): boolean;
44
+ export declare function isNodeStart($pos: ResolvedPos): boolean | null;
45
+ export default GapCursorSelection;
@@ -0,0 +1,42 @@
1
+ import { Dispatch, EditorState, EditorView, ResolvedPos, Transaction } from '../../tiptap';
2
+ import { Extension, ParentConfig } from '../../tiptap/core';
3
+ import { Command } from '../../tiptap/pm';
4
+
5
+ declare module "@tiptap/core" {
6
+ interface NodeConfig<Options, Storage> {
7
+ allowGapCursor?: boolean | null | ((this: {
8
+ name: string;
9
+ options: Options;
10
+ storage: Storage;
11
+ parent: ParentConfig<NodeConfig<Options>>["allowGapCursor"];
12
+ }) => boolean | null);
13
+ }
14
+ }
15
+ /**
16
+ * Adds GapCursor to top-level nodes
17
+ *
18
+ * When the top-level nodes (nodes with a depth of 1 relative to the doc) have the {@link NodeConfig#allowGapCursor} attribute set to true,
19
+ * a GapCursor can be inserted before and after these nodes.
20
+ *
21
+ * This extension provides the ability to navigate between these nodes using the arrow keys.
22
+ *
23
+ * Note that some nodes and shortcuts may conflict with GapCursor due to their own behaviors, such as:
24
+ * - CodeBlock nodes
25
+ * - Backspace on an empty line
26
+ * - Tab key
27
+ */
28
+ declare const GapCursor: Extension<any, any>;
29
+ export declare function handleBackspaceAtStart(pos: number, state: EditorState, dispatch: Dispatch): boolean;
30
+ export declare function handleInlineContent($beforePos: ResolvedPos, state: EditorState, dispatch: Dispatch): boolean;
31
+ /**
32
+ * Handles arrow key navigation for GapCursor
33
+ *
34
+ * This function determines the direction (vertical or horizontal) and
35
+ * the movement (positive or negative) based on the axis and direction parameters.
36
+ *
37
+ * @param {("vert" | "horiz")} axis - The axis of movement, either vertical ("vert") or horizontal ("horiz").
38
+ * @param {number} dir - The direction of movement, positive (1) or negative (-1).
39
+ */
40
+ export declare function arrow(axis: "vert" | "horiz", dir: number): Command;
41
+ export declare const arrowGapCursor: (dir: number, dirStr: any, state: EditorState, view?: EditorView) => (tr: Transaction) => ResolvedPos | undefined;
42
+ export default GapCursor;
@@ -1,5 +1,5 @@
1
- import { HeadingOptions } from '@tiptap/extension-heading';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { HeadingOptions } from '@tiptap/extension-heading';
3
3
 
4
4
  declare const Blockquote: import('../../tiptap').Node<ExtensionOptions & HeadingOptions, any>;
5
5
  export default Blockquote;
@@ -1,5 +1,5 @@
1
- import { Component } from 'vue';
2
1
  import { Editor } from '../../tiptap/vue-3';
2
+ import { Component } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
5
5
  editor?: Editor | undefined;
@@ -31,11 +31,11 @@ declare const _default: import('vue').DefineComponent<__VLS_WithDefaults<__VLS_T
31
31
  icon: undefined;
32
32
  }>>>, {
33
33
  editor: Editor;
34
- disabled: boolean;
35
- title: string;
36
34
  isActive: boolean;
37
35
  icon: Component;
36
+ title: string;
38
37
  action: () => void;
38
+ disabled: boolean;
39
39
  }, {}>;
40
40
  export default _default;
41
41
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1,5 +1,5 @@
1
- import { HighlightOptions } from '@tiptap/extension-highlight';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { HighlightOptions } from '@tiptap/extension-highlight';
3
3
 
4
4
  declare const Highlight: import('../../tiptap/vue-3').Mark<ExtensionOptions & HighlightOptions, any>;
5
5
  export default Highlight;
@@ -1,5 +1,5 @@
1
- import { HistoryOptions } from '@tiptap/extension-history';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { HistoryOptions } from '@tiptap/extension-history';
3
3
 
4
4
  declare const History: import('../../tiptap/vue-3').Extension<ExtensionOptions & HistoryOptions, any>;
5
5
  export default History;
@@ -1,4 +1,4 @@
1
- import { Node as ProseMirrorNode, Decoration } from '../../tiptap/pm';
1
+ import { Decoration, Node as ProseMirrorNode } from '../../tiptap/pm';
2
2
  import { Editor, Node } from '../../tiptap/vue-3';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
@@ -1,5 +1,5 @@
1
- import { ExtensionOptions } from '../../types';
2
1
  import { Node } from '../../tiptap/vue-3';
2
+ import { ExtensionOptions } from '../../types';
3
3
 
4
4
  declare module "@/tiptap" {
5
5
  interface Commands<ReturnType> {
@@ -1,5 +1,5 @@
1
+ import { Decoration, Node as ProseMirrorNode } from '../../tiptap/pm';
1
2
  import { Editor, Node } from '../../tiptap/vue-3';
2
- import { Node as ProseMirrorNode, Decoration } from '../../tiptap/pm';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
5
5
  editor: Editor;
@@ -1,5 +1,5 @@
1
- import { ImageOptions } from '@tiptap/extension-image';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { ImageOptions } from '@tiptap/extension-image';
3
3
 
4
4
  declare const Image: import('../../tiptap/vue-3').Node<ExtensionOptions & ImageOptions, any>;
5
5
  export default Image;
@@ -1,4 +1,4 @@
1
- import { KeyboardShortcutCommand, Extension } from '../../tiptap';
1
+ import { Extension, KeyboardShortcutCommand } from '../../tiptap';
2
2
 
3
3
  declare module "@/tiptap" {
4
4
  interface Commands<ReturnType> {
@@ -1,46 +1,47 @@
1
- import { default as ExtensionHistory } from './history';
2
- import { default as ExtensionHeading } from './heading';
1
+ import { default as ExtensionDocument } from '@tiptap/extension-document';
2
+ import { default as ExtensionDropcursor } from '@tiptap/extension-dropcursor';
3
+ import { default as ExtensionHardBreak } from '@tiptap/extension-hard-break';
4
+ import { default as ExtensionHorizontalRule } from '@tiptap/extension-horizontal-rule';
5
+ import { default as ExtensionPlaceholder } from '@tiptap/extension-placeholder';
6
+ import { default as ExtensionTextStyle } from '@tiptap/extension-text-style';
7
+ import { default as ExtensionBlockquote } from './blockquote';
3
8
  import { default as ExtensionBold } from './bold';
9
+ import { default as ExtensionBulletList } from './bullet-list';
10
+ import { default as ExtensionCode } from './code';
11
+ import { default as ExtensionColor } from './color';
12
+ import { default as ExtensionFontSize } from './font-size';
13
+ import { default as ExtensionHeading } from './heading';
14
+ import { default as ExtensionHighlight } from './highlight';
15
+ import { default as ExtensionHistory } from './history';
4
16
  import { default as ExtensionItalic } from './italic';
17
+ import { default as ExtensionLink } from './link';
18
+ import { default as ExtensionListKeymap } from './list-keymap';
19
+ import { default as ExtensionOrderedList } from './ordered-list';
20
+ import { default as ExtensionParagraph } from './paragraph';
5
21
  import { default as ExtensionStrike } from './strike';
6
- import { default as ExtensionUnderline } from './underline';
7
- import { default as ExtensionHighlight } from './highlight';
8
- import { default as ExtensionBlockquote } from './blockquote';
9
- import { default as ExtensionCode } from './code';
10
- import { default as ExtensionSuperscript } from './superscript';
11
22
  import { default as ExtensionSubscript } from './subscript';
12
- import { default as ExtensionBulletList } from './bullet-list';
13
- import { default as ExtensionOrderedList } from './ordered-list';
14
- import { default as ExtensionTaskList } from './task-list';
15
- import { default as ExtensionListKeymap } from './list-keymap';
23
+ import { default as ExtensionSuperscript } from './superscript';
16
24
  import { default as ExtensionTable } from './table';
25
+ import { default as ExtensionTaskList } from './task-list';
17
26
  import { default as ExtensionTextAlign } from './text-align';
18
- import { default as ExtensionTextStyle } from '@tiptap/extension-text-style';
19
- import { default as ExtensionLink } from './link';
20
- import { default as ExtensionColor } from './color';
21
- import { default as ExtensionFontSize } from './font-size';
22
- import { default as ExtensionDropcursor } from '@tiptap/extension-dropcursor';
23
- import { default as ExtensionGapcursor } from '@tiptap/extension-gapcursor';
24
- import { default as ExtensionHardBreak } from '@tiptap/extension-hard-break';
25
- import { default as ExtensionHorizontalRule } from '@tiptap/extension-horizontal-rule';
26
- import { default as ExtensionDocument } from '@tiptap/extension-document';
27
- import { default as ExtensionParagraph } from './paragraph';
28
- import { default as ExtensionPlaceholder } from '@tiptap/extension-placeholder';
29
- import { ExtensionCommands } from '../extensions/commands-menu';
27
+ import { default as ExtensionUnderline } from './underline';
30
28
  import { ExtensionCodeBlock, lowlight } from './code-block';
31
- import { default as ExtensionIframe } from './iframe';
32
- import { default as ExtensionVideo } from './video';
29
+ import { ExtensionCommands } from '../extensions/commands-menu';
33
30
  import { default as ExtensionAudio } from './audio';
31
+ import { default as ExtensionClearFormat } from './clear-format';
32
+ import { ExtensionColumn, ExtensionColumns } from './columns';
33
+ import { default as ExtensionDraggable } from './draggable';
34
+ import { default as ExtensionFormatBrush } from './format-brush';
35
+ import { default as ExtensionGapcursor } from './gap-cursor';
36
+ import { default as ExtensionIframe } from './iframe';
34
37
  import { default as ExtensionImage } from './image';
35
38
  import { default as ExtensionIndent } from './indent';
36
- import { ExtensionColumns, ExtensionColumn } from './columns';
37
- import { default as ExtensionText } from './text';
38
- import { default as ExtensionDraggable } from './draggable';
39
39
  import { default as ExtensionNodeSelected } from './node-selected';
40
- import { default as ExtensionTrailingNode } from './trailing-node';
40
+ import { ExtensionRangeSelection, RangeSelection } from './range-selection';
41
41
  import { default as ExtensionSearchAndReplace } from './search-and-replace';
42
- import { default as ExtensionClearFormat } from './clear-format';
43
- import { default as ExtensionFormatBrush } from './format-brush';
42
+ import { default as ExtensionText } from './text';
43
+ import { default as ExtensionTrailingNode } from './trailing-node';
44
+ import { default as ExtensionVideo } from './video';
44
45
 
45
- declare const allExtensions: (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<import('../types').ExtensionOptions & import('@tiptap/extension-superscript').SuperscriptExtensionOptions, any>)[];
46
- export { allExtensions, ExtensionBlockquote, ExtensionBold, ExtensionBulletList, ExtensionCode, ExtensionDocument, ExtensionDropcursor, ExtensionGapcursor, ExtensionHardBreak, ExtensionHeading, ExtensionHistory, ExtensionHorizontalRule, ExtensionItalic, ExtensionOrderedList, ExtensionStrike, ExtensionText, ExtensionImage, ExtensionTaskList, ExtensionLink, ExtensionTextAlign, ExtensionTextStyle, ExtensionUnderline, ExtensionTable, ExtensionSubscript, ExtensionSuperscript, ExtensionParagraph, ExtensionPlaceholder, ExtensionHighlight, ExtensionCommands, ExtensionCodeBlock, lowlight, ExtensionIframe, ExtensionVideo, ExtensionAudio, ExtensionColor, ExtensionFontSize, ExtensionIndent, ExtensionDraggable, ExtensionColumns, ExtensionColumn, ExtensionNodeSelected, ExtensionTrailingNode, ExtensionListKeymap, ExtensionSearchAndReplace, ExtensionClearFormat, ExtensionFormatBrush, };
46
+ declare const allExtensions: (import('@tiptap/core').Extension<any, any> | import('@tiptap/core').Node<any, any> | import('@tiptap/core').Mark<import('../types').ExtensionOptions & import('@tiptap/extension-subscript').SubscriptExtensionOptions, any>)[];
47
+ export { ExtensionAudio, ExtensionBlockquote, ExtensionBold, ExtensionBulletList, ExtensionClearFormat, ExtensionCode, ExtensionCodeBlock, ExtensionColor, ExtensionColumn, ExtensionColumns, ExtensionCommands, ExtensionDocument, ExtensionDraggable, ExtensionDropcursor, ExtensionFontSize, ExtensionFormatBrush, ExtensionGapcursor, ExtensionHardBreak, ExtensionHeading, ExtensionHighlight, ExtensionHistory, ExtensionHorizontalRule, ExtensionIframe, ExtensionImage, ExtensionIndent, ExtensionItalic, ExtensionLink, ExtensionListKeymap, ExtensionNodeSelected, ExtensionOrderedList, ExtensionParagraph, ExtensionPlaceholder, ExtensionRangeSelection, ExtensionSearchAndReplace, ExtensionStrike, ExtensionSubscript, ExtensionSuperscript, ExtensionTable, ExtensionTaskList, ExtensionText, ExtensionTextAlign, ExtensionTextStyle, ExtensionTrailingNode, ExtensionUnderline, ExtensionVideo, RangeSelection, allExtensions, lowlight, };
@@ -1,5 +1,5 @@
1
- import { ItalicOptions } from '@tiptap/extension-italic';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { ItalicOptions } from '@tiptap/extension-italic';
3
3
 
4
4
  declare const Italic: import('../../tiptap/vue-3').Mark<ExtensionOptions & ItalicOptions, any>;
5
5
  export default Italic;
@@ -1,5 +1,5 @@
1
- import { Component } from 'vue';
2
1
  import { Editor } from '../../tiptap/vue-3';
2
+ import { Component } from 'vue';
3
3
 
4
4
  declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
5
5
  editor: Editor;
@@ -1,5 +1,5 @@
1
- import { LinkOptions } from '@tiptap/extension-link';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { LinkOptions } from '@tiptap/extension-link';
3
3
 
4
4
  declare const Link: import('../../tiptap/vue-3').Mark<ExtensionOptions & LinkOptions, any>;
5
5
  export default Link;
@@ -1,5 +1,5 @@
1
- import { OrderedListOptions } from '@tiptap/extension-ordered-list';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { OrderedListOptions } from '@tiptap/extension-ordered-list';
3
3
 
4
4
  declare const OrderedList: import('../../tiptap/vue-3').Node<ExtensionOptions & OrderedListOptions, any>;
5
5
  export default OrderedList;
@@ -1,5 +1,8 @@
1
- import { ParagraphOptions } from '@tiptap/extension-paragraph';
1
+ import { EditorState, ResolvedPos, Dispatch } from '../../tiptap';
2
2
  import { ExtensionOptions } from '../../types';
3
+ import { ParagraphOptions } from '@tiptap/extension-paragraph';
3
4
 
4
5
  declare const Paragraph: import('../../tiptap').Node<ExtensionOptions & ParagraphOptions, any>;
6
+ export declare function deleteCurrentNodeAndSetSelection($from: ResolvedPos, beforePos: number, state: EditorState, dispatch: Dispatch): boolean;
7
+ export declare function handleDeletePreviousNode($from: ResolvedPos, beforePos: number, state: EditorState, dispatch: Dispatch): boolean;
5
8
  export default Paragraph;
@@ -0,0 +1,23 @@
1
+ import { Extension, ParentConfig } from '../../tiptap';
2
+ import { default as RangeSelection } from './range-selection';
3
+
4
+ declare module "@tiptap/core" {
5
+ interface NodeConfig<Options, Storage> {
6
+ /**
7
+ * Whether to allow displaying a fake selection state on the node.
8
+ *
9
+ * Typically, it is only necessary to display a fake selection state on child nodes,
10
+ * so the parent node can be set to false.
11
+ *
12
+ * default: true
13
+ */
14
+ fakeSelection?: boolean | null | ((this: {
15
+ name: string;
16
+ options: Options;
17
+ storage: Storage;
18
+ parent: ParentConfig<NodeConfig<Options>>["fakeSelection"];
19
+ }) => boolean | null);
20
+ }
21
+ }
22
+ declare const ExtensionRangeSelection: Extension<any, any>;
23
+ export { ExtensionRangeSelection, RangeSelection };
@@ -0,0 +1,65 @@
1
+ import { EditorState, Node, ResolvedPos, Selection, Mappable } from '../../tiptap/pm';
2
+
3
+ /**
4
+ * The RangeSelection class represents a selection range within a document.
5
+ * The content can include text, paragraphs, block-level content, etc.
6
+ *
7
+ * It has a starting position and an ending position. When the given range includes block-level content,
8
+ * the RangeSelection will automatically expand to include the block-level content at the corresponding depth.
9
+ *
10
+ * The RangeSelection must not contain empty content.
11
+ */
12
+ declare class RangeSelection extends Selection {
13
+ /**
14
+ * Creates a RangeSelection between the specified positions.
15
+ *
16
+ * @param $anchor - The starting position of the selection.
17
+ * @param $head - The ending position of the selection.
18
+ */
19
+ constructor($anchor: ResolvedPos, $head: ResolvedPos);
20
+ map(doc: Node, mapping: Mappable): Selection;
21
+ eq(other: Selection): boolean;
22
+ getBookmark(): RangeBookmark;
23
+ toJSON(): any;
24
+ /**
25
+ * Validates if the given positions can form a valid RangeSelection in the given state.
26
+ *
27
+ * @param state - The editor state.
28
+ * @param anchor - The starting position.
29
+ * @param head - The ending position.
30
+ * @returns True if the positions form a valid RangeSelection, otherwise false.
31
+ */
32
+ static valid(state: EditorState, anchor: number, head: number): boolean;
33
+ /**
34
+ * Returns a RangeSelection spanning the given positions.
35
+ *
36
+ * When the given range includes block-level content, if only a part is included,
37
+ * the selection will be expanded to encompass the block-level content at the corresponding depth.
38
+ *
39
+ * Expansion: If the selection includes all depth nodes of the current block-level content but not the entire last node,
40
+ * the selection will be expanded to include the node at that depth.
41
+ *
42
+ * @param $anchor - The starting position of the selection.
43
+ * @param $head - The ending position of the selection.
44
+ * @returns A new RangeSelection that spans the given positions.
45
+ */
46
+ static between($anchor: ResolvedPos, $head: ResolvedPos): RangeSelection | null;
47
+ static fromJSON(doc: Node, json: any): RangeSelection;
48
+ static create(doc: Node, anchor: number, head: number): RangeSelection;
49
+ static allRange(doc: Node): RangeSelection;
50
+ }
51
+ declare class RangeBookmark {
52
+ readonly anchor: number;
53
+ readonly head: number;
54
+ constructor(anchor: number, head: number);
55
+ map(mapping: Mappable): RangeBookmark;
56
+ resolve(doc: Node): RangeSelection;
57
+ }
58
+ export declare function checkRangeSelection($anchor: ResolvedPos, $head: ResolvedPos): void;
59
+ export declare function rangeNodesBetween($anchor: ResolvedPos, $head: ResolvedPos): {
60
+ node: Node;
61
+ pos: number;
62
+ parent: Node | null;
63
+ index: number;
64
+ }[];
65
+ export default RangeSelection;
@@ -1,5 +1,5 @@
1
+ import { Editor, PluginKey } from '../../tiptap';
1
2
  import { PropType } from 'vue';
2
- import { PluginKey, Editor } from '../../tiptap';
3
3
  import { SearchAndReplacePluginState } from './SearchAndReplacePlugin';
4
4
 
5
5
  declare const _default: import('vue').DefineComponent<{
@@ -1,5 +1,5 @@
1
- import { StrikeOptions } from '@tiptap/extension-strike';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { StrikeOptions } from '@tiptap/extension-strike';
3
3
 
4
4
  declare const Strike: import('../../tiptap/vue-3').Mark<ExtensionOptions & StrikeOptions, any>;
5
5
  export default Strike;
@@ -1,5 +1,5 @@
1
- import { SubscriptExtensionOptions } from '@tiptap/extension-subscript';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { SubscriptExtensionOptions } from '@tiptap/extension-subscript';
3
3
 
4
4
  declare const Subscript: import('../../tiptap/vue-3').Mark<ExtensionOptions & SubscriptExtensionOptions, any>;
5
5
  export default Subscript;
@@ -1,5 +1,5 @@
1
- import { SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { SuperscriptExtensionOptions } from '@tiptap/extension-superscript';
3
3
 
4
4
  declare const Superscript: import('../../tiptap/vue-3').Mark<ExtensionOptions & SuperscriptExtensionOptions, any>;
5
5
  export default Superscript;
@@ -1,5 +1,5 @@
1
- import { TableOptions } from '@tiptap/extension-table';
2
1
  import { ExtensionOptions } from '../../types';
2
+ import { TableOptions } from '@tiptap/extension-table';
3
3
 
4
4
  declare const Table: import('../../tiptap').Node<ExtensionOptions & TableOptions, any>;
5
5
  export default Table;