dragon-editor 3.8.6 → 4.0.0

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.
Files changed (91) hide show
  1. package/README.md +10 -9
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +9 -7
  4. package/dist/runtime/components/Block/Code.d.vue.ts +13 -0
  5. package/dist/runtime/components/Block/Code.vue +193 -0
  6. package/dist/runtime/components/Block/Code.vue.d.ts +13 -0
  7. package/dist/runtime/components/Block/Custom.d.vue.ts +9 -0
  8. package/dist/runtime/components/Block/Custom.vue +28 -0
  9. package/dist/runtime/components/Block/Custom.vue.d.ts +9 -0
  10. package/dist/runtime/components/Block/Divider.d.vue.ts +9 -0
  11. package/dist/runtime/components/Block/Divider.vue +27 -0
  12. package/dist/runtime/components/Block/Divider.vue.d.ts +9 -0
  13. package/dist/runtime/components/Block/Heading.d.vue.ts +13 -0
  14. package/dist/runtime/components/Block/Heading.vue +84 -0
  15. package/dist/runtime/components/Block/Heading.vue.d.ts +13 -0
  16. package/dist/runtime/components/Block/Image.d.vue.ts +13 -0
  17. package/dist/runtime/components/Block/Image.vue +146 -0
  18. package/dist/runtime/components/Block/Image.vue.d.ts +13 -0
  19. package/dist/runtime/components/Block/List.d.vue.ts +13 -0
  20. package/dist/runtime/components/Block/List.vue +170 -0
  21. package/dist/runtime/components/Block/List.vue.d.ts +13 -0
  22. package/dist/runtime/components/Block/Text.d.vue.ts +13 -0
  23. package/dist/runtime/components/Block/Text.vue +84 -0
  24. package/dist/runtime/components/Block/Text.vue.d.ts +13 -0
  25. package/dist/runtime/components/DragonEditor.d.vue.ts +28 -22
  26. package/dist/runtime/components/DragonEditor.vue +75 -1225
  27. package/dist/runtime/components/DragonEditor.vue.d.ts +28 -22
  28. package/dist/runtime/components/DragonEditorViewer.d.vue.ts +13 -5
  29. package/dist/runtime/components/DragonEditorViewer.vue +17 -813
  30. package/dist/runtime/components/DragonEditorViewer.vue.d.ts +13 -5
  31. package/dist/runtime/components/MenuBar.d.vue.ts +3 -0
  32. package/dist/runtime/components/MenuBar.vue +385 -0
  33. package/dist/runtime/components/MenuBar.vue.d.ts +3 -0
  34. package/dist/runtime/scss/editor.css +237 -283
  35. package/dist/runtime/scss/viewer.css +184 -210
  36. package/dist/runtime/store/editor.d.ts +2 -0
  37. package/dist/runtime/store/editor.js +59 -0
  38. package/dist/runtime/type.d.mts +101 -124
  39. package/dist/runtime/utils/data/block.d.ts +20 -0
  40. package/dist/runtime/utils/data/block.js +663 -0
  41. package/dist/runtime/utils/data/cursor.d.ts +9 -0
  42. package/dist/runtime/utils/data/cursor.js +137 -0
  43. package/dist/runtime/utils/data/index.d.ts +5 -0
  44. package/dist/runtime/utils/data/index.js +17 -0
  45. package/dist/runtime/utils/data/node.d.ts +9 -0
  46. package/dist/runtime/utils/data/node.js +101 -0
  47. package/dist/runtime/utils/event/cursor.d.ts +3 -6
  48. package/dist/runtime/utils/event/cursor.js +52 -105
  49. package/dist/runtime/utils/event/index.d.ts +2 -6
  50. package/dist/runtime/utils/event/index.js +48 -6
  51. package/dist/runtime/utils/event/keyboard.d.ts +22 -7
  52. package/dist/runtime/utils/event/keyboard.js +910 -1406
  53. package/dist/runtime/utils/layout/body.d.ts +3 -4
  54. package/dist/runtime/utils/layout/body.js +83 -51
  55. package/dist/runtime/utils/layout/icon.d.ts +1 -2
  56. package/dist/runtime/utils/layout/icon.js +64 -67
  57. package/dist/runtime/utils/layout/index.d.ts +0 -3
  58. package/dist/runtime/utils/layout/index.js +0 -3
  59. package/dist/runtime/utils/node/element.d.ts +4 -6
  60. package/dist/runtime/utils/node/element.js +58 -71
  61. package/dist/runtime/utils/node/index.d.ts +1 -1
  62. package/dist/runtime/utils/node/index.js +1 -1
  63. package/dist/runtime/utils/node/style.d.ts +5 -0
  64. package/dist/runtime/utils/node/style.js +702 -0
  65. package/package.json +31 -17
  66. package/dist/runtime/utils/event/block.d.ts +0 -7
  67. package/dist/runtime/utils/event/block.js +0 -110
  68. package/dist/runtime/utils/event/data.d.ts +0 -8
  69. package/dist/runtime/utils/event/data.js +0 -379
  70. package/dist/runtime/utils/event/mouse.d.ts +0 -11
  71. package/dist/runtime/utils/event/mouse.js +0 -85
  72. package/dist/runtime/utils/event/scroll.d.ts +0 -3
  73. package/dist/runtime/utils/event/scroll.js +0 -29
  74. package/dist/runtime/utils/event/touch.d.ts +0 -5
  75. package/dist/runtime/utils/event/touch.js +0 -10
  76. package/dist/runtime/utils/event/window.d.ts +0 -5
  77. package/dist/runtime/utils/event/window.js +0 -47
  78. package/dist/runtime/utils/layout/block.d.ts +0 -7
  79. package/dist/runtime/utils/layout/block.js +0 -123
  80. package/dist/runtime/utils/layout/controlbar.d.ts +0 -3
  81. package/dist/runtime/utils/layout/controlbar.js +0 -99
  82. package/dist/runtime/utils/layout/menuBar.d.ts +0 -3
  83. package/dist/runtime/utils/layout/menuBar.js +0 -408
  84. package/dist/runtime/utils/node/block.d.ts +0 -19
  85. package/dist/runtime/utils/node/block.js +0 -256
  86. package/dist/runtime/utils/style/anchor.d.ts +0 -5
  87. package/dist/runtime/utils/style/anchor.js +0 -245
  88. package/dist/runtime/utils/style/decoration.d.ts +0 -4
  89. package/dist/runtime/utils/style/decoration.js +0 -378
  90. package/dist/runtime/utils/style/index.d.ts +0 -2
  91. package/dist/runtime/utils/style/index.js +0 -2
@@ -1,33 +1,39 @@
1
- import type { DEBlockData, DEContentData, DEDecoration, DETextalign } from "../type.d.mts.js";
2
- interface DEOption {
1
+ import "../scss/editor.scss.js";
2
+ import { _addBlock, _addImageBlock, _checkDataIsEmpty } from "../utils/data/index.js";
3
+ import { _editorMountedEvent } from "../utils/event/index.js";
4
+ import { _setAlign } from "../utils/node/index.js";
5
+ import type { DEContentData } from "../type.d.mts.js";
6
+ interface DragonEditorOption {
3
7
  modelValue: DEContentData;
4
8
  useMenuBar?: boolean;
5
- imageHostURL?: string;
6
- screenChangePoint?: number;
9
+ mediaHostURL?: string;
10
+ isMobile?: boolean;
11
+ theme?: "dark" | "white";
12
+ codeBlockSpaces?: number;
13
+ acceptImageFormat?: string;
14
+ anchorTagTarget?: string;
7
15
  }
8
- declare function addBlock(data: DEBlockData): void;
9
- declare function setDecoration(style: DEDecoration): void;
10
- declare function setAlign(align: DETextalign): void;
11
- declare function changeEditorData(data: DEContentData): void;
12
- declare function updateLayout(): void;
13
- declare function checkDataEmpty(data?: DEContentData): boolean;
14
- declare const __VLS_export: import("vue").DefineComponent<DEOption, {
15
- addBlock: typeof addBlock;
16
- setDecoration: typeof setDecoration;
17
- setAlign: typeof setAlign;
18
- changeEditorData: typeof changeEditorData;
19
- updateLayout: typeof updateLayout;
20
- checkDataEmpty: typeof checkDataEmpty;
16
+ declare const __VLS_export: import("vue").DefineComponent<DragonEditorOption, {
17
+ addBlock: typeof _addBlock;
18
+ addImageBlock: typeof _addImageBlock;
19
+ updateLayout: typeof _editorMountedEvent;
20
+ checkDataIsEmpty: typeof _checkDataIsEmpty;
21
+ setDecoration: (type: "bold" | "italic" | "underline" | "strikethrough" | "code") => void;
22
+ setAlign: typeof _setAlign;
21
23
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
22
24
  "update:modelValue": (data: DEContentData) => any;
23
- uploadImageEvent: (file: File) => any;
24
- }, string, import("vue").PublicProps, Readonly<DEOption> & Readonly<{
25
+ uploadImageEvent: (files: File[]) => any;
26
+ }, string, import("vue").PublicProps, Readonly<DragonEditorOption> & Readonly<{
25
27
  "onUpdate:modelValue"?: ((data: DEContentData) => any) | undefined;
26
- onUploadImageEvent?: ((file: File) => any) | undefined;
28
+ onUploadImageEvent?: ((files: File[]) => any) | undefined;
27
29
  }>, {
28
- imageHostURL: string;
30
+ mediaHostURL: string;
31
+ isMobile: boolean;
32
+ codeBlockSpaces: number;
33
+ acceptImageFormat: string;
34
+ anchorTagTarget: string;
35
+ theme: "dark" | "white";
29
36
  useMenuBar: boolean;
30
- screenChangePoint: number;
31
37
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
32
38
  declare const _default: typeof __VLS_export;
33
39
  export default _default;
@@ -1,9 +1,17 @@
1
- type __VLS_Props = {
1
+ import "../scss/viewer.scss.js";
2
+ import type { DEContentData } from "../type.d.mts.js";
3
+ interface DragonEditorViewerOption {
2
4
  content: DEContentData;
3
- imageHostURL?: string;
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
6
- imageHostURL: string;
5
+ mediaHostURL?: string;
6
+ isMobile?: boolean;
7
+ theme?: "dark" | "white";
8
+ codeBlockSpaces?: number;
9
+ }
10
+ declare const __VLS_export: import("vue").DefineComponent<DragonEditorViewerOption, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<DragonEditorViewerOption> & Readonly<{}>, {
11
+ mediaHostURL: string;
12
+ isMobile: boolean;
13
+ codeBlockSpaces: number;
14
+ theme: "dark" | "white";
7
15
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
8
16
  declare const _default: typeof __VLS_export;
9
17
  export default _default;