@tldraw/editor 3.13.0-canary.2928a5d81c67 → 3.13.0-canary.2c1fb1ac1f1a

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.
@@ -5438,14 +5438,7 @@ export declare abstract class ShapeUtil<Shape extends TLUnknownShape = TLUnknown
5438
5438
  */
5439
5439
  onClick?(shape: Shape): TLShapePartial<Shape> | void;
5440
5440
  /**
5441
- * A callback called when a shape starts being edited.
5442
- *
5443
- * @param shape - The shape.
5444
- * @public
5445
- */
5446
- onEditStart?(shape: Shape): void;
5447
- /**
5448
- * A callback called when a shape finishes being edited.
5441
+ * A callback called when a shape finishes being editing.
5449
5442
  *
5450
5443
  * @param shape - The shape.
5451
5444
  * @public
package/dist-cjs/index.js CHANGED
@@ -361,7 +361,7 @@ function debugEnableLicensing() {
361
361
  }
362
362
  (0, import_utils.registerTldrawLibraryVersion)(
363
363
  "@tldraw/editor",
364
- "3.13.0-canary.2928a5d81c67",
364
+ "3.13.0-canary.2c1fb1ac1f1a",
365
365
  "cjs"
366
366
  );
367
367
  //# sourceMappingURL=index.js.map
@@ -424,6 +424,7 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
424
424
  ) : getShapeVisibility;
425
425
  this.options = { ...import_options.defaultTldrawOptions, ...options };
426
426
  this.store = store;
427
+ this.disposables.add(this.store.dispose.bind(this.store));
427
428
  this.history = new import_HistoryManager.HistoryManager({
428
429
  store,
429
430
  annotateError: (error) => {
@@ -835,7 +836,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
835
836
  dispose() {
836
837
  this.disposables.forEach((dispose) => dispose());
837
838
  this.disposables.clear();
838
- this.store.dispose();
839
839
  this.isDisposed = true;
840
840
  }
841
841
  getShapeUtil(arg) {
@@ -1738,21 +1738,13 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
1738
1738
  setEditingShape(shape) {
1739
1739
  const id = typeof shape === "string" ? shape : shape?.id ?? null;
1740
1740
  this.setRichTextEditor(null);
1741
- const prevEditingShapeId = this.getEditingShapeId();
1742
- if (id !== prevEditingShapeId) {
1741
+ if (id !== this.getEditingShapeId()) {
1743
1742
  if (id) {
1744
1743
  const shape2 = this.getShape(id);
1745
1744
  if (shape2 && this.getShapeUtil(shape2).canEdit(shape2)) {
1746
1745
  this.run(
1747
1746
  () => {
1748
1747
  this._updateCurrentPageState({ editingShapeId: id });
1749
- if (prevEditingShapeId) {
1750
- const prevEditingShape = this.getShape(prevEditingShapeId);
1751
- if (prevEditingShape) {
1752
- this.getShapeUtil(prevEditingShape).onEditEnd?.(prevEditingShape);
1753
- }
1754
- }
1755
- this.getShapeUtil(shape2).onEditStart?.(shape2);
1756
1748
  },
1757
1749
  { history: "ignore" }
1758
1750
  );
@@ -1763,12 +1755,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
1763
1755
  () => {
1764
1756
  this._updateCurrentPageState({ editingShapeId: null });
1765
1757
  this._currentRichTextEditor.set(null);
1766
- if (prevEditingShapeId) {
1767
- const prevEditingShape = this.getShape(prevEditingShapeId);
1768
- if (prevEditingShape) {
1769
- this.getShapeUtil(prevEditingShape).onEditEnd?.(prevEditingShape);
1770
- }
1771
- }
1772
1758
  },
1773
1759
  { history: "ignore" }
1774
1760
  );
@@ -7553,10 +7539,12 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
7553
7539
  const { x: cx, y: cy, z: cz } = (0, import_state.unsafe__withoutCapture)(() => this.getCamera());
7554
7540
  if (this.inputs.isPanning && this.inputs.isPointing) {
7555
7541
  const { currentScreenPoint, previousScreenPoint } = this.inputs;
7542
+ const { panSpeed } = cameraOptions;
7556
7543
  const offset = import_Vec.Vec.Sub(currentScreenPoint, previousScreenPoint);
7557
- this.setCamera(new import_Vec.Vec(cx + offset.x / cz, cy + offset.y / cz, cz), {
7558
- immediate: true
7559
- });
7544
+ this.setCamera(
7545
+ new import_Vec.Vec(cx + offset.x * panSpeed / cz, cy + offset.y * panSpeed / cz, cz),
7546
+ { immediate: true }
7547
+ );
7560
7548
  this.maybeTrackPerformance("Panning");
7561
7549
  return;
7562
7550
  }