@jxsuite/studio 6.1.1 → 6.1.2

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 (637) hide show
  1. package/dist/chunks/{2020-va2wwra4.js → 2020-f2gkpy8d.js} +3 -3
  2. package/dist/chunks/{action-group-2mqby73c.js → action-group-4aan7g6g.js} +3 -3
  3. package/dist/chunks/adapter-4912g339.js +4 -0
  4. package/dist/chunks/cf-account-picker-wccaenh6.js +4 -0
  5. package/dist/chunks/cf-settings-br6105tr.js +4 -0
  6. package/dist/chunks/color-28ksk2qm.js +4 -0
  7. package/dist/chunks/color-area-0fj8a4ga.js +4 -0
  8. package/dist/chunks/color-field-xch8kx2g.js +4 -0
  9. package/dist/chunks/color-slider-jxd8v350.js +4 -0
  10. package/dist/chunks/combobox-p0efwjke.js +4 -0
  11. package/dist/chunks/components-db68vsn7.js +4 -0
  12. package/dist/chunks/content-source-1449qesq.js +4 -0
  13. package/dist/chunks/convert-to-repeater-5h457egj.js +4 -0
  14. package/dist/chunks/dialog-c4x05vyx.js +4 -0
  15. package/dist/chunks/editor-x9jn86a7.js +4 -0
  16. package/dist/chunks/entry-commands-may24cpt.js +4 -0
  17. package/dist/chunks/extension-sections-pvr14vxr.js +4 -0
  18. package/dist/chunks/file-ops-x9v54pcj.js +4 -0
  19. package/dist/chunks/files-j3knqf0s.js +4 -0
  20. package/dist/chunks/format-host-tyre2trb.js +4 -0
  21. package/dist/chunks/fs-events-64ma9htc.js +4 -0
  22. package/dist/chunks/git-panel-84ps5dex.js +4 -0
  23. package/dist/chunks/grid-view-d2wq9ezg.js +51 -0
  24. package/dist/chunks/icons-pnfz478q.js +4 -0
  25. package/dist/chunks/iframe-entry-fvbk89gm.js +5 -0
  26. package/dist/chunks/iframe-entry-jdcktez8.js +5 -0
  27. package/dist/chunks/iframe-entry-x0ygf2yr.js +5 -0
  28. package/dist/chunks/iframe-entry-zap785cw.js +5 -0
  29. package/dist/chunks/iframe-host-ck6vejt5.js +4 -0
  30. package/dist/chunks/index-b8xw3vy9.js +4 -0
  31. package/dist/chunks/{index-2veqmnhr.js → index-zpjmzqfk.js} +3 -3
  32. package/dist/chunks/{javascript-8nbvs12s.js → javascript-m54mnwp6.js} +3 -3
  33. package/dist/chunks/{jsonMode-s8kt9dsj.js → jsonMode-w15cmrcm.js} +8 -8
  34. package/dist/chunks/jx-validate-at3zn8wa.js +4 -0
  35. package/dist/chunks/layers-h4xp1pss.js +4 -0
  36. package/dist/chunks/layers-panel-m5hw1d7g.js +4 -0
  37. package/dist/chunks/listbox-e74qjyq6.js +4 -0
  38. package/dist/chunks/lit-html-8t8t3dnr.js +4 -0
  39. package/dist/chunks/media-picker-2cweexc5.js +4 -0
  40. package/dist/chunks/menu-n6yzswmy.js +4 -0
  41. package/dist/chunks/menu-ynw13y0s.js +4 -0
  42. package/dist/chunks/monaco-binding-7gx83x3r.js +4 -0
  43. package/dist/chunks/monaco-buffer-qzxn567r.js +4 -0
  44. package/dist/chunks/monaco-setup-gxf6656g.js +4 -0
  45. package/dist/chunks/notify-cj5zbrs2.js +4 -0
  46. package/dist/chunks/number-field-y62xq0ty.js +4 -0
  47. package/dist/chunks/parse-b7ddhr8m.js +4 -0
  48. package/dist/chunks/platform-3dfws9js.js +4 -0
  49. package/dist/chunks/popover-jt2gxmzs.js +4 -0
  50. package/dist/chunks/publish-panel-1gvxbj21.js +4 -0
  51. package/dist/chunks/quick-search-0dajrwqg.js +4 -0
  52. package/dist/chunks/references-49qgt404.js +4 -0
  53. package/dist/chunks/right-panel-jm1bwe53.js +4 -0
  54. package/dist/chunks/section-registry-6kwc4fky.js +4 -0
  55. package/dist/chunks/select-rzds841e.js +4 -0
  56. package/dist/chunks/split-n2gfpm5m.js +4 -0
  57. package/dist/chunks/{studio-1q1sh2ax.js → studio-0q988f9w.js} +3 -3
  58. package/dist/chunks/studio-0rt52vpq.js +5 -0
  59. package/dist/chunks/studio-18vgbhs5.js +5 -0
  60. package/dist/chunks/{studio-h46vtzk8.js → studio-1fxkaaea.js} +4 -4
  61. package/dist/chunks/studio-24mccdrj.js +5 -0
  62. package/dist/chunks/studio-2eh507zk.js +9 -0
  63. package/dist/chunks/studio-2hcbccfv.js +5 -0
  64. package/dist/chunks/studio-2j1cb95x.js +5 -0
  65. package/dist/chunks/studio-2jbs3rxv.js +5 -0
  66. package/dist/chunks/{studio-rv11kfwa.js → studio-485046te.js} +7 -7
  67. package/dist/chunks/studio-4h8k4dw9.js +5 -0
  68. package/dist/chunks/studio-5f6n18kx.js +5 -0
  69. package/dist/chunks/studio-5gthpky6.js +5 -0
  70. package/dist/chunks/studio-5ve6bbep.js +5 -0
  71. package/dist/chunks/studio-6ep3js6b.js +9 -0
  72. package/dist/chunks/studio-6wkmf3wz.js +9 -0
  73. package/dist/chunks/studio-841rf3cg.js +5 -0
  74. package/dist/chunks/studio-8gmwgheg.js +5 -0
  75. package/dist/chunks/studio-8qm0ep50.js +5 -0
  76. package/dist/chunks/{studio-8grwxtqk.js → studio-90pq9km1.js} +4 -4
  77. package/dist/chunks/studio-924p1tm1.js +6 -0
  78. package/dist/chunks/{studio-pre0skq6.js → studio-a3g98wjr.js} +4 -4
  79. package/dist/chunks/studio-a3shpz9y.js +5 -0
  80. package/dist/chunks/studio-amsbaaar.js +6 -0
  81. package/dist/chunks/studio-at5spjbc.js +7 -0
  82. package/dist/chunks/studio-b2xv945e.js +5 -0
  83. package/dist/chunks/studio-bn5nkafw.js +5 -0
  84. package/dist/chunks/studio-bw6q5xjf.js +9 -0
  85. package/dist/chunks/studio-c7q0t9x1.js +5 -0
  86. package/dist/chunks/studio-camnhc96.js +6 -0
  87. package/dist/chunks/studio-cffqvnzd.js +5 -0
  88. package/dist/chunks/studio-d81xfh1g.js +5 -0
  89. package/dist/chunks/studio-dgz8d0c1.js +5 -0
  90. package/dist/chunks/studio-efvfrsf8.js +5 -0
  91. package/dist/chunks/studio-er30bpcx.js +5 -0
  92. package/dist/chunks/studio-ezscgr64.js +5 -0
  93. package/dist/chunks/studio-ffrrncvz.js +5 -0
  94. package/dist/chunks/studio-fpphgn8y.js +10 -0
  95. package/dist/chunks/studio-j1kvhdjk.js +4 -0
  96. package/dist/chunks/{studio-vrmcjf9g.js → studio-j430n16g.js} +5 -5
  97. package/dist/chunks/studio-jjkg84nj.js +5 -0
  98. package/dist/chunks/studio-m0q32ars.js +4 -0
  99. package/dist/chunks/studio-m6bdst11.js +5 -0
  100. package/dist/chunks/studio-nv2cptd4.js +64 -0
  101. package/dist/chunks/studio-nwfrc98n.js +5 -0
  102. package/dist/chunks/studio-p1wgvp7r.js +5 -0
  103. package/dist/chunks/studio-pag2wncm.js +5 -0
  104. package/dist/chunks/studio-qvanvzfd.js +5 -0
  105. package/dist/chunks/studio-qwa64kt7.js +5 -0
  106. package/dist/chunks/studio-rk1zc4x3.js +928 -0
  107. package/dist/chunks/studio-se2r3ptc.js +5 -0
  108. package/dist/chunks/studio-sg2a0dh0.js +5 -0
  109. package/dist/chunks/studio-tjzjhe68.js +5 -0
  110. package/dist/chunks/{studio-wszjyh0j.js → studio-tq0rtfwj.js} +4 -4
  111. package/dist/chunks/{studio-kggey1jt.js → studio-v0jzqdjm.js} +4 -4
  112. package/dist/chunks/studio-v2w7q8r1.js +7 -0
  113. package/dist/chunks/studio-v5vjq1h0.js +4 -0
  114. package/dist/chunks/studio-v8aga3vp.js +14 -0
  115. package/dist/chunks/studio-vfcdrfmv.js +5 -0
  116. package/dist/chunks/studio-vmfkgdjf.js +5 -0
  117. package/dist/chunks/studio-wt1816jj.js +5 -0
  118. package/dist/chunks/studio-wz73q5kq.js +4 -0
  119. package/dist/chunks/studio-y04qtxvp.js +7 -0
  120. package/dist/chunks/studio-y21g8zzg.js +5 -0
  121. package/dist/chunks/{studio-zey7zsdw.js → studio-y64hrt8p.js} +7 -7
  122. package/dist/chunks/studio-ynn90f58.js +16 -0
  123. package/dist/chunks/studio-yxz682sx.js +5 -0
  124. package/dist/chunks/studio-zp7snvkq.js +5 -0
  125. package/dist/chunks/studio-zq4z6tm6.js +5 -0
  126. package/dist/chunks/swatch-group-ewh24n1f.js +4 -0
  127. package/dist/chunks/tabs-f5cw3tgp.js +4 -0
  128. package/dist/chunks/textfield-wewc8rq2.js +4 -0
  129. package/dist/chunks/toast-c9fn075p.js +4 -0
  130. package/dist/chunks/toast-host-ke5z4ng7.js +4 -0
  131. package/dist/chunks/{toolbar-2nnzqhrj.js → toolbar-44cm5cta.js} +3 -3
  132. package/dist/chunks/tooltip-5v8ngwj2.js +4 -0
  133. package/dist/chunks/tree-mdq3v5cw.js +4 -0
  134. package/dist/chunks/{tsMode-2frah6h1.js → tsMode-sf49ee9x.js} +7 -7
  135. package/dist/chunks/workspace-jtfahpee.js +4 -0
  136. package/dist/chunks/ws-client-nze0k6mv.js +4 -0
  137. package/dist/iframe-entry.js +16 -16
  138. package/dist/manifest.json +63 -63
  139. package/dist/studio.js +97 -97
  140. package/package.json +6 -6
  141. package/src/about/about-modal.ts +4 -3
  142. package/src/account/action-flow.ts +45 -38
  143. package/src/account-status.ts +7 -2
  144. package/src/browse/library-layouts.ts +8 -5
  145. package/src/browse/library-model.ts +18 -6
  146. package/src/browse/library-pane.ts +37 -21
  147. package/src/browse/library-preview.ts +14 -9
  148. package/src/browse/library-source.ts +1 -1
  149. package/src/canvas/asset-refs.ts +24 -9
  150. package/src/canvas/asset-resolve.ts +19 -23
  151. package/src/canvas/canvas-helpers.ts +7 -6
  152. package/src/canvas/canvas-live-render.ts +44 -53
  153. package/src/canvas/canvas-patcher.ts +30 -30
  154. package/src/canvas/canvas-perf.ts +11 -5
  155. package/src/canvas/canvas-render.ts +62 -41
  156. package/src/canvas/canvas-surface.ts +5 -3
  157. package/src/canvas/canvas-utils.ts +90 -49
  158. package/src/canvas/dialog-path.ts +9 -4
  159. package/src/canvas/dialog-state.ts +1 -2
  160. package/src/canvas/diff-marks.ts +9 -16
  161. package/src/canvas/diff-toolbar.ts +8 -7
  162. package/src/canvas/edit-width-drag.ts +4 -1
  163. package/src/canvas/edit-width.ts +1 -3
  164. package/src/canvas/iframe-channel.ts +27 -13
  165. package/src/canvas/iframe-drop.ts +13 -12
  166. package/src/canvas/iframe-editable-root.ts +29 -16
  167. package/src/canvas/iframe-entry.ts +80 -63
  168. package/src/canvas/iframe-eval.ts +73 -49
  169. package/src/canvas/iframe-host.ts +135 -96
  170. package/src/canvas/iframe-inline-edit.ts +49 -30
  171. package/src/canvas/iframe-insert.ts +5 -4
  172. package/src/canvas/iframe-interaction.ts +30 -25
  173. package/src/canvas/iframe-overlay.ts +1 -1
  174. package/src/canvas/iframe-patch.ts +18 -15
  175. package/src/canvas/iframe-position.ts +12 -6
  176. package/src/canvas/iframe-protocol.ts +12 -16
  177. package/src/canvas/iframe-render.ts +36 -34
  178. package/src/canvas/iframe-slash.ts +24 -11
  179. package/src/canvas/iframe-subtree.ts +6 -2
  180. package/src/canvas/path-mapping.ts +19 -12
  181. package/src/canvas/popover-path.ts +7 -3
  182. package/src/canvas/popover-state.ts +1 -2
  183. package/src/canvas/serialize-scope.ts +13 -5
  184. package/src/canvas/stage-scrollbar.ts +2 -1
  185. package/src/canvas/surface-registry.ts +21 -3
  186. package/src/collab/collab-commands.ts +7 -2
  187. package/src/collab/collab-session.ts +84 -45
  188. package/src/collab/collab-state.ts +4 -3
  189. package/src/collab/monaco-binding.ts +16 -13
  190. package/src/collab/monaco-cursors.ts +5 -2
  191. package/src/commands/budget.ts +3 -3
  192. package/src/commands/command-args.ts +103 -71
  193. package/src/commands/context.ts +22 -20
  194. package/src/commands/keymap.ts +47 -43
  195. package/src/commands/levels.ts +3 -3
  196. package/src/commands/live-context.ts +7 -7
  197. package/src/commands/reference.ts +2 -1
  198. package/src/commands/registry.ts +12 -10
  199. package/src/commands/run-reported.ts +15 -10
  200. package/src/component-props.ts +46 -30
  201. package/src/content/collection-match.ts +5 -4
  202. package/src/content/draft-state.ts +4 -3
  203. package/src/content/entry-commands.ts +3 -2
  204. package/src/content/entry-editor.ts +29 -17
  205. package/src/content/entry-fields.ts +12 -7
  206. package/src/content/entry-model.ts +21 -12
  207. package/src/editor/canvas-context-menu.ts +1 -2
  208. package/src/editor/canvas-slash-bridge.ts +3 -6
  209. package/src/editor/content-slice.ts +16 -14
  210. package/src/editor/context-menu.ts +35 -22
  211. package/src/editor/convert-targets.ts +30 -35
  212. package/src/editor/convert-to-component.ts +11 -5
  213. package/src/editor/convert-to-repeater.ts +34 -22
  214. package/src/editor/editable-tags.ts +17 -2
  215. package/src/editor/file-drop-action.ts +21 -22
  216. package/src/editor/inline-edit-apply.ts +35 -17
  217. package/src/editor/inline-edit.ts +66 -50
  218. package/src/editor/inline-format.ts +59 -56
  219. package/src/editor/inline-link.ts +40 -15
  220. package/src/editor/insert-zone-action.ts +1 -1
  221. package/src/editor/merge-tags.ts +58 -19
  222. package/src/editor/repeater-scope.ts +39 -28
  223. package/src/editor/shortcuts.ts +32 -20
  224. package/src/editor/slash-menu.ts +1 -6
  225. package/src/files/asset-versions.ts +4 -4
  226. package/src/files/components.ts +15 -10
  227. package/src/files/elements.ts +5 -6
  228. package/src/files/file-ops.ts +77 -36
  229. package/src/files/files.ts +90 -95
  230. package/src/files/media-meta.ts +2 -1
  231. package/src/files/media-paths.ts +3 -0
  232. package/src/files/serialize-document.ts +2 -2
  233. package/src/format/constraints.ts +1 -1
  234. package/src/format/convert-file.ts +27 -13
  235. package/src/format/format-choices.ts +2 -1
  236. package/src/format/format-host.ts +76 -50
  237. package/src/github/github-auth-status.ts +27 -3
  238. package/src/github/github-auth.ts +19 -9
  239. package/src/github/github-publish.ts +24 -20
  240. package/src/grid/cell-editors.ts +46 -31
  241. package/src/grid/cell-popovers.ts +5 -3
  242. package/src/grid/edit-buffer.ts +10 -9
  243. package/src/grid/grid-controller.ts +20 -22
  244. package/src/grid/grid-layout.ts +21 -5
  245. package/src/grid/grid-open.ts +3 -6
  246. package/src/grid/grid-panel.ts +11 -4
  247. package/src/grid/grid-source.ts +8 -8
  248. package/src/grid/grid-view.ts +14 -17
  249. package/src/grid/redirects-grid.ts +14 -5
  250. package/src/grid/redirects.ts +16 -14
  251. package/src/grid/schema-columns.ts +25 -19
  252. package/src/grid/sources/connector-source.ts +47 -20
  253. package/src/grid/sources/content-source.ts +25 -24
  254. package/src/grid/sources/csv-file-source.ts +2 -2
  255. package/src/grid/tabulator-tables.d.ts +55 -34
  256. package/src/hosting/stage.ts +7 -7
  257. package/src/i18n/i18n-commands.ts +1 -2
  258. package/src/media/media-pane.ts +4 -1
  259. package/src/new-project/add-repo-modal.ts +20 -19
  260. package/src/new-project/import-tab.ts +10 -14
  261. package/src/new-project/location-fields.ts +2 -1
  262. package/src/new-project/new-project-modal.ts +12 -9
  263. package/src/packages/jxsuite-update.ts +4 -3
  264. package/src/packages/pull-package-sync.ts +26 -25
  265. package/src/page-params.ts +97 -68
  266. package/src/panels/activity-panel.ts +17 -9
  267. package/src/panels/ai-chat/attached-context.ts +13 -7
  268. package/src/panels/ai-chat/chat-view.ts +80 -73
  269. package/src/panels/ai-chat/composer.ts +30 -33
  270. package/src/panels/ai-chat/sessions-view.ts +1 -2
  271. package/src/panels/ai-panel.ts +23 -20
  272. package/src/panels/block-action-bar.ts +46 -35
  273. package/src/panels/bottom-dock.ts +5 -3
  274. package/src/panels/canvas-dnd-bridge.ts +31 -24
  275. package/src/panels/data-explorer.ts +62 -25
  276. package/src/panels/data-grid.ts +14 -11
  277. package/src/panels/dnd.ts +108 -118
  278. package/src/panels/editors.ts +52 -21
  279. package/src/panels/elements-panel.ts +10 -3
  280. package/src/panels/events-panel.ts +84 -69
  281. package/src/panels/formula-workspace.ts +76 -51
  282. package/src/panels/frontmatter-fields.ts +24 -19
  283. package/src/panels/frontmatter-panel.ts +44 -34
  284. package/src/panels/git-diff-open.ts +4 -4
  285. package/src/panels/git-panel.ts +49 -61
  286. package/src/panels/head-panel.ts +131 -111
  287. package/src/panels/i18n-panel.ts +10 -3
  288. package/src/panels/imports-panel.ts +23 -47
  289. package/src/panels/jump-bar.ts +48 -29
  290. package/src/panels/layers-panel.ts +97 -74
  291. package/src/panels/left-panel.ts +3 -3
  292. package/src/panels/pane-context.ts +31 -22
  293. package/src/panels/pane-grid.ts +49 -20
  294. package/src/panels/panel-registry.ts +22 -37
  295. package/src/panels/properties-panel.ts +175 -121
  296. package/src/panels/quick-search.ts +53 -31
  297. package/src/panels/right-panel.ts +3 -3
  298. package/src/panels/seo-modal.ts +13 -17
  299. package/src/panels/settings-menu.ts +15 -15
  300. package/src/panels/signals-panel.ts +153 -131
  301. package/src/panels/statement-editor.ts +230 -140
  302. package/src/panels/style-panel.ts +218 -205
  303. package/src/panels/style-utils.ts +114 -51
  304. package/src/panels/stylebook-doc.ts +57 -54
  305. package/src/panels/stylebook-layers-panel.ts +9 -9
  306. package/src/panels/stylebook-panel.ts +13 -17
  307. package/src/panels/tab-drop.ts +27 -11
  308. package/src/panels/tab-strip.ts +36 -26
  309. package/src/platform-errors.ts +57 -43
  310. package/src/platform.ts +58 -30
  311. package/src/platforms/cloud.ts +345 -175
  312. package/src/platforms/default-platform.ts +10 -4
  313. package/src/platforms/devserver.ts +129 -117
  314. package/src/platforms/read-batcher.ts +16 -8
  315. package/src/project-list.ts +2 -1
  316. package/src/publish/deploy-checklist.ts +8 -2
  317. package/src/publish/pages-service.ts +28 -13
  318. package/src/publish/publish-commands.ts +5 -4
  319. package/src/publish/publish-panel.ts +10 -6
  320. package/src/recent-projects.ts +15 -8
  321. package/src/resize-edges.ts +26 -36
  322. package/src/services/a11y-report.ts +26 -19
  323. package/src/services/agent-seed.ts +23 -11
  324. package/src/services/ai-ask.ts +9 -12
  325. package/src/services/ai-command-tools.ts +68 -62
  326. package/src/services/ai-import-tools.ts +80 -67
  327. package/src/services/ai-models.ts +17 -13
  328. package/src/services/ai-project-tools.ts +68 -32
  329. package/src/services/ai-session-store.ts +19 -10
  330. package/src/services/ai-system-prompt.ts +46 -20
  331. package/src/services/ai-tools.ts +71 -27
  332. package/src/services/ai-write-report.ts +20 -12
  333. package/src/services/ai-writes.ts +4 -4
  334. package/src/services/automation.ts +58 -31
  335. package/src/services/cem-export.ts +149 -58
  336. package/src/services/clock.ts +6 -1
  337. package/src/services/code-services.ts +37 -31
  338. package/src/services/context-manager.ts +14 -10
  339. package/src/services/context-resolver.ts +20 -8
  340. package/src/services/data-service.ts +19 -15
  341. package/src/services/directory-picker.ts +18 -12
  342. package/src/services/document-assistant.ts +39 -19
  343. package/src/services/gated-registry.ts +10 -6
  344. package/src/services/harness/chat-reducer.ts +23 -1
  345. package/src/services/import-client.ts +91 -38
  346. package/src/services/import-seed.ts +8 -2
  347. package/src/services/jx-validate.ts +28 -31
  348. package/src/services/live-preview.ts +0 -0
  349. package/src/services/live-surfaces.ts +6 -3
  350. package/src/services/model-uri.ts +10 -2
  351. package/src/services/module-preloads.ts +12 -8
  352. package/src/services/monaco-buffer.ts +43 -24
  353. package/src/services/monaco-lazy.ts +7 -8
  354. package/src/services/monaco-setup.ts +23 -16
  355. package/src/services/notify.ts +44 -17
  356. package/src/services/popover-report.ts +25 -10
  357. package/src/services/preview-eval.ts +20 -8
  358. package/src/services/profile.ts +13 -6
  359. package/src/services/project-path.ts +13 -10
  360. package/src/services/references.ts +0 -0
  361. package/src/services/render-critic.ts +8 -7
  362. package/src/services/settings/kernel.ts +13 -4
  363. package/src/services/settings/write-queue.ts +9 -9
  364. package/src/services/token-lint.ts +12 -10
  365. package/src/services/tool-executor.ts +17 -5
  366. package/src/services/tool-outcomes.ts +44 -24
  367. package/src/services/trusted-types.ts +24 -7
  368. package/src/settings/contexts-section.ts +11 -8
  369. package/src/settings/contributed-section.ts +79 -60
  370. package/src/settings/css-vars-editor.ts +37 -16
  371. package/src/settings/defs-editor.ts +38 -35
  372. package/src/settings/extension-rows.ts +16 -8
  373. package/src/settings/extension-sections.ts +23 -13
  374. package/src/settings/extensions-section.ts +4 -1
  375. package/src/settings/general-settings.ts +11 -8
  376. package/src/settings/locales-section.ts +20 -12
  377. package/src/settings/preferences-dialog.ts +9 -6
  378. package/src/settings/preferences-keymap.ts +7 -5
  379. package/src/settings/preferences-sections.ts +11 -5
  380. package/src/settings/project-sections.ts +1 -1
  381. package/src/settings/schema-field-ui.ts +9 -0
  382. package/src/settings/settings-document.ts +5 -5
  383. package/src/shell/tree.ts +6 -5
  384. package/src/shell.ts +104 -81
  385. package/src/site-context.ts +37 -22
  386. package/src/state.ts +41 -49
  387. package/src/store.ts +54 -34
  388. package/src/studio.ts +25 -75
  389. package/src/style/live-preview.ts +1 -1
  390. package/src/style/project-styles.ts +6 -7
  391. package/src/style/token-ref.ts +5 -4
  392. package/src/surfaces/about.ts +18 -19
  393. package/src/surfaces/add-repo.ts +17 -19
  394. package/src/surfaces/ai-chat.ts +31 -36
  395. package/src/surfaces/ai-credentials-form.ts +6 -16
  396. package/src/surfaces/ai-managed-connect.ts +3 -4
  397. package/src/surfaces/ai-model-picker.ts +3 -5
  398. package/src/surfaces/block-action-bar.ts +22 -11
  399. package/src/surfaces/boot-failure.ts +4 -5
  400. package/src/surfaces/bottom-dock.ts +9 -18
  401. package/src/surfaces/canvas-stage.ts +12 -11
  402. package/src/surfaces/cf-account-picker.ts +17 -18
  403. package/src/surfaces/commandbar.ts +14 -9
  404. package/src/surfaces/convert-repeater.ts +17 -19
  405. package/src/surfaces/data-actions.ts +9 -7
  406. package/src/surfaces/dialog.ts +26 -28
  407. package/src/surfaces/diff-toolbar.ts +9 -7
  408. package/src/surfaces/doc-header.ts +10 -19
  409. package/src/surfaces/empty-state.ts +7 -10
  410. package/src/surfaces/entry-editor.ts +14 -11
  411. package/src/surfaces/expression-editor.ts +11 -25
  412. package/src/surfaces/files-panel.ts +27 -14
  413. package/src/surfaces/formula-palette.ts +4 -5
  414. package/src/surfaces/git-panel.ts +7 -15
  415. package/src/surfaces/github-auth.ts +16 -20
  416. package/src/surfaces/github-publish.ts +17 -22
  417. package/src/surfaces/grid-cell.ts +30 -31
  418. package/src/surfaces/grid-open.ts +10 -14
  419. package/src/surfaces/grid-panel.ts +13 -9
  420. package/src/surfaces/grid-replace.ts +13 -13
  421. package/src/surfaces/grid-views.ts +15 -18
  422. package/src/surfaces/inspector-dock.ts +13 -12
  423. package/src/surfaces/jump-bar.ts +5 -6
  424. package/src/surfaces/jxsuite-update.ts +16 -22
  425. package/src/surfaces/library-pane.ts +19 -20
  426. package/src/surfaces/logic-panel.ts +17 -30
  427. package/src/surfaces/logic-workspace.ts +13 -15
  428. package/src/surfaces/media-browser.ts +11 -10
  429. package/src/surfaces/media-field.ts +4 -5
  430. package/src/surfaces/media-pane.ts +8 -7
  431. package/src/surfaces/menu.ts +29 -23
  432. package/src/surfaces/navigator-dock.ts +11 -12
  433. package/src/surfaces/new-project.ts +27 -26
  434. package/src/surfaces/pane-context.ts +20 -25
  435. package/src/surfaces/pane-grid.ts +15 -10
  436. package/src/surfaces/panel-activity.ts +5 -6
  437. package/src/surfaces/panel-data.ts +3 -4
  438. package/src/surfaces/panel-deploy-checklist.ts +5 -6
  439. package/src/surfaces/panel-elements.ts +5 -7
  440. package/src/surfaces/panel-i18n.ts +5 -7
  441. package/src/surfaces/panel-imports.ts +6 -13
  442. package/src/surfaces/panel-outline.ts +25 -19
  443. package/src/surfaces/panel-page.ts +11 -18
  444. package/src/surfaces/panel-problems.ts +5 -7
  445. package/src/surfaces/panel-signals.ts +20 -34
  446. package/src/surfaces/panel-stylebook-layers.ts +5 -8
  447. package/src/surfaces/preferences.ts +21 -11
  448. package/src/surfaces/progress-modal.ts +15 -9
  449. package/src/surfaces/properties-panel.json +1 -1
  450. package/src/surfaces/properties-panel.ts +20 -42
  451. package/src/surfaces/publish.ts +18 -18
  452. package/src/surfaces/push-plan.ts +7 -8
  453. package/src/surfaces/rail.ts +13 -13
  454. package/src/surfaces/reference-field.ts +11 -15
  455. package/src/surfaces/schema-builder.ts +16 -22
  456. package/src/surfaces/schema-form.ts +15 -25
  457. package/src/surfaces/secret-field.ts +9 -6
  458. package/src/surfaces/seo.ts +21 -15
  459. package/src/surfaces/settings-contexts.ts +9 -7
  460. package/src/surfaces/settings-contributed.ts +14 -10
  461. package/src/surfaces/settings-css-vars.ts +5 -12
  462. package/src/surfaces/settings-defs.json +2 -2
  463. package/src/surfaces/settings-defs.ts +17 -21
  464. package/src/surfaces/settings-deploy.ts +8 -15
  465. package/src/surfaces/settings-extensions.ts +5 -6
  466. package/src/surfaces/settings-head.ts +33 -39
  467. package/src/surfaces/settings-locales.ts +8 -20
  468. package/src/surfaces/settings-overview.ts +5 -6
  469. package/src/surfaces/settings-packages.ts +8 -7
  470. package/src/surfaces/settings-pane.ts +9 -18
  471. package/src/surfaces/settings-rawjson.ts +5 -6
  472. package/src/surfaces/shell.ts +1 -2
  473. package/src/surfaces/slash-menu.ts +19 -9
  474. package/src/surfaces/statements.ts +13 -18
  475. package/src/surfaces/statusbar.ts +17 -14
  476. package/src/surfaces/style-panel.ts +18 -31
  477. package/src/surfaces/stylebook-chrome.ts +3 -5
  478. package/src/surfaces/tab-strip.ts +14 -13
  479. package/src/surfaces/target-line.ts +6 -7
  480. package/src/surfaces/welcome.ts +5 -7
  481. package/src/tabs/patch-ops.ts +4 -3
  482. package/src/tabs/project-config.ts +32 -21
  483. package/src/tabs/selection.ts +36 -8
  484. package/src/tabs/tab.ts +52 -41
  485. package/src/tabs/transact.ts +98 -53
  486. package/src/types.ts +32 -17
  487. package/src/ui/ai-credentials-form.ts +10 -13
  488. package/src/ui/ai-model-picker.ts +3 -3
  489. package/src/ui/cf-account-picker.ts +7 -9
  490. package/src/ui/color-selector.ts +9 -5
  491. package/src/ui/dynamic-slot.ts +7 -8
  492. package/src/ui/expression-editor.ts +112 -105
  493. package/src/ui/form-controls.ts +57 -48
  494. package/src/ui/formula-catalog.ts +239 -230
  495. package/src/ui/formula-chips.ts +33 -18
  496. package/src/ui/layers.ts +44 -31
  497. package/src/ui/media-picker.ts +18 -9
  498. package/src/ui/popover-surface.ts +20 -12
  499. package/src/ui/progress-modal.ts +13 -8
  500. package/src/ui/regions.ts +7 -6
  501. package/src/ui/schema-form.ts +113 -70
  502. package/src/ui/surface.ts +71 -8
  503. package/src/ui/timing.ts +9 -0
  504. package/src/ui/value-source.ts +44 -31
  505. package/src/ui/virtual-window.ts +3 -2
  506. package/src/utils/base64.ts +3 -1
  507. package/src/utils/edit-display.ts +73 -73
  508. package/src/utils/element-selectors.ts +3 -2
  509. package/src/utils/google-fonts.ts +15 -14
  510. package/src/utils/inherited-style.ts +18 -20
  511. package/src/utils/link-target.ts +1 -1
  512. package/src/utils/preview-format.ts +25 -3
  513. package/src/utils/strip-events.ts +49 -22
  514. package/src/utils/studio-utils.ts +29 -14
  515. package/src/view.ts +2 -3
  516. package/src/workspace/pane-derive.ts +10 -12
  517. package/src/workspace/session.ts +53 -43
  518. package/src/workspace/workspace.ts +40 -36
  519. package/dist/chunks/adapter-f93pafd7.js +0 -4
  520. package/dist/chunks/cf-account-picker-af1h381v.js +0 -4
  521. package/dist/chunks/cf-settings-125tdm0w.js +0 -4
  522. package/dist/chunks/color-area-jqhna8zy.js +0 -4
  523. package/dist/chunks/color-field-embq5ctg.js +0 -4
  524. package/dist/chunks/color-fpezvnkt.js +0 -4
  525. package/dist/chunks/color-slider-1qmw7wqy.js +0 -4
  526. package/dist/chunks/combobox-773hdzyj.js +0 -4
  527. package/dist/chunks/components-ax2f1fnn.js +0 -4
  528. package/dist/chunks/content-source-108aqtk1.js +0 -4
  529. package/dist/chunks/convert-to-repeater-ry5rmppr.js +0 -4
  530. package/dist/chunks/dialog-mtm9fq5t.js +0 -4
  531. package/dist/chunks/editor-pfgdmkb0.js +0 -4
  532. package/dist/chunks/entry-commands-t0k1q0kx.js +0 -4
  533. package/dist/chunks/extension-sections-6mwh2hf8.js +0 -4
  534. package/dist/chunks/file-ops-meej5mqf.js +0 -4
  535. package/dist/chunks/files-44vp8a2s.js +0 -4
  536. package/dist/chunks/format-host-7q1petb9.js +0 -4
  537. package/dist/chunks/fs-events-h2mwnxaz.js +0 -4
  538. package/dist/chunks/git-panel-zngbymvd.js +0 -4
  539. package/dist/chunks/grid-view-sx9vynsp.js +0 -51
  540. package/dist/chunks/icons-p44xhjf0.js +0 -4
  541. package/dist/chunks/iframe-entry-f7mqjwpm.js +0 -5
  542. package/dist/chunks/iframe-entry-haw7jkvz.js +0 -5
  543. package/dist/chunks/iframe-entry-z6qrytv3.js +0 -5
  544. package/dist/chunks/iframe-host-qk3ycq87.js +0 -4
  545. package/dist/chunks/index-wkyfjeqz.js +0 -4
  546. package/dist/chunks/jx-validate-psgd7vsx.js +0 -4
  547. package/dist/chunks/layers-panel-1kq2jyfk.js +0 -4
  548. package/dist/chunks/layers-xd92fg8d.js +0 -4
  549. package/dist/chunks/listbox-s8fkmnq8.js +0 -4
  550. package/dist/chunks/lit-html-ac4cwwr4.js +0 -4
  551. package/dist/chunks/media-picker-0svzkdyb.js +0 -4
  552. package/dist/chunks/menu-37d07z9m.js +0 -4
  553. package/dist/chunks/menu-5c55ea3d.js +0 -4
  554. package/dist/chunks/monaco-binding-z6r70pdt.js +0 -4
  555. package/dist/chunks/monaco-buffer-fz6gq5y7.js +0 -4
  556. package/dist/chunks/monaco-setup-q4axkgj7.js +0 -4
  557. package/dist/chunks/notify-0xgtn8q1.js +0 -4
  558. package/dist/chunks/number-field-gw7sq8rn.js +0 -4
  559. package/dist/chunks/parse-897fvqah.js +0 -4
  560. package/dist/chunks/platform-v1qctbe6.js +0 -4
  561. package/dist/chunks/popover-8htra4er.js +0 -4
  562. package/dist/chunks/publish-panel-ym1fmgq5.js +0 -4
  563. package/dist/chunks/quick-search-a54e6t5n.js +0 -4
  564. package/dist/chunks/references-gmqp82fs.js +0 -4
  565. package/dist/chunks/right-panel-v7t9awbk.js +0 -4
  566. package/dist/chunks/section-registry-vhyf3zsr.js +0 -4
  567. package/dist/chunks/select-n3v7gwas.js +0 -4
  568. package/dist/chunks/split-pff8f3ze.js +0 -4
  569. package/dist/chunks/studio-0bhx5hz6.js +0 -5
  570. package/dist/chunks/studio-0k1ddnyy.js +0 -6
  571. package/dist/chunks/studio-1b04pd0j.js +0 -64
  572. package/dist/chunks/studio-4dwbj6gb.js +0 -5
  573. package/dist/chunks/studio-4tanh828.js +0 -5
  574. package/dist/chunks/studio-55h4mstj.js +0 -4
  575. package/dist/chunks/studio-5tnvjkz4.js +0 -5
  576. package/dist/chunks/studio-60dqgb0c.js +0 -5
  577. package/dist/chunks/studio-61dp09qg.js +0 -9
  578. package/dist/chunks/studio-63epcrj2.js +0 -5
  579. package/dist/chunks/studio-74k29dy9.js +0 -5
  580. package/dist/chunks/studio-7vg6jcd3.js +0 -5
  581. package/dist/chunks/studio-7zx31knw.js +0 -9
  582. package/dist/chunks/studio-8bxk97km.js +0 -5
  583. package/dist/chunks/studio-933e30n4.js +0 -5
  584. package/dist/chunks/studio-98wnwhbg.js +0 -5
  585. package/dist/chunks/studio-9mccjwjh.js +0 -14
  586. package/dist/chunks/studio-a2ke1e4t.js +0 -5
  587. package/dist/chunks/studio-e3a2a6v3.js +0 -4
  588. package/dist/chunks/studio-e81q1vb9.js +0 -5
  589. package/dist/chunks/studio-epgrmqqm.js +0 -5
  590. package/dist/chunks/studio-ery42sqr.js +0 -4
  591. package/dist/chunks/studio-g1shz58g.js +0 -5
  592. package/dist/chunks/studio-gf0fz03c.js +0 -5
  593. package/dist/chunks/studio-gjtpe62q.js +0 -6
  594. package/dist/chunks/studio-gkskhg7m.js +0 -5
  595. package/dist/chunks/studio-gx4dnjzd.js +0 -5
  596. package/dist/chunks/studio-j03zga3y.js +0 -9
  597. package/dist/chunks/studio-jhpxeckz.js +0 -5
  598. package/dist/chunks/studio-k01r7ykp.js +0 -5
  599. package/dist/chunks/studio-kk7h30ne.js +0 -7
  600. package/dist/chunks/studio-kt1zqney.js +0 -5
  601. package/dist/chunks/studio-m3cwhvye.js +0 -5
  602. package/dist/chunks/studio-mcayt6hz.js +0 -5
  603. package/dist/chunks/studio-myjcghv3.js +0 -5
  604. package/dist/chunks/studio-n8bxwc3y.js +0 -4
  605. package/dist/chunks/studio-ngm8gvpb.js +0 -5
  606. package/dist/chunks/studio-nj5a01jy.js +0 -928
  607. package/dist/chunks/studio-pcgz8heb.js +0 -5
  608. package/dist/chunks/studio-qcsq0t15.js +0 -5
  609. package/dist/chunks/studio-qkstvve9.js +0 -5
  610. package/dist/chunks/studio-qv1pwd3c.js +0 -5
  611. package/dist/chunks/studio-rc6dvxjb.js +0 -7
  612. package/dist/chunks/studio-s8dmmz66.js +0 -5
  613. package/dist/chunks/studio-sp5xzbj4.js +0 -6
  614. package/dist/chunks/studio-szsjbj0g.js +0 -5
  615. package/dist/chunks/studio-t1xzawhr.js +0 -16
  616. package/dist/chunks/studio-t6b6qe31.js +0 -5
  617. package/dist/chunks/studio-tdcprbqb.js +0 -5
  618. package/dist/chunks/studio-vyc0b4he.js +0 -10
  619. package/dist/chunks/studio-w0cgf6jg.js +0 -5
  620. package/dist/chunks/studio-w3hskzqk.js +0 -5
  621. package/dist/chunks/studio-xgrgcdyh.js +0 -9
  622. package/dist/chunks/studio-xz2yxfcb.js +0 -5
  623. package/dist/chunks/studio-y6n42tgs.js +0 -5
  624. package/dist/chunks/studio-yb560vxr.js +0 -5
  625. package/dist/chunks/studio-yn9f8vtx.js +0 -5
  626. package/dist/chunks/studio-yw05w8f0.js +0 -7
  627. package/dist/chunks/studio-z16sgavc.js +0 -5
  628. package/dist/chunks/studio-zyqn40w4.js +0 -5
  629. package/dist/chunks/swatch-group-8qh9a3bm.js +0 -4
  630. package/dist/chunks/tabs-jwthg40w.js +0 -4
  631. package/dist/chunks/textfield-spy3hc77.js +0 -4
  632. package/dist/chunks/toast-4d35zd64.js +0 -4
  633. package/dist/chunks/toast-host-8sjmfed3.js +0 -4
  634. package/dist/chunks/tooltip-fd6g9xy3.js +0 -4
  635. package/dist/chunks/tree-h19v1jfz.js +0 -4
  636. package/dist/chunks/workspace-zt81g1ms.js +0 -4
  637. package/dist/chunks/ws-client-n2bh4hkf.js +0 -4
@@ -0,0 +1,5 @@
1
+ import{f,Qe}from"./studio-ffrrncvz.js";import{E}from"./studio-wz73q5kq.js";function k(e){return e.trim().replace(/\/+$/,"")}function a(e){return e.trim()}var Tt={aiBaseUrl:{default:"",key:"jx.ai.baseUrl",normalize:k,scope:"user"},aiOpenAiKey:{default:"",key:"jx.ai.openaiKey",normalize:a,scope:"user",secret:!0},aiModel:{default:"gpt-4o",key:"jx.ai.model",normalize:a,scope:"user"},keybindings:{default:"",key:"jx.keybindings",normalize:(e)=>e.trim()==="{}"?"":e.trim(),scope:"user"},theme:{default:"",key:"jx-studio-theme",normalize:a,scope:"user"},showIgnoredFiles:{default:"",key:"jx.files.showIgnored",normalize:a,scope:"user"},cfAccountId:{default:"",key:"jx.cf.accountId",normalize:a,scope:"user"},cfToken:{default:"",key:"jx.cf.token",normalize:a,scope:"user",secret:!0}},p=Object.values(Tt),l=p.filter((e)=>e.scope==="user"),P=l.map((e)=>e.key);function h(e){let t=e.schedule??queueMicrotask,n=null,i=Promise.resolve(),r=Promise.resolve();function s(){let o=n;if(n=null,!o)return i;return i=i.then(()=>e.send(o)).catch((u)=>{e.onError?.(u,o)}),i}return{enqueue(o){if(n){Object.assign(n,o);return}n={...o},r=new Promise((u)=>{t(()=>{s().then(u)})})},settled(){return r}}}var c=new Map;function m(){return typeof localStorage>"u"?void 0:localStorage}function v(e,t){try{if(t===null)m()?.removeItem(e);else m()?.setItem(e,t)}catch{}}try{for(let e of p){let t=m()?.getItem(e.key);if(t!==null&&t!==void 0)c.set(e.key,t)}}catch{}function zo(e){return c.get(e.key)??""}function UL(e){return(c.get(e.key)??"")!==""}var y=new Set;function Oy(e){return y.add(e),()=>{y.delete(e)}}function g(e){for(let t of y)t(e)}var d=h({onError(e){E("error","Your settings could not be saved.",{detail:e instanceof Error?e.message:String(e),key:"settings-write",source:"Settings"})},async send(e){if(!Qe())return;let t=f();if(!t.patchSettings)return;let n={},i=[];for(let[r,s]of Object.entries(e))if(s)n[r]=s;else i.push(r);await t.patchSettings({remove:i,set:n})}});function qL(){return d.settled()}function S(e){let t=[];for(let[n,i]of Object.entries(e)){if((c.get(n)??null)===i)continue;if(i===null)c.delete(n);else c.set(n,i);v(n,i),t.push(n)}return t}function Ay(e,t){return e.normalize?e.normalize(t):t}function as(e,t){let n=Ay(e,t),i=S({[e.key]:n});if(i.length>0)d.enqueue({[e.key]:n}),g(i)}function KL(e){let t={};for(let[i,r]of e)t[i.key]=Ay(i,r);let n=S(t);if(n.length>0)d.enqueue(t),g(n)}function ah(e){let t={};for(let i of e)t[i.key]=null;let n=S(t);if(n.length>0)d.enqueue(t),g(n)}async function GL(){if(!Qe())return;let e=f();if(!e.getSettings)return;let t;try{t=await e.getSettings()}catch{return}let n={},i=!1;for(let s of l){let o=t[s.key];if(o)n[s.key]=o;else if(c.get(s.key))i=!0}let r=S(n);if(r.length>0)g(r);if(i){let s={};for(let o of l){let u=c.get(o.key);if(u&&!t[o.key])s[o.key]=u}d.enqueue(s)}}function x(e){let t={};for(let i of l)t[i.key]=e[i.key]??null;let n=S(t);if(n.length>0)g(n)}function JL(){if(!Qe())return;f().subscribeSettings?.(x)}
2
+ export{Tt,zo,UL,Oy,qL,Ay,as,KL,ah,GL,JL};
3
+
4
+ //# debugId=AB7C36986080AD7E64756E2164756E21
5
+ //# sourceMappingURL=studio-vfcdrfmv.js.map
@@ -0,0 +1,5 @@
1
+ import{he,E}from"./studio-wz73q5kq.js";import{te,T}from"./studio-cffqvnzd.js";var tt={functionEditor:null,blockActionBarEl:null,selDragCleanup:null,dndCleanups:[],elementsCollapsed:new Set,elementsFilter:"",_currentDropTargetRow:null,layerDragSourceHeight:0,_completionRegistered:!1,_layersCollapsed:null};var m=0;function M$(){return m+=1,m}var l=new Map;function or(e){let r=l.get(e);if(!r)r=v(e),l.set(e,r);return r}function v(e){return{centerObserver:null,monacoDiffEditor:null,monacoEditor:null,needsCenter:!0,panX:0,panY:0,panels:[],paneId:e,panzoomWrap:null,stage:null,prevCanvasMode:null,prevStylebookCustomizedOnly:null,prevStylebookFilter:null,renderGeneration:0,sourceCollabCleanup:null,stageScrollbar:null,wrap:null}}function Xd(e){return e.wrap}function gh(){return[...l.values()]}function rc(e){if(!e)return null;for(let r of l.values())if(Xd(r)?.contains(e))return r;return null}function g(e){for(let r of e.panels)r.renderScope?.stop(),r.renderScope=null;e.panels.length=0,e.prevCanvasMode=null}function F$(e,r){let t=or(e);return t.wrap=r,g(t),t}function j$(e){if(l.get(e))H1(e);let t=v(e);return l.set(e,t),t}var S=null;function H$(e){S=e}function H1(e){let r=l.get(e);if(!r)return;S?.(r),g(r),w(e)}function w(e){l.delete(e)}var bh="commit";function b(e){return T(e)&&te(e.then)}function ng(e){let r=new Map,t=new Map,o=new Map,a=!1,u=!1,c=!1;function f(n,i){if(!b(i))return i;let s=i.finally(()=>{if(o.get(n)===s)o.delete(n)});return o.set(n,s),s}let d={arm(n,i,s){clearTimeout(r.get(n)),t.set(n,s),r.set(n,setTimeout(()=>{r.delete(n),t.delete(n),f(n,s())},i))},cancel(){for(let n of r.values())clearTimeout(n);r.clear(),t.clear()},flush(n){let i=t.get(n);if(!i)return o.get(n);return clearTimeout(r.get(n)),r.delete(n),t.delete(n),f(n,i())},ahead:()=>a,markAhead(){a=!0},typed:()=>u,markTyped(){a=!0,u=!0},markSettled(){a=!1,u=!1},shared:()=>c,markShared(){c=!0}};return e._writes=d,d}var y={logic:{holds:"The handler you were typing",reached:"written into",source:"Logic"},source:{holds:"The source you were typing",reached:"parsed into",source:"Editor"}};function p(e,r,t){if(e._writes?.typed()!==!0)return!0;let a=e._editingTab??null,u=a?.documentPath??"Untitled",{holds:c,reached:f,source:d}=y[r],n=t?{detail:h(t.error)}:{};if(n.key=`buffer-discarded:${r}:${a?.id??"none"}`,n.source=d,a?.documentPath)n.path=a.documentPath;return E.warn(`${c} was discarded — it was never ${f} "${u}".`,n),!1}function h(e){return e instanceof Error?e.stack??e.message:String(e)}function ig(e,r){let t=e?._writes;if(!e||!t)return!0;let o;try{o=t.flush(bh)}catch(a){return t.cancel(),p(e,r,{error:a})}if(t.cancel(),b(o))return o.then(()=>p(e,r,null),(a)=>p(e,r,{error:a})),!0;return p(e,r,null)}function B1(e){e?._writes?.cancel()}function qc(e){return Boolean(e?.getModel())}function yh(e,r){if(!qc(e)||e.hasTextFocus()||e._writes?.ahead()||e._writes?.shared())return!0;return r!==void 0&&e.getValue()!==r}function C(e){let r=he(e);return[...gh().map((o)=>o.monacoEditor),tt.functionEditor].filter((o)=>o!=null&&o._editingTab!=null&&he(o._editingTab)===r&&qc(o))}async function Qd(e){for(let r of C(e)){if(!qc(r))continue;try{await r._writes?.flush(bh)}catch(t){let o={detail:h(t),key:`buffer-commit:${e.id}`,source:"Editor"};if(e.documentPath)o.path=e.documentPath;E.error(`Could not save the editor's contents into "${e.documentPath??"Untitled"}".`,o)}}}function tf(e){return C(e).some((r)=>r._writes?.typed()===!0)}
2
+ export{tt,M$,or,Xd,gh,rc,F$,j$,H$,H1,bh,ng,ig,B1,qc,yh,Qd,tf};
3
+
4
+ //# debugId=28C71816BB71AA7364756E2164756E21
5
+ //# sourceMappingURL=studio-vmfkgdjf.js.map
@@ -0,0 +1,5 @@
1
+ import{re}from"./studio-j1kvhdjk.js";import{f}from"./studio-ffrrncvz.js";import{v,E}from"./studio-wz73q5kq.js";import{Dd,Ju}from"./studio-zq4z6tm6.js";import{sr,I,A}from"./studio-2jbs3rxv.js";import{Ld}from"./studio-5gthpky6.js";import{uT}from"./studio-fpphgn8y.js";import{py}from"./studio-se2r3ptc.js";import{Vd}from"./studio-ynn90f58.js";import{O}from"./studio-c7q0t9x1.js";import{i,te,T,w}from"./studio-cffqvnzd.js";var k={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"New Entry",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"New Entry"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"New entry name",placeholder:"entry-name",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"Select or create an entry"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};I("settings-contributed",k);function W(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:""}}function K(e){let s=i(e)?void 0:e.attributes?.part;return i(s)?s:""}function H(e,s,a){e.textContent="";let n=v({...W(),...s}),t=null,o=!1,c=A("settings-contributed",n,e,{onNodeCreated:(r,l,u)=>{if(!(r instanceof HTMLElement))return;let d=K(u);if(d==="form-host")a.formSlot(r);else if(d==="actions")a.actionsSlot(r)}}).then((r)=>{let l=r.root;if(o)return r.dispose(),l;return t=r,l});return{attached:()=>{if(o)return!1;let r=t?.root;return r===void 0?!0:r instanceof HTMLElement&&e.contains(r)},dispose(){o=!0,t?.dispose(),t=null},host:e,ready:c,update(r){n.actionsState=r.actionsState,n.editorRegion=r.editorRegion,n.editorState=r.editorState,n.entries=r.entries,n.entryName=r.entryName,n.layout=r.layout,n.newName=r.newName,n.newState=r.newState,n.title=r.title}}}var g=new Map,S=new Set,x=new Map;function cT(e,s){let a=O?.projectConfig?.[e],n=w(a)?a:{};if(!Object.hasOwn(n,s))return Object.keys(n);return g.set(e,s),null}var C=new Map;function q(e,s){let a={},n=[];for(let t of s){let o=t.indexOf(": "),c=o===-1?"":t.slice(0,o),r=o===-1?t:t.slice(o+2);if(c===e){n.push(r);continue}if(!c.startsWith(`${e}/`))continue;let[l]=c.slice(e.length+1).split("/");if(l&&a[l]===void 0)a[l]=r}return{fields:a,section:n}}async function N(e,s){let a=O?.projectConfig;if(!a)return;if(!(await Vd()).ok)return;let t=[];try{t=await Ld(a)}catch(o){E.warn(`Could not validate project.json — ${re(o)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}C.set(e,q(e,t).fields),s()}function M(e,s){for(let[a,n]of Object.entries(s))if(n===void 0)delete e[a];else e[a]=n}function J(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function B(e,s){if(!e)return{};let a=(t)=>{let o={};for(let[c,r]of Object.entries(t))o[c]=n(r);return o},n=(t)=>{if(i(t))return t.replaceAll("${key}",s);if(Array.isArray(t))return t.map((o)=>n(o));if(w(t))return a(t);return t};return a(e)}function R(e,s,a=null){let n=f(),t={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(o,c)=>{let r={projectConfig:O?.projectConfig??{}};if(w(c))r.scope=c;if(s.formats!==void 0)r.formats=s.formats;return Ju(o,r)}};if(te(n.setSecrets))t.commitSecret=async(o,c)=>{let r=uT(e,a,o);return await n.setSecrets({set:{[r]:c}}),r};return t}function h(e){let s=O?.projectConfig;if(!s)return null;let a=s[e];if(w(a))return a;let n={};return s[e]=n,n}var L=new WeakMap;function m(e){ZS(e.container,e.contribution,e.opts)}function V(e,s){e.echo=s,m(e)}function Y(e){let{container:s,contribution:a,opts:n}=e,t=a.key,o=a.title??t,c=n.actions?"slot":"none",r=py(s),l=sr(r,"editor");if((a.settings.layout??"form")!=="map")return{actionsState:c,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:o};let u=h(t)??{},d=g.get(t)??null,y=d===null?void 0:u[d],b=d!==null&&T(y);return{actionsState:c,editorRegion:l,editorState:b?"editing":"empty",entries:Object.keys(u).map((p)=>({key:p,region:sr(r,`entry:${p}`),selected:p===d})),entryName:e.echo??(b?d:""),layout:"map",newName:x.get(t)??"",newState:S.has(t)?"open":"closed",title:o}}function F(e){let s=e.formHost;if(!s)return;let{contribution:a,opts:n}=e,t=a.key,o=a.settings.entry?.ui,c=()=>m(e),r=(p)=>{if(p.parentNode!==s)s.replaceChildren(p)};if((a.settings.layout??"form")!=="map"){let p=`/${t}`;r(Dd(`section:${t}`,a.entrySchema,h(t)??{},{context:R(t,n,null),errors:C.get(p)??{},onChange:(z)=>{let j=h(t);if(!j)return;M(j,z),c(),N(p,c)},rerender:c,...o!==void 0&&{ui:o}}));return}let l=h(t)??{},u=g.get(t)??null,d=u===null?void 0:l[u];if(u===null||!T(d)){s.replaceChildren();return}let y=d,b=`/${t}/${u}`;r(Dd(`section:${t}:${u}`,a.entrySchema,y,{context:R(t,n,u),errors:C.get(b)??{},onChange:(p)=>{M(y,p),c(),N(b,c)},rerender:c,...o!==void 0&&{ui:o}}))}function D(e){let s=e.actionsHost,{actions:a}=e.opts;if(!s)return;if(!a){s.replaceChildren();return}let n=e.contribution.key,t=(e.contribution.settings.layout??"form")==="map"?g.get(n)??null:null;a(s,{rerender:()=>m(e),sectionKey:n,selected:t})}function G(e){let s=(t)=>{e.echo=null,m(e),N(t,()=>m(e))},a=()=>{e.echo=null,m(e)},n=()=>e.contribution.key;return{cancelNew(){S.delete(n()),x.delete(n()),m(e)},cancelRename(t){V(e,t),a()},createNew(){let t=n(),o=J(x.get(t)??""),c=h(t);if(!o||!c||c[o])return;c[o]=B(e.contribution.settings.entry?.newEntry,o),g.set(t,o),S.delete(t),x.delete(t),s(`/${t}`)},editNew(t){x.set(n(),t),m(e)},openNew(){S.add(n()),m(e)},removeEntry(){let t=n(),o=g.get(t)??null,c=h(t);if(!o||!c?.[o])return;delete c[o],g.set(t,null),s(`/${t}`)},renameEntry(t){V(e,t);let o=n(),c=g.get(o)??null,r=h(o),l=J(t.trim());if(!c||!r||!l||l===c||r[l]){a();return}let u={};for(let[d,y]of Object.entries(r))u[d===c?l:d]=y,delete r[d];Object.assign(r,u),g.set(o,l),s(`/${o}`)},select(t){g.set(n(),t),e.echo=null,m(e)}}}function ZS(e,s,a={}){let n=L.get(e);if(n)n.contribution=s,n.opts=a;let t=n?.handle??null;if(!n||!t?.attached()){t?.dispose();let o={actionsHost:null,container:e,contribution:s,echo:null,formHost:null,handle:null,opts:a};L.set(e,o),t=H(e,G(o),{actionsSlot:(c)=>{o.actionsHost=c,D(o)},formSlot:(c)=>{o.formHost=c,F(o)}}),o.handle=t,n=o}t.update(Y(n)),D(n),F(n)}
2
+ export{cT,ZS};
3
+
4
+ //# debugId=423A1D874112B59A64756E2164756E21
5
+ //# sourceMappingURL=studio-wt1816jj.js.map
@@ -0,0 +1,4 @@
1
+ import{ee}from"./studio-cffqvnzd.js";function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var Ke=Object.prototype.hasOwnProperty,j=(e,t)=>Ke.call(e,t),O=Array.isArray,C=(e)=>ge(e)==="[object Map]";var de=(e)=>typeof e==="function",ze=(e)=>typeof e==="string",R=(e)=>typeof e==="symbol",D=(e)=>e!==null&&typeof e==="object";var We=Object.prototype.toString,ge=(e)=>We.call(e),me=(e)=>ge(e).slice(8,-1);var H=(e)=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ge=/-\w/g,_t=U((e)=>e.replace(Ge,(t)=>t.slice(1).toUpperCase())),$e=/\B([A-Z])/g,yt=U((e)=>e.replace($e,"-$1").toLowerCase()),_e=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vt=U((e)=>e?`on${_e(e)}`:""),b=(e,t)=>!Object.is(e,t);var Ye="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Et=q(Ye+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class be{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function xe(e){return new be(e)}function bl(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))we(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ye(this),Te(this);let e=f,t=m;f=this,m=!0;try{return this.fn()}finally{Ne(this),f=e,m=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ye(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(Q(this))this.run()}get dirty(){return Q(this)}}var Se=0,M,L;function we(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function re(){Se++}function se(){if(--Se>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function Te(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ne(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Be(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function Q(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ae(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ae(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Q(e)))return;e.flags|=2;let t=e.dep,n=f,r=m;f=e,m=!0;try{Te(e);let i=e.fn(e._value);if(t.version===0||b(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,m=r,Ne(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Be(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function oe(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var m=!0,Oe=[];function kh(){Oe.push(m),m=!1}function Eh(){let e=Oe.pop();m=e===void 0?!0:e}function C_(e,t=!1){if(f instanceof W)f.cleanup=e}function ye(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Re{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!m||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Re(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;De(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){re();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{se()}}}function De(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)De(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,x=Symbol(""),ne=Symbol(""),V=Symbol("");function h(e,t,n){if(m&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function T(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(re(),t==="clear")o.forEach(a);else{let c=O(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,g)=>{if(g==="length"||g===V||!R(g)&&g>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(x)),C(e))a(o.get(ne))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(x)),C(e))a(o.get(ne))}break;case"set":if(C(e))a(o.get(x));break}}}se()}function k(e){let t=he(e);if(t===e)return t;if(h(t,"iterate",V),N(e))return t;if(!w(e))return t.map(y);return wg(e)?t.map((n)=>A(y(n))):t.map(A)}function ce(e){return h(e=he(e),"iterate",V),e}function _(e,t){if(w(e))return wg(e)?A(y(t)):A(t);return y(t)}var qe={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>_(this,e))},concat(...e){return k(this).concat(...e.map((t)=>O(t)?k(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=_(this,e[1]),e))},every(e,t){return S(this,"every",e,t,void 0,arguments)},filter(e,t){return S(this,"filter",e,t,(n)=>n.map((r)=>_(this,r)),arguments)},find(e,t){return S(this,"find",e,t,(n)=>_(this,n),arguments)},findIndex(e,t){return S(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return S(this,"findLast",e,t,(n)=>_(this,n),arguments)},findLastIndex(e,t){return S(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return S(this,"forEach",e,t,void 0,arguments)},includes(...e){return Z(this,"includes",e)},indexOf(...e){return Z(this,"indexOf",e)},join(e){return k(this).join(e)},lastIndexOf(...e){return Z(this,"lastIndexOf",e)},map(e,t){return S(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return Ee(this,"reduce",e,t)},reduceRight(e,...t){return Ee(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return S(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return k(this).toReversed()},toSorted(e){return k(this).toSorted(e)},toSpliced(...e){return k(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>_(this,e))}};function J(e,t,n){let r=ce(e),i=r[t],s=i.call(r);if(r!==e&&!N(e)){if(s[Symbol.toStringTag]==="Array Iterator"){let o=Object.create(Object.getPrototypeOf(s));if(o.next=()=>ve(s.next(),n),i!==ke[t])Object.defineProperties(o,{return:{get(){let a=s.return;return typeof a==="function"?a.bind(s):a}},throw:{get(){let a=s.throw;return typeof a==="function"?a.bind(s):a}}});return o}s._next=s.next,s.next=()=>ve(s._next(),n)}return s}function ve(e,t){if(!e.done)e.value=t(e.value);return e}var ke=Array.prototype;function S(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!N(e),c=o[t];if(c!==ke[t]){let p=c.apply(e,s);return a?y(p):p}let l=n;if(o!==e){if(a)l=function(p,g){return n.call(this,_(e,p),g,e)};else if(n.length>2)l=function(p,g){return n.call(this,p,g,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function Ee(e,t,n,r){let i=ce(e),s=i!==e&&!N(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=_(e,l);return n.call(this,l,_(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?_(e,c):c}function Z(e,t,n){let r=he(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ct(n[0]))return n[0]=he(n[0]),r[t](...n);return i}function I(e,t,n=[]){kh(),re();let r=he(e)[t].apply(e,n);return se(),Eh(),r}var Xe=q("__proto__,__v_isRef,__isVue"),Ce=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(R));function Je(e){if(!R(e))e=String(e);let t=he(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?ot:Pe:i?Le:Me).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=O(e);if(!r){let a;if(s&&(a=qe[t]))return a;if(t==="hasOwnProperty")return Je}let o=Reflect.get(e,t,ou(e)?e:n);if(R(t)?Ce.has(t):Xe(t))return o;if(!r)h(e,"get",t);if(i)return o;if(ou(o)){let a=s&&H(t)?o:o.value;return r&&D(a)?G(a):a}if(D(o))return r?G(o):v(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=O(e)&&H(t);if(!this._isShallow){let c=w(i);if(!N(n)&&!w(n))i=he(i),n=he(n);if(!s&&ou(i)&&!ou(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,ou(e)?e:r);if(e===he(r)&&a){if(!o)T(e,"add",t,n);else if(b(n,i))T(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)T(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!R(t)||!Ce.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",O(e)?"length":x),Reflect.ownKeys(e)}}class Ie extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ze=new fe,Qe=new Ie,et=new fe(!0);var ie=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function tt(e,t,n){return function(...r){let i=this.__v_raw,s=he(i),o=C(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?ie:t?A:y;return!t&&h(s,"iterate",c?ne:x),F(Object.create(l),{next(){let{value:p,done:g}=l.next();return g?{value:p,done:g}:{value:a?[u(p[0]),u(p[1])]:u(p),done:g}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nt(e,t){let n={get(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(b(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?ie:e?A:y;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(he(i),"iterate",x),i.size},has(i){let s=this.__v_raw,o=he(s),a=he(i);if(!e){if(b(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=he(a),l=t?ie:e?A:y;return!e&&h(c,"iterate",x),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=he(this),o=K(s),a=he(i),c=!t&&!N(i)&&!w(i)?a:i;if(!(o.has.call(s,c)||b(i,c)&&o.has.call(s,i)||b(a,c)&&o.has.call(s,a)))s.add(c),T(s,"add",c,c);return this},set(i,s){if(!t&&!N(s)&&!w(s))s=he(s);let o=he(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=he(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)T(o,"add",i,s);else if(b(s,u))T(o,"set",i,s,u);return this},delete(i){let s=he(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=he(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)T(s,"delete",i,void 0,l);return u},clear(){let i=he(this),s=i.size!==0,o=void 0,a=i.clear();if(s)T(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=tt(i,e,t)}),n}function ue(e,t){let n=nt(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_isShallow")return t;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var it={get:ue(!1,!1)},rt={get:ue(!1,!0)},st={get:ue(!0,!1)};var Me=new WeakMap,Le=new WeakMap,Pe=new WeakMap,ot=new WeakMap;function at(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function v(e){if(w(e))return e;return pe(e,!1,Ze,it,Me)}function vg(e){return pe(e,!1,et,rt,Le)}function G(e){return pe(e,!0,Qe,st,Pe)}function pe(e,t,n,r,i){if(!D(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=at(me(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function wg(e){if(w(e))return wg(e.__v_raw);return!!(e&&e.__v_isReactive)}function w(e){return!!(e&&e.__v_isReadonly)}function N(e){return!!(e&&e.__v_isShallow)}function ct(e){return e?!!e.__v_raw:!1}function he(e){let t=e&&e.__v_raw;return t?he(t):e}var y=(e)=>D(e)?v(e):e,A=(e)=>D(e)?G(e):e;function ou(e){return e?e.__v_isRef===!0:!1}function su(e){return Ve(e,!1)}function yl(e){return Ve(e,!0)}function Ve(e,t){if(ou(e))return e;return new Fe(e,t)}class Fe{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:he(e),this._value=t?e:y(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||N(e)||w(e);if(e=n?e:he(e),b(e,t))this._rawValue=e,this._value=n?e:y(e),this.dep.trigger()}}class je{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return we(this,!0),!0}get value(){let e=this.dep.track();if(Ae(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function au(e,t,n=!1){let r,i;if(de(e))r=e;else r=e.get,i=e.set;return new je(r,i,n)}var lt={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ft(e){if(typeof document>"u")return null;let t=lt[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function gv(e,t="polite"){if(e==="")return;let n=ft(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var Th=60000,He=null;function Kr(){return He??Date.now()}function fR(e){let t=e instanceof Date?e.getTime():ee(e)?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return He=t,t}var ut={error:"problem",info:"toast",success:"toast",warn:"toast"},pt={error:8000,info:4000,success:4000,warn:8000},Ue=0;function dt(){return Ue+=1,`n${Ue}`}var Jc=v([]),Os=v([]),ht=4;function gt(e){return e==="problem"?Os:Jc}function mt(e,t,n,r){let i={at:Kr(),id:dt(),message:t,severity:e,tier:n};if(r.action!==void 0)i.action=r.action;if(r.actionArgs!==void 0)i.actionArgs=r.actionArgs;if(r.detail!==void 0)i.detail=r.detail;if(r.source!==void 0)i.source=r.source;if(r.path!==void 0)i.path=r.path;if(r.key!==void 0)i.key=r.key;if(n==="toast")i.timeoutMs=r.timeoutMs??pt[e];return i}function E(e,t,n={}){let r=n.tier??ut[e],i=mt(e,t,r,n),s=gt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(Jc.length>ht)Jc.shift();return gv(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>E(e,t,n)}E.success=B("success");E.info=B("info");E.warn=B("warn");E.error=B("error");function lu(e){for(let t of[Jc,Os]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function vl(e){let t=e?Os.filter((r)=>!e(r)):[],n=Os.length-t.length;return Os.splice(0,Os.length,...t),n}function Lh(e){let t=[];for(let n of Os){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function xg(e){return e===void 0?Os.length:Os.filter((t)=>t.severity===e).length}export{xe,bl,oe,kh,Eh,C_,v,vg,wg,he,ou,su,yl,au,gv,Th,Kr,fR,Jc,Os,E,lu,vl,Lh,xg};
2
+
3
+ //# debugId=ADBBB602A61154F664756E2164756E21
4
+ //# sourceMappingURL=studio-wz73q5kq.js.map
@@ -0,0 +1,7 @@
1
+ import{mt}from"./studio-0q988f9w.js";import{re}from"./studio-j1kvhdjk.js";import{ae}from"./studio-v8aga3vp.js";import{I,A,un,fl,Hn}from"./studio-2jbs3rxv.js";import{v,Kr,E}from"./studio-wz73q5kq.js";import{f,Qe}from"./studio-ffrrncvz.js";import{Xt,tu,hl,sf,oa,af,rn,pl}from"./studio-nwfrc98n.js";import{Ia}from"./studio-zp7snvkq.js";import{Uo,Vp}from"./studio-jjkg84nj.js";import{bn,Br,ch,Ym,Gp,u_,si,b,fh,nc,dl,zr,F1,bi,tg,sv}from"./studio-24mccdrj.js";import{Qu,LT,$T,Xs}from"./studio-pag2wncm.js";import{Tt,zo,as}from"./studio-vfcdrfmv.js";import{Ts,PL,jL,Dy,$s,Ny}from"./studio-ynn90f58.js";import{La}from"./studio-6wkmf3wz.js";import{Xn}from"./studio-v2w7q8r1.js";import{Zl}from"./studio-4h8k4dw9.js";import{Lo,ia,ra,Is}from"./studio-485046te.js";import{Fb,Cp,kp,Qw,QE,ym}from"./studio-18vgbhs5.js";import{Vc,Py,cl}from"./studio-qvanvzfd.js";import{yT,iC}from"./studio-fpphgn8y.js";import{TT,Vo,Em,Tm}from"./studio-er30bpcx.js";import{Bt}from"./studio-1fxkaaea.js";import{Ab,Pb,Mb}from"./studio-bn5nkafw.js";import{Ss}from"./studio-tjzjhe68.js";import{Ea}from"./studio-8qm0ep50.js";import{O,oc,dn}from"./studio-c7q0t9x1.js";import{i,te,T}from"./studio-cffqvnzd.js";import{we}from"./studio-a3g98wjr.js";async function pm(){if(Fb(location.search))return!1;let e=f();if(!e.dependenciesNeedInstall||!e.installDependencies)return!1;let t=!1;try{t=await e.dependenciesNeedInstall()}catch{return!1}if(!t)return!1;let o=La({status:"Running bun install…",title:"Installing dependencies"});try{let n=await e.installDependencies();if(n.ok)return o.done(),!0;o.fail(n.log??"bun install failed")}catch(n){o.fail(n instanceof Error?n.message:String(n))}return!1}var Ye=["page","component"],Xe={components:"component",pages:"page"};function J(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ze(e){let t=J(e).toLowerCase();for(let[o,n]of Object.entries(Xe))if(t.startsWith(`${o}/`))return n;return null}function ne(e){return Ye.some((t)=>e.includes(t))}function et(e){let t=O?.projectConfig?.layout;if(!i(t))return!1;return J(t).toLowerCase()===J(e).toLowerCase()}function be(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let o of pl(e)){let n=oa(o,"parse");if(n&&oa(o,"serialize"))t.push({ext:o,label:`${n.name} (${o})`})}return t}function xe(){return new Set([".json",...sf().flatMap((e)=>e.extensions)])}function Uw(e){if(e===null||e===void 0||e==="")return[];let t=Ze(e);if(t===null||et(e)||u_(e))return[];let o=rn(e);if(!(o?Boolean(o.capabilities.parse)&&ne(o.documentKinds):J(e).toLowerCase().endsWith(".json")))return[];let r=[];if(o)r.push({ext:".json",label:"JSON (.json)"});for(let a of pl()){let s=oa(a,"serialize");if(!s||s.name===o?.name||!ne(s.documentKinds)||!s.documentKinds.includes(t))continue;r.push({ext:a,label:`${s.name} (${a})`})}return r}function zE(){let e=new Set([".json"]);for(let t of sf()){if(!t.capabilities.serialize||!ne(t.documentKinds))continue;for(let o of t.extensions)e.add(o)}return[...e].toSorted()}var ie="jx-studio-recent-projects",Fe="jx-studio-recent-files",Pe=8,tt=10,z=[];function B(){if(!Qe())return null;let e=f();return ot(e)?e:null}function ot(e){return Boolean(e.getRecentProjects&&e.saveRecentProjects)}function nt(){try{let e=localStorage.getItem(ie);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function se(){return B()?z:nt()}function je(e){z=e;let t=B();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(ie,JSON.stringify(e))}catch{}}async function UE(){let e=B();if(!e)return;try{z=await e.getRecentProjects()}catch{z=[]}}function Nb(){return se().toSorted((e,t)=>t.timestamp-e.timestamp)}function Ob(e,t){let o=se().filter((n)=>n.root!==t);if(o.unshift({name:e,root:t,timestamp:Kr()}),o.length>Pe)o.length=Pe;je(o)}function qw(e){je(se().filter((t)=>t.root!==e))}function qE(){z=[];let e=B();if(e)e.saveRecentProjects([]);else localStorage.removeItem(ie)}function Se(){try{let e=localStorage.getItem(Fe);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function KE(e){let t=Se().toSorted((o,n)=>n.timestamp-o.timestamp);return e==null?t:t.filter((o)=>o.root===e)}function fm(e){let t=Se().filter((r)=>!(r.root===e.root&&r.path===e.path));t.unshift({name:e.name,path:e.path,root:e.root,timestamp:Kr()});let o=new Map,n=[];for(let r of t.toSorted((a,s)=>s.timestamp-a.timestamp)){let a=(o.get(r.root)??0)+1;if(o.set(r.root,a),a<=tt)n.push(r)}localStorage.setItem(Fe,JSON.stringify(n))}var $e={$schema:"https://jxsuite.com/schema/v1",$id:"StudioFilesPanel",$description:'The Navigator\'s Files tree, as a Jx document over the kit. `files/files.ts` keeps every decision — which directories are listed, which entries `.gitignore` masks, which rows the window draws, what a click on a row means, what the context menu offers and what each verb does to the filesystem — and hands this document one projection: a word saying which of three things to draw, a toolbar whose state is already resolved, and rows whose every field is already a string. Nothing here asks what a file is, how tall the Navigator is, or whether a directory has been read. THE TREE IS `jx-tree`, and that is what this document no longer says: `role="tree"`, `role="treeitem"`, `aria-level`, `aria-posinset`, `aria-setsize`, the roving `tabindex` and the five arrow-key cases were each written out here and written out again in `panel-outline.json`, two copies of one keyboard contract with nothing holding them in agreement. The element owns all of it; what is left here is what this tree IS — a flat projection of rows, each already carrying its own level and set counts, because the DOM holds a WINDOW onto the model and an expanded `node_modules` is eleven rows rather than ten thousand. The window reaches the element as `padtop`/`padbottom`, and a caret move past either comes back as `move` for the flow to scroll and repaint. Four facts a row carries are bound against ONE scope field each — the current path, the selected path, the dragged path and the drop target — so moving the caret or dragging a file re-evaluates an attribute per drawn row instead of rebuilding the list under the reader\'s pointer. The pragmatic-drag-and-drop handles are an ISLAND: the document draws the rows and the tree, and the adapter attaches sources and targets to them through `onNodeCreated` (specs/studio-ui-guidelines.md §9.4).',tagName:"div",attributes:{part:"files"},style:{$description:"What the twenty `.file-tree*`, `.files-toolbar`, `.project-header` and `.project-name` rules in `styles/panels.css` said, keyed on `part` and re-pointed at the studio token layer. Three names could not come with the declarations. The five `var(--spectrum-font-size-50 | -75, …)` reads are the kit's `--jx-text-sm` and `--jx-text-md`, which are the same 11px and 12px — a `--spectrum-*` name is declared by `<sp-theme>` and by nothing else in this package, so a document that reads one is a document whose type size changes when a component it does not use is removed. The `.selected`, `.dragging`, `.drag-over` and `.drag-over-root` classes are `data-` attributes on a part, because a part is the handle now and because a state a handler adds and forgets to take off is exactly the defect a cancelled drag used to leave on screen. MOST OF THE ROW'S OWN RULES ARE GONE, and that is the point of the element rather than an omission: `jx-tree-item` declares the flex line, the one-control-height box the window reserves scroll by, the indent (`--jx-tree-indent` times one less than `level` — exactly the `8 + depth * 16` this file composed per row), the hover and focus states, the selected wash and the faded dragged row. What is left here is what is TRUE OF THIS TREE and not of trees in general: it owns its own scrollbar, a click on a row opens it, and the row a drag is over wears the drop mark this file draws.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"The two states that are not a tree. They are two states and not one sentence: a window with no project at all and a monorepo root that has not been pointed at a site are different situations, and only the second has anything to offer (studio-ui-guidelines.md §11).",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="empty"] p':{margin:"0"},'& [part="frame"]':{display:"flex",flexDirection:"column",height:"100%",minHeight:"0"},'& [part="project-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="project-name"]':{fontSize:"var(--jx-text-md)",fontWeight:"600",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="toolbar"]':{display:"flex",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-3)",borderBottom:"1px solid var(--border)",alignItems:"center",flexShrink:"0"},'& [part="search"]':{flex:"1",minWidth:"0"},'& [part="tree"]':{$description:"The scroller as well as the list. `ui/virtual-window.ts` walks up from the element it is given looking for the nearest thing that scrolls, and finding itself is the shortest answer — which is why the element declares no `overflow` of its own and leaves the question to the two trees that answer it differently. The colour is re-declared because `jx-tree` sets `--jx-fg` on itself, and this panel's text colour is the studio alias of it.",flex:"1",minHeight:"0",overflowY:"auto",color:"var(--fg)"},'& [part="tree"][data-drop="true"]':{background:"var(--hover-bg)"},'& [part="row"]':{$description:"What the element does not decide. A click on a row OPENS it here — a directory unfolds, a file takes a tab — so the pointer is a pointer rather than the element's default arrow; and the gap is the wider one this tree has always drawn between a 16px file glyph and its name.",gap:"var(--jx-space-3)",cursor:"pointer"},'& [part="loading-row"]':{$description:"A directory whose listing has not arrived yet. It holds the place and it is NOT a row: it is not a `jx-tree-item`, so the caret cannot land on it, the set counts do not include it and typeahead cannot match it — and it is replaced by the real rows on the repaint the listing provokes. It draws the same box by hand because it is the only line in this tree the element does not draw, and a placeholder of a different height would desynchronise the window's scroll reservation from the rows it reserves for.",display:"flex",alignItems:"center",boxSizing:"border-box",blockSize:"var(--jx-control-h)",paddingInline:"calc(var(--jx-space-3) + var(--depth, 0) * 16px) var(--jx-space-3)",color:"var(--fg-dim)",fontStyle:"italic",cursor:"default",userSelect:"none",whiteSpace:"nowrap"},'& [part="row-icon"]':{flexShrink:"0",display:"flex",alignItems:"center","--jx-icon-size":"16px"},'& [part="locale"]':{$description:"The language chip. Deliberately declares no block size, no padding and no line height: the row above is one control-height by contract, and a chip that grew the box would desynchronise the window's scroll reservation from the height it reserves by. It only ever shrinks the text. A chip, not a filter term: the search matches the file's name alone, because a query that silently also matched a language would make “why is this file here” unanswerable from what is on screen.",marginInlineStart:"auto",flexShrink:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxInlineSize:"6em"},'& [part="view-slot"], & [part="header-slot"], & [part="locale-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{none:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"No project loaded"}]},welcome:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Open a project folder to get started."},{tagName:"jx-button",attributes:{part:"open-project"},$props:{variant:"accent",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openProject"},value:[]}],description:"The declared `project.open` command, run through the registry — not a second opener of this surface's own. It is the one the chord, the palette and the status bar's PROJECT field already run, so a window that opens a project from here reports the outcome the same way they do (studio-ui-guidelines.md §12.5)."},children:[{tagName:"span",textContent:"Open Project"}]}]},tree:{tagName:"div",attributes:{part:"frame"},children:[{tagName:"div",attributes:{part:"header-slot",role:"none"},$switch:{$ref:"#/state/headerState"},cases:{shown:{tagName:"div",attributes:{part:"project-header"},children:[{tagName:"span",attributes:{part:"project-name",title:"${state.projectName}"},textContent:"${state.projectName}"}]}}},{tagName:"div",attributes:{part:"toolbar"},children:[{$description:"A row of quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, which is the segmented look a choice wants and not the borderless one a toolbar wants; Spectrum's group here was `compact quiet`, a combination the kit spells as compact=false with its members' default quiet.",tagName:"jx-action-group",attributes:{part:"toolbar-actions"},$props:{compact:!1,label:"File tree actions"},children:[{tagName:"jx-action-button",attributes:{part:"new-file"},$props:{size:"sm",icon:"plus",label:"New File",hint:"New File"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newFile"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{size:"sm",icon:"arrows-clockwise",label:"Refresh",hint:"Refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}],description:"The rules go with the listings. Refresh is what an author reaches for after editing a `.gitignore` by hand, and a tree that came back still hiding by the old rules would read as the button not having worked."}},{tagName:"jx-action-button",attributes:{part:"show-ignored"},$props:{size:"sm",icon:{$ref:"#/state/ignoredIcon"},label:{$ref:"#/state/ignoredLabel"},hint:{$ref:"#/state/ignoredLabel"},selected:{$ref:"#/state/ignoredSelected"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleIgnored"},value:[]}],description:"A repaint and nothing else: the ignored entries were never dropped from the cached listings, only from the rows built out of them."}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"Filter files",placeholder:"Filter files…",size:"sm",value:{$ref:"#/state/query"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}],description:"The query matches a file's NAME and nothing else. A directory is kept whatever it says, because hiding the folder a match sits in would leave the match with nowhere to be drawn."}}]},{$description:'The `role="tree"`, and everything that used to be spelled out under it. The element writes the role, the name, the roving tab stop and every row\'s `aria-level` / `aria-posinset` / `aria-setsize`, and it owns the whole ARIA keyboard: the arrows walk the drawn rows without wrapping, `Home` and `End` reach the ends of the MODEL by way of the pads, `ArrowRight` opens a directory and steps into an open one, `ArrowLeft` closes one and otherwise steps out to its parent, `Enter` activates and a printable character is typeahead. Every chord it does not own — cut, copy, paste, delete, rename — passes straight through to the flow, which is the WCAG 2.5.7 obligation this tree carries because dragging a file is the other way to move it. What reaches this document is five events, and each of them is a decision `files.ts` already owned.',tagName:"jx-tree",attributes:{part:"tree",label:"Project files",current:"${state.currentPath}",padtop:"${state.padTop}",padbottom:"${state.padBottom}","data-drop":"${state.rootDrop || null}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"event#/detail/value"}]}],description:"The reader meant that row. This tree is single-select, so the element resolves every modifier to `replace` before it gets here and the detail's `mode` and `anchor` are answers to a question this tree does not ask. There is no `change` handler beside it on purpose: the element OWNS the caret and keeps it across every repaint that does not change `current`, so a second copy of it in the flow would be a variable that only ever went stale."},onactivate:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}],description:"`Enter` or a double click. The same verb a single click reaches, by the same name."},onexpand:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/expand"},value:[{$ref:"event#/detail/value"},{$ref:"event#/detail/expanded"}]}],description:"`ArrowRight`, `ArrowLeft` or the twisty, with ONE dispatcher between them: the detail says the state the row should be PUT INTO, so the flow never has to work out which way a toggle was going."},onmove:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/key"}]}],description:"The caret has to reach a row the window did not draw. The element knows only that the pad on that side is not zero; where the row is in the model, and how far to scroll to bring it into view, is the flow's — which is why this is an event and not a `scrollIntoView`."},ontypeahead:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/typeahead"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/char"}]}],description:"A printable character, on a windowed tree. The same hand-off as `onmove` and for a sharper reason: a move off the end of the slice announces itself, and a letter never does — the element's own search over the drawn rows always answers, and over a `node_modules` of ten thousand entries the answer is whichever of the eleven painted rows happened to start with that letter. So the element dispatches EVERY such character and the flow answers it over the model."},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{item:{tagName:"jx-tree-item",attributes:{part:"row",value:"${$map.item.path}",label:"${$map.item.name}",level:"${$map.item.level}",posinset:"${$map.item.posInSet}",setsize:"${$map.item.setSize}",expanded:"${$map.item.ariaExpanded}",selected:"${state.selectedPath === $map.item.path ? 'true' : 'false'}","data-type":"${$map.item.type}","data-dragging":"${state.dragPath === $map.item.path ? '' : null}","data-drop":"${state.dropPath === $map.item.path ? '' : null}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"$map/item/path"}]}],description:"A single click OPENS the row, which is this tree's own answer and not the element's. `jx-tree` answers a click with `change` and `select`, exactly as it answers an arrow key, and a tree that opened on `select` would open every file the reader arrowed past. So the opening verb is bound here, where a click is a click; what a click MEANS — unfold this directory, take a tab for that file — stays the flow's, and Enter reaches the same verb through `activate`. It does NOT stop the event, which is the correction: the tree's delegated click is what moves the caret and the selection onto the row, so a `stopPropagation` here would leave a reader who clicked a folder with the tab stop still on whatever they had open last. The twisty stops its own click, so opening a directory from the chevron does not also activate the row."},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon",part:"row-icon","aria-hidden":"true"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"div",attributes:{slot:"status",part:"locale-slot",role:"none"},$switch:{$ref:"$map/item/localeState"},cases:{shown:{tagName:"span",attributes:{part:"locale"},textContent:"${$map.item.locale}"}}}]},loading:{$description:"A directory whose listing has not arrived yet. Deliberately not a `jx-tree-item`: there is no file there to select, open, rename or drag, and a row the caret could land on that answers to none of the verbs the caret offers is a stop in the walk with nothing behind it.",tagName:"div",attributes:{part:"loading-row",role:"none","data-loading":"true",style:"--depth:${$map.item.depth}"},textContent:"Loading…"}}}}]}]}}}]};I("files-panel",$e);function Re(e,t){e.view=t.view,e.headerState=t.headerState,e.projectName=t.projectName,e.query=t.query,e.ignoredLabel=t.ignoredLabel,e.ignoredIcon=t.ignoredIcon,e.ignoredSelected=t.ignoredSelected,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.selectedPath=t.selectedPath,e.dragPath=t.dragPath,e.dropPath=t.dropPath,e.rootDrop=t.rootDrop,e.currentPath=t.currentPath}function U(){return{currentPath:"",dragPath:"",dropPath:"",headerState:"hidden",ignoredIcon:"eye-slash",ignoredLabel:"Show ignored files",ignoredSelected:!1,padBottom:0,padTop:0,projectName:"",query:"",rootDrop:"",rows:[],selectedPath:"",view:"none"}}function at(e){let t=i(e)?void 0:e.attributes?.part;return i(t)?t:""}function it(e){let t=e?.$map,o=T(t)&&"item"in t?t.item:void 0;if(!T(o)||!("path"in o)||!i(o.path)||!("type"in o)||!i(o.type))return null;return{path:o.path,type:o.type}}function ke(e,t,o){let n=v({...U(),...o});Re(n,t);let r=null,a=!1,s=A("files-panel",n,e,{onNodeCreated:(l,c,d,p)=>{if(a||!(l instanceof HTMLElement))return;let j=at(d);if(j==="tree"){o.treeHost(l);return}if(j!=="row")return;let g=it(p);if(g)o.rowHost(l,g.path,g.type)}}).then((l)=>{if(a){l.dispose();return}r=l});return{connected:()=>!a&&(r===null||r.root.parentNode===e),dispose(){a=!0,r?.dispose(),r=null},ready:s,update:(l)=>{Re(n,l)}}}async function _s(e){if(!O)return;try{let t=f(),[o]=await Promise.all([Uo(()=>t.listDirectory(e)),LT(e)]);O.dirs.set(e,o)}catch{O.dirs.set(e,[])}}var st=new Set(["pages","layouts","components","content","data","public","styles"]);async function mm(){if(!O)return;await _s(".");let e=[];for(let t of O.dirs.get(".")??[])if(t.type==="directory"&&st.has(t.name))e.push(t.name),O.expanded.add(t.path||t.name),await _s(t.path||t.name);O.projectDirs=e}function he(){return zo(Tt.showIgnoredFiles)==="true"}function lt(e){as(Tt.showIgnoredFiles,e?"true":"")}async function IS(){try{let e=f(),t=await e.probeRootProject();if(!t)return;let{meta:o,info:n}=t;if(tu(),Xt(),hl(e),Qu(),Vp(),oc({dirs:new Map,expanded:new Set,isSiteProject:n.isSiteProject,name:n.isSiteProject?n.projectConfig?.name||o.name:o.name,projectConfig:(n.isSiteProject?n.projectConfig:null)||null,projectDirs:n.directories||[],projectRoot:".",root:o.root,searchQuery:"",selectedPath:null}),n.isSiteProject)dl(o.root||".",n.projectConfig||null);if(n.isSiteProject){if(Ob(dn().name,o.root),await kp(),await pm())tu(),await Xt(),hl(e);await mm(),await Zl(),await gm(),Cp(o.root)}}catch{}}async function DS({renderLeftPanel:e}){try{let t=f(),o=await t.openProject();if(!o)return!1;let{config:n,handle:r}=o;if(F1({document:{children:[],tagName:"div"},id:"initial"}),TT(),tu(),Xt(),hl(t),Qu(),Vp(),oc({...O,dirs:new Map,expanded:new Set,isSiteProject:!0,name:n.name||r.name,projectConfig:n,projectRoot:r.root,searchQuery:"",selectedPath:null}),dl(r.root,n),await kp(),await pm())tu(),await Xt(),hl(t);return await mm(),await Zl(),ym(),Ny(),$s("files"),Ob(dn().name,dn().projectRoot),e(),await gm(),Cp(dn().projectRoot),!0}catch(t){return E.error("Could not open the project.",{detail:re(t),source:"Open Project"}),!1}}async function NS(e){let t=f();if(t.createDestination!=="path")return!1;try{if(await t.activate(e),(await t.gitStatus()).isRepo)return!1;return await t.gitInit(),E.success("Initialized a git repository for this project."),!0}catch(o){return E.warn("Could not initialize a git repository — the project itself was written.",{detail:re(o),source:"Source Control"}),!1}}async function Kw(){await Xt();let e=[...pl("page"),".json"],t;try{t=await f().listDirectory("pages")}catch{return null}let o=new Set(t.filter((n)=>n.type==="file").map((n)=>n.name));for(let n of e)if(o.has(`index${n}`))return`pages/index${n}`;return null}async function ct(){let e=await Kw();if(e)await Fr(e)}async function gm(){let e=jL(b.projectRoot);if(Dy(b.projectRoot),e){if(await PL(e,{ensureSecondPane:()=>{nc(si)},openFile:(o,n)=>Fr(o,{focus:!1,paneId:n})})>0)return!0}return await ct(),!1}function dt(e,t,o){if(t==="directory")return o?"folder-open":"folder";let n=e.split(".").pop()?.toLowerCase();switch(n){case"css":case"js":case"json":case"ts":return"file-code";case"md":return"file-text";default:return n!==void 0&&Py(n)?"image":"file"}}var pt=24,u=[],H=null,L=new Map,K=null,Te=null;function me(){for(let e of L.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return pt}function ut(){for(let[e,t]of L)if(!t.isConnected)L.delete(e),ze(t)}function De(e){let t=L.get(e);return t?.isConnected===!0?t:null}function ee(e){return u.find((t)=>!t.loading&&t.path===e)}function Ce(e,t,o,n){let r=dn().dirs.get(e);if(!r){_s(e).then(()=>h()),o.push({depth:t,expanded:!1,key:`loading:${e}`,loading:!0,name:"Loading…",path:e,posInSet:1,setSize:1,type:"file"});return}let a=[...r].toSorted((d,p)=>{if(d.type==="directory"&&p.type!=="directory")return-1;if(d.type!=="directory"&&p.type==="directory")return 1;return d.name.localeCompare(p.name)}),s=he()?a:a.filter((d)=>!$T(e,d.path,d.type==="directory")),l=dn().searchQuery.toLowerCase(),c=l?s.filter((d)=>d.type==="directory"||d.name.toLowerCase().includes(l)):s;for(let[d,p]of c.entries()){let g=p.type==="directory"&&dn().expanded.has(p.path);if(o.push({depth:t,expanded:g,key:p.path,loading:!1,name:p.name,path:p.path,locale:ch(p.path,n)??void 0,posInSet:d+1,setSize:c.length,type:p.type}),g)Ce(p.path,t+1,o,n)}}function Ne(e){return e===void 0?-1:u.findIndex((t)=>!t.loading&&t.path===e)}function q(e,t){for(let o=e+t;o>=0&&o<u.length;o+=t)if(!u[o].loading)return o;return-1}function ft(e){let t=u[e];if(!t)return-1;for(let o=e-1;o>=0;o--){let n=u[o];if(!n.loading&&n.depth<t.depth)return o}return-1}function ht(){if(H?.isConnected!==!0||M!=="")return;queueMicrotask(h)}function ce(){let e=H;if(e===null)return;K=Mb(K,e,{count:()=>u.length,onChange:ht,rowHeight:me})}function gt(e){let t=String(e.depth+1);if(e.loading)return{ariaExpanded:"",depth:String(e.depth),icon:"",key:e.key,kind:"loading",level:t,locale:"",localeState:"hidden",name:e.name,path:e.path,posInSet:"",setSize:"",type:e.type};return{ariaExpanded:e.type==="directory"?String(e.expanded):"",depth:String(e.depth),icon:dt(e.path,e.type,e.expanded),key:e.key,kind:"item",level:t,locale:e.locale===void 0?"":bn(e.locale),localeState:e.locale===void 0?"hidden":"shown",name:e.name,path:e.path,posInSet:String(e.posInSet),setSize:String(e.setSize),type:e.type}}function wt(){if(ut(),!O){u=[];let l={...U(),view:"none"};return F=l,l}if(!O.isSiteProject&&O.projectRoot==="."){u=[];let l={...U(),view:"welcome"};return F=l,l}let e=dn();u=[];let{i18n:t}=Br(e.projectConfig??{});Ce(".",0,u,t);let o=Ab(H,{count:u.length,rowHeight:me()}),n=u.slice(o.start,o.end),r=(e.selectedPath!==null&&ee(e.selectedPath)?e.selectedPath:"")||n.find((l)=>!l.loading)?.path||"",a=he(),s={currentPath:r,dragPath:M,dropPath:V,headerState:e.isSiteProject?"shown":"hidden",ignoredIcon:a?"eye":"eye-slash",ignoredLabel:a?"Hide ignored files":"Show ignored files",ignoredSelected:a,padBottom:o.padBottom,padTop:o.padTop,projectName:e.projectConfig?.name||e.name,query:e.searchQuery,rootDrop:oe,rows:n.map((l)=>gt(l)),selectedPath:e.selectedPath??"",view:"tree"};return F=s,s}function de(){if(!y||!F)return;F={...F,dragPath:M,dropPath:V,rootDrop:oe},y.handle.update(F)}function h(){Te?.()}async function vt(){let e=dn();e.dirs.clear(),Qu(),await _s(".");for(let t of e.expanded)await _s(t);h()}function yt(e){let t=ee(e);if(!t)return;if(t.type==="directory"){Oe(e).then(()=>h());return}Fr(e)}function bt(e,t){let o=dn();if(ee(e)?.type!=="directory"||o.expanded.has(e)===t)return;if(!t){o.expanded.delete(e),h();return}Oe(e).then(()=>h())}function Ie(e){if(!O||dn().selectedPath===e)return;dn().selectedPath=e,h()}function xt(e,t){let o=Ne(e),n;switch(t){case"Home":{n=q(-1,1);break}case"End":{n=q(u.length,-1);break}case"ArrowUp":{n=q(o,-1);break}case"ArrowLeft":{n=ft(o);break}case"ArrowDown":case"ArrowRight":{n=q(o,1);break}default:return}Le(n)}function Pt(e,t){let o=Ne(e),n=u.length;for(let r=1;r<=n;r++){let a=(o+r+n)%n,s=u[a];if(s&&!s.loading&&s.name.trim().toLowerCase().startsWith(t)){Le(a);return}}}function Le(e){let t=u[e];if(!t)return;if(Ie(t.path),De(t.path))return;Pb(H,e,me()),h()}async function Oe(e){let t=dn();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await _s(e)}var _=new Map,Y=null,M="",Q="",V="",X=!1,oe="";function Ft(e){return[...e.dataTransfer?.types??[]].includes("Files")}function Ae(e,t,o){let n=(s)=>{if(!Ft(s))return;if(s.preventDefault(),s.stopPropagation(),s.dataTransfer)s.dataTransfer.dropEffect="copy";o(!0)},r=()=>o(!1),a=(s)=>{o(!1);let l=s.dataTransfer?.files;if(!l?.length)return;s.preventDefault(),s.stopPropagation(),He(l,t,h)};return e.addEventListener("dragover",n),e.addEventListener("dragleave",r),e.addEventListener("drop",a),()=>{e.removeEventListener("dragover",n),e.removeEventListener("dragleave",r),e.removeEventListener("drop",a)}}function pe(e,t){let o=e.replaceAll("\\","/"),n=t.replaceAll("\\","/");if(!o||o===n)return!1;if(o.startsWith(`${n}/`)||n.startsWith(`${o}/`))return!1;return Z(o)!==n}function le(e,t,o){let n=e.data.path;return o==="directory"&&i(n)&&pe(n,t)}function N(e,t){let o=t?e:"";if(Q===e&&V===o)return;Q=e,V=o,Me()}function G(e){if(X===e)return;X=e,Me()}function Me(){oe=X&&Q===""?"true":"",de()}async function He(e,t,o){if((await cl([...e],{dir:t})).length===0)return;if(t!==".")dn().expanded.add(t);o()}function jt(e,t){let o=document.createElement("input");o.type="file",o.multiple=!0,o.accept=Vc(),o.addEventListener("change",()=>{if(o.files?.length)He(o.files,e,t)}),o.click()}function St(e,t,o){ze(e),L.set(t,e);let n=[Is({element:e,getInitialData(){return{entryType:o,path:t,type:"file-tree"}},onDragStart(){M=t,de()},onDrop(){M="",N("",!1),de()}}),Ae(e,o==="directory"?t:Z(t),(r)=>{N(r?t:"",r)}),ia({canDrop({source:r}){return r.data.type==="file-tree"},element:e,getData({source:r}){return le(r,t,o)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:r}){N(t,le(r,t,o))},onDragEnter({source:r}){N(t,le(r,t,o))},onDragLeave(){N("",!1)},onDrop(){N("",!1)}})];_.set(e,Lo(...n))}function ze(e){let t=_.get(e);if(t)t(),_.delete(e)}function $t(e){if(Y?.element===e)return;We(),H=e;let t=ia({canDrop({source:n}){let r=n.data.path;return n.data.type==="file-tree"&&i(r)&&pe(r,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){G(!0)},onDragLeave(){G(!1)},onDrop(){G(!1)}}),o=ra({onDrop({source:n,location:r}){let[a]=r.current.dropTargets;if(!a)return;if(n.data.type!=="file-tree")return;if(a.data.type!=="file-tree-target")return;let s=n.data.path,l=a.data.targetDir;if(!i(s)||!i(l)||!pe(s,l))return;let c=s.split("/").pop(),d=l==="."?c:`${l}/${c}`;Rt(s,d,h)}});Y={cleanup:Lo(t,o,Ae(e,".",G)),element:e},ce()}function We(){Y?.cleanup(),Y=null;for(let e of _.values())e();_.clear(),K?.window.destroy(),K=null,H=null,M="",Q="",V="",X=!1,oe=""}async function Rt(e,t,o){let n=f();Xs(e,t);try{let r=await n.renameFile(e,t);Ia();for(let[l]of b.tabs.entries())if(l===e)sv(e,t,t);else if(l.startsWith(`${e}/`)){let c=t+l.slice(e.length);sv(l,c,c)}let a=Z(e),s=Z(t);if(await _s(a),s!==a)await _s(s);if(s!==".")dn().expanded.add(s);Je(r,t),o(),GE(`Moved to ${t}`,r,t)}catch(r){E.error(`Could not move ${e}.`,{detail:re(r),path:e,source:"Files"})}}function Z(e){let t=e.replaceAll("\\","/"),o=t.lastIndexOf("/");return o===-1?".":t.slice(0,o)}var W=null;function _e(){W?.close(),W=null}function kt(e){let t={};if(e.type==="directory"){let o=Gp(e.path);if(o?.isSourceRoot===!0&&!o.fileBacked)t.name=o.name;return t}if(t.file=e.path,Ea(e.path))t.path=e.path;if(Uw(e.path).length>0)t.source=e.path;return t}function R(e,t,o,n={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:o,title:t,...n}}function Et(e){let t=ae();if(!t)return[];let o=kt(e),n=[];for(let r of t.forPlacement("context/file")){let a=r.args;if(!(a?.required??[]).every((c)=>(c in o)))continue;let s={};for(let c of Object.keys(a?.properties??{}))if(c in o)s[c]=o[c];let l=t.disabledReason(r.id);n.push(l===void 0?R(r.id,r.title,()=>{un(t,r.id,s,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:r.id,requires:l,title:r.title})}return n}function Dt(e){let t=e.type==="directory",o=[];if(t){if(o.push(R("files.newFile","New File…",()=>{Ve(e.path,h)}),R("files.upload","Upload Files…",()=>{jt(e.path,h)})),e.path==="pages"||e.path.endsWith("/pages"))o.push(R("files.pagesGrid","Edit Pages in Grid",()=>{iC()}))}else o.push(R("files.open","Open",()=>{Fr(e.path)}));return o.push(...Et(e),R("files.rename","Rename…",()=>{Mt(e,h)},{dividerAbove:!0}),R("files.delete","Delete",()=>{Ht(e,h)},{destructive:!0})),o}function Ct(e,t,o){let n=ee(e);if(!n)return;_e();let r=De(e);W=Bt({label:"File actions",onClosed:(a)=>{if(W===a)W=null},opener:r,origin:{x:t,y:o},region:"files",rows:Dt({name:n.name,path:n.path,type:n.type})})}var Nt=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2),k="__other__";function Ee(e){return e.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function ue(e){let t=e.lastIndexOf(".");return t>0?e.slice(t):""}function It(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${oa(e.ext)?.name??e.ext} (${e.ext})`}]:be(e.docKind)).map((o)=>({label:o.label,value:o.ext})),{dividerBefore:!0,label:"Other…",value:k}]}function Lt(e,t,o){let n=e.kind==="choose"?e.defaultExt:e.ext;if(n!==void 0&&t.some((a)=>a.value===n))return n;let r=ue(o);if(r!==""&&t.some((a)=>a.value===r))return r;return t[0]?.value??k}async function Gw(e){let{dir:t,format:o,source:n="Files"}=e;await Xt();let r=new Set;try{let w=await f().listDirectory(t);r=new Set(w.map((m)=>m.name.toLowerCase()))}catch{}let a=o!==void 0&&o.kind!=="fixed"?o:null,s=a===null?null:It(a),l=a===null||s===null?"":Lt(a,s,e.suggestedName??""),c=(w,m)=>{let x=w.trim();if(o===void 0||m===k)return x;if(o.kind==="fixed"){let P=Ee(x);return P===""?"":`${P}${o.ext}`}return x.toLowerCase().endsWith(m.toLowerCase())?x:`${x}${m}`},d=xe(),p=(w,m)=>{let x=w.trim();if(!x)return o?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(o?.kind==="fixed"&&Ee(x)==="")return"Enter at least one letter or number.";let P=x.replaceAll("\\","/");if(P.startsWith("/")||P.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(P.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(P.includes("/")&&o!==void 0&&m!==k)return`Pick Other… to create a file in a subfolder of ${t==="."?"the project root":t}.`;let S=ue(P);if(m!==""&&m!==k&&S!==""&&S.toLowerCase()!==m.toLowerCase()&&d.has(S.toLowerCase()))return`You picked ${s?.find((Ke)=>Ke.value===m)?.label??m}; this name ends in ${S}.`;if(o?.kind==="locked"&&m===k){if(S!==""&&S.toLowerCase()!==o.ext.toLowerCase()&&d.has(S.toLowerCase()))return o.because}let ye=c(w,m);return r.has(ye.toLowerCase())?`${ye} already exists in ${t}/.`:""},j=l,g={confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,select:s===null?"stem":"all",validate:p,value:e.suggestedName??"untitled.json"};if(s!==null)g.choice={initial:l,label:"Format",onChange:(w)=>{j=w},options:()=>s};if(e.suggestedName!==void 0)g.placeholder=e.suggestedName;let ge=await Hn(e.title??"New File",g);if(!ge)return null;let D=c(ge,j),C=t==="."?D:`${t}/${D}`;Xs(C);let ve=rn(D),Be=te(e.content)?await e.content(ue(D),D):e.content,Ue=o!==void 0&&j!==k,qe=Be??ve?.studio?.newFileTemplate??(ve?"":D.toLowerCase().endsWith(".json")?Ue?Nt:`{}
2
+ `:"");try{return await f().writeFile(C,qe),await _s(t),E.success(`Created ${C}`),C}catch(w){return E.error(`Could not create ${C}.`,{detail:re(w),path:C,source:n}),null}}async function Ve(e,t){await Xt();let o=Gp(e);if(o?.unresolvedFormat!=null)E.error(`New files in ${e}/ cannot be constrained to the collection's format.`,{detail:`The "${o.name}" content type declares format "${o.unresolvedFormat}", which no installed extension provides. Install the extension that supplies it, or correct `+"the name in Project Settings › Content Types.",path:e,source:"Files"});let n=o?.ext!=null&&o.unresolvedFormat===null,r=n&&o.isSourceRoot&&o.def.schema!==void 0,a;if(r){let{createEntry:s}=await (we("may24cpt"),import("./entry-commands-may24cpt.js"));a=await s(o.name,{dir:e})}else a=await Gw({dir:e,format:n&&o.ext!==null?{because:`${o.name} entries are ${o.ext} files, so a document of another format here would not be one.`,ext:o.ext,kind:"locked"}:{defaultExt:".json",kind:"choose"},suggestedName:"untitled"});if(a!==null)t()}async function Ot(e,t){let o=await Tm(t),n={confirmLabel:"Rename",select:"stem",validate:(r)=>r.trim()?"":"Enter a file name.",value:e};if(o!==void 0)n.message=o;return Hn("Rename",n)}function At(e,t){let o=t.references,n=t.tag?`; tag → <${t.tag.to}> (${t.tag.refsUpdated})`:"";if(o&&o.refsUpdated>0)return`Renamed to ${e}; updated ${o.refsUpdated} reference(s) in ${o.filesChanged} file(s)${n}`;if(n)return`Renamed to ${e}${n}`;return`Renamed to ${e}`}function GE(e,t,o){let n=t.errors??[];if(n.length===0){E.success(e);return}let r=n.length===1?"1 file":`${n.length} files`;E.warn(`${e} — references in ${r} could not be updated`,{detail:n.map((a)=>`${a.path}: ${a.error}`).join(`
3
+ `),path:o,source:"Files"})}function Je(e,t){for(let o of e.references?.files??[])if(o.path!==t&&b.tabs.has(o.path))Sp(o.path)}function fe(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function jI(e,t,o){Ia();let n=fe(e),r=fe(t);if(await _s(n),r!==n)await _s(r);if(dn().selectedPath===e)dn().selectedPath=t;Je(o,t)}async function Mt(e,t){let o=await Ot(e.name,e.path);if(!o||o===e.name)return;let n=fe(e.path),r=n==="."?o:`${n}/${o}`;Xs(e.path,r);try{let s=await f().renameFile(e.path,r);if(b.tabs.has(e.path))sv(e.path,r,r);await jI(e.path,r,s),t(),GE(At(o,s),s,r)}catch(a){E.error(`Could not rename ${e.name}.`,{detail:re(a),path:e.path,source:"Files"})}}async function Ht(e,t){if(!await Em(e))return;try{let n=f();Xs(e.path),await n.deleteFile(e.path),Ia();let r=e.path.replaceAll("\\","/"),a=r.includes("/")?r.slice(0,r.lastIndexOf("/")):".";if(await _s(a),dn().selectedPath===e.path)dn().selectedPath=null;t(),E.success(`Deleted ${e.name}`)}catch(n){E.error(`Could not delete ${e.name}.`,{detail:re(n),path:e.path,source:"Files"})}}function zt(e,t){let o=t.paneId,n=fh(e);if(o!==void 0&&n){if(n.activeTabId===e&&t.focus===!1)return;tg(e,o)}bi(e,{focus:t.focus!==!1})}async function Fr(e,t={}){let o=t.focus!==!1;for(let[r,a]of b.tabs.entries())if(a.documentPath===e){if(zt(r,t),o)dn().selectedPath=e;return}if(Qw(e)){if(QE(e,t),o)dn().selectedPath=e;fm({name:e.split("/").pop()||e,path:e,root:dn().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await yT(e,t),o)dn().selectedPath=e;fm({name:e.split("/").pop()||e,path:e,root:dn().projectRoot})}catch(r){E.error(`Could not open ${e}.`,{detail:re(r),path:e,source:"Open File"})}return}let n=f();try{let r=await n.readFile(e);if(!r){if(await Xt(),!rn(e)&&!e.toLowerCase().endsWith(".json"))throw af(e);return}await Xt();let a,s,l=null,c=rn(e);if(c){let p=await Vo(e,r);({document:a}=p),{frontmatter:s}=p}else if(e.endsWith(".json"))({document:a,layout:l}=Ts(r));else throw af(e);if(zr({id:e,documentPath:e,document:a,...s!=null&&{frontmatter:s},layout:l,sourceFormat:c?.name??null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}}),o)dn().selectedPath=e;fm({name:e.split("/").pop()||e,path:e,root:dn().projectRoot})}catch(r){E.error(`Could not open ${e}.`,{detail:re(r),path:e,source:"Open File"})}}async function Jw(e,t){await Fr(t,{focus:!1,paneId:e,preview:!0})}function OS(e){if(Ym(e))return;for(let[,t]of b.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){Sp(e);return}}function AS(e){for(let t of e)Sp(t,{onlyIfChanged:!0})}async function Sp(e,t={}){for(let[,o]of b.tabs.entries())if(o.documentPath===e){let n=f(),r=o.doc.dirty,a=()=>!r&&o.doc.dirty||Ym(e);try{let s=await n.readFile(e);if(!s)return;if(await Xt(),a())return;if(rn(e)){let{document:l,frontmatter:c}=await Vo(e,s);if(a())return;if(t.onlyIfChanged&&Ss(l,o.doc.document)&&Ss(c,o.doc.content.frontmatter))return;o.doc.document=l,o.doc.content.frontmatter=c}else if(e.endsWith(".json")){let l=Ts(s);if(o.doc.layout=l.layout,t.onlyIfChanged&&Ss(l.document,o.doc.document))return;o.doc.document=l.document}o.doc.dirty=!1}catch(s){E.error(`Could not reload ${e} after it changed on disk.`,{detail:re(s),key:`reload:${e}`,path:e,source:"Files"})}return}}function PS(){Xn({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",render:()=>mt,afterRender:(e,t)=>{_t(t,e.rerender)}})}var Wt={activate:yt,contextMenu:Ct,expand:bt,move:xt,newFile:()=>{Ve(".",h)},openProject:()=>{fl("project.open",void 0,"Files")},refresh:()=>{vt()},rowHost:St,search:(e)=>{dn().searchQuery=e,h()},select:Ie,toggleIgnored:()=>{lt(!he()),h()},treeHost:$t,typeahead:Pt},y=null,F=null;function _t(e,t){let o=e.querySelector(".panel-content")??e;if(Te=t,y&&(y.host!==o||!y.handle.connected()))Vt();let n=wt();if(y)y.handle.update(n);else{let r=ke(o,n,Wt);y={handle:r,host:o},r.ready.then(ce)}queueMicrotask(ce)}function Vt(){_e(),y?.handle.dispose(),y=null,F=null,We(),L.clear(),u=[]}
4
+ export{pm,Uw,zE,UE,Nb,Ob,qw,qE,KE,fm,_s,mm,IS,DS,NS,Kw,gm,Gw,GE,jI,Fr,Jw,OS,AS,Sp,PS};
5
+
6
+ //# debugId=6D4C57B77AEB479064756E2164756E21
7
+ //# sourceMappingURL=studio-y04qtxvp.js.map
@@ -0,0 +1,5 @@
1
+ import{ee,T}from"./studio-cffqvnzd.js";function p(t){return JSON.parse(JSON.stringify(t))}function Te(t){return t===void 0||t===null?t:p(t)}function ne(t,e){let n=t;for(let r of e){if(n==null)return;n=n[r]}return n}function sg(t){if(Array.isArray(t))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!t.children)t.children=[];if(!Array.isArray(t.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return t.children}function ag(t,e){let{op:n}=e;switch(e.op){case"set-key":{let r=ne(t,e.path);if(!r)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete r[e.key];else r[e.key]=Te(e.value);return}case"insert-child":{i(t,e.parentPath).splice(e.index,0,Te(e.node));return}case"remove-child":{i(t,e.parentPath).splice(e.index,1);return}case"set-child":{i(t,e.parentPath).splice(e.index,1,Te(e.node));return}case"move-child":{x(e);let r=i(t,e.fromParentPath),o=i(t,e.toParentPath),[a]=r.splice(e.fromIndex,1);o.splice(e.toIndex,0,a);return}default:break}throw Error(`unknown-doc-op:${n}`)}function i(t,e){let n=ne(t,e);if(n==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return sg(n)}function h(t,e,n,r,o){let a=t.length,m=a<e.length&&t.every((J,b)=>J===e[b]),d=e[a+1];if(!m||e[a]!=="children"||!ee(d))return e;if(o?d<n:d<=n)return e;let c=[...e];return c[a+1]=d+r,c}function x(t){let e=[...t.fromParentPath,"children",t.fromIndex],n=t.toParentPath;if(n.length>=e.length&&e.every((r,o)=>r===n[o]))throw Error(`doc-op-move-into-self:${n.join("/")}`)}function u(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function K1(t,e){let{op:n}=e;switch(e.op){case"set-key":{let r=ne(t,e.path);if(!r)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);let o=Te(r[e.key]);return o===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:o}}case"insert-child":{let{length:r}=l(t,e.parentPath);return{index:u(e.index,r),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let r=s(t,e.parentPath,e.index);return{index:e.index,node:r,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let r=s(t,e.parentPath,e.index);return{index:e.index,node:r,op:"set-child",parentPath:e.parentPath}}case"move-child":{x(e);let r=f(t,e.fromParentPath);P(r,e.fromParentPath,e.fromIndex);let o=l(t,e.toParentPath),a=u(e.toIndex,o.length-(o===r?1:0));return{fromIndex:a,fromParentPath:h(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:h(e.toParentPath,e.fromParentPath,a,1,!0)}}default:break}throw Error(`unknown-doc-op:${n}`)}function f(t,e){let n=ne(t,e);return n&&Array.isArray(n.children)?n.children:null}function P(t,e,n){if(!t||n<0||n>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",n].join("/")}`)}function s(t,e,n){let r=f(t,e);return P(r,e,n),Te(r[n])}function l(t,e){let n=ne(t,e);if(!T(n)||Array.isArray(n))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(n.children===void 0)return[];if(!Array.isArray(n.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return n.children}
2
+ export{Te,ne,sg,ag,K1};
3
+
4
+ //# debugId=E94808DD50218A1264756E2164756E21
5
+ //# sourceMappingURL=studio-y21g8zzg.js.map