@tldraw/editor 5.5.0-canary.e4dba4e76649 → 5.5.0-canary.eef775d9b2dd
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 +1 -1
- package/dist-cjs/lib/editor/Editor.js +4 -8
- package/dist-cjs/lib/editor/Editor.js.map +2 -2
- package/dist-cjs/version.js +3 -3
- package/dist-cjs/version.js.map +1 -1
- package/dist-esm/index.mjs +1 -1
- package/dist-esm/lib/editor/Editor.mjs +4 -8
- package/dist-esm/lib/editor/Editor.mjs.map +2 -2
- package/dist-esm/version.mjs +3 -3
- package/dist-esm/version.mjs.map +1 -1
- package/package.json +7 -7
- package/src/lib/editor/Editor.ts +9 -17
- package/src/version.ts +3 -3
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.
|
|
395
|
+
"5.5.0-canary.eef775d9b2dd",
|
|
396
396
|
"cjs"
|
|
397
397
|
);
|
|
398
398
|
//# sourceMappingURL=index.js.map
|
|
@@ -1610,15 +1610,12 @@ 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 = this.getCurrentPageShapes().filter(
|
|
1614
|
-
|
|
1615
|
-
);
|
|
1616
|
-
const readingOrderShapes = this._getShapesInReadingOrder(filteredShapes);
|
|
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();
|
|
1617
1615
|
const currentShapeId = selectedShapeIds.length === 1 ? selectedShapeIds[0] : readingOrderShapes.find((shape2) => selectedShapeIds.includes(shape2.id))?.id;
|
|
1618
1616
|
let adjacentShapeId;
|
|
1619
1617
|
if (direction === "next" || direction === "prev") {
|
|
1620
1618
|
const shapeIds = readingOrderShapes.map((shape2) => shape2.id);
|
|
1621
|
-
if (shapeIds.length === 0) return;
|
|
1622
1619
|
const currentIndex = currentShapeId ? shapeIds.indexOf(currentShapeId) : -1;
|
|
1623
1620
|
const startIndex = currentIndex === -1 && direction === "prev" ? 0 : currentIndex;
|
|
1624
1621
|
const adjacentIndex = (startIndex + (direction === "next" ? 1 : -1) + shapeIds.length) % shapeIds.length;
|
|
@@ -2923,7 +2920,6 @@ class Editor extends import_eventemitter3.default {
|
|
|
2923
2920
|
}
|
|
2924
2921
|
const isOnSamePage = presence.currentPageId === this.getCurrentPageId();
|
|
2925
2922
|
if (!isOnSamePage) {
|
|
2926
|
-
this.markHistoryStoppingPoint("change-page");
|
|
2927
2923
|
this.setCurrentPage(presence.currentPageId);
|
|
2928
2924
|
}
|
|
2929
2925
|
if (opts && opts.animation && !isOnSamePage) {
|
|
@@ -8301,8 +8297,8 @@ class Editor extends import_eventemitter3.default {
|
|
|
8301
8297
|
break;
|
|
8302
8298
|
}
|
|
8303
8299
|
case "keyboard": {
|
|
8304
|
-
if (info.
|
|
8305
|
-
if (info.
|
|
8300
|
+
if (info.key === "ShiftRight") info.key = "ShiftLeft";
|
|
8301
|
+
if (info.key === "AltRight") info.key = "AltLeft";
|
|
8306
8302
|
if (info.code === "ControlRight") info.code = "ControlLeft";
|
|
8307
8303
|
if (info.code === "MetaRight") info.code = "MetaLeft";
|
|
8308
8304
|
switch (info.name) {
|