@zhangqingcq/vgce 0.0.18 → 0.0.19
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +66 -64
- package/dist/style.css +1 -1
- package/dist/vgce.js +33 -37
- package/dist/vgce.umd.cjs +1 -1
- package/package.json +3 -3
- package/src/components/svg-viewer/index.vue +94 -95
- package/src/utils/fetch.ts +2 -2
- package/types/index.d.ts +19 -5
package/dist/vgce.js
CHANGED
@@ -62956,52 +62956,51 @@ const sub = (i, n, r, g, k) => {
|
|
62956
62956
|
data: {},
|
62957
62957
|
canvasDrag: { type: Boolean, default: !0 }
|
62958
62958
|
},
|
62959
|
-
emits: ["
|
62959
|
+
emits: ["onMessage"],
|
62960
62960
|
setup(i, { expose: n, emit: r }) {
|
62961
62961
|
const g = i, k = getCurrentInstance();
|
62962
62962
|
Object.keys(vueComp).forEach((ue) => {
|
62963
62963
|
var Ne;
|
62964
62964
|
Object.keys((Ne = k == null ? void 0 : k.appContext) == null ? void 0 : Ne.components).includes(ue) || k == null || k.appContext.app.component(ue, vueComp[ue]);
|
62965
62965
|
});
|
62966
|
-
const V = reactive(
|
62967
|
-
|
62968
|
-
|
62969
|
-
|
62970
|
-
|
62971
|
-
|
62972
|
-
|
62973
|
-
|
62974
|
-
|
62975
|
-
|
62976
|
-
|
62977
|
-
|
62966
|
+
const V = reactive(
|
62967
|
+
g.data ?? {
|
62968
|
+
layout_center: {
|
62969
|
+
x: 0,
|
62970
|
+
y: 0
|
62971
|
+
},
|
62972
|
+
config: {
|
62973
|
+
svg: {
|
62974
|
+
background_color: "#fff",
|
62975
|
+
scale: 1,
|
62976
|
+
position_center: {
|
62977
|
+
x: -333,
|
62978
|
+
y: -113
|
62979
|
+
},
|
62980
|
+
svg_position_center: {
|
62981
|
+
x: 50,
|
62982
|
+
y: 50
|
62983
|
+
}
|
62978
62984
|
},
|
62979
|
-
|
62980
|
-
|
62981
|
-
|
62985
|
+
net: {
|
62986
|
+
mqtt: {
|
62987
|
+
url: "",
|
62988
|
+
user: "",
|
62989
|
+
pwd: "",
|
62990
|
+
topics: ""
|
62991
|
+
}
|
62982
62992
|
}
|
62983
62993
|
},
|
62984
|
-
|
62985
|
-
|
62986
|
-
|
62987
|
-
user: "",
|
62988
|
-
pwd: "",
|
62989
|
-
topics: ""
|
62990
|
-
}
|
62991
|
-
}
|
62992
|
-
},
|
62993
|
-
done_json: []
|
62994
|
-
}), $ = useGlobalStore(pinia), oe = (ue) => {
|
62994
|
+
done_json: []
|
62995
|
+
}
|
62996
|
+
), $ = useGlobalStore(pinia), oe = (ue) => {
|
62995
62997
|
if ($.mouse_info.state != EMouseInfoState.Down && $.intention !== EGlobalStoreIntention.Connection)
|
62996
62998
|
return;
|
62997
62999
|
if (!g.canvasDrag) {
|
62998
63000
|
console.log(g.canvasDrag);
|
62999
63001
|
return;
|
63000
63002
|
}
|
63001
|
-
const {
|
63002
|
-
clientX: Ne,
|
63003
|
-
clientY: he
|
63004
|
-
} = ue;
|
63003
|
+
const { clientX: Ne, clientY: he } = ue;
|
63005
63004
|
$.mouse_info.new_position_x = $.mouse_info.now_position_x + Ne - $.mouse_info.position_x, $.mouse_info.new_position_y = $.mouse_info.now_position_y + he - $.mouse_info.position_y, $.intention == EGlobalStoreIntention.MoveCanvas && (V.layout_center.x = $.mouse_info.new_position_x, V.layout_center.y = $.mouse_info.new_position_y);
|
63006
63005
|
}, re = () => {
|
63007
63006
|
$.mouse_info.state == EMouseInfoState.Down && ($.intention != EGlobalStoreIntention.Select && ($.intention = EGlobalStoreIntention.None), $.setMouseInfo({
|
@@ -63015,10 +63014,7 @@ const sub = (i, n, r, g, k) => {
|
|
63015
63014
|
}));
|
63016
63015
|
}, Ce = (ue) => {
|
63017
63016
|
console.log("onCanvasMouseDown", ue);
|
63018
|
-
const {
|
63019
|
-
clientX: Ne,
|
63020
|
-
clientY: he
|
63021
|
-
} = ue;
|
63017
|
+
const { clientX: Ne, clientY: he } = ue;
|
63022
63018
|
$.intention = EGlobalStoreIntention.MoveCanvas, $.setMouseInfo({
|
63023
63019
|
state: EMouseInfoState.Down,
|
63024
63020
|
position_x: Ne,
|
@@ -63092,7 +63088,7 @@ const sub = (i, n, r, g, k) => {
|
|
63092
63088
|
const de = () => {
|
63093
63089
|
const ue = V.config.net.mqtt;
|
63094
63090
|
ue && ue.url && ue.user && ue.pwd && ue.topics && sub(ue.url, ue.user, ue.pwd, ue.topics, (Ne, he) => {
|
63095
|
-
console.log(Ne), console.log(he.toString()), r("
|
63091
|
+
console.log(Ne), console.log(he.toString()), r("onMessage", {
|
63096
63092
|
topics: Ne,
|
63097
63093
|
message: he
|
63098
63094
|
});
|
@@ -63166,7 +63162,7 @@ const sub = (i, n, r, g, k) => {
|
|
63166
63162
|
], 4))
|
63167
63163
|
], 32));
|
63168
63164
|
}
|
63169
|
-
}),
|
63165
|
+
}), index_vue_vue_type_style_index_0_scoped_fad321b8_lang = "", index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-fad321b8"]]);
|
63170
63166
|
export {
|
63171
63167
|
index$1 as SvgEditor,
|
63172
63168
|
index as SvgViewer
|