@tldraw/editor 5.5.0-canary.f35842e3ba7e → 5.5.0-canary.f54aa36cb385
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 +9 -3
- 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 +9 -3
- 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 +23 -4
- package/src/version.ts +3 -3
package/dist-cjs/index.js
CHANGED
|
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
|
|
|
392
392
|
var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
|
|
393
393
|
(0, import_utils.registerTldrawLibraryVersion)(
|
|
394
394
|
"@tldraw/editor",
|
|
395
|
-
"5.5.0-canary.
|
|
395
|
+
"5.5.0-canary.f54aa36cb385",
|
|
396
396
|
"cjs"
|
|
397
397
|
);
|
|
398
398
|
//# sourceMappingURL=index.js.map
|
|
@@ -1593,7 +1593,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
const ids = this.getSortedChildIdsForParent(parentToSelectWithinId);
|
|
1595
1595
|
if (ids.length <= 0) return this;
|
|
1596
|
-
this.setSelectedShapes(this.
|
|
1596
|
+
this.setSelectedShapes(ids.filter((id) => !this.getShape(id)?.isLocked));
|
|
1597
1597
|
return this;
|
|
1598
1598
|
}
|
|
1599
1599
|
/**
|
|
@@ -6311,12 +6311,17 @@ class Editor extends import_eventemitter3.default {
|
|
|
6311
6311
|
let remaining = duration;
|
|
6312
6312
|
let t;
|
|
6313
6313
|
const animations = [];
|
|
6314
|
+
const ignoreShapeLock = this._shouldIgnoreShapeLock;
|
|
6314
6315
|
let partial, result;
|
|
6315
6316
|
for (let i = 0, n = partials.length; i < n; i++) {
|
|
6316
6317
|
partial = partials[i];
|
|
6317
6318
|
if (!partial) continue;
|
|
6318
6319
|
const shape = this.getShape(partial.id);
|
|
6319
6320
|
if (!shape) continue;
|
|
6321
|
+
const unlocks = shape.isLocked && Object.hasOwn(partial, "isLocked") && !partial.isLocked;
|
|
6322
|
+
if (!ignoreShapeLock && !unlocks && this.isShapeOrAncestorLocked(shape)) {
|
|
6323
|
+
continue;
|
|
6324
|
+
}
|
|
6320
6325
|
result = {
|
|
6321
6326
|
start: (0, import_utils.structuredClone)(shape),
|
|
6322
6327
|
end: applyPartialToRecordWithProps((0, import_utils.structuredClone)(shape), partial)
|
|
@@ -6332,7 +6337,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
6332
6337
|
(p) => p && animatingShapes2.get(p.id) === animationId
|
|
6333
6338
|
);
|
|
6334
6339
|
if (partialsToUpdate.length) {
|
|
6335
|
-
this.updateShapes(partialsToUpdate);
|
|
6340
|
+
this.run(() => this.updateShapes(partialsToUpdate), { ignoreShapeLock });
|
|
6336
6341
|
}
|
|
6337
6342
|
this.off("tick", handleTick);
|
|
6338
6343
|
return;
|
|
@@ -6372,6 +6377,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
6372
6377
|
(id) => this.getShape(id)
|
|
6373
6378
|
)
|
|
6374
6379
|
);
|
|
6380
|
+
if (shapesToGroup.length <= 1) return this;
|
|
6375
6381
|
const sortedShapeIds = shapesToGroup.sort(import_utils.sortByIndex).map((s) => s.id);
|
|
6376
6382
|
const childBounds = (0, import_utils.compact)(shapesToGroup.map((shape) => this.getShapePageBounds(shape)));
|
|
6377
6383
|
const pageBounds = import_Box.Box.Common(childBounds);
|
|
@@ -6521,7 +6527,7 @@ class Editor extends import_eventemitter3.default {
|
|
|
6521
6527
|
}
|
|
6522
6528
|
/** @internal */
|
|
6523
6529
|
_getUnlockedShapeIds(ids) {
|
|
6524
|
-
return ids.filter((id) => !this.
|
|
6530
|
+
return ids.filter((id) => !this.isShapeOrAncestorLocked(id));
|
|
6525
6531
|
}
|
|
6526
6532
|
deleteShapes(_ids) {
|
|
6527
6533
|
if (this.getIsReadonly()) return this;
|