dragon-editor 3.5.6 → 3.5.7
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 +6 -1
- package/dist/module.json +1 -1
- package/dist/runtime/plugin.js +1 -1
- package/dist/runtime/type.d.ts +25 -25
- package/dist/runtime/utils/node/block.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ This module support only Nuxt3.
|
|
|
31
31
|
|
|
32
32
|
# Dependencies
|
|
33
33
|
|
|
34
|
-
-
|
|
34
|
+
- highlight.js
|
|
35
35
|
|
|
36
36
|
# Font
|
|
37
37
|
|
|
@@ -54,6 +54,11 @@ First. Set module
|
|
|
54
54
|
```typescript
|
|
55
55
|
export default defineNuxtConfig({
|
|
56
56
|
modules: ["dragon-editor"],
|
|
57
|
+
vite: {
|
|
58
|
+
optimizeDeps: {
|
|
59
|
+
include: ["highlight.js/lib/core"],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
57
62
|
});
|
|
58
63
|
```
|
|
59
64
|
|
package/dist/module.json
CHANGED
package/dist/runtime/plugin.js
CHANGED
package/dist/runtime/type.d.ts
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
|
|
1
|
+
type DEContentData = DEBlockData[];
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
type DEBlockData = DETextBlock | DEHeadingBlock | DEListBlock | DEImageBlock | DECodeBlock | DECustomBlock;
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
type DEIconKind = "plus" | "bold" | "italic" | "underline" | "strikethrough" | "codeblock" | "add-link" | "remove-link" | "image" | "align-center" | "align-left" | "align-right" | "align-justify" | "move-up" | "move-down" | "indent-decrease" | "indent-increase";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
type DEDecoration = "bold" | "italic" | "underline" | "strikethrough" | "code";
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type DETextalign = "left" | "right" | "center" | "justify";
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
type DEBlock = "text" | "heading" | "ul" | "ol" | "image" | "code" | "custom";
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
type DEBlockMenutype = "text" | "heading1" | "heading2" | "heading3" | "ul" | "ol" | "image" | "code" | "custom";
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
type DEListStyle = "disc" | "square" | "decimal" | "lower-alpha" | "upper-alpha" | "lower-roman" | "upper-roman";
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
type DECodeblockTheme = "github" | "github-dark-dimmed";
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type DECodeblockLang = "text" | "bash" | "csharp" | "c" | "cpp" | "css" | "django" | "dockerfile" | "go" | "html" | "json" | "java" | "js" | "ts" | "kotlin" | "lua" | "md" | "nginx" | "php" | "python" | "ruby" | "scss" | "sql" | "shell" | "swift" | "yml";
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
type DEBlockElement = HTMLParagraphElement | HTMLHeadingElement | HTMLElement | HTMLDivElement;
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
type DEListElementName = "ul" | "ol";
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface DragonEditorStore {
|
|
26
26
|
cursorData: DEditorCursor | null;
|
|
27
27
|
message: { [key: string]: string };
|
|
28
28
|
controlBar: {
|
|
@@ -79,7 +79,7 @@ export interface DragonEditorStore {
|
|
|
79
79
|
};
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
interface DEditorCursor {
|
|
83
83
|
type: "Range" | "Caret" | "None";
|
|
84
84
|
startNode: Node;
|
|
85
85
|
startOffset: number;
|
|
@@ -87,7 +87,7 @@ export interface DEditorCursor {
|
|
|
87
87
|
endOffset: number;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
interface DEArrangeCursorData {
|
|
91
91
|
startNode: Node;
|
|
92
92
|
startNodeIdx: number;
|
|
93
93
|
startOffset: number;
|
|
@@ -96,31 +96,31 @@ export interface DEArrangeCursorData {
|
|
|
96
96
|
endOffset: number;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
interface DECodeItem<T = string> {
|
|
100
100
|
text: string;
|
|
101
101
|
code: T;
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
interface DEHeadingItem {
|
|
105
105
|
name: string;
|
|
106
106
|
id: string;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// 컴포넌트 메서드용 타입
|
|
110
|
-
|
|
110
|
+
interface DragonEditor {
|
|
111
111
|
addBlock: (type: DEBlockData) => void;
|
|
112
112
|
setDecoration: (data: DEDecoration) => void;
|
|
113
113
|
setTextAlign: (type: DETextalign) => void;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
interface DETextBlock {
|
|
117
117
|
type: "text";
|
|
118
118
|
classList: string[];
|
|
119
119
|
depth?: number;
|
|
120
120
|
textContent: string;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
interface DEHeadingBlock {
|
|
124
124
|
type: "heading";
|
|
125
125
|
level: number;
|
|
126
126
|
id: string;
|
|
@@ -129,12 +129,12 @@ export interface DEHeadingBlock {
|
|
|
129
129
|
textContent: string;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
interface DEListItem {
|
|
133
133
|
classList: string[];
|
|
134
134
|
textContent: string;
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
interface DEListBlock {
|
|
138
138
|
type: "list";
|
|
139
139
|
element: DEListElementName;
|
|
140
140
|
depth?: number;
|
|
@@ -142,7 +142,7 @@ export interface DEListBlock {
|
|
|
142
142
|
child: DEListItem[];
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
|
|
145
|
+
interface DEImageBlock {
|
|
146
146
|
type: "image";
|
|
147
147
|
maxWidth: number;
|
|
148
148
|
src: string;
|
|
@@ -152,7 +152,7 @@ export interface DEImageBlock {
|
|
|
152
152
|
classList: string[];
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
interface DECodeBlock {
|
|
156
156
|
type: "code";
|
|
157
157
|
language: DECodeblockLang;
|
|
158
158
|
theme: DECodeblockTheme;
|
|
@@ -160,7 +160,7 @@ export interface DECodeBlock {
|
|
|
160
160
|
textContent: string;
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
interface DECustomBlock {
|
|
164
164
|
type: "custom";
|
|
165
165
|
classList: string[];
|
|
166
166
|
textContent: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { _getDefaultBlockData, _generateId, _updateModelData, _updateCursorData, _decideWhetherOpenControlBar, _updateControlBarStatus, CODEBLOCKLANG } from "../event/index.js";
|
|
2
|
-
import hljs from "highlight.js
|
|
2
|
+
import hljs from "highlight.js";
|
|
3
3
|
export function _addBlock(type, store, data) {
|
|
4
4
|
const blockData = data === void 0 ? _getDefaultBlockData(type) : data;
|
|
5
5
|
let $block = _createTextBlock(_getDefaultBlockData("text"));
|