@kaitify/vue 0.0.1-beta.1

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 (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/lib/core/button/button.vue.d.ts +22 -0
  4. package/lib/core/button/index.d.ts +3 -0
  5. package/lib/core/button/props.d.ts +21 -0
  6. package/lib/core/checkbox/checkbox.vue.d.ts +10 -0
  7. package/lib/core/checkbox/index.d.ts +3 -0
  8. package/lib/core/checkbox/props.d.ts +14 -0
  9. package/lib/core/divider/divider.vue.d.ts +2 -0
  10. package/lib/core/divider/index.d.ts +2 -0
  11. package/lib/core/icon/icon.vue.d.ts +5 -0
  12. package/lib/core/icon/index.d.ts +3 -0
  13. package/lib/core/icon/props.d.ts +6 -0
  14. package/lib/core/popover/index.d.ts +3 -0
  15. package/lib/core/popover/popover.vue.d.ts +52 -0
  16. package/lib/core/popover/props.d.ts +49 -0
  17. package/lib/core/tabs/index.d.ts +3 -0
  18. package/lib/core/tabs/props.d.ts +9 -0
  19. package/lib/core/tabs/tabs.vue.d.ts +21 -0
  20. package/lib/editor/bubble/bubble.vue.d.ts +40 -0
  21. package/lib/editor/bubble/index.d.ts +3 -0
  22. package/lib/editor/bubble/props.d.ts +18 -0
  23. package/lib/editor/menu/built-in/align-center/align-center.vue.d.ts +5 -0
  24. package/lib/editor/menu/built-in/align-center/index.d.ts +3 -0
  25. package/lib/editor/menu/built-in/align-center/props.d.ts +10 -0
  26. package/lib/editor/menu/built-in/align-justify/align-justify.vue.d.ts +5 -0
  27. package/lib/editor/menu/built-in/align-justify/index.d.ts +3 -0
  28. package/lib/editor/menu/built-in/align-justify/props.d.ts +10 -0
  29. package/lib/editor/menu/built-in/align-left/align-left.vue.d.ts +5 -0
  30. package/lib/editor/menu/built-in/align-left/index.d.ts +3 -0
  31. package/lib/editor/menu/built-in/align-left/props.d.ts +10 -0
  32. package/lib/editor/menu/built-in/align-right/align-right.vue.d.ts +5 -0
  33. package/lib/editor/menu/built-in/align-right/index.d.ts +3 -0
  34. package/lib/editor/menu/built-in/align-right/props.d.ts +10 -0
  35. package/lib/editor/menu/built-in/attachment/attachment.vue.d.ts +5 -0
  36. package/lib/editor/menu/built-in/attachment/index.d.ts +3 -0
  37. package/lib/editor/menu/built-in/attachment/props.d.ts +19 -0
  38. package/lib/editor/menu/built-in/back-color/back-color.vue.d.ts +6 -0
  39. package/lib/editor/menu/built-in/back-color/index.d.ts +3 -0
  40. package/lib/editor/menu/built-in/back-color/props.d.ts +15 -0
  41. package/lib/editor/menu/built-in/blockquote/blockquote.vue.d.ts +5 -0
  42. package/lib/editor/menu/built-in/blockquote/index.d.ts +3 -0
  43. package/lib/editor/menu/built-in/blockquote/props.d.ts +10 -0
  44. package/lib/editor/menu/built-in/bold/bold.vue.d.ts +5 -0
  45. package/lib/editor/menu/built-in/bold/index.d.ts +3 -0
  46. package/lib/editor/menu/built-in/bold/props.d.ts +10 -0
  47. package/lib/editor/menu/built-in/clear-format/clear-format.vue.d.ts +5 -0
  48. package/lib/editor/menu/built-in/clear-format/index.d.ts +3 -0
  49. package/lib/editor/menu/built-in/clear-format/props.d.ts +10 -0
  50. package/lib/editor/menu/built-in/code/code.vue.d.ts +5 -0
  51. package/lib/editor/menu/built-in/code/index.d.ts +3 -0
  52. package/lib/editor/menu/built-in/code/props.d.ts +10 -0
  53. package/lib/editor/menu/built-in/code-block/code-block-languages.vue.d.ts +7 -0
  54. package/lib/editor/menu/built-in/code-block/code-block.vue.d.ts +5 -0
  55. package/lib/editor/menu/built-in/code-block/index.d.ts +4 -0
  56. package/lib/editor/menu/built-in/code-block/props.d.ts +32 -0
  57. package/lib/editor/menu/built-in/color/color.vue.d.ts +6 -0
  58. package/lib/editor/menu/built-in/color/index.d.ts +3 -0
  59. package/lib/editor/menu/built-in/color/props.d.ts +15 -0
  60. package/lib/editor/menu/built-in/decrease-indent/decrease-indent.vue.d.ts +5 -0
  61. package/lib/editor/menu/built-in/decrease-indent/index.d.ts +3 -0
  62. package/lib/editor/menu/built-in/decrease-indent/props.d.ts +10 -0
  63. package/lib/editor/menu/built-in/font-family/font-family.vue.d.ts +7 -0
  64. package/lib/editor/menu/built-in/font-family/index.d.ts +3 -0
  65. package/lib/editor/menu/built-in/font-family/props.d.ts +21 -0
  66. package/lib/editor/menu/built-in/font-size/font-size.vue.d.ts +7 -0
  67. package/lib/editor/menu/built-in/font-size/index.d.ts +3 -0
  68. package/lib/editor/menu/built-in/font-size/props.d.ts +21 -0
  69. package/lib/editor/menu/built-in/heading/heading.vue.d.ts +7 -0
  70. package/lib/editor/menu/built-in/heading/index.d.ts +3 -0
  71. package/lib/editor/menu/built-in/heading/props.d.ts +21 -0
  72. package/lib/editor/menu/built-in/horizontal/horizontal.vue.d.ts +5 -0
  73. package/lib/editor/menu/built-in/horizontal/index.d.ts +3 -0
  74. package/lib/editor/menu/built-in/horizontal/props.d.ts +10 -0
  75. package/lib/editor/menu/built-in/image/image.vue.d.ts +5 -0
  76. package/lib/editor/menu/built-in/image/index.d.ts +3 -0
  77. package/lib/editor/menu/built-in/image/props.d.ts +19 -0
  78. package/lib/editor/menu/built-in/increase-indent/increase-indent.vue.d.ts +5 -0
  79. package/lib/editor/menu/built-in/increase-indent/index.d.ts +3 -0
  80. package/lib/editor/menu/built-in/increase-indent/props.d.ts +10 -0
  81. package/lib/editor/menu/built-in/index.d.ts +36 -0
  82. package/lib/editor/menu/built-in/italic/index.d.ts +3 -0
  83. package/lib/editor/menu/built-in/italic/italic.vue.d.ts +5 -0
  84. package/lib/editor/menu/built-in/italic/props.d.ts +10 -0
  85. package/lib/editor/menu/built-in/line-height/index.d.ts +3 -0
  86. package/lib/editor/menu/built-in/line-height/line-height.vue.d.ts +8 -0
  87. package/lib/editor/menu/built-in/line-height/props.d.ts +25 -0
  88. package/lib/editor/menu/built-in/link/index.d.ts +4 -0
  89. package/lib/editor/menu/built-in/link/link-unset.vue.d.ts +5 -0
  90. package/lib/editor/menu/built-in/link/link.vue.d.ts +5 -0
  91. package/lib/editor/menu/built-in/link/props.d.ts +21 -0
  92. package/lib/editor/menu/built-in/math/index.d.ts +3 -0
  93. package/lib/editor/menu/built-in/math/math.vue.d.ts +5 -0
  94. package/lib/editor/menu/built-in/math/props.d.ts +11 -0
  95. package/lib/editor/menu/built-in/ordered-list/index.d.ts +3 -0
  96. package/lib/editor/menu/built-in/ordered-list/ordered-list.vue.d.ts +5 -0
  97. package/lib/editor/menu/built-in/ordered-list/props.d.ts +11 -0
  98. package/lib/editor/menu/built-in/redo/index.d.ts +3 -0
  99. package/lib/editor/menu/built-in/redo/props.d.ts +6 -0
  100. package/lib/editor/menu/built-in/redo/redo.vue.d.ts +5 -0
  101. package/lib/editor/menu/built-in/strikethrough/index.d.ts +3 -0
  102. package/lib/editor/menu/built-in/strikethrough/props.d.ts +10 -0
  103. package/lib/editor/menu/built-in/strikethrough/strikethrough.vue.d.ts +5 -0
  104. package/lib/editor/menu/built-in/subscript/index.d.ts +3 -0
  105. package/lib/editor/menu/built-in/subscript/props.d.ts +10 -0
  106. package/lib/editor/menu/built-in/subscript/subscript.vue.d.ts +5 -0
  107. package/lib/editor/menu/built-in/superscript/index.d.ts +3 -0
  108. package/lib/editor/menu/built-in/superscript/props.d.ts +10 -0
  109. package/lib/editor/menu/built-in/superscript/superscript.vue.d.ts +5 -0
  110. package/lib/editor/menu/built-in/table/index.d.ts +9 -0
  111. package/lib/editor/menu/built-in/table/props.d.ts +97 -0
  112. package/lib/editor/menu/built-in/table/table-add-column.vue.d.ts +5 -0
  113. package/lib/editor/menu/built-in/table/table-add-row.vue.d.ts +5 -0
  114. package/lib/editor/menu/built-in/table/table-delete-column.vue.d.ts +5 -0
  115. package/lib/editor/menu/built-in/table/table-delete-row.vue.d.ts +5 -0
  116. package/lib/editor/menu/built-in/table/table-merge-cell.vue.d.ts +5 -0
  117. package/lib/editor/menu/built-in/table/table-unset.vue.d.ts +5 -0
  118. package/lib/editor/menu/built-in/table/table.vue.d.ts +7 -0
  119. package/lib/editor/menu/built-in/task/index.d.ts +3 -0
  120. package/lib/editor/menu/built-in/task/props.d.ts +10 -0
  121. package/lib/editor/menu/built-in/task/task.vue.d.ts +5 -0
  122. package/lib/editor/menu/built-in/underline/index.d.ts +3 -0
  123. package/lib/editor/menu/built-in/underline/props.d.ts +10 -0
  124. package/lib/editor/menu/built-in/underline/underline.vue.d.ts +5 -0
  125. package/lib/editor/menu/built-in/undo/index.d.ts +3 -0
  126. package/lib/editor/menu/built-in/undo/props.d.ts +6 -0
  127. package/lib/editor/menu/built-in/undo/undo.vue.d.ts +5 -0
  128. package/lib/editor/menu/built-in/unordered-list/index.d.ts +3 -0
  129. package/lib/editor/menu/built-in/unordered-list/props.d.ts +11 -0
  130. package/lib/editor/menu/built-in/unordered-list/unordered-list.vue.d.ts +5 -0
  131. package/lib/editor/menu/built-in/video/index.d.ts +6 -0
  132. package/lib/editor/menu/built-in/video/props.d.ts +49 -0
  133. package/lib/editor/menu/built-in/video/video-controls.vue.d.ts +5 -0
  134. package/lib/editor/menu/built-in/video/video-loop.vue.d.ts +5 -0
  135. package/lib/editor/menu/built-in/video/video-muted.vue.d.ts +5 -0
  136. package/lib/editor/menu/built-in/video/video.vue.d.ts +5 -0
  137. package/lib/editor/menu/built-in/wrap-down/index.d.ts +3 -0
  138. package/lib/editor/menu/built-in/wrap-down/props.d.ts +15 -0
  139. package/lib/editor/menu/built-in/wrap-down/wrap-down.vue.d.ts +5 -0
  140. package/lib/editor/menu/built-in/wrap-up/index.d.ts +3 -0
  141. package/lib/editor/menu/built-in/wrap-up/props.d.ts +15 -0
  142. package/lib/editor/menu/built-in/wrap-up/wrap-up.vue.d.ts +5 -0
  143. package/lib/editor/menu/index.d.ts +4 -0
  144. package/lib/editor/menu/menu.vue.d.ts +164 -0
  145. package/lib/editor/menu/props.d.ts +57 -0
  146. package/lib/editor/wrapper/index.d.ts +3 -0
  147. package/lib/editor/wrapper/props.d.ts +133 -0
  148. package/lib/editor/wrapper/render.d.ts +13 -0
  149. package/lib/editor/wrapper/wrapper.vue.d.ts +79 -0
  150. package/lib/index.d.ts +4 -0
  151. package/lib/kaitify-vue.es.js +44470 -0
  152. package/lib/kaitify-vue.umd.js +2 -0
  153. package/lib/locale/en-us.d.ts +24 -0
  154. package/lib/locale/index.d.ts +2 -0
  155. package/package.json +50 -0
@@ -0,0 +1,133 @@
1
+ import { LocaleType } from '../../locale';
2
+ import { Editor, Extension, KNode, KNodeMarksType, KNodeStylesType, RuleFunctionType, Selection } from '@kaitify/core';
3
+ import { BubblePropsType } from '../bubble';
4
+ /**
5
+ * 编辑器参数类型
6
+ */
7
+ export type WrapperPropsType = {
8
+ /**
9
+ * 编辑器的值
10
+ */
11
+ modelValue: string;
12
+ /**
13
+ * 编辑器是否禁用
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * 语言环境
18
+ */
19
+ locale?: LocaleType;
20
+ /**
21
+ * 鼠标按下时是否不显示气泡栏
22
+ */
23
+ hideBubbleOnMousedown?: boolean;
24
+ /**
25
+ * bubble气泡栏参数
26
+ */
27
+ bubbleProps?: BubblePropsType;
28
+ /**
29
+ * 是否自动聚焦
30
+ */
31
+ autofocus?: boolean;
32
+ /**
33
+ * 编辑器内容只有一个段落时的默认文本
34
+ */
35
+ placeholder?: string;
36
+ /**
37
+ * 是否深色模式
38
+ */
39
+ dark?: boolean;
40
+ /**
41
+ * 是否允许复制
42
+ */
43
+ allowCopy?: boolean;
44
+ /**
45
+ * 是否允许粘贴
46
+ */
47
+ allowPaste?: boolean;
48
+ /**
49
+ * 是否允许剪切
50
+ */
51
+ allowCut?: boolean;
52
+ /**
53
+ * 是否允许粘贴html
54
+ */
55
+ allowPasteHtml?: boolean;
56
+ /**
57
+ * 剪切板同时存在文件和html/text时,是否优先粘贴文件
58
+ */
59
+ priorityPasteFiles?: boolean;
60
+ /**
61
+ * 自定义编辑器内渲染文本节点的真实标签
62
+ */
63
+ textRenderTag?: string;
64
+ /**
65
+ * 自定义编辑内渲染默认块级节点的真实标签,即段落标签
66
+ */
67
+ blockRenderTag?: string;
68
+ /**
69
+ * 自定义编辑器内定义需要置空的标签
70
+ */
71
+ emptyRenderTags?: string[];
72
+ /**
73
+ * 自定义编辑器内额外保留的标签
74
+ */
75
+ extraKeepTags?: string[];
76
+ /**
77
+ * 自定义插件数组
78
+ */
79
+ extensions?: Extension[];
80
+ /**
81
+ * 自定义节点数组格式化规则
82
+ */
83
+ formatRules?: RuleFunctionType[];
84
+ /**
85
+ * 自定义dom转为非文本节点的后续处理
86
+ */
87
+ domParseNodeCallback?: (this: Editor, node: KNode) => KNode;
88
+ /**
89
+ * 节点粘贴保留标记的自定义方法
90
+ */
91
+ pasteKeepMarks?: (this: Editor, node: KNode) => KNodeMarksType;
92
+ /**
93
+ * 节点粘贴保留样式的自定义方法
94
+ */
95
+ pasteKeepStyles?: (this: Editor, node: KNode) => KNodeStylesType;
96
+ /**
97
+ * 编辑器粘贴纯文本时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
98
+ */
99
+ onPasteText?: (this: Editor, text: string) => boolean | Promise<boolean>;
100
+ /**
101
+ * 编辑器粘贴html内容时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
102
+ */
103
+ onPasteHtml?: (this: Editor, nodes: KNode[], html: string) => boolean | Promise<boolean>;
104
+ /**
105
+ * 编辑器粘贴图片时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
106
+ */
107
+ onPasteImage?: (this: Editor, file: File) => boolean | Promise<boolean>;
108
+ /**
109
+ * 编辑器粘贴视频时触发,如果返回true则表示继续使用默认逻辑,返回false则不走默认逻辑,需要进行自定义处理
110
+ */
111
+ onPasteVideo?: (this: Editor, file: File) => boolean | Promise<boolean>;
112
+ /**
113
+ * 编辑器粘贴除了图片和视频以外的文件时触发,需要自定义处理
114
+ */
115
+ onPasteFile?: (this: Editor, file: File) => void | Promise<void>;
116
+ /**
117
+ * 在删除和换行操作中块节点节点从其父节点中抽离出去成为与父节点同级的节点后触发,如果返回true则表示继续使用默认逻辑,会将该节点转为段落,返回false则不走默认逻辑,需要自定义处理
118
+ */
119
+ onDetachMentBlockFromParentCallback?: (this: Editor, node: KNode) => boolean;
120
+ /**
121
+ * 编辑器updateView执行时,通过比对新旧节点数组获取需要格式化的节点,在这些节点被格式化前,触发此方法,回调参数即当前需要被格式化的节点,该方法返回一个节点,返回的节点将会被格式化,如果你不需要任何特殊处理,返回入参提供的节点即可
122
+ */
123
+ beforePatchNodeToFormat?: (this: Editor, node: KNode) => KNode;
124
+ };
125
+ /**
126
+ * 编辑器状态对象
127
+ */
128
+ export type StateType = {
129
+ editor?: Editor;
130
+ selection?: Selection;
131
+ locale: LocaleType;
132
+ t: (key: string) => string;
133
+ };
@@ -0,0 +1,13 @@
1
+ import { Editor, KNodeRenderOptionType } from '@kaitify/core';
2
+ /**
3
+ * 生成VNode
4
+ */
5
+ export declare const createVNode: (options: KNodeRenderOptionType) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
6
+ [key: string]: any;
7
+ }>;
8
+ /**
9
+ * 创建VNode数组
10
+ */
11
+ export declare const createVNodes: (editor: Editor) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
+ [key: string]: any;
13
+ }>[];
@@ -0,0 +1,79 @@
1
+ import { StateType, WrapperPropsType } from './props';
2
+ declare function __VLS_template(): {
3
+ slots: {
4
+ before?(_: {
5
+ state: StateType;
6
+ }): any;
7
+ after?(_: {
8
+ state: StateType;
9
+ }): any;
10
+ bubble?(_: {
11
+ state: StateType;
12
+ }): any;
13
+ };
14
+ refs: {};
15
+ attrs: Partial<{}>;
16
+ };
17
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
18
+ declare const __VLS_component: import('vue').DefineComponent<WrapperPropsType, {
19
+ elRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
20
+ state: import('vue').ComputedRef<StateType>;
21
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
+ blur: (...args: any[]) => void;
23
+ focus: (...args: any[]) => void;
24
+ keydown: (...args: any[]) => void;
25
+ keyup: (...args: any[]) => void;
26
+ "update:modelValue": (...args: any[]) => void;
27
+ selectionUpdate: (...args: any[]) => void;
28
+ insertParagraph: (...args: any[]) => void;
29
+ deleteComplete: (...args: any[]) => void;
30
+ beforeUpdateView: (...args: any[]) => void;
31
+ afterUpdateView: (...args: any[]) => void;
32
+ created: (...args: any[]) => void;
33
+ bubbleShow: (...args: any[]) => void;
34
+ bubbleShowing: (...args: any[]) => void;
35
+ bubbleShown: (...args: any[]) => void;
36
+ bubbleHide: (...args: any[]) => void;
37
+ bubbleHiding: (...args: any[]) => void;
38
+ bubbleHidden: (...args: any[]) => void;
39
+ }, string, import('vue').PublicProps, Readonly<WrapperPropsType> & Readonly<{
40
+ onBlur?: ((...args: any[]) => any) | undefined;
41
+ onFocus?: ((...args: any[]) => any) | undefined;
42
+ onKeydown?: ((...args: any[]) => any) | undefined;
43
+ onKeyup?: ((...args: any[]) => any) | undefined;
44
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
45
+ onSelectionUpdate?: ((...args: any[]) => any) | undefined;
46
+ onInsertParagraph?: ((...args: any[]) => any) | undefined;
47
+ onDeleteComplete?: ((...args: any[]) => any) | undefined;
48
+ onBeforeUpdateView?: ((...args: any[]) => any) | undefined;
49
+ onAfterUpdateView?: ((...args: any[]) => any) | undefined;
50
+ onCreated?: ((...args: any[]) => any) | undefined;
51
+ onBubbleShow?: ((...args: any[]) => any) | undefined;
52
+ onBubbleShowing?: ((...args: any[]) => any) | undefined;
53
+ onBubbleShown?: ((...args: any[]) => any) | undefined;
54
+ onBubbleHide?: ((...args: any[]) => any) | undefined;
55
+ onBubbleHiding?: ((...args: any[]) => any) | undefined;
56
+ onBubbleHidden?: ((...args: any[]) => any) | undefined;
57
+ }>, {
58
+ disabled: boolean;
59
+ modelValue: string;
60
+ locale: import('../../locale').LocaleType;
61
+ hideBubbleOnMousedown: boolean;
62
+ autofocus: boolean;
63
+ placeholder: string;
64
+ dark: boolean;
65
+ allowCopy: boolean;
66
+ allowPaste: boolean;
67
+ allowCut: boolean;
68
+ allowPasteHtml: boolean;
69
+ priorityPasteFiles: boolean;
70
+ textRenderTag: string;
71
+ blockRenderTag: string;
72
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
73
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
74
+ export default _default;
75
+ type __VLS_WithTemplateSlots<T, S> = T & {
76
+ new (): {
77
+ $slots: S;
78
+ };
79
+ };
package/lib/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export * from '@kaitify/core';
2
+ export * from './core/divider';
3
+ export * from './editor/wrapper';
4
+ export * from './editor/menu';