@kaitify/core 0.0.2-beta.9 → 0.0.2

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.
@@ -32,7 +32,7 @@ export type ExtensionCreateOptionType = {
32
32
  */
33
33
  onInsertParagraph?: (this: Editor, node: KNode) => void;
34
34
  /**
35
- * 完成删除回调
35
+ * 完成删除回调,此时还没有对起点和终点进行合并操作,也没有进行判空操作
36
36
  */
37
37
  onDeleteComplete?: (this: Editor) => void;
38
38
  /**
@@ -75,6 +75,10 @@ export type ExtensionCreateOptionType = {
75
75
  * 编辑器updateView执行时,通过比对新旧节点数组获取需要格式化的节点,在这些节点被格式化前,触发此方法,回调参数即当前需要被格式化的节点,该方法返回一个节点,返回的节点将会被格式化,如果你不需要任何特殊处理,返回入参提供的节点即可
76
76
  */
77
77
  onBeforePatchNodeToFormat?: (this: Editor, node: KNode) => KNode;
78
+ /**
79
+ * 编辑器进行光标纠正时触发,在这里可以修改虚拟光标的位置
80
+ */
81
+ onRedressSelection?: (this: Editor) => void;
78
82
  /**
79
83
  * 自定义命令
80
84
  */
@@ -117,7 +121,7 @@ export declare class Extension {
117
121
  */
118
122
  onInsertParagraph?: (this: Editor, node: KNode) => void;
119
123
  /**
120
- * 完成删除回调
124
+ * 完成删除回调,此时还没有对起点和终点进行合并操作,也没有进行判空操作
121
125
  */
122
126
  onDeleteComplete?: (this: Editor) => void;
123
127
  /**
@@ -160,6 +164,10 @@ export declare class Extension {
160
164
  * 编辑器updateView执行时,通过比对新旧节点数组获取需要格式化的节点,在这些节点被格式化前,触发此方法,回调参数即当前需要被格式化的节点,该方法返回一个节点,返回的节点将会被格式化,如果你不需要任何特殊处理,返回入参提供的节点即可
161
165
  */
162
166
  onBeforePatchNodeToFormat?: (this: Editor, node: KNode) => KNode;
167
+ /**
168
+ * 编辑器进行光标纠正时触发,在这里可以修改虚拟光标的位置
169
+ */
170
+ onRedressSelection?: (this: Editor) => void;
163
171
  /**
164
172
  * 自定义命令
165
173
  */
@@ -0,0 +1 @@
1
+ export declare const ATTACHMENT_NODE_TAG = "kaitify-attachment";
@@ -1,22 +1,31 @@
1
1
  import { KNode } from '../../model';
2
2
  import { Extension } from '../Extension';
3
+ /**
4
+ * 设置附件的参数类型
5
+ */
3
6
  export type SetAttachmentOptionType = {
4
7
  url: string;
5
8
  text: string;
6
9
  icon?: string;
7
10
  };
11
+ /**
12
+ * 更新附件的参数类型
13
+ */
8
14
  export type UpdateAttachmentOptionType = {
9
15
  url?: string;
10
16
  text?: string;
11
17
  icon?: string;
12
18
  };
19
+ /**
20
+ * 附件扩展入参类型
21
+ */
13
22
  export type AttachmentExtensionPropsType = {
14
23
  icon: string;
15
24
  };
16
25
  declare module '../../model' {
17
26
  interface EditorCommandsType {
18
27
  /**
19
- * 获取光标所在的附件节点,如果光标不在一个附件节点内,返回null
28
+ * 获取光标所在的附件节点
20
29
  */
21
30
  getAttachment?: () => KNode | null;
22
31
  /**
@@ -29,5 +29,11 @@ declare module '../../model' {
29
29
  updateCodeBlockLanguage?: (language: HljsLanguageType) => Promise<void>;
30
30
  }
31
31
  }
32
- export declare const CodeBlockExtension: () => Extension;
32
+ export type CodeBlockExtensionPropsType = {
33
+ /**
34
+ * 复制代码的具体实现
35
+ */
36
+ handleCopy?: (code: string) => void;
37
+ };
38
+ export declare const CodeBlockExtension: (props?: CodeBlockExtensionPropsType) => Extension;
33
39
  export * from './hljs';
@@ -0,0 +1 @@
1
+ export declare const HORIZONTAL_NODE_TAG = "kaitify-horizontal";
@@ -1,8 +1,17 @@
1
+ import { KNode } from '../../model';
1
2
  import { Extension } from '../Extension';
2
3
  declare module '../../model' {
3
4
  interface EditorCommandsType {
4
5
  /**
5
- * 设置分隔线
6
+ * 获取光标所在的水平线节点
7
+ */
8
+ getHorizontal?: () => KNode | null;
9
+ /**
10
+ * 判断光标范围内是否有水平线节点
11
+ */
12
+ hasHorizontal?: () => boolean;
13
+ /**
14
+ * 设置水平线
6
15
  */
7
16
  setHorizontal?: () => Promise<void>;
8
17
  }
@@ -0,0 +1 @@
1
+ export declare const IMAGE_NODE_TAG = "kaitify-image";
@@ -0,0 +1 @@
1
+ export declare const MATH_NODE_TAG = "kaitify-math";
@@ -0,0 +1 @@
1
+ export declare const TASK_CHECKBOX_NODE_TAG = "kaitify-task-checkbox";
@@ -0,0 +1 @@
1
+ export declare const VIDEO_NODE_TAG = "kaitify-video";