@jxsuite/studio 0.36.0 → 0.37.0
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/iframe-entry.js +18 -9
- package/dist/iframe-entry.js.map +4 -4
- package/dist/studio.js +11525 -2877
- package/dist/studio.js.map +64 -17
- package/package.json +4 -2
- package/src/canvas/canvas-render.ts +85 -12
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-overlay.ts +30 -1
- package/src/collab/collab-session.ts +903 -0
- package/src/collab/collab-state.ts +71 -0
- package/src/collab/monaco-cursors.ts +69 -0
- package/src/collab/presence-chips.ts +58 -0
- package/src/files/file-ops.ts +6 -0
- package/src/files/files.ts +6 -0
- package/src/panels/git-panel.ts +5 -0
- package/src/panels/toolbar.ts +13 -3
- package/src/platforms/cloud.ts +31 -0
- package/src/platforms/devserver.ts +37 -0
- package/src/studio.ts +17 -0
- package/src/tabs/doc-op-apply.ts +5 -81
- package/src/tabs/patch-ops.ts +7 -23
- package/src/tabs/transact.ts +138 -12
- package/src/types.ts +8 -0
- package/src/workspace/workspace.ts +4 -0
package/dist/iframe-entry.js
CHANGED
|
@@ -5482,13 +5482,23 @@ function startKeyForwarding(channel, doc = document) {
|
|
|
5482
5482
|
return () => doc.removeEventListener("keydown", onKey, true);
|
|
5483
5483
|
}
|
|
5484
5484
|
|
|
5485
|
-
// src/
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
5536
|
-
const toParent =
|
|
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=
|
|
6246
|
+
//# debugId=FE3AC1CBD1F2F79E64756E2164756E21
|
|
6238
6247
|
//# sourceMappingURL=iframe-entry.js.map
|