@tldraw/editor 3.15.0-canary.14c6b9d1aa1e → 3.15.0-canary.1fc6c3fa6d1c
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 -4
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +2 -20
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.js +101 -96
- package/dist-cjs/lib/editor/managers/TextManager/TextManager.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 -4
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +2 -20
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/TextManager/TextManager.mjs +101 -96
- package/dist-esm/lib/editor/managers/TextManager/TextManager.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 +0 -407
- package/src/lib/editor/Editor.ts +4 -29
- package/src/lib/editor/managers/TextManager/TextManager.ts +128 -108
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -1553,9 +1553,7 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
1553
1553
|
*/
|
|
1554
1554
|
deselect(...shapes: TLShape[] | TLShapeId[]): this;
|
|
1555
1555
|
/**
|
|
1556
|
-
* Select all
|
|
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.
|
|
1556
|
+
* Select all direct children of the current page.
|
|
1559
1557
|
*
|
|
1560
1558
|
* @example
|
|
1561
1559
|
* ```ts
|
|
@@ -5797,9 +5795,10 @@ export declare const TAB_ID: string;
|
|
|
5797
5795
|
export declare class TextManager {
|
|
5798
5796
|
editor: Editor;
|
|
5799
5797
|
private elm;
|
|
5798
|
+
private defaultStyles;
|
|
5800
5799
|
constructor(editor: Editor);
|
|
5801
|
-
private setElementStyles;
|
|
5802
5800
|
dispose(): void;
|
|
5801
|
+
private resetElmStyles;
|
|
5803
5802
|
measureText(textToMeasure: string, opts: TLMeasureTextOpts): BoxModel & {
|
|
5804
5803
|
scrollWidth: number;
|
|
5805
5804
|
};
|
package/dist-cjs/index.js
CHANGED
|
@@ -1432,9 +1432,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
1432
1432
|
return this;
|
|
1433
1433
|
}
|
|
1434
1434
|
/**
|
|
1435
|
-
* Select all
|
|
1436
|
-
* select all shapes within that parent. If the user has not selected any shapes,
|
|
1437
|
-
* or if the shapes shapes are only on select all shapes on the current page.
|
|
1435
|
+
* Select all direct children of the current page.
|
|
1438
1436
|
*
|
|
1439
1437
|
* @example
|
|
1440
1438
|
* ```ts
|
|
@@ -1444,23 +1442,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
1444
1442
|
* @public
|
|
1445
1443
|
*/
|
|
1446
1444
|
selectAll() {
|
|
1447
|
-
|
|
1448
|
-
const selectedShapeIds = this.getSelectedShapeIds();
|
|
1449
|
-
if (selectedShapeIds.length > 0) {
|
|
1450
|
-
for (const id of selectedShapeIds) {
|
|
1451
|
-
const shape = this.getShape(id);
|
|
1452
|
-
if (!shape) continue;
|
|
1453
|
-
if (parentToSelectWithinId === null) {
|
|
1454
|
-
parentToSelectWithinId = shape.parentId;
|
|
1455
|
-
} else if (parentToSelectWithinId !== shape.parentId) {
|
|
1456
|
-
return this;
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
if (!parentToSelectWithinId) {
|
|
1461
|
-
parentToSelectWithinId = this.getCurrentPageId();
|
|
1462
|
-
}
|
|
1463
|
-
const ids = this.getSortedChildIdsForParent(parentToSelectWithinId);
|
|
1445
|
+
const ids = this.getSortedChildIdsForParent(this.getCurrentPageId());
|
|
1464
1446
|
if (ids.length <= 0) return this;
|
|
1465
1447
|
this.setSelectedShapes(this._getUnlockedShapeIds(ids));
|
|
1466
1448
|
return this;
|