@zhangqingcq/vgce 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/style.css +1 -1
- package/dist/vgce.js +1620 -1594
- package/dist/vgce.umd.cjs +20 -20
- package/package.json +1 -1
- package/src/components/svg-editor/center-panel.vue +6 -6
- package/src/components/svg-viewer.vue +6 -6
- package/src/config/files/light-a.vue +5 -3
- package/src/config/svg/animation/thermometer.ts +1 -1
- package/src/config/svg/custom/clock-a.ts +1 -1
- package/src/config/svg/custom/light.ts +10 -0
- package/src/config/svg/stateless/bot-2.ts +13 -2
- package/src/utils/mqtt-net.ts +1 -1
package/package.json
CHANGED
@@ -1005,9 +1005,9 @@
|
|
1005
1005
|
<use
|
1006
1006
|
v-else-if="item.type === EDoneJsonType.File"
|
1007
1007
|
:xlink:href="`#svg-${item.name}`"
|
1008
|
-
v-bind="prosToVBind(item)"
|
1009
|
-
width="100"
|
1010
|
-
height="100"
|
1008
|
+
v-bind="prosToVBind(item, ['height', 'width'])"
|
1009
|
+
:width="item.props?.width?.val ?? 100"
|
1010
|
+
:height="item.props?.height?.val ?? 100"
|
1011
1011
|
:id="item.id"
|
1012
1012
|
:transform="`translate(${item.actual_bound.x + item.actual_bound.width / 2},${
|
1013
1013
|
item.actual_bound.y + item.actual_bound.height / 2
|
@@ -1019,9 +1019,9 @@
|
|
1019
1019
|
<component
|
1020
1020
|
v-else-if="item.type === EDoneJsonType.CustomSvg"
|
1021
1021
|
:is="item.tag"
|
1022
|
-
v-bind="prosToVBind(item)"
|
1023
|
-
width="100"
|
1024
|
-
height="100"
|
1022
|
+
v-bind="prosToVBind(item, ['height', 'width'])"
|
1023
|
+
:width="item.props?.width?.val ?? 100"
|
1024
|
+
:height="item.props?.height?.val ?? 100"
|
1025
1025
|
:id="item.id"
|
1026
1026
|
@resize="resizeBox"
|
1027
1027
|
:transform="`translate(${item.actual_bound.x + item.actual_bound.width / 2},${
|
@@ -318,9 +318,9 @@
|
|
318
318
|
<use
|
319
319
|
v-else-if="item.type === EDoneJsonType.File"
|
320
320
|
:xlink:href="`#svg-${item.name}`"
|
321
|
-
v-bind="prosToVBind(item)"
|
322
|
-
width="100"
|
323
|
-
height="100"
|
321
|
+
v-bind="prosToVBind(item, ['height', 'width'])"
|
322
|
+
:width="item.props?.width?.val ?? 100"
|
323
|
+
:height="item.props?.height?.val ?? 100"
|
324
324
|
:id="item.id"
|
325
325
|
:transform="`translate(${item.actual_bound.x + item.actual_bound.width / 2},${
|
326
326
|
item.actual_bound.y + item.actual_bound.height / 2
|
@@ -332,9 +332,9 @@
|
|
332
332
|
<component
|
333
333
|
v-else-if="item.type === EDoneJsonType.CustomSvg"
|
334
334
|
:is="item.tag"
|
335
|
-
v-bind="prosToVBind(item)"
|
336
|
-
width="100"
|
337
|
-
height="100"
|
335
|
+
v-bind="prosToVBind(item, ['height', 'width'])"
|
336
|
+
:width="item.props?.width?.val ?? 100"
|
337
|
+
:height="item.props?.height?.val ?? 100"
|
338
338
|
:id="item.id"
|
339
339
|
@on-change="eventHandle(item, EEventType.Change)"
|
340
340
|
:transform="`translate(${item.actual_bound.x + item.actual_bound.width / 2},${
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
const props = withDefaults(defineProps<{ id: string; isOpen: boolean }>(), {
|
2
|
+
const props = withDefaults(defineProps<{ id: string; isOpen: boolean; height?: number; width?: number }>(), {
|
3
3
|
id: '',
|
4
|
-
isOpen: false
|
4
|
+
isOpen: false,
|
5
|
+
height: 100,
|
6
|
+
width: 100
|
5
7
|
})
|
6
8
|
|
7
9
|
const emit = defineEmits(['onChange'])
|
@@ -65,6 +67,6 @@
|
|
65
67
|
fill="#CEEFF6"
|
66
68
|
/>
|
67
69
|
</symbol>
|
68
|
-
<use :xlink:href="`#${props.id}light-121`" width="
|
70
|
+
<use :xlink:href="`#${props.id}light-121`" :width="width" :height="height" />
|
69
71
|
</g>
|
70
72
|
</template>
|
@@ -13,6 +13,16 @@ export const light_a: IConfigItem = {
|
|
13
13
|
},
|
14
14
|
display: true,
|
15
15
|
props: {
|
16
|
+
height: {
|
17
|
+
title: '高度',
|
18
|
+
type: EConfigItemPropsType.InputNumber,
|
19
|
+
val: 60
|
20
|
+
},
|
21
|
+
width: {
|
22
|
+
title: '宽度',
|
23
|
+
type: EConfigItemPropsType.InputNumber,
|
24
|
+
val: 50
|
25
|
+
},
|
16
26
|
isOpen: {
|
17
27
|
title: '开关',
|
18
28
|
type: EConfigItemPropsType.Switch,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { EDoneJsonType } from '@/config/types'
|
1
|
+
import { EConfigItemPropsType, EDoneJsonType } from '@/config/types'
|
2
2
|
import type { IConfigItem } from '@/config/types'
|
3
3
|
|
4
4
|
export const svg_bot_2: IConfigItem = {
|
@@ -11,7 +11,18 @@ export const svg_bot_2: IConfigItem = {
|
|
11
11
|
have_anchor: true,
|
12
12
|
actual_rect: true
|
13
13
|
},
|
14
|
-
props: {
|
14
|
+
props: {
|
15
|
+
height: {
|
16
|
+
title: '高度',
|
17
|
+
type: EConfigItemPropsType.InputNumber,
|
18
|
+
val: 150
|
19
|
+
},
|
20
|
+
width: {
|
21
|
+
title: '宽度',
|
22
|
+
type: EConfigItemPropsType.InputNumber,
|
23
|
+
val: 120
|
24
|
+
}
|
25
|
+
},
|
15
26
|
common_animations: {
|
16
27
|
val: '',
|
17
28
|
delay: 'delay-0s',
|
package/src/utils/mqtt-net.ts
CHANGED
@@ -3,7 +3,7 @@ import type { MqttClient, PacketCallback } from 'mqtt'
|
|
3
3
|
|
4
4
|
let client: MqttClient
|
5
5
|
|
6
|
-
export const sub = (url: string, user: string, pwd: string, topics: string, callback:
|
6
|
+
export const sub = (url: string, user: string, pwd: string, topics: string, callback: any) => {
|
7
7
|
const _url = url.trim()
|
8
8
|
if (!/^wss?:\/\/.*$/.test(_url)) {
|
9
9
|
console.error('编辑器MQTT通信只支持ws协议 (url必须以"ws://"开头)')
|