vdc-editor 0.1.241 → 0.1.243

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,6 +1,7 @@
1
1
  import { EditorMode } from '../constants';
2
2
  import { Editor } from '@tiptap/core';
3
3
  import { HTMLAttributes } from 'vue';
4
+ import { ExtensionName } from '../utils/node-names';
4
5
 
5
6
  interface Props {
6
7
  editor: Editor;
@@ -9,6 +10,7 @@ interface Props {
9
10
  mode: EditorMode;
10
11
  class?: HTMLAttributes['class'];
11
12
  customClassToolbar?: string;
13
+ toolbarExtensionOrder?: Partial<Record<ExtensionName, number>>;
12
14
  }
13
15
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
14
16
  disabled: boolean;
@@ -40,6 +40,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
40
40
  superPreview: number;
41
41
  content: number;
42
42
  };
43
+ toolbarExtensionOrder: undefined;
43
44
  }>>, {
44
45
  editor: Editor;
45
46
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -102,6 +103,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
102
103
  superPreview: number;
103
104
  content: number;
104
105
  };
106
+ toolbarExtensionOrder: undefined;
105
107
  }>>> & Readonly<{
106
108
  onChange?: ((value: import('../../type').SBSEditorOnChange) => any) | undefined;
107
109
  onOnFocus?: ((props: {
@@ -137,6 +139,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
137
139
  disableSuperInput: boolean;
138
140
  superPreviewCustomClass: import('../../type').SuperPreviewCustomClass;
139
141
  customClassToolbar: string;
142
+ toolbarExtensionOrder: Partial<Record<import('../../utils/node-names').ExtensionName, number>>;
140
143
  superTextArea: {
141
144
  view: boolean;
142
145
  button: boolean;
@@ -19,6 +19,7 @@ import { DeviceEnvOptions } from './DeviceEnv';
19
19
  import { VideoOptions as VideoUploadOptions } from './VideoUpload';
20
20
  import { VideoOptions } from './Video';
21
21
  import { ImageUploadOptions } from './ImageUpload';
22
+ import { SpecialCharacterOptions } from './SpecialCharacter';
22
23
 
23
24
  /**
24
25
  * Represents the interface for options in the base toolkit.
@@ -116,6 +117,10 @@ export interface BaseKitOptions {
116
117
  * Editor non-editable
117
118
  */
118
119
  disabled?: boolean;
120
+ /**
121
+ * SpecialCharacter options
122
+ */
123
+ specialCharacter: Partial<SpecialCharacterOptions>;
119
124
  /**
120
125
  * SuperText options or false, indicating whether to enable the super text
121
126
  *
@@ -0,0 +1,10 @@
1
+ import { Extension } from '@tiptap/core';
2
+ import { Component } from 'vue';
3
+
4
+ export interface SpecialCharacterOptions {
5
+ specialCharModal?: {
6
+ component?: Component;
7
+ props?: Record<string, any>;
8
+ };
9
+ }
10
+ export declare const SpecialCharacter: Extension<SpecialCharacterOptions, any>;
@@ -0,0 +1,8 @@
1
+ import { Editor } from '@tiptap/core';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ editor: typeof Editor;
5
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
6
+ editor: typeof Editor;
7
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
8
+ export default _default;
@@ -0,0 +1 @@
1
+ export * from './SpecialCharacter';
@@ -1,4 +1,4 @@
1
- import { AnyExtension } from '@tiptap/core';
1
+ import { AnyExtension, Editor as CoreEditor } from '@tiptap/core';
2
2
  import { PageOption } from '../type';
3
3
  import { Editor } from '@tiptap/vue-3';
4
4
  import { ISuperText } from '../extensions/SuperText';
@@ -191,5 +191,7 @@ export declare const useTiptapStore: () => {
191
191
  footerTargetRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
192
192
  editorContentInstance: import('vue').Ref<Editor | undefined, Editor | undefined>;
193
193
  setEditorContentInstance: (editorInstance: Editor) => void;
194
+ editorFocusedInstance: import('vue').Ref<Editor | CoreEditor | undefined, Editor | CoreEditor | undefined>;
195
+ setEditorFocusedInstance: (editorInstance: Editor | CoreEditor) => void;
194
196
  };
195
197
  export {};
@@ -10,6 +10,7 @@ declare function updateSuperTextView(): void;
10
10
  export * as extension from './extensions';
11
11
  export { useConfigTiptap, useTiptapStore } from './hooks';
12
12
  export * as nodeNames from './utils/node-names';
13
+ export type { ExtensionName } from './utils/node-names';
13
14
  export type * from './type';
14
15
  export { EditorMode } from './constants';
15
16
  export type { HistoryOptions } from '@tiptap/extension-history';
package/lib/src/type.d.ts CHANGED
@@ -3,6 +3,7 @@ import { Editor, EditorOptions } from '@tiptap/vue-3';
3
3
  import { icons } from './components/icons';
4
4
  import { SplitContext } from './extensions/Page/computed';
5
5
  import { EDITOR_NAME, EditorMode } from './constants';
6
+ import { ExtensionName } from './utils/node-names';
6
7
 
7
8
  export type { Editor, JSONContent } from '@tiptap/core';
8
9
  /**
@@ -475,6 +476,10 @@ export interface EditorProps {
475
476
  * Editor anchor content instance
476
477
  */
477
478
  editorContentInstance?: Editor;
479
+ /**
480
+ * Toolbar extension order
481
+ */
482
+ toolbarExtensionOrder?: Partial<Record<ExtensionName, number>>;
478
483
  }
479
484
  export interface EditorEmits {
480
485
  (event: 'enter'): void;
@@ -59,5 +59,73 @@ export declare const LINE_HEIGHT = "lineHeight";
59
59
  export declare const PAINTER = "painter";
60
60
  export declare const CLEAR = "clear";
61
61
  export declare const SPELLCHECKER = "spellchecker";
62
- export declare const FONTSIZEINCREASEDECREASE = "fontSizeIncreaseDecrease";
62
+ export declare const FONTSIZE_INCREASEDECREASE = "fontSizeIncreaseDecrease";
63
63
  export declare const TIME_HIGH_LIGHTER = "time-highlighter";
64
+ export declare const SPECIAL_CHARACTER = "specialCharacter";
65
+ export declare const HISTORY = "history";
66
+ declare const EXTENSION_NAMES: {
67
+ readonly HISTORY: "history";
68
+ readonly PARAGRAPH: "paragraph";
69
+ readonly PAGE: "page";
70
+ readonly EXTEND: "Extend";
71
+ readonly CASSIE_BLOCK: "Node";
72
+ readonly CC: "CC";
73
+ readonly HEADING: "heading";
74
+ readonly BULLETLIST: "bulletList";
75
+ readonly LISTITEM: "listItem";
76
+ readonly TASKLIST: "taskList";
77
+ readonly TASKITEM: "taskItem";
78
+ readonly ORDEREDLIST: "orderedList";
79
+ readonly TABLE: "table";
80
+ readonly TABLEHEADER: "tableHeader";
81
+ readonly TABLE_ROW: "tableRow";
82
+ readonly TABLE_CELL: "tableCell";
83
+ readonly COLUMN: "column";
84
+ readonly COLUMNS: "columns";
85
+ readonly TEXT_BOX: "textBox";
86
+ readonly IMAGE: "image";
87
+ readonly IMAGE_UPLOAD: "imageUpload";
88
+ readonly VIDEO_UPLOAD: "videoUpload";
89
+ readonly IFRAME: "iframe";
90
+ readonly FILE: "file";
91
+ readonly CODE_BLOCK: "codeBlock";
92
+ readonly BLOCKQUOTE: "blockquote";
93
+ readonly AUDIO: "audio";
94
+ readonly TOC: "toc";
95
+ readonly VIDEO: "video";
96
+ readonly HORIZONTALRULE: "horizontalrule";
97
+ readonly PAGEBREAK: "pagination";
98
+ readonly LINK: "link";
99
+ readonly PLACEHOLDER: "placeholder";
100
+ readonly FOCUS: "focus";
101
+ readonly TEXT: "text";
102
+ readonly TEXT_BUBBLE: "text-bubble";
103
+ readonly GAP_CURSOR: "gapCursor";
104
+ readonly DROP_CURSOR: "dropCursor";
105
+ readonly CHARACTER_COUNT: "characterCount";
106
+ readonly HARD_BREAK: "hardBreak";
107
+ readonly TEXT_STYLE: "textStyle";
108
+ readonly SELECTION: "selection";
109
+ readonly SUPER_TEXT: "superText";
110
+ readonly CONFIG_PLAN: "configPlan";
111
+ readonly FONT_SIZE: "fontSize";
112
+ readonly FONT_FAMILY: "fontFamily";
113
+ readonly BOLD: "bold";
114
+ readonly ITALIC: "italic";
115
+ readonly UNDERLINE: "underline";
116
+ readonly STRIKE: "strike";
117
+ readonly COLOR: "color";
118
+ readonly HIGHLIGHT: "highlight";
119
+ readonly MORE_MARK: "moreMark";
120
+ readonly TEXT_ALIGN: "textAlign";
121
+ readonly INDENT: "indent";
122
+ readonly LINE_HEIGHT: "lineHeight";
123
+ readonly PAINTER: "painter";
124
+ readonly CLEAR: "clear";
125
+ readonly SPELLCHECKER: "spellchecker";
126
+ readonly FONTSIZE_INCREASEDECREASE: "fontSizeIncreaseDecrease";
127
+ readonly TIME_HIGH_LIGHTER: "time-highlighter";
128
+ readonly SPECIAL_CHARACTER: "specialCharacter";
129
+ };
130
+ export type ExtensionName = (typeof EXTENSION_NAMES)[keyof typeof EXTENSION_NAMES];
131
+ export {};
@@ -1,5 +1,6 @@
1
+ import { ExtensionName } from './node-names';
1
2
  import { Editor } from '@tiptap/core';
2
3
 
3
4
  export declare const getLineSelectionPosition: (editorInstance: Editor) => number;
4
5
  export declare const isFocusEditor: (editor: Editor) => boolean;
5
- export declare const reorderExtensions: (extensions: any[], orderMap: Record<string, number>) => any[];
6
+ export declare const reorderExtensions: (extensions: any[], orderMap: Partial<Record<ExtensionName, number>>) => any[];
@@ -1,4 +1,4 @@
1
- import { A as i, r as t, q as o, s as r, E as d, p, t as u, p as E, B as l, v as n, F as S, y as m, u as w, w as x, z as f, x as g } from "./index-BKOKfAJp.mjs";
1
+ import { A as i, r as t, q as o, s as r, E as d, p, t as u, p as E, B as l, v as n, F as S, y as m, u as w, w as x, z as f, x as g } from "./index-TgARGV_7.mjs";
2
2
  import "@vueuse/core";
3
3
  export {
4
4
  i as ArticleCompareEditor,