dragon-editor 3.4.1 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
3
  "configKey": "dragon-editor",
4
- "version": "3.4.1"
4
+ "version": "3.4.2"
5
5
  }
@@ -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") {
@@ -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));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
- "version": "3.4.1",
3
+ "version": "3.4.2",
4
4
  "description": "Javascript WYSIWYG editor in Nuxt3!",
5
5
  "repository": {
6
6
  "type": "git",