@tldraw/editor 5.5.0-canary.d64d005dcf06 → 5.5.0-canary.d98ea50911fe

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.js CHANGED
@@ -392,7 +392,7 @@ var import_uniq = require("./lib/utils/uniq");
392
392
  var import_defaultThemes2 = require("./lib/editor/managers/ThemeManager/defaultThemes");
393
393
  (0, import_utils.registerTldrawLibraryVersion)(
394
394
  "@tldraw/editor",
395
- "5.5.0-canary.d64d005dcf06",
395
+ "5.5.0-canary.d98ea50911fe",
396
396
  "cjs"
397
397
  );
398
398
  //# sourceMappingURL=index.js.map
@@ -1610,12 +1610,15 @@ class Editor extends import_eventemitter3.default {
1610
1610
  const selectedShapeIds = this.getSelectedShapeIds();
1611
1611
  const firstParentId = selectedShapeIds[0] ? this.getShape(selectedShapeIds[0])?.parentId : null;
1612
1612
  const isSelectedWithinContainer = firstParentId && selectedShapeIds.every((shapeId) => this.getShape(shapeId)?.parentId === firstParentId) && !(0, import_tlschema.isPageId)(firstParentId);
1613
- const filteredShapes = isSelectedWithinContainer ? this.getCurrentPageShapes().filter((shape2) => shape2.parentId === firstParentId) : this.getCurrentPageShapes().filter((shape2) => (0, import_tlschema.isPageId)(shape2.parentId));
1614
- const readingOrderShapes = isSelectedWithinContainer ? this._getShapesInReadingOrder(filteredShapes) : this.getCurrentPageShapesInReadingOrder();
1613
+ const filteredShapes = this.getCurrentPageShapes().filter(
1614
+ (shape2) => !this.isShapeOrAncestorLocked(shape2) && (isSelectedWithinContainer ? shape2.parentId === firstParentId : (0, import_tlschema.isPageId)(shape2.parentId))
1615
+ );
1616
+ const readingOrderShapes = this._getShapesInReadingOrder(filteredShapes);
1615
1617
  const currentShapeId = selectedShapeIds.length === 1 ? selectedShapeIds[0] : readingOrderShapes.find((shape2) => selectedShapeIds.includes(shape2.id))?.id;
1616
1618
  let adjacentShapeId;
1617
1619
  if (direction === "next" || direction === "prev") {
1618
1620
  const shapeIds = readingOrderShapes.map((shape2) => shape2.id);
1621
+ if (shapeIds.length === 0) return;
1619
1622
  const currentIndex = currentShapeId ? shapeIds.indexOf(currentShapeId) : -1;
1620
1623
  const startIndex = currentIndex === -1 && direction === "prev" ? 0 : currentIndex;
1621
1624
  const adjacentIndex = (startIndex + (direction === "next" ? 1 : -1) + shapeIds.length) % shapeIds.length;
@@ -2920,6 +2923,7 @@ class Editor extends import_eventemitter3.default {
2920
2923
  }
2921
2924
  const isOnSamePage = presence.currentPageId === this.getCurrentPageId();
2922
2925
  if (!isOnSamePage) {
2926
+ this.markHistoryStoppingPoint("change-page");
2923
2927
  this.setCurrentPage(presence.currentPageId);
2924
2928
  }
2925
2929
  if (opts && opts.animation && !isOnSamePage) {
@@ -5360,7 +5364,7 @@ class Editor extends import_eventemitter3.default {
5360
5364
  const shapesMovingTogether = [shape];
5361
5365
  const boundsOfShapesMovingTogether = [shapePageBounds];
5362
5366
  this.collectShapesViaArrowBindings({
5363
- bindings: this.getBindingsToShape(shape.id, "arrow"),
5367
+ bindings: this.getBindingsInvolvingShape(shape.id, "arrow"),
5364
5368
  initialShapes: freshShapes,
5365
5369
  resultShapes: shapesMovingTogether,
5366
5370
  resultBounds: boundsOfShapesMovingTogether,
@@ -8297,8 +8301,8 @@ class Editor extends import_eventemitter3.default {
8297
8301
  break;
8298
8302
  }
8299
8303
  case "keyboard": {
8300
- if (info.key === "ShiftRight") info.key = "ShiftLeft";
8301
- if (info.key === "AltRight") info.key = "AltLeft";
8304
+ if (info.code === "ShiftRight") info.code = "ShiftLeft";
8305
+ if (info.code === "AltRight") info.code = "AltLeft";
8302
8306
  if (info.code === "ControlRight") info.code = "ControlLeft";
8303
8307
  if (info.code === "MetaRight") info.code = "MetaLeft";
8304
8308
  switch (info.name) {