@zhangqingcq/vgce 0.0.16 → 0.0.18

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 (45) hide show
  1. package/README.md +83 -82
  2. package/dist/style.css +2 -2
  3. package/dist/vgce.js +7001 -6946
  4. package/dist/vgce.umd.cjs +62 -62
  5. package/package.json +10 -8
  6. package/src/App.vue +1 -3
  7. package/src/components/svg-analysis/index.vue +0 -2
  8. package/src/components/svg-editor/center-panel/index.vue +0 -1
  9. package/src/components/svg-editor/component-tree/index.vue +0 -1
  10. package/src/components/svg-editor/connection-panel/index.vue +0 -1
  11. package/src/components/svg-editor/export-json/index.vue +0 -1
  12. package/src/components/svg-editor/handle-panel/index.vue +0 -1
  13. package/src/components/svg-editor/import-json/index.vue +0 -1
  14. package/src/components/svg-editor/index.vue +0 -1
  15. package/src/components/svg-editor/left-panel/index.vue +0 -1
  16. package/src/components/svg-editor/right-panel/code-edit-modal.vue +0 -1
  17. package/src/components/svg-editor/right-panel/common-animate.vue +0 -1
  18. package/src/components/svg-editor/right-panel/condition.vue +0 -1
  19. package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +4 -4
  20. package/src/components/svg-editor/right-panel/index.vue +1 -2
  21. package/src/components/svg-editor/right-panel/list.vue +0 -1
  22. package/src/components/svg-viewer/index.vue +100 -87
  23. package/src/components/vue3-ruler-tool/index.vue +0 -1
  24. package/src/config/files/clock-a.vue +0 -2
  25. package/src/config/files/common-table.vue +0 -1
  26. package/src/config/files/light-a.vue +0 -2
  27. package/src/config/files/now-time.vue +0 -1
  28. package/src/config/files/pie-charts.vue +0 -1
  29. package/src/config/files/progress.vue +0 -1
  30. package/src/config/files/svg-text.vue +0 -2
  31. package/src/config/files/switch-a.vue +0 -2
  32. package/src/config/svg/stateless/index.ts +1 -5
  33. package/src/config/types.ts +2 -2
  34. package/src/hooks.ts +0 -1
  35. package/src/index.ts +2 -4
  36. package/src/main.ts +0 -1
  37. package/src/stores/config/index.ts +0 -1
  38. package/src/stores/global/index.ts +0 -2
  39. package/src/stores/main.ts +0 -3
  40. package/src/stores/svg-edit-layout/index.ts +0 -1
  41. package/src/stores/system/index.ts +0 -1
  42. package/src/utils/fetch.ts +0 -2
  43. package/src/utils/proxy.ts +0 -1
  44. package/src/views/EditorS.vue +0 -1
  45. package/types/index.d.ts +5 -1
package/README.md CHANGED
@@ -1,82 +1,83 @@
1
- # VGCE
2
-
3
- Vector graphics configure editor. 矢量图组态编辑器。
4
-
5
- ## Guide
6
-
7
- 1. `npm i @zhangqingcq/vgce` or `pnpm add @zhangqingcq/vgce`
8
-
9
- 2. `import '@zhangqingcq/vgce/style'` in main.ts
10
-
11
- 3. editor
12
-
13
- ```
14
- <script setup lang="ts">
15
- import {SvgEditor} from '@zhangqingcq/vgce'
16
-
17
- function preview(d: any) {
18
- //save d and send it to SvgViewer's data
19
- }
20
- </script>
21
- <template>
22
- <SvgEditor @onPreview="preview"/>
23
- </template>
24
- ```
25
-
26
- 4. viewer
27
-
28
- ```
29
- <script setup lang="ts">
30
- import {SvgViewer} from '@zhangqingcq/vgce'
31
- </script>
32
- <template>
33
- <SvgViewer :data="xxx"/>
34
- </template>
35
- ```
36
-
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.
42
- ```
43
- <script setup lang="ts">
44
- import {SvgEditor} from '@zhangqingcq/vgce'
45
- import {config} from '@/config'
46
- </script>
47
- <template>
48
- <SvgEditor :customToolbar="config"/>
49
- </template>
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`
1
+ # VGCE
2
+
3
+ Vector graphics configure editor. 矢量图组态编辑器。
4
+
5
+ ## Guide
6
+
7
+ 1. `npm i @zhangqingcq/vgce` or `pnpm add @zhangqingcq/vgce`
8
+
9
+ 2. `import '@zhangqingcq/vgce/style'` in main.ts
10
+
11
+ 3. editor
12
+
13
+ ```
14
+ <script setup lang="ts">
15
+ import {SvgEditor} from '@zhangqingcq/vgce'
16
+
17
+ function preview(d: any) {
18
+ //save d and send it to SvgViewer's data
19
+ }
20
+ </script>
21
+ <template>
22
+ <SvgEditor @onPreview="preview"/>
23
+ </template>
24
+ ```
25
+
26
+ 4. viewer
27
+
28
+ ```
29
+ <script setup lang="ts">
30
+ import {SvgViewer} from '@zhangqingcq/vgce'
31
+ </script>
32
+ <template>
33
+ <SvgViewer :data="xxx"/>
34
+ </template>
35
+ ```
36
+
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.
42
+ ```
43
+ <script setup lang="ts">
44
+ import {SvgEditor} from '@zhangqingcq/vgce'
45
+ import {config} from '@/config'
46
+ </script>
47
+ <template>
48
+ <SvgEditor :customToolbar="config"/>
49
+ </template>
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
+ * PS: if there is error: `Cannot find module ‘fast-glob’`,then run `npm i fast-glob -D` or `pnpm add fast-glob -D`
79
+
80
+ 6. example
81
+ * download [VGCE](https://github.com/RickyHeaven/VGCE.git)
82
+ * `pnpm i` or `npm i`
83
+ * `pnpm dev` or `npm run dev`