@jxsuite/studio 5.1.0 → 5.2.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.
Files changed (103) hide show
  1. package/dist/chunks/{cf-account-picker-qwkm9zrf.js → cf-account-picker-h4dab9bq.js} +10 -10
  2. package/dist/chunks/{cf-settings-71bv5zn9.js → cf-settings-adg74qsk.js} +4 -4
  3. package/dist/chunks/{components-vj72gqtq.js → components-5y78e05d.js} +4 -4
  4. package/dist/chunks/content-source-sgg1sv6n.js +46 -0
  5. package/dist/chunks/{convert-to-repeater-n64h8znc.js → convert-to-repeater-mf1cxgfn.js} +22 -22
  6. package/dist/chunks/entry-commands-w9qsxa6q.js +42 -0
  7. package/dist/chunks/{extension-sections-3hpcambp.js → extension-sections-c6zwzbre.js} +26 -26
  8. package/dist/chunks/{file-ops-8yhd83xr.js → file-ops-vrpq1jjk.js} +22 -22
  9. package/dist/chunks/{files-hnxqxtsg.js → files-msaf95y6.js} +31 -30
  10. package/dist/chunks/{format-host-779sfp2n.js → format-host-f64fnesp.js} +2 -2
  11. package/dist/chunks/{fs-events-b88z7g4h.js → fs-events-3y6y0nrm.js} +4 -4
  12. package/dist/chunks/{git-panel-xwj8fpab.js → git-panel-bv5e22j0.js} +23 -22
  13. package/dist/chunks/grid-view-1p6hsyjx.css +8406 -0
  14. package/dist/chunks/grid-view-paj67nr5.js +15322 -0
  15. package/dist/chunks/{iframe-host-syr0f9sb.js → iframe-host-dh5np8vk.js} +13 -13
  16. package/dist/chunks/{layers-ff81wthn.js → layers-1vcfdbet.js} +5 -5
  17. package/dist/chunks/layers-panel-fksbdg4q.js +40 -0
  18. package/dist/chunks/{media-picker-cqhhxhhe.js → media-picker-p49nhqhs.js} +13 -13
  19. package/dist/chunks/menu-qht48vnc.js +15 -0
  20. package/dist/chunks/{monaco-buffer-bhy3hb6m.js → monaco-buffer-pykwbm92.js} +3 -3
  21. package/dist/chunks/{notify-628t0anh.js → notify-42gk8ha1.js} +2 -2
  22. package/dist/chunks/{parse-0zx14y15.js → parse-reg9eevt.js} +2 -2
  23. package/dist/chunks/publish-panel-vz23wwmg.js +27 -0
  24. package/dist/chunks/quick-search-e9rp74m8.js +46 -0
  25. package/dist/chunks/{references-qvvxej7h.js → references-h69xp9zz.js} +2 -2
  26. package/dist/chunks/right-panel-j97t2yvy.js +45 -0
  27. package/dist/chunks/{studio-b0k5tqgp.js → studio-01jeck2y.js} +31 -27
  28. package/dist/chunks/{studio-wqz6dggm.js → studio-14d9tq4d.js} +9 -9
  29. package/dist/chunks/{studio-try13h8c.js → studio-15f3kxqe.js} +18 -18
  30. package/dist/chunks/studio-1tbjfqv4.js +146 -0
  31. package/dist/chunks/{studio-vw7mzp6z.js → studio-28vs5k2y.js} +2 -2
  32. package/dist/chunks/{studio-93zafjcm.js → studio-2mdbbc76.js} +10 -10
  33. package/dist/chunks/{studio-7r42c6ca.js → studio-3ntvq6cg.js} +5 -5
  34. package/dist/chunks/{studio-g3jevyjt.js → studio-4c041r8y.js} +2 -2
  35. package/dist/chunks/{studio-3773086z.js → studio-4r14yzyy.js} +4 -4
  36. package/dist/chunks/{studio-3rz5md06.js → studio-4xmjcrg3.js} +6 -6
  37. package/dist/chunks/{studio-syg2tadj.js → studio-5nz00bhh.js} +3 -3
  38. package/dist/chunks/{studio-1knfqgy7.js → studio-5t7ena5z.js} +8 -8
  39. package/dist/chunks/{studio-a79k90n9.js → studio-66arbpc2.js} +8 -8
  40. package/dist/chunks/{studio-b4s9eykd.js → studio-68fydsrj.js} +15 -15
  41. package/dist/chunks/{studio-mhhyamxf.js → studio-9j6sfeba.js} +6 -6
  42. package/dist/chunks/{studio-7xnmgv66.js → studio-a1pswps3.js} +37 -37
  43. package/dist/chunks/{studio-6xa21ej9.js → studio-c04nzbby.js} +2 -2
  44. package/dist/chunks/{studio-nzzpvzx9.js → studio-c07s5ckd.js} +4 -4
  45. package/dist/chunks/{studio-js8nv53n.js → studio-ctm7bhx5.js} +14 -14
  46. package/dist/chunks/{studio-p1dw8wfw.js → studio-d8z5bajd.js} +14 -10
  47. package/dist/chunks/{studio-jxp12rnj.js → studio-en82c639.js} +6 -6
  48. package/dist/chunks/{studio-1z1kcjv4.js → studio-etvx9s2g.js} +11 -11
  49. package/dist/chunks/{studio-k75n7vhp.js → studio-ez11dmdh.js} +74 -36
  50. package/dist/chunks/{studio-qhhm6hbt.js → studio-hdc2jt3z.js} +4 -4
  51. package/dist/chunks/{studio-r6nvacqs.js → studio-hhskq2mr.js} +19 -19
  52. package/dist/chunks/{studio-6ewqv390.js → studio-m1p9b6c3.js} +5 -5
  53. package/dist/chunks/{studio-qk90fgqm.js → studio-mpzwze9x.js} +7 -7
  54. package/dist/chunks/{studio-e1pgga3k.js → studio-ncn9e189.js} +7 -7
  55. package/dist/chunks/{studio-kkqkcp3d.js → studio-p6pmwkvh.js} +10 -10
  56. package/dist/chunks/{studio-aj37eer3.js → studio-qa7fzxan.js} +4 -4
  57. package/dist/chunks/{studio-sbjyc8bt.js → studio-sar8g54p.js} +8 -8
  58. package/dist/chunks/studio-t171hxhe.js +23 -0
  59. package/dist/chunks/{studio-pxbgypmg.js → studio-t3adrr56.js} +17 -14
  60. package/dist/chunks/{studio-hhvs4sdg.js → studio-vn5hske5.js} +10 -4
  61. package/dist/chunks/{studio-5wt9nvhd.js → studio-vt0tj32j.js} +29 -42
  62. package/dist/chunks/{studio-qk4bfsq2.js → studio-wjpgxywa.js} +4 -4
  63. package/dist/chunks/{studio-q3x06vmj.js → studio-wnsyffg1.js} +2 -2
  64. package/dist/chunks/{studio-gb13095a.js → studio-x10fp4tp.js} +59 -20
  65. package/dist/chunks/{studio-8scdew0e.js → studio-x72j58vw.js} +4 -4
  66. package/dist/chunks/{studio-tqgryxwg.js → studio-y4f9fdge.js} +7 -7
  67. package/dist/chunks/{studio-vfq8qpjt.js → studio-ympe0n7a.js} +3 -3
  68. package/dist/chunks/{studio-y9zedyjn.js → studio-z2smx5ce.js} +2 -2
  69. package/dist/chunks/{studio-zdn2g6dt.js → studio-zjjde71a.js} +2 -2
  70. package/dist/chunks/{workspace-t55jdjbx.js → workspace-bnw54cha.js} +18 -10
  71. package/dist/iframe-entry.js +7 -3
  72. package/dist/studio.css +1 -2
  73. package/dist/studio.js +866 -15698
  74. package/package.json +6 -6
  75. package/src/files/files.ts +38 -15
  76. package/src/grid/grid-lazy.ts +59 -0
  77. package/src/grid/grid-open.ts +20 -3
  78. package/src/grid/grid-panel.ts +43 -9
  79. package/src/media/media-open.ts +14 -2
  80. package/src/panels/pane-context.ts +5 -4
  81. package/src/panels/pane-grid.ts +100 -10
  82. package/src/panels/tab-drop.ts +220 -0
  83. package/src/panels/tab-strip.ts +235 -30
  84. package/src/services/ai-models.ts +13 -0
  85. package/src/studio.ts +10 -6
  86. package/src/surfaces/commandbar.json +26 -16
  87. package/src/surfaces/pane-grid.json +35 -3
  88. package/src/surfaces/pane-grid.ts +26 -4
  89. package/src/surfaces/tab-strip.json +16 -39
  90. package/src/surfaces/tab-strip.ts +76 -12
  91. package/src/ui/ai-credentials-form.ts +12 -1
  92. package/src/workspace/pane-derive.ts +7 -5
  93. package/src/workspace/session.ts +3 -3
  94. package/src/workspace/workspace.ts +160 -43
  95. package/styles/shell-frame.css +8 -0
  96. package/styles/shell-frame.json +4 -0
  97. package/dist/chunks/content-source-5mex4x1h.js +0 -46
  98. package/dist/chunks/entry-commands-234hjnqw.js +0 -42
  99. package/dist/chunks/layers-panel-pnnghw12.js +0 -40
  100. package/dist/chunks/menu-9p2w46gj.js +0 -15
  101. package/dist/chunks/publish-panel-5zt840sy.js +0 -27
  102. package/dist/chunks/quick-search-3748564r.js +0 -45
  103. package/dist/chunks/right-panel-eccz92qt.js +0 -45
@@ -368,68 +368,82 @@ export function focusOtherPane() {
368
368
  */
369
369
 
370
370
  /**
371
- * Split the grid and move the focused tab into the new pane, which becomes focused.
371
+ * Split the grid and move a tab into the new pane, which becomes focused.
372
372
  *
373
373
  * Moves rather than duplicates: one tab is one document with one undo history and one collab
374
374
  * session, and two strips claiming the same id is the duplicate-`repeat`-key bug §4.3 describes.
375
375
  *
376
+ * The subject is `tabId` when given, else the focused pane's active tab. The drag resolver names
377
+ * the tab it is carrying — the gesture points at a chip, not at whatever the keyboard is in — and
378
+ * `⌘\` and `pane.splitRight` call it bare, which is the focused tab as it has always been.
379
+ *
380
+ * @param {string} [tabId] The tab to move; defaults to the focused pane's active tab.
376
381
  * @returns {Pane | null} The pane the tab landed in, or null when the split was refused
377
382
  */
378
- export function splitRight(): Pane | null {
379
- const source = activePane();
380
- const tabId = source.activeTabId;
381
- const tab = tabId ? workspace.tabs.get(tabId) : null;
382
- if (!tabId || !tab) {
383
+ export function splitRight(tabId?: string): Pane | null {
384
+ const id = tabId ?? activePane().activeTabId;
385
+ const tab = id ? workspace.tabs.get(id) : null;
386
+ if (!id || !tab) {
387
+ return null;
388
+ }
389
+ const source = paneOfTab(id);
390
+ if (!source) {
383
391
  return null;
384
392
  }
385
393
  /* The tab moves AS IT IS. `capToPaneKind` used to run here and rewrite `session.ui.canvasMode`
386
394
  when the target pane could not host the tab's kind — which, for a Design tab, meant `⌘\`
387
395
  silently reopened your page as Code in the pane you had just made. Both panes host every kind
388
396
  now, so a split is a move and nothing else. */
389
- const target = receivingPane();
390
- detachTab(tabId);
391
- insertIntoPane(target, tabId);
397
+ const target = receivingPane(source.id);
398
+ detachTab(id);
399
+ insertIntoPane(target, id);
392
400
  /* Focus moves LAST, and every write above went through {@link addPane}'s reactive record.
393
401
  Publishing the focus first made the pane observable while it still showed nothing: the
394
402
  `activeTab` computed re-ran, cached null, and the jump bar, the Inspector and the toolbar all
395
403
  printed "no document" over a stage that was drawing one. The write that should have corrected
396
404
  them notified nobody, because it went through the raw literal this used to push. */
397
- target.activeTabId = tabId;
405
+ target.activeTabId = id;
398
406
  workspace.activePaneId = target.id;
399
407
  resetTabCycle();
400
- promoteMru(tabId);
408
+ promoteMru(id);
401
409
  return target;
402
410
  }
403
411
 
404
412
  /**
405
- * The pane BESIDE the focused one, created if the grid has only one.
413
+ * The pane beside `paneId`, created if the grid has only one.
406
414
  *
407
415
  * The `existing ?? addPane(SECONDARY_PANE)` shape {@link splitRight} has always used, named because
408
- * three callers now want it: the split, `pane.compareWith` and `pane.derive`. Unlike `splitRight`
409
- * it moves NOTHING — "give me the other pane" and "send my document to it" are two requests, and
410
- * only the split makes both.
416
+ * four callers now want it: the split, `pane.compareWith`, `pane.derive` and the drag resolver.
417
+ * Unlike `splitRight` it moves NOTHING — "give me the other pane" and "send my document to it" are
418
+ * two requests, and only the split makes both.
419
+ *
420
+ * Takes the pane it is asked about rather than reading the focus, because a drag names the pane its
421
+ * chip came from and `pane.derive`'s preset menu asks about its own pane — and
422
+ * `scripts/check-pane-singletons.ts` rule 4 refuses a function handed a `paneId` that reads the
423
+ * focus. The one caller that means "beside ME" passes `activePane().id`.
411
424
  *
412
425
  * `SECONDARY_PANE` unconditionally, and it is free unconditionally: {@link closePane} refuses to
413
426
  * remove the primary, so "there is no other pane" can only mean the grid is exactly `[primary]` and
414
- * the focused pane is that primary. This used to be `existing?.id ?? SECONDARY_PANE` handed
427
+ * the asked-about pane is that primary. This used to be `existing?.id ?? SECONDARY_PANE` handed
415
428
  * straight to `addPane` with no check that the id was free — which, on a grid of `["secondary"]`,
416
429
  * pushed a SECOND record under that id and gave lit's keyed `repeat` a duplicate key. Both ends are
417
430
  * closed: the state is unreachable, and {@link addPane} would not mint the duplicate even if it
418
431
  * were. {@link MAX_PANES} is therefore satisfied by construction — there are two ids in play.
419
432
  *
433
+ * @param {string} paneId The pane to answer "beside" for.
420
434
  * @returns {Pane}
435
+ * @docs studio/interface/tabs
421
436
  */
422
- export function sidePane(): Pane {
423
- const source = activePane();
424
- return workspace.panes.find((pane) => pane.id !== source.id) ?? addPane(SECONDARY_PANE);
437
+ export function paneBeside(paneId: string): Pane {
438
+ return workspace.panes.find((pane) => pane.id !== paneId) ?? addPane(SECONDARY_PANE);
425
439
  }
426
440
 
427
441
  /**
428
- * The pane beside the focused one, ready to OWN a tab.
442
+ * The pane beside `paneId`, ready to OWN a tab.
429
443
  *
430
- * {@link sidePane} answers "which pane is beside me". This answers "which pane may I put a document
431
- * IN", and they differ by exactly one case — a LENS, whose invariant D2 is that it owns no tab at
432
- * all. Three callers mean the second question and all three were asking the first:
444
+ * {@link paneBeside} answers "which pane is beside that one". This answers "which pane may I put a
445
+ * document IN", and they differ by exactly one case — a LENS, whose invariant D2 is that it owns no
446
+ * tab at all. Four callers mean the second question and all four were asking the first:
433
447
  *
434
448
  * - `splitRight` moved the focused tab into a lens. Between that write and the follow's next frame
435
449
  * the pane held both a derivation and a tab — D2 violated and observable — and `applyDerivation`
@@ -441,6 +455,8 @@ export function sidePane(): Pane {
441
455
  * touches — never ran to repair it.
442
456
  * - `navigateToComponent` read `tabOfPane(target.id)` back and got the SOURCE tab, so the §14.2
443
457
  * `openedFrom` relationship the function exists to record was silently skipped.
458
+ * - The drag resolver dropped a tab or a file onto a lens's strip, where the same three failures
459
+ * apply with a gesture instead of a command.
444
460
  *
445
461
  * **The derivation is released rather than the request refused.** "Put this document over there" is
446
462
  * an explicit instruction about the pane a projection is currently borrowing, and a projection is a
@@ -456,10 +472,11 @@ export function sidePane(): Pane {
456
472
  * `activeTabId` — promotes whichever document is on top, which after `⌘\` is the page, not the
457
473
  * layout the author was keeping. A gesture that empties a derivation of its meaning ends it.
458
474
  *
475
+ * @param {string} paneId The pane the receiving pane sits beside.
459
476
  * @returns {Pane}
460
477
  */
461
- export function receivingPane(): Pane {
462
- const target = sidePane();
478
+ export function receivingPane(paneId: string): Pane {
479
+ const target = paneBeside(paneId);
463
480
  if (target.derived) {
464
481
  /* The same write {@link closePane} makes for D4, for the same reason and in the same module:
465
482
  clearing a derivation is a fact about the PANE GRID. `pane-derive.ts`'s
@@ -582,8 +599,11 @@ export function closePane(paneId: string) {
582
599
  * same question while every pane's subject was its tabs. A lens pane's subject is its derivation —
583
600
  * its `tabOrder` is empty BY DESIGN — so the literal test would collapse it the instant it was
584
601
  * created.
602
+ *
603
+ * Exported for `panels/tab-drop.ts`, whose edge-drop resolution refuses to leave a pane it minted
604
+ * standing empty over a refused open — the same rule `document.openToSide` applies in-module.
585
605
  */
586
- function paneIsEmpty(pane: Pane): boolean {
606
+ export function paneIsEmpty(pane: Pane): boolean {
587
607
  return pane.tabOrder.length === 0 && pane.derived === null;
588
608
  }
589
609
 
@@ -759,12 +779,12 @@ function syncTreeSelection(tab: Tab) {
759
779
  /**
760
780
  * Make `tabId` the active tab OF ITS OWN PANE. The one place activation happens.
761
781
  *
762
- * `focus: false` is "put it on screen there, and leave the keyboard where it is" — the shape a
763
- * side-open needs. It writes `pane.activeTabId` and stops: no `activePaneId` write, no
764
- * `resetTabCycle`, no `promoteMru`, no `syncTreeSelection`, because every one of those describes
765
- * where the AUTHOR is and the author has not moved. Drilling into a component with the focus
766
- * following it is the failure it exists to prevent: the pane the author is typing in changes under
767
- * them, and their next keystroke edits the definition instead of the page.
782
+ * `focus: false` is "put it on screen there, and leave the keyboard where it is" — the shape a READ
783
+ * needs: the derivation follow, `pane.compareWith`, session restore. It writes `pane.activeTabId`
784
+ * and stops: no `activePaneId` write, no `resetTabCycle`, no `promoteMru`, no `syncTreeSelection`,
785
+ * because every one of those describes where the AUTHOR is and the author has not moved. The
786
+ * gestures that OPEN something — drilling into a component, Open to the Side — follow instead: the
787
+ * pane they open into takes the keyboard, because the author asked to go there.
768
788
  *
769
789
  * Legal here and nowhere else — this module is `check-pane-singletons.ts`'s `FOCUS_OWNER`, and the
770
790
  * default is still to move the focus, so no existing caller changes behaviour.
@@ -809,10 +829,12 @@ function setActiveTab(tabId: string, opts: { cycling?: boolean; focus?: boolean
809
829
  *
810
830
  * `paneId` says WHERE, and `focus` says whether the keyboard goes with it. Both default to today's
811
831
  * answer — the focused pane, and yes — because "open this document" has always meant "in front of
812
- * me". They exist because drilling into a component, comparing two documents and following a
813
- * selection all mean the opposite: put it in the pane beside this one and leave me where I am. A
814
- * `paneId` no pane carries falls back to the focused pane rather than dropping the open, which is
815
- * the same answer a stale persisted layout gets everywhere else in this module.
832
+ * me". They exist because the gestures that mean the opposite are the READS: comparing two
833
+ * documents and following a derivation put it in the pane beside this one and leave the author
834
+ * where they are. The gestures that OPEN something — drill-in, Open to the Side — pass neither: the
835
+ * pane they open into takes the keyboard, because the author asked to go there. A `paneId` no pane
836
+ * carries falls back to the focused pane rather than dropping the open, which is the same answer a
837
+ * stale persisted layout gets everywhere else in this module.
816
838
  *
817
839
  * @param {{
818
840
  * id: string;
@@ -960,12 +982,33 @@ export function moveTab(tabId: string, toIndex: number) {
960
982
  if (!tab || !pane) {
961
983
  return;
962
984
  }
985
+ pane.tabOrder = reorderWithinPane(pane, tabId, toIndex);
986
+ }
987
+
988
+ /**
989
+ * The order `pane`'s strip takes when `tabId` moves to `toIndex`, clamped into the region the tab's
990
+ * pinned state allows — the pinned prefix and the unpinned tail never interleave.
991
+ *
992
+ * Extracted from `moveTab` because the cross-pane move needs the SAME clamp: a tab dragged into
993
+ * another pane's strip at index 0 must land after that pane's pinned prefix, not inside it, and
994
+ * duplicating the boundary arithmetic is how the two moves drift apart.
995
+ *
996
+ * @param {Pane} pane
997
+ * @param {string} tabId
998
+ * @param {number} toIndex
999
+ * @returns {string[]} The pane's new `tabOrder`.
1000
+ */
1001
+ function reorderWithinPane(pane: Pane, tabId: string, toIndex: number): string[] {
1002
+ const tab = workspace.tabs.get(tabId);
1003
+ if (!tab) {
1004
+ return pane.tabOrder;
1005
+ }
963
1006
  const without = pane.tabOrder.filter((id) => id !== tabId);
964
1007
  const boundary = without.filter((id) => workspace.tabs.get(id)?.pinned === true).length;
965
1008
  const lower = tab.pinned ? 0 : boundary;
966
1009
  const upper = tab.pinned ? boundary : without.length;
967
1010
  const at = Math.min(Math.max(toIndex, lower), upper);
968
- pane.tabOrder = [...without.slice(0, at), tabId, ...without.slice(at)];
1011
+ return [...without.slice(0, at), tabId, ...without.slice(at)];
969
1012
  }
970
1013
 
971
1014
  /**
@@ -1177,20 +1220,30 @@ export function activateTab(tabId: string, opts: { focus?: boolean } = {}) {
1177
1220
  *
1178
1221
  * Idempotent for a tab already in `paneId`, which is what makes it safe on the follow path.
1179
1222
  *
1223
+ * `index` is the slot in `paneId`'s order the tab takes, clamped into the region the tab's pinned
1224
+ * state allows — the same clamp `moveTab` applies, so a cross-pane move can never interleave a
1225
+ * pinned tab with an unpinned one. Omitted, the tab takes the default slot: inside the pinned
1226
+ * prefix if pinned, else at the end. A same-pane move with an index delegates to `moveTab`, so the
1227
+ * drag-reorder and the cross-pane move share one clamp rather than two.
1228
+ *
1180
1229
  * @param {string} tabId
1181
1230
  * @param {string} paneId
1231
+ * @param {number} [index]
1182
1232
  * @returns {Pane | null} The pane it landed in, or null when either id names nothing.
1183
1233
  */
1184
- export function moveTabToPane(tabId: string, paneId: string): Pane | null {
1234
+ export function moveTabToPane(tabId: string, paneId: string, index?: number): Pane | null {
1185
1235
  const pane = paneById(paneId);
1186
1236
  if (!pane || !workspace.tabs.has(tabId)) {
1187
1237
  return null;
1188
1238
  }
1189
1239
  if (pane.tabOrder.includes(tabId)) {
1240
+ if (index !== undefined) {
1241
+ pane.tabOrder = reorderWithinPane(pane, tabId, index);
1242
+ }
1190
1243
  return pane;
1191
1244
  }
1192
1245
  detachTab(tabId);
1193
- insertIntoPane(pane, tabId);
1246
+ insertIntoPane(pane, tabId, index);
1194
1247
  return pane;
1195
1248
  }
1196
1249
 
@@ -1226,8 +1279,16 @@ export function renameTab(oldId: string, newId: string, newDocumentPath: string)
1226
1279
 
1227
1280
  /** What the tab commands need from the rest of Studio. */
1228
1281
  export interface TabCommandDeps {
1229
- /** Read a file from disk and show it — `files/files.ts`'s `openFileInTab`. */
1230
- openFile: (path: string) => void | Promise<void>;
1282
+ /**
1283
+ * Read a file from disk and show it — `files/files.ts`'s `openFileInTab`. The options are the
1284
+ * opener's own: `paneId` names the pane the tab lands in (defaulting to the focused one), and
1285
+ * `focus: false` browses without moving the keyboard — the shape session restore and the
1286
+ * derivation follow need.
1287
+ */
1288
+ openFile: (
1289
+ path: string,
1290
+ opts?: { paneId?: string; focus?: boolean; preview?: boolean },
1291
+ ) => void | Promise<void>;
1231
1292
  /**
1232
1293
  * Read a file from disk and show it in a NAMED pane, browsing rather than committing and leaving
1233
1294
  * the keyboard where it is — `files/files.ts`'s `openFileInPane`.
@@ -1357,6 +1418,58 @@ export function tabCommands(deps: TabCommandDeps): AnyCommand[] {
1357
1418
  }
1358
1419
  },
1359
1420
  },
1421
+ {
1422
+ args: argsSchema({
1423
+ file: stringProperty(
1424
+ 'Project-relative path of the file to open in the other pane, e.g. "pages/about.json". ' +
1425
+ "It must exist.",
1426
+ ),
1427
+ }),
1428
+ id: "document.openToSide",
1429
+ title: "Open to the Side",
1430
+ category: "Document",
1431
+ /* PROJECT level for the same reason `document.open` is: it adds a tab to the workspace, and
1432
+ a second pane may not exist yet — the record mints one. */
1433
+ level: "project",
1434
+ menus: ["context/file", "palette"],
1435
+ group: "1_file",
1436
+ when: (ctx) => ctx.project.open,
1437
+ requires: "an open project",
1438
+ /* No `aiTool`, by §12.4's first deletion rule: chrome — it arranges what the person is
1439
+ looking at. No `undo`: opening a tab is not a state the undo stack owns. */
1440
+ undo: "none",
1441
+ /* The non-drag equivalent of dragging a file row onto the other pane's strip (SC 2.5.7): the
1442
+ same `receivingPane` the drag resolver uses, so a file tree row and this command can never
1443
+ disagree about where "the side" is. The open is a FOLLOW — the pane it lands in takes the
1444
+ keyboard, which is what "open to the side" means when the side pane did not exist a moment
1445
+ ago. */
1446
+ run: async (_ctx, args) => {
1447
+ const file = stringArg("document.openToSide", args, "file");
1448
+ const target = receivingPane(activePane().id);
1449
+ await deps.openFile(file, { paneId: target.id });
1450
+ if (![...workspace.tabs.values()].some((tab) => tab.documentPath === file)) {
1451
+ /* The open failed (a missing file, or no editor claims the format) and `openFileInTab`
1452
+ reported it as a Problem rather than throwing. If the target pane was minted for this
1453
+ open and holds nothing, close it — a command that fails must not leave a new empty
1454
+ pane behind.
1455
+
1456
+ `target.id !== PRIMARY_PANE` GUARDS it, and the guard is load-bearing rather than
1457
+ defensive: `receivingPane` answers PRIMARY when the author is focused on the secondary,
1458
+ and an empty primary is a legitimate state on its own (`detachTab`'s "welcome screen
1459
+ beside the document" exemption) — not a hole this command minted. `closePane`'s own
1460
+ contract reads `PRIMARY_PANE` as "collapse the OTHER pane", so calling it unguarded here
1461
+ would close the secondary the author was just looking at, over a refusal about a
1462
+ completely different pane. */
1463
+ if (paneIsEmpty(target) && target.id !== PRIMARY_PANE) {
1464
+ closePane(target.id);
1465
+ }
1466
+ throw new RangeError(
1467
+ `command "document.openToSide" argument "file": "${file}" could not be opened — it ` +
1468
+ `does not exist, or no editor claims its format. Problems has the reason.`,
1469
+ );
1470
+ }
1471
+ },
1472
+ },
1360
1473
  {
1361
1474
  id: "document.reopenClosed",
1362
1475
  title: "Reopen Closed Document",
@@ -1470,6 +1583,10 @@ export function paneCommands(deps: TabCommandDeps): AnyCommand[] {
1470
1583
  requires: "an open document",
1471
1584
  undo: "none",
1472
1585
  run: () => {
1586
+ /* The non-drag equivalent of every drag move (SC 2.5.7): `splitRight` moves the active tab
1587
+ to a new pane at the right of the grid, which is what dragging a tab onto the grid's
1588
+ right edge does, and `document.openToSide` is its file-tree counterpart. A keyboard-only
1589
+ author can reach every arrangement the drag offers. */
1473
1590
  splitRight();
1474
1591
  },
1475
1592
  },
@@ -1508,11 +1625,11 @@ export function paneCommands(deps: TabCommandDeps): AnyCommand[] {
1508
1625
  );
1509
1626
  }
1510
1627
  /* Nothing closes, nothing unsplits, and the FOCUS DOES NOT MOVE: comparing is a read.
1511
- {@link receivingPane} rather than `sidePane`, because the pane beside this one may be a
1628
+ {@link receivingPane} rather than `paneBeside`, because the pane beside this one may be a
1512
1629
  LENS — and a lens owns no tab, so the document landed in a `tabOrder` that `tabOfPane`
1513
1630
  hops straight past. Nothing was on screen, nothing was in a strip, and
1514
1631
  `workspace.activeTabId` went on reporting the source. */
1515
- await deps.openFileInPane(receivingPane().id, path);
1632
+ await deps.openFileInPane(receivingPane(here.id).id, path);
1516
1633
  },
1517
1634
  },
1518
1635
  {
@@ -54,6 +54,14 @@
54
54
  #toolbar.electrobun-webkit-app-region-drag {
55
55
  -webkit-app-region: drag;
56
56
  }
57
+ /* The mirror of #toolbar's own drag class above: every interactive control inside the Command Bar
58
+ carries this (commandbar.json) so Electrobun's ancestry walk finds a working no-drag signal on
59
+ the button itself instead of falling through to the toolbar's drag region. Unscoped, like
60
+ .resize-edge below, because the class name is self-describing and used nowhere else. A no-op
61
+ outside Electrobun. */
62
+ .electrobun-webkit-app-region-no-drag {
63
+ -webkit-app-region: no-drag;
64
+ }
57
65
  /* Resize edge zones */
58
66
  .resize-edge {
59
67
  position: fixed;
@@ -35,6 +35,10 @@
35
35
  "#toolbar.electrobun-webkit-app-region-drag": {
36
36
  "-webkit-app-region": "drag"
37
37
  },
38
+ ".electrobun-webkit-app-region-no-drag": {
39
+ "$description": "The mirror of #toolbar's own drag class above: every interactive control inside the Command Bar carries this (commandbar.json) so Electrobun's ancestry walk finds a working no-drag signal on the button itself instead of falling through to the toolbar's drag region. Unscoped, like .resize-edge below, because the class name is self-describing and used nowhere else. A no-op outside Electrobun.",
40
+ "-webkit-app-region": "no-drag"
41
+ },
38
42
  ".resize-edge": {
39
43
  "$description": "Resize edge zones",
40
44
  "position": "fixed",
@@ -1,46 +0,0 @@
1
- import {
2
- collectionInfo2,
3
- collectionDirs2,
4
- listCollectionEntryIds2,
5
- reloadDraftAwareGrids2,
6
- createCollectionSource2,
7
- createPagesSource2
8
- } from "./studio-1knfqgy7.js";
9
- import"./studio-gb13095a.js";
10
- import"./studio-g3jevyjt.js";
11
- import"./studio-q0a3yk4n.js";
12
- import"./studio-3773086z.js";
13
- import"./studio-tqgryxwg.js";
14
- import"./studio-mhhyamxf.js";
15
- import"./studio-8scdew0e.js";
16
- import"./studio-nq5yf5mp.js";
17
- import"./studio-1z1kcjv4.js";
18
- import"./studio-qk90fgqm.js";
19
- import"./studio-zdn2g6dt.js";
20
- import"./studio-y9zedyjn.js";
21
- import"./studio-jxp12rnj.js";
22
- import"./studio-nzzpvzx9.js";
23
- import"./studio-k75n7vhp.js";
24
- import"./studio-q3x06vmj.js";
25
- import"./studio-6ewqv390.js";
26
- import"./studio-esrxgwh6.js";
27
- import"./studio-vw7mzp6z.js";
28
- import"./studio-6nzaktvy.js";
29
- import"./studio-aj37eer3.js";
30
- import"./studio-vfq8qpjt.js";
31
- import"./studio-1k325pwf.js";
32
- import"./studio-kkqkcp3d.js";
33
- import"./studio-p1dw8wfw.js";
34
- import"./studio-yxa81f45.js";
35
- import"./studio-7r42c6ca.js";
36
- export {
37
- collectionDirs2 as collectionDirs,
38
- collectionInfo2 as collectionInfo,
39
- createCollectionSource2 as createCollectionSource,
40
- createPagesSource2 as createPagesSource,
41
- listCollectionEntryIds2 as listCollectionEntryIds,
42
- reloadDraftAwareGrids2 as reloadDraftAwareGrids
43
- };
44
-
45
- //# debugId=597BB9A23802D85864756E2164756E21
46
- //# sourceMappingURL=content-source-5mex4x1h.js.map
@@ -1,42 +0,0 @@
1
- import {
2
- createEntry2,
3
- registerContentCommands2
4
- } from "./studio-b4s9eykd.js";
5
- import"./studio-qhhm6hbt.js";
6
- import"./studio-js8nv53n.js";
7
- import"./studio-1knfqgy7.js";
8
- import"./studio-gb13095a.js";
9
- import"./studio-g3jevyjt.js";
10
- import"./studio-q0a3yk4n.js";
11
- import"./studio-3773086z.js";
12
- import"./studio-tqgryxwg.js";
13
- import"./studio-mhhyamxf.js";
14
- import"./studio-8scdew0e.js";
15
- import"./studio-nq5yf5mp.js";
16
- import"./studio-1z1kcjv4.js";
17
- import"./studio-qk90fgqm.js";
18
- import"./studio-zdn2g6dt.js";
19
- import"./studio-y9zedyjn.js";
20
- import"./studio-jxp12rnj.js";
21
- import"./studio-nzzpvzx9.js";
22
- import"./studio-k75n7vhp.js";
23
- import"./studio-q3x06vmj.js";
24
- import"./studio-6ewqv390.js";
25
- import"./studio-esrxgwh6.js";
26
- import"./studio-vw7mzp6z.js";
27
- import"./studio-6nzaktvy.js";
28
- import"./studio-aj37eer3.js";
29
- import"./studio-vfq8qpjt.js";
30
- import"./studio-1k325pwf.js";
31
- import"./studio-kkqkcp3d.js";
32
- import"./studio-p1dw8wfw.js";
33
- import"./studio-yxa81f45.js";
34
- import"./studio-7r42c6ca.js";
35
- import"./studio-tjjk7jvk.js";
36
- export {
37
- createEntry2 as createEntry,
38
- registerContentCommands2 as registerContentCommands
39
- };
40
-
41
- //# debugId=474288D19E3E71A764756E2164756E21
42
- //# sourceMappingURL=entry-commands-234hjnqw.js.map
@@ -1,40 +0,0 @@
1
- import {
2
- startLayerTitleEdit2,
3
- registerLayersPanel2
4
- } from "./studio-r6nvacqs.js";
5
- import"./studio-93zafjcm.js";
6
- import"./studio-7xnmgv66.js";
7
- import"./studio-e1pgga3k.js";
8
- import"./studio-syg2tadj.js";
9
- import"./studio-js8nv53n.js";
10
- import"./studio-q0a3yk4n.js";
11
- import"./studio-3773086z.js";
12
- import"./studio-8scdew0e.js";
13
- import"./studio-nq5yf5mp.js";
14
- import"./studio-1z1kcjv4.js";
15
- import"./studio-qk90fgqm.js";
16
- import"./studio-zdn2g6dt.js";
17
- import"./studio-y9zedyjn.js";
18
- import"./studio-jxp12rnj.js";
19
- import"./studio-nzzpvzx9.js";
20
- import"./studio-k75n7vhp.js";
21
- import"./studio-q3x06vmj.js";
22
- import"./studio-6ewqv390.js";
23
- import"./studio-esrxgwh6.js";
24
- import"./studio-vw7mzp6z.js";
25
- import"./studio-6nzaktvy.js";
26
- import"./studio-aj37eer3.js";
27
- import"./studio-vfq8qpjt.js";
28
- import"./studio-1k325pwf.js";
29
- import"./studio-kkqkcp3d.js";
30
- import"./studio-p1dw8wfw.js";
31
- import"./studio-yxa81f45.js";
32
- import"./studio-7r42c6ca.js";
33
- import"./studio-tjjk7jvk.js";
34
- export {
35
- registerLayersPanel2 as registerLayersPanel,
36
- startLayerTitleEdit2 as startLayerTitleEdit
37
- };
38
-
39
- //# debugId=0A17594D4CFC8C3764756E2164756E21
40
- //# sourceMappingURL=layers-panel-pnnghw12.js.map
@@ -1,15 +0,0 @@
1
- import {
2
- openMenu2
3
- } from "./studio-aj37eer3.js";
4
- import"./studio-vfq8qpjt.js";
5
- import"./studio-1k325pwf.js";
6
- import"./studio-kkqkcp3d.js";
7
- import"./studio-p1dw8wfw.js";
8
- import"./studio-yxa81f45.js";
9
- import"./studio-7r42c6ca.js";
10
- export {
11
- openMenu2 as openMenu
12
- };
13
-
14
- //# debugId=E452F4E209CD9CD664756E2164756E21
15
- //# sourceMappingURL=menu-9p2w46gj.js.map
@@ -1,27 +0,0 @@
1
- import {
2
- seedPublishConnected2,
3
- openPublishPanel2
4
- } from "./studio-wqz6dggm.js";
5
- import"./studio-hhvs4sdg.js";
6
- import"./studio-6xa21ej9.js";
7
- import"./studio-mhhyamxf.js";
8
- import"./studio-qk90fgqm.js";
9
- import"./studio-y9zedyjn.js";
10
- import"./studio-k75n7vhp.js";
11
- import"./studio-q3x06vmj.js";
12
- import"./studio-6ewqv390.js";
13
- import"./studio-vw7mzp6z.js";
14
- import"./studio-6nzaktvy.js";
15
- import"./studio-vfq8qpjt.js";
16
- import"./studio-1k325pwf.js";
17
- import"./studio-kkqkcp3d.js";
18
- import"./studio-p1dw8wfw.js";
19
- import"./studio-yxa81f45.js";
20
- import"./studio-7r42c6ca.js";
21
- export {
22
- openPublishPanel2 as openPublishPanel,
23
- seedPublishConnected2 as seedPublishConnected
24
- };
25
-
26
- //# debugId=6014AB98C3074CCB64756E2164756E21
27
- //# sourceMappingURL=publish-panel-5zt840sy.js.map
@@ -1,45 +0,0 @@
1
- import {
2
- initQuickSearch2,
3
- openQuickSearch2
4
- } from "./studio-a79k90n9.js";
5
- import"./studio-b0k5tqgp.js";
6
- import"./studio-5wt9nvhd.js";
7
- import"./studio-qk4bfsq2.js";
8
- import"./studio-syg2tadj.js";
9
- import"./studio-qhhm6hbt.js";
10
- import"./studio-pxbgypmg.js";
11
- import"./studio-1knfqgy7.js";
12
- import"./studio-gb13095a.js";
13
- import"./studio-g3jevyjt.js";
14
- import"./studio-q0a3yk4n.js";
15
- import"./studio-3773086z.js";
16
- import"./studio-tqgryxwg.js";
17
- import"./studio-mhhyamxf.js";
18
- import"./studio-8scdew0e.js";
19
- import"./studio-nq5yf5mp.js";
20
- import"./studio-1z1kcjv4.js";
21
- import"./studio-qk90fgqm.js";
22
- import"./studio-zdn2g6dt.js";
23
- import"./studio-y9zedyjn.js";
24
- import"./studio-jxp12rnj.js";
25
- import"./studio-nzzpvzx9.js";
26
- import"./studio-k75n7vhp.js";
27
- import"./studio-q3x06vmj.js";
28
- import"./studio-6ewqv390.js";
29
- import"./studio-esrxgwh6.js";
30
- import"./studio-vw7mzp6z.js";
31
- import"./studio-6nzaktvy.js";
32
- import"./studio-aj37eer3.js";
33
- import"./studio-vfq8qpjt.js";
34
- import"./studio-1k325pwf.js";
35
- import"./studio-kkqkcp3d.js";
36
- import"./studio-p1dw8wfw.js";
37
- import"./studio-yxa81f45.js";
38
- import"./studio-7r42c6ca.js";
39
- export {
40
- initQuickSearch2 as initQuickSearch,
41
- openQuickSearch2 as openQuickSearch
42
- };
43
-
44
- //# debugId=67B6A208739F532164756E2164756E21
45
- //# sourceMappingURL=quick-search-3748564r.js.map
@@ -1,45 +0,0 @@
1
- import {
2
- mount2,
3
- unmount2,
4
- render2,
5
- inspectorTab2,
6
- setInspectorTab2
7
- } from "./studio-try13h8c.js";
8
- import"./studio-93zafjcm.js";
9
- import"./studio-7xnmgv66.js";
10
- import"./studio-e1pgga3k.js";
11
- import"./studio-syg2tadj.js";
12
- import"./studio-js8nv53n.js";
13
- import"./studio-3773086z.js";
14
- import"./studio-8scdew0e.js";
15
- import"./studio-nq5yf5mp.js";
16
- import"./studio-1z1kcjv4.js";
17
- import"./studio-qk90fgqm.js";
18
- import"./studio-zdn2g6dt.js";
19
- import"./studio-y9zedyjn.js";
20
- import"./studio-jxp12rnj.js";
21
- import"./studio-nzzpvzx9.js";
22
- import"./studio-k75n7vhp.js";
23
- import"./studio-q3x06vmj.js";
24
- import"./studio-6ewqv390.js";
25
- import"./studio-esrxgwh6.js";
26
- import"./studio-vw7mzp6z.js";
27
- import"./studio-6nzaktvy.js";
28
- import"./studio-aj37eer3.js";
29
- import"./studio-vfq8qpjt.js";
30
- import"./studio-1k325pwf.js";
31
- import"./studio-kkqkcp3d.js";
32
- import"./studio-p1dw8wfw.js";
33
- import"./studio-yxa81f45.js";
34
- import"./studio-7r42c6ca.js";
35
- import"./studio-tjjk7jvk.js";
36
- export {
37
- inspectorTab2 as inspectorTab,
38
- mount2 as mount,
39
- render2 as render,
40
- setInspectorTab2 as setInspectorTab,
41
- unmount2 as unmount
42
- };
43
-
44
- //# debugId=ACC2FC3785A3466764756E2164756E21
45
- //# sourceMappingURL=right-panel-eccz92qt.js.map