@plait/core 0.15.1 → 0.16.1
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/esm2020/interfaces/path.mjs +4 -1
- package/esm2020/plugins/with-hotkey.mjs +4 -1
- package/fesm2015/plait-core.mjs +6 -0
- package/fesm2015/plait-core.mjs.map +1 -1
- package/fesm2020/plait-core.mjs +6 -0
- package/fesm2020/plait-core.mjs.map +1 -1
- package/interfaces/path.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/plait-core.mjs
CHANGED
|
@@ -344,6 +344,9 @@ const Path = {
|
|
|
344
344
|
const last = path[path.length - 1];
|
|
345
345
|
return path.slice(0, -1).concat(last + 1);
|
|
346
346
|
},
|
|
347
|
+
hasPrevious(path) {
|
|
348
|
+
return path[path.length - 1] > 0;
|
|
349
|
+
},
|
|
347
350
|
previous(path) {
|
|
348
351
|
if (path.length === 0) {
|
|
349
352
|
throw new Error(`Cannot get the next path of a root path [${path}], because it has no previous index.`);
|
|
@@ -2637,6 +2640,9 @@ const withHotkey = (board) => {
|
|
|
2637
2640
|
event.preventDefault();
|
|
2638
2641
|
let elements = [];
|
|
2639
2642
|
depthFirstRecursion(board, node => {
|
|
2643
|
+
if (PlaitBoard.isBoard(node)) {
|
|
2644
|
+
return;
|
|
2645
|
+
}
|
|
2640
2646
|
elements.push(node);
|
|
2641
2647
|
}, node => {
|
|
2642
2648
|
if (PlaitBoard.isBoard(node) || board.isRecursion(node)) {
|