@zhangqingcq/vgce 0.0.14 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. package/README.md +38 -3
  2. package/dist/vgce.js +5040 -5305
  3. package/dist/vgce.umd.cjs +43 -143
  4. package/package.json +3 -2
  5. package/src/App.vue +11 -0
  6. package/src/assets/base.less +49 -0
  7. package/src/assets/icons/add.svg +1 -0
  8. package/src/assets/icons/delete.svg +12 -0
  9. package/src/assets/icons/export.svg +1 -0
  10. package/src/assets/icons/group.svg +13 -0
  11. package/src/assets/icons/import.svg +1 -0
  12. package/src/assets/icons/lock.svg +7 -0
  13. package/src/assets/icons/menu-fold.svg +9 -0
  14. package/src/assets/icons/menu-unfold.svg +9 -0
  15. package/src/assets/icons/preview.svg +6 -0
  16. package/src/assets/icons/redo.svg +8 -0
  17. package/src/assets/icons/return.svg +8 -0
  18. package/src/assets/icons/rotate.svg +1 -0
  19. package/src/assets/icons/save.svg +9 -0
  20. package/src/assets/icons/setting.svg +6 -0
  21. package/src/assets/icons/undo.svg +7 -0
  22. package/src/assets/icons/ungroup.svg +16 -0
  23. package/src/assets/icons/unlock.svg +7 -0
  24. package/src/assets/main.less +6 -0
  25. package/src/assets/svgs/alternator.svg +8 -0
  26. package/src/assets/svgs/bot-2.svg +1 -0
  27. package/src/assets/svgs/circuit-breaker.svg +11 -0
  28. package/src/assets/svgs/clock-a.svg +23 -0
  29. package/src/assets/svgs/common-table.svg +7 -0
  30. package/src/assets/svgs/el-button.svg +10 -0
  31. package/src/assets/svgs/el-tag.svg +13 -0
  32. package/src/assets/svgs/house.svg +1 -0
  33. package/src/assets/svgs/light.svg +24 -0
  34. package/src/assets/svgs/now-time.svg +9 -0
  35. package/src/assets/svgs/package.svg +1 -0
  36. package/src/assets/svgs/pie-charts.svg +10 -0
  37. package/src/assets/svgs/progress-a.svg +1 -0
  38. package/src/assets/svgs/reservoir.svg +10 -0
  39. package/src/assets/svgs/svg-text.svg +5 -0
  40. package/src/assets/svgs/switch-a.svg +5 -0
  41. package/src/components/ace-edit/index.ts +27 -0
  42. package/src/components/config/index.ts +450 -0
  43. package/src/components/config/types.ts +25 -0
  44. package/src/components/svg-analysis/index.vue +11 -0
  45. package/src/components/svg-editor/center-panel/index.vue +867 -0
  46. package/src/components/svg-editor/center-panel/types.ts +11 -0
  47. package/src/components/svg-editor/component-tree/index.vue +33 -0
  48. package/src/components/svg-editor/connection-line/index.vue +125 -0
  49. package/src/components/svg-editor/connection-panel/index.vue +198 -0
  50. package/src/components/svg-editor/export-json/index.vue +37 -0
  51. package/src/components/svg-editor/handle-panel/index.vue +342 -0
  52. package/src/components/svg-editor/import-json/index.vue +37 -0
  53. package/src/components/svg-editor/index.vue +280 -0
  54. package/src/components/svg-editor/left-panel/index.vue +83 -0
  55. package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
  56. package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
  57. package/src/components/svg-editor/right-panel/condition.vue +101 -0
  58. package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
  59. package/src/components/svg-editor/right-panel/index.vue +304 -0
  60. package/src/components/svg-editor/right-panel/list.vue +86 -0
  61. package/src/components/svg-editor/top-panel/index.vue +139 -0
  62. package/src/components/svg-editor/types.ts +22 -0
  63. package/src/components/svg-viewer/index.vue +340 -0
  64. package/src/components/vue3-ruler-tool/index.vue +506 -0
  65. package/src/config/files/clock-a.vue +66 -0
  66. package/src/config/files/common-table.vue +49 -0
  67. package/src/config/files/light-a.vue +72 -0
  68. package/src/config/files/now-time.vue +53 -0
  69. package/src/config/files/pie-charts.vue +72 -0
  70. package/src/config/files/progress.vue +40 -0
  71. package/src/config/files/svg-text.vue +39 -0
  72. package/src/config/files/switch-a.vue +45 -0
  73. package/src/config/index.ts +28 -0
  74. package/src/config/svg/animation/index.ts +8 -0
  75. package/src/config/svg/animation/reservoir.ts +32 -0
  76. package/src/config/svg/custom/clock-a.ts +23 -0
  77. package/src/config/svg/custom/index.ts +11 -0
  78. package/src/config/svg/custom/light.ts +29 -0
  79. package/src/config/svg/custom/svg-text.ts +54 -0
  80. package/src/config/svg/custom/switch-a.ts +29 -0
  81. package/src/config/svg/index.ts +12 -0
  82. package/src/config/svg/stateful/circuit-breaker.ts +38 -0
  83. package/src/config/svg/stateful/index.ts +8 -0
  84. package/src/config/svg/stateless/alternator.ts +28 -0
  85. package/src/config/svg/stateless/bot-2.ts +22 -0
  86. package/src/config/svg/stateless/house.ts +22 -0
  87. package/src/config/svg/stateless/index.ts +14 -0
  88. package/src/config/types.ts +126 -0
  89. package/src/config/vue/component/button.ts +57 -0
  90. package/src/config/vue/component/common-table.ts +124 -0
  91. package/src/config/vue/component/index.ts +13 -0
  92. package/src/config/vue/component/now-time.ts +29 -0
  93. package/src/config/vue/component/progress.ts +29 -0
  94. package/src/config/vue/component/tag.ts +46 -0
  95. package/src/config/vue/echarts/index.ts +8 -0
  96. package/src/config/vue/echarts/pie-charts.ts +60 -0
  97. package/src/config/vue/index.ts +5 -0
  98. package/src/hooks.ts +47 -0
  99. package/src/index.ts +14 -0
  100. package/src/main.ts +15 -0
  101. package/src/router.ts +24 -0
  102. package/src/stores/config/index.ts +44 -0
  103. package/src/stores/config/types.ts +27 -0
  104. package/src/stores/global/index.ts +109 -0
  105. package/src/stores/global/types.ts +115 -0
  106. package/src/stores/main.ts +10 -0
  107. package/src/stores/svg-edit-layout/index.ts +17 -0
  108. package/src/stores/svg-edit-layout/types.ts +8 -0
  109. package/src/stores/system/index.ts +174 -0
  110. package/src/stores/system/types.ts +43 -0
  111. package/src/utils/fetch.ts +351 -0
  112. package/src/utils/file-read-write.ts +26 -0
  113. package/src/utils/index.ts +397 -0
  114. package/src/utils/mqtt-net.ts +48 -0
  115. package/src/utils/proxy.ts +7 -0
  116. package/src/utils/scale-core.ts +214 -0
  117. package/src/utils/types.ts +13 -0
  118. package/src/views/EditorS.vue +18 -0
  119. package/src/views/Preview.vue +12 -0
package/README.md CHANGED
@@ -34,14 +34,49 @@ Vector graphics configure editor. 矢量图组态编辑器。
34
34
  </template>
35
35
  ```
36
36
 
37
- 5.custom toolbar
38
- copy src/config/ and change as you want
37
+ 5. custom toolbar
38
+ * copy `src/config/` and change as you want
39
+ * put svg files into `src/asset/svgs` , then file name need to be same with config.name
40
+ * put custom parts file into `src/config/files`, then import in `src/config/index.ts` and export with `vueComp`
41
+ * PS: you have to install `vite-plugin-svg-icons` plugin to append your svgs to html dom.
39
42
  ```
40
43
  <script setup lang="ts">
41
44
  import {SvgEditor} from '@zhangqingcq/vgce'
42
45
  import {config} from '@/config'
43
46
  </script>
44
47
  <template>
45
- <SvgEditor @customToolbar="config"/>
48
+ <SvgEditor :customToolbar="config"/>
46
49
  </template>
47
50
  ```
51
+
52
+ 5.1 how to use `vite-plugin-svg-icons`
53
+ * `npm i vite-plugin-svg-icons -D` or `pnpm add vite-plugin-svg-icons -D`
54
+ * change `vite.config.ts`
55
+ ```
56
+ import { fileURLToPath, URL } from 'node:url'
57
+ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
58
+
59
+ export default defineConfig({
60
+ plugins: [
61
+ xxx,
62
+ createSvgIconsPlugin({
63
+ iconDirs: [fileURLToPath(new URL('./src/assets/svgs', import.meta.url))],
64
+ symbolId: 'svg-[name]',
65
+ svgoOptions: false,
66
+ customDomId: '__svg__icons__dom__'//your id, do not use this id!
67
+ })
68
+ ],
69
+ xxx
70
+ })
71
+ ```
72
+ * change `main.ts`
73
+ ```
74
+ xxx
75
+ import 'virtual:svg-icons-register'
76
+ xxx
77
+ ```
78
+
79
+ 6. example
80
+ * download [VGCE](https://github.com/RickyHeaven/VGCE.git)
81
+ * `pnpm i` or `npm i`
82
+ * `pnpm dev` or `npm run dev`