@tldraw/editor 3.15.0-canary.0f6bd23d7755 → 3.15.0-canary.14c6b9d1aa1e
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.d.ts +3 -1
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +20 -2
- 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.d.mts +3 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +20 -2
- 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.test.ts +407 -0
- package/src/lib/editor/Editor.ts +29 -4
- package/src/version.ts +3 -3
package/dist-cjs/version.js
CHANGED
|
@@ -22,10 +22,10 @@ __export(version_exports, {
|
|
|
22
22
|
version: () => version
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(version_exports);
|
|
25
|
-
const version = "3.15.0-canary.
|
|
25
|
+
const version = "3.15.0-canary.14c6b9d1aa1e";
|
|
26
26
|
const publishDates = {
|
|
27
27
|
major: "2024-09-13T14:36:29.063Z",
|
|
28
|
-
minor: "2025-07-
|
|
29
|
-
patch: "2025-07-
|
|
28
|
+
minor: "2025-07-10T10:11:22.062Z",
|
|
29
|
+
patch: "2025-07-10T10:11:22.062Z"
|
|
30
30
|
};
|
|
31
31
|
//# sourceMappingURL=version.js.map
|
package/dist-cjs/version.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/version.ts"],
|
|
4
|
-
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.15.0-canary.
|
|
4
|
+
"sourcesContent": ["// This file is automatically generated by internal/scripts/refresh-assets.ts.\n// Do not edit manually. Or do, I'm a comment, not a cop.\n\nexport const version = '3.15.0-canary.14c6b9d1aa1e'\nexport const publishDates = {\n\tmajor: '2024-09-13T14:36:29.063Z',\n\tminor: '2025-07-10T10:11:22.062Z',\n\tpatch: '2025-07-10T10:11:22.062Z',\n}\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGO,MAAM,UAAU;AAChB,MAAM,eAAe;AAAA,EAC3B,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AACR;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist-esm/index.d.mts
CHANGED
|
@@ -1553,7 +1553,9 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1553
1553
|
*/
|
|
1554
1554
|
deselect(...shapes: TLShape[] | TLShapeId[]): this;
|
|
1555
1555
|
/**
|
|
1556
|
-
* Select all
|
|
1556
|
+
* Select all shapes. If the user has selected shapes that share a parent,
|
|
1557
|
+
* select all shapes within that parent. If the user has not selected any shapes,
|
|
1558
|
+
* or if the shapes shapes are only on select all shapes on the current page.
|
|
1557
1559
|
*
|
|
1558
1560
|
* @example
|
|
1559
1561
|
* ```ts
|
package/dist-esm/index.mjs
CHANGED
|
@@ -1466,7 +1466,9 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
1466
1466
|
return this;
|
|
1467
1467
|
}
|
|
1468
1468
|
/**
|
|
1469
|
-
* Select all
|
|
1469
|
+
* Select all shapes. If the user has selected shapes that share a parent,
|
|
1470
|
+
* select all shapes within that parent. If the user has not selected any shapes,
|
|
1471
|
+
* or if the shapes shapes are only on select all shapes on the current page.
|
|
1470
1472
|
*
|
|
1471
1473
|
* @example
|
|
1472
1474
|
* ```ts
|
|
@@ -1476,7 +1478,23 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
1476
1478
|
* @public
|
|
1477
1479
|
*/
|
|
1478
1480
|
selectAll() {
|
|
1479
|
-
|
|
1481
|
+
let parentToSelectWithinId = null;
|
|
1482
|
+
const selectedShapeIds = this.getSelectedShapeIds();
|
|
1483
|
+
if (selectedShapeIds.length > 0) {
|
|
1484
|
+
for (const id of selectedShapeIds) {
|
|
1485
|
+
const shape = this.getShape(id);
|
|
1486
|
+
if (!shape) continue;
|
|
1487
|
+
if (parentToSelectWithinId === null) {
|
|
1488
|
+
parentToSelectWithinId = shape.parentId;
|
|
1489
|
+
} else if (parentToSelectWithinId !== shape.parentId) {
|
|
1490
|
+
return this;
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
if (!parentToSelectWithinId) {
|
|
1495
|
+
parentToSelectWithinId = this.getCurrentPageId();
|
|
1496
|
+
}
|
|
1497
|
+
const ids = this.getSortedChildIdsForParent(parentToSelectWithinId);
|
|
1480
1498
|
if (ids.length <= 0) return this;
|
|
1481
1499
|
this.setSelectedShapes(this._getUnlockedShapeIds(ids));
|
|
1482
1500
|
return this;
|