@tldraw/editor 3.8.0-canary.ab782583b3ba → 3.8.0-canary.ac399b94f9c0
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 -59
- package/dist-cjs/index.js +1 -3
- package/dist-cjs/index.js.map +2 -2
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js +1 -1
- package/dist-cjs/lib/components/default-components/DefaultCanvas.js.map +2 -2
- package/dist-cjs/lib/editor/Editor.js +14 -24
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/lib/editor/shapes/ShapeUtil.js.map +2 -2
- package/dist-cjs/lib/options.js +1 -2
- package/dist-cjs/lib/options.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 -59
- package/dist-esm/index.mjs +1 -3
- package/dist-esm/index.mjs.map +2 -2
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs +1 -1
- package/dist-esm/lib/components/default-components/DefaultCanvas.mjs.map +2 -2
- package/dist-esm/lib/editor/Editor.mjs +14 -24
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/lib/editor/shapes/ShapeUtil.mjs.map +2 -2
- package/dist-esm/lib/options.mjs +1 -2
- package/dist-esm/lib/options.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/editor.css +1 -2
- package/package.json +7 -7
- package/src/index.ts +0 -2
- package/src/lib/components/default-components/DefaultCanvas.tsx +1 -1
- package/src/lib/editor/Editor.ts +14 -41
- package/src/lib/editor/shapes/ShapeUtil.ts +1 -30
- package/src/lib/options.ts +0 -6
- package/src/version.ts +3 -3
- package/dist-cjs/lib/editor/shapes/shared/resizeScaled.js +0 -66
- package/dist-cjs/lib/editor/shapes/shared/resizeScaled.js.map +0 -7
- package/dist-esm/lib/editor/shapes/shared/resizeScaled.mjs +0 -46
- package/dist-esm/lib/editor/shapes/shared/resizeScaled.mjs.map +0 -7
- package/src/lib/editor/shapes/shared/resizeScaled.ts +0 -61
|
@@ -839,10 +839,6 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
839
839
|
assert(shapeUtil, `No shape util found for type "${type}"`);
|
|
840
840
|
return shapeUtil;
|
|
841
841
|
}
|
|
842
|
-
hasShapeUtil(arg) {
|
|
843
|
-
const type = typeof arg === "string" ? arg : arg.type;
|
|
844
|
-
return hasOwnProperty(this.shapeUtils, type);
|
|
845
|
-
}
|
|
846
842
|
getBindingUtil(arg) {
|
|
847
843
|
const type = typeof arg === "string" ? arg : arg.type;
|
|
848
844
|
const bindingUtil = getOwnProperty(this.bindingUtils, type);
|
|
@@ -5124,7 +5120,6 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
5124
5120
|
scale = new Vec(Math.sign(scale.x) * Math.abs(scale.y), scale.y);
|
|
5125
5121
|
}
|
|
5126
5122
|
}
|
|
5127
|
-
let didResize = false;
|
|
5128
5123
|
if (util.onResize && util.canResize(initialShape)) {
|
|
5129
5124
|
const newPagePoint = this._scalePagePoint(
|
|
5130
5125
|
Mat.applyToPoint(pageTransform, new Vec(0, 0)),
|
|
@@ -5149,28 +5144,24 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
5149
5144
|
util.onResizeStart?.(initialShape) ?? void 0
|
|
5150
5145
|
);
|
|
5151
5146
|
}
|
|
5152
|
-
const resizedShape = util.onResize(
|
|
5153
|
-
{ ...initialShape, x, y },
|
|
5154
|
-
{
|
|
5155
|
-
newPoint: newLocalPoint,
|
|
5156
|
-
handle: opts.dragHandle ?? "bottom_right",
|
|
5157
|
-
// don't set isSingle to true for children
|
|
5158
|
-
mode: opts.mode ?? "scale_shape",
|
|
5159
|
-
scaleX: myScale.x,
|
|
5160
|
-
scaleY: myScale.y,
|
|
5161
|
-
initialBounds,
|
|
5162
|
-
initialShape
|
|
5163
|
-
}
|
|
5164
|
-
);
|
|
5165
|
-
if (resizedShape) {
|
|
5166
|
-
didResize = true;
|
|
5167
|
-
}
|
|
5168
5147
|
workingShape = applyPartialToRecordWithProps(workingShape, {
|
|
5169
5148
|
id,
|
|
5170
5149
|
type: initialShape.type,
|
|
5171
5150
|
x: newLocalPoint.x,
|
|
5172
5151
|
y: newLocalPoint.y,
|
|
5173
|
-
...
|
|
5152
|
+
...util.onResize(
|
|
5153
|
+
{ ...initialShape, x, y },
|
|
5154
|
+
{
|
|
5155
|
+
newPoint: newLocalPoint,
|
|
5156
|
+
handle: opts.dragHandle ?? "bottom_right",
|
|
5157
|
+
// don't set isSingle to true for children
|
|
5158
|
+
mode: opts.mode ?? "scale_shape",
|
|
5159
|
+
scaleX: myScale.x,
|
|
5160
|
+
scaleY: myScale.y,
|
|
5161
|
+
initialBounds,
|
|
5162
|
+
initialShape
|
|
5163
|
+
}
|
|
5164
|
+
)
|
|
5174
5165
|
});
|
|
5175
5166
|
if (!opts.skipStartAndEndCallbacks) {
|
|
5176
5167
|
workingShape = applyPartialToRecordWithProps(
|
|
@@ -5179,8 +5170,7 @@ class Editor extends (_a = EventEmitter, _getIsShapeHiddenCache_dec = [computed]
|
|
|
5179
5170
|
);
|
|
5180
5171
|
}
|
|
5181
5172
|
this.updateShapes([workingShape]);
|
|
5182
|
-
}
|
|
5183
|
-
if (!didResize) {
|
|
5173
|
+
} else {
|
|
5184
5174
|
const initialPageCenter = Mat.applyToPoint(pageTransform, initialBounds.center);
|
|
5185
5175
|
const newPageCenter = this._scalePagePoint(
|
|
5186
5176
|
initialPageCenter,
|