@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.
- package/README.md +38 -3
- package/dist/vgce.js +5040 -5305
- package/dist/vgce.umd.cjs +43 -143
- package/package.json +3 -2
- package/src/App.vue +11 -0
- package/src/assets/base.less +49 -0
- package/src/assets/icons/add.svg +1 -0
- package/src/assets/icons/delete.svg +12 -0
- package/src/assets/icons/export.svg +1 -0
- package/src/assets/icons/group.svg +13 -0
- package/src/assets/icons/import.svg +1 -0
- package/src/assets/icons/lock.svg +7 -0
- package/src/assets/icons/menu-fold.svg +9 -0
- package/src/assets/icons/menu-unfold.svg +9 -0
- package/src/assets/icons/preview.svg +6 -0
- package/src/assets/icons/redo.svg +8 -0
- package/src/assets/icons/return.svg +8 -0
- package/src/assets/icons/rotate.svg +1 -0
- package/src/assets/icons/save.svg +9 -0
- package/src/assets/icons/setting.svg +6 -0
- package/src/assets/icons/undo.svg +7 -0
- package/src/assets/icons/ungroup.svg +16 -0
- package/src/assets/icons/unlock.svg +7 -0
- package/src/assets/main.less +6 -0
- package/src/assets/svgs/alternator.svg +8 -0
- package/src/assets/svgs/bot-2.svg +1 -0
- package/src/assets/svgs/circuit-breaker.svg +11 -0
- package/src/assets/svgs/clock-a.svg +23 -0
- package/src/assets/svgs/common-table.svg +7 -0
- package/src/assets/svgs/el-button.svg +10 -0
- package/src/assets/svgs/el-tag.svg +13 -0
- package/src/assets/svgs/house.svg +1 -0
- package/src/assets/svgs/light.svg +24 -0
- package/src/assets/svgs/now-time.svg +9 -0
- package/src/assets/svgs/package.svg +1 -0
- package/src/assets/svgs/pie-charts.svg +10 -0
- package/src/assets/svgs/progress-a.svg +1 -0
- package/src/assets/svgs/reservoir.svg +10 -0
- package/src/assets/svgs/svg-text.svg +5 -0
- package/src/assets/svgs/switch-a.svg +5 -0
- package/src/components/ace-edit/index.ts +27 -0
- package/src/components/config/index.ts +450 -0
- package/src/components/config/types.ts +25 -0
- package/src/components/svg-analysis/index.vue +11 -0
- package/src/components/svg-editor/center-panel/index.vue +867 -0
- package/src/components/svg-editor/center-panel/types.ts +11 -0
- package/src/components/svg-editor/component-tree/index.vue +33 -0
- package/src/components/svg-editor/connection-line/index.vue +125 -0
- package/src/components/svg-editor/connection-panel/index.vue +198 -0
- package/src/components/svg-editor/export-json/index.vue +37 -0
- package/src/components/svg-editor/handle-panel/index.vue +342 -0
- package/src/components/svg-editor/import-json/index.vue +37 -0
- package/src/components/svg-editor/index.vue +280 -0
- package/src/components/svg-editor/left-panel/index.vue +83 -0
- package/src/components/svg-editor/right-panel/code-edit-modal.vue +50 -0
- package/src/components/svg-editor/right-panel/common-animate.vue +96 -0
- package/src/components/svg-editor/right-panel/condition.vue +101 -0
- package/src/components/svg-editor/right-panel/dynamic-el-form-item.vue +97 -0
- package/src/components/svg-editor/right-panel/index.vue +304 -0
- package/src/components/svg-editor/right-panel/list.vue +86 -0
- package/src/components/svg-editor/top-panel/index.vue +139 -0
- package/src/components/svg-editor/types.ts +22 -0
- package/src/components/svg-viewer/index.vue +340 -0
- package/src/components/vue3-ruler-tool/index.vue +506 -0
- package/src/config/files/clock-a.vue +66 -0
- package/src/config/files/common-table.vue +49 -0
- package/src/config/files/light-a.vue +72 -0
- package/src/config/files/now-time.vue +53 -0
- package/src/config/files/pie-charts.vue +72 -0
- package/src/config/files/progress.vue +40 -0
- package/src/config/files/svg-text.vue +39 -0
- package/src/config/files/switch-a.vue +45 -0
- package/src/config/index.ts +28 -0
- package/src/config/svg/animation/index.ts +8 -0
- package/src/config/svg/animation/reservoir.ts +32 -0
- package/src/config/svg/custom/clock-a.ts +23 -0
- package/src/config/svg/custom/index.ts +11 -0
- package/src/config/svg/custom/light.ts +29 -0
- package/src/config/svg/custom/svg-text.ts +54 -0
- package/src/config/svg/custom/switch-a.ts +29 -0
- package/src/config/svg/index.ts +12 -0
- package/src/config/svg/stateful/circuit-breaker.ts +38 -0
- package/src/config/svg/stateful/index.ts +8 -0
- package/src/config/svg/stateless/alternator.ts +28 -0
- package/src/config/svg/stateless/bot-2.ts +22 -0
- package/src/config/svg/stateless/house.ts +22 -0
- package/src/config/svg/stateless/index.ts +14 -0
- package/src/config/types.ts +126 -0
- package/src/config/vue/component/button.ts +57 -0
- package/src/config/vue/component/common-table.ts +124 -0
- package/src/config/vue/component/index.ts +13 -0
- package/src/config/vue/component/now-time.ts +29 -0
- package/src/config/vue/component/progress.ts +29 -0
- package/src/config/vue/component/tag.ts +46 -0
- package/src/config/vue/echarts/index.ts +8 -0
- package/src/config/vue/echarts/pie-charts.ts +60 -0
- package/src/config/vue/index.ts +5 -0
- package/src/hooks.ts +47 -0
- package/src/index.ts +14 -0
- package/src/main.ts +15 -0
- package/src/router.ts +24 -0
- package/src/stores/config/index.ts +44 -0
- package/src/stores/config/types.ts +27 -0
- package/src/stores/global/index.ts +109 -0
- package/src/stores/global/types.ts +115 -0
- package/src/stores/main.ts +10 -0
- package/src/stores/svg-edit-layout/index.ts +17 -0
- package/src/stores/svg-edit-layout/types.ts +8 -0
- package/src/stores/system/index.ts +174 -0
- package/src/stores/system/types.ts +43 -0
- package/src/utils/fetch.ts +351 -0
- package/src/utils/file-read-write.ts +26 -0
- package/src/utils/index.ts +397 -0
- package/src/utils/mqtt-net.ts +48 -0
- package/src/utils/proxy.ts +7 -0
- package/src/utils/scale-core.ts +214 -0
- package/src/utils/types.ts +13 -0
- package/src/views/EditorS.vue +18 -0
- 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
|
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
|
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`
|