@kaitify/vue 0.0.4-beta.2 → 0.0.4-beta.21

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 (67) hide show
  1. package/lib/core/button/button.vue.d.ts +3 -2
  2. package/lib/core/checkbox/checkbox.vue.d.ts +1 -1
  3. package/lib/core/divider/divider.vue.d.ts +1 -1
  4. package/lib/core/popover/popover.vue.d.ts +13 -457
  5. package/lib/core/tabs/tabs.vue.d.ts +3 -2
  6. package/lib/editor/bubble/bubble.vue.d.ts +9 -457
  7. package/lib/editor/bubble/props.d.ts +0 -4
  8. package/lib/editor/menu/built-in/align-center/align-center.vue.d.ts +1 -1
  9. package/lib/editor/menu/built-in/align-justify/align-justify.vue.d.ts +1 -1
  10. package/lib/editor/menu/built-in/align-left/align-left.vue.d.ts +1 -1
  11. package/lib/editor/menu/built-in/align-right/align-right.vue.d.ts +1 -1
  12. package/lib/editor/menu/built-in/attachment/attachment.vue.d.ts +234 -1
  13. package/lib/editor/menu/built-in/back-color/back-color.vue.d.ts +234 -1
  14. package/lib/editor/menu/built-in/blockquote/blockquote.vue.d.ts +1 -1
  15. package/lib/editor/menu/built-in/bold/bold.vue.d.ts +1 -1
  16. package/lib/editor/menu/built-in/clear-format/clear-format.vue.d.ts +1 -1
  17. package/lib/editor/menu/built-in/code/code.vue.d.ts +1 -1
  18. package/lib/editor/menu/built-in/code-block/code-block-languages.vue.d.ts +235 -1
  19. package/lib/editor/menu/built-in/code-block/code-block.vue.d.ts +1 -1
  20. package/lib/editor/menu/built-in/color/color.vue.d.ts +234 -1
  21. package/lib/editor/menu/built-in/decrease-indent/decrease-indent.vue.d.ts +1 -1
  22. package/lib/editor/menu/built-in/emoji/emoji.vue.d.ts +234 -1
  23. package/lib/editor/menu/built-in/font-family/font-family.vue.d.ts +234 -1
  24. package/lib/editor/menu/built-in/font-size/font-size.vue.d.ts +234 -1
  25. package/lib/editor/menu/built-in/full-screen/full-screen.vue.d.ts +1 -1
  26. package/lib/editor/menu/built-in/heading/heading.vue.d.ts +235 -1
  27. package/lib/editor/menu/built-in/horizontal/horizontal.vue.d.ts +1 -1
  28. package/lib/editor/menu/built-in/image/image.vue.d.ts +234 -1
  29. package/lib/editor/menu/built-in/increase-indent/increase-indent.vue.d.ts +1 -1
  30. package/lib/editor/menu/built-in/italic/italic.vue.d.ts +1 -1
  31. package/lib/editor/menu/built-in/line-height/line-height.vue.d.ts +234 -2
  32. package/lib/editor/menu/built-in/line-height/props.d.ts +0 -4
  33. package/lib/editor/menu/built-in/link/link-unset.vue.d.ts +1 -1
  34. package/lib/editor/menu/built-in/link/link.vue.d.ts +234 -1
  35. package/lib/editor/menu/built-in/math/math.vue.d.ts +234 -1
  36. package/lib/editor/menu/built-in/ordered-list/ordered-list.vue.d.ts +234 -1
  37. package/lib/editor/menu/built-in/redo/redo.vue.d.ts +1 -1
  38. package/lib/editor/menu/built-in/strikethrough/strikethrough.vue.d.ts +1 -1
  39. package/lib/editor/menu/built-in/subscript/subscript.vue.d.ts +1 -1
  40. package/lib/editor/menu/built-in/superscript/superscript.vue.d.ts +1 -1
  41. package/lib/editor/menu/built-in/table/table-add-column.vue.d.ts +1 -1
  42. package/lib/editor/menu/built-in/table/table-add-row.vue.d.ts +1 -1
  43. package/lib/editor/menu/built-in/table/table-delete-column.vue.d.ts +1 -1
  44. package/lib/editor/menu/built-in/table/table-delete-row.vue.d.ts +1 -1
  45. package/lib/editor/menu/built-in/table/table-merge-cell.vue.d.ts +1 -1
  46. package/lib/editor/menu/built-in/table/table-unset.vue.d.ts +1 -1
  47. package/lib/editor/menu/built-in/table/table.vue.d.ts +234 -1
  48. package/lib/editor/menu/built-in/task/task.vue.d.ts +1 -1
  49. package/lib/editor/menu/built-in/underline/underline.vue.d.ts +1 -1
  50. package/lib/editor/menu/built-in/undo/undo.vue.d.ts +1 -1
  51. package/lib/editor/menu/built-in/unordered-list/unordered-list.vue.d.ts +234 -1
  52. package/lib/editor/menu/built-in/video/video-controls.vue.d.ts +1 -1
  53. package/lib/editor/menu/built-in/video/video-loop.vue.d.ts +1 -1
  54. package/lib/editor/menu/built-in/video/video-muted.vue.d.ts +1 -1
  55. package/lib/editor/menu/built-in/video/video.vue.d.ts +234 -1
  56. package/lib/editor/menu/built-in/wrap-down/wrap-down.vue.d.ts +1 -1
  57. package/lib/editor/menu/built-in/wrap-up/wrap-up.vue.d.ts +1 -1
  58. package/lib/editor/menu/menu.vue.d.ts +137 -915
  59. package/lib/editor/wrapper/props.d.ts +31 -56
  60. package/lib/editor/wrapper/wrapper.vue.d.ts +39 -14
  61. package/lib/index.d.ts +1 -0
  62. package/lib/kaitify-vue.es.js +639 -576
  63. package/lib/kaitify-vue.umd.js +2 -2
  64. package/lib/locale/en-us.d.ts +1 -0
  65. package/lib/locale/ja-jp.d.ts +1 -0
  66. package/lib/locale/ko-kr.d.ts +1 -0
  67. package/package.json +7 -8
@@ -1,6 +1,5 @@
1
1
  import { LocaleType } from '../../locale';
2
- import { Editor, Extension, KNode, KNodeMarksType, KNodeStylesType, RuleFunctionType, Selection } from '@kaitify/core';
3
- import { BubblePropsType } from '../bubble';
2
+ import { Editor, EditorConfigureOptionType, KNode, Selection } from '@kaitify/core';
4
3
  /**
5
4
  * 编辑器参数类型
6
5
  */
@@ -17,10 +16,6 @@ export type WrapperPropsType = {
17
16
  * 语言环境
18
17
  */
19
18
  locale?: LocaleType;
20
- /**
21
- * bubble气泡栏参数
22
- */
23
- bubbleProps?: BubblePropsType;
24
19
  /**
25
20
  * before插槽挂载的元素,如果不设置,则就放置在编辑器前面
26
21
  */
@@ -32,99 +27,103 @@ export type WrapperPropsType = {
32
27
  /**
33
28
  * 是否自动聚焦
34
29
  */
35
- autofocus?: boolean;
30
+ autofocus?: EditorConfigureOptionType['autofocus'];
36
31
  /**
37
32
  * 编辑器内容只有一个段落时的默认文本
38
33
  */
39
- placeholder?: string;
34
+ placeholder?: EditorConfigureOptionType['placeholder'];
40
35
  /**
41
36
  * 是否深色模式
42
37
  */
43
- dark?: boolean;
38
+ dark?: EditorConfigureOptionType['dark'];
44
39
  /**
45
40
  * 是否允许复制
46
41
  */
47
- allowCopy?: boolean;
42
+ allowCopy?: EditorConfigureOptionType['allowCopy'];
48
43
  /**
49
44
  * 是否允许粘贴
50
45
  */
51
- allowPaste?: boolean;
46
+ allowPaste?: EditorConfigureOptionType['allowPaste'];
52
47
  /**
53
48
  * 是否允许剪切
54
49
  */
55
- allowCut?: boolean;
50
+ allowCut?: EditorConfigureOptionType['allowCut'];
56
51
  /**
57
52
  * 是否允许粘贴html
58
53
  */
59
- allowPasteHtml?: boolean;
54
+ allowPasteHtml?: EditorConfigureOptionType['allowPasteHtml'];
60
55
  /**
61
56
  * 剪切板同时存在文件和html/text时,是否优先粘贴文件
62
57
  */
63
- priorityPasteFiles?: boolean;
58
+ priorityPasteFiles?: EditorConfigureOptionType['priorityPasteFiles'];
64
59
  /**
65
60
  * 自定义编辑器内渲染文本节点的真实标签
66
61
  */
67
- textRenderTag?: string;
62
+ textRenderTag?: EditorConfigureOptionType['textRenderTag'];
68
63
  /**
69
64
  * 自定义编辑内渲染默认块级节点的真实标签,即段落标签
70
65
  */
71
- blockRenderTag?: string;
66
+ blockRenderTag?: EditorConfigureOptionType['blockRenderTag'];
72
67
  /**
73
68
  * 自定义编辑器内定义需要置空的标签
74
69
  */
75
- emptyRenderTags?: string[];
70
+ emptyRenderTags?: EditorConfigureOptionType['emptyRenderTags'];
76
71
  /**
77
72
  * 自定义编辑器内额外保留的标签
78
73
  */
79
- extraKeepTags?: string[];
74
+ extraKeepTags?: EditorConfigureOptionType['extraKeepTags'];
80
75
  /**
81
76
  * 自定义插件数组
82
77
  */
83
- extensions?: Extension[];
78
+ extensions?: EditorConfigureOptionType['extensions'];
84
79
  /**
85
80
  * 自定义节点数组格式化规则
86
81
  */
87
- formatRules?: RuleFunctionType[];
82
+ formatRules?: EditorConfigureOptionType['formatRules'];
88
83
  /**
89
84
  * 自定义dom转为非文本节点的后续处理
90
85
  */
91
- onDomParseNode?: (this: Editor, node: KNode) => KNode;
86
+ onDomParseNode?: EditorConfigureOptionType['onDomParseNode'];
92
87
  /**
93
88
  * 节点粘贴保留标记的自定义方法
94
89
  */
95
- onPasteKeepMarks?: (this: Editor, node: KNode) => KNodeMarksType;
90
+ onPasteKeepMarks?: EditorConfigureOptionType['onPasteKeepMarks'];
96
91
  /**
97
92
  * 节点粘贴保留样式的自定义方法
98
93
  */
99
- onPasteKeepStyles?: (this: Editor, node: KNode) => KNodeStylesType;
94
+ onPasteKeepStyles?: EditorConfigureOptionType['onPasteKeepStyles'];
100
95
  /**
101
96
  * 编辑器粘贴纯文本时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
102
97
  */
103
- onPasteText?: (this: Editor, text: string) => boolean | Promise<boolean>;
98
+ onPasteText?: EditorConfigureOptionType['onPasteText'];
104
99
  /**
105
100
  * 编辑器粘贴html内容时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
106
101
  */
107
- onPasteHtml?: (this: Editor, nodes: KNode[], html: string) => boolean | Promise<boolean>;
102
+ onPasteHtml?: EditorConfigureOptionType['onPasteHtml'];
108
103
  /**
109
104
  * 编辑器粘贴图片时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
110
105
  */
111
- onPasteImage?: (this: Editor, file: File) => boolean | Promise<boolean>;
106
+ onPasteImage?: EditorConfigureOptionType['onPasteImage'];
112
107
  /**
113
108
  * 编辑器粘贴视频时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
114
109
  */
115
- onPasteVideo?: (this: Editor, file: File) => boolean | Promise<boolean>;
110
+ onPasteVideo?: EditorConfigureOptionType['onPasteVideo'];
116
111
  /**
117
112
  * 编辑器粘贴除了图片和视频以外的文件时触发,需要自定义处理
118
113
  */
119
- onPasteFile?: (this: Editor, file: File) => void | Promise<void>;
114
+ onPasteFile?: EditorConfigureOptionType['onPasteFile'];
120
115
  /**
121
116
  * 在删除和换行操作中块节点节点从其父节点中抽离出去成为与父节点同级的节点后触发,如果返回true则表示继续使用默认逻辑,会将该节点转为段落,返回false则不走默认逻辑,需要自定义处理
122
117
  */
123
- onDetachMentBlockFromParent?: (this: Editor, node: KNode) => boolean;
118
+ onDetachMentBlockFromParent?: EditorConfigureOptionType['onDetachMentBlockFromParent'];
124
119
  /**
125
120
  * 编辑器updateView执行时,通过比对新旧节点数组获取需要格式化的节点,在这些节点被格式化前,触发此方法,回调参数即当前需要被格式化的节点,该方法返回一个节点,返回的节点将会被格式化,如果你不需要任何特殊处理,返回入参提供的节点即可
126
121
  */
127
- onBeforePatchNodeToFormat?: (this: Editor, node: KNode) => KNode;
122
+ onBeforePatchNodeToFormat?: EditorConfigureOptionType['onBeforePatchNodeToFormat'];
123
+ /**
124
+ * 编辑器进行光标纠正时触发,在这里可以修改虚拟光标的位置
125
+ */
126
+ onRedressSelection?: EditorConfigureOptionType['onRedressSelection'];
128
127
  };
129
128
  /**
130
129
  * 编辑器事件类型
@@ -174,35 +173,11 @@ export type WrapperEmitsType = {
174
173
  * 编辑器创建完成后触发的事件
175
174
  */
176
175
  (e: 'created', value: Editor): void;
177
- /**
178
- * 气泡栏显示前触发的事件
179
- */
180
- (e: 'bubbleShow', value: HTMLDivElement): void;
181
- /**
182
- * 气泡栏显示时触发的事件
183
- */
184
- (e: 'bubbleShowing', value: HTMLDivElement): void;
185
- /**
186
- * 气泡栏显示后触发的事件
187
- */
188
- (e: 'bubbleShown', value: HTMLDivElement): void;
189
- /**
190
- * 气泡栏隐藏前触发的事件
191
- */
192
- (e: 'bubbleHide', value: HTMLDivElement): void;
193
- /**
194
- * 气泡栏隐藏时触发的事件
195
- */
196
- (e: 'bubbleHiding', value: HTMLDivElement): void;
197
- /**
198
- * 气泡栏隐藏后触发的事件
199
- */
200
- (e: 'bubbleHidden', value: HTMLDivElement): void;
201
176
  };
202
177
  /**
203
178
  * 编辑器状态对象
204
179
  */
205
180
  export type StateType = {
206
- editor: Editor | null;
207
- selection: Selection | null;
181
+ editor?: Editor;
182
+ selection?: Selection;
208
183
  };
@@ -1,5 +1,8 @@
1
+ import { Ref } from 'vue';
2
+ import { Editor } from '@kaitify/core';
1
3
  import { StateType, WrapperPropsType } from './props';
2
4
  declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
3
6
  slots: {
4
7
  before?(_: {
5
8
  state: StateType;
@@ -13,30 +16,49 @@ declare function __VLS_template(): {
13
16
  after?(_: {
14
17
  state: StateType;
15
18
  }): any;
16
- bubble?(_: {
19
+ default?(_: {
17
20
  state: StateType;
18
21
  }): any;
19
22
  };
20
- refs: {};
21
- attrs: Partial<{}>;
23
+ refs: {
24
+ elRef: HTMLDivElement;
25
+ };
26
+ rootEl: any;
22
27
  };
23
28
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
24
29
  declare const __VLS_component: import('vue').DefineComponent<WrapperPropsType, {
25
- state: import('vue').ComputedRef<StateType>;
26
- elRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
27
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
28
- [x: string]: any;
29
- } & {
30
- [x: string]: any;
30
+ state: Ref<StateType, StateType>;
31
+ elRef: Ref<HTMLElement | undefined, HTMLElement | undefined>;
32
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
33
+ "update:modelValue": (value: string) => any;
34
+ selectionUpdate: (value: import('@kaitify/core').Selection) => any;
35
+ insertParagraph: (value: import('@kaitify/core').KNode) => any;
36
+ deleteComplete: () => any;
37
+ keydown: (value: KeyboardEvent) => any;
38
+ keyup: (value: KeyboardEvent) => any;
39
+ focus: (value: FocusEvent) => any;
40
+ blur: (value: FocusEvent) => any;
41
+ beforeUpdateView: () => any;
42
+ afterUpdateView: () => any;
43
+ created: (value: Editor) => any;
31
44
  }, string, import('vue').PublicProps, Readonly<WrapperPropsType> & Readonly<{
32
- [x: `on${Capitalize<any>}`]: ((...args: any) => any) | undefined;
45
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
46
+ onSelectionUpdate?: ((value: import('@kaitify/core').Selection) => any) | undefined;
47
+ onInsertParagraph?: ((value: import('@kaitify/core').KNode) => any) | undefined;
48
+ onDeleteComplete?: (() => any) | undefined;
49
+ onKeydown?: ((value: KeyboardEvent) => any) | undefined;
50
+ onKeyup?: ((value: KeyboardEvent) => any) | undefined;
51
+ onFocus?: ((value: FocusEvent) => any) | undefined;
52
+ onBlur?: ((value: FocusEvent) => any) | undefined;
53
+ onBeforeUpdateView?: (() => any) | undefined;
54
+ onAfterUpdateView?: (() => any) | undefined;
55
+ onCreated?: ((value: Editor) => any) | undefined;
33
56
  }>, {
57
+ dark: boolean;
34
58
  disabled: boolean;
35
59
  modelValue: string;
36
- placeholder: string;
37
- locale: import('../../locale').LocaleType;
38
60
  autofocus: boolean;
39
- dark: boolean;
61
+ placeholder: string;
40
62
  allowCopy: boolean;
41
63
  allowPaste: boolean;
42
64
  allowCut: boolean;
@@ -44,7 +66,10 @@ declare const __VLS_component: import('vue').DefineComponent<WrapperPropsType, {
44
66
  priorityPasteFiles: boolean;
45
67
  textRenderTag: string;
46
68
  blockRenderTag: string;
47
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
69
+ locale: import('../../locale').LocaleType;
70
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
71
+ elRef: HTMLDivElement;
72
+ }, any>;
48
73
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
49
74
  export default _default;
50
75
  type __VLS_WithTemplateSlots<T, S> = T & {
package/lib/index.d.ts CHANGED
@@ -4,4 +4,5 @@ export * from './core/tabs';
4
4
  export * from './core/checkbox';
5
5
  export * from './core/icon';
6
6
  export * from './editor/wrapper';
7
+ export * from './editor/bubble';
7
8
  export * from './editor/menu';