dragon-editor 3.8.7 → 4.0.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.
- package/README.md +10 -9
- package/dist/module.json +1 -1
- package/dist/module.mjs +9 -7
- package/dist/runtime/components/Block/Code.d.vue.ts +13 -0
- package/dist/runtime/components/Block/Code.vue +193 -0
- package/dist/runtime/components/Block/Code.vue.d.ts +13 -0
- package/dist/runtime/components/Block/Custom.d.vue.ts +9 -0
- package/dist/runtime/components/Block/Custom.vue +28 -0
- package/dist/runtime/components/Block/Custom.vue.d.ts +9 -0
- package/dist/runtime/components/Block/Divider.d.vue.ts +9 -0
- package/dist/runtime/components/Block/Divider.vue +27 -0
- package/dist/runtime/components/Block/Divider.vue.d.ts +9 -0
- package/dist/runtime/components/Block/Heading.d.vue.ts +13 -0
- package/dist/runtime/components/Block/Heading.vue +84 -0
- package/dist/runtime/components/Block/Heading.vue.d.ts +13 -0
- package/dist/runtime/components/Block/Image.d.vue.ts +13 -0
- package/dist/runtime/components/Block/Image.vue +146 -0
- package/dist/runtime/components/Block/Image.vue.d.ts +13 -0
- package/dist/runtime/components/Block/List.d.vue.ts +13 -0
- package/dist/runtime/components/Block/List.vue +170 -0
- package/dist/runtime/components/Block/List.vue.d.ts +13 -0
- package/dist/runtime/components/Block/Text.d.vue.ts +13 -0
- package/dist/runtime/components/Block/Text.vue +84 -0
- package/dist/runtime/components/Block/Text.vue.d.ts +13 -0
- package/dist/runtime/components/DragonEditor.d.vue.ts +27 -22
- package/dist/runtime/components/DragonEditor.vue +311 -474
- package/dist/runtime/components/DragonEditor.vue.d.ts +27 -22
- package/dist/runtime/components/DragonEditorViewer.d.vue.ts +12 -5
- package/dist/runtime/components/DragonEditorViewer.vue +200 -227
- package/dist/runtime/components/DragonEditorViewer.vue.d.ts +12 -5
- package/dist/runtime/components/MenuBar.d.vue.ts +3 -0
- package/dist/runtime/components/MenuBar.vue +385 -0
- package/dist/runtime/components/MenuBar.vue.d.ts +3 -0
- package/dist/runtime/scss/editor.css +237 -283
- package/dist/runtime/scss/viewer.css +184 -210
- package/dist/runtime/store/editor.d.ts +2 -0
- package/dist/runtime/store/editor.js +59 -0
- package/dist/runtime/type.d.mts +101 -124
- package/dist/runtime/utils/data/block.d.ts +20 -0
- package/dist/runtime/utils/data/block.js +663 -0
- package/dist/runtime/utils/data/cursor.d.ts +9 -0
- package/dist/runtime/utils/data/cursor.js +137 -0
- package/dist/runtime/utils/data/index.d.ts +5 -0
- package/dist/runtime/utils/data/index.js +17 -0
- package/dist/runtime/utils/data/node.d.ts +9 -0
- package/dist/runtime/utils/data/node.js +101 -0
- package/dist/runtime/utils/event/cursor.d.ts +3 -6
- package/dist/runtime/utils/event/cursor.js +52 -105
- package/dist/runtime/utils/event/index.d.ts +2 -6
- package/dist/runtime/utils/event/index.js +48 -6
- package/dist/runtime/utils/event/keyboard.d.ts +22 -7
- package/dist/runtime/utils/event/keyboard.js +910 -1406
- package/dist/runtime/utils/layout/body.d.ts +3 -4
- package/dist/runtime/utils/layout/body.js +83 -51
- package/dist/runtime/utils/layout/icon.d.ts +1 -2
- package/dist/runtime/utils/layout/icon.js +64 -67
- package/dist/runtime/utils/layout/index.d.ts +0 -3
- package/dist/runtime/utils/layout/index.js +0 -3
- package/dist/runtime/utils/node/element.d.ts +4 -6
- package/dist/runtime/utils/node/element.js +58 -71
- package/dist/runtime/utils/node/index.d.ts +1 -1
- package/dist/runtime/utils/node/index.js +1 -1
- package/dist/runtime/utils/node/style.d.ts +5 -0
- package/dist/runtime/utils/node/style.js +702 -0
- package/package.json +32 -18
- package/dist/runtime/utils/event/block.d.ts +0 -7
- package/dist/runtime/utils/event/block.js +0 -110
- package/dist/runtime/utils/event/data.d.ts +0 -8
- package/dist/runtime/utils/event/data.js +0 -379
- package/dist/runtime/utils/event/mouse.d.ts +0 -11
- package/dist/runtime/utils/event/mouse.js +0 -85
- package/dist/runtime/utils/event/scroll.d.ts +0 -3
- package/dist/runtime/utils/event/scroll.js +0 -29
- package/dist/runtime/utils/event/touch.d.ts +0 -5
- package/dist/runtime/utils/event/touch.js +0 -10
- package/dist/runtime/utils/event/window.d.ts +0 -5
- package/dist/runtime/utils/event/window.js +0 -47
- package/dist/runtime/utils/layout/block.d.ts +0 -7
- package/dist/runtime/utils/layout/block.js +0 -123
- package/dist/runtime/utils/layout/controlbar.d.ts +0 -3
- package/dist/runtime/utils/layout/controlbar.js +0 -99
- package/dist/runtime/utils/layout/menuBar.d.ts +0 -3
- package/dist/runtime/utils/layout/menuBar.js +0 -408
- package/dist/runtime/utils/node/block.d.ts +0 -19
- package/dist/runtime/utils/node/block.js +0 -256
- package/dist/runtime/utils/style/anchor.d.ts +0 -5
- package/dist/runtime/utils/style/anchor.js +0 -245
- package/dist/runtime/utils/style/decoration.d.ts +0 -4
- package/dist/runtime/utils/style/decoration.js +0 -378
- package/dist/runtime/utils/style/index.d.ts +0 -2
- package/dist/runtime/utils/style/index.js +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { VNode
|
|
2
|
-
import type {
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function _updateBodyStructure(bodyData: DEContentData, store: Ref<DragonEditorStore>): void;
|
|
1
|
+
import type { VNode } from "vue";
|
|
2
|
+
import type { DEContentData } from "../../type.mjs.js";
|
|
3
|
+
export declare function _getBody(data: DEContentData, isEdit?: boolean): VNode;
|
|
@@ -1,60 +1,92 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
2
|
+
import TextBlock from "../../components/Block/Text.vue";
|
|
3
|
+
import HeadingBlock from "../../components/Block/Heading.vue";
|
|
4
|
+
import ListBlock from "../../components/Block/List.vue";
|
|
5
|
+
import ImageBlock from "../../components/Block/Image.vue";
|
|
6
|
+
import CodeBlock from "../../components/Block/Code.vue";
|
|
7
|
+
import DividerBlock from "../../components/Block/Divider.vue";
|
|
8
|
+
import CustomBlock from "../../components/Block/Custom.vue";
|
|
9
|
+
import { useEditorStore } from "../../store/editor.js";
|
|
10
|
+
import { _generateId } from "../data/index.js";
|
|
11
|
+
import { _updateCursorData, _hotKeyEvent } from "../event/index.js";
|
|
12
|
+
export function _getBody(data, isEdit = false) {
|
|
13
|
+
const editorStore = useEditorStore();
|
|
14
|
+
const blockList = [];
|
|
15
|
+
data.forEach((block, index) => {
|
|
16
|
+
let component;
|
|
17
|
+
if (block.id === "" || block.id === null || block.id === void 0) {
|
|
18
|
+
block.id = _generateId();
|
|
19
|
+
}
|
|
20
|
+
switch (block.type) {
|
|
21
|
+
case "text":
|
|
22
|
+
component = TextBlock;
|
|
23
|
+
break;
|
|
24
|
+
case "heading":
|
|
25
|
+
component = HeadingBlock;
|
|
26
|
+
break;
|
|
27
|
+
case "list":
|
|
28
|
+
component = ListBlock;
|
|
29
|
+
block.child.forEach((child) => {
|
|
30
|
+
if (child.id === "" || child.id === null || child.id === void 0) {
|
|
31
|
+
child.id = _generateId();
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
break;
|
|
35
|
+
case "image":
|
|
36
|
+
component = ImageBlock;
|
|
37
|
+
break;
|
|
38
|
+
case "code":
|
|
39
|
+
component = CodeBlock;
|
|
40
|
+
break;
|
|
41
|
+
case "divider":
|
|
42
|
+
component = DividerBlock;
|
|
43
|
+
break;
|
|
44
|
+
case "custom":
|
|
45
|
+
component = CustomBlock;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
if (component !== void 0) {
|
|
49
|
+
blockList.push(
|
|
50
|
+
h(component, {
|
|
51
|
+
data: block,
|
|
52
|
+
isEdit,
|
|
53
|
+
index,
|
|
54
|
+
onUpdate: (newBlockData) => {
|
|
55
|
+
const newData = JSON.parse(JSON.stringify(data));
|
|
56
|
+
if (newData[index] !== void 0) {
|
|
57
|
+
newData[index] = newBlockData;
|
|
58
|
+
}
|
|
59
|
+
if (editorStore.fn.updateEditorData !== null) {
|
|
60
|
+
editorStore.fn.updateEditorData(newData);
|
|
61
|
+
} else {
|
|
62
|
+
console.error("[Dragon Editor]: Editor initialize fail.");
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
key: `block-${block.id}`
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
});
|
|
6
70
|
return h(
|
|
7
71
|
"div",
|
|
8
72
|
{
|
|
9
|
-
class: ["de-body"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
73
|
+
class: ["de-body"],
|
|
74
|
+
onMouseup: () => {
|
|
75
|
+
_updateCursorData();
|
|
76
|
+
endImageResizeEvent();
|
|
77
|
+
},
|
|
78
|
+
onKeydown: _hotKeyEvent,
|
|
79
|
+
onKeyup: _updateCursorData,
|
|
80
|
+
onMouseleave: endImageResizeEvent,
|
|
81
|
+
onTouchcancel: endImageResizeEvent,
|
|
82
|
+
onTouchend: endImageResizeEvent
|
|
16
83
|
},
|
|
17
|
-
|
|
18
|
-
blockList: store.value.firstData,
|
|
19
|
-
isEditable: true,
|
|
20
|
-
imageHostURL: store.value.imageHostURL
|
|
21
|
-
})
|
|
84
|
+
blockList
|
|
22
85
|
);
|
|
23
86
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
htmlSturcutre += _createTextBlock(_getDefaultBlockData("text")).outerHTML;
|
|
29
|
-
} else {
|
|
30
|
-
bodyData.forEach((data) => {
|
|
31
|
-
switch (data.type) {
|
|
32
|
-
case "text":
|
|
33
|
-
htmlSturcutre += _createTextBlock(data).outerHTML;
|
|
34
|
-
break;
|
|
35
|
-
case "heading":
|
|
36
|
-
htmlSturcutre += _createHeadingBlock(data).outerHTML;
|
|
37
|
-
break;
|
|
38
|
-
case "image":
|
|
39
|
-
htmlSturcutre += _createImageBlock(data, store.value.imageHostURL).outerHTML;
|
|
40
|
-
break;
|
|
41
|
-
case "list":
|
|
42
|
-
htmlSturcutre += _createListBlock(data).outerHTML;
|
|
43
|
-
break;
|
|
44
|
-
case "code":
|
|
45
|
-
htmlSturcutre += _createCodeBlock(data, store).outerHTML;
|
|
46
|
-
break;
|
|
47
|
-
case "divider":
|
|
48
|
-
htmlSturcutre += _createDividerBlock().outerHTML;
|
|
49
|
-
break;
|
|
50
|
-
default:
|
|
51
|
-
htmlSturcutre += _createCustomBlock(data).outerHTML;
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
store.value.$body.innerHTML = htmlSturcutre;
|
|
56
|
-
setTimeout(() => {
|
|
57
|
-
_updateModelData(store);
|
|
58
|
-
}, 250);
|
|
87
|
+
function endImageResizeEvent() {
|
|
88
|
+
const editorStore = useEditorStore();
|
|
89
|
+
if (editorStore.status.isImageResizeActive === true) {
|
|
90
|
+
editorStore.status.isImageResizeActive = false;
|
|
59
91
|
}
|
|
60
92
|
}
|
|
@@ -1,156 +1,153 @@
|
|
|
1
1
|
import { h } from "vue";
|
|
2
|
-
export function _getIconNode(
|
|
3
|
-
const
|
|
4
|
-
switch (
|
|
2
|
+
export function _getIconNode(name) {
|
|
3
|
+
const pathList = [];
|
|
4
|
+
switch (name) {
|
|
5
5
|
case "plus":
|
|
6
|
-
|
|
6
|
+
pathList.push(
|
|
7
|
+
h("path", {
|
|
8
|
+
class: ["de-path"],
|
|
9
|
+
d: "M29.3333 50.6666V34.6666H13.3333C11.8606 34.6666 10.6667 33.4727 10.6667 32C10.6667 30.5272 11.8606 29.3333 13.3333 29.3333H29.3333V13.3333C29.3333 11.8605 30.5272 10.6666 32 10.6666C33.4728 10.6666 34.6667 11.8605 34.6667 13.3333V29.3333H50.6667C52.1394 29.3333 53.3333 30.5272 53.3333 32C53.3333 33.4727 52.1394 34.6666 50.6667 34.6666H34.6667V50.6666C34.6667 52.1394 33.4728 53.3333 32 53.3333C30.5272 53.3333 29.3333 52.1394 29.3333 50.6666Z"
|
|
10
|
+
})
|
|
11
|
+
);
|
|
7
12
|
break;
|
|
8
13
|
case "bold":
|
|
9
|
-
|
|
14
|
+
pathList.push(
|
|
15
|
+
h("path", {
|
|
16
|
+
class: ["de-path"],
|
|
17
|
+
d: "M48 42.6667C48 40.5449 47.1565 38.5107 45.6562 37.0104C44.156 35.5101 42.1217 34.6667 40 34.6667H18.6667V50.6667H40C42.1217 50.6667 44.156 49.8232 45.6562 48.3229C47.1565 46.8226 48 44.7884 48 42.6667ZM53.3333 42.6667C53.3333 46.2029 51.9276 49.5933 49.4271 52.0938C46.9266 54.5942 43.5362 56 40 56H18.6667C17.2522 56 15.896 55.4377 14.8958 54.4375C13.8956 53.4373 13.3333 52.0812 13.3333 50.6667V13.3333C13.3333 11.9188 13.8956 10.5627 14.8958 9.5625C15.896 8.56231 17.2522 8 18.6667 8H37.3333C40.8696 8 44.2599 9.40577 46.7604 11.9062C49.2609 14.4067 50.6667 17.7971 50.6667 21.3333C50.6667 24.8696 49.2609 28.2599 46.7604 30.7604C46.6708 30.85 46.5762 30.9341 46.4844 31.0208C47.5538 31.6162 48.5462 32.3587 49.4271 33.2396C51.9276 35.7401 53.3333 39.1304 53.3333 42.6667ZM18.6667 29.3333H37.3333C39.4551 29.3333 41.4893 28.4899 42.9896 26.9896C44.4899 25.4893 45.3333 23.4551 45.3333 21.3333C45.3333 19.2116 44.4899 17.1774 42.9896 15.6771C41.4893 14.1768 39.4551 13.3333 37.3333 13.3333H18.6667V29.3333Z"
|
|
18
|
+
})
|
|
19
|
+
);
|
|
10
20
|
break;
|
|
11
21
|
case "italic":
|
|
12
|
-
|
|
22
|
+
pathList.push(h("path", { class: ["de-path"], d: "M50.6667 8C52.1394 8 53.3333 9.19391 53.3333 10.6667C53.3333 12.1394 52.1394 13.3333 50.6667 13.3333H41.849L27.849 50.6667H37.3333C38.8061 50.6667 40 51.8606 40 53.3333C40 54.8061 38.8061 56 37.3333 56H13.3333C11.8606 56 10.6667 54.8061 10.6667 53.3333C10.6667 51.8606 11.8606 50.6667 13.3333 50.6667H22.151L36.151 13.3333H26.6667C25.1939 13.3333 24 12.1394 24 10.6667C24 9.19391 25.1939 8 26.6667 8H50.6667Z" }));
|
|
13
23
|
break;
|
|
14
24
|
case "underline":
|
|
15
|
-
|
|
25
|
+
pathList.push(
|
|
16
26
|
h("path", {
|
|
17
27
|
class: ["de-path"],
|
|
18
|
-
|
|
19
|
-
"clip-rule": "evenodd",
|
|
20
|
-
d: "M9.52381 10.6667C9.52381 9.19391 10.7177 8 12.1905 8H21.3333C22.8061 8 24 9.19391 24 10.6667C24 12.1394 22.8061 13.3333 21.3333 13.3333H19.4016C19.4194 13.4578 19.4286 13.5849 19.4286 13.7143V28.9524C19.4286 35.8954 25.057 41.5238 32 41.5238C38.943 41.5238 44.5714 35.8954 44.5714 28.9524V13.7143C44.5714 13.5849 44.5806 13.4578 44.5984 13.3333H42.6667C41.1939 13.3333 40 12.1394 40 10.6667C40 9.19391 41.1939 8 42.6667 8L51.8095 8C53.2823 8 54.4762 9.19391 54.4762 10.6667C54.4762 12.1394 53.2823 13.3333 51.8095 13.3333L49.8778 13.3333C49.8956 13.4578 49.9048 13.5849 49.9048 13.7143V28.9524C49.9048 38.8409 41.8885 46.8571 32 46.8571C22.1115 46.8571 14.0952 38.8409 14.0952 28.9524V13.7143C14.0952 13.5849 14.1044 13.4578 14.1222 13.3333H12.1905C10.7177 13.3333 9.52381 12.1394 9.52381 10.6667ZM8 53.3333C8 51.8606 9.19391 50.6667 10.6667 50.6667H53.3333C54.8061 50.6667 56 51.8606 56 53.3333C56 54.8061 54.8061 56 53.3333 56H10.6667C9.19391 56 8 54.8061 8 53.3333Z"
|
|
28
|
+
d: "M53.3333 50.6667C54.8061 50.6667 56 51.8606 56 53.3333C56 54.8061 54.8061 56 53.3333 56H10.6667C9.19391 56 8 54.8061 8 53.3333C8 51.8606 9.19391 50.6667 10.6667 50.6667H53.3333ZM13.3333 26.6667V10.6667C13.3333 9.19391 14.5272 8 16 8C17.4728 8 18.6667 9.19391 18.6667 10.6667V26.6667C18.6667 30.2029 20.0724 33.5933 22.5729 36.0938C25.0734 38.5942 28.4638 40 32 40C35.5362 40 38.9266 38.5942 41.4271 36.0938C43.9276 33.5933 45.3333 30.2029 45.3333 26.6667V10.6667C45.3333 9.19391 46.5272 8 48 8C49.4728 8 50.6667 9.19391 50.6667 10.6667V26.6667C50.6667 31.6174 48.7012 36.3665 45.2005 39.8672C41.6998 43.3679 36.9507 45.3333 32 45.3333C27.0493 45.3333 22.3002 43.3679 18.7995 39.8672C15.2988 36.3665 13.3333 31.6174 13.3333 26.6667Z"
|
|
21
29
|
})
|
|
22
30
|
);
|
|
23
31
|
break;
|
|
24
32
|
case "strikethrough":
|
|
25
|
-
|
|
33
|
+
pathList.push(
|
|
26
34
|
h("path", {
|
|
27
35
|
class: ["de-path"],
|
|
28
|
-
|
|
29
|
-
"clip-rule": "evenodd",
|
|
30
|
-
d: "M28.8 10.6668C23.5777 10.6668 19.3778 14.864 19.3778 20.0002V23.0002C19.3778 24.4729 18.1839 25.6668 16.7111 25.6668C15.2384 25.6668 14.0444 24.4729 14.0444 23.0002V20.0002C14.0444 11.8815 20.6693 5.3335 28.8 5.3335H36.1992C45.999 5.3335 53.977 13.2246 53.977 23.0002C53.977 24.4729 52.7831 25.6668 51.3103 25.6668C49.8376 25.6668 48.6437 24.4729 48.6437 23.0002C48.6437 16.2072 43.0907 10.6668 36.1992 10.6668H28.8ZM8 32.0002C8 30.5274 9.19391 29.3335 10.6667 29.3335H56C57.4728 29.3335 58.6667 30.5274 58.6667 32.0002C58.6667 33.4729 57.4728 34.6668 56 34.6668H50.6059C52.7113 37.2002 53.9778 40.4501 53.9778 44.0002C53.9778 52.1189 47.3529 58.6668 39.2223 58.6668H31.823C23.2338 58.6668 16.0529 52.6109 14.401 44.5345C14.1058 43.0917 15.0363 41.6827 16.4792 41.3876C17.922 41.0925 19.331 42.0229 19.6261 43.4658C20.7751 49.083 25.7907 53.3335 31.823 53.3335H39.2223C44.4446 53.3335 48.6445 49.1363 48.6445 44.0002C48.6445 38.8637 44.4454 34.6668 39.2234 34.6668H10.6667C9.19391 34.6668 8 33.4729 8 32.0002Z"
|
|
36
|
+
d: "M45.3333 42.6667C45.3333 40.5449 44.4899 38.5107 42.9896 37.0104C41.4893 35.5101 39.4551 34.6667 37.3333 34.6667H10.6667C9.19391 34.6667 8 33.4728 8 32C8 30.5272 9.19391 29.3333 10.6667 29.3333H53.3333C54.8061 29.3333 56 30.5272 56 32C56 33.4728 54.8061 34.6667 53.3333 34.6667H47.9974C49.7188 36.9613 50.6667 39.7646 50.6667 42.6667C50.6667 46.2029 49.2609 49.5933 46.7604 52.0938C44.2599 54.5942 40.8696 56 37.3333 56H16C14.5272 56 13.3333 54.8061 13.3333 53.3333C13.3333 51.8606 14.5272 50.6667 16 50.6667H37.3333C39.4551 50.6667 41.4893 49.8232 42.9896 48.3229C44.4899 46.8226 45.3333 44.7884 45.3333 42.6667ZM42.6667 8C44.1394 8 45.3333 9.19391 45.3333 10.6667C45.3333 12.1394 44.1394 13.3333 42.6667 13.3333H23.9974C23.1446 13.3331 22.3045 13.538 21.5469 13.9297C20.7891 14.3216 20.1361 14.8896 19.6432 15.5859C19.1505 16.2824 18.831 17.0873 18.7135 17.9323C18.5962 18.7776 18.6843 19.6407 18.9688 20.4453C19.4589 21.8335 18.7293 23.3556 17.3411 23.8464C15.9528 24.3369 14.431 23.6097 13.9401 22.2214C13.3713 20.6124 13.1951 18.8908 13.4297 17.2005C13.6644 15.5098 14.3032 13.8987 15.2891 12.5052C16.2748 11.1122 17.5805 9.97661 19.0964 9.19271C20.6121 8.40884 22.2935 8.00193 24 8.0026L42.6667 8Z"
|
|
31
37
|
})
|
|
32
38
|
);
|
|
33
39
|
break;
|
|
34
40
|
case "codeblock":
|
|
35
|
-
|
|
41
|
+
pathList.push(
|
|
36
42
|
h("path", {
|
|
37
43
|
class: ["de-path"],
|
|
38
|
-
|
|
39
|
-
"clip-rule": "evenodd",
|
|
40
|
-
d: "M35.7494 14.1906C37.1906 14.494 38.1129 15.9082 37.8095 17.3494L31.4095 47.7494C31.1061 49.1906 29.6919 50.1129 28.2507 49.8095C26.8095 49.5061 25.8872 48.0918 26.1906 46.6507L32.5906 16.2507C32.894 14.8095 34.3083 13.8872 35.7494 14.1906ZM46.1144 21.3144C47.1558 20.273 48.8443 20.273 49.8857 21.3144L59.4857 30.9144C60.5271 31.9558 60.5271 33.6442 59.4857 34.6856L49.8857 44.2856C48.8443 45.327 47.1558 45.327 46.1144 44.2856C45.073 43.2442 45.073 41.5558 46.1144 40.5144L53.8288 32.8L46.1144 25.0856C45.073 24.0442 45.073 22.3558 46.1144 21.3144ZM17.8857 21.3144C18.9271 22.3558 18.9271 24.0442 17.8857 25.0856L10.1713 32.8L17.8857 40.5144C18.9271 41.5558 18.9271 43.2442 17.8857 44.2856C16.8443 45.327 15.1558 45.327 14.1144 44.2856L4.51445 34.6856C3.47305 33.6442 3.47305 31.9558 4.51445 30.9144L14.1144 21.3144C15.1558 20.273 16.8443 20.273 17.8857 21.3144Z"
|
|
44
|
+
d: "M53.3333 13.3333C53.3333 11.8606 52.1394 10.6666 50.6666 10.6666H13.3333C11.8606 10.6666 10.6666 11.8606 10.6666 13.3333V50.6666C10.6666 52.1394 11.8606 53.3333 13.3333 53.3333H50.6666C52.1394 53.3333 53.3333 52.1394 53.3333 50.6666V13.3333ZM24.7812 22.1146C25.8226 21.0732 27.5107 21.0732 28.5521 22.1146C29.5935 23.156 29.5935 24.844 28.5521 25.8854L22.4375 32L28.5521 38.1146C29.5935 39.156 29.5935 40.844 28.5521 41.8854C27.5107 42.9268 25.8226 42.9268 24.7812 41.8854L16.7812 33.8854C15.7398 32.844 15.7398 31.156 16.7812 30.1146L24.7812 22.1146ZM35.4479 22.1146C36.4893 21.0732 38.1773 21.0732 39.2187 22.1146L47.2187 30.1146C48.2601 31.156 48.2601 32.844 47.2187 33.8854L39.2187 41.8854C38.1773 42.9268 36.4893 42.9268 35.4479 41.8854C34.4065 40.844 34.4065 39.156 35.4479 38.1146L41.5625 32L35.4479 25.8854C34.4065 24.844 34.4065 23.156 35.4479 22.1146ZM58.6666 50.6666C58.6666 55.0849 55.0849 58.6666 50.6666 58.6666H13.3333C8.91504 58.6666 5.33331 55.0849 5.33331 50.6666V13.3333C5.33331 8.91503 8.91503 5.33331 13.3333 5.33331H50.6666C55.0849 5.33331 58.6666 8.91504 58.6666 13.3333V50.6666Z"
|
|
41
45
|
})
|
|
42
46
|
);
|
|
43
47
|
break;
|
|
44
48
|
case "add-link":
|
|
45
|
-
|
|
49
|
+
pathList.push(
|
|
46
50
|
h("path", {
|
|
47
51
|
class: ["de-path"],
|
|
48
|
-
|
|
49
|
-
"clip-rule": "evenodd",
|
|
50
|
-
d: "M39.2515 12.5195L15.492 36.279C10.4604 41.3106 10.1163 47.945 14.6317 52.4604C19.3058 57.1344 26.2386 56.7617 31.1066 51.8936L52.243 30.7573C53.2844 29.7159 54.9728 29.7159 56.0142 30.7573C57.0556 31.7987 57.0556 33.4871 56.0142 34.5285L34.8779 55.6648C28.2402 62.3025 17.9173 63.2884 10.8605 56.2316C3.87019 49.2413 5.02145 39.2071 11.7208 32.5078L35.4802 8.74828C40.158 4.07053 47.7006 4.07053 52.3784 8.74828C57.0561 13.426 57.0561 20.9687 52.3784 25.6464L28.2017 49.8231C25.3479 52.6769 20.7209 52.6769 17.867 49.8231C15.0132 46.9692 15.0132 42.3422 17.867 39.4884L39.4206 17.9349C40.4619 16.8935 42.1504 16.8935 43.1918 17.9349C44.2332 18.9762 44.2332 20.6647 43.1918 21.7061L21.6383 43.2596C20.8672 44.0307 20.8672 45.2808 21.6383 46.0518C22.4093 46.8229 23.6594 46.8229 24.4305 46.0518L48.6071 21.8752C51.2021 19.2802 51.2021 15.1145 48.6071 12.5195C46.0122 9.92456 41.8464 9.92457 39.2515 12.5195Z"
|
|
52
|
+
d: "M2.66669 32C2.66669 27.7565 4.35361 23.6881 7.35419 20.6875C10.3548 17.6869 14.4232 16 18.6667 16H24C25.4728 16 26.6667 17.1939 26.6667 18.6667C26.6667 20.1394 25.4728 21.3333 24 21.3333H18.6667C15.8377 21.3333 13.1254 22.4579 11.125 24.4583C9.12463 26.4587 8.00002 29.171 8.00002 32C8.00002 34.829 9.12463 37.5413 11.125 39.5417C13.1254 41.5421 15.8377 42.6667 18.6667 42.6667H24C25.4728 42.6667 26.6667 43.8606 26.6667 45.3333C26.6667 46.8061 25.4728 48 24 48H18.6667C14.4232 48 10.3548 46.3131 7.35419 43.3125C4.35361 40.3119 2.66669 36.2435 2.66669 32ZM56 32C56 29.171 54.8754 26.4587 52.875 24.4583C50.8746 22.4579 48.1623 21.3333 45.3334 21.3333H40C38.5273 21.3333 37.3334 20.1394 37.3334 18.6667C37.3334 17.1939 38.5273 16 40 16H45.3334C49.5768 16 53.6453 17.6869 56.6459 20.6875C59.6464 23.6881 61.3334 27.7565 61.3334 32C61.3334 36.2435 59.6464 40.3119 56.6459 43.3125C53.6453 46.3131 49.5768 48 45.3334 48H40C38.5273 48 37.3334 46.8061 37.3334 45.3333C37.3334 43.8606 38.5273 42.6667 40 42.6667H45.3334C48.1623 42.6667 50.8746 41.5421 52.875 39.5417C54.8754 37.5413 56 34.829 56 32ZM42.6667 29.3333C44.1395 29.3333 45.3334 30.5272 45.3334 32C45.3334 33.4728 44.1395 34.6667 42.6667 34.6667H21.3334C19.8606 34.6667 18.6667 33.4728 18.6667 32C18.6667 30.5272 19.8606 29.3333 21.3334 29.3333H42.6667Z"
|
|
51
53
|
})
|
|
52
54
|
);
|
|
53
55
|
break;
|
|
54
56
|
case "remove-link":
|
|
55
|
-
|
|
57
|
+
pathList.push(
|
|
56
58
|
h("path", {
|
|
57
59
|
class: ["de-path"],
|
|
58
|
-
|
|
59
|
-
"clip-rule": "evenodd",
|
|
60
|
-
d: "M4.78075 8.74855C5.82214 7.70715 7.51058 7.70715 8.55198 8.74855L54.952 55.1486C55.9934 56.1899 55.9934 57.8784 54.952 58.9198C53.9106 59.9612 52.2221 59.9612 51.1807 58.9198L4.78075 12.5198C3.73935 11.4784 3.73935 9.78995 4.78075 8.74855ZM26.1141 21.8863C25.0727 20.8449 25.0727 19.1564 26.1141 18.115L35.4805 8.74857C40.1583 4.07082 47.7009 4.07082 52.3786 8.74857C57.0564 13.4263 57.0564 20.9689 52.3787 25.6467L43.6845 34.3408C42.6431 35.3822 40.9547 35.3822 39.9133 34.3408C38.8719 33.2994 38.8719 31.611 39.9133 30.5696L48.6074 21.8755C51.2024 19.2805 51.2024 15.1148 48.6074 12.5198C46.0125 9.92485 41.8467 9.92486 39.2518 12.5198L29.8853 21.8863C28.8439 22.9277 27.1555 22.9277 26.1141 21.8863ZM15.4923 36.2793C10.4607 41.3108 10.1166 47.9452 14.632 52.4607C19.3061 57.1347 26.2388 56.762 31.1069 51.8939L34.2192 48.7816C35.2606 47.7402 36.949 47.7402 37.9904 48.7816C39.0318 49.823 39.0318 51.5115 37.9904 52.5529L34.8782 55.6651C28.2405 62.3028 17.9176 63.2887 10.8608 56.2319C3.87048 49.2416 5.02174 39.2074 11.7211 32.508L14.1141 30.115C15.1555 29.0736 16.8439 29.0736 17.8853 30.115C18.9267 31.1564 18.9267 32.8449 17.8853 33.8863L15.4923 36.2793ZM17.8673 49.8234C15.0135 46.9695 15.0135 42.3425 17.8673 39.4887L20.7807 36.5752C21.8221 35.5338 23.5106 35.5338 24.552 36.5752C25.5934 37.6166 25.5934 39.3051 24.552 40.3465L21.6385 43.2599C20.8675 44.031 20.8675 45.2811 21.6385 46.0521C22.4096 46.8232 23.6597 46.8232 24.4308 46.0521L27.7665 42.7164C28.8079 41.675 30.4964 41.675 31.5378 42.7164C32.5792 43.7578 32.5792 45.4462 31.5378 46.4876L28.202 49.8234C25.3482 52.6772 20.7212 52.6772 17.8673 49.8234ZM32.7807 28.3465C31.7393 27.3051 31.7393 25.6166 32.7807 24.5752L39.4208 17.9351C40.4622 16.8937 42.1507 16.8937 43.1921 17.9351C44.2335 18.9765 44.2335 20.665 43.1921 21.7064L36.552 28.3465C35.5106 29.3879 33.8221 29.3879 32.7807 28.3465ZM46.222 40.55C45.1806 39.5086 45.1806 37.8202 46.222 36.7788L52.2433 30.7576C53.2847 29.7162 54.9731 29.7162 56.0145 30.7576C57.0559 31.799 57.0559 33.4874 56.0145 34.5288L49.9933 40.55C48.9519 41.5914 47.2634 41.5914 46.222 40.55Z"
|
|
60
|
+
d: "M2.66669 32C2.66669 27.7565 4.3536 23.6881 7.35419 20.6875C9.02233 19.0194 11.0202 17.7578 13.1953 16.9661L3.44794 7.21875C2.40654 6.17735 2.40654 4.48932 3.44794 3.44792C4.48933 2.40652 6.17737 2.40652 7.21877 3.44792L60.5521 56.7812C61.5935 57.8227 61.5935 59.5107 60.5521 60.5521C59.5107 61.5935 57.8227 61.5935 56.7813 60.5521L30.8959 34.6667H21.3334C19.8606 34.6667 18.6667 33.4728 18.6667 32C18.6667 30.5272 19.8606 29.3333 21.3334 29.3333H25.5625L17.612 21.3828C15.1702 21.6253 12.8753 22.708 11.125 24.4583C9.12463 26.4587 8.00002 29.171 8.00002 32C8.00002 34.829 9.12463 37.5413 11.125 39.5417C13.1254 41.5421 15.8377 42.6667 18.6667 42.6667H24C25.4728 42.6667 26.6667 43.8606 26.6667 45.3333C26.6667 46.8061 25.4728 48 24 48H18.6667C14.4232 48 10.3548 46.3131 7.35419 43.3125C4.35361 40.3119 2.66669 36.2435 2.66669 32ZM45.3334 16C48.3047 16 51.2172 16.8285 53.7448 18.3906C56.272 19.9526 58.3144 22.1866 59.6432 24.8438C60.9721 27.5014 61.5351 30.4781 61.2682 33.4375C61.0013 36.3965 59.9154 39.2221 58.1328 41.599C57.2493 42.777 55.5792 43.0161 54.4011 42.1328C53.223 41.2493 52.9839 39.5792 53.8672 38.401C55.0557 36.8164 55.7778 34.9311 55.9557 32.9583C56.1336 30.9854 55.7609 29.001 54.875 27.2292C53.9891 25.4574 52.6252 23.9685 50.9401 22.9271C49.2551 21.8858 47.3141 21.3333 45.3334 21.3333H40C38.5273 21.3333 37.3334 20.1394 37.3334 18.6667C37.3334 17.1939 38.5273 16 40 16H45.3334Z"
|
|
61
61
|
})
|
|
62
62
|
);
|
|
63
63
|
break;
|
|
64
64
|
case "image":
|
|
65
|
-
|
|
65
|
+
pathList.push(
|
|
66
66
|
h("path", {
|
|
67
67
|
class: ["de-path"],
|
|
68
|
-
|
|
69
|
-
"clip-rule": "evenodd",
|
|
70
|
-
d: "M14.9945 38.0117C14.5635 38.7796 14.3332 39.6498 14.3332 40.5409V45.7498C14.3332 47.9129 16.0867 49.6665 18.2498 49.6665H45.7498C47.9129 49.6665 49.6665 47.9129 49.6665 45.7498V36.2013C49.6665 34.7945 49.0928 33.4484 48.0779 32.4742L43.4501 28.0315C41.9499 26.5913 39.5857 26.5746 38.0653 27.9936L30.4582 35.1432C29.7863 34.534 29.0626 33.9074 28.4503 33.3859C27.9857 32.9901 27.5727 32.6443 27.2757 32.3972C27.127 32.2736 27.0071 32.1744 26.9238 32.1058L26.8773 32.0674C25.3715 30.6639 23.0223 30.6701 21.5237 32.0855L15.9581 36.877C15.8971 36.9188 15.849 36.9554 15.8168 36.9807C15.7306 37.0483 15.6657 37.1077 15.6321 37.1391C15.5606 37.206 15.5034 37.2666 15.4644 37.3095C15.4254 37.3523 15.3706 37.4151 15.3107 37.4926C15.2826 37.529 15.2296 37.5992 15.1705 37.6915C15.1408 37.7377 15.0937 37.8142 15.0431 37.9125C15.0287 37.9404 15.0122 37.9737 14.9945 38.0117ZM40.7274 32.8108L33.1325 39.9489C31.515 41.4586 29.0906 41.2498 27.6732 39.8372C26.9353 39.1246 25.8887 38.2097 24.992 37.446C24.7117 37.2072 24.4508 36.9872 24.2247 36.7978L19.6665 40.7221V44.3331H44.3332V36.2724L40.7274 32.8108Z M42.798 15.8335C41.3253 15.8335 40.1313 17.0274 40.1313 18.5002V19.2267C40.1313 20.6995 41.3253 21.8934 42.798 21.8934H43.656C45.1287 21.8934 46.3226 20.6995 46.3226 19.2267V18.5002C46.3226 17.0274 45.1287 15.8335 43.656 15.8335H42.798Z M5.6665 17.0002C5.6665 10.5568 10.8898 5.3335 17.3332 5.3335H47.3332C53.7765 5.3335 58.9998 10.5568 58.9998 17.0002V47.0002C58.9998 53.4435 53.7765 58.6668 47.3332 58.6668H17.3332C10.8898 58.6668 5.6665 53.4435 5.6665 47.0002V17.0002ZM17.3332 10.6668C13.8354 10.6668 10.9998 13.5024 10.9998 17.0002V47.0002C10.9998 50.498 13.8354 53.3335 17.3332 53.3335H47.3332C50.831 53.3335 53.6665 50.498 53.6665 47.0002V17.0002C53.6665 13.5024 50.831 10.6668 47.3332 10.6668H17.3332Z"
|
|
68
|
+
d: "M53.3333 41.1042L45.8854 33.6563C45.3853 33.1564 44.707 32.875 44 32.875C43.2929 32.875 42.6146 33.1564 42.1146 33.6563L22.4375 53.3334H50.6666C51.3739 53.3334 52.052 53.0522 52.5521 52.5521C53.0522 52.052 53.3333 51.3739 53.3333 50.6667V41.1042ZM26.6666 24C26.6666 22.5273 25.4727 21.3334 24 21.3334C22.5272 21.3334 21.3333 22.5273 21.3333 24C21.3333 25.4728 22.5272 26.6667 24 26.6667C25.4727 26.6667 26.6666 25.4728 26.6666 24ZM48 21.3334V16H42.6666C41.1939 16 40 14.8061 40 13.3334C40 11.8606 41.1939 10.6667 42.6666 10.6667H48V5.33335C48 3.86059 49.1939 2.66669 50.6666 2.66669C52.1394 2.66669 53.3333 3.86059 53.3333 5.33335V10.6667H58.6666C60.1394 10.6667 61.3333 11.8606 61.3333 13.3334C61.3333 14.8061 60.1394 16 58.6666 16H53.3333V21.3334C53.3333 22.8061 52.1394 24 50.6666 24C49.1939 24 48 22.8061 48 21.3334ZM58.6666 50.6667C58.6666 52.7884 57.8232 54.8226 56.3229 56.3229C54.8226 57.8232 52.7884 58.6667 50.6666 58.6667H13.3333C11.2116 58.6667 9.17735 57.8232 7.67706 56.3229C6.17677 54.8226 5.33331 52.7884 5.33331 50.6667V13.3334C5.33331 11.2116 6.17677 9.1774 7.67706 7.6771C9.17735 6.17681 11.2116 5.33335 13.3333 5.33335H33.3333C34.8061 5.33335 36 6.52726 36 8.00002C36 9.47278 34.8061 10.6667 33.3333 10.6667H13.3333C12.6261 10.6667 11.948 10.9478 11.4479 11.4479C10.9478 11.948 10.6666 12.6261 10.6666 13.3334V50.6667C10.6666 51.3739 10.9478 52.052 11.4479 52.5521C11.948 53.0522 12.6261 53.3334 13.3333 53.3334H14.8958L38.3437 29.8854L38.9297 29.3542C40.3533 28.1877 42.1434 27.5417 44 27.5417C46.1213 27.5417 48.156 28.3857 49.6562 29.8854L53.3333 33.5625V30.6667C53.3333 29.1939 54.5272 28 56 28C57.4727 28 58.6666 29.1939 58.6666 30.6667V50.6667ZM32 24C32 28.4183 28.4183 32 24 32C19.5817 32 16 28.4183 16 24C16 19.5817 19.5817 16 24 16C28.4183 16 32 19.5817 32 24Z"
|
|
71
69
|
})
|
|
72
70
|
);
|
|
73
71
|
break;
|
|
74
72
|
case "align-center":
|
|
75
|
-
|
|
73
|
+
pathList.push(
|
|
76
74
|
h("path", {
|
|
77
75
|
class: ["de-path"],
|
|
78
|
-
|
|
79
|
-
"clip-rule": "evenodd",
|
|
80
|
-
d: "M16.3679 12.8C16.3679 11.3272 17.5618 10.1333 19.0345 10.1333L46.4001 10.1333C47.8728 10.1333 49.0667 11.3272 49.0667 12.8C49.0667 14.2727 47.8728 15.4666 46.4001 15.4666H19.0345C17.5618 15.4666 16.3679 14.2727 16.3679 12.8ZM3.7334 25.0666C3.7334 23.5939 4.92731 22.4 6.40007 22.4H57.6001C59.0728 22.4 60.2667 23.5939 60.2667 25.0666C60.2667 26.5394 59.0728 27.7333 57.6001 27.7333H6.40007C4.92731 27.7333 3.7334 26.5394 3.7334 25.0666ZM12.469 38.9333C12.469 37.4605 13.6629 36.2666 15.1357 36.2666H52.8001C54.2728 36.2666 55.4667 37.4605 55.4667 38.9333C55.4667 40.4061 54.2728 41.6 52.8001 41.6H15.1357C13.6629 41.6 12.469 40.4061 12.469 38.9333ZM3.7334 52.8C3.7334 51.3272 4.92731 50.1333 6.40007 50.1333H57.6001C59.0728 50.1333 60.2667 51.3272 60.2667 52.8C60.2667 54.2727 59.0728 55.4666 57.6001 55.4666H6.40007C4.92731 55.4666 3.7334 54.2727 3.7334 52.8Z"
|
|
76
|
+
d: "M50.6666 48C52.1394 48 53.3333 49.1939 53.3333 50.6666C53.3333 52.1394 52.1394 53.3333 50.6666 53.3333H13.3333C11.8606 53.3333 10.6666 52.1394 10.6666 50.6666C10.6666 49.1939 11.8606 48 13.3333 48H50.6666ZM45.3333 29.3333C46.8061 29.3333 48 30.5272 48 32C48 33.4727 46.8061 34.6666 45.3333 34.6666H18.6666C17.1939 34.6666 16 33.4727 16 32C16 30.5272 17.1939 29.3333 18.6666 29.3333H45.3333ZM56 10.6666C57.4727 10.6666 58.6666 11.8605 58.6666 13.3333C58.6666 14.8061 57.4727 16 56 16H7.99998C6.52722 16 5.33331 14.8061 5.33331 13.3333C5.33331 11.8605 6.52722 10.6666 7.99998 10.6666H56Z"
|
|
81
77
|
})
|
|
82
78
|
);
|
|
83
79
|
break;
|
|
84
80
|
case "align-left":
|
|
85
|
-
|
|
81
|
+
pathList.push(
|
|
86
82
|
h("path", {
|
|
87
83
|
class: ["de-path"],
|
|
88
|
-
|
|
89
|
-
"clip-rule": "evenodd",
|
|
90
|
-
d: "M60.2666 37.3331C60.2666 38.8059 59.0727 39.9998 57.5999 39.9998L6.39995 39.9998C4.92719 39.9998 3.73328 38.8059 3.73328 37.3331C3.73328 35.8603 4.92719 34.6664 6.39995 34.6664L57.5999 34.6664C59.0727 34.6664 60.2666 35.8603 60.2666 37.3331ZM60.2666 9.59977C60.2666 11.0725 59.0727 12.2664 57.5999 12.2664L6.39995 12.2664C4.92719 12.2664 3.73328 11.0725 3.73328 9.59977C3.73328 8.12701 4.92719 6.93311 6.39995 6.93311L57.5999 6.93311C59.0727 6.93311 60.2666 8.12701 60.2666 9.59977ZM46.731 23.4664C46.731 24.9392 45.5371 26.1331 44.0643 26.1331L6.39995 26.1331C4.92719 26.1331 3.73328 24.9392 3.73328 23.4664C3.73328 21.9937 4.92719 20.7998 6.39995 20.7998L44.0643 20.7998C45.5371 20.7998 46.731 21.9937 46.731 23.4664ZM36.4321 51.1998C36.4321 52.6725 35.2382 53.8664 33.7655 53.8664L6.39994 53.8664C4.92719 53.8664 3.73328 52.6725 3.73328 51.1998C3.73328 49.727 4.92719 48.5331 6.39994 48.5331L33.7655 48.5331C35.2382 48.5331 36.4321 49.727 36.4321 51.1998Z"
|
|
84
|
+
d: "M45.3333 48C46.8061 48 48 49.1939 48 50.6667C48 52.1395 46.8061 53.3334 45.3333 53.3334H7.99998C6.52722 53.3334 5.33331 52.1395 5.33331 50.6667C5.33331 49.1939 6.52722 48 7.99998 48H45.3333ZM40 29.3334C41.4727 29.3334 42.6666 30.5273 42.6666 32C42.6666 33.4728 41.4727 34.6667 40 34.6667H7.99998C6.52722 34.6667 5.33331 33.4728 5.33331 32C5.33331 30.5273 6.52722 29.3334 7.99998 29.3334H40ZM56 10.6667C57.4727 10.6667 58.6666 11.8606 58.6666 13.3334C58.6666 14.8061 57.4727 16 56 16H7.99998C6.52722 16 5.33331 14.8061 5.33331 13.3334C5.33331 11.8606 6.52722 10.6667 7.99998 10.6667H56Z"
|
|
91
85
|
})
|
|
92
86
|
);
|
|
93
87
|
break;
|
|
94
88
|
case "align-right":
|
|
95
|
-
|
|
89
|
+
pathList.push(
|
|
96
90
|
h("path", {
|
|
97
91
|
class: ["de-path"],
|
|
98
|
-
|
|
99
|
-
"clip-rule": "evenodd",
|
|
100
|
-
d: "M27.5679 9.59977C27.5679 8.12701 28.7618 6.93311 30.2345 6.93311L57.6001 6.93311C59.0728 6.93311 60.2667 8.12701 60.2667 9.59977C60.2667 11.0725 59.0728 12.2664 57.6001 12.2664H30.2345C28.7618 12.2664 27.5679 11.0725 27.5679 9.59977ZM3.7334 23.4664C3.7334 21.9937 4.92731 20.7998 6.40007 20.7998H57.6001C59.0728 20.7998 60.2667 21.9937 60.2667 23.4664C60.2667 24.9392 59.0728 26.1331 57.6001 26.1331H6.40007C4.92731 26.1331 3.7334 24.9392 3.7334 23.4664ZM17.269 37.3331C17.269 35.8603 18.4629 34.6664 19.9357 34.6664H57.6001C59.0728 34.6664 60.2667 35.8603 60.2667 37.3331C60.2667 38.8059 59.0728 39.9998 57.6001 39.9998H19.9357C18.4629 39.9998 17.269 38.8059 17.269 37.3331ZM3.7334 51.1998C3.7334 49.727 4.92731 48.5331 6.40007 48.5331H57.6001C59.0728 48.5331 60.2667 49.727 60.2667 51.1998C60.2667 52.6725 59.0728 53.8664 57.6001 53.8664H6.40007C4.92731 53.8664 3.7334 52.6725 3.7334 51.1998Z"
|
|
92
|
+
d: "M56 48C57.4727 48 58.6666 49.1939 58.6666 50.6666C58.6666 52.1394 57.4727 53.3333 56 53.3333H18.6666C17.1939 53.3333 16 52.1394 16 50.6666C16 49.1939 17.1939 48 18.6666 48H56ZM56 29.3333C57.4727 29.3333 58.6666 30.5272 58.6666 32C58.6666 33.4727 57.4727 34.6666 56 34.6666H24C22.5272 34.6666 21.3333 33.4727 21.3333 32C21.3333 30.5272 22.5272 29.3333 24 29.3333H56ZM56 10.6666C57.4727 10.6666 58.6666 11.8605 58.6666 13.3333C58.6666 14.8061 57.4727 16 56 16H7.99998C6.52722 16 5.33331 14.8061 5.33331 13.3333C5.33331 11.8605 6.52722 10.6666 7.99998 10.6666H56Z"
|
|
101
93
|
})
|
|
102
94
|
);
|
|
103
95
|
break;
|
|
104
96
|
case "align-justify":
|
|
105
|
-
|
|
97
|
+
pathList.push(
|
|
106
98
|
h("path", {
|
|
107
99
|
class: ["de-path"],
|
|
108
|
-
|
|
109
|
-
"clip-rule": "evenodd",
|
|
110
|
-
d: "M60.2666 51.1998C60.2666 52.6725 59.0727 53.8664 57.5999 53.8664L6.39994 53.8664C4.92719 53.8664 3.73328 52.6725 3.73328 51.1998C3.73328 49.727 4.92719 48.5331 6.39994 48.5331L57.5999 48.5331C59.0727 48.5331 60.2666 49.727 60.2666 51.1998ZM60.2666 37.3331C60.2666 38.8059 59.0727 39.9998 57.5999 39.9998L6.39995 39.9998C4.92719 39.9998 3.73328 38.8059 3.73328 37.3331C3.73328 35.8603 4.92719 34.6664 6.39995 34.6664L57.5999 34.6664C59.0727 34.6664 60.2666 35.8603 60.2666 37.3331ZM60.2666 23.4664C60.2666 24.9392 59.0727 26.1331 57.5999 26.1331L6.39995 26.1331C4.92719 26.1331 3.73328 24.9392 3.73328 23.4664C3.73328 21.9937 4.92719 20.7998 6.39995 20.7998L57.5999 20.7998C59.0727 20.7998 60.2666 21.9937 60.2666 23.4664ZM60.2666 9.59977C60.2666 11.0725 59.0727 12.2664 57.5999 12.2664L6.39995 12.2664C4.92719 12.2664 3.73328 11.0725 3.73328 9.59977C3.73328 8.12701 4.92719 6.93311 6.39995 6.93311L57.5999 6.93311C59.0727 6.93311 60.2666 8.12701 60.2666 9.59977Z"
|
|
100
|
+
d: "M56 48C57.4727 48 58.6666 49.1939 58.6666 50.6666C58.6666 52.1394 57.4727 53.3333 56 53.3333H7.99998C6.52722 53.3333 5.33331 52.1394 5.33331 50.6666C5.33331 49.1939 6.52722 48 7.99998 48H56ZM56 29.3333C57.4727 29.3333 58.6666 30.5272 58.6666 32C58.6666 33.4727 57.4727 34.6666 56 34.6666H7.99998C6.52722 34.6666 5.33331 33.4727 5.33331 32C5.33331 30.5272 6.52722 29.3333 7.99998 29.3333H56ZM56 10.6666C57.4727 10.6666 58.6666 11.8605 58.6666 13.3333C58.6666 14.8061 57.4727 16 56 16H7.99998C6.52722 16 5.33331 14.8061 5.33331 13.3333C5.33331 11.8605 6.52722 10.6666 7.99998 10.6666H56Z"
|
|
111
101
|
})
|
|
112
102
|
);
|
|
113
103
|
break;
|
|
114
|
-
case "
|
|
115
|
-
|
|
104
|
+
case "indent-decrease":
|
|
105
|
+
pathList.push(
|
|
116
106
|
h("path", {
|
|
117
107
|
class: ["de-path"],
|
|
118
|
-
|
|
119
|
-
"clip-rule": "evenodd",
|
|
120
|
-
d: "M15.7144 1.31425C16.7557 0.272854 18.4442 0.272854 19.4856 1.31425L25.8856 7.71425C26.3857 8.21435 26.6666 8.89263 26.6666 9.59987C26.6666 10.3071 26.3857 10.9854 25.8856 11.4855L19.4856 17.8855C18.4442 18.9269 16.7557 18.9269 15.7144 17.8855C14.673 16.8441 14.673 15.1556 15.7144 14.1143L17.5621 12.2665H13.3333C10.0932 12.2665 7.46663 14.8931 7.46663 18.1332V22.3999C7.46663 23.8726 6.27273 25.0665 4.79997 25.0665C3.32721 25.0665 2.1333 23.8726 2.1333 22.3999V18.1332C2.1333 11.9476 7.14771 6.9332 13.3333 6.9332H17.5621L15.7144 5.08549C14.673 4.04409 14.673 2.35565 15.7144 1.31425ZM41.2431 12.2665C35.6625 12.2665 30.9861 16.1652 29.8005 21.39C29.4746 22.8262 28.0461 23.7263 26.6099 23.4004C25.1736 23.0745 24.2735 21.646 24.5994 20.2098C26.3241 12.6091 33.1176 6.9332 41.2431 6.9332C50.6688 6.9332 58.3098 14.5742 58.3098 23.9999C58.3098 32.7327 51.7531 39.9302 43.2926 40.9445C41.8304 41.1198 40.5028 40.0765 40.3275 38.6142C40.1522 37.1519 41.1955 35.8244 42.6578 35.6491C48.4697 34.9523 52.9765 30.0004 52.9765 23.9999C52.9765 17.5197 47.7233 12.2665 41.2431 12.2665ZM19.2 31.4665C12.7198 31.4665 7.46663 36.7197 7.46663 43.1999C7.46663 49.68 12.7198 54.9332 19.2 54.9332C25.6801 54.9332 30.9333 49.68 30.9333 43.1999C30.9333 36.7197 25.6801 31.4665 19.2 31.4665ZM2.1333 43.1999C2.1333 33.7742 9.77431 26.1332 19.2 26.1332C28.6256 26.1332 36.2666 33.7742 36.2666 43.1999C36.2666 52.6255 28.6256 60.2665 19.2 60.2665C9.77431 60.2665 2.1333 52.6255 2.1333 43.1999Z"
|
|
108
|
+
d: "M56 48C57.4727 48 58.6666 49.1939 58.6666 50.6666C58.6666 52.1394 57.4727 53.3333 56 53.3333H29.3333C27.8605 53.3333 26.6666 52.1394 26.6666 50.6666C26.6666 49.1939 27.8605 48 29.3333 48H56ZM16.7812 19.4479C17.8226 18.4065 19.5106 18.4065 20.552 19.4479C21.5934 20.4893 21.5934 22.1773 20.552 23.2187L11.7708 32L20.552 40.7812C21.5934 41.8226 21.5934 43.5106 20.552 44.552C19.5106 45.5934 17.8226 45.5934 16.7812 44.552L6.11454 33.8854C5.07315 32.844 5.07315 31.1559 6.11454 30.1145L16.7812 19.4479ZM56 29.3333C57.4727 29.3333 58.6666 30.5272 58.6666 32C58.6666 33.4727 57.4727 34.6666 56 34.6666H29.3333C27.8605 34.6666 26.6666 33.4727 26.6666 32C26.6666 30.5272 27.8605 29.3333 29.3333 29.3333H56ZM56 10.6666C57.4727 10.6666 58.6666 11.8605 58.6666 13.3333C58.6666 14.8061 57.4727 16 56 16H29.3333C27.8605 16 26.6666 14.8061 26.6666 13.3333C26.6666 11.8605 27.8605 10.6666 29.3333 10.6666H56Z"
|
|
121
109
|
})
|
|
122
110
|
);
|
|
123
111
|
break;
|
|
124
|
-
case "
|
|
125
|
-
|
|
112
|
+
case "indent-increase":
|
|
113
|
+
pathList.push(
|
|
126
114
|
h("path", {
|
|
127
115
|
class: ["de-path"],
|
|
128
|
-
|
|
129
|
-
"clip-rule": "evenodd",
|
|
130
|
-
d: "M41.2431 12.2664C35.6625 12.2664 30.9861 16.1651 29.8005 21.3899C29.4746 22.8261 28.0461 23.7262 26.6099 23.4003C25.1736 23.0744 24.2735 21.6459 24.5994 20.2097C26.3241 12.609 33.1176 6.93311 41.2431 6.93311C50.6688 6.93311 58.3098 14.5741 58.3098 23.9998C58.3098 32.7326 51.7531 39.9301 43.2926 40.9444C41.8304 41.1197 40.5028 40.0764 40.3275 38.6141C40.1522 37.1518 41.1955 35.8243 42.6578 35.649C48.4697 34.9522 52.9765 30.0003 52.9765 23.9998C52.9765 17.5196 47.7233 12.2664 41.2431 12.2664ZM19.2 31.4664C12.7198 31.4664 7.46663 36.7196 7.46663 43.1998C7.46663 49.6799 12.7198 54.9331 19.2 54.9331C25.6801 54.9331 30.9333 49.6799 30.9333 43.1998C30.9333 36.7196 25.6801 31.4664 19.2 31.4664ZM2.1333 43.1998C2.1333 33.7741 9.77431 26.1331 19.2 26.1331C28.6256 26.1331 36.2666 33.7741 36.2666 43.1998C36.2666 52.6254 28.6256 60.2664 19.2 60.2664C9.77431 60.2664 2.1333 52.6254 2.1333 43.1998ZM59.2 38.9331C60.6727 38.9331 61.8666 40.127 61.8666 41.5998V45.8664C61.8666 52.052 56.8522 57.0664 50.6666 57.0664H46.4379L48.2856 58.9142C49.327 59.9555 49.327 61.644 48.2856 62.6854C47.2442 63.7268 45.5557 63.7268 44.5144 62.6854L38.1144 56.2854C37.6143 55.7853 37.3333 55.107 37.3333 54.3998C37.3333 53.6925 37.6143 53.0142 38.1144 52.5141L44.5144 46.1142C45.5558 45.0728 47.2442 45.0728 48.2856 46.1142C49.327 47.1556 49.327 48.844 48.2856 49.8854L46.4379 51.7331H50.6666C53.9067 51.7331 56.5333 49.1065 56.5333 45.8664V41.5998C56.5333 40.127 57.7272 38.9331 59.2 38.9331Z"
|
|
116
|
+
d: "M56 48C57.4727 48 58.6666 49.1939 58.6666 50.6666C58.6666 52.1394 57.4727 53.3333 56 53.3333H29.3333C27.8605 53.3333 26.6666 52.1394 26.6666 50.6666C26.6666 49.1939 27.8605 48 29.3333 48H56ZM6.11454 19.4479C7.15594 18.4065 8.84398 18.4065 9.88538 19.4479L20.552 30.1145C21.5934 31.1559 21.5934 32.844 20.552 33.8854L9.88538 44.552C8.84398 45.5934 7.15594 45.5934 6.11454 44.552C5.07315 43.5106 5.07315 41.8226 6.11454 40.7812L14.8958 32L6.11454 23.2187C5.07315 22.1773 5.07315 20.4893 6.11454 19.4479ZM56 29.3333C57.4727 29.3333 58.6666 30.5272 58.6666 32C58.6666 33.4727 57.4727 34.6666 56 34.6666H29.3333C27.8605 34.6666 26.6666 33.4727 26.6666 32C26.6666 30.5272 27.8605 29.3333 29.3333 29.3333H56ZM56 10.6666C57.4727 10.6666 58.6666 11.8605 58.6666 13.3333C58.6666 14.8061 57.4727 16 56 16H29.3333C27.8605 16 26.6666 14.8061 26.6666 13.3333C26.6666 11.8605 27.8605 10.6666 29.3333 10.6666H56Z"
|
|
131
117
|
})
|
|
132
118
|
);
|
|
133
119
|
break;
|
|
134
|
-
case "
|
|
135
|
-
|
|
120
|
+
case "move-first":
|
|
121
|
+
pathList.push(
|
|
136
122
|
h("path", {
|
|
137
123
|
class: ["de-path"],
|
|
138
|
-
|
|
139
|
-
"clip-rule": "evenodd",
|
|
140
|
-
d: "M32.5334 12.8C32.5334 11.3272 33.7273 10.1333 35.2001 10.1333H57.6001C59.0728 10.1333 60.2667 11.3272 60.2667 12.8C60.2667 14.2727 59.0728 15.4666 57.6001 15.4666H35.2001C33.7273 15.4666 32.5334 14.2727 32.5334 12.8ZM21.0857 17.3143C22.1271 18.3557 22.1271 20.0442 21.0857 21.0856L10.1713 32L21.0857 42.9144C22.1271 43.9558 22.1271 45.6442 21.0857 46.6856C20.0443 47.727 18.3558 47.727 17.3144 46.6856L4.51445 33.8856C3.47305 32.8442 3.47305 31.1558 4.51445 30.1144L17.3144 17.3144C18.3558 16.273 20.0443 16.273 21.0857 17.3143ZM26.1334 25.6C26.1334 24.1272 27.3273 22.9333 28.8001 22.9333H57.6001C59.0728 22.9333 60.2667 24.1272 60.2667 25.6C60.2667 27.0727 59.0728 28.2666 57.6001 28.2666H28.8001C27.3273 28.2666 26.1334 27.0727 26.1334 25.6ZM26.1334 38.4C26.1334 36.9272 27.3273 35.7333 28.8001 35.7333H57.6001C59.0728 35.7333 60.2667 36.9272 60.2667 38.4C60.2667 39.8727 59.0728 41.0666 57.6001 41.0666H28.8001C27.3273 41.0666 26.1334 39.8727 26.1334 38.4ZM32.5334 51.2C32.5334 49.7272 33.7273 48.5333 35.2001 48.5333H57.6001C59.0728 48.5333 60.2667 49.7272 60.2667 51.2C60.2667 52.6727 59.0728 53.8666 57.6001 53.8666H35.2001C33.7273 53.8666 32.5334 52.6727 32.5334 51.2Z"
|
|
124
|
+
d: "M29.3333 56V25.1041L17.8854 36.5521C16.844 37.5935 15.1559 37.5935 14.1145 36.5521C13.0731 35.5107 13.0731 33.8226 14.1145 32.7812L30.1145 16.7812L30.3177 16.5989C31.3651 15.7447 32.9091 15.8049 33.8854 16.7812L49.8854 32.7812C50.9268 33.8226 50.9268 35.5107 49.8854 36.5521C48.844 37.5935 47.1559 37.5935 46.1145 36.5521L34.6666 25.1041V56C34.6666 57.4727 33.4727 58.6666 32 58.6666C30.5272 58.6666 29.3333 57.4727 29.3333 56ZM50.6666 5.33331C52.1394 5.33331 53.3333 6.52722 53.3333 7.99998C53.3333 9.47274 52.1394 10.6666 50.6666 10.6666H13.3333C11.8605 10.6666 10.6666 9.47274 10.6666 7.99998C10.6666 6.52722 11.8605 5.33331 13.3333 5.33331H50.6666Z"
|
|
141
125
|
})
|
|
142
126
|
);
|
|
143
127
|
break;
|
|
144
|
-
case "
|
|
145
|
-
|
|
128
|
+
case "move-up":
|
|
129
|
+
pathList.push(
|
|
130
|
+
h("path", { class: ["de-path"], d: "M29.3333 50.6666V19.7708L15.2188 33.8854C14.1774 34.9268 12.4893 34.9268 11.4479 33.8854C10.4065 32.844 10.4065 31.1559 11.4479 30.1145L30.1146 11.4479L30.3177 11.2656C31.3651 10.4113 32.9091 10.4716 33.8854 11.4479L52.5521 30.1145C53.5935 31.1559 53.5935 32.844 52.5521 33.8854C51.5107 34.9268 49.8226 34.9268 48.7812 33.8854L34.6667 19.7708V50.6666C34.6667 52.1394 33.4728 53.3333 32 53.3333C30.5272 53.3333 29.3333 52.1394 29.3333 50.6666Z" })
|
|
131
|
+
);
|
|
132
|
+
break;
|
|
133
|
+
case "move-down":
|
|
134
|
+
pathList.push(h("path", { class: ["de-path"], d: "M29.3333 13.3333C29.3333 11.8605 30.5272 10.6666 32 10.6666C33.4728 10.6666 34.6667 11.8605 34.6667 13.3333V44.2291L48.7812 30.1145C49.8226 29.0731 51.5107 29.0731 52.5521 30.1145C53.5935 31.1559 53.5935 32.844 52.5521 33.8854L33.8854 52.552C32.844 53.5934 31.156 53.5934 30.1146 52.552L11.4479 33.8854C10.4065 32.844 10.4065 31.1559 11.4479 30.1145C12.4893 29.0731 14.1774 29.0731 15.2188 30.1145L29.3333 44.2291V13.3333Z" }));
|
|
135
|
+
break;
|
|
136
|
+
case "move-last":
|
|
137
|
+
pathList.push(
|
|
146
138
|
h("path", {
|
|
147
139
|
class: ["de-path"],
|
|
148
|
-
|
|
149
|
-
"clip-rule": "evenodd",
|
|
150
|
-
d: "M19.7334 12.8C19.7334 11.3272 20.9273 10.1333 22.4001 10.1333H57.6001C59.0728 10.1333 60.2667 11.3272 60.2667 12.8C60.2667 14.2727 59.0728 15.4666 57.6001 15.4666H22.4001C20.9273 15.4666 19.7334 14.2727 19.7334 12.8ZM4.51445 17.3143C5.55585 16.273 7.24429 16.273 8.28568 17.3144L21.0857 30.1144C22.1271 31.1558 22.1271 32.8442 21.0857 33.8856L8.28568 46.6856C7.24429 47.727 5.55585 47.727 4.51445 46.6856C3.47305 45.6442 3.47305 43.9558 4.51445 42.9144L15.4288 32L4.51445 21.0856C3.47305 20.0442 3.47305 18.3557 4.51445 17.3143ZM32.5334 25.6C32.5334 24.1272 33.7273 22.9333 35.2001 22.9333H57.6001C59.0728 22.9333 60.2667 24.1272 60.2667 25.6C60.2667 27.0727 59.0728 28.2666 57.6001 28.2666H35.2001C33.7273 28.2666 32.5334 27.0727 32.5334 25.6ZM32.5334 38.4C32.5334 36.9272 33.7273 35.7333 35.2001 35.7333H57.6001C59.0728 35.7333 60.2667 36.9272 60.2667 38.4C60.2667 39.8727 59.0728 41.0666 57.6001 41.0666H35.2001C33.7273 41.0666 32.5334 39.8727 32.5334 38.4ZM19.7334 51.2C19.7334 49.7272 20.9273 48.5333 22.4001 48.5333H57.6001C59.0728 48.5333 60.2667 49.7272 60.2667 51.2C60.2667 52.6727 59.0728 53.8666 57.6001 53.8666H22.4001C20.9273 53.8666 19.7334 52.6727 19.7334 51.2Z"
|
|
140
|
+
d: "M50.6666 53.3333C52.1394 53.3333 53.3333 54.5272 53.3333 56C53.3333 57.4727 52.1394 58.6666 50.6666 58.6666H13.3333C11.8605 58.6666 10.6666 57.4727 10.6666 56C10.6666 54.5272 11.8605 53.3333 13.3333 53.3333H50.6666ZM29.3333 7.99998C29.3333 6.52722 30.5272 5.33331 32 5.33331C33.4727 5.33331 34.6666 6.52722 34.6666 7.99998V38.8958L46.1145 27.4479C47.1559 26.4065 48.844 26.4065 49.8854 27.4479C50.9268 28.4893 50.9268 30.1773 49.8854 31.2187L33.8854 47.2187C32.844 48.2601 31.1559 48.2601 30.1145 47.2187L14.1145 31.2187C13.0731 30.1773 13.0731 28.4893 14.1145 27.4479C15.1559 26.4065 16.844 26.4065 17.8854 27.4479L29.3333 38.8958V7.99998Z"
|
|
151
141
|
})
|
|
152
142
|
);
|
|
153
143
|
break;
|
|
154
144
|
}
|
|
155
|
-
return h(
|
|
145
|
+
return h(
|
|
146
|
+
"svg",
|
|
147
|
+
{
|
|
148
|
+
class: ["de-icon"],
|
|
149
|
+
viewBox: "0 0 64 64"
|
|
150
|
+
},
|
|
151
|
+
pathList
|
|
152
|
+
);
|
|
156
153
|
}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export declare function
|
|
2
|
-
export declare function
|
|
3
|
-
export declare function
|
|
4
|
-
export declare function
|
|
5
|
-
export declare function _findContentEditableElement($target: Node): HTMLElement | null;
|
|
6
|
-
export declare function _findPoverTextNode(node: Element, idx: number): number;
|
|
1
|
+
export declare function _findFocusableBlock($block: HTMLElement, direction: "up" | "down"): HTMLElement | null;
|
|
2
|
+
export declare function _findEditableElement($block: HTMLElement, direction: "up" | "down"): HTMLElement | null;
|
|
3
|
+
export declare function _findParentBlock($element: HTMLElement | null): HTMLElement | null;
|
|
4
|
+
export declare function _findEditableParent($element: HTMLElement | null): HTMLElement | null;
|
|
@@ -1,90 +1,77 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { _getBlockType } from "../data/index.js";
|
|
2
|
+
export function _findFocusableBlock($block, direction) {
|
|
3
|
+
const $sibling = direction === "up" ? $block.previousElementSibling : $block.nextElementSibling;
|
|
4
|
+
if ($sibling === null) {
|
|
5
|
+
return null;
|
|
6
|
+
} else {
|
|
7
|
+
const type = _getBlockType($sibling);
|
|
8
|
+
if (type !== "custom" && type !== "divider") {
|
|
9
|
+
return $sibling;
|
|
7
10
|
} else {
|
|
8
|
-
|
|
9
|
-
return window;
|
|
10
|
-
} else {
|
|
11
|
-
return _findScrollingElement($wrap);
|
|
12
|
-
}
|
|
11
|
+
return _findFocusableBlock($sibling, direction);
|
|
13
12
|
}
|
|
14
|
-
} else {
|
|
15
|
-
return window;
|
|
16
13
|
}
|
|
17
14
|
}
|
|
18
|
-
export function
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
15
|
+
export function _findEditableElement($block, direction) {
|
|
16
|
+
const targetBlockType = _getBlockType($block);
|
|
17
|
+
let $editableTarget = $block;
|
|
18
|
+
switch (targetBlockType) {
|
|
19
|
+
case "list":
|
|
20
|
+
const children = $block.querySelectorAll(".de-item-text");
|
|
21
|
+
if (children.length > 0) {
|
|
22
|
+
$editableTarget = direction === "up" ? children[children.length - 1] : children[0];
|
|
23
|
+
}
|
|
24
|
+
break;
|
|
25
|
+
case "code":
|
|
26
|
+
if (direction === "up") {
|
|
27
|
+
$editableTarget = $block.querySelector(".de-code-content");
|
|
27
28
|
} else {
|
|
28
|
-
|
|
29
|
+
$editableTarget = $block.querySelector(".de-filename");
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const style = window.getComputedStyle($wrap);
|
|
39
|
-
if (style.transform !== "none") {
|
|
40
|
-
return $wrap;
|
|
41
|
-
} else {
|
|
42
|
-
if ($wrap.tagName === "BODY") {
|
|
43
|
-
return null;
|
|
31
|
+
break;
|
|
32
|
+
case "image":
|
|
33
|
+
$editableTarget = $block.querySelector(".de-caption");
|
|
34
|
+
break;
|
|
35
|
+
case "custom":
|
|
36
|
+
const customNerbyElement = _findFocusableBlock($block, direction);
|
|
37
|
+
if (customNerbyElement !== null) {
|
|
38
|
+
$editableTarget = _findEditableElement(customNerbyElement, direction);
|
|
44
39
|
} else {
|
|
45
|
-
|
|
40
|
+
$editableTarget = null;
|
|
46
41
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
$target = $parent;
|
|
57
|
-
}
|
|
42
|
+
break;
|
|
43
|
+
case "divider":
|
|
44
|
+
const dividerNerbyElement = _findFocusableBlock($block, direction);
|
|
45
|
+
if (dividerNerbyElement !== null) {
|
|
46
|
+
$editableTarget = _findEditableElement(dividerNerbyElement, direction);
|
|
47
|
+
} else {
|
|
48
|
+
$editableTarget = null;
|
|
49
|
+
}
|
|
50
|
+
break;
|
|
58
51
|
}
|
|
59
|
-
return $
|
|
52
|
+
return $editableTarget;
|
|
60
53
|
}
|
|
61
|
-
export function
|
|
62
|
-
if ($
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
if ($baseElement.parentElement === null) {
|
|
67
|
-
return null;
|
|
68
|
-
} else {
|
|
69
|
-
if ($baseElement.parentElement.tagName === "BODY") {
|
|
70
|
-
return null;
|
|
54
|
+
export function _findParentBlock($element) {
|
|
55
|
+
if ($element !== null) {
|
|
56
|
+
const hasClass = $element.classList.contains("de-block");
|
|
57
|
+
if (hasClass === true) {
|
|
58
|
+
return $element;
|
|
71
59
|
} else {
|
|
72
|
-
|
|
73
|
-
return _findContentEditableElement($baseElement.parentNode);
|
|
74
|
-
} else {
|
|
75
|
-
return $baseElement;
|
|
76
|
-
}
|
|
60
|
+
return _findParentBlock($element.parentElement);
|
|
77
61
|
}
|
|
62
|
+
} else {
|
|
63
|
+
return null;
|
|
78
64
|
}
|
|
79
65
|
}
|
|
80
|
-
export function
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
66
|
+
export function _findEditableParent($element) {
|
|
67
|
+
if ($element !== null) {
|
|
68
|
+
const isEditable = $element.contentEditable === "true";
|
|
69
|
+
if (isEditable === true) {
|
|
70
|
+
return $element;
|
|
84
71
|
} else {
|
|
85
|
-
return
|
|
72
|
+
return _findEditableParent($element.parentElement);
|
|
86
73
|
}
|
|
87
74
|
} else {
|
|
88
|
-
return
|
|
75
|
+
return null;
|
|
89
76
|
}
|
|
90
77
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./element.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./style.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./element.js";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./style.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { DETextalign } from "../../type.d.mts.js";
|
|
2
|
+
export declare function _setAlign(style: DETextalign): Promise<void>;
|
|
3
|
+
export declare function _setDecoration(className: DEDecorationClass): Promise<void>;
|
|
4
|
+
export declare function _setLink(url: string): Promise<void>;
|
|
5
|
+
export declare function _removeLink(): Promise<void>;
|