@zhangqingcq/vgce 0.0.17 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/README.md +85 -83
  2. package/dist/style.css +2 -2
  3. package/dist/vgce.js +6979 -6928
  4. package/dist/vgce.umd.cjs +62 -62
  5. package/package.json +12 -10
  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 +14 -2
  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 +2 -4
  43. package/src/utils/proxy.ts +0 -1
  44. package/src/views/EditorS.vue +0 -1
  45. package/types/index.d.ts +21 -3
package/README.md CHANGED
@@ -1,83 +1,85 @@
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`
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
+ <script setup lang="ts">
14
+ import {SvgEditor} from '@zhangqingcq/vgce'
15
+
16
+ function preview(d: any) {
17
+ //save d and send it to SvgViewer's data
18
+ }
19
+ </script>
20
+ <template>
21
+ <SvgEditor @onPreview="preview"/>
22
+ </template>
23
+ ```
24
+ 4. viewer
25
+ ```
26
+ <script setup lang="ts">
27
+ import {SvgViewer} from '@zhangqingcq/vgce'
28
+ </script>
29
+ <template>
30
+ <SvgViewer :data="xxx"/>
31
+ </template>
32
+ ```
33
+ 5. custom toolbar
34
+ * copy `src/config/` and change as you want
35
+
36
+ * put svg files into `src/asset/svgs` , then file name need to be same with config.name
37
+
38
+ * put custom parts file into `src/config/files`, then import in `src/config/index.ts` and export with `vueComp`
39
+
40
+ * PS: you have to install `vite-plugin-svg-icons` plugin to append your svgs to html dom.
41
+ ```
42
+ <script setup lang="ts">
43
+ import {SvgEditor} from '@zhangqingcq/vgce'
44
+ import {config} from '@/config'
45
+ </script>
46
+ <template>
47
+ <SvgEditor :customToolbar="config"/>
48
+ </template>
49
+ ```
50
+ 5.1 how to use `vite-plugin-svg-icons`
51
+ * `npm i vite-plugin-svg-icons -D` or `pnpm add vite-plugin-svg-icons -D`
52
+
53
+ * change `vite.config.ts`
54
+ ```
55
+ // vite.config.ts
56
+
57
+ import { fileURLToPath, URL } from 'node:url'
58
+ import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
59
+
60
+ export default defineConfig({
61
+ plugins: [
62
+ xxx,
63
+ createSvgIconsPlugin({
64
+ iconDirs: [fileURLToPath(new URL('./src/assets/svgs', import.meta.url))],
65
+ symbolId: 'svg-[name]',
66
+ svgoOptions: false,
67
+ customDomId: '__svg__icons__dom__'//your id, do not use this id!
68
+ })
69
+ ],
70
+ xxx
71
+ })
72
+ ```
73
+ * change `main.ts`
74
+ ```
75
+ // main.ts
76
+
77
+ import 'virtual:svg-icons-register'
78
+ ```
79
+ * PS: if there is error: `Cannot find module ‘fast-glob’`,then run `npm i fast-glob -D` or `pnpm add fast-glob -D`
80
+ 6. example
81
+ * download [VGCE](https://github.com/RickyHeaven/VGCE.git)
82
+
83
+ * `pnpm i` or `npm i`
84
+
85
+ * `pnpm dev` or `npm run dev`