mce 0.15.23 → 0.15.24

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
@@ -5287,8 +5287,9 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
5287
5287
  const cloend = renderEngine.value.input._clonePointerEvent(event);
5288
5288
  cloend.srcElement = drawboardDom.value;
5289
5289
  cloend.target = frame.value;
5290
+ cloend.__FORM__ = event.target;
5290
5291
  exec("startPointerdown", cloend, {
5291
- allowRootFrame: true
5292
+ allowTopFrame: true
5292
5293
  });
5293
5294
  }
5294
5295
  }
@@ -15557,8 +15558,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15557
15558
  } = useEditor();
15558
15559
  const transformable = useTemplateRef("transformableTpl");
15559
15560
  const startContext = ref({});
15561
+ const currentEvent = ref();
15560
15562
  onBeforeMount(() => {
15561
- registerCommand({ command: "startTransform", handle: (e) => Boolean(transformable.value?.start(e)) });
15563
+ registerCommand({
15564
+ command: "startTransform",
15565
+ handle: (event) => {
15566
+ currentEvent.value = event;
15567
+ Boolean(transformable.value?.start(event));
15568
+ }
15569
+ });
15562
15570
  });
15563
15571
  onBeforeUnmount(() => {
15564
15572
  unregisterCommand("startTransform");
@@ -15689,13 +15697,15 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
15689
15697
  }
15690
15698
  return false;
15691
15699
  });
15692
- handleDragOutReparent(
15693
- element,
15694
- {
15695
- ...startContext.value[element.instanceId],
15696
- pointer: getGlobalPointer()
15697
- }
15698
- );
15700
+ if (handle === "move" && !currentEvent.value?.__FORM__) {
15701
+ handleDragOutReparent(
15702
+ element,
15703
+ {
15704
+ ...startContext.value[element.instanceId],
15705
+ pointer: getGlobalPointer()
15706
+ }
15707
+ );
15708
+ }
15699
15709
  });
15700
15710
  }
15701
15711
  });
@@ -16213,10 +16223,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
16213
16223
  return;
16214
16224
  }
16215
16225
  const {
16216
- allowRootFrame = false
16226
+ allowTopFrame = false
16217
16227
  } = options;
16218
16228
  function isIncluded(node) {
16219
- return isElement(node) && !isLock(node) && (allowRootFrame || !isTopFrame(node)) && !node.findAncestor((ancestor) => isLock(ancestor));
16229
+ return isElement(node) && !isLock(node) && (allowTopFrame || !isTopFrame(node)) && !node.findAncestor((ancestor) => isLock(ancestor));
16220
16230
  }
16221
16231
  const drawing = state.value === "drawing";
16222
16232
  const hand = state.value === "hand";
@@ -3,7 +3,7 @@ import type { AxisAlignedBoundingBox } from '../types';
3
3
  declare global {
4
4
  namespace Mce {
5
5
  interface StartPointerdownOptions {
6
- allowRootFrame?: boolean;
6
+ allowTopFrame?: boolean;
7
7
  }
8
8
  interface Commands {
9
9
  startPointerdown: (e: PointerInputEvent, options?: StartPointerdownOptions) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mce",
3
3
  "type": "module",
4
- "version": "0.15.23",
4
+ "version": "0.15.24",
5
5
  "description": "The headless canvas editor framework. only the ESM.",
6
6
  "author": "wxm",
7
7
  "license": "MIT",