@kaitify/core 0.0.2-beta.17 → 0.0.2-beta.19
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.
- package/lib/extensions/Extension.d.ts +2 -2
- package/lib/extensions/attachment/element.d.ts +1 -0
- package/lib/extensions/attachment/index.d.ts +10 -1
- package/lib/extensions/code-block/index.d.ts +7 -1
- package/lib/extensions/horizontal/element.d.ts +1 -0
- package/lib/extensions/horizontal/index.d.ts +10 -1
- package/lib/extensions/image/element.d.ts +1 -0
- package/lib/extensions/math/element.d.ts +1 -0
- package/lib/extensions/task/element.d.ts +1 -0
- package/lib/extensions/video/element.d.ts +1 -0
- package/lib/kaitify-core.es.js +1236 -829
- package/lib/kaitify-core.umd.js +2 -2
- package/lib/model/Editor.d.ts +17 -3
- package/lib/model/KNode.d.ts +12 -11
- package/lib/model/config/event-handler.d.ts +1 -1
- package/lib/model/config/format-rules.d.ts +5 -5
- package/package.json +1 -1
|
@@ -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
|
/**
|
|
@@ -121,7 +121,7 @@ export declare class Extension {
|
|
|
121
121
|
*/
|
|
122
122
|
onInsertParagraph?: (this: Editor, node: KNode) => void;
|
|
123
123
|
/**
|
|
124
|
-
*
|
|
124
|
+
* 完成删除回调,此时还没有对起点和终点进行合并操作,也没有进行判空操作
|
|
125
125
|
*/
|
|
126
126
|
onDeleteComplete?: (this: Editor) => void;
|
|
127
127
|
/**
|
|
@@ -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
|
-
*
|
|
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
|
|
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";
|