@tldraw/editor 3.14.0-canary.5ce4e4abc0a3 → 3.14.0-canary.60685c123a1c
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 +0 -16
- package/dist-cjs/index.js +1 -1
- package/dist-cjs/lib/editor/Editor.js +3 -22
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js +1 -3
- package/dist-cjs/lib/editor/managers/HistoryManager/HistoryManager.js.map +2 -2
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js +6 -13
- package/dist-cjs/lib/editor/tools/BaseBoxShapeTool/children/Pointing.js.map +3 -3
- package/dist-cjs/lib/primitives/geometry/Group2d.js +6 -11
- package/dist-cjs/lib/primitives/geometry/Group2d.js.map +2 -2
- package/dist-cjs/lib/utils/dom.js +1 -1
- package/dist-cjs/lib/utils/dom.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 +0 -16
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +3 -22
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs +1 -3
- package/dist-esm/lib/editor/managers/HistoryManager/HistoryManager.mjs.map +2 -2
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs +6 -13
- package/dist-esm/lib/editor/tools/BaseBoxShapeTool/children/Pointing.mjs.map +3 -3
- package/dist-esm/lib/primitives/geometry/Group2d.mjs +6 -11
- package/dist-esm/lib/primitives/geometry/Group2d.mjs.map +2 -2
- package/dist-esm/lib/utils/dom.mjs +1 -1
- package/dist-esm/lib/utils/dom.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +11 -17
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +6 -30
- package/src/lib/editor/managers/HistoryManager/HistoryManager.ts +1 -3
- package/src/lib/editor/tools/BaseBoxShapeTool/children/Pointing.ts +17 -25
- package/src/lib/primitives/geometry/Group2d.ts +5 -11
- package/src/lib/utils/dom.ts +1 -1
- package/src/version.ts +3 -3
package/dist-cjs/index.d.ts
CHANGED
|
@@ -3264,22 +3264,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
|
|
|
3264
3264
|
* @public
|
|
3265
3265
|
*/
|
|
3266
3266
|
getInitialMetaForShape(_shape: TLShape): JsonObject;
|
|
3267
|
-
/**
|
|
3268
|
-
* Get whether the provided shape can be created.
|
|
3269
|
-
*
|
|
3270
|
-
* @param shape - The shape or shape IDs to check.
|
|
3271
|
-
*
|
|
3272
|
-
* @public
|
|
3273
|
-
*/
|
|
3274
|
-
canCreateShape<T extends TLUnknownShape>(shape: OptionalKeys<TLShapePartial<T>, 'id'> | T['id']): boolean;
|
|
3275
|
-
/**
|
|
3276
|
-
* Get whether the provided shapes can be created.
|
|
3277
|
-
*
|
|
3278
|
-
* @param shapes - The shapes or shape IDs to create.
|
|
3279
|
-
*
|
|
3280
|
-
* @public
|
|
3281
|
-
*/
|
|
3282
|
-
canCreateShapes<T extends TLUnknownShape>(shapes: (OptionalKeys<TLShapePartial<T>, 'id'> | T['id'])[]): boolean;
|
|
3283
3267
|
/**
|
|
3284
3268
|
* Create a single shape.
|
|
3285
3269
|
*
|
package/dist-cjs/index.js
CHANGED
|
@@ -2788,7 +2788,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
2788
2788
|
* @public
|
|
2789
2789
|
*/
|
|
2790
2790
|
updateViewportScreenBounds(screenBounds, center = false) {
|
|
2791
|
-
if (
|
|
2791
|
+
if (screenBounds instanceof HTMLElement) {
|
|
2792
2792
|
const rect = screenBounds.getBoundingClientRect();
|
|
2793
2793
|
screenBounds = new import_Box.Box(
|
|
2794
2794
|
rect.left || rect.x,
|
|
@@ -4727,7 +4727,8 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
4727
4727
|
shape.index = index;
|
|
4728
4728
|
});
|
|
4729
4729
|
const shapesToCreate = shapesToCreateWithOriginals.map(({ shape }) => shape);
|
|
4730
|
-
|
|
4730
|
+
const maxShapesReached = shapesToCreate.length + this.getCurrentPageShapeIds().size > this.options.maxShapesPerPage;
|
|
4731
|
+
if (maxShapesReached) {
|
|
4731
4732
|
alertMaxShapes(this);
|
|
4732
4733
|
return;
|
|
4733
4734
|
}
|
|
@@ -5742,26 +5743,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
|
|
|
5742
5743
|
getInitialMetaForShape(_shape) {
|
|
5743
5744
|
return {};
|
|
5744
5745
|
}
|
|
5745
|
-
/**
|
|
5746
|
-
* Get whether the provided shape can be created.
|
|
5747
|
-
*
|
|
5748
|
-
* @param shape - The shape or shape IDs to check.
|
|
5749
|
-
*
|
|
5750
|
-
* @public
|
|
5751
|
-
*/
|
|
5752
|
-
canCreateShape(shape) {
|
|
5753
|
-
return this.canCreateShapes([shape]);
|
|
5754
|
-
}
|
|
5755
|
-
/**
|
|
5756
|
-
* Get whether the provided shapes can be created.
|
|
5757
|
-
*
|
|
5758
|
-
* @param shapes - The shapes or shape IDs to create.
|
|
5759
|
-
*
|
|
5760
|
-
* @public
|
|
5761
|
-
*/
|
|
5762
|
-
canCreateShapes(shapes) {
|
|
5763
|
-
return shapes.length + this.getCurrentPageShapeIds().size <= this.options.maxShapesPerPage;
|
|
5764
|
-
}
|
|
5765
5746
|
/**
|
|
5766
5747
|
* Create a single shape.
|
|
5767
5748
|
*
|