@zhangqingcq/vgce 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
package/dist/vgce.js CHANGED
@@ -38835,7 +38835,7 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-64ac5be6"), i = i(), popScope
38835
38835
  __name: "index",
38836
38836
  setup(i) {
38837
38837
  useCssVars((jt) => ({
38838
- "0f010360": ie.value
38838
+ "7007d8eb": ie.value
38839
38839
  }));
38840
38840
  const n = getCurrentInstance();
38841
38841
  Object.keys(vueComp).forEach((jt) => {
@@ -39301,161 +39301,163 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-64ac5be6"), i = i(), popScope
39301
39301
  left: (ti == null ? void 0 : ti.left) || 0
39302
39302
  };
39303
39303
  });
39304
- }), (jt, ti) => (openBlock(), createElementBlock("div", {
39305
- class: "canvas",
39306
- tabindex: "0",
39307
- ref_key: "canvasRef",
39308
- ref: ae,
39309
- onDrop: Ne,
39310
- onDragenter: he,
39311
- onDragover: pe,
39312
- onMousedown: Fe,
39313
- onMousemove: At,
39314
- onMouseup: $e,
39315
- onContextmenu: Ve,
39316
- onKeydown: kt,
39317
- onMousewheel: Ue
39318
- }, [
39319
- (openBlock(), createElementBlock("svg", {
39320
- xmlns: "http://www.w3.org/2000/svg",
39321
- style: normalizeStyle$1({ backgroundColor: unref(g).svg.background_color }),
39322
- width: "100%",
39323
- height: "100%"
39304
+ }), (jt, ti) => (openBlock(), createElementBlock(Fragment, null, [
39305
+ createElementVNode("div", {
39306
+ class: "canvas",
39307
+ tabindex: "0",
39308
+ ref_key: "canvasRef",
39309
+ ref: ae,
39310
+ onDrop: Ne,
39311
+ onDragenter: he,
39312
+ onDragover: pe,
39313
+ onMousedown: Fe,
39314
+ onMousemove: At,
39315
+ onMouseup: $e,
39316
+ onContextmenu: Ve,
39317
+ onKeydown: kt,
39318
+ onMousewheel: Ue
39324
39319
  }, [
39325
- createElementVNode("defs", null, [
39326
- createElementVNode("pattern", _hoisted_1$8, [
39327
- createElementVNode("line", {
39328
- x1: "0",
39329
- y1: "0",
39330
- x2: "0",
39331
- y2: "20",
39332
- stroke: unref(g).svg.grid_color
39333
- }, null, 8, _hoisted_2$6),
39334
- createElementVNode("line", {
39335
- x1: "10",
39336
- y1: "0",
39337
- x2: "10",
39338
- y2: "20",
39339
- stroke: unref(g).svg.grid_color
39340
- }, null, 8, _hoisted_3$6),
39341
- createElementVNode("line", {
39342
- x1: "0",
39343
- y1: "0",
39344
- x2: "20",
39345
- y2: "0",
39346
- stroke: unref(g).svg.grid_color
39347
- }, null, 8, _hoisted_4$4),
39348
- createElementVNode("line", {
39349
- x1: "0",
39350
- y1: "10",
39351
- x2: "20",
39352
- y2: "10",
39353
- stroke: unref(g).svg.grid_color
39354
- }, null, 8, _hoisted_5$2)
39355
- ])
39356
- ]),
39357
- unref(g).svg.grid ? (openBlock(), createElementBlock("rect", _hoisted_6)) : createCommentVNode("", !0),
39358
- createElementVNode("g", {
39359
- transform: `translate(${unref(V).center_offset.x * unref(g).svg.scale},${unref(V).center_offset.y * unref(g).svg.scale})rotate(0)scale(${unref(g).svg.scale})`
39320
+ (openBlock(), createElementBlock("svg", {
39321
+ xmlns: "http://www.w3.org/2000/svg",
39322
+ style: normalizeStyle$1({ backgroundColor: unref(g).svg.background_color }),
39323
+ width: "100%",
39324
+ height: "100%"
39360
39325
  }, [
39361
- (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r).done_json, (Lt, Pt) => {
39362
- var ni, ri, di, Ci, gi, ui;
39363
- return withDirectives((openBlock(), createElementBlock("g", {
39364
- key: Lt.id,
39365
- transform: `translate(${Lt.x},${Lt.y})rotate(0)scale(1)`
39366
- }, [
39367
- createElementVNode("g", {
39368
- class: normalizeClass(`${unref(getCommonClass)(Lt)}`)
39326
+ createElementVNode("defs", null, [
39327
+ createElementVNode("pattern", _hoisted_1$8, [
39328
+ createElementVNode("line", {
39329
+ x1: "0",
39330
+ y1: "0",
39331
+ x2: "0",
39332
+ y2: "20",
39333
+ stroke: unref(g).svg.grid_color
39334
+ }, null, 8, _hoisted_2$6),
39335
+ createElementVNode("line", {
39336
+ x1: "10",
39337
+ y1: "0",
39338
+ x2: "10",
39339
+ y2: "20",
39340
+ stroke: unref(g).svg.grid_color
39341
+ }, null, 8, _hoisted_3$6),
39342
+ createElementVNode("line", {
39343
+ x1: "0",
39344
+ y1: "0",
39345
+ x2: "20",
39346
+ y2: "0",
39347
+ stroke: unref(g).svg.grid_color
39348
+ }, null, 8, _hoisted_4$4),
39349
+ createElementVNode("line", {
39350
+ x1: "0",
39351
+ y1: "10",
39352
+ x2: "20",
39353
+ y2: "10",
39354
+ stroke: unref(g).svg.grid_color
39355
+ }, null, 8, _hoisted_5$2)
39356
+ ])
39357
+ ]),
39358
+ unref(g).svg.grid ? (openBlock(), createElementBlock("rect", _hoisted_6)) : createCommentVNode("", !0),
39359
+ createElementVNode("g", {
39360
+ transform: `translate(${unref(V).center_offset.x * unref(g).svg.scale},${unref(V).center_offset.y * unref(g).svg.scale})rotate(0)scale(${unref(g).svg.scale})`
39361
+ }, [
39362
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(unref(r).done_json, (Lt, Pt) => {
39363
+ var ni, ri, di, Ci, gi, ui;
39364
+ return withDirectives((openBlock(), createElementBlock("g", {
39365
+ key: Lt.id,
39366
+ transform: `translate(${Lt.x},${Lt.y})rotate(0)scale(1)`
39369
39367
  }, [
39370
39368
  createElementVNode("g", {
39371
- transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2})rotate(${Lt.rotate}) scale(1) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`,
39372
- onMousedown: (hi) => ze(Lt, Pt, hi),
39373
- onMouseup: (hi) => xe(Lt, Pt, hi),
39374
- onMouseenter: (hi) => Oe(Lt, Pt, hi),
39375
- onMouseleave: (hi) => _e(Lt, Pt, hi),
39376
- onContextmenu: (hi) => Dt(Lt, Pt, hi)
39369
+ class: normalizeClass(`${unref(getCommonClass)(Lt)}`)
39377
39370
  }, [
39378
- Lt.type === unref(EDoneJsonType).ConnectionLine ? (openBlock(), createBlock(_sfc_main$e, {
39379
- key: 0,
39380
- "item-info": Lt,
39381
- "point-visible": unref(re).connection_line && ((ni = unref(re).select_item.info) == null ? void 0 : ni.id) == Lt.id
39382
- }, null, 8, ["item-info", "point-visible"])) : Lt.type === unref(EDoneJsonType).File ? (openBlock(), createElementBlock("use", mergeProps({
39383
- key: 1,
39384
- "xlink:href": `#svg-${Lt.name}`
39385
- }, unref(prosToVBind)(Lt), {
39386
- width: "100",
39387
- height: "100",
39388
- id: Lt.id,
39389
- transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2}) scale(${Lt.scale_x},${Lt.scale_y}) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`
39390
- }), null, 16, _hoisted_10)) : Lt.type === unref(EDoneJsonType).CustomSvg ? (openBlock(), createBlock(resolveDynamicComponent(Lt.tag), mergeProps({ key: 2 }, unref(prosToVBind)(Lt), {
39391
- width: "100",
39392
- height: "100",
39393
- id: Lt.id,
39394
- onResize: Et,
39395
- transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2}) scale(${Lt.scale_x},${Lt.scale_y}) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`
39396
- }), null, 16, ["id", "transform"])) : Lt.type === unref(EDoneJsonType).Vue ? (openBlock(), createElementBlock("foreignObject", mergeProps({ key: 3 }, qe(Lt.actual_bound, Lt.scale_x, Lt.scale_y), {
39397
- id: `foreign-object${Lt.id}`
39398
- }), [
39399
- (openBlock(), createBlock(resolveDynamicComponent(Lt.tag), mergeProps(unref(prosToVBind)(Lt), {
39371
+ createElementVNode("g", {
39372
+ transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2})rotate(${Lt.rotate}) scale(1) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`,
39373
+ onMousedown: (hi) => ze(Lt, Pt, hi),
39374
+ onMouseup: (hi) => xe(Lt, Pt, hi),
39375
+ onMouseenter: (hi) => Oe(Lt, Pt, hi),
39376
+ onMouseleave: (hi) => _e(Lt, Pt, hi),
39377
+ onContextmenu: (hi) => Dt(Lt, Pt, hi)
39378
+ }, [
39379
+ Lt.type === unref(EDoneJsonType).ConnectionLine ? (openBlock(), createBlock(_sfc_main$e, {
39380
+ key: 0,
39381
+ "item-info": Lt,
39382
+ "point-visible": unref(re).connection_line && ((ni = unref(re).select_item.info) == null ? void 0 : ni.id) == Lt.id
39383
+ }, null, 8, ["item-info", "point-visible"])) : Lt.type === unref(EDoneJsonType).File ? (openBlock(), createElementBlock("use", mergeProps({
39384
+ key: 1,
39385
+ "xlink:href": `#svg-${Lt.name}`
39386
+ }, unref(prosToVBind)(Lt), {
39387
+ width: "100",
39388
+ height: "100",
39400
39389
  id: Lt.id,
39401
39390
  transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2}) scale(${Lt.scale_x},${Lt.scale_y}) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`
39402
- }), {
39403
- default: withCtx(() => [
39404
- createTextVNode(toDisplayString(Lt.tag_slot), 1)
39405
- ]),
39406
- _: 2
39407
- }, 1040, ["id", "transform"]))
39408
- ], 16, _hoisted_11)) : Lt.type === unref(EDoneJsonType).StraightLine ? (openBlock(), createElementBlock("line", {
39409
- key: 4,
39410
- id: Lt.id,
39411
- x1: Lt.props.start_x.val,
39412
- y1: Lt.props.start_y.val,
39413
- x2: Lt.props.end_x.val,
39414
- y2: Lt.props.end_y.val,
39415
- fill: "#FF0000",
39416
- stroke: "#FF0000",
39417
- "stroke-width": "2"
39418
- }, null, 8, _hoisted_12)) : createCommentVNode("", !0),
39419
- Lt.config.actual_rect ? (openBlock(), createElementBlock("rect", mergeProps({
39420
- key: 5,
39421
- id: `rect${Lt.id}`,
39422
- fill: "black",
39423
- "fill-opacity": "0"
39424
- }, qe(Lt.actual_bound, Lt.scale_x, Lt.scale_y), {
39425
- style: { stroke: "none", "stroke-width": "2", "stroke-miterlimit": "10" },
39426
- class: {
39427
- "svg-item-none": !Lt.selected && (unref(r).intention == unref(EGlobalStoreIntention).None || unref(r).intention == unref(EGlobalStoreIntention).Select),
39428
- "svg-item-move": unref(r).intention == unref(EGlobalStoreIntention).Move && ((ri = unref(r).handle_svg_info) == null ? void 0 : ri.info.id) == Lt.id,
39429
- "svg-item-select": unref(r).intention == unref(EGlobalStoreIntention).Select && ((di = unref(r).handle_svg_info) == null ? void 0 : di.info.id) == Lt.id,
39430
- "svg-item-in-group": Lt.selected
39431
- }
39432
- }), null, 16, _hoisted_13)) : createCommentVNode("", !0),
39433
- ((Ci = unref(r).handle_svg_info) == null ? void 0 : Ci.info.id) === Lt.id && unref(re).handle_panel && Lt.config.can_zoom ? (openBlock(), createBlock(HandlePanel, {
39434
- key: 6,
39435
- "item-info": Lt
39436
- }, null, 8, ["item-info"])) : createCommentVNode("", !0),
39437
- !Lt.selected && ((gi = unref(re).select_item.info) == null ? void 0 : gi.id) == Lt.id && unref(re).connection_panel && Lt.config.have_anchor && unref(r).intention !== unref(EGlobalStoreIntention).SelectArea && (unref(r).intention !== unref(EGlobalStoreIntention).Select || Lt.id !== ((ui = unref(r).handle_svg_info) == null ? void 0 : ui.info.id)) ? (openBlock(), createBlock(ConnectionPanel, {
39438
- key: 7,
39439
- onContextmenu: Ve,
39440
- "item-info": Lt
39441
- }, null, 8, ["item-info"])) : createCommentVNode("", !0)
39442
- ], 40, _hoisted_9)
39443
- ], 2)
39444
- ], 8, _hoisted_8)), [
39445
- [vShow, Lt.display]
39446
- ]);
39447
- }), 128)),
39448
- createElementVNode("rect", {
39449
- x: Ie.value.x,
39450
- y: Ie.value.y,
39451
- height: Ie.value.height,
39452
- width: Ie.value.with,
39453
- stroke: "#107cec",
39454
- fill: "#107cec",
39455
- "fill-opacity": ".2"
39456
- }, null, 8, _hoisted_14)
39457
- ], 8, _hoisted_7)
39458
- ], 4)),
39391
+ }), null, 16, _hoisted_10)) : Lt.type === unref(EDoneJsonType).CustomSvg ? (openBlock(), createBlock(resolveDynamicComponent(Lt.tag), mergeProps({ key: 2 }, unref(prosToVBind)(Lt), {
39392
+ width: "100",
39393
+ height: "100",
39394
+ id: Lt.id,
39395
+ onResize: Et,
39396
+ transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2}) scale(${Lt.scale_x},${Lt.scale_y}) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`
39397
+ }), null, 16, ["id", "transform"])) : Lt.type === unref(EDoneJsonType).Vue ? (openBlock(), createElementBlock("foreignObject", mergeProps({ key: 3 }, qe(Lt.actual_bound, Lt.scale_x, Lt.scale_y), {
39398
+ id: `foreign-object${Lt.id}`
39399
+ }), [
39400
+ (openBlock(), createBlock(resolveDynamicComponent(Lt.tag), mergeProps(unref(prosToVBind)(Lt), {
39401
+ id: Lt.id,
39402
+ transform: `translate(${Lt.actual_bound.x + Lt.actual_bound.width / 2},${Lt.actual_bound.y + Lt.actual_bound.height / 2}) scale(${Lt.scale_x},${Lt.scale_y}) translate(${-(Lt.actual_bound.x + Lt.actual_bound.width / 2)},${-(Lt.actual_bound.y + Lt.actual_bound.height / 2)})`
39403
+ }), {
39404
+ default: withCtx(() => [
39405
+ createTextVNode(toDisplayString(Lt.tag_slot), 1)
39406
+ ]),
39407
+ _: 2
39408
+ }, 1040, ["id", "transform"]))
39409
+ ], 16, _hoisted_11)) : Lt.type === unref(EDoneJsonType).StraightLine ? (openBlock(), createElementBlock("line", {
39410
+ key: 4,
39411
+ id: Lt.id,
39412
+ x1: Lt.props.start_x.val,
39413
+ y1: Lt.props.start_y.val,
39414
+ x2: Lt.props.end_x.val,
39415
+ y2: Lt.props.end_y.val,
39416
+ fill: "#FF0000",
39417
+ stroke: "#FF0000",
39418
+ "stroke-width": "2"
39419
+ }, null, 8, _hoisted_12)) : createCommentVNode("", !0),
39420
+ Lt.config.actual_rect ? (openBlock(), createElementBlock("rect", mergeProps({
39421
+ key: 5,
39422
+ id: `rect${Lt.id}`,
39423
+ fill: "black",
39424
+ "fill-opacity": "0"
39425
+ }, qe(Lt.actual_bound, Lt.scale_x, Lt.scale_y), {
39426
+ style: { stroke: "none", "stroke-width": "2", "stroke-miterlimit": "10" },
39427
+ class: {
39428
+ "svg-item-none": !Lt.selected && (unref(r).intention == unref(EGlobalStoreIntention).None || unref(r).intention == unref(EGlobalStoreIntention).Select),
39429
+ "svg-item-move": unref(r).intention == unref(EGlobalStoreIntention).Move && ((ri = unref(r).handle_svg_info) == null ? void 0 : ri.info.id) == Lt.id,
39430
+ "svg-item-select": unref(r).intention == unref(EGlobalStoreIntention).Select && ((di = unref(r).handle_svg_info) == null ? void 0 : di.info.id) == Lt.id,
39431
+ "svg-item-in-group": Lt.selected
39432
+ }
39433
+ }), null, 16, _hoisted_13)) : createCommentVNode("", !0),
39434
+ ((Ci = unref(r).handle_svg_info) == null ? void 0 : Ci.info.id) === Lt.id && unref(re).handle_panel && Lt.config.can_zoom ? (openBlock(), createBlock(HandlePanel, {
39435
+ key: 6,
39436
+ "item-info": Lt
39437
+ }, null, 8, ["item-info"])) : createCommentVNode("", !0),
39438
+ !Lt.selected && ((gi = unref(re).select_item.info) == null ? void 0 : gi.id) == Lt.id && unref(re).connection_panel && Lt.config.have_anchor && unref(r).intention !== unref(EGlobalStoreIntention).SelectArea && (unref(r).intention !== unref(EGlobalStoreIntention).Select || Lt.id !== ((ui = unref(r).handle_svg_info) == null ? void 0 : ui.info.id)) ? (openBlock(), createBlock(ConnectionPanel, {
39439
+ key: 7,
39440
+ onContextmenu: Ve,
39441
+ "item-info": Lt
39442
+ }, null, 8, ["item-info"])) : createCommentVNode("", !0)
39443
+ ], 40, _hoisted_9)
39444
+ ], 2)
39445
+ ], 8, _hoisted_8)), [
39446
+ [vShow, Lt.display]
39447
+ ]);
39448
+ }), 128)),
39449
+ createElementVNode("rect", {
39450
+ x: Ie.value.x,
39451
+ y: Ie.value.y,
39452
+ height: Ie.value.height,
39453
+ width: Ie.value.with,
39454
+ stroke: "#107cec",
39455
+ fill: "#107cec",
39456
+ "fill-opacity": ".2"
39457
+ }, null, 8, _hoisted_14)
39458
+ ], 8, _hoisted_7)
39459
+ ], 4))
39460
+ ], 544),
39459
39461
  withDirectives(createElementVNode("ul", {
39460
39462
  ref_key: "contextMenuRef",
39461
39463
  ref: oe,
@@ -39475,9 +39477,9 @@ const _withScopeId$2 = (i) => (pushScopeId("data-v-64ac5be6"), i = i(), popScope
39475
39477
  ], 512), [
39476
39478
  [vShow, unref($).display]
39477
39479
  ])
39478
- ], 544));
39480
+ ], 64));
39479
39481
  }
39480
- }), index_vue_vue_type_style_index_0_scoped_6ab802ed_lang = "", CenterPanel = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-6ab802ed"]]);
39482
+ }), index_vue_vue_type_style_index_0_scoped_a0b7be17_lang = "", CenterPanel = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-a0b7be17"]]);
39481
39483
  var ace$2 = { exports: {} };
39482
39484
  (function(i, n) {
39483
39485
  (function() {