mce 0.15.36 → 0.15.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Node as Node$1, Element2D, Timeline, Engine, Camera2D, DrawboardEffect, Aabb2D, IN_BROWSER, clamp, assets, TimelineNode, Video2D, Transform2D, Obb2D, render, Vector2 as Vector2$1, Lottie2D, customNodes, Animation, IN_MAC_OS } from "modern-canvas";
2
2
  import { reactive, computed, watch, markRaw, isReactive, ref, onBeforeMount, onScopeDispose, warn, shallowRef, defineComponent, createElementBlock, createCommentVNode, unref, openBlock, normalizeStyle as normalizeStyle$1, toDisplayString, onMounted, createVNode, useAttrs, createBlock, resolveDynamicComponent, normalizeClass, mergeProps, createElementVNode, inject, toValue, getCurrentInstance, provide, useId, onBeforeUnmount, readonly, toRef, onDeactivated, onActivated, useModel, useTemplateRef, withDirectives, withModifiers, vModelText, vShow, nextTick, Fragment, renderList, renderSlot, mergeModels, resolveComponent, withCtx, Teleport, createTextVNode, createSlots, normalizeProps, guardReactiveProps, h, isRef, effectScope, useSlots } from "vue";
3
- import { useFileDialog, useEventListener, isClient, onClickOutside, useDebounceFn, useResizeObserver as useResizeObserver$1, useLocalStorage, useImage } from "@vueuse/core";
3
+ import { useFileDialog, useEventListener, isClient, onClickOutside, useDebounceFn, useImage, useResizeObserver as useResizeObserver$1, useLocalStorage } from "@vueuse/core";
4
4
  import { getObjectValueByPath, setObjectValueByPath, Observable, Reactivable, idGenerator, property, normalizeTextContent, isCRLF, textContentToString, normalizeCRLF, isEqualObject } from "modern-idoc";
5
5
  import { saveAs } from "file-saver";
6
6
  import { Fonts } from "modern-font";
@@ -4410,7 +4410,7 @@ const _hoisted_1$r = {
4410
4410
  key: 0,
4411
4411
  class: "mce-drawing__tip"
4412
4412
  };
4413
- const _sfc_main$D = /* @__PURE__ */ defineComponent({
4413
+ const _sfc_main$E = /* @__PURE__ */ defineComponent({
4414
4414
  __name: "Drawing",
4415
4415
  setup(__props) {
4416
4416
  const {
@@ -4443,7 +4443,7 @@ const _drawingTool = definePlugin((editor) => {
4443
4443
  { command: "setActiveDrawingTool", handle: (val) => setActiveDrawingTool(val) }
4444
4444
  ],
4445
4445
  components: [
4446
- { name: "drawing", type: "overlay", component: _sfc_main$D }
4446
+ { name: "drawing", type: "overlay", component: _sfc_main$E }
4447
4447
  ]
4448
4448
  };
4449
4449
  });
@@ -4737,7 +4737,7 @@ const ComponentIcon = defineComponent({
4737
4737
  };
4738
4738
  }
4739
4739
  });
4740
- const _sfc_main$C = /* @__PURE__ */ defineComponent({
4740
+ const _sfc_main$D = /* @__PURE__ */ defineComponent({
4741
4741
  __name: "Icon",
4742
4742
  props: {
4743
4743
  disabled: Boolean,
@@ -5395,7 +5395,7 @@ const defaultHoverStrategy = (context) => {
5395
5395
  }
5396
5396
  return element.findAncestor(cb);
5397
5397
  };
5398
- const _sfc_main$B = /* @__PURE__ */ defineComponent({
5398
+ const _sfc_main$C = /* @__PURE__ */ defineComponent({
5399
5399
  __name: "Frame",
5400
5400
  props: {
5401
5401
  "modelValue": { required: true },
@@ -5471,7 +5471,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
5471
5471
  }
5472
5472
  });
5473
5473
  const _hoisted_1$q = { class: "mce-frames" };
5474
- const _sfc_main$A = /* @__PURE__ */ defineComponent({
5474
+ const _sfc_main$B = /* @__PURE__ */ defineComponent({
5475
5475
  __name: "Frames",
5476
5476
  setup(__props) {
5477
5477
  const {
@@ -5480,7 +5480,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
5480
5480
  return (_ctx, _cache) => {
5481
5481
  return openBlock(), createElementBlock("div", _hoisted_1$q, [
5482
5482
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(frames), (frame, key) => {
5483
- return openBlock(), createBlock(_sfc_main$B, {
5483
+ return openBlock(), createBlock(_sfc_main$C, {
5484
5484
  key,
5485
5485
  "model-value": frame
5486
5486
  }, null, 8, ["model-value"]);
@@ -5540,7 +5540,7 @@ const _frame = definePlugin((editor) => {
5540
5540
  { command: "setActiveDrawingTool:frame", key: "F" }
5541
5541
  ],
5542
5542
  components: [
5543
- { type: "overlay", component: _sfc_main$A, order: "before" }
5543
+ { type: "overlay", component: _sfc_main$B, order: "before" }
5544
5544
  ]
5545
5545
  };
5546
5546
  });
@@ -5620,7 +5620,7 @@ const _history = definePlugin((editor) => {
5620
5620
  };
5621
5621
  });
5622
5622
  const _hoisted_1$p = ["data-name"];
5623
- const _sfc_main$z = /* @__PURE__ */ defineComponent({
5623
+ const _sfc_main$A = /* @__PURE__ */ defineComponent({
5624
5624
  __name: "Hover",
5625
5625
  setup(__props) {
5626
5626
  const {
@@ -5649,7 +5649,7 @@ const _hover = definePlugin(() => {
5649
5649
  return {
5650
5650
  name: "mce:hover",
5651
5651
  components: [
5652
- { type: "overlay", component: _sfc_main$z, order: "before" }
5652
+ { type: "overlay", component: _sfc_main$A, order: "before" }
5653
5653
  ]
5654
5654
  };
5655
5655
  });
@@ -5928,7 +5928,7 @@ const _json = definePlugin((editor) => {
5928
5928
  ]
5929
5929
  };
5930
5930
  });
5931
- const _sfc_main$y = /* @__PURE__ */ defineComponent({
5931
+ const _sfc_main$z = /* @__PURE__ */ defineComponent({
5932
5932
  __name: "Btn",
5933
5933
  props: {
5934
5934
  active: { type: Boolean },
@@ -5950,7 +5950,7 @@ const _sfc_main$y = /* @__PURE__ */ defineComponent({
5950
5950
  const _hoisted_1$o = ["data-id"];
5951
5951
  const _hoisted_2$d = { class: "mce-layer__content" };
5952
5952
  const _hoisted_3$b = { class: "mce-layer__prepend" };
5953
- const _sfc_main$x = /* @__PURE__ */ defineComponent({
5953
+ const _sfc_main$y = /* @__PURE__ */ defineComponent({
5954
5954
  ...{
5955
5955
  name: "MceLayer",
5956
5956
  inheritAttrs: false
@@ -6174,7 +6174,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6174
6174
  _cache[6] || (_cache[6] = createElementVNode("span", { class: "mce-layer__overlay" }, null, -1)),
6175
6175
  createElementVNode("div", _hoisted_2$d, [
6176
6176
  createElementVNode("div", _hoisted_3$b, [
6177
- childrenLength.value ? (openBlock(), createBlock(unref(_sfc_main$C), {
6177
+ childrenLength.value ? (openBlock(), createBlock(unref(_sfc_main$D), {
6178
6178
  key: 0,
6179
6179
  class: "mce-layer__arrow",
6180
6180
  icon: "$arrowRight",
@@ -6187,7 +6187,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6187
6187
  class: "mce-layer__thumbnail",
6188
6188
  onDblclick: onDblclickThumbnail
6189
6189
  }, [
6190
- createVNode(unref(_sfc_main$C), { icon: thumbnailIcon.value }, null, 8, ["icon"])
6190
+ createVNode(unref(_sfc_main$D), { icon: thumbnailIcon.value }, null, 8, ["icon"])
6191
6191
  ], 32),
6192
6192
  createElementVNode("div", {
6193
6193
  class: "mce-layer__name",
@@ -6220,7 +6220,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6220
6220
  }])
6221
6221
  }, [
6222
6222
  props.root ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
6223
- Array.from(unref(openedItems).values()).filter((v) => v.value).length > 1 ? (openBlock(), createBlock(_sfc_main$y, {
6223
+ Array.from(unref(openedItems).values()).filter((v) => v.value).length > 1 ? (openBlock(), createBlock(_sfc_main$z, {
6224
6224
  key: 0,
6225
6225
  icon: "",
6226
6226
  class: "mce-layer__btn mce-layer__btn--show",
@@ -6231,12 +6231,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6231
6231
  }), ["prevent", "stop"]))
6232
6232
  }, {
6233
6233
  default: withCtx(() => [
6234
- createVNode(unref(_sfc_main$C), { icon: "$collapse" })
6234
+ createVNode(unref(_sfc_main$D), { icon: "$collapse" })
6235
6235
  ]),
6236
6236
  _: 1
6237
6237
  })) : createCommentVNode("", true)
6238
6238
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
6239
- createVNode(_sfc_main$y, {
6239
+ createVNode(_sfc_main$z, {
6240
6240
  icon: "",
6241
6241
  class: normalizeClass(["mce-layer__btn", {
6242
6242
  "mce-layer__btn--show": unref(isLock)(props.node)
@@ -6244,13 +6244,13 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6244
6244
  onClick: _cache[3] || (_cache[3] = withModifiers(($event) => unref(setLock)(props.node, !unref(isLock)(props.node)), ["prevent", "stop"]))
6245
6245
  }, {
6246
6246
  default: withCtx(() => [
6247
- createVNode(unref(_sfc_main$C), {
6247
+ createVNode(unref(_sfc_main$D), {
6248
6248
  icon: unref(isLock)(props.node) ? "$lock" : "$unlock"
6249
6249
  }, null, 8, ["icon"])
6250
6250
  ]),
6251
6251
  _: 1
6252
6252
  }, 8, ["class"]),
6253
- createVNode(_sfc_main$y, {
6253
+ createVNode(_sfc_main$z, {
6254
6254
  icon: "",
6255
6255
  class: normalizeClass(["mce-layer__btn", {
6256
6256
  "mce-layer__btn--show": !unref(isVisible)(props.node)
@@ -6258,7 +6258,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6258
6258
  onClick: _cache[4] || (_cache[4] = withModifiers(($event) => unref(setVisible)(props.node, !unref(isVisible)(props.node)), ["prevent", "stop"]))
6259
6259
  }, {
6260
6260
  default: withCtx(() => [
6261
- createVNode(unref(_sfc_main$C), {
6261
+ createVNode(unref(_sfc_main$D), {
6262
6262
  icon: unref(isVisible)(props.node) ? "$visible" : "$unvisible"
6263
6263
  }, null, 8, ["icon"])
6264
6264
  ]),
@@ -6282,7 +6282,7 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6282
6282
  });
6283
6283
  const _hoisted_1$n = { class: "mce-layers" };
6284
6284
  const _hoisted_2$c = { class: "mce-layers__wrapper" };
6285
- const _sfc_main$w = /* @__PURE__ */ defineComponent({
6285
+ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6286
6286
  __name: "Layers",
6287
6287
  setup(__props) {
6288
6288
  const {
@@ -6328,7 +6328,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
6328
6328
  return (_ctx, _cache) => {
6329
6329
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
6330
6330
  createElementVNode("div", _hoisted_2$c, [
6331
- createVNode(_sfc_main$x, {
6331
+ createVNode(_sfc_main$y, {
6332
6332
  root: true,
6333
6333
  node: unref(root),
6334
6334
  opened: true
@@ -6342,7 +6342,7 @@ const _layers = definePlugin(() => {
6342
6342
  return {
6343
6343
  name: "mce:layers",
6344
6344
  components: [
6345
- { name: "layers", type: "panel", position: "float", component: _sfc_main$w }
6345
+ { name: "layers", type: "panel", position: "float", component: _sfc_main$x }
6346
6346
  ]
6347
6347
  };
6348
6348
  });
@@ -6353,7 +6353,7 @@ const _export_sfc = (sfc, props) => {
6353
6353
  }
6354
6354
  return target;
6355
6355
  };
6356
- const _sfc_main$v = {};
6356
+ const _sfc_main$w = {};
6357
6357
  const _hoisted_1$m = {
6358
6358
  class: "mce-made-with",
6359
6359
  href: "https://github.com/qq15725/mce",
@@ -6365,7 +6365,7 @@ function _sfc_render(_ctx, _cache) {
6365
6365
  createElementVNode("div", null, "MCE", -1)
6366
6366
  ])]);
6367
6367
  }
6368
- const MadeWith = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["render", _sfc_render]]);
6368
+ const MadeWith = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["render", _sfc_render]]);
6369
6369
  const _madeWith = definePlugin((editor) => {
6370
6370
  const {
6371
6371
  config,
@@ -6383,7 +6383,7 @@ const _madeWith = definePlugin((editor) => {
6383
6383
  ]
6384
6384
  };
6385
6385
  });
6386
- const _sfc_main$u = /* @__PURE__ */ defineComponent({
6386
+ const _sfc_main$v = /* @__PURE__ */ defineComponent({
6387
6387
  ...{
6388
6388
  inheritAttrs: false
6389
6389
  },
@@ -6528,7 +6528,7 @@ const _hoisted_7$3 = {
6528
6528
  key: 3,
6529
6529
  class: "mce-list-item__append"
6530
6530
  };
6531
- const _sfc_main$t = /* @__PURE__ */ defineComponent({
6531
+ const _sfc_main$u = /* @__PURE__ */ defineComponent({
6532
6532
  ...{
6533
6533
  name: "MceMenu"
6534
6534
  },
@@ -6611,7 +6611,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
6611
6611
  });
6612
6612
  return (_ctx, _cache) => {
6613
6613
  const _component_MceMenu = resolveComponent("MceMenu");
6614
- return openBlock(), createBlock(_sfc_main$u, {
6614
+ return openBlock(), createBlock(_sfc_main$v, {
6615
6615
  ref: "overlayTpl",
6616
6616
  modelValue: isActive.value,
6617
6617
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => isActive.value = $event),
@@ -6658,7 +6658,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
6658
6658
  onClick: (e) => onClickItem(item, index, e)
6659
6659
  }, [
6660
6660
  hasPrepend.value ? (openBlock(), createElementBlock("div", _hoisted_3$a, [
6661
- item.checked ? (openBlock(), createBlock(unref(_sfc_main$C), {
6661
+ item.checked ? (openBlock(), createBlock(unref(_sfc_main$D), {
6662
6662
  key: 0,
6663
6663
  icon: "$check"
6664
6664
  })) : createCommentVNode("", true)
@@ -6676,7 +6676,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
6676
6676
  ])) : createCommentVNode("", true),
6677
6677
  item.children?.length || _ctx.$slots.append ? (openBlock(), createElementBlock("div", _hoisted_7$3, [
6678
6678
  renderSlot(_ctx.$slots, "append", { item }),
6679
- item.children?.length ? (openBlock(), createBlock(unref(_sfc_main$C), {
6679
+ item.children?.length ? (openBlock(), createBlock(unref(_sfc_main$D), {
6680
6680
  key: 0,
6681
6681
  icon: "$arrowRight"
6682
6682
  })) : createCommentVNode("", true)
@@ -6733,7 +6733,7 @@ const _sfc_main$t = /* @__PURE__ */ defineComponent({
6733
6733
  };
6734
6734
  }
6735
6735
  });
6736
- const _sfc_main$s = /* @__PURE__ */ defineComponent({
6736
+ const _sfc_main$t = /* @__PURE__ */ defineComponent({
6737
6737
  __name: "ContextMenu",
6738
6738
  props: {
6739
6739
  "modelValue": { type: Boolean },
@@ -6819,7 +6819,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
6819
6819
  updateLocation
6820
6820
  });
6821
6821
  return (_ctx, _cache) => {
6822
- return openBlock(), createBlock(_sfc_main$t, {
6822
+ return openBlock(), createBlock(_sfc_main$u, {
6823
6823
  ref: "menuTplRef",
6824
6824
  modelValue: isActive.value,
6825
6825
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isActive.value = $event),
@@ -7109,7 +7109,7 @@ const _menu = definePlugin((editor, options) => {
7109
7109
  return {
7110
7110
  name: "mce:menu",
7111
7111
  components: [
7112
- { type: "overlay", component: _sfc_main$s, order: "after" }
7112
+ { type: "overlay", component: _sfc_main$t, order: "after" }
7113
7113
  ]
7114
7114
  };
7115
7115
  });
@@ -7176,7 +7176,7 @@ const _new = definePlugin((editor) => {
7176
7176
  const _hoisted_1$k = { class: "mce-node-creator" };
7177
7177
  const _hoisted_2$a = { class: "mce-node-creator__tree" };
7178
7178
  const _hoisted_3$9 = { class: "mce-node-creator__actions" };
7179
- const _sfc_main$r = /* @__PURE__ */ defineComponent({
7179
+ const _sfc_main$s = /* @__PURE__ */ defineComponent({
7180
7180
  __name: "NodeCreator",
7181
7181
  props: {
7182
7182
  "isActive": { type: Boolean },
@@ -7269,13 +7269,13 @@ const _sfc_main$r = /* @__PURE__ */ defineComponent({
7269
7269
  }), 128))
7270
7270
  ]),
7271
7271
  createElementVNode("div", _hoisted_3$9, [
7272
- createVNode(_sfc_main$y, { onClick: cancel }, {
7272
+ createVNode(_sfc_main$z, { onClick: cancel }, {
7273
7273
  default: withCtx(() => [
7274
7274
  createTextVNode(toDisplayString(unref(t)("cancel")), 1)
7275
7275
  ]),
7276
7276
  _: 1
7277
7277
  }),
7278
- createVNode(_sfc_main$y, { onClick: create }, {
7278
+ createVNode(_sfc_main$z, { onClick: create }, {
7279
7279
  default: withCtx(() => [
7280
7280
  createTextVNode(toDisplayString(unref(t)("create")), 1)
7281
7281
  ]),
@@ -7295,7 +7295,7 @@ const _node = definePlugin((editor) => {
7295
7295
  return {
7296
7296
  name: "mce:node",
7297
7297
  components: [
7298
- { name: "nodeCreator", type: "panel", position: "float", component: _sfc_main$r }
7298
+ { name: "nodeCreator", type: "panel", position: "float", component: _sfc_main$s }
7299
7299
  ],
7300
7300
  commands: [
7301
7301
  { command: "addSubNode", handle: () => config.value.nodeCreator = true }
@@ -11437,7 +11437,7 @@ const _hoisted_3$8 = {
11437
11437
  key: 0,
11438
11438
  class: "mce-tooltip__kbd"
11439
11439
  };
11440
- const _sfc_main$q = /* @__PURE__ */ defineComponent({
11440
+ const _sfc_main$r = /* @__PURE__ */ defineComponent({
11441
11441
  __name: "Tooltip",
11442
11442
  props: /* @__PURE__ */ mergeModels({
11443
11443
  ...makeMceOverlayProps({
@@ -11468,7 +11468,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
11468
11468
  updateLocation
11469
11469
  });
11470
11470
  return (_ctx, _cache) => {
11471
- return openBlock(), createBlock(_sfc_main$u, {
11471
+ return openBlock(), createBlock(_sfc_main$v, {
11472
11472
  ref: "overlayTpl",
11473
11473
  modelValue: isActive.value,
11474
11474
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isActive.value = $event),
@@ -11512,7 +11512,7 @@ const _sfc_main$q = /* @__PURE__ */ defineComponent({
11512
11512
  const _hoisted_1$i = ["width", "height"];
11513
11513
  const _hoisted_2$8 = ["onDblclick", "onMousedown", "onMousemove"];
11514
11514
  const _hoisted_3$7 = { style: { "font-size": "0.75rem", "text-wrap": "nowrap" } };
11515
- const _sfc_main$p = /* @__PURE__ */ defineComponent({
11515
+ const _sfc_main$q = /* @__PURE__ */ defineComponent({
11516
11516
  ...{
11517
11517
  inheritAttrs: false
11518
11518
  },
@@ -11792,7 +11792,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
11792
11792
  onMouseleave: onLeave
11793
11793
  }, null, 46, _hoisted_2$8);
11794
11794
  }), 128)),
11795
- createVNode(_sfc_main$q, {
11795
+ createVNode(_sfc_main$r, {
11796
11796
  "model-value": !!tipText.value,
11797
11797
  target: tipPos.value,
11798
11798
  offset: 24
@@ -11807,7 +11807,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
11807
11807
  }
11808
11808
  });
11809
11809
  const _hoisted_1$h = { class: "mce-rulers" };
11810
- const _sfc_main$o = /* @__PURE__ */ defineComponent({
11810
+ const _sfc_main$p = /* @__PURE__ */ defineComponent({
11811
11811
  __name: "Rulers",
11812
11812
  setup(__props) {
11813
11813
  const {
@@ -11816,7 +11816,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
11816
11816
  } = useEditor();
11817
11817
  return (_ctx, _cache) => {
11818
11818
  return openBlock(), createElementBlock("div", _hoisted_1$h, [
11819
- createVNode(_sfc_main$p, {
11819
+ createVNode(_sfc_main$q, {
11820
11820
  refline: "",
11821
11821
  zoom: unref(camera).zoom.x,
11822
11822
  position: unref(camera).position.x,
@@ -11824,7 +11824,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
11824
11824
  axis: "",
11825
11825
  size: 16
11826
11826
  }, null, 8, ["zoom", "position", "selected"]),
11827
- createVNode(_sfc_main$p, {
11827
+ createVNode(_sfc_main$q, {
11828
11828
  refline: "",
11829
11829
  zoom: unref(camera).zoom.y,
11830
11830
  position: unref(camera).position.y,
@@ -11849,7 +11849,7 @@ const _ruler = definePlugin((editor) => {
11849
11849
  components: [
11850
11850
  {
11851
11851
  type: "overlay",
11852
- component: _sfc_main$o,
11852
+ component: _sfc_main$p,
11853
11853
  ignore: () => !config.value.ruler,
11854
11854
  order: "after"
11855
11855
  }
@@ -11891,7 +11891,7 @@ const _hoisted_1$g = {
11891
11891
  ref: "trackTplRef",
11892
11892
  class: "mce-scrollbar__track"
11893
11893
  };
11894
- const _sfc_main$n = /* @__PURE__ */ defineComponent({
11894
+ const _sfc_main$o = /* @__PURE__ */ defineComponent({
11895
11895
  __name: "Scrollbar",
11896
11896
  props: /* @__PURE__ */ mergeModels({
11897
11897
  length: {},
@@ -11999,7 +11999,7 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
11999
11999
  }
12000
12000
  });
12001
12001
  const _hoisted_1$f = { class: "mce-scrollbars" };
12002
- const _sfc_main$m = /* @__PURE__ */ defineComponent({
12002
+ const _sfc_main$n = /* @__PURE__ */ defineComponent({
12003
12003
  __name: "Scrollbars",
12004
12004
  props: {
12005
12005
  offset: { default: 0 },
@@ -12013,13 +12013,13 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
12013
12013
  } = useEditor();
12014
12014
  return (_ctx, _cache) => {
12015
12015
  return openBlock(), createElementBlock("div", _hoisted_1$f, [
12016
- createVNode(_sfc_main$n, mergeProps(props, {
12016
+ createVNode(_sfc_main$o, mergeProps(props, {
12017
12017
  modelValue: unref(camera).position.y,
12018
12018
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(camera).position.y = $event),
12019
12019
  vertical: "",
12020
12020
  length: unref(rootAabb).height * unref(camera).zoom.y
12021
12021
  }), null, 16, ["modelValue", "length"]),
12022
- createVNode(_sfc_main$n, mergeProps(props, {
12022
+ createVNode(_sfc_main$o, mergeProps(props, {
12023
12023
  modelValue: unref(camera).position.x,
12024
12024
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(camera).position.x = $event),
12025
12025
  length: unref(rootAabb).width * unref(camera).zoom.x
@@ -12136,7 +12136,7 @@ const _scroll = definePlugin((editor) => {
12136
12136
  components: [
12137
12137
  {
12138
12138
  type: "overlay",
12139
- component: _sfc_main$m,
12139
+ component: _sfc_main$n,
12140
12140
  ignore: () => !config.value.scrollbar,
12141
12141
  order: "after"
12142
12142
  }
@@ -12173,7 +12173,7 @@ const _scroll = definePlugin((editor) => {
12173
12173
  // },
12174
12174
  };
12175
12175
  });
12176
- const _sfc_main$l = /* @__PURE__ */ defineComponent({
12176
+ const _sfc_main$m = /* @__PURE__ */ defineComponent({
12177
12177
  __name: "ScrollToSelection",
12178
12178
  setup(__props) {
12179
12179
  const {
@@ -12191,7 +12191,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
12191
12191
  class: "mce-scroll-to-selection",
12192
12192
  onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(exec)("scrollToSelection", { behavior: "smooth" }), ["prevent"]))
12193
12193
  }, [
12194
- createVNode(unref(_sfc_main$C), { icon: "$gps" }),
12194
+ createVNode(unref(_sfc_main$D), { icon: "$gps" }),
12195
12195
  createElementVNode("span", null, toDisplayString(unref(t)("scrollToSelection")), 1)
12196
12196
  ])) : createCommentVNode("", true);
12197
12197
  };
@@ -12213,7 +12213,7 @@ const _hoisted_10$1 = {
12213
12213
  key: 0,
12214
12214
  class: "mce-transform-controls__tip"
12215
12215
  };
12216
- const _sfc_main$k = /* @__PURE__ */ defineComponent({
12216
+ const _sfc_main$l = /* @__PURE__ */ defineComponent({
12217
12217
  __name: "TransformControls",
12218
12218
  props: /* @__PURE__ */ mergeModels({
12219
12219
  tag: { default: "div" },
@@ -12863,8 +12863,202 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
12863
12863
  };
12864
12864
  }
12865
12865
  });
12866
- const _hoisted_1$d = { class: "mce-selection" };
12866
+ const _hoisted_1$d = { class: "mce-cropper" };
12867
+ const _sfc_main$k = /* @__PURE__ */ defineComponent({
12868
+ __name: "Cropper",
12869
+ props: /* @__PURE__ */ mergeModels({
12870
+ image: {},
12871
+ minScale: { default: 0.1 },
12872
+ maxScale: { default: 3 }
12873
+ }, {
12874
+ "modelValue": { default: () => ({}) },
12875
+ "modelModifiers": {},
12876
+ "style": { default: () => ({}) },
12877
+ "styleModifiers": {}
12878
+ }),
12879
+ emits: /* @__PURE__ */ mergeModels(["start", "end", "update:transform"], ["update:modelValue", "update:style"]),
12880
+ setup(__props, { emit: __emit }) {
12881
+ const props = __props;
12882
+ const emit = __emit;
12883
+ const cropRect = useModel(__props, "modelValue");
12884
+ const styleModel = useModel(__props, "style");
12885
+ const rootBox = ref({ width: 0, height: 0 });
12886
+ const { state: imageRef } = useImage(
12887
+ computed(() => ({
12888
+ src: props.image
12889
+ }))
12890
+ );
12891
+ const backup = cloneDeep(cropRect.value);
12892
+ const canvasRef = useTemplateRef("canvasRef");
12893
+ const computedCropRect = computed({
12894
+ get: () => {
12895
+ const { left = 0, top = 0, right = 0, bottom = 0 } = cropRect.value;
12896
+ return { left, top, right, bottom };
12897
+ },
12898
+ set: (val) => cropRect.value = val
12899
+ });
12900
+ const inverseMat = computed(() => {
12901
+ const { left, top, right, bottom } = computedCropRect.value;
12902
+ const sx = 1 / (1 - left - right);
12903
+ const sy = 1 / (1 - top - bottom);
12904
+ const tx = -left;
12905
+ const ty = -top;
12906
+ return { sx, sy, tx, ty };
12907
+ });
12908
+ const sourceTransform = computed({
12909
+ get: () => {
12910
+ const { sx, sy, tx, ty } = inverseMat.value;
12911
+ const { scaleX = 1, scaleY = 1 } = styleModel.value;
12912
+ const { width, height } = rootBox.value;
12913
+ return {
12914
+ width: sx * width,
12915
+ height: sy * height,
12916
+ left: tx * scaleX * (sx * width),
12917
+ top: ty * scaleY * (sy * height)
12918
+ };
12919
+ },
12920
+ set: (newValue) => {
12921
+ const { width, height } = rootBox.value;
12922
+ const { scaleX = 1, scaleY = 1 } = styleModel.value;
12923
+ const transform = {
12924
+ sx: newValue.width / width,
12925
+ sy: newValue.height / height,
12926
+ tx: newValue.left / newValue.width / scaleX,
12927
+ ty: newValue.top / newValue.height / scaleY
12928
+ };
12929
+ const left = -transform.tx;
12930
+ const top = -transform.ty;
12931
+ const w = 1 - 1 / transform.sx;
12932
+ const h2 = 1 - 1 / transform.sy;
12933
+ const right = w - left;
12934
+ const bottom = h2 - top;
12935
+ computedCropRect.value = { left, top, right, bottom };
12936
+ }
12937
+ });
12938
+ const scale = computed({
12939
+ get: () => inverseMat.value.sx,
12940
+ set: (value) => {
12941
+ const transform = inverseMat.value;
12942
+ const rate = transform.sx / value;
12943
+ const left = -transform.tx;
12944
+ const top = -transform.ty;
12945
+ const w = 1 - 1 / value;
12946
+ const h2 = 1 - 1 / transform.sy * rate;
12947
+ const right = w - left;
12948
+ const bottom = h2 - top;
12949
+ computedCropRect.value = { left, top, right, bottom };
12950
+ }
12951
+ });
12952
+ onBeforeMount(() => emit("start"));
12953
+ onBeforeUnmount(() => emit("end"));
12954
+ const sourceStyle = computed(() => {
12955
+ const { sx, sy, tx, ty } = inverseMat.value;
12956
+ const { scaleX = 1, scaleY = 1 } = styleModel.value;
12957
+ return {
12958
+ transform: [
12959
+ `scale(${sx}, ${sy})`,
12960
+ `translate(${tx * scaleX * 100}%, ${ty * scaleY * 100}%)`
12961
+ ].join(" ")
12962
+ };
12963
+ });
12964
+ watch([canvasRef, imageRef], render2);
12965
+ watch(computedCropRect, render2, { deep: true });
12966
+ watch([() => styleModel.value.scaleX, () => styleModel.value.scaleY], render2);
12967
+ function render2() {
12968
+ const ctx = canvasRef.value?.getContext("2d");
12969
+ if (!ctx || !imageRef.value)
12970
+ return;
12971
+ const { scaleX = 1, scaleY = 1 } = styleModel.value;
12972
+ const { naturalWidth, naturalHeight } = imageRef.value;
12973
+ ctx.canvas.width = naturalWidth;
12974
+ ctx.canvas.height = naturalHeight;
12975
+ ctx.clearRect(0, 0, naturalWidth, naturalHeight);
12976
+ ctx.globalAlpha = 0.4;
12977
+ ctx.scale(scaleX, scaleY);
12978
+ ctx.drawImage(imageRef.value, 0, 0, naturalWidth, naturalHeight);
12979
+ }
12980
+ function ok() {
12981
+ emit("end");
12982
+ }
12983
+ function cancel() {
12984
+ cropRect.value = backup;
12985
+ ok();
12986
+ }
12987
+ function onResizeObserver(entries) {
12988
+ const { width, height } = entries[0].contentRect;
12989
+ rootBox.value = { width, height };
12990
+ }
12991
+ function applySourceTransformToStyle() {
12992
+ const { left = 0, top = 0, width = 0, height = 0 } = styleModel.value;
12993
+ const { sx, sy, tx, ty } = inverseMat.value;
12994
+ cropRect.value = {};
12995
+ styleModel.value = {
12996
+ ...styleModel.value,
12997
+ width: sx * width,
12998
+ height: sy * height,
12999
+ left: left + tx * (sx * width),
13000
+ top: top + ty * (sy * height)
13001
+ };
13002
+ ok();
13003
+ }
13004
+ return (_ctx, _cache) => {
13005
+ return withDirectives((openBlock(), createElementBlock("div", _hoisted_1$d, [
13006
+ createElementVNode("div", {
13007
+ class: "mce-cropper__source",
13008
+ style: normalizeStyle$1(sourceStyle.value)
13009
+ }, [
13010
+ createElementVNode("canvas", {
13011
+ ref_key: "canvasRef",
13012
+ ref: canvasRef
13013
+ }, null, 512)
13014
+ ], 4),
13015
+ createVNode(_sfc_main$l, {
13016
+ modelValue: sourceTransform.value,
13017
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => sourceTransform.value = $event),
13018
+ class: "mce-cropper__transform",
13019
+ rotatable: false
13020
+ }, {
13021
+ default: withCtx(({ props: slotProps }) => [
13022
+ createElementVNode("div", mergeProps({ class: "mce-cropper__transform_rect" }, slotProps), null, 16)
13023
+ ]),
13024
+ _: 1
13025
+ }, 8, ["modelValue"]),
13026
+ renderSlot(_ctx.$slots, "default", {
13027
+ scale: scale.value,
13028
+ ok,
13029
+ cancel,
13030
+ applySourceTransformToStyle
13031
+ })
13032
+ ])), [
13033
+ [unref(vResizeObserver), onResizeObserver]
13034
+ ]);
13035
+ };
13036
+ }
13037
+ });
12867
13038
  const _sfc_main$j = /* @__PURE__ */ defineComponent({
13039
+ __name: "ForegroundCropper",
13040
+ setup(__props) {
13041
+ const {
13042
+ state,
13043
+ elementSelection
13044
+ } = useEditor();
13045
+ const element = computed(() => elementSelection.value[0]);
13046
+ return (_ctx, _cache) => {
13047
+ return unref(state) === "cropping" && element.value?.foreground.isValid() ? (openBlock(), createBlock(_sfc_main$k, {
13048
+ key: 0,
13049
+ modelValue: element.value.foreground.cropRect,
13050
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => element.value.foreground.cropRect = $event),
13051
+ style: normalizeStyle$1(element.value.style.toJSON()),
13052
+ image: element.value.foreground.image,
13053
+ class: "pointer-events-auto",
13054
+ "onUpdate:style": _cache[1] || (_cache[1] = (val) => element.value.style.setProperties(val)),
13055
+ onEnd: _cache[2] || (_cache[2] = () => state.value = void 0)
13056
+ }, null, 8, ["modelValue", "style", "image"])) : createCommentVNode("", true);
13057
+ };
13058
+ }
13059
+ });
13060
+ const _hoisted_1$c = { class: "mce-selection" };
13061
+ const _sfc_main$i = /* @__PURE__ */ defineComponent({
12868
13062
  __name: "Selection",
12869
13063
  setup(__props, { expose: __expose }) {
12870
13064
  const {
@@ -13097,7 +13291,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
13097
13291
  transformControls
13098
13292
  });
13099
13293
  return (_ctx, _cache) => {
13100
- return openBlock(), createElementBlock("div", _hoisted_1$d, [
13294
+ return openBlock(), createElementBlock("div", _hoisted_1$c, [
13101
13295
  (openBlock(true), createElementBlock(Fragment, null, renderList(parentObbStyles.value, (style, index) => {
13102
13296
  return openBlock(), createElementBlock("div", {
13103
13297
  key: index,
@@ -13126,7 +13320,7 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
13126
13320
  ...unref(selectionArea).toCssStyle()
13127
13321
  })
13128
13322
  }, null, 4)) : createCommentVNode("", true),
13129
- transform.value.width && transform.value.height ? (openBlock(), createBlock(_sfc_main$k, mergeProps({
13323
+ transform.value.width && transform.value.height ? (openBlock(), createBlock(_sfc_main$l, mergeProps({
13130
13324
  key: 2,
13131
13325
  ref: "transformControlsTpl"
13132
13326
  }, unref(config).transformControls, {
@@ -13147,18 +13341,19 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
13147
13341
  }), createSlots({ _: 2 }, [
13148
13342
  _ctx.$slots.transform ? {
13149
13343
  name: "svg",
13150
- fn: withCtx((slotProps) => [
13151
- renderSlot(_ctx.$slots, "transform", normalizeProps(guardReactiveProps(slotProps)))
13344
+ fn: withCtx(() => [
13345
+ renderSlot(_ctx.$slots, "transform")
13152
13346
  ]),
13153
13347
  key: "0"
13154
13348
  } : void 0
13155
13349
  ]), 1040, ["modelValue", "movable", "resizable", "rotatable", "roundable", "resize-strategy", "scale", "offset"])) : createCommentVNode("", true),
13156
- transform.value.width && transform.value.height && _ctx.$slots.default ? (openBlock(), createElementBlock("div", {
13350
+ transform.value.width && transform.value.height ? (openBlock(), createElementBlock("div", {
13157
13351
  key: 3,
13158
13352
  class: "mce-selection__slot",
13159
13353
  style: normalizeStyle$1(unref(selectionObbInDrawboard).toCssStyle())
13160
13354
  }, [
13161
- renderSlot(_ctx.$slots, "default", { transform: transform.value })
13355
+ createVNode(_sfc_main$j),
13356
+ renderSlot(_ctx.$slots, "default")
13162
13357
  ], 4)) : createCommentVNode("", true)
13163
13358
  ]);
13164
13359
  };
@@ -13359,8 +13554,8 @@ const _selection = definePlugin((editor) => {
13359
13554
  }
13360
13555
  },
13361
13556
  components: [
13362
- { slot: "selection", type: "overlay", component: _sfc_main$j },
13363
- { type: "overlay", component: _sfc_main$l }
13557
+ { slot: "selection", type: "overlay", component: _sfc_main$i },
13558
+ { type: "overlay", component: _sfc_main$m }
13364
13559
  ]
13365
13560
  };
13366
13561
  });
@@ -13635,15 +13830,15 @@ const _slice = definePlugin((editor) => {
13635
13830
  ]
13636
13831
  };
13637
13832
  });
13638
- const _hoisted_1$c = { class: "mce-smart-guides" };
13639
- const _sfc_main$i = /* @__PURE__ */ defineComponent({
13833
+ const _hoisted_1$b = { class: "mce-smart-guides" };
13834
+ const _sfc_main$h = /* @__PURE__ */ defineComponent({
13640
13835
  __name: "SmartGuides",
13641
13836
  props: {
13642
13837
  snapLines: {}
13643
13838
  },
13644
13839
  setup(__props) {
13645
13840
  return (_ctx, _cache) => {
13646
- return openBlock(), createElementBlock("div", _hoisted_1$c, [
13841
+ return openBlock(), createElementBlock("div", _hoisted_1$b, [
13647
13842
  (openBlock(true), createElementBlock(Fragment, null, renderList(__props.snapLines, (item, key) => {
13648
13843
  return openBlock(), createElementBlock("div", {
13649
13844
  key,
@@ -14958,7 +15153,7 @@ const _smartGuides = definePlugin((editor) => {
14958
15153
  components: [
14959
15154
  {
14960
15155
  type: "overlay",
14961
- component: () => h(_sfc_main$i, { snapLines: snapLines.value })
15156
+ component: () => h(_sfc_main$h, { snapLines: snapLines.value })
14962
15157
  }
14963
15158
  ]
14964
15159
  };
@@ -14989,12 +15184,12 @@ function flipType(type) {
14989
15184
  function isLeftTopLine(line) {
14990
15185
  return ["vt", "hl"].includes(line.type);
14991
15186
  }
14992
- const _hoisted_1$b = {
15187
+ const _hoisted_1$a = {
14993
15188
  key: 0,
14994
15189
  class: "mce-smart-selection"
14995
15190
  };
14996
15191
  const _hoisted_2$6 = ["onMousedown"];
14997
- const _sfc_main$h = /* @__PURE__ */ defineComponent({
15192
+ const _sfc_main$g = /* @__PURE__ */ defineComponent({
14998
15193
  __name: "SmartSelection",
14999
15194
  props: {
15000
15195
  "modelValue": {},
@@ -15170,7 +15365,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15170
15365
  return;
15171
15366
  }
15172
15367
  return (_ctx, _cache) => {
15173
- return info.value.active ? (openBlock(), createElementBlock("div", _hoisted_1$b, [
15368
+ return info.value.active ? (openBlock(), createElementBlock("div", _hoisted_1$a, [
15174
15369
  (openBlock(true), createElementBlock(Fragment, null, renderList(handles.value, (item, index) => {
15175
15370
  return openBlock(), createElementBlock("div", {
15176
15371
  key: index,
@@ -15188,7 +15383,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
15188
15383
  }, null, 42, _hoisted_2$6)
15189
15384
  ], 6);
15190
15385
  }), 128)),
15191
- transform.value.width && transform.value.height ? (openBlock(), createBlock(_sfc_main$k, {
15386
+ transform.value.width && transform.value.height ? (openBlock(), createBlock(_sfc_main$l, {
15192
15387
  key: 0,
15193
15388
  modelValue: transform.value,
15194
15389
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => transform.value = $event),
@@ -15215,7 +15410,7 @@ const _smartSelection = definePlugin((_editor) => {
15215
15410
  components: [
15216
15411
  {
15217
15412
  type: "overlay",
15218
- component: () => h(_sfc_main$h, {
15413
+ component: () => h(_sfc_main$g, {
15219
15414
  "modelValue": currentElement.value,
15220
15415
  "onUpdate:modelValue": (el) => currentElement.value = el
15221
15416
  })
@@ -15238,7 +15433,7 @@ const _state = definePlugin((editor) => {
15238
15433
  ]
15239
15434
  };
15240
15435
  });
15241
- const _hoisted_1$a = { class: "progress-indicator" };
15436
+ const _hoisted_1$9 = { class: "progress-indicator" };
15242
15437
  const _hoisted_2$5 = {
15243
15438
  key: 0,
15244
15439
  class: "progress-indicator__status"
@@ -15248,7 +15443,7 @@ const _hoisted_4$2 = {
15248
15443
  key: 1,
15249
15444
  class: "progress-indicator__bar-indeterminate"
15250
15445
  };
15251
- const _sfc_main$g = /* @__PURE__ */ defineComponent({
15446
+ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15252
15447
  __name: "ProgressIndicator",
15253
15448
  props: /* @__PURE__ */ mergeModels({
15254
15449
  label: {},
@@ -15261,7 +15456,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
15261
15456
  setup(__props) {
15262
15457
  const progress = useModel(__props, "modelValue");
15263
15458
  return (_ctx, _cache) => {
15264
- return openBlock(), createElementBlock("div", _hoisted_1$a, [
15459
+ return openBlock(), createElementBlock("div", _hoisted_1$9, [
15265
15460
  __props.label ? (openBlock(), createElementBlock("span", _hoisted_2$5, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
15266
15461
  createElementVNode("div", _hoisted_3$5, [
15267
15462
  !__props.indeterminate ? (openBlock(), createElementBlock("div", {
@@ -15274,8 +15469,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
15274
15469
  };
15275
15470
  }
15276
15471
  });
15277
- const ProgressIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-3b286483"]]);
15278
- const _hoisted_1$9 = { class: "mce-statusbar" };
15472
+ const ProgressIndicator = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-3b286483"]]);
15473
+ const _hoisted_1$8 = { class: "mce-statusbar" };
15279
15474
  const _hoisted_2$4 = { class: "mce-statusbar__main" };
15280
15475
  const _hoisted_3$4 = { class: "mce-statusbar__item" };
15281
15476
  const _hoisted_4$1 = { class: "mce-statusbar__kbd" };
@@ -15297,7 +15492,7 @@ const _hoisted_19 = { class: "mce-statusbar__kbd" };
15297
15492
  const _hoisted_20 = { class: "mce-statusbar__item" };
15298
15493
  const _hoisted_21 = { class: "mce-statusbar__item" };
15299
15494
  const _hoisted_22 = { class: "mce-statusbar__progress" };
15300
- const _sfc_main$f = /* @__PURE__ */ defineComponent({
15495
+ const _sfc_main$e = /* @__PURE__ */ defineComponent({
15301
15496
  __name: "Statusbar",
15302
15497
  setup(__props) {
15303
15498
  const {
@@ -15310,7 +15505,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15310
15505
  isElement
15311
15506
  } = useEditor();
15312
15507
  return (_ctx, _cache) => {
15313
- return openBlock(), createElementBlock("div", _hoisted_1$9, [
15508
+ return openBlock(), createElementBlock("div", _hoisted_1$8, [
15314
15509
  createElementVNode("div", _hoisted_2$4, [
15315
15510
  unref(state) === "typing" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
15316
15511
  createElementVNode("div", _hoisted_3$4, [
@@ -15324,7 +15519,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15324
15519
  ])
15325
15520
  ], 64)) : unref(state) === "transforming" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
15326
15521
  createElementVNode("div", _hoisted_8, [
15327
- createVNode(unref(_sfc_main$C), { icon: "$mouseRightClick" })
15522
+ createVNode(unref(_sfc_main$D), { icon: "$mouseRightClick" })
15328
15523
  ]),
15329
15524
  _cache[2] || (_cache[2] = createElementVNode("span", null, " / ", -1)),
15330
15525
  createElementVNode("div", _hoisted_9, [
@@ -15338,7 +15533,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15338
15533
  ])
15339
15534
  ], 64)) : unref(state) ? (openBlock(), createElementBlock("span", _hoisted_13, toDisplayString(unref(t)(unref(state))), 1)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [
15340
15535
  createElementVNode("div", _hoisted_14, [
15341
- createVNode(unref(_sfc_main$C), { icon: "$mouseLeftClick" }),
15536
+ createVNode(unref(_sfc_main$D), { icon: "$mouseLeftClick" }),
15342
15537
  createElementVNode("span", null, toDisplayString(unref(t)("selectObject")), 1)
15343
15538
  ]),
15344
15539
  _cache[5] || (_cache[5] = createElementVNode("span", null, " + ", -1)),
@@ -15348,7 +15543,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15348
15543
  ]),
15349
15544
  _cache[6] || (_cache[6] = createElementVNode("div", { class: "mce-statusbar__divider" }, null, -1)),
15350
15545
  createElementVNode("div", _hoisted_17, [
15351
- createVNode(unref(_sfc_main$C), { icon: "$mouseLeftClick" }),
15546
+ createVNode(unref(_sfc_main$D), { icon: "$mouseLeftClick" }),
15352
15547
  createElementVNode("span", null, toDisplayString(unref(t)("selectArea")), 1)
15353
15548
  ]),
15354
15549
  _cache[7] || (_cache[7] = createElementVNode("span", null, " + ", -1)),
@@ -15358,7 +15553,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15358
15553
  ]),
15359
15554
  _cache[8] || (_cache[8] = createElementVNode("div", { class: "mce-statusbar__divider" }, null, -1)),
15360
15555
  createElementVNode("div", _hoisted_20, [
15361
- createVNode(unref(_sfc_main$C), { icon: "$mouseLeftClick" }),
15556
+ createVNode(unref(_sfc_main$D), { icon: "$mouseLeftClick" }),
15362
15557
  createElementVNode("span", null, toDisplayString(unref(t)("dragSelected")), 1)
15363
15558
  ]),
15364
15559
  unref(selection).length === 1 && unref(isElement)(unref(selection)[0]) && unref(selection)[0].text.isValid() ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -15382,7 +15577,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
15382
15577
  };
15383
15578
  }
15384
15579
  });
15385
- const Statusbar = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a1f0e31b"]]);
15580
+ const Statusbar = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-a1f0e31b"]]);
15386
15581
  const _statusbar = definePlugin((editor) => {
15387
15582
  const {
15388
15583
  registerConfig
@@ -15401,7 +15596,7 @@ const _statusbar = definePlugin((editor) => {
15401
15596
  ]
15402
15597
  };
15403
15598
  });
15404
- const _sfc_main$e = /* @__PURE__ */ defineComponent({
15599
+ const _sfc_main$d = /* @__PURE__ */ defineComponent({
15405
15600
  __name: "TextEditor",
15406
15601
  setup(__props, { expose: __expose }) {
15407
15602
  const {
@@ -15572,23 +15767,23 @@ const _text = definePlugin((editor) => {
15572
15767
  { command: "setActiveDrawingTool:text", key: "T" }
15573
15768
  ],
15574
15769
  components: [
15575
- { type: "overlay", component: _sfc_main$e }
15770
+ { type: "overlay", component: _sfc_main$d }
15576
15771
  ]
15577
15772
  };
15578
15773
  });
15579
- const _hoisted_1$8 = { class: "mce-payhead" };
15580
- const _sfc_main$d = /* @__PURE__ */ defineComponent({
15774
+ const _hoisted_1$7 = { class: "mce-payhead" };
15775
+ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15581
15776
  __name: "Playhead",
15582
15777
  setup(__props) {
15583
15778
  return (_ctx, _cache) => {
15584
- return openBlock(), createElementBlock("div", _hoisted_1$8, [..._cache[0] || (_cache[0] = [
15779
+ return openBlock(), createElementBlock("div", _hoisted_1$7, [..._cache[0] || (_cache[0] = [
15585
15780
  createElementVNode("header", { class: "mce-payhead__header" }, null, -1),
15586
15781
  createElementVNode("main", { class: "mce-payhead__main" }, null, -1)
15587
15782
  ])]);
15588
15783
  };
15589
15784
  }
15590
15785
  });
15591
- const _hoisted_1$7 = {
15786
+ const _hoisted_1$6 = {
15592
15787
  key: 0,
15593
15788
  class: "mce-segment__edge mce-segment__edge--front"
15594
15789
  };
@@ -15600,7 +15795,7 @@ const _hoisted_3$3 = {
15600
15795
  key: 1,
15601
15796
  class: "mce-segment__edge mce-segment__edge--end"
15602
15797
  };
15603
- const _sfc_main$c = /* @__PURE__ */ defineComponent({
15798
+ const _sfc_main$b = /* @__PURE__ */ defineComponent({
15604
15799
  __name: "Segment",
15605
15800
  props: {
15606
15801
  node: {},
@@ -15666,25 +15861,25 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
15666
15861
  style: normalizeStyle$1(block.style)
15667
15862
  }, toDisplayString(block.name), 5);
15668
15863
  }), 128)),
15669
- __props.active ? (openBlock(), createElementBlock("div", _hoisted_1$7)) : createCommentVNode("", true),
15864
+ __props.active ? (openBlock(), createElementBlock("div", _hoisted_1$6)) : createCommentVNode("", true),
15670
15865
  createElementVNode("span", _hoisted_2$3, toDisplayString(props.node.name), 1),
15671
15866
  __props.active ? (openBlock(), createElementBlock("div", _hoisted_3$3)) : createCommentVNode("", true)
15672
15867
  ], 6);
15673
15868
  };
15674
15869
  }
15675
15870
  });
15676
- const _hoisted_1$6 = { class: "mce-track" };
15677
- const _sfc_main$b = /* @__PURE__ */ defineComponent({
15871
+ const _hoisted_1$5 = { class: "mce-track" };
15872
+ const _sfc_main$a = /* @__PURE__ */ defineComponent({
15678
15873
  __name: "Track",
15679
15874
  setup(__props) {
15680
15875
  return (_ctx, _cache) => {
15681
- return openBlock(), createElementBlock("div", _hoisted_1$6, [
15876
+ return openBlock(), createElementBlock("div", _hoisted_1$5, [
15682
15877
  renderSlot(_ctx.$slots, "default")
15683
15878
  ]);
15684
15879
  };
15685
15880
  }
15686
15881
  });
15687
- const _sfc_main$a = /* @__PURE__ */ defineComponent({
15882
+ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15688
15883
  __name: "Trackhead",
15689
15884
  props: {
15690
15885
  node: {}
@@ -15700,14 +15895,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
15700
15895
  };
15701
15896
  }
15702
15897
  });
15703
- const _hoisted_1$5 = { class: "mce-timeline__toolbar" };
15898
+ const _hoisted_1$4 = { class: "mce-timeline__toolbar" };
15704
15899
  const _hoisted_2$2 = { class: "mce-timeline__main" };
15705
15900
  const _hoisted_3$2 = { class: "mce-timeline__left" };
15706
15901
  const _hoisted_4 = { class: "mce-timeline__left-wrapper" };
15707
15902
  const _hoisted_5 = { class: "mce-timeline__right-wrapper" };
15708
15903
  const _hoisted_6 = { class: "mce-timeline__ruler" };
15709
15904
  const _hoisted_7 = { class: "mce-timeline__track" };
15710
- const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15905
+ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
15711
15906
  __name: "Timeline",
15712
15907
  setup(__props) {
15713
15908
  const {
@@ -15808,12 +16003,12 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15808
16003
  onWheel: _cache[0] || (_cache[0] = withModifiers(() => {
15809
16004
  }, ["prevent"]))
15810
16005
  }, [
15811
- createElementVNode("div", _hoisted_1$5, [
16006
+ createElementVNode("div", _hoisted_1$4, [
15812
16007
  createElementVNode("div", {
15813
16008
  class: "mce-timeline__play",
15814
16009
  onClick: toggle
15815
16010
  }, [
15816
- createVNode(unref(_sfc_main$C), {
16011
+ createVNode(unref(_sfc_main$D), {
15817
16012
  icon: paused.value ? "$play" : "$pause"
15818
16013
  }, null, 8, ["icon"])
15819
16014
  ])
@@ -15827,7 +16022,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15827
16022
  })
15828
16023
  }, [
15829
16024
  (openBlock(true), createElementBlock(Fragment, null, renderList(elements.value, (node, index) => {
15830
- return openBlock(), createBlock(_sfc_main$a, {
16025
+ return openBlock(), createBlock(_sfc_main$9, {
15831
16026
  key: index,
15832
16027
  node
15833
16028
  }, null, 8, ["node"]);
@@ -15842,7 +16037,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15842
16037
  }, [
15843
16038
  createElementVNode("div", _hoisted_5, [
15844
16039
  createElementVNode("div", _hoisted_6, [
15845
- createVNode(_sfc_main$p, {
16040
+ createVNode(_sfc_main$q, {
15846
16041
  ref: "rulerTpl",
15847
16042
  zoom: 1 / unref(msPerPx) * fps.value,
15848
16043
  unit: 100,
@@ -15860,9 +16055,9 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15860
16055
  })
15861
16056
  }, [
15862
16057
  (openBlock(true), createElementBlock(Fragment, null, renderList(elements.value, (node, index) => {
15863
- return openBlock(), createBlock(_sfc_main$b, { key: index }, {
16058
+ return openBlock(), createBlock(_sfc_main$a, { key: index }, {
15864
16059
  default: withCtx(() => [
15865
- createVNode(_sfc_main$c, {
16060
+ createVNode(_sfc_main$b, {
15866
16061
  node,
15867
16062
  "ms-per-px": unref(msPerPx),
15868
16063
  active: unref(selection).some((v) => v.equal(node)),
@@ -15874,7 +16069,7 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
15874
16069
  }), 128))
15875
16070
  ], 4)
15876
16071
  ]),
15877
- createVNode(_sfc_main$d, {
16072
+ createVNode(_sfc_main$c, {
15878
16073
  style: normalizeStyle$1({
15879
16074
  transform: `translate(${offset2.value[0] + Math.ceil(unref(currentTime) / unref(msPerPx))}px, 0px)`
15880
16075
  })
@@ -15899,7 +16094,7 @@ const _timeline = definePlugin((editor) => {
15899
16094
  type: "panel",
15900
16095
  position: "bottom",
15901
16096
  size: 160,
15902
- component: _sfc_main$9
16097
+ component: _sfc_main$8
15903
16098
  }
15904
16099
  ],
15905
16100
  hotkeys: [
@@ -15907,10 +16102,10 @@ const _timeline = definePlugin((editor) => {
15907
16102
  ]
15908
16103
  };
15909
16104
  });
15910
- const _hoisted_1$4 = { class: "mce-toolbelt" };
16105
+ const _hoisted_1$3 = { class: "mce-toolbelt" };
15911
16106
  const _hoisted_2$1 = { key: 0 };
15912
16107
  const _hoisted_3$1 = { key: 1 };
15913
- const _sfc_main$8 = /* @__PURE__ */ defineComponent({
16108
+ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15914
16109
  __name: "Toolbelt",
15915
16110
  setup(__props) {
15916
16111
  const {
@@ -16009,19 +16204,19 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
16009
16204
  ];
16010
16205
  });
16011
16206
  return (_ctx, _cache) => {
16012
- return openBlock(), createElementBlock("div", _hoisted_1$4, [
16207
+ return openBlock(), createElementBlock("div", _hoisted_1$3, [
16013
16208
  (openBlock(true), createElementBlock(Fragment, null, renderList(items.value, (tool, key) => {
16014
16209
  return openBlock(), createElementBlock("div", {
16015
16210
  key,
16016
16211
  class: "mce-toolbelt__group"
16017
16212
  }, [
16018
- createVNode(_sfc_main$q, {
16213
+ createVNode(_sfc_main$r, {
16019
16214
  location: "top",
16020
16215
  offset: 12,
16021
16216
  "show-arrow": ""
16022
16217
  }, {
16023
16218
  activator: withCtx(({ props: slotProps }) => [
16024
- createVNode(_sfc_main$y, mergeProps({
16219
+ createVNode(_sfc_main$z, mergeProps({
16025
16220
  icon: "",
16026
16221
  class: "mce-toolbelt__btn",
16027
16222
  active: tool.active || tool.checked || false
@@ -16029,7 +16224,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
16029
16224
  onClick: tool.handle
16030
16225
  }), {
16031
16226
  default: withCtx(() => [
16032
- createVNode(unref(_sfc_main$C), {
16227
+ createVNode(unref(_sfc_main$D), {
16033
16228
  icon: `$${tool.key}`
16034
16229
  }, null, 8, ["icon"])
16035
16230
  ]),
@@ -16044,19 +16239,19 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
16044
16239
  ]),
16045
16240
  _: 2
16046
16241
  }, 1024),
16047
- tool.children?.length ? (openBlock(), createBlock(_sfc_main$t, {
16242
+ tool.children?.length ? (openBlock(), createBlock(_sfc_main$u, {
16048
16243
  key: 0,
16049
16244
  items: tool.children,
16050
16245
  offset: 12,
16051
16246
  location: "top-start"
16052
16247
  }, {
16053
16248
  activator: withCtx(({ props }) => [
16054
- createVNode(_sfc_main$y, mergeProps({
16249
+ createVNode(_sfc_main$z, mergeProps({
16055
16250
  icon: "",
16056
16251
  class: "mce-toolbelt__arrow"
16057
16252
  }, { ref_for: true }, props), {
16058
16253
  default: withCtx(() => [
16059
- createVNode(unref(_sfc_main$C), { icon: "$arrowDown" })
16254
+ createVNode(unref(_sfc_main$D), { icon: "$arrowDown" })
16060
16255
  ]),
16061
16256
  _: 1
16062
16257
  }, 16)
@@ -16072,7 +16267,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
16072
16267
  ], 64)) : createCommentVNode("", true)
16073
16268
  ]),
16074
16269
  prepend: withCtx(({ item }) => [
16075
- createVNode(unref(_sfc_main$C), {
16270
+ createVNode(unref(_sfc_main$D), {
16076
16271
  class: "mce-toolbelt__icon",
16077
16272
  icon: `$${item.key}`
16078
16273
  }, null, 8, ["icon"])
@@ -16096,7 +16291,7 @@ const _toolbelt = definePlugin((editor) => {
16096
16291
  {
16097
16292
  name: "toolbelt",
16098
16293
  type: "overlay",
16099
- component: _sfc_main$8,
16294
+ component: _sfc_main$7,
16100
16295
  ignore: () => !toolbelt.value
16101
16296
  }
16102
16297
  ]
@@ -16601,7 +16796,7 @@ function useEditor() {
16601
16796
  }
16602
16797
  return editor;
16603
16798
  }
16604
- const _sfc_main$7 = /* @__PURE__ */ defineComponent({
16799
+ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
16605
16800
  __name: "Floatbar",
16606
16801
  props: {
16607
16802
  ...makeMceOverlayProps({
@@ -16646,7 +16841,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
16646
16841
  updateLocation
16647
16842
  });
16648
16843
  return (_ctx, _cache) => {
16649
- return openBlock(), createBlock(_sfc_main$u, {
16844
+ return openBlock(), createBlock(_sfc_main$v, {
16650
16845
  ref: "overlayTpl",
16651
16846
  "content-style": style.value,
16652
16847
  class: "mce-floatbar",
@@ -16665,11 +16860,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
16665
16860
  };
16666
16861
  }
16667
16862
  });
16668
- const _hoisted_1$3 = {
16863
+ const _hoisted_1$2 = {
16669
16864
  key: 0,
16670
16865
  class: "mce-float-panel__title"
16671
16866
  };
16672
- const _sfc_main$6 = /* @__PURE__ */ defineComponent({
16867
+ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
16673
16868
  __name: "FloatPanel",
16674
16869
  props: /* @__PURE__ */ mergeModels({
16675
16870
  title: {},
@@ -16693,7 +16888,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
16693
16888
  isActive
16694
16889
  };
16695
16890
  return (_ctx, _cache) => {
16696
- return openBlock(), createBlock(_sfc_main$k, {
16891
+ return openBlock(), createBlock(_sfc_main$l, {
16697
16892
  modelValue: transform.value,
16698
16893
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => transform.value = $event),
16699
16894
  class: "mce-float-panel",
@@ -16703,14 +16898,14 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
16703
16898
  }, {
16704
16899
  default: withCtx(({ props: slotProps }) => [
16705
16900
  createElementVNode("div", mergeProps({ class: "mce-float-panel__card" }, slotProps), [
16706
- __props.title ? (openBlock(), createElementBlock("div", _hoisted_1$3, [
16901
+ __props.title ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
16707
16902
  createElementVNode("div", null, toDisplayString(__props.title), 1),
16708
- createVNode(_sfc_main$y, {
16903
+ createVNode(_sfc_main$z, {
16709
16904
  icon: "",
16710
16905
  onClick: _cache[0] || (_cache[0] = ($event) => isActive.value = false)
16711
16906
  }, {
16712
16907
  default: withCtx(() => [
16713
- createVNode(unref(_sfc_main$C), { icon: "$close" })
16908
+ createVNode(unref(_sfc_main$D), { icon: "$close" })
16714
16909
  ]),
16715
16910
  _: 1
16716
16911
  })
@@ -16729,7 +16924,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
16729
16924
  };
16730
16925
  }
16731
16926
  });
16732
- const _sfc_main$5 = /* @__PURE__ */ defineComponent({
16927
+ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16733
16928
  __name: "Layout",
16734
16929
  props: {
16735
16930
  class: [String, Array, Object],
@@ -16763,7 +16958,7 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
16763
16958
  };
16764
16959
  }
16765
16960
  });
16766
- const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16961
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16767
16962
  __name: "LayoutItem",
16768
16963
  props: {
16769
16964
  class: [String, Array, Object],
@@ -16809,11 +17004,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
16809
17004
  };
16810
17005
  }
16811
17006
  });
16812
- const _hoisted_1$2 = {
17007
+ const _hoisted_1$1 = {
16813
17008
  key: 0,
16814
17009
  class: "mce-main__scroller"
16815
17010
  };
16816
- const _sfc_main$3 = /* @__PURE__ */ defineComponent({
17011
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
16817
17012
  __name: "Main",
16818
17013
  props: {
16819
17014
  scrollable: Boolean
@@ -16828,14 +17023,14 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
16828
17023
  ]]),
16829
17024
  style: normalizeStyle$1([unref(mainStyles)])
16830
17025
  }, [
16831
- props.scrollable ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
17026
+ props.scrollable ? (openBlock(), createElementBlock("div", _hoisted_1$1, [
16832
17027
  renderSlot(_ctx.$slots, "default")
16833
17028
  ])) : renderSlot(_ctx.$slots, "default", { key: 1 })
16834
17029
  ], 6);
16835
17030
  };
16836
17031
  }
16837
17032
  });
16838
- const _hoisted_1$1 = ["data-pixel-ratio"];
17033
+ const _hoisted_1 = ["data-pixel-ratio"];
16839
17034
  const _hoisted_2 = {
16840
17035
  ref: "canvasTpl",
16841
17036
  class: "mce-editor__canvas"
@@ -16844,7 +17039,7 @@ const _hoisted_3 = {
16844
17039
  ref: "overlayContainerTpl",
16845
17040
  class: "mce-overlay-container"
16846
17041
  };
16847
- const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17042
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16848
17043
  __name: "EditorLayout",
16849
17044
  props: {
16850
17045
  ...makeMceStrategyProps({
@@ -17204,7 +17399,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17204
17399
  editor
17205
17400
  };
17206
17401
  return (_ctx, _cache) => {
17207
- return openBlock(), createBlock(_sfc_main$5, {
17402
+ return openBlock(), createBlock(_sfc_main$4, {
17208
17403
  class: normalizeClass(["mce-editor", [
17209
17404
  unref(state) && `mce-editor--${unref(state)}`,
17210
17405
  unref(activeDrawingTool) && `mce-editor--drawing-tool-${unref(activeDrawingTool).name}`,
@@ -17212,7 +17407,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17212
17407
  ]])
17213
17408
  }, {
17214
17409
  default: withCtx(() => [
17215
- createVNode(_sfc_main$3, null, {
17410
+ createVNode(_sfc_main$2, null, {
17216
17411
  default: withCtx(() => [
17217
17412
  createElementVNode("div", {
17218
17413
  ref_key: "drawboardDom",
@@ -17225,7 +17420,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17225
17420
  }, ["prevent"]))
17226
17421
  }, [
17227
17422
  createElementVNode("canvas", _hoisted_2, null, 512),
17228
- slots["floatbar-top"] || slots.floatbar ? (openBlock(), createBlock(_sfc_main$7, {
17423
+ slots["floatbar-top"] || slots.floatbar ? (openBlock(), createBlock(_sfc_main$6, {
17229
17424
  key: 0,
17230
17425
  location: "top-start",
17231
17426
  target: unref(state) === "typing" ? unref(componentRefs)["mce:text"]?.[0]?.textEditor : unref(componentRefs)["mce:selection"]?.[0]?.transformControls?.$el,
@@ -17237,7 +17432,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17237
17432
  ]),
17238
17433
  _: 3
17239
17434
  }, 8, ["target"])) : createCommentVNode("", true),
17240
- slots["floatbar-bottom"] ? (openBlock(), createBlock(_sfc_main$7, {
17435
+ slots["floatbar-bottom"] ? (openBlock(), createBlock(_sfc_main$6, {
17241
17436
  key: 1,
17242
17437
  location: "bottom-start",
17243
17438
  target: unref(componentRefs)["mce:selection"]?.[0]?.transformControls?.$el,
@@ -17249,7 +17444,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17249
17444
  _: 3
17250
17445
  }, 8, ["target"])) : createCommentVNode("", true),
17251
17446
  renderSlot(_ctx.$slots, "drawboard", normalizeProps(guardReactiveProps(slotProps)))
17252
- ], 40, _hoisted_1$1)
17447
+ ], 40, _hoisted_1)
17253
17448
  ]),
17254
17449
  _: 3
17255
17450
  }),
@@ -17265,7 +17460,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17265
17460
  ], 8, ["to"])) : createCommentVNode("", true)
17266
17461
  ], 64)) : item.type === "panel" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
17267
17462
  item.position === "float" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
17268
- unref(config)[item.name] ? (openBlock(), createBlock(_sfc_main$6, {
17463
+ unref(config)[item.name] ? (openBlock(), createBlock(_sfc_main$5, {
17269
17464
  key: 0,
17270
17465
  modelValue: unref(config)[item.name],
17271
17466
  "onUpdate:modelValue": ($event) => unref(config)[item.name] = $event,
@@ -17287,7 +17482,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17287
17482
  _: 2
17288
17483
  }, 1032, ["modelValue", "onUpdate:modelValue", "title", "default-transform"])) : createCommentVNode("", true)
17289
17484
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
17290
- unref(config)[item.name] ? (openBlock(), createBlock(_sfc_main$4, {
17485
+ unref(config)[item.name] ? (openBlock(), createBlock(_sfc_main$3, {
17291
17486
  key: 0,
17292
17487
  modelValue: unref(config)[item.name],
17293
17488
  "onUpdate:modelValue": ($event) => unref(config)[item.name] = $event,
@@ -17311,178 +17506,6 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
17311
17506
  };
17312
17507
  }
17313
17508
  });
17314
- const _hoisted_1 = { class: "mce-cropper" };
17315
- const _sfc_main$1 = /* @__PURE__ */ defineComponent({
17316
- __name: "Cropper",
17317
- props: /* @__PURE__ */ mergeModels({
17318
- image: {},
17319
- minScale: { default: 0.1 },
17320
- maxScale: { default: 3 }
17321
- }, {
17322
- "modelValue": { default: () => ({}) },
17323
- "modelModifiers": {},
17324
- "style": { default: () => ({}) },
17325
- "styleModifiers": {}
17326
- }),
17327
- emits: /* @__PURE__ */ mergeModels(["start", "end", "update:transform"], ["update:modelValue", "update:style"]),
17328
- setup(__props, { emit: __emit }) {
17329
- const props = __props;
17330
- const emit = __emit;
17331
- const cropRect = useModel(__props, "modelValue");
17332
- const styleModel = useModel(__props, "style");
17333
- const rootBox = ref({ width: 0, height: 0 });
17334
- const { state: imageRef } = useImage(
17335
- computed(() => ({
17336
- src: props.image
17337
- }))
17338
- );
17339
- const backup = cloneDeep(cropRect.value);
17340
- const canvasRef = useTemplateRef("canvasRef");
17341
- const computedCropRect = computed({
17342
- get: () => {
17343
- const { left = 0, top = 0, right = 0, bottom = 0 } = cropRect.value;
17344
- return { left, top, right, bottom };
17345
- },
17346
- set: (val) => cropRect.value = val
17347
- });
17348
- const inverseMat = computed(() => {
17349
- const { left, top, right, bottom } = computedCropRect.value;
17350
- const sx = 1 / (1 - left - right);
17351
- const sy = 1 / (1 - top - bottom);
17352
- const tx = -left;
17353
- const ty = -top;
17354
- return { sx, sy, tx, ty };
17355
- });
17356
- const sourceTransform = computed({
17357
- get: () => {
17358
- const { sx, sy, tx, ty } = inverseMat.value;
17359
- const { scaleX = 1, scaleY = 1 } = styleModel.value;
17360
- const { width, height } = rootBox.value;
17361
- return {
17362
- width: sx * width,
17363
- height: sy * height,
17364
- left: tx * scaleX * (sx * width),
17365
- top: ty * scaleY * (sy * height)
17366
- };
17367
- },
17368
- set: (newValue) => {
17369
- const { width, height } = rootBox.value;
17370
- const { scaleX = 1, scaleY = 1 } = styleModel.value;
17371
- const transform = {
17372
- sx: newValue.width / width,
17373
- sy: newValue.height / height,
17374
- tx: newValue.left / newValue.width / scaleX,
17375
- ty: newValue.top / newValue.height / scaleY
17376
- };
17377
- const left = -transform.tx;
17378
- const top = -transform.ty;
17379
- const w = 1 - 1 / transform.sx;
17380
- const h2 = 1 - 1 / transform.sy;
17381
- const right = w - left;
17382
- const bottom = h2 - top;
17383
- computedCropRect.value = { left, top, right, bottom };
17384
- }
17385
- });
17386
- const scale = computed({
17387
- get: () => inverseMat.value.sx,
17388
- set: (value) => {
17389
- const transform = inverseMat.value;
17390
- const rate = transform.sx / value;
17391
- const left = -transform.tx;
17392
- const top = -transform.ty;
17393
- const w = 1 - 1 / value;
17394
- const h2 = 1 - 1 / transform.sy * rate;
17395
- const right = w - left;
17396
- const bottom = h2 - top;
17397
- computedCropRect.value = { left, top, right, bottom };
17398
- }
17399
- });
17400
- onBeforeMount(() => emit("start"));
17401
- onBeforeUnmount(() => emit("end"));
17402
- const sourceStyle = computed(() => {
17403
- const { sx, sy, tx, ty } = inverseMat.value;
17404
- const { scaleX = 1, scaleY = 1 } = styleModel.value;
17405
- return {
17406
- transform: [
17407
- `scale(${sx}, ${sy})`,
17408
- `translate(${tx * scaleX * 100}%, ${ty * scaleY * 100}%)`
17409
- ].join(" ")
17410
- };
17411
- });
17412
- watch([canvasRef, imageRef], render2);
17413
- watch(computedCropRect, render2, { deep: true });
17414
- watch([() => styleModel.value.scaleX, () => styleModel.value.scaleY], render2);
17415
- function render2() {
17416
- const ctx = canvasRef.value?.getContext("2d");
17417
- if (!ctx || !imageRef.value)
17418
- return;
17419
- const { scaleX = 1, scaleY = 1 } = styleModel.value;
17420
- const { naturalWidth, naturalHeight } = imageRef.value;
17421
- ctx.canvas.width = naturalWidth;
17422
- ctx.canvas.height = naturalHeight;
17423
- ctx.clearRect(0, 0, naturalWidth, naturalHeight);
17424
- ctx.globalAlpha = 0.4;
17425
- ctx.scale(scaleX, scaleY);
17426
- ctx.drawImage(imageRef.value, 0, 0, naturalWidth, naturalHeight);
17427
- }
17428
- function ok() {
17429
- emit("end");
17430
- }
17431
- function cancel() {
17432
- cropRect.value = backup;
17433
- ok();
17434
- }
17435
- function onResizeObserver(entries) {
17436
- const { width, height } = entries[0].contentRect;
17437
- rootBox.value = { width, height };
17438
- }
17439
- function applySourceTransformToStyle() {
17440
- const { left = 0, top = 0, width = 0, height = 0 } = styleModel.value;
17441
- const { sx, sy, tx, ty } = inverseMat.value;
17442
- cropRect.value = {};
17443
- styleModel.value = {
17444
- ...styleModel.value,
17445
- width: sx * width,
17446
- height: sy * height,
17447
- left: left + tx * (sx * width),
17448
- top: top + ty * (sy * height)
17449
- };
17450
- ok();
17451
- }
17452
- return (_ctx, _cache) => {
17453
- return withDirectives((openBlock(), createElementBlock("div", _hoisted_1, [
17454
- createElementVNode("div", {
17455
- class: "mce-cropper__source",
17456
- style: normalizeStyle$1(sourceStyle.value)
17457
- }, [
17458
- createElementVNode("canvas", {
17459
- ref_key: "canvasRef",
17460
- ref: canvasRef
17461
- }, null, 512)
17462
- ], 4),
17463
- createVNode(_sfc_main$k, {
17464
- modelValue: sourceTransform.value,
17465
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => sourceTransform.value = $event),
17466
- class: "mce-cropper__transform",
17467
- rotatable: false
17468
- }, {
17469
- default: withCtx(({ props: slotProps }) => [
17470
- createElementVNode("div", mergeProps({ class: "mce-cropper__transform_rect" }, slotProps), null, 16)
17471
- ]),
17472
- _: 1
17473
- }, 8, ["modelValue"]),
17474
- renderSlot(_ctx.$slots, "default", {
17475
- scale: scale.value,
17476
- ok,
17477
- cancel,
17478
- applySourceTransformToStyle
17479
- })
17480
- ])), [
17481
- [unref(vResizeObserver), onResizeObserver]
17482
- ]);
17483
- };
17484
- }
17485
- });
17486
17509
  const _sfc_main = /* @__PURE__ */ defineComponent({
17487
17510
  __name: "Dialog",
17488
17511
  props: /* @__PURE__ */ mergeModels({
@@ -17510,7 +17533,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17510
17533
  updateLocation
17511
17534
  });
17512
17535
  return (_ctx, _cache) => {
17513
- return openBlock(), createBlock(_sfc_main$u, {
17536
+ return openBlock(), createBlock(_sfc_main$v, {
17514
17537
  ref: "overlayTpl",
17515
17538
  modelValue: isActive.value,
17516
17539
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isActive.value = $event),
@@ -17534,14 +17557,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
17534
17557
  }
17535
17558
  });
17536
17559
  export {
17537
- _sfc_main$1 as Cropper,
17560
+ _sfc_main$k as Cropper,
17538
17561
  _sfc_main as Dialog,
17539
17562
  Doc,
17540
17563
  Editor,
17541
- _sfc_main$w as EditorLayers,
17542
- _sfc_main$2 as EditorLayout,
17543
- _sfc_main$4 as EditorLayoutItem,
17544
- _sfc_main$8 as EditorToolbelt,
17564
+ _sfc_main$x as EditorLayers,
17565
+ _sfc_main$1 as EditorLayout,
17566
+ _sfc_main$3 as EditorLayoutItem,
17567
+ _sfc_main$7 as EditorToolbelt,
17545
17568
  IconsSymbol,
17546
17569
  MceLayerItemKey,
17547
17570
  MceLayerKey,
@@ -17549,12 +17572,12 @@ export {
17549
17572
  MceLayoutKey,
17550
17573
  MceMenuSymbol,
17551
17574
  MceOverlaySymbol,
17552
- _sfc_main$t as Menu,
17575
+ _sfc_main$u as Menu,
17553
17576
  Model,
17554
- _sfc_main$p as Ruler,
17577
+ _sfc_main$q as Ruler,
17555
17578
  SUPPORTS_CLIPBOARD,
17556
- _sfc_main$n as Scrollbar,
17557
- _sfc_main$k as TransformControls,
17579
+ _sfc_main$o as Scrollbar,
17580
+ _sfc_main$l as TransformControls,
17558
17581
  USER_AGENT,
17559
17582
  boundingBoxToStyle,
17560
17583
  consoleError,