@tldraw/editor 4.3.0-canary.c7096a59bf3b → 4.3.0-canary.cf5673a789a1
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-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +19 -0
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +19 -0
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +24 -0
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -370,7 +370,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
370
370
|
var import_window_open = require("./lib/utils/window-open");
|
|
371
371
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
372
372
|
"@tldraw/editor",
|
|
373
|
-
"4.3.0-canary.
|
|
373
|
+
"4.3.0-canary.cf5673a789a1",
|
|
374
374
|
"cjs"
|
|
375
375
|
);
|
|
376
376
|
//# sourceMappingURL=index.js.map
|
|
@@ -6655,6 +6655,25 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
6655
6655
|
}
|
|
6656
6656
|
}
|
|
6657
6657
|
}
|
|
6658
|
+
if (point) {
|
|
6659
|
+
const shapesById = new Map(shapes.map((shape) => [shape.id, shape]));
|
|
6660
|
+
const rootShapesFromContent = (0, import_utils.compact)(rootShapeIds.map((id) => shapesById.get(id)));
|
|
6661
|
+
if (rootShapesFromContent.length > 0) {
|
|
6662
|
+
const targetParent = this.getShapeAtPoint(point, {
|
|
6663
|
+
hitInside: true,
|
|
6664
|
+
hitFrameInside: true,
|
|
6665
|
+
hitLocked: true,
|
|
6666
|
+
filter: (shape) => {
|
|
6667
|
+
const util = this.getShapeUtil(shape);
|
|
6668
|
+
if (!util.canReceiveNewChildrenOfType) return false;
|
|
6669
|
+
return rootShapesFromContent.every(
|
|
6670
|
+
(rootShape) => util.canReceiveNewChildrenOfType(shape, rootShape.type)
|
|
6671
|
+
);
|
|
6672
|
+
}
|
|
6673
|
+
});
|
|
6674
|
+
pasteParentId = targetParent ? targetParent.id : currentPageId;
|
|
6675
|
+
}
|
|
6676
|
+
}
|
|
6658
6677
|
let isDuplicating = false;
|
|
6659
6678
|
if (!(0, import_tlschema.isPageId)(pasteParentId)) {
|
|
6660
6679
|
const parent = this.getShape(pasteParentId);
|