@tldraw/editor 5.7.0-canary.fd4a9d669e63 → 5.7.0-next.0ef3ff64787a

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.
@@ -1977,7 +1977,14 @@ export declare class Editor extends EventEmitter<TLEventMap> {
1977
1977
  * @public
1978
1978
  */
1979
1979
  getCurrentPageShapesInReadingOrder(): TLShape[];
1980
- private _getShapesInReadingOrder;
1980
+ /**
1981
+ * Sort the given shapes into reading order (left-to-right, top-to-bottom), dropping any that
1982
+ * can't be tabbed to. Use this for the children of a frame or group, which
1983
+ * {@link Editor.getCurrentPageShapesInReadingOrder} leaves out.
1984
+ *
1985
+ * @public
1986
+ */
1987
+ getShapesInReadingOrder(shapes: TLShape[]): TLShape[];
1981
1988
  /**
1982
1989
  * Find the nearest adjacent shape in a specific direction.
1983
1990
  *
@@ -5119,6 +5126,7 @@ export declare class GroupShapeUtil extends ShapeUtil<TLGroupShape> {
5119
5126
  static type: 'group';
5120
5127
  static props: RecordProps<TLGroupShape>;
5121
5128
  static migrations: TLPropsMigrations;
5129
+ getShapeName(): string;
5122
5130
  hideSelectionBoundsFg(shape: TLGroupShape): boolean;
5123
5131
  canFlip(): boolean;
5124
5132
  canBind(): boolean;
package/dist-cjs/index.js CHANGED
@@ -398,7 +398,7 @@ var import_uniq = require("./lib/utils/uniq");
398
398
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
399
399
  (0, import_utils.registerTldrawLibraryVersion)(
400
400
  "@tldraw/editor",
401
- "5.7.0-canary.fd4a9d669e63",
401
+ "5.7.0-next.0ef3ff64787a",
402
402
  "cjs"
403
403
  );
404
404
  //# sourceMappingURL=index.js.map
@@ -1627,7 +1627,7 @@ class Editor extends import_eventemitter3.default {
1627
1627
  const filteredShapes = this.getCurrentPageShapes().filter(
1628
1628
  (shape2) => isSelectedWithinContainer ? shape2.parentId === firstParentId : (0, import_tlschema.isPageId)(shape2.parentId)
1629
1629
  );
1630
- const readingOrderShapes = this._getShapesInReadingOrder(filteredShapes);
1630
+ const readingOrderShapes = this.getShapesInReadingOrder(filteredShapes);
1631
1631
  const currentShapeId = selectedShapeIds.length === 1 ? selectedShapeIds[0] : readingOrderShapes.find((shape2) => selectedShapeIds.includes(shape2.id))?.id;
1632
1632
  let adjacentShapeId;
1633
1633
  if (direction === "next" || direction === "prev") {
@@ -1647,9 +1647,16 @@ class Editor extends import_eventemitter3.default {
1647
1647
  }
1648
1648
  getCurrentPageShapesInReadingOrder() {
1649
1649
  const shapes = this.getCurrentPageShapes().filter((shape) => (0, import_tlschema.isPageId)(shape.parentId));
1650
- return this._getShapesInReadingOrder(shapes);
1650
+ return this.getShapesInReadingOrder(shapes);
1651
1651
  }
1652
- _getShapesInReadingOrder(shapes) {
1652
+ /**
1653
+ * Sort the given shapes into reading order (left-to-right, top-to-bottom), dropping any that
1654
+ * can't be tabbed to. Use this for the children of a frame or group, which
1655
+ * {@link Editor.getCurrentPageShapesInReadingOrder} leaves out.
1656
+ *
1657
+ * @public
1658
+ */
1659
+ getShapesInReadingOrder(shapes) {
1653
1660
  const SHALLOW_ANGLE = 20;
1654
1661
  const ROW_THRESHOLD = 100;
1655
1662
  const tabbableShapes = shapes.filter((shape) => this.getShapeUtil(shape).canTabTo(shape));
@@ -1763,7 +1770,7 @@ class Editor extends import_eventemitter3.default {
1763
1770
  const children = (0, import_utils.compact)(
1764
1771
  this.getSortedChildIdsForParent(selectedShape.id).map((id) => this.getShape(id))
1765
1772
  );
1766
- const sortedChildren = this._getShapesInReadingOrder(children);
1773
+ const sortedChildren = this.getShapesInReadingOrder(children);
1767
1774
  if (sortedChildren.length === 0) return;
1768
1775
  this._selectShapesAndZoom([sortedChildren[0].id]);
1769
1776
  }