dragon-editor 2.0.0-beta.2.1.2 → 2.1.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 (49) hide show
  1. package/README.md +29 -5
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +2 -2
  4. package/dist/runtime/core/components/SvgIcon.d.ts +10 -0
  5. package/dist/runtime/core/components/SvgIcon.mjs +98 -0
  6. package/dist/runtime/core/components/editor/ImageBlock.vue +5 -5
  7. package/dist/runtime/core/components/editor/OlBlock.vue +93 -66
  8. package/dist/runtime/core/components/editor/TextBlock.vue +12 -6
  9. package/dist/runtime/core/components/editor/UlBlock.vue +162 -0
  10. package/dist/runtime/core/style/common.css +18 -1
  11. package/dist/runtime/core/style/viewer.css +14 -0
  12. package/dist/runtime/core/utils/converter.d.ts +2 -0
  13. package/dist/runtime/core/utils/converter.mjs +90 -0
  14. package/dist/runtime/core/utils/global.d.ts +3 -0
  15. package/dist/runtime/core/utils/global.mjs +81 -0
  16. package/dist/runtime/core/utils/index.d.ts +3 -2
  17. package/dist/runtime/core/utils/index.mjs +3 -79
  18. package/dist/runtime/core/utils/keyboard.mjs +22 -14
  19. package/dist/runtime/core/utils/ui.d.ts +4 -0
  20. package/dist/runtime/core/utils/ui.mjs +13 -0
  21. package/dist/runtime/shared/components/DragonEditor.d.ts +16 -0
  22. package/dist/runtime/shared/components/DragonEditor.mjs +62 -0
  23. package/dist/runtime/shared/components/DragonEditor.vue +17 -13
  24. package/dist/runtime/shared/components/DragonEditorComment.vue +60 -27
  25. package/dist/runtime/shared/components/DragonEditorViewer.d.ts +14 -0
  26. package/dist/runtime/shared/components/DragonEditorViewer.mjs +15 -0
  27. package/package.json +57 -57
  28. package/dist/runtime/core/components/SvgIcon.vue +0 -175
  29. package/dist/runtime/core/components/icon/Accept.vue +0 -5
  30. package/dist/runtime/core/components/icon/AlignCenter.vue +0 -6
  31. package/dist/runtime/core/components/icon/AlignLeft.vue +0 -6
  32. package/dist/runtime/core/components/icon/AlignRight.vue +0 -6
  33. package/dist/runtime/core/components/icon/ArrowDown.vue +0 -3
  34. package/dist/runtime/core/components/icon/ArrowUp.vue +0 -3
  35. package/dist/runtime/core/components/icon/Cancel.vue +0 -5
  36. package/dist/runtime/core/components/icon/CodeBlock.vue +0 -6
  37. package/dist/runtime/core/components/icon/DecorationBold.vue +0 -6
  38. package/dist/runtime/core/components/icon/DecorationItalic.vue +0 -6
  39. package/dist/runtime/core/components/icon/DecorationStrikethrough.vue +0 -6
  40. package/dist/runtime/core/components/icon/DecorationUnderline.vue +0 -6
  41. package/dist/runtime/core/components/icon/Delete.vue +0 -3
  42. package/dist/runtime/core/components/icon/ImageBlock.vue +0 -5
  43. package/dist/runtime/core/components/icon/LinkPath.vue +0 -6
  44. package/dist/runtime/core/components/icon/OlBlock.vue +0 -6
  45. package/dist/runtime/core/components/icon/QuotationBlock.vue +0 -6
  46. package/dist/runtime/core/components/icon/TableBlock.vue +0 -8
  47. package/dist/runtime/core/components/icon/TextBlock.vue +0 -5
  48. package/dist/runtime/core/components/icon/UlBlock.vue +0 -6
  49. package/dist/runtime/shared/components/DragonEditorViewer.vue +0 -31
@@ -1,6 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- d="M21 13C21 11.8954 20.1046 11 19 11C17.8954 11 17 11.8954 17 13V28C17 36.2843 23.7157 43 32 43C40.2843 43 47 36.2843 47 28V13C47 11.8954 46.1046 11 45 11C43.8954 11 43 11.8954 43 13V28C43 34.0751 38.0751 39 32 39C25.9249 39 21 34.0751 21 28V13ZM13 49C11.8954 49 11 49.8954 11 51C11 52.1046 11.8954 53 13 53H51C52.1046 53 53 52.1046 53 51C53 49.8954 52.1046 49 51 49H13Z"
5
- ></path>
6
- </template>
@@ -1,3 +0,0 @@
1
- <template>
2
- <path class="path" fill-rule="evenodd" clip-rule="evenodd" d="M32 51C42.4934 51 51 42.4934 51 32C51 21.5066 42.4934 13 32 13C21.5066 13 13 21.5066 13 32C13 42.4934 21.5066 51 32 51ZM32 55C44.7026 55 55 44.7026 55 32C55 19.2974 44.7026 9 32 9C19.2974 9 9 19.2974 9 32C9 44.7026 19.2974 55 32 55ZM21.4142 42.6274C20.6332 41.8462 20.6332 40.5801 21.4142 39.7988L29.1715 32.0415L21.5858 24.4558C20.8047 23.6748 20.8047 22.4084 21.5858 21.6274C22.3668 20.8462 23.6332 20.8462 24.4142 21.6274L31.9999 29.2131L39.799 21.4141C40.58 20.6331 41.8464 20.6331 42.6274 21.4141C43.4084 22.1953 43.4084 23.4614 42.6274 24.2427L34.8284 32.0417L42.799 40.0122C43.58 40.7932 43.58 42.0596 42.799 42.8406C42.0179 43.6216 40.7516 43.6216 39.9706 42.8406L32.0001 34.8701L24.2426 42.6274C23.4616 43.4084 22.1953 43.4084 21.4142 42.6274Z"></path>
3
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <path class="path" fill-rule="evenodd" clip-rule="evenodd"
3
- d="M45 13H19C15.6863 13 13 15.6863 13 19V45C13 45.2946 13.0212 45.5843 13.0623 45.8676L22.5157 36.4142C24.7774 34.1525 28.3955 34.0739 30.7515 36.1784L36.5157 30.4142C38.8588 28.0711 42.6578 28.0711 45.0009 30.4142L51 36.4133V19C51 15.6863 48.3137 13 45 13ZM19 51C17.4694 51 16.0727 50.4269 15.0127 49.4835C15.156 49.3993 15.2912 49.2956 15.4142 49.1725L25.3441 39.2426C26.1251 38.4616 27.3915 38.4616 28.1725 39.2426L33.1967 44.2669C33.9778 45.0479 35.2441 45.0479 36.0252 44.2669C36.8062 43.4858 36.8062 42.2195 36.0252 41.4385L33.5867 39L39.3441 33.2426C40.1251 32.4616 41.3915 32.4616 42.1725 33.2426L51 42.0701V45C51 48.3137 48.3137 51 45 51H19ZM19 9C13.4772 9 9 13.4772 9 19V45C9 50.5228 13.4772 55 19 55H45C50.5228 55 55 50.5228 55 45V19C55 13.4772 50.5228 9 45 9H19ZM27 24C27 25.6569 25.6569 27 24 27C22.3431 27 21 25.6569 21 24C21 22.3431 22.3431 21 24 21C25.6569 21 27 22.3431 27 24ZM31 24C31 27.866 27.866 31 24 31C20.134 31 17 27.866 17 24C17 20.134 20.134 17 24 17C27.866 17 31 20.134 31 24Z"
4
- ></path>
5
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- d="M21 20H28C29.1046 20 30 20.8954 30 22C30 23.1046 29.1046 24 28 24H21C16.5817 24 13 27.5817 13 32C13 36.4183 16.5817 40 21 40H28C29.1046 40 30 40.8955 30 42C30 43.1045 29.1046 44 28 44H21C14.3726 44 9 38.6274 9 32C9 25.3726 14.3726 20 21 20ZM51 32C51 36.4183 47.4183 40 43 40H36C34.8964 40 34.0015 40.8939 34 41.9972V42L34 42.0028C34.0015 43.1061 34.8964 44 36 44H43C49.6274 44 55 38.6274 55 32C55 25.3726 49.6274 20 43 20H36C34.8954 20 34 20.8955 34 22C34 23.1045 34.8954 24 36 24H43C47.4183 24 51 27.5817 51 32ZM24.5 30C23.3954 30 22.5 30.8954 22.5 32C22.5 33.1046 23.3954 34 24.5 34H39.5C40.6046 34 41.5 33.1046 41.5 32C41.5 30.8954 40.6046 30 39.5 30H24.5Z"
5
- ></path>
6
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- d="M9 11.75C9 10.7835 9.76747 10 10.7143 10H13.2857C14.2325 10 15 10.7835 15 11.75V21.25C15 22.2165 14.2325 23 13.2857 23C12.3389 23 11.5714 22.2165 11.5714 21.25V13.5H10.7143C9.76747 13.5 9 12.7165 9 11.75ZM27 15C25.8954 15 25 15.8954 25 17C25 18.1046 25.8954 19 27 19H53C54.1046 19 55 18.1046 55 17C55 15.8954 54.1046 15 53 15H27ZM25 32C25 30.8954 25.8954 30 27 30H53C54.1046 30 55 30.8954 55 32C55 33.1046 54.1046 34 53 34H27C25.8954 34 25 33.1046 25 32ZM27 45C25.8954 45 25 45.8954 25 47C25 48.1046 25.8954 49 27 49H53C54.1046 49 55 48.1046 55 47C55 45.8954 54.1046 45 53 45H27ZM12.3846 44.2308C12.3846 43.7635 12.7635 43.3846 13.2308 43.3846C13.6981 43.3846 14.0769 43.7635 14.0769 44.2308C14.0769 44.6981 13.6981 45.0769 13.2308 45.0769C12.2961 45.0769 11.5385 45.8346 11.5385 46.7692C11.5385 47.7039 12.2961 48.4615 13.2308 48.4615C13.6981 48.4615 14.0769 48.8404 14.0769 49.3077C14.0769 49.775 13.6981 50.1538 13.2308 50.1538C12.7635 50.1538 12.3846 49.775 12.3846 49.3077C12.3846 48.3731 11.6269 47.6154 10.6923 47.6154C9.75767 47.6154 9 48.3731 9 49.3077C9 51.6443 10.8942 53.5385 13.2308 53.5385C15.5674 53.5385 17.4615 51.6443 17.4615 49.3077C17.4615 48.3553 17.1468 47.4763 16.6157 46.7692C17.1468 46.0621 17.4615 45.1832 17.4615 44.2308C17.4615 41.8942 15.5674 40 13.2308 40C10.8942 40 9 41.8942 9 44.2308C9 45.1654 9.75767 45.9231 10.6923 45.9231C11.6269 45.9231 12.3846 45.1654 12.3846 44.2308ZM13.5 28.5C13.0029 28.5 12.6 28.8918 12.6 29.375C12.6 30.3415 11.7941 31.125 10.8 31.125C9.80589 31.125 9 30.3415 9 29.375C9 26.9588 11.0147 25 13.5 25C15.9853 25 18 26.9588 18 29.375C18 29.9731 17.7566 30.5282 17.595 30.8603C17.4017 31.2573 17.1464 31.681 16.8741 32.0963C16.8175 32.1825 16.7653 32.2623 16.7163 32.3373C16.2911 32.9875 16.1104 33.2638 15.5 34.0473C15.3789 34.2028 15.0308 34.639 14.74 35.0033C14.5689 35.2177 14.4177 35.4072 14.3443 35.5H17.2C18.1941 35.5 19 36.2835 19 37.25C19 38.2165 18.1941 39 17.2 39H10.8C9.80585 39 9 38.2165 9 37.25C9 36.8843 9.11809 36.6048 9.14918 36.5312L9.15027 36.5286C9.19963 36.4117 9.25386 36.3129 9.29246 36.2463C9.37132 36.1102 9.46475 35.9726 9.54962 35.8528C9.72388 35.6068 9.95766 35.3025 10.2124 34.9778C10.4469 34.6787 10.6916 34.3714 10.949 34.0482L10.9497 34.0473C11.2967 33.6116 11.6665 33.1471 12.0651 32.6355C12.7344 31.7764 13.373 30.9246 13.8384 30.2148C14.0724 29.8581 14.2389 29.5727 14.341 29.3631C14.363 29.3178 14.3794 29.2814 14.3914 29.2532C14.3304 28.8276 13.9545 28.5 13.5 28.5Z"
5
- ></path>
6
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- d="M11 13C9.89543 13 9 13.7397 9 14.6522V49.3478C9 50.2603 9.89543 51 11 51C12.1046 51 13 50.2603 13 49.3478V14.6522C13 13.7397 12.1046 13 11 13ZM23.2667 15C22.0148 15 21 15.8954 21 17C21 18.1046 22.0148 19 23.2667 19H52.7333C53.9852 19 55 18.1046 55 17C55 15.8954 53.9852 15 52.7333 15H23.2667ZM21 47C21 45.8954 22.0148 45 23.2667 45H52.7333C53.9852 45 55 45.8954 55 47C55 48.1046 53.9852 49 52.7333 49H23.2667C22.0148 49 21 48.1046 21 47ZM23.2667 30C22.0148 30 21 30.8954 21 32C21 33.1046 22.0148 34 23.2667 34H52.7333C53.9852 34 55 33.1046 55 32C55 30.8954 53.9852 30 52.7333 30H23.2667Z"
5
- ></path>
6
- </template>
@@ -1,8 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- fill-rule="evenodd"
5
- clip-rule="evenodd"
6
- d="M45 13H19C15.6863 13 13 15.6863 13 19V21H51V19C51 15.6863 48.3137 13 45 13ZM13 36V25H22V36H13ZM26 36V25H38V36H26ZM38 40H26V51H38V40ZM42 51H45C48.3137 51 51 48.3137 51 45V40H42V51ZM42 36V25H51V36H42ZM13 40H22V51H19C15.6863 51 13 48.3137 13 45V40ZM19 9C13.4772 9 9 13.4771 9 19V45C9 50.5229 13.4772 55 19 55H45C50.5228 55 55 50.5229 55 45V19C55 13.4771 50.5228 9 45 9H19Z"
7
- ></path>
8
- </template>
@@ -1,5 +0,0 @@
1
- <template>
2
- <path class="path" fill-rule="evenodd" clip-rule="evenodd"
3
- d="M19 13H45C48.3137 13 51 15.6863 51 19V45C51 48.3137 48.3137 51 45 51H19C15.6863 51 13 48.3137 13 45V19C13 15.6863 15.6863 13 19 13ZM9 19C9 13.4772 13.4772 9 19 9H45C50.5228 9 55 13.4772 55 19V45C55 50.5228 50.5228 55 45 55H19C13.4772 55 9 50.5228 9 45V19ZM20.8571 19C19.8315 19 19 19.8315 19 20.8571C19 20.8806 19.0004 20.904 19.0013 20.9272C19.0004 20.9514 19 20.9756 19 21V22.5714C19 23.676 19.8954 24.5714 21 24.5714C22.0565 24.5714 22.9217 23.7522 22.995 22.7143H30V41.2857H28.8571C27.8315 41.2857 27 42.1172 27 43.1429C27 44.1685 27.8315 45 28.8571 45H32H35.1429C36.1685 45 37 44.1685 37 43.1429C37 42.1172 36.1685 41.2857 35.1429 41.2857H34V22.7143H41.005C41.0783 23.7522 41.9435 24.5714 43 24.5714C44.1046 24.5714 45 23.676 45 22.5714V21C45 20.9756 44.9996 20.9514 44.9987 20.9272C44.9996 20.904 45 20.8806 45 20.8571C45 19.8315 44.1685 19 43.1429 19H43H32H21H20.8571Z"
4
- ></path>
5
- </template>
@@ -1,6 +0,0 @@
1
- <template>
2
- <path
3
- class="path"
4
- d="M11 19C12.1046 19 13 18.1046 13 17C13 15.8954 12.1046 15 11 15C9.89543 15 9 15.8954 9 17C9 18.1046 9.89543 19 11 19ZM23 15C21.8954 15 21 15.8954 21 17C21 18.1046 21.8954 19 23 19H53C54.1046 19 55 18.1046 55 17C55 15.8954 54.1046 15 53 15H23ZM23 30C21.8954 30 21 30.8954 21 32C21 33.1046 21.8954 34 23 34H53C54.1046 34 55 33.1046 55 32C55 30.8954 54.1046 30 53 30H23ZM21 47C21 45.8954 21.8954 45 23 45H53C54.1046 45 55 45.8954 55 47C55 48.1046 54.1046 49 53 49H23C21.8954 49 21 48.1046 21 47ZM13 32C13 33.1046 12.1046 34 11 34C9.89543 34 9 33.1046 9 32C9 30.8954 9.89543 30 11 30C12.1046 30 13 30.8954 13 32ZM11 49C12.1046 49 13 48.1046 13 47C13 45.8954 12.1046 45 11 45C9.89543 45 9 45.8954 9 47C9 48.1046 9.89543 49 11 49Z"
5
- ></path>
6
- </template>
@@ -1,31 +0,0 @@
1
- <template>
2
- <div class="dragon-editor-viewer">
3
- <template v-for="(row, count) in props.content">
4
- <p class="d-text-block" v-if="row.type === 'text'" :class="row.classList" v-html="row.content"></p>
5
-
6
- <template v-if="row.type === 'image'">
7
- <template v-if="row.webp"> </template>
8
- <template v-else>
9
- <div class="d-image-block" :class="row.classList">
10
- <div class="d-image-area">
11
- <img class="d-img" :src="row.src" :width="row.width" :height="row.height" :alt="row.caption" loading="lazy" />
12
- </div>
13
- <p class="d-caption" v-if="row.caption" v-html="row.caption"></p>
14
- </div>
15
- </template>
16
- </template>
17
- </template>
18
- </div>
19
- </template>
20
-
21
- <script setup lang="ts">
22
- import { editorContentType } from "../../../types";
23
-
24
- const props = defineProps<{
25
- content: editorContentType;
26
- }>();
27
- </script>
28
-
29
- <style>
30
- @import "../../core/style/viewer.css";
31
- </style>