@zhangqingcq/vgce 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +83 -83
- package/dist/style.css +2 -2
- package/dist/vgce.js +7001 -6946
- package/dist/vgce.umd.cjs +62 -62
- package/package.json +10 -8
- package/src/App.vue +1 -3
- package/src/components/svg-analysis/index.vue +0 -2
- package/src/components/svg-editor/center-panel/index.vue +0 -1
- package/src/components/svg-editor/component-tree/index.vue +0 -1
- package/src/components/svg-editor/connection-panel/index.vue +0 -1
- package/src/components/svg-editor/export-json/index.vue +0 -1
- package/src/components/svg-editor/handle-panel/index.vue +0 -1
- package/src/components/svg-editor/import-json/index.vue +0 -1
- package/src/components/svg-editor/index.vue +0 -1
- package/src/components/svg-editor/left-panel/index.vue +0 -1
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +0 -1
- package/src/components/svg-editor/right-panel/common-animate.vue +0 -1
- package/src/components/svg-editor/right-panel/condition.vue +0 -1
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +4 -4
- package/src/components/svg-editor/right-panel/index.vue +1 -2
- package/src/components/svg-editor/right-panel/list.vue +0 -1
- package/src/components/svg-viewer/index.vue +100 -87
- package/src/components/vue3-ruler-tool/index.vue +0 -1
- package/src/config/files/clock-a.vue +0 -2
- package/src/config/files/common-table.vue +0 -1
- package/src/config/files/light-a.vue +0 -2
- package/src/config/files/now-time.vue +0 -1
- package/src/config/files/pie-charts.vue +0 -1
- package/src/config/files/progress.vue +0 -1
- package/src/config/files/svg-text.vue +0 -2
- package/src/config/files/switch-a.vue +0 -2
- package/src/config/svg/stateless/index.ts +1 -5
- package/src/config/types.ts +2 -2
- package/src/hooks.ts +0 -1
- package/src/index.ts +2 -4
- package/src/main.ts +0 -1
- package/src/stores/config/index.ts +0 -1
- package/src/stores/global/index.ts +0 -2
- package/src/stores/main.ts +0 -3
- package/src/stores/svg-edit-layout/index.ts +0 -1
- package/src/stores/system/index.ts +0 -1
- package/src/utils/fetch.ts +0 -2
- package/src/utils/proxy.ts +0 -1
- package/src/views/EditorS.vue +0 -1
- package/types/index.d.ts +5 -1
package/README.md
CHANGED
@@ -1,83 +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
|
-
* 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
|
+
```
|
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`
|