@tldraw/editor 3.14.0-canary.ae1762886f91 → 3.14.0-canary.b8c5ab05b06a

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.
@@ -2460,23 +2460,6 @@ export declare class Editor extends EventEmitter<TLEventMap> {
2460
2460
  * @public
2461
2461
  */
2462
2462
  getShapeGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2463
- private _shapePageGeometryCaches;
2464
- /**
2465
- * Get the geometry of a shape in page-space.
2466
- *
2467
- * @example
2468
- * ```ts
2469
- * editor.getShapePageGeometry(myShape)
2470
- * editor.getShapePageGeometry(myShapeId)
2471
- * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
2472
- * ```
2473
- *
2474
- * @param shape - The shape (or shape id) to get the geometry for.
2475
- * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
2476
- *
2477
- * @public
2478
- */
2479
- getShapePageGeometry<T extends Geometry2d>(shape: TLShape | TLShapeId, opts?: TLGeometryOpts): T;
2480
2463
  /* Excluded from this release type: _getShapeHandlesCache */
2481
2464
  /**
2482
2465
  * Get the handles (if any) for a shape.
package/dist-cjs/index.js CHANGED
@@ -363,7 +363,7 @@ function debugEnableLicensing() {
363
363
  }
364
364
  (0, import_utils.registerTldrawLibraryVersion)(
365
365
  "@tldraw/editor",
366
- "3.14.0-canary.ae1762886f91",
366
+ "3.14.0-canary.b8c5ab05b06a",
367
367
  "cjs"
368
368
  );
369
369
  //# sourceMappingURL=index.js.map
@@ -302,7 +302,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
302
302
  __publicField(this, "_currentPageShapeIds");
303
303
  /* --------------------- Shapes --------------------- */
304
304
  __publicField(this, "_shapeGeometryCaches", {});
305
- __publicField(this, "_shapePageGeometryCaches", {});
306
305
  // Parents and children
307
306
  /**
308
307
  * A cache of parents to children.
@@ -3495,41 +3494,6 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
3495
3494
  typeof shape === "string" ? shape : shape.id
3496
3495
  );
3497
3496
  }
3498
- /**
3499
- * Get the geometry of a shape in page-space.
3500
- *
3501
- * @example
3502
- * ```ts
3503
- * editor.getShapePageGeometry(myShape)
3504
- * editor.getShapePageGeometry(myShapeId)
3505
- * editor.getShapePageGeometry(myShapeId, { context: "arrow" })
3506
- * ```
3507
- *
3508
- * @param shape - The shape (or shape id) to get the geometry for.
3509
- * @param opts - Additional options about the request for geometry. Passed to {@link ShapeUtil.getGeometry}.
3510
- *
3511
- * @public
3512
- */
3513
- getShapePageGeometry(shape, opts) {
3514
- const context = opts?.context ?? "none";
3515
- if (!this._shapePageGeometryCaches[context]) {
3516
- this._shapePageGeometryCaches[context] = this.store.createComputedCache(
3517
- "bounds",
3518
- (shape2) => {
3519
- const geometry = this.getShapeGeometry(shape2.id, opts);
3520
- const pageTransform = this.getShapePageTransform(shape2.id);
3521
- return geometry.transform(pageTransform);
3522
- },
3523
- {
3524
- // we only depend directly on the shape id, and changing geometry/transform will update us anyway
3525
- areRecordsEqual: () => true
3526
- }
3527
- );
3528
- }
3529
- return this._shapePageGeometryCaches[context].get(
3530
- typeof shape === "string" ? shape : shape.id
3531
- );
3532
- }
3533
3497
  _getShapeHandlesCache() {
3534
3498
  return this.store.createComputedCache(
3535
3499
  "handles",
@@ -3623,7 +3587,10 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
3623
3587
  }
3624
3588
  _getShapePageBoundsCache() {
3625
3589
  return this.store.createComputedCache("pageBoundsCache", (shape) => {
3626
- return this.getShapePageGeometry(shape).bounds;
3590
+ const pageTransform = this.getShapePageTransform(shape);
3591
+ if (!pageTransform) return void 0;
3592
+ const geometry = this.getShapeGeometry(shape);
3593
+ return import_Box.Box.FromPoints(pageTransform.applyToPoints(geometry.vertices));
3627
3594
  });
3628
3595
  }
3629
3596
  /**
@@ -3680,12 +3647,11 @@ class Editor extends (_a = import_eventemitter3.default, _getIsShapeHiddenCache_
3680
3647
  (shape2) => this.isShapeOfType(shape2, "frame")
3681
3648
  );
3682
3649
  if (frameAncestors.length === 0) return void 0;
3683
- const pageMask = frameAncestors.map(
3684
- (s) => (
3685
- // Apply the frame transform to the frame outline to get the frame outline in the current page space
3686
- this.getShapePageGeometry(s.id).vertices
3687
- )
3688
- ).reduce((acc, b) => {
3650
+ const pageMask = frameAncestors.map((s) => {
3651
+ const geometry = this.getShapeGeometry(s.id);
3652
+ const pageTransform = this.getShapePageTransform(s.id);
3653
+ return pageTransform.applyToPoints(geometry.vertices);
3654
+ }).reduce((acc, b) => {
3689
3655
  if (!(b && acc)) return void 0;
3690
3656
  const intersection = (0, import_intersect.intersectPolygonPolygon)(acc, b);
3691
3657
  if (intersection) {