@halo-dev/richtext-editor 2.14.0 → 2.15.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.
@@ -1,30 +1,36 @@
1
1
  import type { Component } from "vue";
2
+ import type { ToolbarItem } from '../../types';
2
3
  declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
3
4
  isActive?: boolean | undefined;
4
5
  disabled?: boolean | undefined;
5
6
  title?: string | undefined;
6
7
  action?: (() => void) | undefined;
7
8
  icon?: Component | undefined;
9
+ children?: ToolbarItem[] | undefined;
8
10
  }>, {
9
11
  isActive: boolean;
10
12
  disabled: boolean;
11
13
  title: undefined;
12
14
  action: undefined;
13
15
  icon: undefined;
16
+ children: undefined;
14
17
  }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
15
18
  isActive?: boolean | undefined;
16
19
  disabled?: boolean | undefined;
17
20
  title?: string | undefined;
18
21
  action?: (() => void) | undefined;
19
22
  icon?: Component | undefined;
23
+ children?: ToolbarItem[] | undefined;
20
24
  }>, {
21
25
  isActive: boolean;
22
26
  disabled: boolean;
23
27
  title: undefined;
24
28
  action: undefined;
25
29
  icon: undefined;
30
+ children: undefined;
26
31
  }>>>, {
27
32
  title: string;
33
+ children: ToolbarItem[];
28
34
  isActive: boolean;
29
35
  icon: Component;
30
36
  action: () => void;
@@ -0,0 +1,4 @@
1
+ import { Extension } from '../../tiptap';
2
+ import type { ExtensionOptions } from '../../types';
3
+ declare const clearFormat: Extension<ExtensionOptions, any>;
4
+ export default clearFormat;
@@ -0,0 +1,15 @@
1
+ import { Extension } from '../../tiptap';
2
+ declare module "@/tiptap" {
3
+ interface Commands<ReturnType> {
4
+ formatBrush: {
5
+ copyFormatBrush: () => ReturnType;
6
+ pasteFormatBrush: () => ReturnType;
7
+ };
8
+ }
9
+ }
10
+ export interface FormatBrushStore {
11
+ formatBrush: boolean;
12
+ formatBrushMarks: any[];
13
+ }
14
+ declare const formatBrush: Extension<any, FormatBrushStore>;
15
+ export default formatBrush;
@@ -0,0 +1,27 @@
1
+ import type { EditorState, MarkRange, Transaction } from '../../tiptap';
2
+ /**
3
+ * get its marks through the first text node in the selector
4
+ *
5
+ * @param state editor state
6
+ * @returns the marks of the current first text node
7
+ */
8
+ export declare const getMarksByFirstTextNode: (state: EditorState) => MarkRange[];
9
+ /**
10
+ *
11
+ * Set marks for the text in the currently selected content. This method will first remove all marks
12
+ * from the currently selected text, and then add marks again.
13
+ *
14
+ * For CellSelection, it is necessary to iterate through ranges and set marks for each range.
15
+ *
16
+ * @param state editor state
17
+ * @param marks the marks to be set
18
+ * @param transaction transaction
19
+ *
20
+ * @returns transaction
21
+ *
22
+ * */
23
+ export declare const setMarks: (state: EditorState, marks: MarkRange[], transaction?: Transaction) => Transaction;
24
+ export declare const setMarksByRange: (tr: Transaction, state: EditorState, range: {
25
+ from: number;
26
+ to: number;
27
+ }, marks: MarkRange[]) => void;
@@ -39,5 +39,7 @@ import ExtensionDraggable from "./draggable";
39
39
  import ExtensionNodeSelected from "./node-selected";
40
40
  import ExtensionTrailingNode from "./trailing-node";
41
41
  import ExtensionSearchAndReplace from "./search-and-replace";
42
+ import ExtensionClearFormat from "./clear-format";
43
+ import ExtensionFormatBrush from "./format-brush";
42
44
  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>)[];
43
- 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, };
45
+ 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, };
@@ -1,5 +1,5 @@
1
1
  import { type Component } from "vue";
2
- import type { Editor } from '../../tiptap/vue-3';
2
+ import { type Editor } from '../../tiptap/vue-3';
3
3
  declare const _default: import("vue").DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
4
  editor: Editor;
5
5
  isActive: ({ editor }: {
@@ -1,4 +1,4 @@
1
1
  import type { ParagraphOptions } from "@tiptap/extension-paragraph";
2
2
  import type { ExtensionOptions } from '../../types';
3
- declare const Paragraph: import("@tiptap/core").Node<ExtensionOptions & ParagraphOptions, any>;
3
+ declare const Paragraph: import('../../tiptap').Node<ExtensionOptions & ParagraphOptions, any>;
4
4
  export default Paragraph;
@@ -1,4 +1,4 @@
1
- import { Node, CellSelection } from '../../tiptap/pm';
1
+ import { Node, CellSelection, TableMap } from '../../tiptap/pm';
2
2
  import type { EditorState, Selection, Transaction } from '../../tiptap/pm';
3
3
  export declare const selectTable: (tr: Transaction) => Transaction;
4
4
  export declare const selectColumn: (index: number) => (tr: Transaction) => Transaction;
@@ -25,3 +25,21 @@ export declare const isColumnSelected: (columnIndex: number) => (selection: any)
25
25
  export declare const isRowSelected: (rowIndex: number) => (selection: any) => boolean;
26
26
  export declare const isTableSelected: (selection: any) => boolean;
27
27
  export declare const hasTableBefore: (editorState: EditorState) => boolean;
28
+ export declare const findNextCell: (state: EditorState) => {
29
+ start: number;
30
+ node: Node | null;
31
+ } | undefined;
32
+ export declare const findPreviousCell: (state: EditorState) => {
33
+ start: number;
34
+ node: Node | null;
35
+ } | undefined;
36
+ export declare const findAdjacentCell: (dir: number) => (state: EditorState) => {
37
+ start: number;
38
+ node: Node | null;
39
+ } | undefined;
40
+ export declare const nextCell: (map: TableMap) => (pos: number, dir: number) => {
41
+ top: number;
42
+ left: number;
43
+ right: number;
44
+ bottom: number;
45
+ } | undefined;