mce 0.15.19 → 0.15.21

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,5 +1,5 @@
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
- import { reactive, computed, watch, markRaw, isReactive, ref, warn, shallowRef, onBeforeUnmount, defineComponent, createElementBlock, createCommentVNode, unref, openBlock, normalizeStyle as normalizeStyle$1, toDisplayString, createVNode, useAttrs, createBlock, resolveDynamicComponent, normalizeClass, mergeProps, createElementVNode, inject, toValue, getCurrentInstance, provide, useId, readonly, toRef, onMounted, onDeactivated, onActivated, onScopeDispose, useModel, useTemplateRef, withDirectives, withModifiers, vShow, vModelText, nextTick, Fragment, renderList, renderSlot, mergeModels, resolveComponent, withCtx, Teleport, createTextVNode, createSlots, normalizeProps, guardReactiveProps, onBeforeMount, h, isRef, useSlots } from "vue";
2
+ import { reactive, computed, watch, markRaw, isReactive, ref, warn, shallowRef, onBeforeUnmount, defineComponent, createElementBlock, createCommentVNode, unref, openBlock, normalizeStyle as normalizeStyle$1, toDisplayString, createVNode, useAttrs, createBlock, resolveDynamicComponent, normalizeClass, mergeProps, createElementVNode, inject, toValue, getCurrentInstance, provide, useId, readonly, toRef, onMounted, onDeactivated, onActivated, onScopeDispose, useModel, useTemplateRef, withDirectives, withModifiers, vModelText, vShow, nextTick, Fragment, renderList, renderSlot, mergeModels, resolveComponent, withCtx, Teleport, createTextVNode, createSlots, normalizeProps, guardReactiveProps, onBeforeMount, h, isRef, useSlots } from "vue";
3
3
  import { useFileDialog, useEventListener, isClient, onClickOutside, useDebounceFn, useResizeObserver as useResizeObserver$1, useLocalStorage, useImage } 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";
@@ -113,7 +113,6 @@ const _0_config_base = defineMixin((editor, options) => {
113
113
  config
114
114
  } = editor;
115
115
  registerConfig("theme", "system");
116
- registerConfig("viewMode", "edgeless");
117
116
  registerConfig("watermark", void 0);
118
117
  registerConfig("msaa", false);
119
118
  registerConfig("checkerboard", false);
@@ -942,7 +941,7 @@ const _0_context = defineMixin((editor) => {
942
941
  function isFrame(value) {
943
942
  return isElement(value) && value.meta.inEditorIs === "Frame";
944
943
  }
945
- function isTopLevelFrame(value) {
944
+ function isTopFrame(value) {
946
945
  return isFrame(value) && Boolean(value.parent?.equal(root.value));
947
946
  }
948
947
  function isVisible(node) {
@@ -986,7 +985,7 @@ const _0_context = defineMixin((editor) => {
986
985
  isRoot,
987
986
  isElement,
988
987
  isFrame,
989
- isTopLevelFrame,
988
+ isTopFrame,
990
989
  isVisible,
991
990
  setVisible,
992
991
  isLock,
@@ -1123,8 +1122,8 @@ const en = {
1123
1122
  "selectAll": "Select all",
1124
1123
  "deselectAll": "Deselect all",
1125
1124
  "selectParent": "Select parent",
1126
- "previousSelection": "Previous selection",
1127
- "nextSelection": "Next selection",
1125
+ "selectPreviousSibling": "Select previous sibling",
1126
+ "selectNextSibling": "Select next sibling",
1128
1127
  "view": "View",
1129
1128
  "view:checkerboard": "Checkerboard",
1130
1129
  "view:pixelGrid": "Pixel grid",
@@ -1148,6 +1147,8 @@ const en = {
1148
1147
  "zoomTo100": "Zoom to 100%",
1149
1148
  "zoomToFit": "Zoom to fit",
1150
1149
  "zoomToSelection": "Zoom to selection",
1150
+ "zoomToNextFrame": "Zoom to next frame",
1151
+ "zoomToPreviousFrame": "Zoom to previous frame",
1151
1152
  "object": "Object",
1152
1153
  "groupSelection": "Group Selection",
1153
1154
  "frameSelection": "Frame selection",
@@ -1232,8 +1233,8 @@ const zhHans = {
1232
1233
  "selectAll": "选择全部",
1233
1234
  "deselectAll": "反选全部",
1234
1235
  "selectParent": "选择父元素",
1235
- "previousSelection": "选择前一个",
1236
- "nextSelection": "选择后一个",
1236
+ "selectPreviousSibling": "选择前一个",
1237
+ "selectNextSibling": "选择后一个",
1237
1238
  "view": "视图",
1238
1239
  "view:checkerboard": "棋盘",
1239
1240
  "view:pixelGrid": "像素网格",
@@ -1257,6 +1258,8 @@ const zhHans = {
1257
1258
  "zoomTo100": "缩放到100%",
1258
1259
  "zoomToFit": "缩放到合适",
1259
1260
  "zoomToSelection": "缩放到选区",
1261
+ "zoomToNextFrame": "缩放到下个画板",
1262
+ "zoomToPreviousFrame": "缩放到上个画板",
1260
1263
  "object": "对象",
1261
1264
  "groupSelection": "组合选区",
1262
1265
  "frameSelection": "组合选区为画板",
@@ -1317,39 +1320,20 @@ const _0_locale = defineMixin((editor, options) => {
1317
1320
  const _1_frame = defineMixin((editor) => {
1318
1321
  const {
1319
1322
  root,
1320
- isFrame
1323
+ isFrame,
1324
+ isTopFrame
1321
1325
  } = editor;
1322
1326
  const frames = computed(() => root.value.children.filter(isFrame) ?? []);
1323
- const currentFrameIndex = ref(-1);
1324
- const currentFrame = computed(() => frames.value[currentFrameIndex.value]);
1325
- const currentFrameAabb = computed(() => {
1326
- const { left = 0, top = 0, width = 0, height = 0 } = currentFrame.value?.style ?? {};
1327
- return { left, top, width, height };
1328
- });
1329
1327
  const frameThumbs = ref([]);
1330
- function getAncestorFrame(node) {
1331
- return node?.findAncestor((node2) => isFrame(node2));
1328
+ function getAncestorFrame(node, isTop) {
1329
+ const when = isTop ? isTopFrame : isFrame;
1330
+ return node?.findAncestor((node2) => when(node2));
1332
1331
  }
1333
1332
  Object.assign(editor, {
1334
1333
  frames,
1335
1334
  frameThumbs,
1336
- currentFrameIndex,
1337
- currentFrame,
1338
- currentFrameAabb,
1339
1335
  getAncestorFrame
1340
1336
  });
1341
- return () => {
1342
- const {
1343
- selection
1344
- } = editor;
1345
- watch(() => {
1346
- return selection.value.length === 1 && selection.value[0];
1347
- }, (node) => {
1348
- if (node && isFrame(node)) {
1349
- currentFrameIndex.value = frames.value.findIndex((v) => v.equal(node));
1350
- }
1351
- });
1352
- };
1353
1337
  });
1354
1338
  function boundingBoxToStyle(box) {
1355
1339
  const style = {
@@ -1460,6 +1444,8 @@ async function createImageElement(image) {
1460
1444
  }
1461
1445
  };
1462
1446
  }
1447
+ function noop(..._args) {
1448
+ }
1463
1449
  function isClickInsideElement(event, targetDiv) {
1464
1450
  const mouseX = event.clientX;
1465
1451
  const mouseY = event.clientY;
@@ -1832,15 +1818,14 @@ const _1_upload = defineMixin((editor, options) => {
1832
1818
  upload
1833
1819
  });
1834
1820
  });
1835
- function noop(..._args) {
1836
- }
1837
1821
  const _2_box = defineMixin((editor) => {
1838
1822
  const {
1839
1823
  isElement,
1840
1824
  camera,
1841
1825
  root,
1842
1826
  selection,
1843
- getAncestorFrame
1827
+ getAncestorFrame,
1828
+ drawboardAabb
1844
1829
  } = editor;
1845
1830
  function obbToFit(element) {
1846
1831
  const min = {
@@ -1913,7 +1898,7 @@ const _2_box = defineMixin((editor) => {
1913
1898
  }
1914
1899
  } else if (isElement(node)) {
1915
1900
  const style = node.style;
1916
- noop([style.left, style.top, style.width, style.height, style.rotate]);
1901
+ noop(style.left, style.top, style.width, style.height, style.rotate);
1917
1902
  obb = node.getGlobalObb();
1918
1903
  } else {
1919
1904
  obb = new Obb2D();
@@ -2022,6 +2007,23 @@ const _2_box = defineMixin((editor) => {
2022
2007
  _aabb.top -= position.y;
2023
2008
  return _aabb;
2024
2009
  }
2010
+ const viewportAabb = computed(() => {
2011
+ noop(
2012
+ camera.value.position.x,
2013
+ camera.value.position.y,
2014
+ camera.value.zoom.x,
2015
+ camera.value.zoom.y
2016
+ );
2017
+ const { width, height } = drawboardAabb.value;
2018
+ const p1 = camera.value.toGlobal({ x: 0, y: 0 });
2019
+ const p2 = camera.value.toGlobal({ x: width, y: height });
2020
+ return new Aabb2D({
2021
+ x: p1.x,
2022
+ y: p1.y,
2023
+ width: p2.x,
2024
+ height: p2.y
2025
+ });
2026
+ });
2025
2027
  const rootAabb = computed(() => getAabb(root.value.children));
2026
2028
  const selectionAabb = computed(() => getAabb(selection.value));
2027
2029
  const selectionAabbInDrawboard = computed(() => getAabb(selection.value, "drawboard"));
@@ -2032,6 +2034,7 @@ const _2_box = defineMixin((editor) => {
2032
2034
  getObb,
2033
2035
  getAabb,
2034
2036
  aabbToDrawboardAabb,
2037
+ viewportAabb,
2035
2038
  rootAabb,
2036
2039
  selectionAabb,
2037
2040
  selectionAabbInDrawboard,
@@ -2161,14 +2164,8 @@ const _2_load = defineMixin((editor) => {
2161
2164
  });
2162
2165
  const _3_view = defineMixin((editor) => {
2163
2166
  const {
2164
- renderEngine,
2165
- rootAabb,
2166
- currentFrameAabb,
2167
- config
2167
+ renderEngine
2168
2168
  } = editor;
2169
- const viewAabb = computed(() => {
2170
- return config.value.viewMode === "frame" ? currentFrameAabb.value : rootAabb.value;
2171
- });
2172
2169
  function bindRenderCanvas(canvas, eventTarget) {
2173
2170
  function onRendered() {
2174
2171
  const target = renderEngine.value.view;
@@ -2198,46 +2195,38 @@ const _3_view = defineMixin((editor) => {
2198
2195
  return unbind;
2199
2196
  }
2200
2197
  Object.assign(editor, {
2201
- viewAabb,
2202
2198
  bindRenderCanvas
2203
2199
  });
2204
- return () => {
2205
- const {
2206
- isElement,
2207
- root,
2208
- currentFrame,
2209
- on,
2210
- exec
2211
- } = editor;
2212
- function onViewMode() {
2213
- switch (config.value.viewMode) {
2214
- case "frame":
2215
- root.value.children.forEach((child) => {
2216
- if (isElement(child)) {
2217
- child.visible = child.equal(currentFrame.value);
2218
- }
2219
- });
2220
- break;
2221
- case "edgeless":
2222
- root.value.children.forEach((child) => {
2223
- if (isElement(child)) {
2224
- child.visible = true;
2225
- }
2226
- });
2227
- break;
2228
- }
2229
- exec("zoomToFit");
2230
- }
2231
- watch(() => config.value.viewMode, onViewMode);
2232
- on("setCurrentFrame", onViewMode);
2233
- on("setDoc", onViewMode);
2234
- };
2235
2200
  });
2236
2201
  const _4_0_node = defineMixin((editor) => {
2237
2202
  const {
2238
2203
  doc,
2239
2204
  selection
2240
2205
  } = editor;
2206
+ function findSibling(target) {
2207
+ const node = selection.value[0];
2208
+ if (node) {
2209
+ let value;
2210
+ switch (target) {
2211
+ case "previous":
2212
+ value = node.nextSibling;
2213
+ if (!value && node.parent) {
2214
+ value = node.parent.children[0];
2215
+ }
2216
+ break;
2217
+ case "next":
2218
+ value = node.previousSibling;
2219
+ if (!value && node.parent) {
2220
+ value = node.parent.children[node.parent.children.length - 1];
2221
+ }
2222
+ break;
2223
+ }
2224
+ if (value && !node.equal(value)) {
2225
+ return value;
2226
+ }
2227
+ }
2228
+ return void 0;
2229
+ }
2241
2230
  function addNode(value, options = {}) {
2242
2231
  const {
2243
2232
  parent,
@@ -2256,6 +2245,7 @@ const _4_0_node = defineMixin((editor) => {
2256
2245
  return node;
2257
2246
  }
2258
2247
  Object.assign(editor, {
2248
+ findSibling,
2259
2249
  addNode
2260
2250
  });
2261
2251
  });
@@ -2402,7 +2392,7 @@ class TextEditor extends HTMLElement {
2402
2392
  </style>
2403
2393
 
2404
2394
  <div class="container">
2405
- <textarea></textarea>
2395
+ <textarea name="text-content"></textarea>
2406
2396
  <div class="selection"></div>
2407
2397
  <div class="cursor blink"></div>
2408
2398
  </div>
@@ -2723,18 +2713,18 @@ class TextEditor extends HTMLElement {
2723
2713
  } else {
2724
2714
  const { selectionStart, selectionEnd } = this._textarea;
2725
2715
  let count2 = 0;
2726
- const _selection = [-1, -1];
2716
+ const _selection2 = [-1, -1];
2727
2717
  this._chars.forEach((char, index) => {
2728
2718
  if (count2 <= selectionStart) {
2729
- _selection[0] = index;
2719
+ _selection2[0] = index;
2730
2720
  }
2731
2721
  if (count2 <= selectionEnd) {
2732
- _selection[1] = index;
2722
+ _selection2[1] = index;
2733
2723
  }
2734
2724
  count2 += char.content.length;
2735
2725
  });
2736
2726
  const oldSelection = this.selection;
2737
- this.selection = _selection;
2727
+ this.selection = _selection2;
2738
2728
  this._prevSelection = oldSelection;
2739
2729
  }
2740
2730
  }
@@ -3315,26 +3305,39 @@ const _4_1_text = defineMixin((editor) => {
3315
3305
  const _4_2_frame = defineMixin((editor) => {
3316
3306
  const {
3317
3307
  root,
3318
- currentFrameIndex,
3319
- emit,
3320
- selection,
3321
3308
  frames,
3322
- config,
3323
- isTopLevelFrame
3309
+ isTopFrame,
3310
+ exec,
3311
+ selection,
3312
+ getAncestorFrame
3324
3313
  } = editor;
3325
- function setCurrentFrame(index = currentFrameIndex.value) {
3326
- index = Math.max(0, Math.min(frames.value.length - 1, index));
3327
- const oldIndex = currentFrameIndex.value;
3328
- currentFrameIndex.value = index;
3329
- if (config.value.viewMode === "edgeless") {
3330
- selection.value = [frames.value[index]];
3331
- } else {
3332
- selection.value = [];
3314
+ function findFrame(target) {
3315
+ let current;
3316
+ const node = selection.value[0];
3317
+ if (node) {
3318
+ current = isTopFrame(node) ? node : getAncestorFrame(node, true);
3319
+ }
3320
+ const last = frames.value.length - 1;
3321
+ let index = frames.value.findIndex((node2) => node2.equal(current));
3322
+ switch (target) {
3323
+ case "next":
3324
+ index--;
3325
+ if (index < 0) {
3326
+ index = last;
3327
+ }
3328
+ break;
3329
+ case "previous":
3330
+ index++;
3331
+ if (index > last) {
3332
+ index = 0;
3333
+ }
3334
+ break;
3333
3335
  }
3334
- emit("setCurrentFrame", index, oldIndex);
3336
+ return frames.value[index];
3335
3337
  }
3336
- function handleElementInsideFrame(element) {
3337
- const frame1 = element.findAncestor((node) => isTopLevelFrame(node));
3338
+ function handleDragOutReparent(element, options) {
3339
+ const pointer = options?.pointer;
3340
+ const frame1 = element.findAncestor((node) => isTopFrame(node));
3338
3341
  const aabb1 = element.getGlobalAabb();
3339
3342
  const area1 = aabb1.getArea();
3340
3343
  let flag = true;
@@ -3344,12 +3347,17 @@ const _4_2_frame = defineMixin((editor) => {
3344
3347
  continue;
3345
3348
  }
3346
3349
  const aabb2 = frame2.getGlobalAabb();
3347
- if (aabb1 && aabb2) {
3348
- if (aabb1.getIntersectionRect(aabb2).getArea() > area1 * 0.5) {
3350
+ if (aabb2) {
3351
+ if (pointer ? aabb2.contains(pointer) : aabb1 && aabb1.getIntersectionRect(aabb2).getArea() > area1 * 0.5) {
3349
3352
  if (!frame2.equal(frame1)) {
3350
- frame2.appendChild(element);
3353
+ let index = frame2.children.length;
3354
+ if (frame2.equal(options?.parent)) {
3355
+ index = options.index;
3356
+ }
3351
3357
  element.style.left = aabb1.x - aabb2.x;
3352
3358
  element.style.top = aabb1.y - aabb2.y;
3359
+ frame2.moveChild(element, index);
3360
+ exec("layerScrollIntoView");
3353
3361
  }
3354
3362
  flag = false;
3355
3363
  break;
@@ -3357,14 +3365,19 @@ const _4_2_frame = defineMixin((editor) => {
3357
3365
  }
3358
3366
  }
3359
3367
  if (flag && frame1) {
3360
- root.value.moveChild(element, 0);
3361
3368
  element.style.left = aabb1.x;
3362
3369
  element.style.top = aabb1.y;
3370
+ let index = root.value.children.length;
3371
+ if (root.value.equal(options?.parent)) {
3372
+ index = options.index;
3373
+ }
3374
+ root.value.moveChild(element, index);
3375
+ exec("layerScrollIntoView");
3363
3376
  }
3364
3377
  }
3365
3378
  Object.assign(editor, {
3366
- setCurrentFrame,
3367
- handleElementInsideFrame
3379
+ findFrame,
3380
+ handleDragOutReparent
3368
3381
  });
3369
3382
  });
3370
3383
  const _4_3_element = defineMixin((editor) => {
@@ -3386,7 +3399,7 @@ const _4_3_element = defineMixin((editor) => {
3386
3399
  selection,
3387
3400
  camera,
3388
3401
  parseAnchor,
3389
- handleElementInsideFrame
3402
+ handleDragOutReparent
3390
3403
  } = editor;
3391
3404
  function addElement(value, options = {}) {
3392
3405
  log("addElement", value, options);
@@ -3529,13 +3542,12 @@ const _4_3_element = defineMixin((editor) => {
3529
3542
  });
3530
3543
  } else if (globalPosition) {
3531
3544
  elements2.forEach((el) => {
3532
- el.style.left = Math.round(
3545
+ el.style.left += Math.round(
3533
3546
  parentAabb ? parentAabb.left - globalPosition.x : globalPosition.x
3534
3547
  );
3535
- el.style.top = Math.round(
3548
+ el.style.top += Math.round(
3536
3549
  parentAabb ? parentAabb.top - globalPosition.y : globalPosition.y
3537
3550
  );
3538
- globalPosition.x += el.style.width + frameGap;
3539
3551
  });
3540
3552
  }
3541
3553
  return elements2;
@@ -3545,7 +3557,7 @@ const _4_3_element = defineMixin((editor) => {
3545
3557
  selection.value = elements;
3546
3558
  }
3547
3559
  if (!isArray && !parent) {
3548
- handleElementInsideFrame(elements[0]);
3560
+ handleDragOutReparent(elements[0]);
3549
3561
  }
3550
3562
  return isArray ? elements : elements[0];
3551
3563
  }
@@ -3580,7 +3592,7 @@ const _4_3_element = defineMixin((editor) => {
3580
3592
  }
3581
3593
  return [node];
3582
3594
  }).filter((node) => {
3583
- return "isVisibleInTree" in node && node.isVisibleInTree() && getObb(node, "drawboard").overlapsOnAxis(area2) && !isLock(node) && !node.findAncestor((ancestor) => isLock(ancestor));
3595
+ return "isVisibleInTree" in node && node.isVisibleInTree() && getObb(node, "drawboard").overlap(area2) && !isLock(node) && !node.findAncestor((ancestor) => isLock(ancestor));
3584
3596
  }) ?? [];
3585
3597
  selection.value = selected;
3586
3598
  return selected;
@@ -3745,11 +3757,13 @@ const _scroll$1 = defineMixin((editor) => {
3745
3757
  camera,
3746
3758
  getAabb,
3747
3759
  selectionAabb,
3748
- viewAabb,
3760
+ rootAabb,
3761
+ viewportAabb,
3749
3762
  screenCenter
3750
3763
  } = editor;
3751
3764
  const scrollTo = async (target, options = {}) => {
3752
3765
  const {
3766
+ intoView,
3753
3767
  behavior,
3754
3768
  duration = 500
3755
3769
  } = options;
@@ -3771,10 +3785,13 @@ const _scroll$1 = defineMixin((editor) => {
3771
3785
  break;
3772
3786
  case "root":
3773
3787
  default:
3774
- aabb = viewAabb.value;
3788
+ aabb = rootAabb.value;
3775
3789
  break;
3776
3790
  }
3777
3791
  }
3792
+ if (intoView && viewportAabb.value.contains(aabb)) {
3793
+ return;
3794
+ }
3778
3795
  position = { x: aabb.left + aabb.width / 2, y: aabb.top + aabb.height / 2 };
3779
3796
  offset2.x += -_screenCenter.x;
3780
3797
  offset2.y = -_screenCenter.y;
@@ -3822,10 +3839,7 @@ const _scroll$1 = defineMixin((editor) => {
3822
3839
  const _snapshot = defineMixin((editor) => {
3823
3840
  const {
3824
3841
  isElement,
3825
- renderEngine,
3826
3842
  frames,
3827
- currentFrameAabb,
3828
- camera,
3829
3843
  frameThumbs,
3830
3844
  log,
3831
3845
  fonts,
@@ -3833,7 +3847,12 @@ const _snapshot = defineMixin((editor) => {
3833
3847
  } = editor;
3834
3848
  registerConfig("frameScreenshot", false);
3835
3849
  async function snapshot() {
3836
- frameThumbs.value.length = frames.value.length;
3850
+ frameThumbs.value = frames.value.map(() => ({
3851
+ instanceId: -1,
3852
+ width: 0,
3853
+ height: 0,
3854
+ url: ""
3855
+ }));
3837
3856
  for (let i = 0; i < frames.value.length; i++) {
3838
3857
  await captureFrameScreenshot(i);
3839
3858
  }
@@ -3869,39 +3888,10 @@ const _snapshot = defineMixin((editor) => {
3869
3888
  log("captureFrameScreenshot", index);
3870
3889
  }
3871
3890
  }
3872
- function renderFrameThumb(target) {
3873
- const view = renderEngine.value.view;
3874
- const aabb = currentFrameAabb.value;
3875
- const pixelRatio = renderEngine.value.pixelRatio ?? 1;
3876
- if (!view)
3877
- return;
3878
- const ctx = target.getContext("2d");
3879
- if (!ctx)
3880
- return;
3881
- ctx.fillStyle = "rgba(0, 0, 0, 0)";
3882
- ctx.clearRect(0, 0, target.width, target.height);
3883
- const { zoom, position } = camera.value;
3884
- target.width = aabb.width;
3885
- target.height = aabb.height;
3886
- const sw = aabb.width * zoom.x;
3887
- const sh = aabb.height * zoom.y;
3888
- ctx.drawImage(
3889
- view,
3890
- (aabb.left * zoom.x - position.x) * pixelRatio,
3891
- (aabb.top * zoom.x - position.y) * pixelRatio,
3892
- sw * pixelRatio,
3893
- sh * pixelRatio,
3894
- 0,
3895
- 0,
3896
- target.width,
3897
- target.height
3898
- );
3899
- }
3900
3891
  Object.assign(editor, {
3901
3892
  snapshot,
3902
3893
  captureElementScreenshot,
3903
- captureFrameScreenshot,
3904
- renderFrameThumb
3894
+ captureFrameScreenshot
3905
3895
  });
3906
3896
  return () => {
3907
3897
  const {
@@ -3936,11 +3926,6 @@ const _snapshot = defineMixin((editor) => {
3936
3926
  doc.root.on("addChild", onAddChild);
3937
3927
  doc.root.on("removeChild", onRemoveChild);
3938
3928
  });
3939
- on("setCurrentFrame", (_index, oldIndex) => {
3940
- if (config.value.frameScreenshot) {
3941
- captureFrameScreenshot(oldIndex);
3942
- }
3943
- });
3944
3929
  };
3945
3930
  });
3946
3931
  const _zoom$1 = defineMixin((editor) => {
@@ -3948,18 +3933,20 @@ const _zoom$1 = defineMixin((editor) => {
3948
3933
  camera,
3949
3934
  drawboardAabb,
3950
3935
  selectionAabb,
3951
- viewAabb,
3936
+ rootAabb,
3952
3937
  getAabb,
3953
- screenCenterOffset
3938
+ screenCenterOffset,
3939
+ viewportAabb
3954
3940
  } = editor;
3955
3941
  const zoomTo = async (target, options = {}) => {
3956
3942
  const {
3943
+ intoView,
3957
3944
  mode = "contain",
3958
3945
  duration = 500,
3959
3946
  behavior
3960
3947
  } = options;
3961
3948
  let aabb;
3962
- if (Array.isArray(target)) {
3949
+ if (Array.isArray(target) || typeof target === "object") {
3963
3950
  aabb = getAabb(target);
3964
3951
  } else {
3965
3952
  switch (target) {
@@ -3968,10 +3955,13 @@ const _zoom$1 = defineMixin((editor) => {
3968
3955
  break;
3969
3956
  case "root":
3970
3957
  default:
3971
- aabb = viewAabb.value;
3958
+ aabb = rootAabb.value;
3972
3959
  break;
3973
3960
  }
3974
3961
  }
3962
+ if (intoView && viewportAabb.value.contains(aabb)) {
3963
+ return;
3964
+ }
3975
3965
  const offset2 = screenCenterOffset.value;
3976
3966
  const { width, height } = drawboardAabb.value;
3977
3967
  const tw = width - (offset2.left + offset2.right);
@@ -5177,8 +5167,8 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
5177
5167
  const editing = ref(false);
5178
5168
  async function onDblclick() {
5179
5169
  editing.value = true;
5170
+ await nextTick();
5180
5171
  if (input.value) {
5181
- await nextTick();
5182
5172
  input.value.focus();
5183
5173
  input.value.select();
5184
5174
  }
@@ -5211,14 +5201,15 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
5211
5201
  onPointerleave: _cache[3] || (_cache[3] = ($event) => !unref(state) && !unref(isLock)(frame.value) && (hoverElement.value = void 0))
5212
5202
  }, [
5213
5203
  createElementVNode("div", null, toDisplayString(frame.value.name), 1),
5214
- withDirectives(createElementVNode("input", {
5204
+ editing.value ? withDirectives((openBlock(), createElementBlock("input", {
5205
+ key: 0,
5215
5206
  ref: "inputTpl",
5216
5207
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => frame.value.name = $event),
5208
+ name: "frame-name",
5217
5209
  onBlur: _cache[1] || (_cache[1] = ($event) => editing.value = false)
5218
- }, null, 544), [
5219
- [vShow, editing.value],
5210
+ }, null, 544)), [
5220
5211
  [vModelText, frame.value.name]
5221
- ])
5212
+ ]) : createCommentVNode("", true)
5222
5213
  ], 32)
5223
5214
  ], 6)), [
5224
5215
  [vShow, frame.value.visible]
@@ -5615,8 +5606,16 @@ const _import = definePlugin((editor) => {
5615
5606
  } = editor;
5616
5607
  const _import2 = async (options = {}) => {
5617
5608
  const files = await openFileDialog({ multiple: true });
5618
- return addElements((await Promise.all(files.map((file) => load(file)))).flat(), {
5619
- sizeToFit: true,
5609
+ return addElements((await Promise.all(files.map(async (file) => {
5610
+ const items = await load(file);
5611
+ return items.flatMap((item) => {
5612
+ if (item.meta?.inEditorIs === "Doc" && item.children) {
5613
+ return item.children;
5614
+ }
5615
+ return [item];
5616
+ });
5617
+ }))).flat(), {
5618
+ position: "right",
5620
5619
  ...options
5621
5620
  });
5622
5621
  };
@@ -6033,20 +6032,20 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6033
6032
  }
6034
6033
  });
6035
6034
  if (min !== void 0 && max !== void 0) {
6036
- let _selection = nodes.value.slice(min, max + 1);
6037
- const result = new Set(_selection.map((node) => node.id));
6035
+ let _selection2 = nodes.value.slice(min, max + 1);
6036
+ const result = new Set(_selection2.map((node) => node.id));
6038
6037
  const parents = /* @__PURE__ */ new Set();
6039
- _selection.forEach((node) => node.parent && parents.add(node.parent));
6038
+ _selection2.forEach((node) => node.parent && parents.add(node.parent));
6040
6039
  parents.forEach((parent) => {
6041
6040
  if (parent.children.every((ch) => result.has(ch.id))) {
6042
6041
  const ids = new Set(parent.children.map((ch) => ch.id));
6043
- _selection = [
6044
- ..._selection.filter((v) => !ids.has(v.id)),
6042
+ _selection2 = [
6043
+ ..._selection2.filter((v) => !ids.has(v.id)),
6045
6044
  parent
6046
6045
  ];
6047
6046
  }
6048
6047
  });
6049
- selection.value = _selection;
6048
+ selection.value = _selection2;
6050
6049
  }
6051
6050
  } else if (e.ctrlKey || e.metaKey) {
6052
6051
  const filtered = selection.value.filter((v) => !v.equal(props.node));
@@ -6149,10 +6148,12 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6149
6148
  class: "mce-layer__name",
6150
6149
  onDblclick: onDblclickName
6151
6150
  }, [
6152
- withDirectives(createElementVNode("input", {
6151
+ editing.value ? withDirectives((openBlock(), createElementBlock("input", {
6152
+ key: 0,
6153
6153
  ref_key: "inputDom",
6154
6154
  ref: inputDom,
6155
6155
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => editValue.value = $event),
6156
+ name: "layer-name",
6156
6157
  type: "text",
6157
6158
  class: "mce-layer__input",
6158
6159
  spellcheck: "false",
@@ -6160,10 +6161,9 @@ const _sfc_main$x = /* @__PURE__ */ defineComponent({
6160
6161
  autocorrect: "off",
6161
6162
  autofocus: "",
6162
6163
  onBlur: onInputBlur
6163
- }, null, 544), [
6164
- [vShow, editing.value],
6164
+ }, null, 544)), [
6165
6165
  [vModelText, editValue.value]
6166
- ]),
6166
+ ]) : createCommentVNode("", true),
6167
6167
  createElementVNode("div", {
6168
6168
  style: normalizeStyle$1({ visibility: editing.value ? "hidden" : void 0 })
6169
6169
  }, toDisplayString(editValue.value || thumbnailName.value), 5)
@@ -6227,7 +6227,8 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
6227
6227
  const {
6228
6228
  root,
6229
6229
  selection,
6230
- state
6230
+ state,
6231
+ registerCommand
6231
6232
  } = useEditor();
6232
6233
  const {
6233
6234
  selecting,
@@ -6235,12 +6236,10 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
6235
6236
  domItems,
6236
6237
  getIdByNode
6237
6238
  } = createLayer();
6238
- watch(selection, (selection2) => {
6239
- if (state.value === "selecting" || selecting.value) {
6240
- return;
6241
- }
6239
+ registerCommand({ command: "layerScrollIntoView", handle: layerScrollIntoView });
6240
+ function layerScrollIntoView() {
6242
6241
  let last;
6243
- selection2.forEach((node) => {
6242
+ selection.value.forEach((node) => {
6244
6243
  node.findAncestor((ancestor) => {
6245
6244
  const opened = openedItems.get(getIdByNode(ancestor) ?? "");
6246
6245
  if (opened) {
@@ -6258,6 +6257,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
6258
6257
  });
6259
6258
  });
6260
6259
  }
6260
+ }
6261
+ watch(selection, () => {
6262
+ if (state.value === "selecting" || selecting.value) {
6263
+ return;
6264
+ }
6265
+ layerScrollIntoView();
6261
6266
  });
6262
6267
  return (_ctx, _cache) => {
6263
6268
  return openBlock(), createElementBlock("div", _hoisted_1$k, [
@@ -6823,8 +6828,8 @@ const _menu = definePlugin((editor, options) => {
6823
6828
  { key: "selectAll" },
6824
6829
  { key: "deselectAll", disabled: !hasSelected.value },
6825
6830
  { key: "selectParent", disabled: !hasSelected.value },
6826
- { key: "previousSelection", disabled: !hasSelected.value },
6827
- { key: "nextSelection", disabled: !hasSelected.value }
6831
+ { key: "selectPreviousSibling", disabled: !hasSelected.value },
6832
+ { key: "selectNextSibling", disabled: !hasSelected.value }
6828
6833
  ]
6829
6834
  }));
6830
6835
  const editMenu = computed(() => ({
@@ -6844,7 +6849,9 @@ const _menu = definePlugin((editor, options) => {
6844
6849
  { key: "zoomOut" },
6845
6850
  { key: "zoomTo100" },
6846
6851
  { key: "zoomToFit" },
6847
- { key: "zoomToSelection", disabled: !hasSelected.value }
6852
+ { key: "zoomToSelection", disabled: !hasSelected.value },
6853
+ { key: "zoomToNextFrame", disabled: !hasSelected.value },
6854
+ { key: "zoomToPreviousFrame", disabled: !hasSelected.value }
6848
6855
  ]
6849
6856
  }));
6850
6857
  const panelsMenu = computed(() => ({
@@ -11927,7 +11934,7 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
11927
11934
  const props = __props;
11928
11935
  const {
11929
11936
  camera,
11930
- viewAabb
11937
+ rootAabb
11931
11938
  } = useEditor();
11932
11939
  return (_ctx, _cache) => {
11933
11940
  return openBlock(), createElementBlock(Fragment, null, [
@@ -11935,12 +11942,12 @@ const _sfc_main$m = /* @__PURE__ */ defineComponent({
11935
11942
  modelValue: unref(camera).position.y,
11936
11943
  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => unref(camera).position.y = $event),
11937
11944
  vertical: "",
11938
- length: unref(viewAabb).height * unref(camera).zoom.y
11945
+ length: unref(rootAabb).height * unref(camera).zoom.y
11939
11946
  }), null, 16, ["modelValue", "length"]),
11940
11947
  createVNode(_sfc_main$n, mergeProps(props, {
11941
11948
  modelValue: unref(camera).position.x,
11942
11949
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => unref(camera).position.x = $event),
11943
- length: unref(viewAabb).width * unref(camera).zoom.x
11950
+ length: unref(rootAabb).width * unref(camera).zoom.x
11944
11951
  }), null, 16, ["modelValue", "length"])
11945
11952
  ], 64);
11946
11953
  };
@@ -11972,16 +11979,11 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11972
11979
  setup(__props) {
11973
11980
  const {
11974
11981
  selectionAabb,
11975
- drawboardAabb,
11976
- aabbToDrawboardAabb,
11982
+ viewportAabb,
11977
11983
  t,
11978
11984
  exec
11979
11985
  } = useEditor();
11980
- const isActive = computed(() => {
11981
- return selectionAabb.value.width && selectionAabb.value.height && !drawboardAabb.value.overlapsOnAxis(
11982
- aabbToDrawboardAabb(selectionAabb.value)
11983
- );
11984
- });
11986
+ const isActive = computed(() => !viewportAabb.value.overlap(selectionAabb.value));
11985
11987
  return (_ctx, _cache) => {
11986
11988
  return isActive.value ? (openBlock(), createElementBlock("div", {
11987
11989
  key: 0,
@@ -11994,11 +11996,13 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
11994
11996
  };
11995
11997
  }
11996
11998
  });
11997
- const _select = definePlugin((editor) => {
11999
+ const _selection = definePlugin((editor) => {
11998
12000
  const {
11999
12001
  isElement,
12000
12002
  selection,
12001
- root
12003
+ root,
12004
+ scrollTo,
12005
+ findSibling
12002
12006
  } = editor;
12003
12007
  function selectAll() {
12004
12008
  selection.value = [...root.value.children];
@@ -12012,39 +12016,30 @@ const _select = definePlugin((editor) => {
12012
12016
  selection.value = [parent];
12013
12017
  }
12014
12018
  }
12015
- function previousSelection() {
12016
- const node = selection.value[0];
12017
- if (node) {
12018
- const previousSibling = node.previousSibling;
12019
- if (previousSibling && !node.equal(previousSibling)) {
12020
- selection.value = [previousSibling];
12021
- }
12022
- }
12023
- }
12024
- function nextSelection() {
12025
- const node = selection.value[0];
12026
- if (node) {
12027
- const nextSibling = node.nextSibling;
12028
- if (nextSibling && node.equal(nextSibling)) {
12029
- selection.value = [nextSibling];
12030
- }
12019
+ function selectSibling(type) {
12020
+ const value = findSibling(type);
12021
+ if (value) {
12022
+ selection.value = [value];
12023
+ scrollTo("selection", {
12024
+ intoView: true
12025
+ });
12031
12026
  }
12032
12027
  }
12033
12028
  return {
12034
- name: "mce:select",
12029
+ name: "mce:selection",
12035
12030
  commands: [
12036
12031
  { command: "selectAll", handle: selectAll },
12037
12032
  { command: "deselectAll", handle: deselectAll },
12038
12033
  { command: "selectParent", handle: selectParent },
12039
- { command: "previousSelection", handle: previousSelection },
12040
- { command: "nextSelection", handle: nextSelection }
12034
+ { command: "selectPreviousSibling", handle: () => selectSibling("previous") },
12035
+ { command: "selectNextSibling", handle: () => selectSibling("next") }
12041
12036
  ],
12042
12037
  hotkeys: [
12043
12038
  { command: "selectAll", key: "CmdOrCtrl+a" },
12044
12039
  { command: "deselectAll", key: "Shift+CmdOrCtrl+a" },
12045
12040
  { command: "selectParent", key: "Alt+\\" },
12046
- { command: "previousSelection", key: "Alt+[" },
12047
- { command: "nextSelection", key: "Alt+]" }
12041
+ { command: "selectPreviousSibling", key: "Shift+Tab" },
12042
+ { command: "selectNextSibling", key: "Tab" }
12048
12043
  ],
12049
12044
  components: [
12050
12045
  { type: "overlay", component: _sfc_main$l }
@@ -13246,8 +13241,8 @@ const _smartGuides = definePlugin((editor) => {
13246
13241
  return line.box?.id === -1;
13247
13242
  }
13248
13243
  function findLines(targets, source) {
13249
- const axis = ["vt", "vb"].includes(source.type) ? "vertical" : "horizontal";
13250
- const flippedAxis = axis === "vertical" ? "horizontal" : "vertical";
13244
+ const axis = ["vt", "vb"].includes(source.type) ? "y" : "x";
13245
+ const flippedAxis = axis === "y" ? "x" : "y";
13251
13246
  const isLeftTop = isLeftTopLine(source);
13252
13247
  let type = flipType(source.type);
13253
13248
  if (parentBox.value) {
@@ -13274,9 +13269,9 @@ const _smartGuides = definePlugin((editor) => {
13274
13269
  const isCanvas = isCanvasLine(target);
13275
13270
  if (type !== target.type && !isCanvas)
13276
13271
  return;
13277
- if (!toBoundingBox(source).overlapsOnAxis(toBoundingBox(target), flippedAxis))
13272
+ if (!toBoundingBox(source).overlap(toBoundingBox(target), flippedAxis))
13278
13273
  return;
13279
- if (!isCanvas && prev && prev.box.id !== target.box.id && toBoundingBox(prev).overlapsOnAxis(toBoundingBox(target), axis)) {
13274
+ if (!isCanvas && prev && prev.box.id !== target.box.id && toBoundingBox(prev).overlap(toBoundingBox(target), axis)) {
13280
13275
  return;
13281
13276
  }
13282
13277
  prev = target;
@@ -14414,12 +14409,24 @@ const _visibility = definePlugin((editor) => {
14414
14409
  });
14415
14410
  const _zoom = definePlugin((editor) => {
14416
14411
  const {
14412
+ registerConfig,
14417
14413
  camera,
14418
14414
  drawboardAabb,
14419
14415
  zoomTo,
14420
14416
  elementSelection,
14421
- exec
14417
+ exec,
14418
+ config,
14419
+ findFrame,
14420
+ selection
14422
14421
  } = editor;
14422
+ registerConfig("zoomToFit", "contain");
14423
+ function zoomToFrame(type, options) {
14424
+ const value = findFrame(type);
14425
+ if (value) {
14426
+ selection.value = [value];
14427
+ zoomTo(value, options);
14428
+ }
14429
+ }
14423
14430
  return {
14424
14431
  name: "mce:zoom",
14425
14432
  commands: [
@@ -14427,15 +14434,19 @@ const _zoom = definePlugin((editor) => {
14427
14434
  { command: "zoomOut", handle: () => camera.value.addZoom(-0.25) },
14428
14435
  { command: "zoomTo100", handle: () => camera.value.setZoom(1) },
14429
14436
  { command: "zoomToCover", handle: () => zoomTo("root", { mode: "cover" }) },
14430
- { command: "zoomToFit", handle: () => zoomTo("root", { mode: "contain" }) },
14431
- { command: "zoomToSelection", handle: (options) => zoomTo("selection", options) }
14437
+ { command: "zoomToFit", handle: () => zoomTo("root", { mode: config.value.zoomToFit }) },
14438
+ { command: "zoomToSelection", handle: (options) => zoomTo("selection", options) },
14439
+ { command: "zoomToNextFrame", handle: (options) => zoomToFrame("next", options) },
14440
+ { command: "zoomToPreviousFrame", handle: (options) => zoomToFrame("previous", options) }
14432
14441
  ],
14433
14442
  hotkeys: [
14434
14443
  { command: "zoomIn", key: "CmdOrCtrl+=" },
14435
14444
  { command: "zoomOut", key: "CmdOrCtrl+-" },
14436
- { command: "zoomTo100", key: "CmdOrCtrl" },
14437
- { command: "zoomToFit", key: "Shift" },
14438
- { command: "zoomToSelection", key: "Shift+™" }
14445
+ { command: "zoomTo100", key: "CmdOrCtrl+0" },
14446
+ { command: "zoomToFit", key: "Shift+!" },
14447
+ { command: "zoomToSelection", key: "Shift+@" },
14448
+ { command: "zoomToNextFrame", key: "n" },
14449
+ { command: "zoomToPreviousFrame", key: "Shift+N" }
14439
14450
  ],
14440
14451
  events: {
14441
14452
  setDoc: () => exec("zoomToFit"),
@@ -14449,10 +14460,8 @@ const _zoom = definePlugin((editor) => {
14449
14460
  },
14450
14461
  setup: () => {
14451
14462
  const {
14452
- drawboardDom,
14453
- config
14463
+ drawboardDom
14454
14464
  } = editor;
14455
- watch(() => config.value.viewMode, () => exec("zoomToFit"));
14456
14465
  useResizeObserver$1(drawboardDom, (entries) => {
14457
14466
  const { left: _left, top: _top, width, height } = entries[0].contentRect;
14458
14467
  const { left = _left, top = _top } = drawboardDom.value?.getBoundingClientRect() ?? {};
@@ -14495,7 +14504,7 @@ const plugins = [
14495
14504
  _ruler,
14496
14505
  _saveAs,
14497
14506
  _scroll,
14498
- _select,
14507
+ _selection,
14499
14508
  _shape,
14500
14509
  _smartGuides,
14501
14510
  _state,
@@ -15531,9 +15540,11 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15531
15540
  config,
15532
15541
  snapThreshold,
15533
15542
  getSnapPoints,
15534
- handleElementInsideFrame
15543
+ handleDragOutReparent,
15544
+ getGlobalPointer
15535
15545
  } = useEditor();
15536
15546
  const transformable = useTemplateRef("transformableTpl");
15547
+ const startContext = ref({});
15537
15548
  onBeforeMount(() => {
15538
15549
  registerCommand({ command: "startTransform", handle: (e) => Boolean(transformable.value?.start(e)) });
15539
15550
  });
@@ -15666,7 +15677,13 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15666
15677
  }
15667
15678
  return false;
15668
15679
  });
15669
- handleElementInsideFrame(element);
15680
+ handleDragOutReparent(
15681
+ element,
15682
+ {
15683
+ ...startContext.value[element.instanceId],
15684
+ pointer: getGlobalPointer()
15685
+ }
15686
+ );
15670
15687
  });
15671
15688
  }
15672
15689
  });
@@ -15689,6 +15706,27 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15689
15706
  const element = elementSelection.value[0];
15690
15707
  return elementSelection.value.length === 1 && !isLock(element) && element.foreground.isValid();
15691
15708
  });
15709
+ function onStart() {
15710
+ const ctx = {};
15711
+ elementSelection.value.forEach((el) => {
15712
+ ctx[el.instanceId] = {
15713
+ parent: el.getParent(),
15714
+ index: el.getIndex()
15715
+ };
15716
+ });
15717
+ startContext.value = ctx;
15718
+ }
15719
+ function onMove() {
15720
+ if (!state.value) {
15721
+ state.value = "transforming";
15722
+ }
15723
+ }
15724
+ function onEnd() {
15725
+ if (state.value === "transforming") {
15726
+ state.value = void 0;
15727
+ }
15728
+ startContext.value = {};
15729
+ }
15692
15730
  function tipFormat() {
15693
15731
  const obb = elementSelection.value.length === 1 ? elementSelection.value[0].style : selectionObb.value;
15694
15732
  return `${Number(obb.width.toFixed(2))} × ${Number(obb.height.toFixed(2))}`;
@@ -15740,8 +15778,9 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15740
15778
  class: "mce-selector__transform",
15741
15779
  "border-style": unref(elementSelection).length > 1 ? "dashed" : "solid",
15742
15780
  "tip-format": tipFormat,
15743
- onMove: _cache[1] || (_cache[1] = () => !unref(state) && (state.value = "transforming")),
15744
- onEnd: _cache[2] || (_cache[2] = () => unref(state) === "transforming" && (state.value = void 0))
15781
+ onStart,
15782
+ onMove,
15783
+ onEnd
15745
15784
  }, createSlots({ _: 2 }, [
15746
15785
  _ctx.$slots.transformable ? {
15747
15786
  name: "svg",
@@ -16071,7 +16110,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16071
16110
  const {
16072
16111
  pluginsComponents,
16073
16112
  isElement,
16074
- isTopLevelFrame,
16113
+ isTopFrame,
16075
16114
  config,
16076
16115
  drawboardDom,
16077
16116
  renderEngine,
@@ -16131,7 +16170,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16131
16170
  function onHover(event) {
16132
16171
  let cursor;
16133
16172
  let hovered;
16134
- if (elementSelection.value.length > 1 && selectionAabbInDrawboard.value.containsPoint({
16173
+ if (elementSelection.value.length > 1 && selectionAabbInDrawboard.value.contains({
16135
16174
  x: event.clientX,
16136
16175
  y: event.clientY
16137
16176
  })) {
@@ -16150,7 +16189,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16150
16189
  hovered = result;
16151
16190
  }
16152
16191
  }
16153
- if (!(isElement(hovered) && !isLock(hovered) && !hovered.findAncestor((ancestor) => isLock(ancestor)) && !isTopLevelFrame(hovered))) {
16192
+ if (!(isElement(hovered) && !isLock(hovered) && !hovered.findAncestor((ancestor) => isLock(ancestor)) && !isTopFrame(hovered))) {
16154
16193
  hovered = void 0;
16155
16194
  cursor = void 0;
16156
16195
  }
@@ -16165,7 +16204,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16165
16204
  allowRootFrame = false
16166
16205
  } = options;
16167
16206
  function isIncluded(node) {
16168
- return isElement(node) && !isLock(node) && (allowRootFrame || !isTopLevelFrame(node)) && !node.findAncestor((ancestor) => isLock(ancestor));
16207
+ return isElement(node) && !isLock(node) && (allowRootFrame || !isTopFrame(node)) && !node.findAncestor((ancestor) => isLock(ancestor));
16169
16208
  }
16170
16209
  const drawing = state.value === "drawing";
16171
16210
  const hand = state.value === "hand";
@@ -16178,7 +16217,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16178
16217
  let isUp = false;
16179
16218
  let selected = [];
16180
16219
  let ctxState;
16181
- const inSelection = selectionAabbInDrawboard.value.containsPoint({
16220
+ const inSelection = selectionAabbInDrawboard.value.contains({
16182
16221
  x: start.x - drawboardAabb.value.left,
16183
16222
  y: start.y - drawboardAabb.value.top
16184
16223
  });
@@ -16364,8 +16403,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16364
16403
  }
16365
16404
  onHover(event);
16366
16405
  }
16367
- function onPointerover() {
16368
- drawboardPointer.value = void 0;
16406
+ function onPointerover(event) {
16407
+ if (event.srcElement !== drawboardDom.value) {
16408
+ return;
16409
+ }
16369
16410
  hoverElement.value = void 0;
16370
16411
  }
16371
16412
  function onScroll() {
@@ -16612,6 +16653,7 @@ export {
16612
16653
  makeMceOverlayProps,
16613
16654
  makeMceStrategyProps,
16614
16655
  mixins,
16656
+ noop,
16615
16657
  plugins,
16616
16658
  propsFactory,
16617
16659
  provideOverlay,