@jxsuite/studio 10.4.0 → 10.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/data/locales/en/elements.json +434 -0
  2. package/data/webdata.json +116 -139
  3. package/dist/chunks/2020-rqm7qrje.js +4 -0
  4. package/dist/chunks/adapter-cyy8vbcx.js +4 -0
  5. package/dist/chunks/add-new-flow-8cgtejv2.js +4 -0
  6. package/dist/chunks/{cf-account-picker-xb8vvt2h.js → cf-account-picker-v3qd2dhw.js} +3 -3
  7. package/dist/chunks/cf-settings-1fnw874z.js +4 -0
  8. package/dist/chunks/{color-area-h8dbasp1.js → color-area-frd9y9q6.js} +2 -2
  9. package/dist/chunks/color-field-rebpbe33.js +4 -0
  10. package/dist/chunks/{color-slider-nz2mrzky.js → color-slider-6bzmk3s7.js} +2 -2
  11. package/dist/chunks/color-t2bnnj8y.js +4 -0
  12. package/dist/chunks/{combobox-6hs00996.js → combobox-c49x7gf1.js} +3 -3
  13. package/dist/chunks/components-y8yhdd7d.js +4 -0
  14. package/dist/chunks/content-source-9e7qvmsf.js +4 -0
  15. package/dist/chunks/convert-to-repeater-pd2w4z21.js +4 -0
  16. package/dist/chunks/editor-mb9jzdrw.js +4 -0
  17. package/dist/chunks/entry-commands-at0wnx3f.js +4 -0
  18. package/dist/chunks/extension-sections-4z9qq0gh.js +4 -0
  19. package/dist/chunks/file-ops-dtdvjmza.js +4 -0
  20. package/dist/chunks/files-8pf70854.js +4 -0
  21. package/dist/chunks/format-host-fd3m2y2a.js +4 -0
  22. package/dist/chunks/fs-events-hrk29vcv.js +4 -0
  23. package/dist/chunks/grid-open-bh74v82z.js +4 -0
  24. package/dist/chunks/{grid-view-2f03wcgw.js → grid-view-a51mgzmq.js} +17 -17
  25. package/dist/chunks/{icons-gb967qc8.js → icons-qp8fn1k8.js} +2 -2
  26. package/dist/chunks/{iframe-entry-btck0e9s.js → iframe-entry-mpwe5pwk.js} +4 -4
  27. package/dist/chunks/{iframe-entry-2x9bn5ng.js → iframe-entry-msd43x9h.js} +4 -4
  28. package/dist/chunks/iframe-entry-rt8jz5t8.js +5 -0
  29. package/dist/chunks/{iframe-entry-b5qgggyp.js → iframe-entry-v40cr813.js} +4 -4
  30. package/dist/chunks/iframe-host-q0s0wwy3.js +4 -0
  31. package/dist/chunks/{image-bake-4afr4y6a.js → image-bake-q9ajdjsj.js} +3 -3
  32. package/dist/chunks/{image-editor-x7t8jbjn.js → image-editor-ke9std9b.js} +3 -3
  33. package/dist/chunks/index-57ang7ma.js +4 -0
  34. package/dist/chunks/index-eytr7av4.js +17 -0
  35. package/dist/chunks/{index-yjrfeks8.js → index-x495reff.js} +3 -3
  36. package/dist/chunks/{javascript-hy2mws8v.js → javascript-qe34bvaz.js} +3 -3
  37. package/dist/chunks/jsonMode-m8rseh31.js +13 -0
  38. package/dist/chunks/jx-validate-bbd1mary.js +4 -0
  39. package/dist/chunks/layers-panel-wcjtdqsa.js +4 -0
  40. package/dist/chunks/layers-yscpys6q.js +4 -0
  41. package/dist/chunks/{listbox-7gka1h86.js → listbox-tktzq5xj.js} +2 -2
  42. package/dist/chunks/lit-html-qm5wbhqz.js +4 -0
  43. package/dist/chunks/media-library-2hfff88g.js +4 -0
  44. package/dist/chunks/media-open-4pb05cne.js +4 -0
  45. package/dist/chunks/media-picker-bzktmmwr.js +4 -0
  46. package/dist/chunks/menu-xc3cbgsd.js +4 -0
  47. package/dist/chunks/{monaco-binding-a51py33c.js → monaco-binding-7t38arh9.js} +3 -3
  48. package/dist/chunks/monaco-buffer-3vz94c9f.js +4 -0
  49. package/dist/chunks/monaco-setup-fstdew02.js +4 -0
  50. package/dist/chunks/notify-gbdcckrh.js +4 -0
  51. package/dist/chunks/parse-fpdzgk4c.js +4 -0
  52. package/dist/chunks/platform-9g72gdqr.js +4 -0
  53. package/dist/chunks/popover-cnmsav6b.js +4 -0
  54. package/dist/chunks/publish-panel-91x1cb5d.js +4 -0
  55. package/dist/chunks/publish-quick-e2dmf7eg.js +4 -0
  56. package/dist/chunks/publish-workspace-1x8mnzrj.js +4 -0
  57. package/dist/chunks/quick-search-2m4y6p1x.js +4 -0
  58. package/dist/chunks/references-yg1g9rwx.js +4 -0
  59. package/dist/chunks/right-panel-7mfyhzrk.js +4 -0
  60. package/dist/chunks/source-control-rrc4jgp5.js +4 -0
  61. package/dist/chunks/{split-m5rwn31z.js → split-d15yencd.js} +2 -2
  62. package/dist/chunks/studio-0jhhznxy.js +9 -0
  63. package/dist/chunks/studio-0nb57pjg.js +7 -0
  64. package/dist/chunks/{studio-s24mhq0z.js → studio-0wa4wv4s.js} +4 -4
  65. package/dist/chunks/studio-0z8kp4xk.js +5 -0
  66. package/dist/chunks/{studio-g0hxtcga.js → studio-18gc5t3v.js} +4 -4
  67. package/dist/chunks/{studio-4fnb5648.js → studio-1b79rpcb.js} +4 -4
  68. package/dist/chunks/studio-211q5j7m.js +4 -0
  69. package/dist/chunks/studio-213pyfxh.js +16 -0
  70. package/dist/chunks/studio-2b1smjvp.js +5 -0
  71. package/dist/chunks/{studio-nwf0c32p.js → studio-2v6tc9jp.js} +4 -4
  72. package/dist/chunks/studio-30j0wz99.js +5 -0
  73. package/dist/chunks/studio-3kmqhwtt.js +5 -0
  74. package/dist/chunks/studio-44drsmhw.js +5 -0
  75. package/dist/chunks/{studio-2pk7kc7z.js → studio-495b6f2r.js} +4 -4
  76. package/dist/chunks/{studio-jma2q8r9.js → studio-4gthb2fd.js} +4 -4
  77. package/dist/chunks/{studio-0gvvqj3h.js → studio-4xadhxj1.js} +4 -4
  78. package/dist/chunks/{studio-nvcn2ykc.js → studio-52mzbxqm.js} +4 -4
  79. package/dist/chunks/{studio-v7a7yb5w.js → studio-56mmnsw8.js} +7 -7
  80. package/dist/chunks/studio-59hz8f4r.js +5 -0
  81. package/dist/chunks/{studio-sce30r7b.js → studio-5k9mfafh.js} +3 -3
  82. package/dist/chunks/{studio-rr00ex23.js → studio-5qez462c.js} +6 -6
  83. package/dist/chunks/studio-6tnpg0vx.js +5 -0
  84. package/dist/chunks/studio-6w8mt734.js +6 -0
  85. package/dist/chunks/studio-7hm04x5z.js +5 -0
  86. package/dist/chunks/studio-8atmfjjm.js +7 -0
  87. package/dist/chunks/{studio-wmjmsw0p.js → studio-8n99z71s.js} +4 -4
  88. package/dist/chunks/studio-8vmad6x2.js +5 -0
  89. package/dist/chunks/studio-93p5k4r4.js +5 -0
  90. package/dist/chunks/{studio-2x972v58.js → studio-9gb0m81w.js} +4 -4
  91. package/dist/chunks/studio-a4ymg4vd.js +5 -0
  92. package/dist/chunks/studio-anc8067x.js +5 -0
  93. package/dist/chunks/{studio-2e4hry72.js → studio-dbdt67kr.js} +5 -5
  94. package/dist/chunks/studio-dbex091t.js +5 -0
  95. package/dist/chunks/{studio-amaz545p.js → studio-dj8ctxey.js} +4 -4
  96. package/dist/chunks/{studio-k2evngrj.js → studio-ed9bz68j.js} +5 -5
  97. package/dist/chunks/{studio-4bgvvzhv.js → studio-fe2d1fp5.js} +4 -4
  98. package/dist/chunks/{studio-45mj4jqe.js → studio-fgp4cyy3.js} +4 -4
  99. package/dist/chunks/studio-ft706q02.js +5 -0
  100. package/dist/chunks/studio-g79s1dyg.js +6 -0
  101. package/dist/chunks/{studio-pj216fmn.js → studio-gahswxp4.js} +4 -4
  102. package/dist/chunks/studio-gbqc12bk.js +5 -0
  103. package/dist/chunks/studio-gxphbetb.js +6 -0
  104. package/dist/chunks/studio-hdf01j7q.js +7 -0
  105. package/dist/chunks/studio-hf259xzd.js +48 -0
  106. package/dist/chunks/studio-jbva4wxw.js +5 -0
  107. package/dist/chunks/studio-jj9gf1qc.js +5 -0
  108. package/dist/chunks/studio-jsjg3mjv.js +5 -0
  109. package/dist/chunks/studio-jtvb8hd7.js +5 -0
  110. package/dist/chunks/{studio-g9brbewz.js → studio-kp4vzrct.js} +4 -4
  111. package/dist/chunks/studio-kpx02gaa.js +7 -0
  112. package/dist/chunks/{studio-3na1r48j.js → studio-kv1728ex.js} +8 -8
  113. package/dist/chunks/studio-m25ry0mf.js +5 -0
  114. package/dist/chunks/studio-mcbwmkyh.js +5 -0
  115. package/dist/chunks/studio-meajkr51.js +5 -0
  116. package/dist/chunks/studio-mkjrjpr2.js +6 -0
  117. package/dist/chunks/{studio-eqcddvc2.js → studio-mr084886.js} +201 -201
  118. package/dist/chunks/studio-mrb10hv3.js +5 -0
  119. package/dist/chunks/{studio-0939t1q1.js → studio-nhpg405j.js} +4 -4
  120. package/dist/chunks/studio-nsec0hxm.js +64 -0
  121. package/dist/chunks/{studio-xx3r3sb0.js → studio-nv0mh0p5.js} +4 -4
  122. package/dist/chunks/studio-pafmb06w.js +5 -0
  123. package/dist/chunks/{studio-pm17wdc4.js → studio-pgftd79b.js} +4 -4
  124. package/dist/chunks/{studio-4zd6an2b.js → studio-pk961xgz.js} +4 -4
  125. package/dist/chunks/studio-pzbr7g05.js +5 -0
  126. package/dist/chunks/studio-qcc5hsw2.js +10 -0
  127. package/dist/chunks/studio-qfq58c8n.js +5 -0
  128. package/dist/chunks/studio-qvb2jr83.js +5 -0
  129. package/dist/chunks/studio-r85zw6ay.js +5 -0
  130. package/dist/chunks/studio-s0kwce5w.js +9 -0
  131. package/dist/chunks/studio-s6ymkf3q.js +14 -0
  132. package/dist/chunks/{studio-0x6f3nk9.js → studio-s7p5ccxa.js} +4 -4
  133. package/dist/chunks/{studio-1410q5dw.js → studio-s9jjap3x.js} +4 -4
  134. package/dist/chunks/{studio-evq47j2z.js → studio-t5hde1ws.js} +4 -4
  135. package/dist/chunks/studio-vj9yv897.js +5 -0
  136. package/dist/chunks/studio-wmak8xjw.js +5 -0
  137. package/dist/chunks/{studio-bnc50f9h.js → studio-wqsmvtqj.js} +4 -4
  138. package/dist/chunks/studio-x3z3rhej.js +5 -0
  139. package/dist/chunks/{studio-bg8pzprg.js → studio-xb55kpmy.js} +4 -4
  140. package/dist/chunks/studio-xxtdajmv.js +12 -0
  141. package/dist/chunks/studio-xxttcym1.js +5 -0
  142. package/dist/chunks/{studio-90zkgne5.js → studio-y2zsnzye.js} +7 -7
  143. package/dist/chunks/{studio-3qr08sxq.js → studio-y3tjh2xb.js} +3 -3
  144. package/dist/chunks/studio-y4f1rdsj.js +5 -0
  145. package/dist/chunks/studio-ybkd5w8k.js +5 -0
  146. package/dist/chunks/{studio-tpxcryf2.js → studio-yetr4gg1.js} +4 -4
  147. package/dist/chunks/studio-z295anhs.js +6 -0
  148. package/dist/chunks/studio-z89e6wpg.js +9 -0
  149. package/dist/chunks/{studio-5tet77de.js → studio-zbwr6prc.js} +3 -3
  150. package/dist/chunks/{studio-daksw8kh.js → studio-zdbsv5q2.js} +4 -4
  151. package/dist/chunks/{studio-abh9kfdh.js → studio-zvthj8hg.js} +4 -4
  152. package/dist/chunks/toast-2kn2vrn4.js +4 -0
  153. package/dist/chunks/{toast-host-g3r2s0kn.js → toast-host-3rxeyj3d.js} +3 -3
  154. package/dist/chunks/{tooltip-dj1pvgz7.js → tooltip-ghkxkasp.js} +3 -3
  155. package/dist/chunks/{tree-j0ebwr5s.js → tree-vw4nc63s.js} +2 -2
  156. package/dist/chunks/tsMode-7gngmamr.js +14 -0
  157. package/dist/chunks/workspace-gv0hxgsm.js +4 -0
  158. package/dist/chunks/workspace-home-j7e0mjy5.js +4 -0
  159. package/dist/chunks/{ws-client-arz2qsy9.js → ws-client-vs11sxc5.js} +3 -3
  160. package/dist/iframe-entry.js +14 -14
  161. package/dist/manifest.json +84 -83
  162. package/dist/studio.js +99 -98
  163. package/dist/workers/ts.worker.js +3 -3
  164. package/package.json +12 -12
  165. package/src/browse/library-layouts.ts +9 -12
  166. package/src/browse/library-pane.ts +22 -16
  167. package/src/browse/library-source.ts +3 -4
  168. package/src/browse/preview-style.ts +2 -1
  169. package/src/canvas/canvas-live-render.ts +2 -5
  170. package/src/canvas/canvas-page-context.ts +5 -0
  171. package/src/canvas/canvas-render.ts +6 -1
  172. package/src/canvas/iframe-drop.ts +84 -1
  173. package/src/canvas/iframe-entry.ts +9 -6
  174. package/src/canvas/iframe-render.ts +13 -0
  175. package/src/collab/collab-session.ts +2 -2
  176. package/src/commands/levels.ts +1 -1
  177. package/src/content/entry-commands.ts +32 -27
  178. package/src/content/entry-editor.ts +46 -44
  179. package/src/content/entry-inspector.ts +15 -12
  180. package/src/content/entry-model.ts +3 -3
  181. package/src/content/entry-summaries.ts +5 -5
  182. package/src/content/hold-state.ts +172 -0
  183. package/src/content/page-summaries.ts +10 -14
  184. package/src/create/add-new-flow.ts +2 -1
  185. package/src/editor/convert-targets.ts +2 -23
  186. package/src/editor/inline-edit.ts +6 -1
  187. package/src/editor/repeater-scope.ts +333 -74
  188. package/src/editor/slash-menu.ts +35 -17
  189. package/src/files/files.ts +18 -0
  190. package/src/format/format-choices.ts +5 -5
  191. package/src/format/format-host.ts +35 -3
  192. package/src/grid/redirects-grid.ts +4 -4
  193. package/src/grid/sources/content-source.ts +42 -66
  194. package/src/locale/element-names.ts +131 -0
  195. package/src/panels/block-action-bar.ts +3 -4
  196. package/src/panels/dnd.ts +3 -1
  197. package/src/panels/elements-panel.ts +93 -36
  198. package/src/panels/events-panel.ts +6 -2
  199. package/src/panels/formula-workspace.ts +9 -0
  200. package/src/panels/imports-panel.ts +3 -2
  201. package/src/panels/navigator-panels.ts +10 -10
  202. package/src/panels/panel-registry.ts +3 -3
  203. package/src/panels/properties-panel.ts +127 -35
  204. package/src/panels/site-panel.ts +2 -1
  205. package/src/panels/statement-editor.ts +4 -0
  206. package/src/panels/style-panel.ts +2 -1
  207. package/src/panels/styles-panel.ts +2 -2
  208. package/src/panels/tab-strip.ts +29 -26
  209. package/src/platforms/cloud.ts +5 -2
  210. package/src/services/ai-command-tools.ts +2 -1
  211. package/src/services/ai-project-tools.ts +21 -8
  212. package/src/services/ai-tools.ts +5 -5
  213. package/src/services/ai-write-report.ts +22 -4
  214. package/src/services/context-manager.ts +110 -2
  215. package/src/services/document-assistant.ts +2 -2
  216. package/src/services/harness/chat-reducer.ts +9 -4
  217. package/src/services/jxn-language.ts +110 -0
  218. package/src/services/model-uri.ts +3 -0
  219. package/src/services/monaco-setup.ts +6 -2
  220. package/src/services/render-critic.ts +234 -12
  221. package/src/services/tool-executor.ts +16 -8
  222. package/src/settings/contributed-section.ts +2 -1
  223. package/src/settings/extension-commands.ts +2 -1
  224. package/src/settings/general-settings.ts +2 -2
  225. package/src/settings/settings-document.ts +5 -5
  226. package/src/shell.ts +1 -1
  227. package/src/studio.ts +28 -11
  228. package/src/style/variables-view.ts +2 -2
  229. package/src/surfaces/collections-panel.json +1 -1
  230. package/src/surfaces/collections-panel.ts +1 -1
  231. package/src/surfaces/entry-editor.json +10 -10
  232. package/src/surfaces/entry-editor.ts +22 -19
  233. package/src/surfaces/entry-inspector.json +11 -11
  234. package/src/surfaces/entry-inspector.ts +17 -10
  235. package/src/surfaces/panel-elements.json +466 -206
  236. package/src/surfaces/panel-elements.ts +61 -25
  237. package/src/surfaces/tab-strip.json +5 -5
  238. package/src/surfaces/tab-strip.ts +2 -2
  239. package/src/tabs/project-config.ts +13 -13
  240. package/src/tabs/tab.ts +7 -2
  241. package/src/types.ts +13 -2
  242. package/src/ui/expression-editor.ts +10 -5
  243. package/src/ui/schema-form.ts +18 -1
  244. package/src/utils/edit-display.ts +27 -1
  245. package/src/view.ts +9 -2
  246. package/src/workspace/tab-workspace.ts +2 -2
  247. package/src/workspace/workspace-back.ts +2 -2
  248. package/dist/chunks/2020-906vx2dq.js +0 -4
  249. package/dist/chunks/adapter-hnvad61x.js +0 -4
  250. package/dist/chunks/add-new-flow-v0pm96mr.js +0 -4
  251. package/dist/chunks/cf-settings-mkbcz4z2.js +0 -4
  252. package/dist/chunks/color-04361ttk.js +0 -4
  253. package/dist/chunks/color-field-qv5r2b16.js +0 -4
  254. package/dist/chunks/components-w5zqwva1.js +0 -4
  255. package/dist/chunks/content-source-g38w0d3f.js +0 -4
  256. package/dist/chunks/convert-to-repeater-r8sfxjjm.js +0 -4
  257. package/dist/chunks/editor-wvf5e6j9.js +0 -4
  258. package/dist/chunks/entry-commands-t13dyw3c.js +0 -4
  259. package/dist/chunks/extension-sections-vjzw46xb.js +0 -4
  260. package/dist/chunks/file-ops-1sghzgcr.js +0 -4
  261. package/dist/chunks/files-zrqtgt41.js +0 -4
  262. package/dist/chunks/format-host-9gy76erh.js +0 -4
  263. package/dist/chunks/fs-events-45rhg3me.js +0 -4
  264. package/dist/chunks/grid-open-t4fq6bbm.js +0 -4
  265. package/dist/chunks/iframe-entry-42hpmwz5.js +0 -5
  266. package/dist/chunks/iframe-host-9aq8ze3q.js +0 -4
  267. package/dist/chunks/index-f9qr7kzh.js +0 -4
  268. package/dist/chunks/jsonMode-vj30te2h.js +0 -13
  269. package/dist/chunks/jx-validate-r4ax11e3.js +0 -4
  270. package/dist/chunks/layers-m49nmwvx.js +0 -4
  271. package/dist/chunks/layers-panel-zr92pwdp.js +0 -4
  272. package/dist/chunks/lit-html-k2mb9k0r.js +0 -4
  273. package/dist/chunks/media-library-j74rt0w4.js +0 -4
  274. package/dist/chunks/media-open-mypr0k6b.js +0 -4
  275. package/dist/chunks/media-picker-pemtbsjv.js +0 -4
  276. package/dist/chunks/menu-d2jxpgma.js +0 -4
  277. package/dist/chunks/monaco-buffer-pa0g6ax7.js +0 -4
  278. package/dist/chunks/monaco-setup-0hw9f835.js +0 -4
  279. package/dist/chunks/notify-bwehrp7q.js +0 -4
  280. package/dist/chunks/parse-hee7ne9b.js +0 -4
  281. package/dist/chunks/platform-kv0k65cy.js +0 -4
  282. package/dist/chunks/popover-9tf4cjrk.js +0 -4
  283. package/dist/chunks/publish-panel-vg1n880b.js +0 -4
  284. package/dist/chunks/publish-quick-4fwngwrw.js +0 -4
  285. package/dist/chunks/publish-workspace-jv4w2bx2.js +0 -4
  286. package/dist/chunks/quick-search-nh29rt8a.js +0 -4
  287. package/dist/chunks/references-vqyr5s9x.js +0 -4
  288. package/dist/chunks/right-panel-3ws9f2w0.js +0 -4
  289. package/dist/chunks/source-control-h3hcs5gy.js +0 -4
  290. package/dist/chunks/studio-0khd8xtx.js +0 -4
  291. package/dist/chunks/studio-1ctnw3xv.js +0 -5
  292. package/dist/chunks/studio-1ks5d9y4.js +0 -5
  293. package/dist/chunks/studio-1y9mab9m.js +0 -5
  294. package/dist/chunks/studio-2kpxm0eh.js +0 -7
  295. package/dist/chunks/studio-2zz4qbv9.js +0 -5
  296. package/dist/chunks/studio-3pz4t5a2.js +0 -5
  297. package/dist/chunks/studio-4f7thq0p.js +0 -5
  298. package/dist/chunks/studio-61rg2cz5.js +0 -5
  299. package/dist/chunks/studio-7rrdbvex.js +0 -5
  300. package/dist/chunks/studio-9c6cbq2c.js +0 -4
  301. package/dist/chunks/studio-9dq7rwc7.js +0 -5
  302. package/dist/chunks/studio-9gr7xs9r.js +0 -6
  303. package/dist/chunks/studio-a88ej93p.js +0 -7
  304. package/dist/chunks/studio-acer0g8w.js +0 -5
  305. package/dist/chunks/studio-az3wvyh2.js +0 -5
  306. package/dist/chunks/studio-brh8d2pr.js +0 -5
  307. package/dist/chunks/studio-c2fa783p.js +0 -9
  308. package/dist/chunks/studio-cfnn70h1.js +0 -5
  309. package/dist/chunks/studio-cqxj4fcy.js +0 -5
  310. package/dist/chunks/studio-cw11h078.js +0 -5
  311. package/dist/chunks/studio-dn56z7sn.js +0 -5
  312. package/dist/chunks/studio-egnjpyde.js +0 -9
  313. package/dist/chunks/studio-ejrypvmq.js +0 -5
  314. package/dist/chunks/studio-frc16j8v.js +0 -10
  315. package/dist/chunks/studio-gnazwtv3.js +0 -5
  316. package/dist/chunks/studio-hfqpfmpk.js +0 -5
  317. package/dist/chunks/studio-hh394phe.js +0 -5
  318. package/dist/chunks/studio-j0zf5x2x.js +0 -5
  319. package/dist/chunks/studio-j5fcp6gj.js +0 -5
  320. package/dist/chunks/studio-jd1qb1st.js +0 -7
  321. package/dist/chunks/studio-k0xzrse2.js +0 -64
  322. package/dist/chunks/studio-k1xqrgm5.js +0 -5
  323. package/dist/chunks/studio-k3we3kqb.js +0 -5
  324. package/dist/chunks/studio-knsjyx7n.js +0 -5
  325. package/dist/chunks/studio-mrjtnm62.js +0 -5
  326. package/dist/chunks/studio-n9qba0gx.js +0 -5
  327. package/dist/chunks/studio-nzemfbkk.js +0 -14
  328. package/dist/chunks/studio-pwctzka3.js +0 -16
  329. package/dist/chunks/studio-q80fg1d6.js +0 -12
  330. package/dist/chunks/studio-q9hx2qp0.js +0 -5
  331. package/dist/chunks/studio-qrzmfaf6.js +0 -5
  332. package/dist/chunks/studio-r6mx7vm5.js +0 -7
  333. package/dist/chunks/studio-swedpd82.js +0 -5
  334. package/dist/chunks/studio-tmfcn347.js +0 -6
  335. package/dist/chunks/studio-v5wktj6f.js +0 -5
  336. package/dist/chunks/studio-vpevkfxw.js +0 -5
  337. package/dist/chunks/studio-wqfaqw4m.js +0 -5
  338. package/dist/chunks/studio-xpx91fby.js +0 -6
  339. package/dist/chunks/studio-xva3hzkv.js +0 -5
  340. package/dist/chunks/studio-z3fztxrp.js +0 -9
  341. package/dist/chunks/studio-z9453ypn.js +0 -6
  342. package/dist/chunks/toast-w11qpkyz.js +0 -4
  343. package/dist/chunks/tsMode-jg1dtphj.js +0 -14
  344. package/dist/chunks/workspace-6ztqcrsh.js +0 -4
  345. package/dist/chunks/workspace-home-rse9h8a0.js +0 -4
  346. package/src/content/draft-state.ts +0 -108
@@ -0,0 +1,5 @@
1
+ import{Va}from"./studio-y3tjh2xb.js";var t=Va(null);function cP(e){t.value=e}function ae(){return t.value}
2
+ export{cP,ae};
3
+
4
+ //# debugId=F5EEF95DBD38E42164756E2164756E21
5
+ //# sourceMappingURL=studio-dbex091t.js.map
@@ -1,5 +1,5 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{Iw,Vu}from"./studio-cqxj4fcy.js";import{ed,Qx}from"./studio-knsjyx7n.js";import{Kl,Cm}from"./studio-4bgvvzhv.js";import{E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{n,v}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";var vS=["string","number","boolean","array","object","reference"],yS=["","image","date","color"],Dd={format:"",name:"",required:!1,type:"string"};function Sb(e){if(e.$ref)return"reference";return e.type||"string"}function Nd(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function _a(e,s){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return s?{items:{format:s,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return s?{format:s,type:"string"}:{type:"string"}}}var D={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};E("schema-builder",D);function _(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function B(e,s){e.textContent="";let t=g({..._(),...s}),o=null,r=!0,l=!1,p=()=>R("schema-builder",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.addFormat=d.addFormat,t.addHasFormat=d.addHasFormat,t.addName=d.addName,t.addRequired=d.addRequired,t.addState=d.addState,t.addType=d.addType,t.fields=d.fields,t.formatOptions=d.formatOptions,t.targets=d.targets,t.typeOptions=d.typeOptions,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};E("reference-field",M);function Y(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function L(e,s){e.textContent="";let t=g({...Y(),...s}),o=null,r=!0,l=!1,p=()=>R("reference-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.canRetry=d.canRetry,t.disabled=d.disabled,t.hasNote=d.hasNote,t.kind=d.kind,t.label=d.label,t.note=d.note,t.noteTone=d.noteTone,t.options=d.options,t.value=d.value,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var V={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};E("secret-field",V);function Q(){return{disabled:!0,label:"",placeholder:"Not set"}}function z(e,s){e.textContent="";let t=g({...Q(),...s,shown:""}),o=null,r=!0,l=!1,p=()=>R("secret-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{clear(){t.shown=" ",t.shown=""},dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.disabled=d.disabled,t.label=d.label,t.placeholder=d.placeholder,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var Z=vS.map((e)=>({label:e,value:e})),ee=yS.map((e)=>({label:e||"(none)",value:e})),P=[],I=" ";function te(e){let s=e.resolvePointer("#/$context/content"),t=v(s)?Object.keys(s):[],o=t.join(" ");if(o!==I)I=o,P=t.map((r)=>({label:r,value:r}));return P}function S(e){return e==="string"||e==="array"}function re(e){if(!v(e))return{properties:{},required:[],type:"object"};return e}function ae(e){return JSON.parse(JSON.stringify(e))}function ne(e){let s=e;return s.type??="object",s.properties??={},s.required??=[],s}function T(e){return`name:${e}`}function k(e){return`required:${e}`}function C(e,s){return`${e} ${s}`}function q(e,s,t){return e.echo?.id===s?e.echo.value:t}function oe(e,s,t,o,r){let l=C(s,t),p=Sb(o);return{format:Nd(o),hasFormat:S(p),key:t,name:q(e,T(l),t),parent:s,required:q(e,k(l),r),type:p}}function ie(e,s,t,o,r){let l=Sb(t),p=l==="object",u=e.drafts.get(s),d=t.required??[];return{children:p?Object.entries(t.properties??{}).map(([y,h])=>oe(e,s,y,h,d.includes(y))):[],draftName:u?.name??"",draftType:u?.type??"string",extra:l==="reference"&&r?"reference":p?"nested":"none",format:Nd(t),hasFormat:S(l),key:s,label:ed(s),name:q(e,T(s),s),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:q(e,k(s),o),type:l}}function W(e,s,t){let o={};for(let[r,l]of Object.entries(e))o[r===s?t:r]=l,delete e[r];Object.assign(e,o)}function A(e,s,t){e.required??=[];let o=e.required.indexOf(s);if(t&&o===-1)e.required.push(s);if(!t&&o!==-1)e.required.splice(o,1)}function se(e,s){let t=s,o=null,r={add:{...Dd},addOpen:!1,drafts:new Map,echo:null},l=()=>o??re(t.value),p=()=>{let a=l(),i=a.required??[],c=te(t.ctx);return{addFormat:r.add.format,addHasFormat:S(r.add.type),addName:r.add.name,addRequired:r.add.required,addState:r.addOpen?"open":"closed",addType:r.add.type,fields:Object.entries(a.properties??{}).map(([m,f])=>ie(r,m,f,i.includes(m),c.length>0)),formatOptions:ee,targets:c,typeOptions:Z}},u=()=>H.update(p()),d=(a,i)=>{r.echo={id:a,value:i},u()},y=()=>{r.echo=null,u()},h=(a)=>{let i=ae(l()),c=ne(i);if(!a(c)){y();return}o=c,r.echo=null,t.onChange(i),u()},w=(a,i)=>a.properties[i],j=(a)=>{let i=r.drafts.get(a);if(!i)i={name:"",type:"string"},r.drafts.set(a,i);return i},H=B(e,{addNested(a){let i=j(a),c=Qx(i.name.trim());if(!c)return;h((m)=>{let f=w(m,a);if(!f)return!1;return f.properties??={},f.properties[c]=_a(i.type||"string"),i.name="",!0})},cancelAdd(){r.addOpen=!1,r.add={...Dd},u()},confirmAdd(){let a=Qx(r.add.name.trim());if(!a)return;let{format:i,required:c,type:m}=r.add;r.addOpen=!1,r.add={...Dd},h((f)=>{if(f.properties[a]=_a(m,i||void 0),c)A(f,a,!0);return!0})},editAddFormat(a){r.add.format=a,u()},editAddName(a){r.add.name=a,u()},editAddRequired(a){r.add.required=a,u()},editAddType(a){r.add.type=a,u()},editDraftName(a,i){j(a).name=i,u()},editDraftType(a,i){j(a).type=i,u()},openAdd(){r.addOpen=!0,r.add={...Dd},u()},removeField(a){h((i)=>{if(!i.properties[a])return!1;return delete i.properties[a],i.required=i.required.filter((c)=>c!==a),!0})},removeNested(a,i){h((c)=>{let m=w(c,a);if(!m?.properties?.[i])return!1;if(delete m.properties[i],m.required)m.required=m.required.filter((f)=>f!==i);return!0})},renameField(a,i){d(T(a),i);let c=Qx(i.trim());h((m)=>{if(!m.properties[a]||!c||c===a||m.properties[c])return!1;return W(m.properties,a,c),m.required=m.required.map((f)=>f===a?c:f),!0})},renameNested(a,i,c){d(T(C(a,i)),c);let m=Qx(c.trim());h((f)=>{let b=w(f,a);if(!b?.properties?.[i]||!m||m===i||b.properties[m])return!1;if(W(b.properties,i,m),b.required)b.required=b.required.map((N)=>N===i?m:N);return!0})},setFormat(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;return c.properties[a]=_a(m.type||"string",i||void 0),!0})},setNestedFormat(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;return f.properties[i]=_a(b.type||"string",c||void 0),!0})},setNestedRequired(a,i,c){d(k(C(a,i)),c),h((m)=>{let f=w(m,a);if(!f)return!1;return A(f,i,c),!0})},setNestedType(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;let N=S(c)?Nd(b):void 0;return f.properties[i]=_a(c,N||void 0),!0})},setRequired(a,i){d(k(a),i),h((c)=>{if(!c.properties[a])return!1;return A(c,a,i),!0})},setTarget(a,i){h((c)=>{if(!c.properties[a])return!1;return c.properties[a]={$ref:`#/content/${i}`},!0})},setType(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;let f=S(i)?Nd(m):void 0;return c.properties[a]=_a(i,f||void 0),!0})}});return u(),{dispose:()=>H.dispose(),update(a){t=a,o=null,r.echo=null,u()}}}var de={mount:se};Iw("schema-builder",de);function J(e){return n(e)&&e?e:null}function le(e,s){let t=s,o=()=>{let l=J(t.value);r.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:l?`Stored as ${l}`:"Not set"})},r=z(e,{commit(l){let{commitSecret:p}=t.ctx;if(!p||!l)return;r.clear();let{key:u,onChange:d}=t,y=J(t.value);Promise.resolve(p(u,l)).then((h)=>{if(n(h)&&h&&h!==y)d(h)})}});return o(),{dispose:()=>r.dispose(),update(l){t=l,o()}}}var pe={mount:le};Iw("secret",pe);function me(e,s){let t=s,o=()=>{Kl(e,t.key,n(t.value)?t.value:"",(r)=>t.onChange(r===""?void 0:r),{images:!0})};return o(),{dispose:()=>Cm(e),update(r){t=r,o()}}}var ue={mount:me};Iw("media",ue);var F=new Map,O=new Map,x=new Map;function wm(e){if(e===void 0)F.clear(),O.clear(),x.clear();else F.delete(e),O.delete(e),x.delete(e)}function fe(e){let s=F.get(e);if(s)return s;let t=(ce("g38w0d3f"),import("./content-source-g38w0d3f.js")).then((o)=>o.listCollectionEntryIds(e));return F.set(e,t),t}function rT(e,s){let t=O.get(e);if(t)return t;let o=fe(e),r=x.get(e);if(r){if(s)r.add(s);return null}x.set(e,new Set(s?[s]:[]));let l=(p)=>{if(F.get(e)!==o)return;let u=x.get(e);x.delete(e),O.set(e,p);for(let d of u??[])d()};return o.then((p)=>l({ids:p}),(p)=>l({error:X(p)})),null}function he(e,s){let t=n(e.value)?e.value:"",o={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},r=Vu(e.schema);if(r===null)return{...o,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let l=rT(r,s);if(l===null)return{...o,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in l)return{...o,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${r} entries — ${l.error}`,noteTone:"danger"};let p=t!==""&&!l.ids.includes(t);return{...o,hasNote:l.ids.length===0,kind:"picker",note:l.ids.length===0?`No ${r} entries yet.`:"",options:[{label:"—",value:""},...p?[{label:`${t} — not found`,value:t}]:[],...l.ids.map((u)=>({label:u,value:u}))]}}function ge(e,s){let t=s,o=!1,r=()=>{if(!o)l.update(he(t,r))},l=L(e,{choose(p){t.onChange(p===""?void 0:p)},edit(p){t.onChange(p.trim()||void 0)},retry(){let p=Vu(t.schema);if(p!==null)wm(p);r()}});return r(),{dispose(){o=!0,l.dispose()},update(p){t=p,r()}}}var ye={mount:ge};Iw("reference",ye);
2
- export{vS,yS,Dd,Sb,Nd,_a,wm,rT};
1
+ import{Z}from"./studio-mkjrjpr2.js";import{Bw,qu}from"./studio-8vmad6x2.js";import{nd,u_}from"./studio-ybkd5w8k.js";import{Xl,Lm}from"./studio-fe2d1fp5.js";import{E,I}from"./studio-xxttcym1.js";import{b}from"./studio-y3tjh2xb.js";import{n,f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var NS=["string","number","boolean","array","object","reference"],DS=["","image","date","color"],Od={format:"",name:"",required:!1,type:"string"};function Ib(e){if(e.$ref)return"reference";return e.type||"string"}function Ad(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Ta(e,s){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return s?{items:{format:s,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return s?{format:s,type:"string"}:{type:"string"}}}var H={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};E("schema-builder",H);function _(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function D(e,s){e.textContent="";let t=b({..._(),...s}),o=null,r=!0,l=!1,p=()=>I("schema-builder",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.addFormat=d.addFormat,t.addHasFormat=d.addHasFormat,t.addName=d.addName,t.addRequired=d.addRequired,t.addState=d.addState,t.addType=d.addType,t.fields=d.fields,t.formatOptions=d.formatOptions,t.targets=d.targets,t.typeOptions=d.typeOptions,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var B={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};E("reference-field",B);function Y(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function M(e,s){e.textContent="";let t=b({...Y(),...s}),o=null,r=!0,l=!1,p=()=>I("reference-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.canRetry=d.canRetry,t.disabled=d.disabled,t.hasNote=d.hasNote,t.kind=d.kind,t.label=d.label,t.note=d.note,t.noteTone=d.noteTone,t.options=d.options,t.value=d.value,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var L={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};E("secret-field",L);function G(){return{disabled:!0,label:"",placeholder:"Not set"}}function V(e,s){e.textContent="";let t=b({...G(),...s,shown:""}),o=null,r=!0,l=!1,p=()=>I("secret-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{clear(){t.shown=" ",t.shown=""},dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.disabled=d.disabled,t.label=d.label,t.placeholder=d.placeholder,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var Q=NS.map((e)=>({label:e,value:e})),ee=DS.map((e)=>({label:e||"(none)",value:e})),z=[],P=" ";function te(e){let s=e.resolvePointer("#/$context/content"),t=f(s)?Object.keys(s):[],o=t.join(" ");if(o!==P)P=o,z=t.map((r)=>({label:r,value:r}));return z}function S(e){return e==="string"||e==="array"}function re(e){if(!f(e))return{properties:{},required:[],type:"object"};return e}function ae(e){return JSON.parse(JSON.stringify(e))}function ne(e){let s=e;return s.type??="object",s.properties??={},s.required??=[],s}function T(e){return`name:${e}`}function k(e){return`required:${e}`}function A(e,s){return`${e} ${s}`}function q(e,s,t){return e.echo?.id===s?e.echo.value:t}function oe(e,s,t,o,r){let l=A(s,t),p=Ib(o);return{format:Ad(o),hasFormat:S(p),key:t,name:q(e,T(l),t),parent:s,required:q(e,k(l),r),type:p}}function ie(e,s,t,o,r){let l=Ib(t),p=l==="object",u=e.drafts.get(s),d=t.required??[];return{children:p?Object.entries(t.properties??{}).map(([y,g])=>oe(e,s,y,g,d.includes(y))):[],draftName:u?.name??"",draftType:u?.type??"string",extra:l==="reference"&&r?"reference":p?"nested":"none",format:Ad(t),hasFormat:S(l),key:s,label:nd(s),name:q(e,T(s),s),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:q(e,k(s),o),type:l}}function W(e,s,t){let o={};for(let[r,l]of Object.entries(e))o[r===s?t:r]=l,delete e[r];Object.assign(e,o)}function j(e,s,t){e.required??=[];let o=e.required.indexOf(s);if(t&&o===-1)e.required.push(s);if(!t&&o!==-1)e.required.splice(o,1)}function se(e,s){let t=s,o=null,r={add:{...Od},addOpen:!1,drafts:new Map,echo:null},l=()=>o??re(t.value),p=()=>{let a=l(),i=a.required??[],c=te(t.ctx);return{addFormat:r.add.format,addHasFormat:S(r.add.type),addName:r.add.name,addRequired:r.add.required,addState:r.addOpen?"open":"closed",addType:r.add.type,fields:Object.entries(a.properties??{}).map(([m,h])=>ie(r,m,h,i.includes(m),c.length>0)),formatOptions:ee,targets:c,typeOptions:Q}},u=()=>C.update(p()),d=(a,i)=>{r.echo={id:a,value:i},u()},y=()=>{r.echo=null,u()},g=(a)=>{let i=ae(l()),c=ne(i);if(!a(c)){y();return}o=c,r.echo=null,t.onChange(i),u()},w=(a,i)=>a.properties[i],O=(a)=>{let i=r.drafts.get(a);if(!i)i={name:"",type:"string"},r.drafts.set(a,i);return i},C=D(e,{addNested(a){let i=O(a),c=u_(i.name.trim());if(!c)return;g((m)=>{let h=w(m,a);if(!h)return!1;return h.properties??={},h.properties[c]=Ta(i.type||"string"),i.name="",!0})},cancelAdd(){r.addOpen=!1,r.add={...Od},u()},confirmAdd(){let a=u_(r.add.name.trim());if(!a)return;let{format:i,required:c,type:m}=r.add;r.addOpen=!1,r.add={...Od},g((h)=>{if(h.properties[a]=Ta(m,i||void 0),c)j(h,a,!0);return!0})},editAddFormat(a){r.add.format=a,u()},editAddName(a){r.add.name=a,u()},editAddRequired(a){r.add.required=a,u()},editAddType(a){r.add.type=a,u()},editDraftName(a,i){O(a).name=i,u()},editDraftType(a,i){O(a).type=i,u()},openAdd(){r.addOpen=!0,r.add={...Od},u()},removeField(a){g((i)=>{if(!i.properties[a])return!1;return delete i.properties[a],i.required=i.required.filter((c)=>c!==a),!0})},removeNested(a,i){g((c)=>{let m=w(c,a);if(!m?.properties?.[i])return!1;if(delete m.properties[i],m.required)m.required=m.required.filter((h)=>h!==i);return!0})},renameField(a,i){d(T(a),i);let c=u_(i.trim());g((m)=>{if(!m.properties[a]||!c||c===a||m.properties[c])return!1;return W(m.properties,a,c),m.required=m.required.map((h)=>h===a?c:h),!0})},renameNested(a,i,c){d(T(A(a,i)),c);let m=u_(c.trim());g((h)=>{let v=w(h,a);if(!v?.properties?.[i]||!m||m===i||v.properties[m])return!1;if(W(v.properties,i,m),v.required)v.required=v.required.map((N)=>N===i?m:N);return!0})},setFormat(a,i){g((c)=>{let m=c.properties[a];if(!m)return!1;return c.properties[a]=Ta(m.type||"string",i||void 0),!0})},setNestedFormat(a,i,c){g((m)=>{let h=w(m,a),v=h?.properties?.[i];if(!h?.properties||!v)return!1;return h.properties[i]=Ta(v.type||"string",c||void 0),!0})},setNestedRequired(a,i,c){d(k(A(a,i)),c),g((m)=>{let h=w(m,a);if(!h)return!1;return j(h,i,c),!0})},setNestedType(a,i,c){g((m)=>{let h=w(m,a),v=h?.properties?.[i];if(!h?.properties||!v)return!1;let N=S(c)?Ad(v):void 0;return h.properties[i]=Ta(c,N||void 0),!0})},setRequired(a,i){d(k(a),i),g((c)=>{if(!c.properties[a])return!1;return j(c,a,i),!0})},setTarget(a,i){g((c)=>{if(!c.properties[a])return!1;return c.properties[a]={$ref:`#/content/${i}`},!0})},setType(a,i){g((c)=>{let m=c.properties[a];if(!m)return!1;let h=S(i)?Ad(m):void 0;return c.properties[a]=Ta(i,h||void 0),!0})}});return u(),{dispose:()=>C.dispose(),update(a){t=a,o=null,r.echo=null,u()}}}var de={mount:se};Bw("schema-builder",de);function J(e){return n(e)&&e?e:null}function le(e,s){let t=s,o=()=>{let l=J(t.value);r.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:l?`Stored as ${l}`:"Not set"})},r=V(e,{commit(l){let{commitSecret:p}=t.ctx;if(!p||!l)return;r.clear();let{key:u,onChange:d}=t,y=J(t.value);Promise.resolve(p(u,l)).then((g)=>{if(n(g)&&g&&g!==y)d(g)})}});return o(),{dispose:()=>r.dispose(),update(l){t=l,o()}}}var pe={mount:le};Bw("secret",pe);function me(e,s){let t=s,o=()=>{Xl(e,t.key,n(t.value)?t.value:"",(r)=>t.onChange(r===""?void 0:r),{images:!0})};return o(),{dispose:()=>Lm(e),update(r){t=r,o()}}}var ue={mount:me};Bw("media",ue);var F=new Map,R=new Map,x=new Map;function km(e){if(e===void 0)F.clear(),R.clear(),x.clear();else F.delete(e),R.delete(e),x.delete(e)}function fe(e){let s=F.get(e);if(s)return s;let t=(ce("9e7qvmsf"),import("./content-source-9e7qvmsf.js")).then((o)=>o.listCollectionEntryIds(e));return F.set(e,t),t}function ST(e,s){let t=R.get(e);if(t)return t;let o=fe(e),r=x.get(e);if(r){if(s)r.add(s);return null}x.set(e,new Set(s?[s]:[]));let l=(p)=>{if(F.get(e)!==o)return;let u=x.get(e);x.delete(e),R.set(e,p);for(let d of u??[])d()};return o.then((p)=>l({ids:p}),(p)=>l({error:Z(p)})),null}function he(e,s){let t=n(e.value)?e.value:"",o={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},r=qu(e.schema);if(r===null)return{...o,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let l=ST(r,s);if(l===null)return{...o,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in l)return{...o,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${r} entries — ${l.error}`,noteTone:"danger"};let p=t!==""&&!l.ids.includes(t);return{...o,hasNote:l.ids.length===0,kind:"picker",note:l.ids.length===0?`No ${r} entries yet.`:"",options:[{label:"—",value:""},...p?[{label:`${t} — not found`,value:t}]:[],...l.ids.map((u)=>({label:u,value:u}))]}}function ge(e,s){let t=s,o=!1,r=()=>{if(!o)l.update(he(t,r))},l=M(e,{choose(p){t.onChange(p===""?void 0:p)},edit(p){t.onChange(p.trim()||void 0)},retry(){let p=qu(t.schema);if(p!==null)km(p);r()}});return r(),{dispose(){o=!0,l.dispose()},update(p){t=p,r()}}}var ye={mount:ge};Bw("reference",ye);
2
+ export{NS,DS,Od,Ib,Ad,Ta,km,ST};
3
3
 
4
- //# debugId=FE884CA0C1833B7B64756E2164756E21
5
- //# sourceMappingURL=studio-amaz545p.js.map
4
+ //# debugId=65C4F7F6EF56842164756E2164756E21
5
+ //# sourceMappingURL=studio-dj8ctxey.js.map
@@ -1,7 +1,7 @@
1
- import{X}from"./studio-9c6cbq2c.js";import{w}from"./studio-sce30r7b.js";import{Jt,Ut}from"./studio-nzemfbkk.js";import{sn,dt}from"./studio-tpxcryf2.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};E("github-auth",_);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ve,vt("dialog","github-auth")),e.layer.append(t);let s=!1,l=()=>{if(s)return;s=!0,e.onClosed()},u=()=>s,b=g({cancel:()=>{e.onCancel()},closed:l,userCode:e.userCode,verificationUri:e.verificationUri}),n=null,r=R("github-auth",b,t).then(async(i)=>{n=i;let o=i.root;if(u())return i.dispose(),o;if(await sn(o),u())return o;return Jt(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)Ut(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var S="jx_github_token",v="Ov23liYVlMFpgjOEPXJH";function P(e){return typeof e==="object"&&e!==null&&"githubAuth"in e&&e.githubAuth!=null}function p(){let e=globalThis,t="__jxPlatform"in e?e.__jxPlatform:void 0;return P(t)?t.githubAuth:null}var f=null,C=!1;function H(e){f=e}function vL(){return f!==null||C||localStorage.getItem("jx_github_token")!==null}function yL(){return p()?"desktop":"browser"}function y(){return f??localStorage.getItem("jx_github_token")}function wL(){f=null,C=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var O="github.auth",j="Source Control",N="git.signInToGithub",Y=3,z="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function I(e){w.error("Could not reach GitHub to sign in.",{action:N,detail:`${z}
1
+ import{Z}from"./studio-mkjrjpr2.js";import{w}from"./studio-5k9mfafh.js";import{Gt,Ut}from"./studio-s6ymkf3q.js";import{an,dt}from"./studio-yetr4gg1.js";import{ze,yt,E,I}from"./studio-xxttcym1.js";import{b}from"./studio-y3tjh2xb.js";var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubAuth",$description:"The RFC 8628 device flow's waiting room: the code GitHub minted, the page to type it into, and a Cancel. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop — and it is the reason the dialog has no confirm button at all: the answer arrives from GitHub over a poll rather than from anything the reader can press here, so a primary button would be a control with nothing to do. Nothing in this document talks to GitHub: `github/github-auth.ts` keeps the client id, the poll loop, its failure budget and every report the three outcomes raise.",tagName:"jx-dialog",$props:{headline:"Sign in to GitHub",confirmLabel:"",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-auth"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"Four `.github-auth-*` rules in `styles/overlays.css` become the parts below, and two things in them do not travel. `.github-auth-dialog`'s `padding: 16px 0` was the card's own body padding drawn by hand, and `jx-dialog` already pads its body; `.github-auth-dialog p { font-size: 13px }` was a body size this surface picked for itself, and what the paragraphs now inherit is the dialog's own `--jx-text-md`. The `8px 0` margins go with them — the column is a flex column with a gap, so a margin between two rows would be a second opinion about the same space. The code keeps its 24px, which is above the token scale on purpose: it is a string the reader has to copy onto another screen, and reading it out loud is the whole job of this dialog.",'& [part="device"]':{display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-3)",textAlign:"center"},'& [part="lede"], & [part="waiting"]':{margin:"0"},'& [part="code"]':{$description:"`<code>`, not a styled `<div>`: this is a literal string to be transcribed, and the element that says so is also the one a reader's own stylesheet and a screen reader's character-by-character mode already know about. It is this dialog's message, and the one string in it the reader must carry to another screen, so it opts back in to selection against the root's `user-select: none`. `all` rather than `text`: one click selects the whole code, so a copy never leaves a character behind.",userSelect:"all",fontFamily:"var(--font-mono)",fontSize:"24px",fontWeight:"700",letterSpacing:"2px",padding:"var(--jx-space-3) var(--jx-space-4)",background:"var(--hover-bg)",borderRadius:"var(--radius)"},'& [part="link"]':{$description:"The blue this carried as a `var(--accent, …)` fallback is gone: `--accent` is declared on `:root` in `styles/tokens.css`, so the fallback could only ever have painted when the token was missing — which is a theme fault to fix rather than a colour to hard-code.",color:"var(--accent)",textDecoration:"underline"},'& [part="waiting"]':{color:"var(--fg-dim)",fontStyle:"italic"}},children:[{tagName:"div",attributes:{part:"device"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Enter this code on GitHub to authorize Jx Studio:"},{tagName:"code",attributes:{part:"code"},textContent:"${state.userCode}"},{tagName:"a",attributes:{part:"link",href:"${state.verificationUri}",target:"_blank",rel:"noreferrer"},textContent:"Open ${state.verificationUri}"},{tagName:"p",attributes:{part:"waiting"},textContent:"Waiting for authorization…"}]}]};E("github-auth",_);function A(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(ze,yt("dialog","github-auth")),e.layer.append(t);let s=!1,l=()=>{if(s)return;s=!0,e.onClosed()},u=()=>s,f=b({cancel:()=>{e.onCancel()},closed:l,userCode:e.userCode,verificationUri:e.verificationUri}),n=null,r=I("github-auth",f,t).then(async(i)=>{n=i;let o=i.root;if(u())return i.dispose(),o;if(await an(o),u())return o;return Gt(o),o});return{close(){let i=n?.root;if(i instanceof HTMLElement)Ut(i);n?.dispose(),n=null,t.remove(),l()},host:t,ready:r}}var S="jx_github_token",v="Ov23liYVlMFpgjOEPXJH";function P(e){return typeof e==="object"&&e!==null&&"githubAuth"in e&&e.githubAuth!=null}function p(){let e=globalThis,t="__jxPlatform"in e?e.__jxPlatform:void 0;return P(t)?t.githubAuth:null}var g=null,C=!1;function H(e){g=e}function M$(){return g!==null||C||localStorage.getItem("jx_github_token")!==null}function F$(){return p()?"desktop":"browser"}function y(){return g??localStorage.getItem("jx_github_token")}function j$(){g=null,C=!1,localStorage.removeItem("jx_github_token"),p()?.signOut().catch(()=>{})}var R="github.auth",O="Source Control",j="git.signInToGithub",Y=3,z="The request never reached GitHub. GitHub's device-flow endpoints send no CORS headers, so a "+"browser cannot call them directly — the desktop app can. A machine that is offline fails "+"identically, and the browser does not say which happened.";function N(e){w.error("Could not reach GitHub to sign in.",{action:j,detail:`${z}
2
2
 
3
- ${X(e)}`,key:O,source:j})}function T(e,t){w.warn(e,{action:N,detail:t,key:O,source:j})}async function F(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:v,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return I(t),null}if(!e.ok)return T("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function ZS(){let e=y();if(e)return e;let t=p();if(t)try{let{token:r}=await t.signIn();return H(r),r}catch(r){return T("GitHub sign-in was not completed.",X(r)),null}let s=await F();if(!s)return null;let{device_code:l,user_code:u,verification_uri:b,interval:n=5}=s;return new Promise((r)=>{let i=!1,o=null,m=0,k=!1,L=(c)=>{if(k)return;if(k=!0,i=!0,o)clearTimeout(o),o=null;r(c)},x=!1,G=()=>{if(x)return;x=!0,D.close()},d=(c)=>{L(c),G()},h=async()=>{if(i)return;try{let a=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:v,device_code:l,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,a.access_token){localStorage.setItem(S,a.access_token),d(a.access_token);return}if(a.error==="authorization_pending"){o=setTimeout(h,n*1000);return}if(a.error==="slow_down"){o=setTimeout(h,(n+5)*1000);return}T("GitHub sign-in was not completed.",a.error==="access_denied"?"The authorization was declined on GitHub.":a.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${a.error??"an unrecognised response"}".`),d(null)}catch(c){if(m+=1,m>=Y){I(c),d(null);return}o=setTimeout(h,n*1000)}},D=A({layer:dt("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:u,verificationUri:b});o=setTimeout(h,n*1000)})}
4
- export{vL,yL,wL,ZS};
3
+ ${Z(e)}`,key:R,source:O})}function T(e,t){w.warn(e,{action:j,detail:t,key:R,source:O})}async function F(){let e;try{e=await fetch("https://github.com/login/device/code",{body:JSON.stringify({client_id:v,scope:"repo"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})}catch(t){return N(t),null}if(!e.ok)return T("GitHub refused to start the sign-in.",`GitHub answered ${e.status}${e.statusText?` ${e.statusText}`:""}.`),null;return await e.json()}async function hC(){let e=y();if(e)return e;let t=p();if(t)try{let{token:r}=await t.signIn();return H(r),r}catch(r){return T("GitHub sign-in was not completed.",Z(r)),null}let s=await F();if(!s)return null;let{device_code:l,user_code:u,verification_uri:f,interval:n=5}=s;return new Promise((r)=>{let i=!1,o=null,m=0,k=!1,L=(c)=>{if(k)return;if(k=!0,i=!0,o)clearTimeout(o),o=null;r(c)},x=!1,G=()=>{if(x)return;x=!0,D.close()},d=(c)=>{L(c),G()},h=async()=>{if(i)return;try{let a=await(await fetch("https://github.com/login/oauth/access_token",{body:JSON.stringify({client_id:v,device_code:l,grant_type:"urn:ietf:params:oauth:grant-type:device_code"}),headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"})).json();if(m=0,a.access_token){localStorage.setItem(S,a.access_token),d(a.access_token);return}if(a.error==="authorization_pending"){o=setTimeout(h,n*1000);return}if(a.error==="slow_down"){o=setTimeout(h,(n+5)*1000);return}T("GitHub sign-in was not completed.",a.error==="access_denied"?"The authorization was declined on GitHub.":a.error==="expired_token"?"The device code expired before it was entered.":`GitHub answered "${a.error??"an unrecognised response"}".`),d(null)}catch(c){if(m+=1,m>=Y){N(c),d(null);return}o=setTimeout(h,n*1000)}},D=A({layer:dt("dialog"),onCancel:()=>{G()},onClosed:()=>{d(null)},userCode:u,verificationUri:f});o=setTimeout(h,n*1000)})}
4
+ export{M$,F$,j$,hC};
5
5
 
6
- //# debugId=A116AF93B212CC5864756E2164756E21
7
- //# sourceMappingURL=studio-k2evngrj.js.map
6
+ //# debugId=9DB56B5964B97D3664756E2164756E21
7
+ //# sourceMappingURL=studio-ed9bz68j.js.map
@@ -1,5 +1,5 @@
1
- import{p,ye}from"./studio-4fnb5648.js";import{dt}from"./studio-tpxcryf2.js";import{$s}from"./studio-hh394phe.js";import{oa,ra,At}from"./studio-1ks5d9y4.js";import{Jc,IO,Ys,rv,nr,Vd,Yc,OO,hh,fl,MO,Px}from"./studio-61rg2cz5.js";import{Xc}from"./studio-acer0g8w.js";import{a0,wn}from"./studio-4f7thq0p.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{Me}from"./studio-0gvvqj3h.js";import{g}from"./studio-3qr08sxq.js";import{ce}from"./studio-0939t1q1.js";var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, because a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};E("media-field",C);function G(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function D(t,e,o){let i=g({browse:o.browse,edit:o.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:o.upload,value:e.value,warm:o.warm}),a=null,r=!1;return R("media-field",i,t).then((n)=>{if(r){n.dispose();return}a=n}),{dispose(){r=!0,a?.dispose(),a=null},update:(n)=>G(i,n)}}function qu(t){let{anchor:e,name:o,scope:i,slot:a}=t,r=document.createElement("div");r.style.pointerEvents="auto",r.setAttribute(Ve,vt("popover",a)),dt("popover").append(r);let n=new AbortController,s=null,l=null,c=!1,T=()=>n.signal.aborted,H=(x)=>{if(c)return;if(c=!0,n.abort(),l?.dispose(),l=null,r.remove(),x)t.onDismissed?.()},U=(async()=>{let x={signal:n.signal};if(t.onNodeCreated)x.onNodeCreated=t.onNodeCreated;let I=await R(o,i,r,x);if(T())return;if(l=I,s=I.root,s.setAttribute(Ve,vt("popover",a)),s.addEventListener("toggle",(S)=>{if("newState"in S&&S.newState==="closed")H(!0)}),!s.hasAttribute("popover"))await new Promise((S)=>{s?.addEventListener("jx-ready",()=>S(),{once:!0})});if(T())return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();H(!1)},host:r,isOpen:()=>!c,ready:U}}var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{justifyContent:"flex-start"},'& [part="browse-all"]':{$description:"The last row, set apart by a rule: it does not pick a file, it opens the picker that shows all of them.",marginTop:"var(--jx-space-1)",paddingTop:"var(--jx-space-2)",borderTop:"1px solid var(--border)",justifyContent:"flex-start"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so, and the marker is a control (the rule studio.md §5.6 states for every truncation marker): it raises the cap by fifty, so every file the Media workspace lists can be reached from here without a search. Inert "…21 more" text was the panel holding the answer and not showing it.',tagName:"jx-button",attributes:{part:"more"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showMore"},value:[]}]},children:[{tagName:"span",textContent:"${state.moreLabel}"}]}}},{tagName:"jx-button",attributes:{part:"browse-all"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browseAll"},value:[]}]},children:[{tagName:"span",textContent:"${state.browseAllLabel}"}]}]}]};E("media-browser",_);var X="media-picker";function Y(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel,t.browseAllLabel=e.browseAllLabel}function V(t,e,o){let i=g({browseAll:e.browseAll,browseAllLabel:t.browseAllLabel,emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,showMore:e.showMore,x:t.x,y:t.y}),a={anchor:o,name:"media-browser",scope:i,slot:X};if(e.dismissed)a.onDismissed=e.dismissed;let r=qu(a);return r.ready.then(()=>{if(r.isOpen())r.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:r.close,host:r.host,isOpen:r.isOpen,ready:r.ready,update:(n)=>Y(i,n)}}var b=[],M=!1,L="images";function kT(t){let e=t.replaceAll("\\","/");return e.startsWith("public/")||new RegExp(`^content/[^/]+/${L}/`).test(e)}async function N(t,e){let o=[];try{let i=await $s(()=>e.listDirectory(t));OO(i);for(let a of i)if(a.type==="directory"){let r=await N(a.path,e);o.push(...r)}else{let r=At(a.name);if(ra.has(r))o.push({file:a.path,isImage:oa.has(r),kind:IO(a.name),name:a.name,ref:rv(a.path)})}}catch{}return o}async function Q(t){let e;try{e=(await t.listDirectory("content")).filter((a)=>a.type==="directory").map((a)=>a.path)}catch{return[]}let o=[];for(let i of e){let a=!1;try{a=(await t.listDirectory(i)).some((n)=>n.type==="directory"&&n.name===L)}catch{}if(a)o.push(...await N(`${i}/${L}`,t))}return o}async function Z(t){try{let e=await t.listDirectory(".");return new Set(e.filter((o)=>o.type==="directory").map((o)=>o.name).filter((o)=>o==="public"||o==="content"))}catch{return new Set(["public","content"])}}var h=null,O=0,A=new Set;function ET(t){return A.add(t),()=>{A.delete(t)}}function q(){for(let t of A)t()}function k(){if(M)return Promise.resolve();if(h)return h;if(!ye())return Promise.resolve();let t=O,e=(async()=>{let o=p(),i=await Z(o),[a,r]=await Promise.all([i.has("public")?N("public",o):[],i.has("content")?Q(o):[]]);if(t!==O)return;b=[...a,...r],M=!0,h=null,wn("leftPanel","rightPanel"),q()})();return h=e,e}function Gu(){if(!M)return k(),null;return b}function Dw(){b=[],M=!1,O+=1,h=null,MO(),q()}var z=null;function ee(){return z??=(ce("j74rt0w4"),import("./media-library-j74rt0w4.js")),z}async function zP(t,e={}){(await ee()).openMediaPickDialog({images:e.images===!0,onPick:t})}var y=50,d=null,f=null,v="",u=y,w={},B={x:0,y:0};function m(){let t=v.toLowerCase(),e=w.images?b.filter((r)=>r.isImage):b,o=t?e.filter((r)=>r.ref.toLowerCase().includes(t)||r.name.toLowerCase().includes(t)):e,a=o.slice(0,u).map((r)=>{let n=Px(Yc(r.file));return{caption:n,captionState:n?"shown":"hidden",file:r.file,key:r.file,name:r.name,path:r.ref,thumbSrc:r.isImage?nr(r.file):"",thumbState:r.isImage?"shown":"hidden"}});return{browseAllLabel:w.images?"Browse all images…":"Browse all media…",emptyLabel:e.length>0?"No matches":w.images?"No images in this project yet":"No media in this project yet",filter:v,moreLabel:`Show ${Math.min(o.length-u,y)} more`,moreState:o.length>u?"shown":"hidden",rows:a,rowsState:a.length>0?"listed":"empty",x:B.x,y:B.y}}function P(){let t=d;d=null,f=null,v="",u=y,t?.close()}var j=0;function te(t,e,o){if(!fl(t,e,o)){if(!Vd(t))hh(t).then(()=>d?.update(m()));return}if(j!==0)return;j=requestAnimationFrame(()=>{j=0,d?.update(m())})}function ES(t,e,o={}){P(),k().then(()=>d?.update(m())),f=e,w=o;let i=Me(t);B={x:i.left,y:i.bottom+4},d=V(m(),{browseAll:()=>{let a=f,r=w;if(P(),a)zP(a,r)},dismissed:()=>{d=null,f=null,v="",u=y},measure:te,pick:(a)=>{let r=f;P(),r?.(a)},showMore:()=>{u+=y,d?.update(m())},setFilter:(a)=>{v=a,d?.update(m())}},t)}async function WP(t,e){let o=await Ys([...t]),[i]=o;if(i)e(i.ref)}function TS(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=Jc(),e.addEventListener("change",()=>{if(e.files?.length)WP(e.files,t)}),e.click()}var re=400,F=new WeakMap;function W(t,e){let o=oa.has(At(e));return{label:t,thumbSrc:o&&e?Xc(e):"",thumbState:o&&e?"shown":"hidden",value:e}}function Kl(t,e,o,i,a={}){k();let r=F.get(t);if(r){r.prop=e,r.commit=i,r.options=a,r.handle.update(W(e,o));return}let n={commit:i,options:a,prop:e},s=D(t,W(e,o),{browse:(l)=>{ES(l,(c)=>n.commit(c),n.options)},edit:(l)=>a0(`media:${n.prop}`,re,(c)=>n.commit(c))(l),upload:()=>TS((l)=>n.commit(l)),warm:()=>{k()}});F.set(t,Object.assign(n,{handle:s}))}function Cm(t){let e=F.get(t);if(e)F.delete(t),e.handle.dispose()}
2
- export{qu,kT,ET,Gu,Dw,zP,ES,WP,TS,Kl,Cm};
1
+ import{dt}from"./studio-yetr4gg1.js";import{p,we}from"./studio-1b79rpcb.js";import{Is}from"./studio-44drsmhw.js";import{la,ca,Ot}from"./studio-6tnpg0vx.js";import{Zc,eP,ea,fy,io,qd,Xc,oP,fh,yl,sP,Gx}from"./studio-jj9gf1qc.js";import{ed}from"./studio-meajkr51.js";import{v_,wn}from"./studio-anc8067x.js";import{ze,yt,E,I}from"./studio-xxttcym1.js";import{Me}from"./studio-4xadhxj1.js";import{b}from"./studio-y3tjh2xb.js";import{ce}from"./studio-nhpg405j.js";function Ku(t){let{anchor:e,name:o,scope:i,slot:a}=t,r=document.createElement("div");r.style.pointerEvents="auto",r.setAttribute(ze,yt("popover",a)),dt("popover").append(r);let n=new AbortController,s=null,l=null,c=!1,T=()=>n.signal.aborted,H=(x)=>{if(c)return;if(c=!0,n.abort(),l?.dispose(),l=null,r.remove(),x)t.onDismissed?.()},U=(async()=>{let x={signal:n.signal};if(t.onNodeCreated)x.onNodeCreated=t.onNodeCreated;let C=await I(o,i,r,x);if(T())return;if(l=C,s=C.root,s.setAttribute(ze,yt("popover",a)),s.addEventListener("toggle",(S)=>{if("newState"in S&&S.newState==="closed")H(!0)}),!s.hasAttribute("popover"))await new Promise((S)=>{s?.addEventListener("jx-ready",()=>S(),{once:!0})});if(T())return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();H(!1)},host:r,isOpen:()=>!c,ready:U}}var R={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, because a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};E("media-field",R);function G(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function D(t,e,o){let i=b({browse:o.browse,edit:o.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:o.upload,value:e.value,warm:o.warm}),a=null,r=!1;return I("media-field",i,t).then((n)=>{if(r){n.dispose();return}a=n}),{dispose(){r=!0,a?.dispose(),a=null},update:(n)=>G(i,n)}}var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{justifyContent:"flex-start"},'& [part="browse-all"]':{$description:"The last row, set apart by a rule: it does not pick a file, it opens the picker that shows all of them.",marginTop:"var(--jx-space-1)",paddingTop:"var(--jx-space-2)",borderTop:"1px solid var(--border)",justifyContent:"flex-start"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so, and the marker is a control (the rule studio.md §5.6 states for every truncation marker): it raises the cap by fifty, so every file the Media workspace lists can be reached from here without a search. Inert "…21 more" text was the panel holding the answer and not showing it.',tagName:"jx-button",attributes:{part:"more"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showMore"},value:[]}]},children:[{tagName:"span",textContent:"${state.moreLabel}"}]}}},{tagName:"jx-button",attributes:{part:"browse-all"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browseAll"},value:[]}]},children:[{tagName:"span",textContent:"${state.browseAllLabel}"}]}]}]};E("media-browser",_);var X="media-picker";function Y(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel,t.browseAllLabel=e.browseAllLabel}function V(t,e,o){let i=b({browseAll:e.browseAll,browseAllLabel:t.browseAllLabel,emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,showMore:e.showMore,x:t.x,y:t.y}),a={anchor:o,name:"media-browser",scope:i,slot:X};if(e.dismissed)a.onDismissed=e.dismissed;let r=Ku(a);return r.ready.then(()=>{if(r.isOpen())r.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:r.close,host:r.host,isOpen:r.isOpen,ready:r.ready,update:(n)=>Y(i,n)}}var g=[],M=!1,L="images";function WT(t){let e=t.replaceAll("\\","/");return e.startsWith("public/")||new RegExp(`^content/[^/]+/${L}/`).test(e)}async function N(t,e){let o=[];try{let i=await Is(()=>e.listDirectory(t));oP(i);for(let a of i)if(a.type==="directory"){let r=await N(a.path,e);o.push(...r)}else{let r=Ot(a.name);if(ca.has(r))o.push({file:a.path,isImage:la.has(r),kind:eP(a.name),name:a.name,ref:fy(a.path)})}}catch{}return o}async function Q(t){let e;try{e=(await t.listDirectory("content")).filter((a)=>a.type==="directory").map((a)=>a.path)}catch{return[]}let o=[];for(let i of e){let a=!1;try{a=(await t.listDirectory(i)).some((n)=>n.type==="directory"&&n.name===L)}catch{}if(a)o.push(...await N(`${i}/${L}`,t))}return o}async function Z(t){try{let e=await t.listDirectory(".");return new Set(e.filter((o)=>o.type==="directory").map((o)=>o.name).filter((o)=>o==="public"||o==="content"))}catch{return new Set(["public","content"])}}var h=null,O=0,A=new Set;function zT(t){return A.add(t),()=>{A.delete(t)}}function q(){for(let t of A)t()}function k(){if(M)return Promise.resolve();if(h)return h;if(!we())return Promise.resolve();let t=O,e=(async()=>{let o=p(),i=await Z(o),[a,r]=await Promise.all([i.has("public")?N("public",o):[],i.has("content")?Q(o):[]]);if(t!==O)return;g=[...a,...r],M=!0,h=null,wn("leftPanel","rightPanel"),q()})();return h=e,e}function Gu(){if(!M)return k(),null;return g}function Ww(){g=[],M=!1,O+=1,h=null,sP(),q()}var z=null;function ee(){return z??=(ce("2hfff88g"),import("./media-library-2hfff88g.js")),z}async function fF(t,e={}){(await ee()).openMediaPickDialog({images:e.images===!0,onPick:t})}var y=50,d=null,f=null,v="",u=y,w={},B={x:0,y:0};function m(){let t=v.toLowerCase(),e=w.images?g.filter((r)=>r.isImage):g,o=t?e.filter((r)=>r.ref.toLowerCase().includes(t)||r.name.toLowerCase().includes(t)):e,a=o.slice(0,u).map((r)=>{let n=Gx(Xc(r.file));return{caption:n,captionState:n?"shown":"hidden",file:r.file,key:r.file,name:r.name,path:r.ref,thumbSrc:r.isImage?io(r.file):"",thumbState:r.isImage?"shown":"hidden"}});return{browseAllLabel:w.images?"Browse all images…":"Browse all media…",emptyLabel:e.length>0?"No matches":w.images?"No images in this project yet":"No media in this project yet",filter:v,moreLabel:`Show ${Math.min(o.length-u,y)} more`,moreState:o.length>u?"shown":"hidden",rows:a,rowsState:a.length>0?"listed":"empty",x:B.x,y:B.y}}function P(){let t=d;d=null,f=null,v="",u=y,t?.close()}var j=0;function te(t,e,o){if(!yl(t,e,o)){if(!qd(t))fh(t).then(()=>d?.update(m()));return}if(j!==0)return;j=requestAnimationFrame(()=>{j=0,d?.update(m())})}function HS(t,e,o={}){P(),k().then(()=>d?.update(m())),f=e,w=o;let i=Me(t);B={x:i.left,y:i.bottom+4},d=V(m(),{browseAll:()=>{let a=f,r=w;if(P(),a)fF(a,r)},dismissed:()=>{d=null,f=null,v="",u=y},measure:te,pick:(a)=>{let r=f;P(),r?.(a)},showMore:()=>{u+=y,d?.update(m())},setFilter:(a)=>{v=a,d?.update(m())}},t)}async function mF(t,e){let o=await ea([...t]),[i]=o;if(i)e(i.ref)}function BS(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=Zc(),e.addEventListener("change",()=>{if(e.files?.length)mF(e.files,t)}),e.click()}var re=400,F=new WeakMap;function W(t,e){let o=la.has(Ot(e));return{label:t,thumbSrc:o&&e?ed(e):"",thumbState:o&&e?"shown":"hidden",value:e}}function Xl(t,e,o,i,a={}){k();let r=F.get(t);if(r){r.prop=e,r.commit=i,r.options=a,r.handle.update(W(e,o));return}let n={commit:i,options:a,prop:e},s=D(t,W(e,o),{browse:(l)=>{HS(l,(c)=>n.commit(c),n.options)},edit:(l)=>v_(`media:${n.prop}`,re,(c)=>n.commit(c))(l),upload:()=>BS((l)=>n.commit(l)),warm:()=>{k()}});F.set(t,Object.assign(n,{handle:s}))}function Lm(t){let e=F.get(t);if(e)F.delete(t),e.handle.dispose()}
2
+ export{Ku,WT,zT,Gu,Ww,fF,HS,mF,BS,Xl,Lm};
3
3
 
4
- //# debugId=903D685F11A1727A64756E2164756E21
5
- //# sourceMappingURL=studio-4bgvvzhv.js.map
4
+ //# debugId=84DD1C90D55B8BAC64756E2164756E21
5
+ //# sourceMappingURL=studio-fe2d1fp5.js.map
@@ -1,5 +1,5 @@
1
- import{n,_}from"./studio-k3we3kqb.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function Pd(e){let t=u(e);return t?a(t):null}function Sm(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function ST(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Uu(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function kS(e){return u(e)?.active??null}function LN(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Uu(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function $N(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Uu(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Rw(e,t){let r=Uu(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function CT(e,t){let r=u(e);if(!r||!c())return!1;let o=Uu(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function IN(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
- export{Pd,Sm,ST,Uu,kS,LN,$N,Rw,CT,IN};
1
+ import{n,S}from"./studio-0z8kp4xk.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return S(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function jd(e){let t=u(e);return t?a(t):null}function $m(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function BT(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Ju(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return S(e)&&"name"in e&&n(e.name)}function jS(e){return u(e)?.active??null}function YD(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Ju(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function ZD(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Ju(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Vw(e,t){let r=Ju(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function VT(e,t){let r=u(e);if(!r||!c())return!1;let o=Ju(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function XD(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
2
+ export{jd,$m,BT,Ju,jS,YD,ZD,Vw,VT,XD};
3
3
 
4
- //# debugId=318ED8B7FAE7E41F64756E2164756E21
5
- //# sourceMappingURL=studio-45mj4jqe.js.map
4
+ //# debugId=CE3D6B2FD10BF00564756E2164756E21
5
+ //# sourceMappingURL=studio-fgp4cyy3.js.map
@@ -0,0 +1,5 @@
1
+ import{n,J,S}from"./studio-0z8kp4xk.js";function b(t){return JSON.parse(JSON.stringify(t))}function Ce(t){return t===void 0||t===null?t:b(t)}function re(t,e){let r=t;for(let o of e){if(r==null)return;r=r[o]}return r}function Uy(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 qy(t,e){let{op:r}=e;switch(e.op){case"set-key":{let o=re(t,e.path);if(!o)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete o[e.key];else o[e.key]=Ce(e.value);return}case"insert-child":{l(t,e.parentPath).splice(e.index,0,Ce(e.node));return}case"remove-child":{l(t,e.parentPath).splice(e.index,1);return}case"set-child":{l(t,e.parentPath).splice(e.index,1,Ce(e.node));return}case"move-child":{P(e);let o=l(t,e.fromParentPath),a=l(t,e.toParentPath),[i]=o.splice(e.fromIndex,1);a.splice(e.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${r}`)}function l(t,e){let r=re(t,e);if(r==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return Uy(r)}function I1(t,e,r,o,a){let i=t.length,c=i<e.length&&t.every((s,u)=>s===e[u]),d=e[i+1];if(!c||e[i]!=="children"||!J(d))return e;if(a?d<r:d<=r)return e;let h=[...e];return h[i+1]=d+o,h}function P(t){let e=[...t.fromParentPath,"children",t.fromIndex],r=t.toParentPath;if(r.length>=e.length&&e.every((o,a)=>o===r[a]))throw Error(`doc-op-move-into-self:${r.join("/")}`)}function ff(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function N1(t,e){let{op:r}=e;switch(g(e),e.op){case"set-key":{let o=re(t,e.path);if(o===void 0)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(!S(o)||Array.isArray(o))throw TypeError(`doc-op-not-a-node:${e.path.join("/")}`);let a=Ce(o[e.key]);return a===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:a}}case"insert-child":{let{length:o}=f(t,e.parentPath);return{index:ff(e.index,o),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"set-child",parentPath:e.parentPath}}case"move-child":{P(e);let o=m(t,e.fromParentPath);p(o,e.fromParentPath,e.fromIndex);let a=f(t,e.toParentPath),i=ff(e.toIndex,a.length-(a===o?1:0));return{fromIndex:i,fromParentPath:I1(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:I1(e.toParentPath,e.fromParentPath,i,1,!0)}}default:break}throw Error(`unknown-doc-op:${r}`)}function g(t){let e=[];if(t.op==="move-child")e.push([t.fromParentPath,t.fromIndex],[t.toParentPath,t.toIndex]);else if(t.op==="insert-child"||t.op==="remove-child"||t.op==="set-child")e.push([t.parentPath,t.index]);for(let[r,o]of e)if(!Number.isInteger(o))throw TypeError(`doc-op-index:${[...r,"children",String(o)].join("/")}`)}function m(t,e){let r=re(t,e);return r&&Array.isArray(r.children)?r.children:null}function p(t,e,r){if(!t||r<0||r>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",r].join("/")}`)}function x(t,e,r){let o=m(t,e);return p(o,e,r),Ce(o[r])}function f(t,e){let r=re(t,e);if(!S(r)||Array.isArray(r))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(r.children===void 0)return[];if(!Array.isArray(r.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return r.children}function sa(t,e){if(t.length>e.length)return!1;return t.every((r,o)=>r===e[o])}function w(t,e){let r=Math.min(t.length,e.length);for(let o=0;o<r;o++){let a=t[o],i=e[o];if(a===i)continue;if(J(a)&&J(i))return a-i;return String(a)<String(i)?-1:1}return t.length-e.length}function v(t){let e=[];for(let r of t)if(!t.some((o)=>!N(o,r)&&sa(o,r)))e.push([...r]);return e}function N(t,e){return t.length===e.length&&sa(t,e)}function mf(t){let e=t?.at(-1);return t&&t.at(-2)==="children"&&J(e)?{index:e,parentPath:t.slice(0,-2)}:null}function au(t){return mf(t)!==null}function pg(t){return v(t).filter((e)=>au(e)).toSorted((e,r)=>w(r,e))}function S_(t){if(J(t)&&Number.isInteger(t))return t;return n(t)&&/^(?:0|[1-9]\d*)$/.test(t)?Number(t):null}function C_(t,e,r,o){let a=mf(e),i=a&&re(t,a.parentPath),c=re(t,r);if(!a||!i||!Array.isArray(i.children)||!c)return null;if(i.children[a.index]===void 0)return null;let d=i===c,h=d&&a.index<o?o-1:o,s=Array.isArray(c.children)?c.children.length:0,u={fromIndex:a.index,fromParentPath:a.parentPath,op:"move-child",toIndex:ff(h,s-(d?1:0)),toParentPath:r},y=N1(t,u);return{forward:u,inverse:y}}
2
+ export{Ce,re,Uy,qy,I1,ff,N1,sa,mf,au,pg,S_,C_};
3
+
4
+ //# debugId=59042F7C1264CC9564756E2164756E21
5
+ //# sourceMappingURL=studio-ft706q02.js.map
@@ -0,0 +1,6 @@
1
+ import{p,we}from"./studio-1b79rpcb.js";import{w}from"./studio-5k9mfafh.js";import{st,Tr,GA,zp,zx,So,ZA,Up}from"./studio-kp4vzrct.js";import{ta,dt}from"./studio-yetr4gg1.js";import{n,J,qe,Q,f}from"./studio-0z8kp4xk.js";var u=null;async function Vd(){if(!we()||!Q(p().getAccountStatus)){u=null;return}try{u=await p().getAccountStatus?.()??null}catch{u=null}}function yC(){return u}function vC(){return u!==null&&u.installations.length===0&&Boolean(u.appInstallUrl)}function DO(){if(u===null)return null;let e=u.installations.flatMap((o)=>o.manageUrl?[{account:o.account??`Installation ${o.id}`,url:o.manageUrl}]:[]);if(e.length===0&&!u.appInstallUrl)return null;let t={manage:e};if(u.appInstallUrl)t.installUrl=u.appInstallUrl;return t}function OO(){return u?.entries??[]}function Q$(){return(u?.notices??[]).filter((e)=>e.display!=="toast")}var Y=new Set;function Z(){let e=(u?.notices??[]).filter((t)=>t.display==="toast"&&!Y.has(t.id));for(let t of e)Y.add(t.id);return e}var ee="https://jxsuite.com/problems/";function N(e){return typeof e==="string"}function fe(e){return typeof e==="object"&&e!==null}function Kb(e){if(!N(e)||!e.startsWith("https://jxsuite.com/problems/"))return null;let t=e.slice(29);return t===""?null:t}function no(e){if(N(e))return e.trim()===""?null:e;if(!fe(e))return null;for(let t of[e.detail,e.error,e.title])if(N(t)&&t.trim()!=="")return t;return null}function ul(e,t){return no(e)??(t===void 0?"Request failed":`Request failed (${t})`)}var g=(e,t,o,i)=>{let s={status:t,title:o,type:`${ee}${e}`};if(i!==void 0)s.extensions=i;return s},Be={invalidRequest:g("invalid-request",400,"The request was malformed or incomplete"),notFound:g("not-found",404,"The requested resource does not exist"),methodNotAllowed:g("method-not-allowed",405,"That method is not allowed on this route"),conflict:g("conflict",409,"The request conflicts with the current state",["conflicts"]),payloadTooLarge:g("payload-too-large",413,"The request body is too large"),unauthorized:g("unauthorized",401,"Credentials are missing or not accepted"),forbidden:g("forbidden",403,"The request was refused"),needsInstallationAccess:g("needs-installation-access",403,"The GitHub App is not installed for that account",["installUrl"]),pathOutsideProject:g("path-outside-project",403,"The path resolves outside the active project"),actionRequired:g("action-required",403,"An action is required first",["actions","heading","retry"]),noActiveProject:g("no-active-project",409,"No project is active on this backend"),capabilityUnavailable:g("capability-unavailable",501,"This backend does not provide that capability"),upstreamFailure:g("upstream-failure",502,"An upstream service failed",["upstream"]),internalError:g("internal-error",500,"The backend failed to complete the request")};var r=(e,t,o,i)=>{let s={method:e,path:t,optional:i!==void 0,summary:o};if(i!==void 0)s.degradation=i;return s},Ge={activate:r("POST","/__studio/activate","Bind the backend to a project root"),project:r("GET","/__studio/project","Root project metadata {name, root}"),projectInfo:r("GET","/__studio/project-info","Probe a directory: {isSiteProject, projectConfig?, directories?}"),resolveSite:r("GET","/__studio/resolve-site","Resolve the owning site of a file path {sitePath, projectConfig?, fileRelPath?}"),sites:r("GET","/__studio/sites","Enumerate site projects [{config, path}] (backs listProjects)","The welcome screen's Projects catalogue stays hidden."),createProject:r("POST","/__studio/create-project","Scaffold a project at a caller-chosen destination → {root, config}"),starters:r("GET","/__studio/starters","Starter templates (StarterInfo[])","The New Project picker offers only blank/templates."),importSite:r("POST","/__studio/import-site","Clone a live website into a project; streams NDJSON progress","The New Project Import tab is unavailable."),files:r("GET","/__studio/files","List a directory (DirEntry[]) in stable path order; an entry may carry an opaque content `version` the backend vouches for; with ?glob=<pattern>, search matching files project-wide"),fileRead:r("GET","/__studio/file","Read a file's text content"),filesRead:r("POST","/__studio/files/read","Read many files' text content {paths} → ReadFilesResult {files: [path, {content} | "+"{error: {status, code?, message}}][], omitted}. At most READ_FILES_MAX_PATHS (200) paths and a backend byte budget per call: the excess is listed in `omitted` (never a 400) and the first path is always answered. Per-path errors: 404 missing/deleted, 415 binary, 413 too large, 502 upstream. Allowed for read-only sessions; keeps fileRead's server-side effects","Adapters fall back to one fileRead per path."),fileWrite:r("PUT","/__studio/file","Write a file's text content"),fileDelete:r("DELETE","/__studio/file","Delete a file"),fileUpload:r("POST","/__studio/file/upload","Upload binary content to a path → UploadResult {path, size?}. `path` is the answer, not an "+"echo: a store that de-duplicates, suffixes, or normalizes names reports what it really wrote"),fileBytes:r("GET","/__studio/file/bytes","A project file's raw bytes, undecoded — the read side of `fileUpload`, for a caller that must "+"not go through UTF-8","Studio can only read a project file as text, so any surface that must decode one stays hidden."),documentRaw:r("GET","/__studio/raw/","A project file as its own bytes, at its own URL — the mount a canvas renders against when "+"the editor origin does not serve the site's URL space. The project-relative path is appended to this prefix","The canvas cannot address project files by URL, so a host whose origin does not serve the site URL space renders no component $refs and no images."),fileRename:r("POST","/__studio/file/rename","Rename/move (+ refactor report). `from`/`to` are server-root-relative; every path in the "+"report is relative to the active project (specs/server.md §4.1)"),references:r("GET","/__studio/references","Where a file or a component tag is used (?path=&tag=, at least one) → ReferencesResult "+"{files, filesReferencing, refsTotal} — the read side of the rename refactor's own walker, "+"cached until the backend's watcher sees the tree move (backs findReferences). `?path=` is server-root-relative and every path in the answer is relative to the active project; a "+"target outside that project is a 400, never a zero-result 200 (specs/server.md §4.1)",'Usage counts are hidden: no "Used on N pages" in the inspector, no Selection: Find Usages, and delete/rename confirmations state no reference count.'),locate:r("POST","/__studio/locate","Find a file by name → {path | null}"),collab:r("GET","/__studio/collab","Realtime co-editing: a WebSocket upgrade speaking the @jxsuite/collab wire envelope (one socket per project, documents multiplexed by path; y-protocols sync + project-level "+"awareness in lib0 binary frames — see @jxsuite/collab/envelope for the frame layout and "+"the docEpoch/doc-reset lifecycle). A plain GET (no Upgrade) answers {collab, protocols, version} as the capability probe, and `protocols` is the subprotocol negotiation: the client offers one of them as Sec-WebSocket-Protocol and the server echoes it, or the "+"client offers none when the server advertises none, because RFC 6455 §4.1 fails a "+"connection whose offer went unechoed.","Realtime co-editing is unavailable; Studio edits solo with file-level saves"),components:r("GET","/__studio/components","Discover components (ComponentMeta[])"),cem:r("GET","/__studio/cem","Custom-elements manifest of an npm dependency","Dependency components lose prop/slot metadata."),formats:r("GET","/__studio/formats","The project's format registry entries plus a sibling `extensions` array — per enabled "+"extension its manifest identity and project-section contributions (ExtensionsInfo[]; backs listFormats and listExtensions).","Only .json documents open (backs listFormats); descriptor-contributed settings sections do not appear."),extensionCatalog:r("GET","/__studio/catalog","Extensions this backend can OFFER (ExtensionCatalogEntry[]) — the shipped first-party "+"catalogue plus any package in the project's own dependencies exporting a jx-extension.json, each marked with whether the host resolves it without a project install and whether the project has it installed. A capability rather than a constant: a Worker ships a fixed set "+"of extension packages (specs/extensions.md §5.5). Backs listExtensionCatalog.","The Extensions section offers no catalogue; adding an extension stays a typed package name."),projectSchemas:r("GET","/__studio/project-schemas","The project's generated entry documents (project.schema.json / document.schema.json), "+"PRE-BUNDLED into self-contained schemas — {project, document} (backs fetchProjectSchemas). "+"Regenerated on demand when missing or older than project.json.","The JSON editor falls back to the bundled core schemas (extension sections get no editor validation/completion)."),format:r("POST","/__studio/format","Dispatch a format capability {format, action: parse|serialize, source?|doc?}","Non-JSON documents cannot be parsed/serialized (backs formatAction)."),pluginSchema:r("GET","/__studio/plugin-schema","Extract a $studio schema from a class source","Plugin property panels fall back to generic JSON editing."),codeFormat:r("POST","/__studio/code/format","Format posted source {code, path?} → {code, errors}","Code editors skip format-on-open/save (codeService returns null)."),codeMinify:r("POST","/__studio/code/minify","Minify posted source {code} → {code}","Compiled-output minification is skipped."),codeLint:r("POST","/__studio/code/lint","Lint posted source {code, path?} → {diagnostics}","Code editors show no lint markers."),buildSite:r("POST","/__studio/build","Build or render the site → {routes, files, errors, mode?, url}","Build Site reports that this target cannot build."),previewSite:r("POST","/__studio/preview","Preview the working tree at a route → {routes, files, errors, mode, url, reused}","Open in Browser falls back to buildSite."),previewOverlay:r("POST","/__studio/preview/overlay","Publish (POST) or retract (DELETE) a document's unsaved bytes → 204","A live preview shows the last saved state instead of the editor's."),packages:r("GET","/__studio/packages","List dependencies (PackageInfo[])"),packagesAdd:r("POST","/__studio/packages/add","Add a registry dependency, writing package.json and package-lock.json together"),packagesRemove:r("POST","/__studio/packages/remove","Remove a dependency, writing package.json and package-lock.json together"),packagesInstall:r("POST","/__studio/packages/install","Install the declared dependencies (npm's installer, writing package-lock.json)","Install/reinstall affordances are hidden; add, remove and version updates still work where the backend serves them (a cloud session updates the lockfile without installing)."),packagesNeedsInstall:r("GET","/__studio/packages/needs-install","Whether node_modules is stale","The install-on-open prompt never shows."),packagesVersions:r("GET","/__studio/packages/versions","Newest published version of each dependency (PackageVersionInfo[])","The Latest column stays empty and the update affordances are hidden."),packagesSetVersions:r("POST","/__studio/packages/set-versions","Rewrite dependency ranges and install (lockfile-only where nothing installs)","Bulk version updates are hidden."),gitStatus:r("GET","/__studio/git/status","The project's working-tree status (GitStatusResult), project-relative"),gitBranches:r("GET","/__studio/git/branches","Branch list (GitBranchesResult)"),gitLog:r("GET","/__studio/git/log","Recent commits (GitLogEntry[])"),gitStage:r("POST","/__studio/git/stage","Stage files"),gitUnstage:r("POST","/__studio/git/unstage","Unstage files"),gitCommit:r("POST","/__studio/git/commit","Commit the project's staged (else all its dirty) files"),gitPush:r("POST","/__studio/git/push","Push (cloud: sync check — commits land on push)"),gitPull:r("POST","/__studio/git/pull","Pull/fast-forward; 409 {conflicts} on overlap"),gitFetch:r("POST","/__studio/git/fetch","Refresh remote tracking state"),gitCheckout:r("POST","/__studio/git/checkout","Switch branches"),gitCreateBranch:r("POST","/__studio/git/create-branch","Create a branch"),gitCommitBranch:r("POST","/__studio/git/commit-branch","Commit the change set as a NEW branch off the session's base, then take it out of this one "+"→ GitCommitBranchResult; 409 branch_exists","A publish the remote conflicts with reports the conflict alone, and Send for review stays refused on a branch whose every commit is live."),gitDiff:r("GET","/__studio/git/diff","Unified diff of dirty files (or one path)"),gitShow:r("GET","/__studio/git/show","File content at a ref"),gitDiscard:r("POST","/__studio/git/discard","Discard working changes"),gitInit:r("POST","/__studio/git/init","Initialize a repository"),gitAddRemote:r("POST","/__studio/git/add-remote","Add a remote"),gitClone:r("POST","/__studio/git/clone","Clone a repository","The welcome screen hides Clone Git Repository."),gitPr:r("POST","/__studio/git/pr","Open a pull request → PullRequestInfo","Studio falls back to a direct GitHub API call with the user's token."),dataConnections:r("GET","/__studio/data/connections","Connector connections with configured/missingSecrets/isDefault state, reachable table names, and registry-descriptor provider metadata (DataConnectionsResponse; backs dataConnections)","The connections settings section shows no status, and data-domain actions stay hidden."),dataConnectionTest:r("POST","/__studio/data/connections/test","Probe a connection {connection} → DataConnectionTestResult (backs dataConnectionTest)","The Test Connection action is hidden."),dataPush:r("POST","/__studio/data/push","Additive schema push {connection?, dryRun?} → DataPushResult (plan of DataPushStep[], "+"applied, warnings/errors; backs dataPush)","The Push Schema action is hidden; schemas deploy via `jx db push` instead."),dataRows:r("GET","/__studio/data/rows","Page a table (DataRowsQuery params) → DataRowsResult {rows, total, columns} (backs dataRows)","The data grid is unavailable."),dataInsertRow:r("POST","/__studio/data/rows","Insert a row {table, connection?, values} → {row} (backs dataInsertRow)","The data grid hides its add-row footer."),dataUpdateRow:r("PUT","/__studio/data/rows","Update a row keyed on its primary key {table, connection?, pk, set} → {row} (backs "+"dataUpdateRow)","Data grid cells are read-only."),dataDeleteRow:r("DELETE","/__studio/data/rows","Delete a row (?table=&pk=&connection=) → {ok} (backs dataDeleteRow)","The data grid hides row deletion."),secretsList:r("GET","/__studio/secrets","Configured secret env-var NAMES, never values (SecretsListResponse; backs listSecrets)","Secret fields cannot show set/unset state."),secretsSet:r("PUT","/__studio/secrets","Write/remove secrets in the backend store (.dev.vars locally) {set?, remove?} → names "+"(backs setSecrets)","The secret form control renders disabled; secrets are edited in .dev.vars by hand."),aiChat:r("POST","/__studio/ai/chat","StreamEvent SSE chat proxy {messages, tools, systemPrompt, model}"),aiModels:r("GET","/__studio/ai/models","Model catalogue (AiModelsResponse)"),cfProxy:r("POST","/__studio/cf/proxy","Allowlisted Cloudflare API passthrough {path, method?, body?} (backs cfApi)","The Publish panel explains the git-push publishing path instead.")};var eL=200,tL=100,nL=12;var me=new Set(["reload","repeat","none"]);function Ap(e){if(!Array.isArray(e))return[];return e.flatMap((o)=>{if(!f(o))return[];let{href:i,id:s,label:d,primary:l}=o;if(!n(s)||!s||!n(d)||!d)return[];let h={id:s,label:d};if(n(i)&&i)h.href=i;if(l===!0)h.primary=!0;return[h]})}function te(e){return n(e)&&me.has(e)}function iL(e){return te(e)?e:void 0}function ge(e){return e.replaceAll("_","-")}function R(e){if(!f(e))return{};let{actions:t,code:o,conflicts:i,heading:s,installUrl:d,retry:l,type:h}=e,a={},c=Kb(h)??(n(o)?ge(o):null);if(c!==null)a.code=c;if(n(d))a.installUrl=d;if(t!==void 0)a.actions=Ap(t);if(n(s)&&s)a.heading=s;if(te(l))a.retry=l;if(Array.isArray(i))a.conflicts=i.filter((x)=>n(x));return a}function AO(e){let t=R(e);return(t.code==="pull-conflict"||t.code==="conflict")&&t.conflicts?t.conflicts:null}function PO(e){let t=R(e);return t.code==="needs-installation-access"&&t.installUrl?t.installUrl:null}function MO(e){return R(e).code==="action-required"}var B="X-Jx-Ai-Session";var F="X-Api-Provider";function re(e){return typeof e==="string"}function ye(e){return re(e)&&e!==""}function O(e){return typeof e==="object"&&e!==null}function be(e){return Array.isArray(e)}function xe(e,t){if(!e)return t;let o;try{o=JSON.parse(e)}catch{return e}if(O(o)){if("error"in o){let{error:i}=o;if(re(i))return i;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}if("errors"in o&&be(o.errors)){let[i]=o.errors;if(O(i)&&"message"in i&&Boolean(i.message))return String(i.message)}}return e}function Se(e){let t;try{t=JSON.parse(e)}catch{return""}return O(t)&&"code"in t&&ye(t.code)?t.code:""}function ne(e,t){let o=t;if(o.name==="AbortError")return{type:"done",stopReason:"cancelled"};return{type:"error",message:`${e}: ${o.message}`}}function _e(e){return typeof e==="function"}function rL({chatUrl:e,model:t="gpt-4o",apiKey:o,baseUrl:i,provider:s,sessionId:d}){let l=null;async function*h(a,c,x,P){let _={"Content-Type":"application/json"};if(o)_["X-Api-Key"]=o;if(i)_["X-Api-Base-URL"]=i;if(s&&s!=="openai-compat")_[F]=s;if(d)_[B]=d;l??=Promise.resolve(_e(e)?e():e);let S;try{S=await l}catch(y){if(P.aborted){yield{type:"done",stopReason:"cancelled"};return}throw y}if(P.aborted){yield{type:"done",stopReason:"cancelled"};return}let m;try{m=await fetch(S,{method:"POST",headers:_,body:JSON.stringify({messages:a,tools:c,systemPrompt:x,model:t}),signal:P})}catch(y){yield ne("Network error",y);return}if(!m.ok){let y="";try{y=await m.text()}catch{}let T=xe(y,m.statusText),M=Se(y);yield{type:"error",message:T,code:M||String(m.status)};return}let b=m.body?.getReader();if(!b){yield{type:"error",message:"No response body"};return}let ue=new TextDecoder,U="";try{for(let y=await b.read();!y.done;y=await b.read()){U+=ue.decode(y.value,{stream:!0});let T=U.split(`
2
+ `);U=T.pop()||"";for(let M of T){let L=M.trim();if(!L||!L.startsWith("data: "))continue;let pe=L.slice(6),E;try{E=JSON.parse(pe)}catch{continue}if(yield E,E.type==="done"||E.type==="error")return}}}catch(y){b.cancel(),yield ne("Stream error",y)}}return{streamChat:h}}function th(){return Tr(st.aiOpenAiKey)}function FO(e){So(st.aiOpenAiKey,e||"")}function px(){return GA(st.aiOpenAiKey)}function hl(){return Tr(st.aiBaseUrl)}function $a(){return Tr(st.aiProvider)==="anthropic"?"anthropic":"openai-compat"}function jO(){return $a()==="openai-compat"?th():""}function fx(){return Tr(st.aiModel)}function HO(e){So(st.aiModel,e||"")}function G(e){return e==="anthropic"?"anthropic":""}function BO(e){ZA([[st.aiOpenAiKey,e.apiKey],[st.aiBaseUrl,e.baseUrl],[st.aiModel,e.model],[st.aiProvider,G(e.provider)]])}function VO(e){return!jm(st.aiOpenAiKey,e.apiKey,th())||!jm(st.aiBaseUrl,e.baseUrl,hl())||!jm(st.aiModel,e.model,fx())||G(e.provider)!==G($a())}function jm(e,t,o){return zx(e,t)===zx(e,o)}function WO(){Up([st.aiOpenAiKey,st.aiBaseUrl,st.aiModel,st.aiProvider])}var Ae="claude-opus-5-5";function wC(){return{apiKey:th(),baseUrl:hl(),provider:$a()}}function se(e){let t=e.provider??"openai-compat";return`${e.apiKey}\x00${e.baseUrl}\x00${t}`}var A=null,k="",q=!1,j=!1,H="",V,K="",C=null,W=["openai-compat"],z=null,oe=new Set,Pe=600000,v=0,ie=!1;function us(){A=null,k="",q=!1,j=!1,H="",V=void 0,K="",C=null,W=["openai-compat"],z=null,v=0}var Re=new Set([st.aiOpenAiKey.key,st.aiBaseUrl.key,st.aiProvider.key,st.cfToken.key,st.cfAccountId.key]);zp((e)=>{if(e.some((t)=>Re.has(t)))us()});function oL(e){return A&&k===se(e)?A:null}function ae(e){return A?.find((t)=>t.id===e)}function sL(e){return ae(e)?.toolSupport}function zO(e){return ae(e)?.contextWindow}function mx(e){if(e)oe.add(e);z??=nh({force:!0}).catch(()=>{}).then(()=>{v=Date.now();for(let t of oe)t()})}function ve(){if(!j||v===0||Date.now()-v<Pe)return!1;return z=null,v=0,mx(),!0}function Te(){if(typeof window>"u"||ie)return;ie=!0,window.addEventListener("focus",()=>{ve()})}Te();function Gb(){return px()||xC()}function xC(){return q}function UO(){return j}function Hm(){return V}function qO(){return K}function _C(){return C}function JO(){return W}function Ee(){return H}function tc(){let e=$a()==="anthropic"?Ae:st.aiModel.default;return fx()||Ee()||e}function Oe(e,t){let o;try{o=new URL(e,"http://jx.invalid")}catch{return e}return o.pathname=o.pathname.replace(/[^/]*$/,t),/^https?:/i.test(e)?o.href:`${o.pathname}${o.search}`}function ke(e){if(e===void 0)return["openai-compat"];return e.filter((t)=>["anthropic","openai-compat"].includes(t))}async function nh(e={}){let t=e.credentials??wC(),o=se(t);if(A&&k===o&&!e.force)return A;let i=p(),s=await Promise.resolve(i.aiChatUrl()),d=Oe(s,"models"),l={};if(t.apiKey)l["X-Api-Key"]=t.apiKey;if(t.baseUrl)l["X-Api-Base-URL"]=t.baseUrl;if(t.provider==="anthropic")l[F]=t.provider;let h=await fetch(d,{headers:l});if(!h.ok)throw Error(`HTTP ${h.status}`);let a=await h.json();if(q=a.configured===!0,j=a.managed===!0,H=a.defaultModel??"",V=a.code,K=a.upstreamError!==void 0?a.upstreamMessage??"":"",C=null,W=ke(a.providers),a.code==="action_required"){let c={actions:Ap(a.actions)};if(n(a.detail)&&a.detail)c.detail=a.detail;C=c}return A=(a.models||[]).map((c)=>{let x={id:c.id,name:c.name||c.id};if(J(c.contextWindow))x.contextWindow=c.contextWindow;if(qe(c.toolSupport))x.toolSupport=c.toolSupport;return x}),k=o,A}var I=new Set,X=null;function KO(e){if(I.size===0){X=e;return}for(let t of I)t(e)}function ce(e){I.add(e);let t=X;if(X=null,t)e(t);return()=>{I.delete(e)}}function SC(){return we()&&Q(p().performAction)}function aL(e){let t=e.find((i)=>i.primary)??e[0];if(!t)return null;let o=e.find((i)=>i!==t);return o?{lead:t,other:o}:{lead:t}}var D=null,le=!1;function CC(e){let t=aL(e.actions);if(!SC()||!t)return Promise.resolve(!1);return D??=Ce(e,t).finally(()=>{D=null}),D}async function Bm(e){let t=R(e);if(t.code!=="action-required"||!t.actions?.length)return!1;return CC({actions:t.actions,detail:e instanceof Error?e.message:void 0,heading:t.heading,retry:t.retry})}async function de(){us(),await Vd(),lL()}function Ce(e,t){let o=e.detail??"This needs one more step first.";return new Promise((i)=>{let s="offer",d=(S)=>{if(s==="done")return;s="done",_.close(),i(S)},l=(S)=>{s="offer",_.update({cancelLabel:"Not now",confirmLabel:t.lead.label,message:S,secondaryLabel:t.other?.label??""})},h=async(S)=>{let m;try{m=await S}catch(b){if(s==="waiting")l(b instanceof Error?b.message:String(b));return}if(m?.status==="done"){await de(),d(!0);return}if(s!=="waiting"||!m||m.status==="redirect")return;Vd(),l(o)},a=(S)=>{if(s!=="offer")return;s="waiting";let m;try{m=p().performAction(S)}catch(b){l(b instanceof Error?b.message:String(b));return}_.update({cancelLabel:"Cancel",confirmLabel:"Waiting…",message:"Finish in the window that opened. This closes by itself once it is done.",secondaryLabel:""}),h(m)},{lead:c,other:x}=t,P={cancelLabel:"Not now",confirmLabel:c.label,headline:e.heading??"One more step",layer:dt("dialog"),message:o,onCancel:()=>{le=!0,d(!1)},onClosed:()=>{d(!1)},onConfirm:()=>{a(c)},region:"account/action"};if(x)P.onSecondary=()=>{a(x)},P.secondaryLabel=x.label;let _=ta(P)})}function je(e){if(e==="reload")location.reload();else if(e==="repeat")w.info("Done. Run that again now.",{key:"account.action.retry",source:"Account"})}function GO(){return ce((e)=>{if(le||D)return;CC(e).then((t)=>{if(t)je(e.retry)})})}async function gx(e){if(!SC())return!1;let t=p().performAction(e),o;try{o=await t}catch(i){return w.error(i instanceof Error?i.message:String(i),{key:"account.action",source:"Account",tier:"toast"}),!1}if(o?.status==="done")return await de(),!0;if(o?.status!=="redirect")await Vd();return!1}function lL(){for(let e of Z()){let t={key:`account.notice.${e.id}`,source:"Account"};if(e.level==="warning")w.warn(e.message,t);else w.info(e.message,t)}}
3
+ export{Vd,yC,vC,DO,OO,Q$,Kb,no,ul,eL,tL,nL,Ap,iL,AO,PO,MO,rL,th,FO,px,hl,$a,jO,fx,HO,BO,VO,jm,WO,wC,us,oL,sL,zO,mx,Gb,xC,UO,Hm,qO,_C,JO,tc,nh,KO,SC,aL,CC,Bm,GO,gx,lL};
4
+
5
+ //# debugId=969CDAFC19938A7864756E2164756E21
6
+ //# sourceMappingURL=studio-g79s1dyg.js.map
@@ -1,5 +1,5 @@
1
- import{Ne}from"./studio-n9qba0gx.js";import{bt,ka,Uo,Hr}from"./studio-xva3hzkv.js";import{Wt,Qc,ti,qn,Se,pi,Fe,m,qr,pn,o1,ng,Sh,td}from"./studio-knsjyx7n.js";import{to,Ts,hl,u}from"./studio-pwctzka3.js";import{Vt}from"./studio-4f7thq0p.js";import{oe}from"./studio-v5wktj6f.js";import{te}from"./studio-3qr08sxq.js";var sS=["code","layout","component","diff","breakpoint","locale"],T={breakpoint:"design",code:"source",component:"design"},x={design:"Design",source:"Code"},k="Could not read this file's comparison against HEAD.";var ju={breakpoint:"Same page at",code:"Code",component:"Component definition",diff:"Diff vs HEAD",layout:"Layout",locale:"Same page in"};function R(e){let t=pn(e)?.derived;if(!t)return null;let o=bt(t.sourcePaneId);if(!o)return{diffPath:null,kind:t.kind,media:null,mode:null,path:null,probePath:null,reason:"The pane this one follows has no document open.",select:null,status:"unavailable"};if(t.kind==="lens")return w(e,t,o);return S(e,t,o)}function w(e,t,o){let n={diffPath:null,kind:"lens",media:t.media,mode:t.mode,path:null,probePath:null,select:null};if(t.preset==="diff"){let i=o.documentPath;if(!h(i))return{...n,reason:"Nothing to compare — this file matches HEAD.",status:"unavailable"};if(t.diff?.filePath===i&&(t.diffRev===void 0||t.diffRev===u.git.rev))return{...n,reason:"",status:"ready"};if(c.get(e)?.failed&&c.get(e)?.path===i)return{...n,reason:k,status:"unavailable"};return{...n,diffPath:i,reason:"",status:"loading"}}if(t.preset==="code"&&ka(o)==="source")return{...n,reason:"The pane this one follows is showing Code — one document has one editor.",status:"unavailable"};if(t.preset==="breakpoint"&&!aS(o).includes(t.media))return{...n,reason:`This document does not declare a "${t.media??"base"}" breakpoint.`,status:"unavailable"};return{...n,reason:"",status:"ready"}}function h(e){return u.git.status?.files.find((t)=>t.path===e&&(t.status==="M"||t.status==="A"||t.status==="U"))??null}function S(e,t,o){let n={diffPath:null,kind:"companion",media:null,mode:null};if(t.preset==="layout"){let a=u.layoutSelection,r=a?.layoutFile??hl(o.doc.document.$layout);return r===null?{...n,path:null,probePath:null,reason:"This page has no layout.",select:null,status:"unavailable"}:{...n,path:r,probePath:null,reason:"",select:a?a.layoutPath:null,status:"ready"}}if(t.preset==="locale"){let a=Ts(),r=o.documentPath===null||t.locale===null?null:Qc(o.documentPath,t.locale,a);if(r===null)return{...n,path:null,probePath:null,reason:"This document has no path in that locale.",select:null,status:"unavailable"};let l=d.get(e);if(l?.path!==r||l.exists===null)return{...n,path:null,probePath:r,reason:"",select:null,status:"loading"};if(!l.exists)return{...n,path:null,probePath:null,reason:`No ${Wt(t.locale)} copy of this document yet — `+"the Languages panel can create one.",select:null,status:"unavailable"};return{...n,path:r,probePath:null,reason:"",select:null,status:"ready"}}let i=_(o);if(i===null)return t.resolved===null?{...n,path:null,probePath:null,reason:"Select an element inside a component to see its definition.",select:null,status:"unavailable"}:{...n,path:null,probePath:null,reason:"",select:null,status:"ready"};return{...n,path:i,probePath:null,reason:"",select:null,status:"ready"}}function aS(e){let{sizeBreakpoints:t}=Hr(to(e.doc.document.$media));return[null,...t.map((o)=>o.name)]}function _(e){let[t]=e?.session.selection??[];if(!e||!t)return null;let o=e.doc.document,n=[...t];while(n){let i=oe(o,n),a=i?Ne.find((r)=>r.tagName===i.tagName):null;if(a?.path)return a.path;n=Vt(n)}return null}function F(e,t){if(t.sourcePaneId===e||!pn(t.sourcePaneId))throw RangeError(`pane "${e}" cannot derive from "${t.sourcePaneId}" — a derivation names `+"another pane that is in the grid");b(e,t)}function b(e,t){let o=pn(e);if(o)c.delete(e),d.delete(e),o.derived=t}function GE(e){b(e,null)}function f(e,t){let o=pn(e),n=o?.derived,i=R(e);if(!o||!n||!i)return;if(Uo.derivedResolves+=1,n.status=i.status,n.reason=i.reason,n.kind==="lens"){let r=pn(n.sourcePaneId);if(o.tabOrder.length>0||o.activeTabId!==null){let l=[...o.tabOrder];for(let s of l)if(ng(s),r)Sh(r,s);o.activeTabId=null}if(n.preset==="diff"&&i.status!=="ready")n.diff=null;A(e,i,t);return}if(C(e,i,t),n.resolved!==null&&bt(e)===null)n.resolved=null;if(i.path===null||i.path===n.resolved){v(e,i);return}n.resolved=i.path,Uo.derivedRetargets+=1;let a=t.openFileInPane(e,i.path);if(i.select===null)return;Promise.resolve(a).then(()=>{v(e,i)})}function v(e,t){let o=t.select,n=bt(e);if(!o||!n||t.path!==null&&n.documentPath!==t.path)return;let[i]=n.session.selection;if(i?.length===o.length&&i.every((a,r)=>a===o[r]))return;n.session.selection=[[...o]]}var c=new Map;function A(e,t,o){let n=t.diffPath,i=h(n),{rev:a}=u.git,r=c.get(e);if(n===null||!i||r?.path===n&&r.rev===a)return;c.set(e,{failed:!1,path:n,rev:a}),o.loadDiff(n,i.status).then((l)=>{let s=pn(e)?.derived;if(s?.kind!=="lens"||s.preset!=="diff"||c.get(e)?.path!==n)return;if(l)s.diff=l,s.diffRev=a;else c.set(e,{failed:!0,path:n,rev:a});f(e,o)}).catch((l)=>{console.error("loadDiff error:",l)})}var d=new Map;function C(e,t,o){let n=t.probePath;if(n===null||d.get(e)?.path===n)return;d.set(e,{exists:null,path:n}),o.fileExists(n).then((i)=>{let a=pn(e)?.derived;if(a?.kind!=="companion"||a.preset!=="locale"||d.get(e)?.path!==n)return;d.set(e,{exists:i,path:n}),f(e,o)}).catch((i)=>{console.error("fileExists error:",i)})}var p=new Map;function M(e,t){if(p.has(e))return;p.set(e,requestAnimationFrame(()=>{p.delete(e);try{f(e,t)}catch(o){console.error("applyDerivation error:",o)}}))}function XD(e,t){te(()=>{let o=pn(e),n=o?.derived;if(!n)return;o.activeTabId;let i=bt(n.sourcePaneId);if(n.kind==="lens"&&n.preset==="code")i?.session.ui.canvasMode;if(n.kind==="companion"&&n.preset==="component")i?.session.selection;if(n.kind==="companion"&&n.preset==="layout")u.layoutSelection,i?.doc.document?.$layout;M(e,t)})}function bw(e,t,o,n=null){let i=bt(t);if(!i)return"an open document";let a=T[e];if(a&&!i.capabilities.modes.includes(a))return`a document with a ${x[a]} view — this one declares none`;if(e==="code")return ka(i)==="source"?"a source pane that is not already showing Code":null;if(e==="diff")return h(i.documentPath)===null?"a file with changes against HEAD":null;if(e==="breakpoint")return aS(i).includes(o)?null:"a breakpoint this document declares — see Project Settings › Contexts";if(e==="layout")return hl(i.doc.document.$layout)===null?"a page with a layout — this one declares none":null;if(e==="locale"){let r=Ts();if(r===null||r.locales.length<2)return"a project that declares more than one locale — see Project Settings › Locales";if(i.documentPath===null)return"a document that has been saved";return n!==null&&r.locales.includes(n)?null:"a locale this project declares"}return null}function yb(e){let t=pn(e);return t&&t.activeTabId!==null&&t.derived===null?null:D}var D="an open document in a pane that is not itself derived";function O(e,t,o,n=null){if(e==="locale")return{kind:"companion",locale:n,preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};if(e==="layout"||e==="component")return{kind:"companion",preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};return{diff:null,kind:"lens",media:e==="breakpoint"?o:null,mode:e==="code"?"source":e==="diff"?"git-diff":"design",preset:e,reason:"",sourcePaneId:t,status:"loading",zoom:1}}function P(){return m.panes.find((e)=>KE(e.id)===null)??null}function KE(e){let t=pn(e);return t?.derived?.kind==="companion"&&t.activeTabId?null:y}var y="a derived pane showing a document of its own — Code, Diff and breakpoint views project "+"the document already open beside them";function QD(e){return[{args:Se({locale:Fe('BCP 47 tag for preset "locale". Ignored by every other preset.'),media:Fe('Breakpoint name for preset "breakpoint" — omit or leave empty for the base size. '+"Ignored by every other preset."),preset:pi(sS,"Which projection of this pane's document to show beside it.")},["preset"]),id:"pane.derive",title:"Show Beside This…",category:"View",level:"document",menus:["context/pane"],group:"5_pane",when:(t)=>t.document.open,enablement:()=>yb(qr().id)===null,requires:D,undo:"none",run:(t,o)=>{let n=qn("pane.derive",o,"preset",sS),i=ti("pane.derive",o,"media")??null,a=ti("pane.derive",o,"locale")??null,r=qr(),l=bw(n,r.id,i,a);if(l)throw RangeError(`command "pane.derive" argument "preset": "${n}" requires ${l}`);let s=o1(r.id);F(s.id,O(n,r.id,i,a));let E=[...s.tabOrder];for(let g of E)ng(g),Sh(r,g);f(s.id,e)}},{id:"pane.pin",title:"Keep This Document",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:()=>P()!==null,requires:y,undo:"none",run:()=>{let t=P();if(!t?.activeTabId)return;td(t.activeTabId),GE(t.id)}}]}
2
- export{sS,ju,aS,GE,XD,bw,yb,KE,QD};
1
+ import{De}from"./studio-mrb10hv3.js";import{bt,La,Jr,zo}from"./studio-m25ry0mf.js";import{Wt,td,ti,qn,Se,fi,Fe,g,Yo,pn,S1,cg,kh,id}from"./studio-ybkd5w8k.js";import{nr,Ls,gl,u}from"./studio-3kmqhwtt.js";import{zt}from"./studio-anc8067x.js";import{re}from"./studio-ft706q02.js";import{te}from"./studio-y3tjh2xb.js";var wS=["code","layout","component","diff","breakpoint","locale"],T={breakpoint:"design",code:"source",component:"design"},x={design:"Design",source:"Code"},k="Could not read this file's comparison against HEAD.";var Bu={breakpoint:"Same page at",code:"Code",component:"Component definition",diff:"Diff vs HEAD",layout:"Layout",locale:"Same page in"};function R(e){let t=pn(e)?.derived;if(!t)return null;let o=bt(t.sourcePaneId);if(!o)return{diffPath:null,kind:t.kind,media:null,mode:null,path:null,probePath:null,reason:"The pane this one follows has no document open.",select:null,status:"unavailable"};if(t.kind==="lens")return w(e,t,o);return S(e,t,o)}function w(e,t,o){let n={diffPath:null,kind:"lens",media:t.media,mode:t.mode,path:null,probePath:null,select:null};if(t.preset==="diff"){let i=o.documentPath;if(!m(i))return{...n,reason:"Nothing to compare — this file matches HEAD.",status:"unavailable"};if(t.diff?.filePath===i&&(t.diffRev===void 0||t.diffRev===u.git.rev))return{...n,reason:"",status:"ready"};if(c.get(e)?.failed&&c.get(e)?.path===i)return{...n,reason:k,status:"unavailable"};return{...n,diffPath:i,reason:"",status:"loading"}}if(t.preset==="code"&&La(o)==="source")return{...n,reason:"The pane this one follows is showing Code — one document has one editor.",status:"unavailable"};if(t.preset==="breakpoint"&&!xS(o).includes(t.media))return{...n,reason:`This document does not declare a "${t.media??"base"}" breakpoint.`,status:"unavailable"};return{...n,reason:"",status:"ready"}}function m(e){return u.git.status?.files.find((t)=>t.path===e&&(t.status==="M"||t.status==="A"||t.status==="U"))??null}function S(e,t,o){let n={diffPath:null,kind:"companion",media:null,mode:null};if(t.preset==="layout"){let a=u.layoutSelection,r=a?.layoutFile??gl(o.doc.document.$layout);return r===null?{...n,path:null,probePath:null,reason:"This page has no layout.",select:null,status:"unavailable"}:{...n,path:r,probePath:null,reason:"",select:a?a.layoutPath:null,status:"ready"}}if(t.preset==="locale"){let a=Ls(),r=o.documentPath===null||t.locale===null?null:td(o.documentPath,t.locale,a);if(r===null)return{...n,path:null,probePath:null,reason:"This document has no path in that locale.",select:null,status:"unavailable"};let l=d.get(e);if(l?.path!==r||l.exists===null)return{...n,path:null,probePath:r,reason:"",select:null,status:"loading"};if(!l.exists)return{...n,path:null,probePath:null,reason:`No ${Wt(t.locale)} copy of this document yet — `+"the Languages panel can create one.",select:null,status:"unavailable"};return{...n,path:r,probePath:null,reason:"",select:null,status:"ready"}}let i=_(o);if(i===null)return t.resolved===null?{...n,path:null,probePath:null,reason:"Select an element inside a component to see its definition.",select:null,status:"unavailable"}:{...n,path:null,probePath:null,reason:"",select:null,status:"ready"};return{...n,path:i,probePath:null,reason:"",select:null,status:"ready"}}function xS(e){let{sizeBreakpoints:t}=zo(nr(e.doc.document.$media));return[null,...t.map((o)=>o.name)]}function _(e){let[t]=e?.session.selection??[];if(!e||!t)return null;let o=e.doc.document,n=[...t];while(n){let i=re(o,n),a=i?De.find((r)=>r.tagName===i.tagName):null;if(a?.path)return a.path;n=zt(n)}return null}function F(e,t){if(t.sourcePaneId===e||!pn(t.sourcePaneId))throw RangeError(`pane "${e}" cannot derive from "${t.sourcePaneId}" — a derivation names `+"another pane that is in the grid");b(e,t)}function b(e,t){let o=pn(e);if(o)c.delete(e),d.delete(e),o.derived=t}function uT(e){b(e,null)}function f(e,t){let o=pn(e),n=o?.derived,i=R(e);if(!o||!n||!i)return;if(Jr.derivedResolves+=1,n.status=i.status,n.reason=i.reason,n.kind==="lens"){let r=pn(n.sourcePaneId);if(o.tabOrder.length>0||o.activeTabId!==null){let l=[...o.tabOrder];for(let s of l)if(cg(s),r)kh(r,s);o.activeTabId=null}if(n.preset==="diff"&&i.status!=="ready")n.diff=null;A(e,i,t);return}if(C(e,i,t),n.resolved!==null&&bt(e)===null)n.resolved=null;if(i.path===null||i.path===n.resolved){v(e,i);return}n.resolved=i.path,Jr.derivedRetargets+=1;let a=t.openFileInPane(e,i.path);if(i.select===null)return;Promise.resolve(a).then(()=>{v(e,i)})}function v(e,t){let o=t.select,n=bt(e);if(!o||!n||t.path!==null&&n.documentPath!==t.path)return;let[i]=n.session.selection;if(i?.length===o.length&&i.every((a,r)=>a===o[r]))return;n.session.selection=[[...o]]}var c=new Map;function A(e,t,o){let n=t.diffPath,i=m(n),{rev:a}=u.git,r=c.get(e);if(n===null||!i||r?.path===n&&r.rev===a)return;c.set(e,{failed:!1,path:n,rev:a}),o.loadDiff(n,i.status).then((l)=>{let s=pn(e)?.derived;if(s?.kind!=="lens"||s.preset!=="diff"||c.get(e)?.path!==n)return;if(l)s.diff=l,s.diffRev=a;else c.set(e,{failed:!0,path:n,rev:a});f(e,o)}).catch((l)=>{console.error("loadDiff error:",l)})}var d=new Map;function C(e,t,o){let n=t.probePath;if(n===null||d.get(e)?.path===n)return;d.set(e,{exists:null,path:n}),o.fileExists(n).then((i)=>{let a=pn(e)?.derived;if(a?.kind!=="companion"||a.preset!=="locale"||d.get(e)?.path!==n)return;d.set(e,{exists:i,path:n}),f(e,o)}).catch((i)=>{console.error("fileExists error:",i)})}var p=new Map;function M(e,t){if(p.has(e))return;p.set(e,requestAnimationFrame(()=>{p.delete(e);try{f(e,t)}catch(o){console.error("applyDerivation error:",o)}}))}function wD(e,t){te(()=>{let o=pn(e),n=o?.derived;if(!n)return;o.activeTabId;let i=bt(n.sourcePaneId);if(n.kind==="lens"&&n.preset==="code")i?.session.ui.canvasMode;if(n.kind==="companion"&&n.preset==="component")i?.session.selection;if(n.kind==="companion"&&n.preset==="layout")u.layoutSelection,i?.doc.document?.$layout;M(e,t)})}function $w(e,t,o,n=null){let i=bt(t);if(!i)return"an open document";let a=T[e];if(a&&!i.capabilities.modes.includes(a))return`a document with a ${x[a]} view — this one declares none`;if(e==="code")return La(i)==="source"?"a source pane that is not already showing Code":null;if(e==="diff")return m(i.documentPath)===null?"a file with changes against HEAD":null;if(e==="breakpoint")return xS(i).includes(o)?null:"a breakpoint this document declares — see Project Settings › Contexts";if(e==="layout")return gl(i.doc.document.$layout)===null?"a page with a layout — this one declares none":null;if(e==="locale"){let r=Ls();if(r===null||r.locales.length<2)return"a project that declares more than one locale — see Project Settings › Locales";if(i.documentPath===null)return"a document that has been saved";return n!==null&&r.locales.includes(n)?null:"a locale this project declares"}return null}function Tb(e){let t=pn(e);return t&&t.activeTabId!==null&&t.derived===null?null:D}var D="an open document in a pane that is not itself derived";function O(e,t,o,n=null){if(e==="locale")return{kind:"companion",locale:n,preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};if(e==="layout"||e==="component")return{kind:"companion",preset:e,reason:"",resolved:null,sourcePaneId:t,status:"loading"};return{diff:null,kind:"lens",media:e==="breakpoint"?o:null,mode:e==="code"?"source":e==="diff"?"git-diff":"design",preset:e,reason:"",sourcePaneId:t,status:"loading",zoom:1}}function P(){return g.panes.find((e)=>hT(e.id)===null)??null}function hT(e){let t=pn(e);return t?.derived?.kind==="companion"&&t.activeTabId?null:y}var y="a derived pane showing a document of its own — Code, Diff and breakpoint views project "+"the document already open beside them";function xD(e){return[{args:Se({locale:Fe('BCP 47 tag for preset "locale". Ignored by every other preset.'),media:Fe('Breakpoint name for preset "breakpoint" — omit or leave empty for the base size. '+"Ignored by every other preset."),preset:fi(wS,"Which projection of this pane's document to show beside it.")},["preset"]),id:"pane.derive",title:"Show Beside This…",category:"View",level:"document",menus:["context/pane"],group:"5_pane",when:(t)=>t.document.open,enablement:()=>Tb(Yo().id)===null,requires:D,undo:"none",run:(t,o)=>{let n=qn("pane.derive",o,"preset",wS),i=ti("pane.derive",o,"media")??null,a=ti("pane.derive",o,"locale")??null,r=Yo(),l=$w(n,r.id,i,a);if(l)throw RangeError(`command "pane.derive" argument "preset": "${n}" requires ${l}`);let s=S1(r.id);F(s.id,O(n,r.id,i,a));let E=[...s.tabOrder];for(let h of E)cg(h),kh(r,h);f(s.id,e)}},{id:"pane.pin",title:"Keep This Document",category:"View",level:"document",menus:["context/pane","palette"],group:"5_pane",enablement:()=>P()!==null,requires:y,undo:"none",run:()=>{let t=P();if(!t?.activeTabId)return;id(t.activeTabId),uT(t.id)}}]}
2
+ export{wS,Bu,xS,uT,wD,$w,Tb,hT,xD};
3
3
 
4
- //# debugId=02DD2968B046325064756E2164756E21
5
- //# sourceMappingURL=studio-pj216fmn.js.map
4
+ //# debugId=1E35C792562B0B9264756E2164756E21
5
+ //# sourceMappingURL=studio-gahswxp4.js.map
@@ -0,0 +1,5 @@
1
+ import{Z}from"./studio-mkjrjpr2.js";import{jt,zi,fn,co,ja}from"./studio-hf259xzd.js";import{w}from"./studio-5k9mfafh.js";import{jn,td,St,Bi,Se,$r,Fe,Yd,h}from"./studio-ybkd5w8k.js";import{Rr}from"./studio-52mzbxqm.js";import{km}from"./studio-dj8ctxey.js";import{hs,hy,Ia}from"./studio-jj9gf1qc.js";import{Ts,uO,c$}from"./studio-qcc5hsw2.js";import{xo,oh}from"./studio-m25ry0mf.js";import{Ow,Nb}from"./studio-0wa4wv4s.js";import{Ab}from"./studio-z89e6wpg.js";import{Kl}from"./studio-jbva4wxw.js";import{Js,ll,i$}from"./studio-pafmb06w.js";import{vr}from"./studio-213pyfxh.js";import{f}from"./studio-0z8kp4xk.js";import{ce}from"./studio-nhpg405j.js";var Lb=["page","collection","template","component","media","entry"],Nw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},qs="blank",Bc="article",TS="selection",Sm="copy",Dw=["title","image","richText","date","tags","number","link"],$S={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},bT=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function sl(e){return e.replace(/^\.\//,"")}function LS(e,n){let t=n.defaultLayout;if(e===qs||e==="")return t?!1:void 0;if(t&&sl(t)===sl(e))return;return e}function Vu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>sl(r.ref)===sl(n))?.ref??n;return e.layouts[0]?.ref??qs}function RS(e,n){let t=jn(n??"");if(t!==null){let r=e.layouts.find((o)=>sl(o.ref).replace(/\.json$/i,"").split("/").some((l)=>jn(l)===t));if(r)return r.ref}return Vu(e)}function I(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>hs(n)).filter((n)=>n!=="")}function D(e){let n={};for(let r of Dw){let o=$S[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function ED(e,n){let t=e?.properties??{};return Dw.filter((r)=>{let{key:o}=$S[r];return o===null?n:Object.hasOwn(t,o)})}function L(e,n){let t=i$(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function yT(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":oh(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function Cm(e,n){let t=n.i18n??null,r=jn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function Rb(e){return e.dir.includes(Rr)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Rr,n.toLowerCase())}function S(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return td(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===Sm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function H(e,n,t){let r=n.startFrom??Vu(t),o=r===Bc&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[hs(e)].filter((u)=>u!==""):I(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,m=Cm(n.locale,t),d=c===""?p(s,c):S(p(s,c),m,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let u={},C=LS(r===Bc?qs:r,t);if(C!==void 0)u.$layout=C;u.title=g,u.tagName="main",u.children=[{tagName:"h1",textContent:g}],y={doc:u,format:null}}let N=c===""?"":xo(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function B(e,n,t){let r=hs(e),o=n.fields??bT,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,m=c?.ext??".json",d=oh(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${m}`,g=D(o),y=structuredClone(g),N={format:c?.name??"json",schema:f(y)?y:{},source:l?`./${a}/${Rr}`:`./${a}`},u=L({ext:m,formatName:c?.name??null,schema:g},`First ${d}`),C=[],T,O="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Vu(t),A=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],k=[];for(let x of A){let P=S(`pages/${r}/[slug].json`,x,t),R=x===null||j!==Vu(t)?j:RS(t,x);T??=xo(P).urlPattern,C.push({body:{doc:yT(r,o,LS(R,t),t),format:null},path:P}),k.push(P)}O=k.length===1?`, and ${k[0]} at ${T}`:`, and a page in each language (${k.join(", ")})`}let E={config:{entry:N,name:r},content:u,dir:s,ext:m,extraWrites:C,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${O}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${O}.`};if(T!==void 0)E.route=T;return E}function K(e,n){let t=hs(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==qs)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function M(e,n,t){let r=Nb(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function z(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=hs(e),i=r?.ext??".json",l=Cm(n.locale,t),a=r!==null&&Rb(r)&&l===null,s=r===null?"content":Rb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,m=p(s,c);return{content:r?L(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:m,saved:c===""?"":`Saved as ${m} in ${r.name}.`}}function vT(e,n,t,r){switch(e){case"page":return H(n,t,r);case"collection":return B(n,t,r);case"template":return K(n,t);case"component":return M(n,t,r);case"entry":return z(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:Ia,ext:"",extraWrites:[],fileName:"",kind:e,path:Ia,saved:o===0?`Saved under ${Ia}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${Ia}/.`}}}}function U(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return hy(e.slice(t+1),"",{dir:r,taken:o??new Set})}function F(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function q(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of F(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function V(e){return hy(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function wT(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=V(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=q(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=Ow(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===TS&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===Sm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(Rb(a)&&Cm(t.locale,r)===null)return`Choose the language this ${oh(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=U(a,o);if(s!=="")return s}return""}function xT(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of F(e))n.add(r);return[...n]}function TD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function $D(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function IS(e){if(e.ext===".json")return null;return(e.def.format?zi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??co()?.name??null}async function G(e){let n=L({ext:e.ext,formatName:IS(e),schema:e.schema});if(n.format===null)return vr(n.doc,null);return ja(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function HF(e,n={}){let t=Js(e);if(!t)return w.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await jt().catch(()=>{});let r;try{r=await G(t)}catch(s){return w.error(`Could not prepare a new ${t.name} entry.`,{detail:Z(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Yd(o)?.name===t.name?o:t.dir;if(i.includes(Rr))return w.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (ce("8pf70854"),import("./files-8pf70854.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return km(t.name),await Kl(a),a}function v(){let e=h.value;return e&&ll(e.documentPath)?e:null}function Y(){return ll(v()?.documentPath??null)}function Q(){return[{args:Se({path:Fe("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{await Kl(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Se({hold:$r("True holds the open entry back from production; false releases it. Written to the one-field `hold` rule its collection declares.")}),category:"Document",id:"content.setHold",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry whose collection has a one-field hold rule",when:(e)=>e.document.open,enablement:()=>Ts(Y()?.def)!==null,undo:"document",run:(e,n)=>{let t=v();if(!t)throw Error("content.setHold: the active document is not a content entry");Ab(t,Bi("content.setHold",n,"hold"))},title:"Set Hold"},{args:Se({include:$r("True lists entries a `hold` rule matches alongside the rest.")}),category:"View",id:"content.setIncludeHeld",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{uO(Bi("content.setIncludeHeld",n,"include")),await c$()},title:"Include Held Entries"}]}function _T(e){e.registerAll(Q())}
2
+ export{Lb,Nw,qs,Bc,TS,Sm,Dw,$S,bT,sl,LS,Vu,RS,ED,yT,Cm,Rb,vT,wT,xT,TD,$D,IS,HF,_T};
3
+
4
+ //# debugId=DA4F330E127A874764756E2164756E21
5
+ //# sourceMappingURL=studio-gbqc12bk.js.map
@@ -0,0 +1,6 @@
1
+ import{p}from"./studio-1b79rpcb.js";import{x}from"./studio-anc8067x.js";import{df}from"./studio-hf259xzd.js";import{re}from"./studio-ft706q02.js";import{f,V_}from"./studio-0z8kp4xk.js";async function rx(e,o){return p().codeService(e,o)}async function bO(e){return p().locateFile(e)}var Xu=new Map;async function ox(e,o){let s=e.$prototype?x?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||s;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(Xu.has(r))return Xu.get(r);try{let n=p(),i=!s&&o.documentPath?`${location.origin}/${o.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return Xu.set(r,a),a}catch{return Xu.set(r,null),null}}function g$(e,o){let s=e.getModel();if(!s)return;let t=df();if(!t)return;let r=o.flatMap((n)=>{let i=n.labels?.[0];if(!i)return[];let{line:a,column:c,length:u}=i.span;return[{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:c+(u||1),endLineNumber:a,message:n.message+(n.help?`
2
+ ${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function yO(e,o){let s=(t)=>{if(!f(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return V_(r)};if(e.type==="def"){let t=e.defName?s(o?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!o||!e.path)return["state","event"];let t=re(o,e.path),r=t&&e.eventKey?s(t[e.eventKey]):null;if(r)return r}return["state","event"]}
3
+ export{rx,bO,Xu,ox,g$,yO};
4
+
5
+ //# debugId=33924B4B6B8FD63D64756E2164756E21
6
+ //# sourceMappingURL=studio-gxphbetb.js.map