dragon-editor 3.4.0 → 3.4.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.
- package/dist/module.json +1 -1
- package/dist/runtime/components/DragonEditor.vue +1 -1
- package/dist/runtime/components/DragonEditorViewer.vue +3 -1
- package/dist/runtime/scss/viewer.css +3 -1
- package/dist/runtime/utils/block.d.ts +1 -1
- package/dist/runtime/utils/block.mjs +2 -2
- package/dist/runtime/utils/convertor.d.ts +1 -1
- package/dist/runtime/utils/convertor.mjs +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -604,7 +604,7 @@ function getContentData(): DEContentData {
|
|
|
604
604
|
}
|
|
605
605
|
|
|
606
606
|
function setContentData(data: DEContentData) {
|
|
607
|
-
_setContentData(data, editorStore);
|
|
607
|
+
_setContentData(data, editorStore, props.imageHostURL);
|
|
608
608
|
}
|
|
609
609
|
|
|
610
610
|
function moveBlock(type: "up" | "down") {
|
|
@@ -181,12 +181,14 @@ const props = defineProps<{
|
|
|
181
181
|
* 노드 스타일
|
|
182
182
|
*/
|
|
183
183
|
.dragon-editor-viewer {
|
|
184
|
-
display:
|
|
184
|
+
display: flex;
|
|
185
|
+
flex-direction: column;
|
|
185
186
|
gap: 4px;
|
|
186
187
|
width: 100%;
|
|
187
188
|
height: 100%;
|
|
188
189
|
padding: 20px;
|
|
189
190
|
line-height: 1.6;
|
|
191
|
+
box-sizing: border-box;
|
|
190
192
|
}
|
|
191
193
|
.dragon-editor-viewer .de-block {
|
|
192
194
|
width: 100%;
|
|
@@ -133,12 +133,14 @@
|
|
|
133
133
|
* 노드 스타일
|
|
134
134
|
*/
|
|
135
135
|
.dragon-editor-viewer {
|
|
136
|
-
display:
|
|
136
|
+
display: flex;
|
|
137
|
+
flex-direction: column;
|
|
137
138
|
gap: 4px;
|
|
138
139
|
width: 100%;
|
|
139
140
|
height: 100%;
|
|
140
141
|
padding: 20px;
|
|
141
142
|
line-height: 1.6;
|
|
143
|
+
box-sizing: border-box;
|
|
142
144
|
}
|
|
143
145
|
.dragon-editor-viewer .de-block {
|
|
144
146
|
width: 100%;
|
|
@@ -7,7 +7,7 @@ export declare function _createTextBlock(data?: DETextBlock): HTMLParagraphEleme
|
|
|
7
7
|
export declare function _createHeadingBlock(data: DEHeadingBlock): HTMLHeadingElement;
|
|
8
8
|
export declare function _createListBlock(data: DEListBlock): HTMLElement;
|
|
9
9
|
export declare function _createListItemBlock(child?: DEListItem): HTMLLIElement;
|
|
10
|
-
export declare function _createImageBlock(data: DEImageBlock): HTMLDivElement;
|
|
10
|
+
export declare function _createImageBlock(data: DEImageBlock, imageHostURL: string): HTMLDivElement;
|
|
11
11
|
export declare function _createCodeBlock(data: DECodeBlock): HTMLDivElement;
|
|
12
12
|
export declare function _generateId(): string;
|
|
13
13
|
export declare function _createCustomBlock(data: DECustomBlock): HTMLDivElement;
|
|
@@ -68,7 +68,7 @@ export function _createListItemBlock(child = { textContent: "", classList: [] })
|
|
|
68
68
|
}
|
|
69
69
|
return $li;
|
|
70
70
|
}
|
|
71
|
-
export function _createImageBlock(data) {
|
|
71
|
+
export function _createImageBlock(data, imageHostURL) {
|
|
72
72
|
const $wrap = document.createElement("div");
|
|
73
73
|
const $div = document.createElement("div");
|
|
74
74
|
const $leftBtn = document.createElement("button");
|
|
@@ -87,7 +87,7 @@ export function _createImageBlock(data) {
|
|
|
87
87
|
} else {
|
|
88
88
|
$div.dataset["maxwidth"] = String(data.maxWidth);
|
|
89
89
|
}
|
|
90
|
-
$image.src = data.src;
|
|
90
|
+
$image.src = imageHostURL + data.src;
|
|
91
91
|
$image.width = data.width;
|
|
92
92
|
$image.height = data.height;
|
|
93
93
|
$image.draggable = false;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import "../type.d.ts";
|
|
2
2
|
export declare function _getContentData($content: HTMLDivElement, imageHostURL: string): DEContentData;
|
|
3
|
-
export declare function _setContentData(data: DEContentData, store: any): void;
|
|
3
|
+
export declare function _setContentData(data: DEContentData, store: any, imageHostURL: string): void;
|
|
@@ -29,7 +29,7 @@ export function _getContentData($content, imageHostURL) {
|
|
|
29
29
|
});
|
|
30
30
|
return data;
|
|
31
31
|
}
|
|
32
|
-
export function _setContentData(data, store) {
|
|
32
|
+
export function _setContentData(data, store, imageHostURL) {
|
|
33
33
|
const childList = [];
|
|
34
34
|
data.forEach((item) => {
|
|
35
35
|
switch (item.type) {
|
|
@@ -43,7 +43,7 @@ export function _setContentData(data, store) {
|
|
|
43
43
|
childList.push(_createListBlock(item));
|
|
44
44
|
break;
|
|
45
45
|
case "image":
|
|
46
|
-
childList.push(_createImageBlock(item));
|
|
46
|
+
childList.push(_createImageBlock(item, imageHostURL));
|
|
47
47
|
break;
|
|
48
48
|
case "code":
|
|
49
49
|
childList.push(_createCodeBlock(item));
|