@jxsuite/studio 0.36.0 → 0.37.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.
@@ -5482,13 +5482,23 @@ function startKeyForwarding(channel, doc = document) {
5482
5482
  return () => doc.removeEventListener("keydown", onKey, true);
5483
5483
  }
5484
5484
 
5485
- // src/tabs/doc-op-apply.ts
5485
+ // ../collab/src/ops.ts
5486
5486
  function jsonClone(value) {
5487
5487
  return JSON.parse(JSON.stringify(value));
5488
5488
  }
5489
5489
  function cloneValue(v) {
5490
5490
  return v === undefined || v === null ? v : jsonClone(v);
5491
5491
  }
5492
+ function getNodeAtPath2(doc, path) {
5493
+ let node = doc;
5494
+ for (const key of path) {
5495
+ if (node == null) {
5496
+ return;
5497
+ }
5498
+ node = node[key];
5499
+ }
5500
+ return node;
5501
+ }
5492
5502
  function childArray(node) {
5493
5503
  if (Array.isArray(node)) {
5494
5504
  throw new TypeError("Cannot insert into a children array; parentPath must point at a node");
@@ -5504,7 +5514,7 @@ function childArray(node) {
5504
5514
  function applyDocOpToDoc(doc, op) {
5505
5515
  switch (op.op) {
5506
5516
  case "set-key": {
5507
- const node = getNodeAtPath(doc, op.path);
5517
+ const node = getNodeAtPath2(doc, op.path);
5508
5518
  if (!node) {
5509
5519
  throw new Error(`doc-op-node-not-found:${op.path.join("/")}`);
5510
5520
  }
@@ -5517,23 +5527,23 @@ function applyDocOpToDoc(doc, op) {
5517
5527
  return;
5518
5528
  }
5519
5529
  case "insert-child": {
5520
- const parent = getNodeAtPath(doc, op.parentPath);
5530
+ const parent = getNodeAtPath2(doc, op.parentPath);
5521
5531
  childArray(parent).splice(op.index, 0, cloneValue(op.node));
5522
5532
  return;
5523
5533
  }
5524
5534
  case "remove-child": {
5525
- const parent = getNodeAtPath(doc, op.parentPath);
5535
+ const parent = getNodeAtPath2(doc, op.parentPath);
5526
5536
  childArray(parent).splice(op.index, 1);
5527
5537
  return;
5528
5538
  }
5529
5539
  case "set-child": {
5530
- const parent = getNodeAtPath(doc, op.parentPath);
5540
+ const parent = getNodeAtPath2(doc, op.parentPath);
5531
5541
  childArray(parent).splice(op.index, 1, cloneValue(op.node));
5532
5542
  return;
5533
5543
  }
5534
5544
  case "move-child": {
5535
- const fromParent = getNodeAtPath(doc, op.fromParentPath);
5536
- const toParent = getNodeAtPath(doc, op.toParentPath);
5545
+ const fromParent = getNodeAtPath2(doc, op.fromParentPath);
5546
+ const toParent = getNodeAtPath2(doc, op.toParentPath);
5537
5547
  const [node] = childArray(fromParent).splice(op.fromIndex, 1);
5538
5548
  childArray(toParent).splice(op.toIndex, 0, node);
5539
5549
  return;
@@ -5543,7 +5553,6 @@ function applyDocOpToDoc(doc, op) {
5543
5553
  }
5544
5554
  }
5545
5555
  }
5546
-
5547
5556
  // src/utils/strip-events.ts
5548
5557
  function stripEventHandlers(node) {
5549
5558
  if (!node || typeof node !== "object") {
@@ -6234,5 +6243,5 @@ export {
6234
6243
  bootCanvasIframe
6235
6244
  };
6236
6245
 
6237
- //# debugId=369B0CCF9985BC4564756E2164756E21
6246
+ //# debugId=FE3AC1CBD1F2F79E64756E2164756E21
6238
6247
  //# sourceMappingURL=iframe-entry.js.map