@tldraw/editor 4.1.0-next.0df13eab91e1 → 4.1.0-next.2c81540f049b
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 +16 -1
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +4 -2
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js +67 -2
- package/dist-cjs/lib/editor/managers/SnapManager/HandleSnaps.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/license/Watermark.js +4 -4
- package/dist-cjs/lib/license/Watermark.js.map +1 -1
- package/dist-cjs/lib/primitives/geometry/Geometry2d.js +5 -0
- package/dist-cjs/lib/primitives/geometry/Geometry2d.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 +16 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +5 -2
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs +67 -2
- package/dist-esm/lib/editor/managers/SnapManager/HandleSnaps.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/license/Watermark.mjs +4 -4
- package/dist-esm/lib/license/Watermark.mjs.map +1 -1
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs +5 -0
- package/dist-esm/lib/primitives/geometry/Geometry2d.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +7 -2
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +5 -2
- package/src/lib/editor/managers/SnapManager/HandleSnaps.ts +91 -4
- package/src/lib/editor/shapes/ShapeUtil.ts +10 -0
- package/src/lib/license/Watermark.tsx +4 -4
- package/src/lib/primitives/geometry/Geometry2d.ts +6 -0
- package/src/version.ts +3 -3
package/dist-esm/index.mjs
CHANGED
|
@@ -301,7 +301,7 @@ import { uniq } from "./lib/utils/uniq.mjs";
|
|
|
301
301
|
import { openWindow } from "./lib/utils/window-open.mjs";
|
|
302
302
|
registerTldrawLibraryVersion(
|
|
303
303
|
"@tldraw/editor",
|
|
304
|
-
"4.1.0-next.
|
|
304
|
+
"4.1.0-next.2c81540f049b",
|
|
305
305
|
"esm"
|
|
306
306
|
);
|
|
307
307
|
export {
|
|
@@ -75,6 +75,7 @@ import {
|
|
|
75
75
|
FileHelpers,
|
|
76
76
|
PerformanceTracker,
|
|
77
77
|
Result,
|
|
78
|
+
ZERO_INDEX_KEY,
|
|
78
79
|
annotateError,
|
|
79
80
|
assert,
|
|
80
81
|
assertExists,
|
|
@@ -1601,7 +1602,9 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
1601
1602
|
return selectedShapes.length === 1 ? selectedShapes[0] : null;
|
|
1602
1603
|
}
|
|
1603
1604
|
/**
|
|
1604
|
-
*
|
|
1605
|
+
* Get the page bounds of all the provided shapes.
|
|
1606
|
+
*
|
|
1607
|
+
* @public
|
|
1605
1608
|
*/
|
|
1606
1609
|
getShapesPageBounds(shapeIds) {
|
|
1607
1610
|
const bounds = compact(shapeIds.map((id) => this.getShapePageBounds(id)));
|
|
@@ -4265,7 +4268,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
4265
4268
|
const parentId = typeof parent === "string" ? parent : parent.id;
|
|
4266
4269
|
const children = this._parentIdsToChildIds.get()[parentId];
|
|
4267
4270
|
if (!children || children.length === 0) {
|
|
4268
|
-
return
|
|
4271
|
+
return getIndexAbove(ZERO_INDEX_KEY);
|
|
4269
4272
|
}
|
|
4270
4273
|
const shape = this.getShape(children[children.length - 1]);
|
|
4271
4274
|
return getIndexAbove(shape.index);
|