@jxsuite/studio 8.1.0 → 10.0.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 (266) hide show
  1. package/dist/chunks/{2020-dg097k3e.js → 2020-j56903f1.js} +3 -3
  2. package/dist/chunks/adapter-wc5zvg9a.js +4 -0
  3. package/dist/chunks/add-new-flow-snx1s4b0.js +4 -0
  4. package/dist/chunks/cf-account-picker-xyqw0jex.js +4 -0
  5. package/dist/chunks/cf-settings-hp1pjm0n.js +4 -0
  6. package/dist/chunks/color-04361ttk.js +4 -0
  7. package/dist/chunks/{color-area-vh9cew51.js → color-area-h8dbasp1.js} +2 -2
  8. package/dist/chunks/{color-field-e78f16bs.js → color-field-qv5r2b16.js} +3 -3
  9. package/dist/chunks/{color-slider-fg4yhvk6.js → color-slider-nz2mrzky.js} +2 -2
  10. package/dist/chunks/components-nkwphrx3.js +4 -0
  11. package/dist/chunks/content-source-6a253wmk.js +4 -0
  12. package/dist/chunks/{convert-to-repeater-grnmea6c.js → convert-to-repeater-fhdwyg14.js} +3 -3
  13. package/dist/chunks/editor-wqrc68ca.js +4 -0
  14. package/dist/chunks/entry-commands-nef0wrmp.js +4 -0
  15. package/dist/chunks/{extension-sections-rp7fkega.js → extension-sections-8ez2rrk8.js} +3 -3
  16. package/dist/chunks/file-ops-y3w71k1n.js +4 -0
  17. package/dist/chunks/files-de90apn9.js +4 -0
  18. package/dist/chunks/format-host-zfjz4rzm.js +4 -0
  19. package/dist/chunks/fs-events-77c0mr0x.js +4 -0
  20. package/dist/chunks/grid-open-4n4fjfpf.js +4 -0
  21. package/dist/chunks/{grid-view-x26rfpz1.js → grid-view-ka55z38f.js} +10 -10
  22. package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
  23. package/dist/chunks/{iframe-entry-02wzcyvy.js → iframe-entry-btck0e9s.js} +4 -4
  24. package/dist/chunks/iframe-host-na2mywz4.js +4 -0
  25. package/dist/chunks/index-ewmgdb7c.js +4 -0
  26. package/dist/chunks/{index-203h71wy.js → index-qb98xhse.js} +3 -3
  27. package/dist/chunks/{javascript-ww5pv5ae.js → javascript-ces13wny.js} +2 -2
  28. package/dist/chunks/{jsonMode-vwbdwwq3.js → jsonMode-6md16d4v.js} +6 -6
  29. package/dist/chunks/jx-validate-b309c020.js +4 -0
  30. package/dist/chunks/layers-8rn8y6qv.js +4 -0
  31. package/dist/chunks/layers-panel-eyah7h9z.js +4 -0
  32. package/dist/chunks/lit-html-wyqw04y2.js +4 -0
  33. package/dist/chunks/media-library-gs3np47y.js +4 -0
  34. package/dist/chunks/media-picker-tt7dk4tb.js +4 -0
  35. package/dist/chunks/{monaco-binding-63tqze27.js → monaco-binding-p8j80s4w.js} +3 -3
  36. package/dist/chunks/monaco-buffer-wsf6cmnq.js +4 -0
  37. package/dist/chunks/{monaco-setup-zyyynnj8.js → monaco-setup-wasktzfg.js} +3 -3
  38. package/dist/chunks/notify-qwst108r.js +4 -0
  39. package/dist/chunks/parse-n8dfxnqf.js +4 -0
  40. package/dist/chunks/platform-c16mqvmp.js +4 -0
  41. package/dist/chunks/publish-panel-d34bhvwj.js +4 -0
  42. package/dist/chunks/{publish-quick-ajzdhhs6.js → publish-quick-vr695j26.js} +3 -3
  43. package/dist/chunks/publish-workspace-2yr60mt4.js +4 -0
  44. package/dist/chunks/quick-search-e6xsdv0d.js +4 -0
  45. package/dist/chunks/references-gsj6trdv.js +4 -0
  46. package/dist/chunks/right-panel-33jv1knc.js +4 -0
  47. package/dist/chunks/source-control-bj9bejjv.js +4 -0
  48. package/dist/chunks/studio-03mqh8ax.js +5 -0
  49. package/dist/chunks/{studio-957jg8g3.js → studio-06j4en5h.js} +4 -4
  50. package/dist/chunks/studio-0ydxv2mr.js +7 -0
  51. package/dist/chunks/{studio-v2ek69cb.js → studio-1e8dw2w2.js} +4 -4
  52. package/dist/chunks/studio-2hsqbq7b.js +7 -0
  53. package/dist/chunks/studio-2j86y34y.js +6 -0
  54. package/dist/chunks/studio-2ks6ka4g.js +5 -0
  55. package/dist/chunks/studio-34jrz12k.js +5 -0
  56. package/dist/chunks/{studio-1meqbxns.js → studio-35vrtpdq.js} +4 -4
  57. package/dist/chunks/studio-38g0jdz7.js +5 -0
  58. package/dist/chunks/{studio-25a5by3h.js → studio-396srjbk.js} +4 -4
  59. package/dist/chunks/{studio-zm7dnr9g.js → studio-3c8pp7pb.js} +4 -4
  60. package/dist/chunks/{studio-x3ge4rts.js → studio-3v5cagy9.js} +4 -4
  61. package/dist/chunks/studio-3w35qvay.js +5 -0
  62. package/dist/chunks/studio-3zge48z4.js +7 -0
  63. package/dist/chunks/studio-45gyxpcq.js +5 -0
  64. package/dist/chunks/{studio-hw60n5dh.js → studio-4kzbrr5t.js} +3 -3
  65. package/dist/chunks/{studio-533py3yy.js → studio-5tzgq6fx.js} +4 -4
  66. package/dist/chunks/studio-5wzdy1jc.js +16 -0
  67. package/dist/chunks/studio-732mw0g8.js +5 -0
  68. package/dist/chunks/{studio-3q6n9qvq.js → studio-771k2n12.js} +4 -4
  69. package/dist/chunks/{studio-z42kysg7.js → studio-7dzyz9n8.js} +137 -137
  70. package/dist/chunks/{studio-fqs1a22a.js → studio-7xag4na8.js} +4 -4
  71. package/dist/chunks/{studio-jqrg9xxg.js → studio-881z1xrx.js} +4 -4
  72. package/dist/chunks/studio-88bmt9rh.js +5 -0
  73. package/dist/chunks/{studio-8nyw10dp.js → studio-9b7177jq.js} +4 -4
  74. package/dist/chunks/{studio-nm9qev4p.js → studio-9cxmp61c.js} +5 -5
  75. package/dist/chunks/{studio-4dsdnan2.js → studio-9dz76yqc.js} +5 -5
  76. package/dist/chunks/{studio-a6x058ew.js → studio-agyvzfm4.js} +4 -4
  77. package/dist/chunks/{studio-2b8443ms.js → studio-ajw4k8hp.js} +3 -3
  78. package/dist/chunks/studio-c1pxszat.js +5 -0
  79. package/dist/chunks/studio-cpkamjdn.js +14 -0
  80. package/dist/chunks/studio-d038kqbs.js +5 -0
  81. package/dist/chunks/studio-d83m0wyq.js +5 -0
  82. package/dist/chunks/studio-dbxv7w4s.js +5 -0
  83. package/dist/chunks/studio-de1s2x9v.js +5 -0
  84. package/dist/chunks/{studio-94ppxeqy.js → studio-dx73md4n.js} +8 -8
  85. package/dist/chunks/studio-ekgtrndg.js +5 -0
  86. package/dist/chunks/studio-epenqmvk.js +7 -0
  87. package/dist/chunks/studio-et2q4s8n.js +5 -0
  88. package/dist/chunks/{studio-txkx6586.js → studio-ewarnzm4.js} +7 -7
  89. package/dist/chunks/{studio-bf0rgyf7.js → studio-fy7jzj9j.js} +4 -4
  90. package/dist/chunks/{studio-332hesdk.js → studio-gr36vnte.js} +4 -4
  91. package/dist/chunks/{studio-rdnezzkd.js → studio-gwrhcrss.js} +5 -5
  92. package/dist/chunks/{studio-9wyqyfqy.js → studio-h310mbqm.js} +4 -4
  93. package/dist/chunks/{studio-zht0x0v3.js → studio-h5tpz5ke.js} +4 -4
  94. package/dist/chunks/studio-h7weqf2q.js +5 -0
  95. package/dist/chunks/{studio-1gdfsr49.js → studio-hcsba201.js} +7 -7
  96. package/dist/chunks/studio-hwejq03c.js +5 -0
  97. package/dist/chunks/{studio-wcakp5bt.js → studio-hy4ye0dx.js} +7 -7
  98. package/dist/chunks/{studio-02phtmqn.js → studio-jttyqrmh.js} +4 -4
  99. package/dist/chunks/{studio-j5jqvyn3.js → studio-jw0q5j6k.js} +4 -4
  100. package/dist/chunks/studio-k3a8rp3d.js +5 -0
  101. package/dist/chunks/{studio-hnx1h1pr.js → studio-k3bcy02e.js} +4 -4
  102. package/dist/chunks/studio-m48v13s3.js +4 -0
  103. package/dist/chunks/{studio-bqgs90r8.js → studio-ndskgqef.js} +4 -4
  104. package/dist/chunks/studio-p1n2xjda.js +5 -0
  105. package/dist/chunks/studio-pgm83a2f.js +6 -0
  106. package/dist/chunks/studio-pqqq6v85.js +5 -0
  107. package/dist/chunks/studio-psh8mwnw.js +4 -0
  108. package/dist/chunks/{studio-cpdzrdgp.js → studio-r17asgs0.js} +4 -4
  109. package/dist/chunks/{studio-6vrxzkba.js → studio-ry81j4q1.js} +4 -4
  110. package/dist/chunks/studio-rzg8hnkf.js +5 -0
  111. package/dist/chunks/{studio-nsv7g1qn.js → studio-s0fg2wav.js} +4 -4
  112. package/dist/chunks/{studio-v0gsjav0.js → studio-tj2s0tks.js} +4 -4
  113. package/dist/chunks/studio-tyw7tk0x.js +5 -0
  114. package/dist/chunks/studio-v9ywz2se.js +6 -0
  115. package/dist/chunks/{studio-dmn7gpba.js → studio-vswcpzk7.js} +5 -5
  116. package/dist/chunks/studio-vzgmyt0v.js +5 -0
  117. package/dist/chunks/{studio-2dtc90zs.js → studio-wxdcd42g.js} +6 -6
  118. package/dist/chunks/{studio-c5dj3dzk.js → studio-wxhy1yh7.js} +4 -4
  119. package/dist/chunks/studio-x08a3m0a.js +5 -0
  120. package/dist/chunks/studio-x3mjr5cc.js +5 -0
  121. package/dist/chunks/{studio-xddgbwhe.js → studio-x97ay0v4.js} +4 -4
  122. package/dist/chunks/{studio-mmqr9awv.js → studio-xdpz9rpe.js} +33 -33
  123. package/dist/chunks/studio-xh683qzy.js +5 -0
  124. package/dist/chunks/{studio-hxq1ebp0.js → studio-xkxetm65.js} +6 -6
  125. package/dist/chunks/{studio-73wz63nn.js → studio-y26hx9re.js} +4 -4
  126. package/dist/chunks/{studio-kdseew9m.js → studio-yg3djpnm.js} +4 -4
  127. package/dist/chunks/studio-yx8hzqja.js +5 -0
  128. package/dist/chunks/studio-zg16eeq1.js +5 -0
  129. package/dist/chunks/studio-zgx7svjd.js +9 -0
  130. package/dist/chunks/studio-zkq3r91p.js +5 -0
  131. package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
  132. package/dist/chunks/toast-w11qpkyz.js +4 -0
  133. package/dist/chunks/{tsMode-vra2hh7y.js → tsMode-h6tkz0ea.js} +5 -5
  134. package/dist/chunks/workspace-home-zkkrxq3r.js +4 -0
  135. package/dist/chunks/workspace-tdqqjqaa.js +4 -0
  136. package/dist/chunks/{ws-client-72x5n99j.js → ws-client-e951my95.js} +3 -3
  137. package/dist/iframe-entry.js +13 -13
  138. package/dist/manifest.json +77 -77
  139. package/dist/studio.js +91 -92
  140. package/package.json +11 -12
  141. package/src/canvas/iframe-editable-root.ts +32 -2
  142. package/src/collab/collab-session.ts +6 -2
  143. package/src/commands/context.ts +4 -0
  144. package/src/commands/defaults.ts +2 -0
  145. package/src/commands/live-context.ts +2 -0
  146. package/src/files/files.ts +6 -3
  147. package/src/format/format-host.ts +1 -1
  148. package/src/github/github-auth-status.ts +2 -2
  149. package/src/media/media-library.ts +73 -3
  150. package/src/new-project/new-project-modal.ts +1 -4
  151. package/src/packages/ensure-deps.ts +5 -5
  152. package/src/packages/pull-package-sync.ts +4 -4
  153. package/src/panels/activity-panel.ts +1 -1
  154. package/src/panels/ai-panel.ts +27 -34
  155. package/src/platform.ts +20 -0
  156. package/src/platforms/cloud.ts +48 -34
  157. package/src/platforms/devserver.ts +2 -120
  158. package/src/services/ai-ask.ts +29 -171
  159. package/src/services/ai-command-tools.ts +40 -50
  160. package/src/services/ai-import-tools.ts +4 -5
  161. package/src/services/ai-project-tools.ts +13 -3
  162. package/src/services/ai-tools.ts +26 -564
  163. package/src/services/ai-writes.ts +84 -2
  164. package/src/services/document-assistant.ts +29 -58
  165. package/src/services/harness/assistant-tools.ts +68 -0
  166. package/src/services/harness/interaction-store.ts +118 -0
  167. package/src/services/harness/studio-documents.ts +105 -0
  168. package/src/services/harness/turn-hooks.ts +1 -6
  169. package/src/services/project-adoption.ts +8 -16
  170. package/src/services/tool-executor.ts +25 -22
  171. package/src/settings/extension-commands.ts +1 -1
  172. package/src/settings/extension-rows.ts +1 -6
  173. package/src/settings/extensions-section.ts +3 -6
  174. package/src/state.ts +3 -13
  175. package/src/surfaces/block-action-bar.json +1 -3
  176. package/src/surfaces/files-panel.json +12 -0
  177. package/src/surfaces/files-panel.ts +5 -2
  178. package/src/surfaces/media-library.json +35 -0
  179. package/src/surfaces/media-library.ts +2 -0
  180. package/src/surfaces/menu.ts +62 -1
  181. package/src/surfaces/settings-packages.ts +1 -1
  182. package/src/surfaces/welcome.ts +4 -1
  183. package/src/tabs/selection.ts +14 -109
  184. package/src/tabs/tab.ts +10 -1
  185. package/src/tabs/transact.ts +316 -124
  186. package/src/types.ts +23 -16
  187. package/src/ui/layers.ts +1 -1
  188. package/src/ui/progress-modal.ts +3 -3
  189. package/dist/chunks/adapter-tck81zft.js +0 -4
  190. package/dist/chunks/add-new-flow-a1w0bnm6.js +0 -4
  191. package/dist/chunks/cf-account-picker-ce3kp3x1.js +0 -4
  192. package/dist/chunks/cf-settings-7ye6x7g2.js +0 -4
  193. package/dist/chunks/color-4gj49xq6.js +0 -4
  194. package/dist/chunks/components-qce0v93f.js +0 -4
  195. package/dist/chunks/content-source-jjx8kgzr.js +0 -4
  196. package/dist/chunks/editor-bkja5dbv.js +0 -4
  197. package/dist/chunks/entry-commands-1wh0btvg.js +0 -4
  198. package/dist/chunks/file-ops-6pe4z7an.js +0 -4
  199. package/dist/chunks/files-ybpp3j38.js +0 -4
  200. package/dist/chunks/format-host-3mtbhxk1.js +0 -4
  201. package/dist/chunks/fs-events-xfanfxds.js +0 -4
  202. package/dist/chunks/grid-open-dg5qmnaj.js +0 -4
  203. package/dist/chunks/iframe-host-j2bk2xkc.js +0 -4
  204. package/dist/chunks/index-fkrm7pdk.js +0 -4
  205. package/dist/chunks/jx-validate-w7v32f6a.js +0 -4
  206. package/dist/chunks/layers-g7j732cm.js +0 -4
  207. package/dist/chunks/layers-panel-gjrsxcck.js +0 -4
  208. package/dist/chunks/lit-html-jdfz9rhc.js +0 -4
  209. package/dist/chunks/media-library-9j0v4wmk.js +0 -4
  210. package/dist/chunks/media-picker-cpyyt2m0.js +0 -4
  211. package/dist/chunks/monaco-buffer-9wcme176.js +0 -4
  212. package/dist/chunks/notify-rahnnnv4.js +0 -4
  213. package/dist/chunks/parse-v77xtwv7.js +0 -4
  214. package/dist/chunks/platform-b2aqv7v5.js +0 -4
  215. package/dist/chunks/publish-panel-4yk2461b.js +0 -4
  216. package/dist/chunks/publish-workspace-mxestzcf.js +0 -4
  217. package/dist/chunks/quick-search-9g6z65b0.js +0 -4
  218. package/dist/chunks/references-c26enpxs.js +0 -4
  219. package/dist/chunks/right-panel-9d0e0yg7.js +0 -4
  220. package/dist/chunks/source-control-xyn3a8ds.js +0 -4
  221. package/dist/chunks/studio-0khd0xdw.js +0 -5
  222. package/dist/chunks/studio-1fvzq9vs.js +0 -5
  223. package/dist/chunks/studio-1yhz0s8p.js +0 -5
  224. package/dist/chunks/studio-2c2mjyzj.js +0 -6
  225. package/dist/chunks/studio-3pndhat0.js +0 -9
  226. package/dist/chunks/studio-4fjqdzrb.js +0 -6
  227. package/dist/chunks/studio-5abge3wy.js +0 -5
  228. package/dist/chunks/studio-74nzv280.js +0 -5
  229. package/dist/chunks/studio-7cg75gtj.js +0 -14
  230. package/dist/chunks/studio-89cwmnae.js +0 -5
  231. package/dist/chunks/studio-8m1t83kn.js +0 -7
  232. package/dist/chunks/studio-a3evp7f6.js +0 -6
  233. package/dist/chunks/studio-ana67wax.js +0 -5
  234. package/dist/chunks/studio-b4xhpcwy.js +0 -4
  235. package/dist/chunks/studio-c4rcaftm.js +0 -5
  236. package/dist/chunks/studio-cgjt1zce.js +0 -5
  237. package/dist/chunks/studio-cq87hree.js +0 -5
  238. package/dist/chunks/studio-d140sy8e.js +0 -5
  239. package/dist/chunks/studio-e1g64q43.js +0 -5
  240. package/dist/chunks/studio-e8pzjjhf.js +0 -5
  241. package/dist/chunks/studio-f8kz3krj.js +0 -7
  242. package/dist/chunks/studio-fw3jp9m7.js +0 -5
  243. package/dist/chunks/studio-g6ysm05p.js +0 -7
  244. package/dist/chunks/studio-gmhd0j3f.js +0 -5
  245. package/dist/chunks/studio-gqpty626.js +0 -5
  246. package/dist/chunks/studio-grp684wx.js +0 -5
  247. package/dist/chunks/studio-h98520qr.js +0 -5
  248. package/dist/chunks/studio-hvxt8z79.js +0 -5
  249. package/dist/chunks/studio-j4e627w1.js +0 -5
  250. package/dist/chunks/studio-kt2j51sa.js +0 -5
  251. package/dist/chunks/studio-m4w6sygj.js +0 -16
  252. package/dist/chunks/studio-nqxqf8p2.js +0 -4
  253. package/dist/chunks/studio-p89w12s2.js +0 -7
  254. package/dist/chunks/studio-pbagym4j.js +0 -5
  255. package/dist/chunks/studio-pr23qhrw.js +0 -5
  256. package/dist/chunks/studio-r4ya3sb2.js +0 -5
  257. package/dist/chunks/studio-rm9m3z60.js +0 -5
  258. package/dist/chunks/studio-tpmnbgmt.js +0 -5
  259. package/dist/chunks/studio-ttxhq5yt.js +0 -5
  260. package/dist/chunks/studio-y1x65h5r.js +0 -5
  261. package/dist/chunks/studio-zf188hnd.js +0 -5
  262. package/dist/chunks/toast-1gv0h53h.js +0 -4
  263. package/dist/chunks/workspace-3nt93k48.js +0 -4
  264. package/dist/chunks/workspace-home-zbgyqqws.js +0 -4
  265. package/src/services/directory-picker.ts +0 -187
  266. package/src/services/gated-registry.ts +0 -77
@@ -0,0 +1,5 @@
1
+ import{St,Qn,Ce,We,bh,m,_i,jt}from"./studio-vzgmyt0v.js";import{g}from"./studio-4kzbrr5t.js";import{p}from"./studio-03mqh8ax.js";import{Ht,fn}from"./studio-3w35qvay.js";import{T,R,Ys,tt}from"./studio-jttyqrmh.js";import{Ta,Hd}from"./studio-h310mbqm.js";import{Id,eT,rS,nT,iT}from"./studio-wxdcd42g.js";import{xb,ls,Bl,Tw,Lw,vp,Qo,yp}from"./studio-c1pxszat.js";import{S}from"./studio-45gyxpcq.js";import{n,Z,Q,lf}from"./studio-zkq3r91p.js";var j={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGridOpen",$description:"Every grid-able source a project has, grouped by where it comes from: the project's own pages and content collections first, then each connection's tables. It is the ISLAND of a confirm dialog rather than a dialog of its own — `ui/layers.ts`'s dialog owns the headline, the cancel button, modality and focus, and this document is only the list — because a second answer to \"what is a dialog\" is a defect (studio-ui-guidelines.md §12.5). Group headings are why it is not the kit menu: a menu row can carry a divider above it and cannot carry a name for the run it opens.",tagName:"div",attributes:{part:"sources"},style:{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",minWidth:"280px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="group-title"]':{margin:"0",fontSize:"var(--jx-text-xs)",fontWeight:"600",textTransform:"uppercase",letterSpacing:"0.04em",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"1px",marginTop:"var(--jx-space-1)"},'& [part="source"]':{textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-2) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer"},'& [part="source"]:hover':{background:"var(--bg-hover)"},'& [part="source"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="group-empty"]':{margin:"0",padding:"var(--jx-space-2)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"}},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/key"},map:{$description:"One origin of grid-able sources. A connection with no tables says why it has none instead of drawing an empty box — an author who has not pushed a schema yet is exactly the reader who needs the sentence.",tagName:"section",attributes:{part:"group","data-group":"${$map.item.key}"},children:[{tagName:"h3",attributes:{part:"group-title"},textContent:"${$map.item.title}"},{tagName:"div",attributes:{part:"rows"},$switch:{$ref:"$map/item/state"},cases:{listed:{tagName:"div",attributes:{part:"rows-list",role:"none"},style:{display:"contents"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/id"},map:{tagName:"button",attributes:{part:"source",type:"button","data-source":"${$map.item.id}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/id"}]}]},textContent:"${$map.item.label}"}}]},empty:{tagName:"p",attributes:{part:"group-empty"},textContent:"${$map.item.emptyMessage}"}}}]}}]};T("grid-open",j);function I(e,r,t){let o=g({groups:r,open:t}),i=null,s=!1,c=R("grid-open",o,e).then((y)=>{let a=y.root;if(s)return y.dispose(),a;return i=y,a});return{dispose(){s=!0,i?.dispose(),i=null},ready:c}}function x(){try{return p()}catch{return null}}function nS(){return Q(x()?.dataRows)}async function K(){let e=x();if(!Q(e?.dataConnections))return null;return e.dataConnections()}async function HD(e){let r=x();if(!Q(r?.dataConnectionTest))return{error:"Connection tests are not supported by this backend",ok:!1};try{return await r.dataConnectionTest(e)}catch(t){return{error:t instanceof Error?t.message:String(t),ok:!1}}}async function YE(e){let r=x();if(!Q(r?.dataPush))return{applied:!1,errors:["Schema push is not supported by this backend"],plan:[]};try{return await r.dataPush(e)}catch(t){return{applied:!1,errors:[t instanceof Error?t.message:String(t)],plan:[]}}}function k(e){let t=x()?.[e];if(t===void 0)throw Error(`The ${String(e)} surface is not supported by this backend`);return t}function v(e){return k("dataRows")(e)}function M(e){return k("dataInsertRow")(e)}function E(e){return k("dataUpdateRow")(e)}function O(e){return k("dataDeleteRow")(e)}function BD(e,r,t){let o=(c)=>c.replaceAll(/([a-z0-9])([A-Z])/g,"$1_$2").replaceAll(/[^A-Za-z0-9]+/g,"_").replaceAll(/^_+|_+$/g,"").toUpperCase(),s=[r??e,t.replace(/Env$/,"")].flatMap((c)=>{let y=o(c);return y?[y]:[]}).join("_")||"SECRET";return/^\d/.test(s)?`JX_${s}`:s}var H=["id","sku","slug","Slug"];function L(e){let r=new Set;return e.map((t,o)=>{let i=t.trim()===""?`column${o+1}`:t;if(r.has(i))i=`${i}__${o+1}`;return r.add(i),i})}function J(e,r){for(let t of H){let o=e.indexOf(t);if(o===-1)continue;let i=r.rows.map((s)=>s[o]??"");if(i.every((s)=>s!=="")&&new Set(i).size===i.length)return t}return null}function A(e,r){let t=Id(e),o=L(t.headers),i=J(o,t),s=i?o.indexOf(i):-1,c=t.rows.map((d,u)=>s===-1?String(u):d[s]),y=new Map(c.map((d,u)=>[d,u])),a=bh(r,S?.projectConfig),l=a?.schema.properties??{},b=t.rows.slice(0,50).map((d)=>{let u={};for(let[C,G]of o.entries())u[G]=d[C]??"";return u}),f=new Map(Lw(b).map((d)=>[d.field,d])),w=new Map(Tw(a?.schema,{idField:i??void 0}).map((d)=>[d.field,d]));return{columns:o.map((d,u)=>{let G=(d in l?w.get(d):void 0)??f.get(d)??{editable:!0,field:d,kind:"string",title:t.headers[u]||d};return{...G,pk:d===i,title:t.headers[u]?.trim()||G.title}}),doc:t,fields:o,keys:c,keyToIndex:y,loadText:e}}function z(e,r){let t={},o=e.doc.rows[r]??[];for(let[i,s]of e.fields.entries()){let c=e.columns[i],y=o[i]??"";t[s]=c.kind==="string"||c.kind==="text"||c.kind==="readonly"?y:vp(y,c)}return t}function F(e,r){let t=e.doc.rows.map((s)=>[...s]),o=(s)=>e.fields.indexOf(s);for(let s of r.cells){let c=e.keyToIndex.get(s.rowKey),y=o(s.field);if(c===void 0||y===-1)continue;t[c][y]=Qo(s.value)}for(let s of r.inserts){let c=e.fields.map((y)=>Qo(s.cells[y]??null));t.push(c)}let i=r.deletes.map((s)=>e.keyToIndex.get(s.rowKey)).filter((s)=>s!==void 0).toSorted((s,c)=>c-s);for(let s of i)t.splice(s,1);return{...e.doc,rows:t}}function _(e,r){return{cells:e.cells.map((t)=>({field:t.field,rowKey:t.rowKey,...r})),deletes:e.deletes.map((t)=>({rowKey:t.rowKey,...r})),inserts:e.inserts.map((t)=>({error:r.error,ok:r.ok,tempKey:t.tempKey}))}}function iS(e){let r=null,t=(o=!1)=>{if(!o&&r)return r;return r=p().readFile(e).then((i)=>A(i,e)),r};return{backingPaths:()=>new Map([[e,"*"]]),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return(await t()).columns},async commit(o){let i=await t(),s=p(),c=null;try{c=await s.readFile(e)}catch{c=null}if(c!==i.loadText&&!Hd(e))return _(o,{error:"File changed on disk — refresh to reload",ok:!1,stale:!0});let y=F(i,o),a=eT(y);return Ta(e),await s.writeFile(e,a),r=Promise.resolve(A(a,e)),_(o,{ok:!0})},id:e,label:e.split("/").pop()??e,async refresh(){await t(!0)},async rows(){let o=await t(),i=o.doc.rows.map((s,c)=>({cells:z(o,c),key:o.keys[c]}));return{rows:i,total:i.length}},async serializeForSource(o){let i=await t();return eT(F(i,o))}}}var U=50;function q(e){let r=e.toLowerCase();if(/(int|real|floa|doub|num|dec)/.test(r))return"number";if(r.includes("bool"))return"boolean";if(/(timestamp|datetime|date)/.test(r))return"date";return"string"}function W(e){return!e.pk&&e.name!=="created_at"&&e.name!=="updated_at"}function X(e){if(e===void 0)return null;if(lf(e))return e;return JSON.stringify(e)}function N(e,r){let t=[],o="id",i=new Map,s=(a)=>{if(a.length>0)t=a,o=a.find((l)=>l.pk)?.name??"id"},c=(a)=>{let l={table:r};if(e)l.connection=e;if(l.limit=a?.limit??U,l.offset=a?.offset??0,a?.orderBy)l.dir=a.dir??"asc",l.orderBy=a.orderBy;return l},y=(a,l)=>{let b=a[o];if(n(b)||Z(b))return i.set(String(b),b),String(b);return`row-${l}`};return{capabilities:{delete:!0,insert:!0,remotePaging:!0,remoteSort:!0},async columns(){if(t.length===0){let a=await v(c({limit:1,offset:0}));s(a.columns)}return t.map((a)=>{let l=W(a)?q(a.type):"readonly";return{editable:l!=="readonly",field:a.name,kind:l,pk:a.pk===!0,title:a.name,widthHint:a.pk?80:void 0}})},async commit(a){let l={cells:[],deletes:[],inserts:[]},b=new Map;for(let f of a.cells){let w=b.get(f.rowKey)??[];w.push({field:f.field,value:f.value}),b.set(f.rowKey,w)}for(let[f,w]of b){let h=i.get(f),d=(u,C)=>{for(let G of w)l.cells.push({error:C,field:G.field,ok:u,rowKey:f})};if(h===void 0){d(!1,"Row has no primary key — refresh the grid");continue}try{let u={};for(let G of w)u[G.field]=G.value;let C={pk:h,set:u,table:r};if(e)C.connection=e;await E(C),d(!0)}catch(u){d(!1,u instanceof Error?u.message:String(u))}}for(let f of a.inserts)try{let w={};for(let[G,P]of Object.entries(f.cells))if(P!==null)w[G]=P;let h={table:r,values:w};if(e)h.connection=e;let{row:d}=await M(h),u=d[o],C;if(n(u)||Z(u))C=String(u),i.set(C,u);l.inserts.push({newKey:C,ok:!0,tempKey:f.tempKey})}catch(w){l.inserts.push({error:w instanceof Error?w.message:String(w),ok:!1,tempKey:f.tempKey})}for(let f of a.deletes){let w=i.get(f.rowKey);if(w===void 0){l.deletes.push({error:"Row has no primary key — refresh the grid",ok:!1,rowKey:f.rowKey});continue}try{let h={pk:w,table:r};if(e)h.connection=e;await O(h),l.deletes.push({ok:!0,rowKey:f.rowKey})}catch(h){l.deletes.push({error:h instanceof Error?h.message:String(h),ok:!1,rowKey:f.rowKey})}}return l},id:ls({connection:e??"default",kind:"data",table:r}),label:r,async refresh(){t=[],i.clear()},async rows(a){let l=await v(c(a));return s(l.columns),{rows:l.rows.map((f,w)=>{let h=y(f,w),d={};for(let u of t)d[u.name]=X(f[u.name]);return{cells:d,key:h}}),total:l.total}}}}async function ZE(e,r={}){let t=m.tabs.get(e);if(t)return jt(e,{focus:r.focus!==!1}),t;try{await Ht()}catch{}let o=iS(e),i=_i({capabilities:{modes:["grid","source"]},document:structuredClone(xb),documentPath:e,id:e,sourceFormat:fn(e)?.name??null,...r.paneId!==void 0&&{paneId:r.paneId},...r.preview===!0&&{preview:!0},...r.focus===!1&&{focus:!1}});return yp(i,o).load(),i}function D(e){let r=_i({capabilities:{modes:["grid"]},document:structuredClone(xb),documentPath:null,id:e.id});return yp(r,e).load(),r}function zD(e){let r=ls({kind:"collection",name:e}),t=m.tabs.get(r);if(t)return jt(r),t;return D(nT(e))}function oS(){let e=ls({kind:"pages"}),r=m.tabs.get(e);if(r)return jt(e),r;return D(iT())}function V(e,r){let t=ls({connection:e??"default",kind:"data",table:r}),o=m.tabs.get(t);if(o)return jt(t),o;return D(N(e,r))}function Y(e){let r=Bl(e);if(r?.kind==="pages")oS();else if(r?.kind==="collection")zD(r.name);else if(r?.kind==="data")V(r.connection,r.table)}function ee(e,r){return[{emptyMessage:"",key:"project",rows:[{id:ls({kind:"pages"}),label:"Pages"},...e.map(({name:t})=>({id:ls({kind:"collection",name:t}),label:`Collection: ${t}`}))],state:"listed",title:"Project"},...r.map((t)=>({emptyMessage:"No tables — push a schema first.",key:`data:${t.name}`,rows:t.tables.map((o)=>({id:ls({connection:t.name,kind:"data",table:o}),label:o})),state:t.tables.length===0?"empty":"listed",title:`Data · ${t.name}`}))]}async function XE(){let e=rS(),r=[];if(nS())r=(await K().catch(()=>null))?.connections??[];let t=null,o=Ys({cancelLabel:"Cancel",confirmLabel:"",headline:"Open Grid",island:(i)=>{t=I(i,ee(e,r),(s)=>{o.close(),Y(s)})},layer:tt("dialog"),onCancel:()=>o.close(),onClosed:()=>{t?.dispose(),t=null},onConfirm:()=>{},region:"grid/open"});o.ready}function te(){return[{args:Ce({name:We("The content collection's name, as project.json declares it.")}),category:"Project",id:"collection.editInGrid",level:"project",menus:["context/file","palette"],group:"5_data",requires:"a project that declares content collections",when:(e)=>e.project.open,run:(e,r)=>{let t=St("collection.editInGrid",r,"name"),o=rS().map((i)=>i.name);if(!o.includes(t))throw RangeError(`command "collection.editInGrid" argument "name": "${t}" is not a content `+"collection this project declares — it declares: "+`${o.length>0?o.join(", "):"none"}`);zD(t)},title:"Edit Collection in Grid"},{args:{additionalProperties:!1,properties:{connection:We('The connection name from project.json. Defaults to "default".'),table:We("The table to open.")},required:["table"],type:"object"},category:"Project",id:"data.openGrid",level:"project",menus:["palette"],group:"5_data",requires:"a platform that serves the data routes",when:(e)=>e.project.open,enablement:(e)=>e.capability.dataRows,run:(e,r)=>{let t=St("data.openGrid",r,"table");V(Qn("data.openGrid",r,"connection"),t)},title:"Open Data Grid"}]}function QE(e){e.registerAll(te())}
2
+ export{nS,HD,YE,BD,iS,ZE,zD,oS,XE,QE};
3
+
4
+ //# debugId=D0EF90634B3E5AF864756E2164756E21
5
+ //# sourceMappingURL=studio-2ks6ka4g.js.map
@@ -0,0 +1,5 @@
1
+ import{te}from"./studio-psh8mwnw.js";import{p,_e}from"./studio-03mqh8ax.js";import{C}from"./studio-4kzbrr5t.js";import{Sr}from"./studio-de1s2x9v.js";import{A$,dv,u}from"./studio-vzgmyt0v.js";import{MC,Si,wv}from"./studio-ry81j4q1.js";import{us,zd,eO}from"./studio-k3bcy02e.js";import{Ks,e$,t$,Js,nn,rC,n$,sh}from"./studio-x3mjr5cc.js";import{S}from"./studio-45gyxpcq.js";function d(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var x=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function zc(){return(_e()?p().assetCapabilities?.accept:void 0)??x}function Od(t){return Js.has(nn(t))}function Wc(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=nn(t.name);if(Ks.has(n))return"image";if(e$.has(n))return"video";if(t$.has(n))return"audio";return"file"}var ZL=new Set([".woff",".woff2",".ttf",".otf"]);function dA(t){if(ZL.has(nn(t)))return"font";let e=Wc({name:t});return e==="file"?"document":e}var y=/^content\/([^/]+)\//,_a="public/media";function XL(t){let e=t?y.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:_a}function uA(t){let e=t.replaceAll("\\","/");return e===_a||/^content\/[^/]+\/images$/.test(e)}function A(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function w(t,e){if(!e.has(t))return t;let n=nn(t),r=n?t.slice(0,-n.length):t;for(let i=1;;i++){let o=`${r}-${i}${n}`;if(!e.has(o))return o}}function E(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var m=null;function hA(t){m=t}async function QL(t){await m?.(t)}function b(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function M(t,e){let n=(o)=>e==="image"?Ks.has(nn(o.name)):Od(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)C.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Sa(t,e={}){let n=e.only===void 0?[...t]:M([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??XL(u.value?.documentPath??null),o;try{let s=await us(()=>r.listDirectory(i));o=new Set(s.map((l)=>l.name))}catch{o=new Set}let f=_e()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let s of n){if(f!==void 0&&s.size>f){C.error(`${s.name} is too large.`,{detail:`This backend accepts at most ${d(f)}; that file is ${d(s.size)}.`,source:"Media"});continue}let l=w(s.name,o);o.add(l);let g=E(i,l);try{let{path:c}=await r.uploadFile(g,s);zd([c]),a.push({kind:Wc(s),name:l,path:c,ref:A(c)})}catch(c){C.error(`Could not upload ${s.name}.`,{detail:te(c),path:g,source:"Media"})}}if(a.length>0)C.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await m?.(i);return a}var O=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function h(t){return O.find((e)=>e.has(t))??new Set([t])}function pA(t){return[...h(nn(t))].join(",")}function v(t,e){return h(nn(t)).has(nn(e.name))}async function fA(t,e){let n=t.split("/").pop()??t;if(!v(t,e))return C.error(`${e.name} cannot replace ${n}.`,{detail:`${n} is ${nn(t)||"a file with no extension"} and ${e.name} is ${nn(e.name)||"a file with no extension"}. Every page that uses ${n} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let r=_e()?p().assetCapabilities?.maxUploadBytes:void 0;if(r!==void 0&&e.size>r)return C.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${d(r)}; that file is ${d(e.size)}.`,source:"Media"}),!1;let i;try{({path:i}=await p().uploadFile(t,e))}catch(o){return C.error(`Could not replace ${n}.`,{detail:te(o),path:t,source:"Media"}),!1}if(zd([t,i]),Sr(),await QL(b(t)),i!==t)return C.warn(`${n} was not replaced.`,{detail:`The backend stored the new file as ${i}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return C.success(`Replaced ${n}`),!0}function mA(t){let e=Si(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function jb(t){let e=Si(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function I(){return S?.projectConfig?.content??null}function N(t){return dv(t,I(),n$())}function F(t,e){return`${Si(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function Hb(t){let e=Si(t);if(e.startsWith(`${MC}/`))return`/${e.slice(MC.length+1)}`;let n=N(e);return n?`/${F(e,n)}`:`/${e}`}function tr(t){let e=Si(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=sh();if(n==="repo")return A$(`${r}${wv(e)}`,eO(e));return rC(`/${wv(Hb(e).slice(1))}`)}
2
+ export{zc,Od,Wc,ZL,dA,_a,XL,uA,hA,QL,Sa,pA,fA,mA,jb,Hb,tr};
3
+
4
+ //# debugId=D0E8351425CC326C64756E2164756E21
5
+ //# sourceMappingURL=studio-34jrz12k.js.map
@@ -1,5 +1,5 @@
1
- import{Q}from"./studio-nqxqf8p2.js";import{p}from"./studio-pr23qhrw.js";import{g,C}from"./studio-hw60n5dh.js";import{Qb}from"./studio-y1x65h5r.js";import{Mt,Nt,ae}from"./studio-7cg75gtj.js";import{Fl,gp}from"./studio-bf0rgyf7.js";import{qe,ft,T,R,Jt,rt,tt}from"./studio-02phtmqn.js";import{zu}from"./studio-73wz63nn.js";import{FD}from"./studio-74nzv280.js";import{Gl}from"./studio-m4w6sygj.js";import{S}from"./studio-ana67wax.js";import{n,te,_,v}from"./studio-kt2j51sa.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],NR="integrations";function AR(e){return B.some((o)=>o.id===e)}var ve="overview",E=new Map,G=new Set;function D(){for(let e of G)e()}function Sd(){D()}function S_(e){return G.add(e),()=>{G.delete(e)}}function Ol(e){E.set(e.key,e),D()}function OR(e){if(E.delete(e))D()}function we(){return[...E.values()].toSorted((e,o)=>e.order-o.order)}function Py(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function Hk(){return Py().flatMap((e)=>e.sections.map((o)=>o.key))}function H(e){return E.get(e)}var L=null,P=ve;function V(){if(L!==null&&E.has(L))return P=L,L=null,P;if(E.has(P))return P;return Hk()[0]??P}function C_(e){if(E.has(e))P=e,L=null;else L=e;D()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var W=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Mt(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Jt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(qe,W),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var ee={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",ee);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var x=new Map,A=new Set,I=new Map;function MR(e,o){let s=S?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return x.set(e,o),null}var J=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=S?.projectConfig;if(!s)return;if(!(await Gl()).ok)return;let i=[];try{i=await zu(s)}catch(r){C.warn(`Could not validate project.json — ${Q(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}J.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:S?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return gp(r,a)}};if(te(t.setSecrets))i.commitSecret=async(r,l)=>{let a=FD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function j(e){let o=S?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${W}/${e}`}var se=new WeakMap;function w(e){Bk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=j(t)??{},u=x.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&_(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:I.get(t)??"",newState:A.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(N)=>{if(N.parentNode!==o)o.replaceChildren(N)};if((s.settings.layout??"form")!=="map"){let N=`/${i}`;a(Fl(`section:${i}`,s.entrySchema,j(i)??{},{context:ie(i,t,null),errors:J.get(N)??{},onChange:(y)=>{let f=j(i);if(!f)return;oe(f,y),l(),z(N,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=j(i)??{},u=x.get(i)??null,d=u===null?void 0:c[u];if(u===null||!_(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(Fl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:J.get(h)??{},onChange:(N)=>{oe(m,N),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?x.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){A.delete(t()),I.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(I.get(i)??""),l=j(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),x.set(i,r),A.delete(i),I.delete(i),o(`/${i}`)},editNew(i){I.set(t(),i),w(e)},openNew(){A.add(t()),w(e)},removeEntry(){let i=t(),r=x.get(i)??null,l=j(i);if(!r||!l?.[r])return;delete l[r],x.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=x.get(r)??null,a=j(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),x.set(r,c),o(`/${r}`)},select(i){x.set(t(),i),e.echo=null,w(e)}}}function Bk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function F(e){let o=V(),s=Py();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:H(o)!==void 0,intro:H(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=Qb(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,F(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{C_(y)}});function u(y,f,k){if(s||k!==a)return;l=`Could not show ${H(y)?.label??y}: ${f}`,c.update(F(l))}function d(y){if(s)return;let f=V(),k=c.body();if(k!==t)t=k,r=null;if(!k||!y&&r===f){c.update(F(l));return}let q=r!==f;r=f,l="",c.update(F(l));let K=H(f);if(!K){i=null,k.replaceChildren();return}if(q||!i||i.parentElement!==k)i=document.createElement("div"),k.replaceChildren(i);a+=1;let Y=a;try{let O=K.render(i);if(O instanceof Promise)O.catch((ye)=>{u(f,Q(ye),Y)})}catch(O){u(f,Q(O),Y)}}let m=()=>S_(()=>{d(!0)}),h=m(),N=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:N,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,M=!1;function be(){return M}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Ru()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Ru(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function PR(){if(M&&b){await b.dialog.ready;return}if(M=!0,b&&!b.dialog.host.isConnected)Re(),M=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Ru(){if(!M)return;M=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){M=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
2
- export{NR,AR,Sd,S_,Ol,OR,Py,Hk,C_,MR,Bk,PR,Ru};
1
+ import{te}from"./studio-psh8mwnw.js";import{p}from"./studio-03mqh8ax.js";import{g,C}from"./studio-4kzbrr5t.js";import{ov}from"./studio-vzgmyt0v.js";import{Ot,Nt,ae}from"./studio-cpkamjdn.js";import{Fl,mp}from"./studio-fy7jzj9j.js";import{Ue,ft,T,R,Yt,rt,tt}from"./studio-jttyqrmh.js";import{Bu}from"./studio-y26hx9re.js";import{BD}from"./studio-2ks6ka4g.js";import{Gl}from"./studio-5wzdy1jc.js";import{S}from"./studio-45gyxpcq.js";import{n,Q,_,v}from"./studio-zkq3r91p.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],MR="integrations";function PR(e){return B.some((o)=>o.id===e)}var ve="overview",E=new Map,G=new Set;function D(){for(let e of G)e()}function xd(){D()}function E_(e){return G.add(e),()=>{G.delete(e)}}function Ol(e){E.set(e.key,e),D()}function FR(e){if(E.delete(e))D()}function we(){return[...E.values()].toSorted((e,o)=>e.order-o.order)}function zy(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function zk(){return zy().flatMap((e)=>e.sections.map((o)=>o.key))}function H(e){return E.get(e)}var L=null,P=ve;function V(){if(L!==null&&E.has(L))return P=L,L=null,P;if(E.has(P))return P;return zk()[0]??P}function T_(e){if(E.has(e))P=e,L=null;else L=e;D()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var W=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Ot(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Yt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(Ue,W),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var ee={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",ee);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var x=new Map,A=new Set,I=new Map;function jR(e,o){let s=S?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return x.set(e,o),null}var J=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=S?.projectConfig;if(!s)return;if(!(await Gl()).ok)return;let i=[];try{i=await Bu(s)}catch(r){C.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}J.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:S?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return mp(r,a)}};if(Q(t.setSecrets))i.commitSecret=async(r,l)=>{let a=BD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function j(e){let o=S?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${W}/${e}`}var se=new WeakMap;function w(e){Wk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=j(t)??{},u=x.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&_(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:I.get(t)??"",newState:A.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(N)=>{if(N.parentNode!==o)o.replaceChildren(N)};if((s.settings.layout??"form")!=="map"){let N=`/${i}`;a(Fl(`section:${i}`,s.entrySchema,j(i)??{},{context:ie(i,t,null),errors:J.get(N)??{},onChange:(y)=>{let f=j(i);if(!f)return;oe(f,y),l(),z(N,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=j(i)??{},u=x.get(i)??null,d=u===null?void 0:c[u];if(u===null||!_(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(Fl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:J.get(h)??{},onChange:(N)=>{oe(m,N),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?x.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){A.delete(t()),I.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(I.get(i)??""),l=j(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),x.set(i,r),A.delete(i),I.delete(i),o(`/${i}`)},editNew(i){I.set(t(),i),w(e)},openNew(){A.add(t()),w(e)},removeEntry(){let i=t(),r=x.get(i)??null,l=j(i);if(!r||!l?.[r])return;delete l[r],x.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=x.get(r)??null,a=j(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),x.set(r,c),o(`/${r}`)},select(i){x.set(t(),i),e.echo=null,w(e)}}}function Wk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function F(e){let o=V(),s=zy();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:H(o)!==void 0,intro:H(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=ov(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,F(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{T_(y)}});function u(y,f,k){if(s||k!==a)return;l=`Could not show ${H(y)?.label??y}: ${f}`,c.update(F(l))}function d(y){if(s)return;let f=V(),k=c.body();if(k!==t)t=k,r=null;if(!k||!y&&r===f){c.update(F(l));return}let q=r!==f;r=f,l="",c.update(F(l));let K=H(f);if(!K){i=null,k.replaceChildren();return}if(q||!i||i.parentElement!==k)i=document.createElement("div"),k.replaceChildren(i);a+=1;let Y=a;try{let O=K.render(i);if(O instanceof Promise)O.catch((ye)=>{u(f,te(ye),Y)})}catch(O){u(f,te(O),Y)}}let m=()=>E_(()=>{d(!0)}),h=m(),N=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:N,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,M=!1;function be(){return M}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Iu()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Iu(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function HR(){if(M&&b){await b.dialog.ready;return}if(M=!0,b&&!b.dialog.host.isConnected)Re(),M=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Iu(){if(!M)return;M=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){M=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
2
+ export{MR,PR,xd,E_,Ol,FR,zy,zk,T_,jR,Wk,HR,Iu};
3
3
 
4
- //# debugId=BDE3A51A04703E2464756E2164756E21
5
- //# sourceMappingURL=studio-1meqbxns.js.map
4
+ //# debugId=C4FDA091FBB7A84364756E2164756E21
5
+ //# sourceMappingURL=studio-35vrtpdq.js.map
@@ -0,0 +1,5 @@
1
+ import{p,_e}from"./studio-03mqh8ax.js";import{ae}from"./studio-cpkamjdn.js";import{C}from"./studio-4kzbrr5t.js";import{te}from"./studio-psh8mwnw.js";import{fO,Vn,Ce,ui}from"./studio-vzgmyt0v.js";import{Em,h}from"./studio-5wzdy1jc.js";import{zl,Cb,Ri,Nd,SS}from"./studio-2hsqbq7b.js";import{Vs}from"./studio-hy4ye0dx.js";import{Ws,wa,sT}from"./studio-hwejq03c.js";import{as}from"./studio-s0fg2wav.js";import{S}from"./studio-45gyxpcq.js";import{le}from"./studio-7xag4na8.js";var g={attempts:6,delayMs:5000};function P(e,t){return`https://dash.cloudflare.com/${e}/pages/view/${t}`}async function k(e){if(e>0)await new Promise((t)=>{setTimeout(t,e)})}async function d(e={}){let t=Ri(),r=new AbortController,i=Vs({cancel:()=>{r.abort()},source:"Publish",status:"Starting…",steps:["Push to the remote","Ask Cloudflare for the deployment"],title:"Deploy"});i.step("Push to the remote");try{await p().gitPush({setUpstream:!0}),i.log("Pushed the current branch.")}catch(a){return i.log(te(a)),i.fail("Could not push to the remote.",{action:"git.push"}),!1}if(!t)return i.done("Pushed. No provider is connected, so nothing was asked to build it."),!0;i.step("Ask Cloudflare for the deployment");let n=e.attempts??g.attempts,s=e.delayMs??g.delayMs;for(let a=0;a<n;a+=1){if(r.signal.aborted)return!1;let o;try{o=await Cb(t)}catch(l){return i.log(te(l)),i.fail("Cloudflare did not answer.",{action:"publish.deploy"}),!1}if(o)return Nd(o),i.log(`${o.stage}: ${o.status} — ${o.url}`),i.done(`${o.stage}: ${o.status}`),!0;await k(s)}if(r.signal.aborted)return!1;return Nd(null),i.done("Pushed. Cloudflare has not reported a deployment yet."),!0}function x(){return[{category:"Publish",id:"publish.setUp",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"an open project on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>e.capability.publish,run:async()=>{let{openPublishPanel:e}=await (le("d34bhvwj"),import("./publish-panel-d34bhvwj.js"));e()},title:"Set Up Publishing"},{category:"Publish",id:"publish.deploy",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a repository with a remote and a connected deploy provider, on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>e.project.isRepo&&Ri()!==void 0&&e.capability.publish,run:async()=>{await d()},title:"Deploy"},{category:"Publish",id:"publish.openDashboard",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a connected deploy provider, on a platform that can reach the Cloudflare API",when:(e)=>e.project.open,enablement:(e)=>Ri()!==void 0&&e.capability.publish,run:()=>{let e=Ri();if(e)window.open(P(e.accountId,e.projectName),"_blank","noopener")},title:"Open Deployment Dashboard"},{category:"Publish",id:"publish.quick",level:"project",menus:["commandbar/overflow","palette"],group:"8_publish",requires:"a project tracked by git",when:(e)=>e.project.open,enablement:(e)=>e.project.isRepo,run:async()=>{let{openQuickPublish:e}=await (le("vr695j26"),import("./publish-quick-vr695j26.js"));e()},title:"Quick Publish"},{args:Ce({tab:ui(Em,"Which view of the Publish workspace to show: review (the changes and where they go), deploys (the live site and its deployments), branches, or hosting (where the project is saved and hosted). Defaults to the view the workspace was left on.")},[]),category:"Publish",id:"publish.open",level:"project",menus:["never"],group:"8_publish",requires:"an open project",enablement:(e)=>e.project.open,run:async(e,t)=>{let r=t.tab===void 0?null:Vn("publish.open",t,"tab",Em),i=ae();if(!i)throw Error(`command "publish.open" needs the window's command registry`);if(await i.run("view.setWorkspace",{workspace:"publish"}),r!==null){let{showPublishTab:n}=await (le("2yr60mt4"),import("./publish-workspace-2yr60mt4.js"));n(r)}},title:"Show Publish"}]}function iR(e){e.registerAll(x())}function u(){let e=h.git.status?.remotes;return Array.isArray(e)&&e.length>0?e[0]??"":""}function c(){return h.git.branches?.current||h.git.status?.branch||""}function b(){return Ri()!==void 0&&zl()&&u()!==""}function D(){let e=Ri();return e?.productionUrl??e?.projectName??""}function y(e){return`studio/${as(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"").slice(0,48).replace(/-$/,"")||"changes"}`}function f(){return h.git.branches?.defaultBranch??""}function Hg(){if(!sT())return"This host cannot open a pull request yet. Publish live, or create a branch under Branches and push it.";if(wa()){let e=f(),t=c();if(!e||!t||t===e)return`Every commit to ${e||"the default branch"} on this host is live. Create a branch under Branches and send it for review from there.`;return""}if(u()==="")return"A pull request needs a remote. Create the GitHub repository under Hosting first.";return""}function j(){let e=c()||"the current branch";if(b())return`Commits to ${e} and deploys to ${D()}.`;if(wa())return`Commits to ${e} on GitHub.`;let t=u();return t?`Commits to ${e} and pushes it to ${t}.`:`Commits to ${e}. This repository has no remote, so nothing leaves this machine.`}function A(){let e=c()||"the current branch";if(wa())return`Commits to ${e} and opens a pull request from it into ${f()||"the default branch"}.`;let t=h.git.commitMessage.trim();return`Saves to ${t?y(t):"a new studio/ branch"}, pushes it and opens a pull request into ${e}.`}function Ty(e){let t=Hg();return[{checked:e==="live"?"true":"false",disabled:!1,label:"Publish live",note:j(),reason:"",value:"live"},{checked:e==="review"?"true":"false",disabled:t!=="",label:"Send for review",note:A(),reason:t,value:"review"}]}function qf(e){return e==="review"&&Hg()!==""?"live":e}function oR(e){if(e==="review")return"Send for review";if(b())return"Publish live";return wa()||u()!==""?"Commit and push":"Commit"}function w(e){let t=h.git.status?.files??[];return e?t:t.filter((r)=>Boolean(r.staged))}function Gf(e,t=!1){let{status:r}=h.git;if(!S||!r?.isRepo)return"Track this project with git first.";if(h.git.loading)return"Source control is busy.";if(r.files.length===0)return"There is nothing to publish.";if(w(t).length===0)return"Include at least one change.";if(!h.git.commitMessage.trim())return"Write a summary of the change first.";return e==="review"?Hg():""}function v(){return(h.git.status?.files??[]).map((e)=>`${e.status}:${e.path}`).join("|")}function s_(){return _e()&&p().buildSite!==void 0}async function rR(){if(!s_()||h.publish.build.state==="running")return;let e=p().buildSite;if(!e)return;h.publish.build.state="running",h.publish.build.text="Building the site…",h.publish.build.for=v();try{let t=await e();if(t.errors.length>0)h.publish.build.state="failed",h.publish.build.text=`Built with ${t.errors.length} error(s): ${t.errors[0]}`;else h.publish.build.state="passed",h.publish.build.text=t.mode==="live"?`${t.routes} page(s) render. This host previews the working tree; it does not build.`:`Site builds: ${t.routes} page(s).`}catch(t){h.publish.build.state="failed",h.publish.build.text=`The site could not be built: ${te(t)}`}}function Bg(){let e=[],t=SS();if(e.push(t?{command:t.command,key:"deploy",state:t.state==="unknown"?"unknown":"todo",text:`${t.label}: ${t.detail}`}:{command:"",key:"deploy",state:"done",text:"Everything this project needs to ship is in place."}),s_()){let r=h.publish.build.for===v()||h.publish.build.state==="running";e.push(r&&h.publish.build.state!=="idle"?{command:"",key:"build",state:h.publish.build.state==="passed"?"done":h.publish.build.state==="failed"?"failed":"running",text:h.publish.build.text}:{command:"",key:"build",state:"unknown",text:"The site has not been built with these changes."})}return e}function sR(e){let t=e.filter((r)=>r.state!=="done");if(t.length===0)return"Checks passed: ready to publish.";return t.map((r)=>r.text).join(" · ")}function aR(){return h.publish.review.number>0?{number:h.publish.review.number,url:h.publish.review.url}:null}function R(e){if(!h.git.commitMessage)h.git.commitMessage=e}async function Ly(e,t={}){let r=t.includeAll??!1,i=Gf(e,r);if(i)return h.git.error=i,!1;let n=h.git.commitMessage.trim(),s=p();h.git.commitMessage="",h.git.loading=!0,h.git.error=null,await fO();let a=!1,o=!0;try{if(r){let l=w(!0).filter((m)=>!m.staged).map((m)=>m.path);if(l.length>0)await s.gitStage(l)}if(e==="review")await B(s,n,()=>{a=!0});else if(await s.gitCommit(n),a=!0,b())h.git.loading=!1,o=await d();else if(!wa()&&u()!=="")await s.gitPush();return await Ws(),o}catch(l){if(h.git.error=te(l),h.git.loading=!1,!a)R(n);return!1}}async function q(e,t,r){if(wa()){await e.gitCommit(t),r();let s=f();return s?{base:s,title:t}:{title:t}}let i=c(),n=y(t);return await e.gitCreateBranch(n),await e.gitCommit(t),r(),await e.gitPush({setUpstream:!0}),i?{base:i,head:n,title:t}:{head:n,title:t}}async function B(e,t,r){let i=e.createPullRequest;if(!i)throw Error(Hg());let n=await i(await q(e,t,r));h.publish.review.number=n.number,h.publish.review.url=n.url,C.success(`Pull request #${n.number} opened for review.`,{detail:n.url,key:"publish.review",source:"Publish"})}
2
+ export{iR,Hg,Ty,qf,oR,Gf,s_,rR,Bg,sR,aR,Ly};
3
+
4
+ //# debugId=B83C05FCD5F6BB0064756E2164756E21
5
+ //# sourceMappingURL=studio-38g0jdz7.js.map
@@ -1,5 +1,5 @@
1
- import{p,_e}from"./studio-pr23qhrw.js";import{Ne,Gw,xa,jc}from"./studio-v2ek69cb.js";import{g}from"./studio-hw60n5dh.js";import{ln,Y,kr,Up,Ra,u}from"./studio-y1x65h5r.js";import{Sv}from"./studio-tpmnbgmt.js";import{Vc,Sa,or}from"./studio-hvxt8z79.js";import{Vr}from"./studio-txkx6586.js";import{JT,il,Eb}from"./studio-5abge3wy.js";import{mt}from"./studio-2b8443ms.js";import{T,R,rt}from"./studio-02phtmqn.js";import{Zn}from"./studio-nm9qev4p.js";import{mb}from"./studio-2dtc90zs.js";import{Vu}from"./studio-a6x058ew.js";import{jy,VR,qg,kd,UR,qR,Vk,Hy,By}from"./studio-8m1t83kn.js";import{sm}from"./studio-3pndhat0.js";import{yw,ww,bp}from"./studio-a3evp7f6.js";import{S,xn}from"./studio-ana67wax.js";import{n,Z,v}from"./studio-kt2j51sa.js";import{le}from"./studio-fqs1a22a.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ra(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function BR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>kr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let f={fragment:E(i),type:"block"};if(r)Eb(e,{type:r.instruction},f,te(r,m));else Eb(e,{type:"make-child"},f,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,f,P,h)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(h,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(h,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(h,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await JT(e)).contentType}async function se(e){let[t,a]=await Promise.all([sm(["pages","layouts"],p()),Sv()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let f=await mb(i).catch(()=>null);if(e===b&&f)l.set(i,f.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Vg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Gw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=kd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!qg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:jy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>qg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:jy(r.file===a),src:r.isImage?or(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=VR(w),t=u.value?.documentPath??null,a=pe();de();let r=Vu(),o=a?UR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=qR(o,e),l=ge(),m=a?Vk(a.layouts,t,"",l):[],i=a?Vk(a.layouts,t,e,l):[],f=!Gw,P=_("",t),h=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:h,componentsCount:k(P.length,h.length,f),componentsState:j(f,P.length,h.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("ybpp3j38"),import("./files-ybpp3j38.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await ww(a,e.cache);if(r&&c===e&&t.isConnected&&!By(t))Hy(t,r)}function q(e,t,a){let r=Vr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{il({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:jc(t),type:"block"}:null}function ve(e){let t=Vu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Vc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:yw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function zR(){Zn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function WR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
2
- export{BR,Vg,zR,WR};
1
+ import{p,_e}from"./studio-03mqh8ax.js";import{Ne,Zw,xa,Fc}from"./studio-1e8dw2w2.js";import{g}from"./studio-4kzbrr5t.js";import{ln,Ia,Y,Cr,Up,u}from"./studio-vzgmyt0v.js";import{Ev}from"./studio-3w35qvay.js";import{Wc,Sa,tr}from"./studio-34jrz12k.js";import{Wr}from"./studio-ewarnzm4.js";import{ZT,nl,Rb}from"./studio-pqqq6v85.js";import{mt}from"./studio-ajw4k8hp.js";import{T,R,rt}from"./studio-jttyqrmh.js";import{Xn}from"./studio-9cxmp61c.js";import{gb}from"./studio-wxdcd42g.js";import{Wu}from"./studio-agyvzfm4.js";import{Vy,GR,Zg,Sd,KR,JR,qk,Uy,qy}from"./studio-0ydxv2mr.js";import{cm}from"./studio-zgx7svjd.js";import{Sw,Cw,bp}from"./studio-pgm83a2f.js";import{S,xn}from"./studio-45gyxpcq.js";import{n,Z,v}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ia(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function VR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>Cr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let f={fragment:E(i),type:"block"};if(r)Rb(e,{type:r.instruction},f,te(r,m));else Rb(e,{type:"make-child"},f,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,f,P,h)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(h,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(h,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(h,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await ZT(e)).contentType}async function se(e){let[t,a]=await Promise.all([cm(["pages","layouts"],p()),Ev()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let f=await gb(i).catch(()=>null);if(e===b&&f)l.set(i,f.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Jg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Zw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=Sd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!Zg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:Vy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>Zg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:Vy(r.file===a),src:r.isImage?tr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=GR(w),t=u.value?.documentPath??null,a=pe();de();let r=Wu(),o=a?KR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=JR(o,e),l=ge(),m=a?qk(a.layouts,t,"",l):[],i=a?qk(a.layouts,t,e,l):[],f=!Zw,P=_("",t),h=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:h,componentsCount:k(P.length,h.length,f),componentsState:j(f,P.length,h.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("de90apn9"),import("./files-de90apn9.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await Cw(a,e.cache);if(r&&c===e&&t.isConnected&&!qy(t))Uy(t,r)}function q(e,t,a){let r=Wr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{nl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:Fc(t),type:"block"}:null}function ve(e){let t=Wu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Wc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:Sw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function UR(){Xn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function qR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
2
+ export{VR,Jg,UR,qR};
3
3
 
4
- //# debugId=D1A33BDB1908DB0364756E2164756E21
5
- //# sourceMappingURL=studio-25a5by3h.js.map
4
+ //# debugId=985D9219DA66DC5964756E2164756E21
5
+ //# sourceMappingURL=studio-396srjbk.js.map
@@ -1,5 +1,5 @@
1
- import{n,_}from"./studio-kt2j51sa.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 Cd(e){let t=u(e);return t?a(t):null}function em(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 zk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Du(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 E_(e){return u(e)?.active??null}function FR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Du(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function jR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Du(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Fy(e,t){let r=Du(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 Wk(e,t){let r=u(e);if(!r||!c())return!1;let o=Du(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 HR(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{Cd,em,zk,Du,E_,FR,jR,Fy,Wk,HR};
1
+ import{n,_}from"./studio-zkq3r91p.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 _d(e){let t=u(e);return t?a(t):null}function im(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 Vk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Ru(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 L_(e){return u(e)?.active??null}function BR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Ru(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function zR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Ru(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Wy(e,t){let r=Ru(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 Uk(e,t){let r=u(e);if(!r||!c())return!1;let o=Ru(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 WR(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{_d,im,Vk,Ru,L_,BR,zR,Wy,Uk,WR};
3
3
 
4
- //# debugId=FE514F84F46649C464756E2164756E21
5
- //# sourceMappingURL=studio-zm7dnr9g.js.map
4
+ //# debugId=8D22B0AFD928F5F664756E2164756E21
5
+ //# sourceMappingURL=studio-3c8pp7pb.js.map
@@ -1,5 +1,5 @@
1
- import{p}from"./studio-pr23qhrw.js";import{Bt,Aa,ul}from"./studio-tpmnbgmt.js";import{ae}from"./studio-7cg75gtj.js";import{T,R,En,rt,Zs}from"./studio-02phtmqn.js";import{g}from"./studio-hw60n5dh.js";import{u}from"./studio-y1x65h5r.js";import{aw,RD,ab,yi}from"./studio-g6ysm05p.js";import{_h,Lr,S}from"./studio-ana67wax.js";import{n,rf}from"./studio-kt2j51sa.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPalette",$description:'The command palette: a `role="combobox"` field over the kit\'s `jx-listbox`, whose rows are `jx-option`s the host projects. `rows` is the ranked set for the current mode and query; `activeId` is the highlight, and it is ONE string — the id the field points `aria-activedescendant` at and the id the listbox is handed as `active`, so a key moves the caret without the rows reconciling and no row re-decides its own flag. The FIELD is not a `jx-combobox`: this one carries a mode chip inside its box, its Enter runs a command rather than committing a value, and its panel is a centred scrim rather than a popover under a control. Every gesture calls back into panels/quick-search.ts, which owns the modes, the ranking, the recents and what a row does.',tagName:"div",attributes:{part:"palette"},style:{display:"contents",'& [part="overlay"]':{position:"fixed",inset:"0",zIndex:"1000",display:"flex",justifyContent:"center",paddingTop:"60px",background:"rgba(0, 0, 0, 0.4)"},'& [part="overlay"][hidden]':{display:"none"},'& [part="panel"]':{width:"560px",maxWidth:"calc(100vw - 32px)",maxHeight:"420px",display:"flex",flexDirection:"column",alignSelf:"flex-start",background:"var(--jx-bg-overlay)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-md)",boxShadow:"var(--jx-shadow-dialog)",color:"var(--jx-fg)",fontFamily:"var(--jx-font-sans)",overflow:"hidden"},'& [part="input-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",paddingLeft:"var(--jx-space-4)",background:"var(--jx-bg-input)",borderBottom:"1px solid var(--jx-border)"},'& [part="chip-slot"], & [part="empty-slot"], & [part="section-slot"], & [part="trailing-slot"]':{display:"contents"},'& [part="chip"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-1)",flexShrink:"0",padding:"2px var(--jx-space-1) 2px var(--jx-space-3)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-accent-solid)",color:"var(--jx-accent-fg)",fontSize:"var(--jx-text-sm)"},'& [part="chip-remove"] > [part="control"]':{color:"inherit",opacity:"0.8",":hover":{opacity:"1",background:"transparent"}},'& [part="input"]':{flex:"1",minWidth:"0",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-4) var(--jx-space-1)",font:"inherit",fontSize:"var(--jx-text-lg)",border:"none",outline:"none",background:"none",color:"var(--jx-fg)","::placeholder":{color:"var(--jx-fg-muted)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="results"]':{$description:"The list is the kit's: a `jx-listbox` of `jx-option`, so the highlight is ONE id — `active`, the same string the field points `aria-activedescendant` at — and the listbox's sidecar is the single writer of every row's `selected`. What this surface still decides is density. The kit's row pads itself by `--jx-space-3`; the other half of the 16px optical margin the panel has always had sits here, on the list, so the heading, the rows and the empty sentence line up on one edge instead of each naming it.",flex:"1",paddingInline:"var(--jx-space-3)"},'& [part="option"] [part="label"]':{fontWeight:"500"},'& [part="option"] [part="description"]':{$description:"A `jx-select` row's note is a category at the END of the row, so the kit pushes it there with an auto margin. A palette row's note is a CONTINUATION of its name — the file's directory, the command's category — and the far edge belongs to the chord, which is how this surface teaches the keyboard it replaced. So the auto margin moves to the end slot.",marginInlineStart:"0"},'& [part="option"] [part="end"]':{marginInlineStart:"auto"},'& [part="option"][aria-disabled="true"]':{$description:"An unavailable command is greyed with its `requires` sentence as the subtitle, and that sentence is the reason the row is on screen at all. The kit fades the whole row to 0.45, which would take a muted grey below any readable contrast — so the row keeps its ink and only the name and the glyph dim.",opacity:"1"},'& [part="option"][aria-disabled="true"] [part="label"], & [part="option"][aria-disabled="true"] [part="icon"]':{opacity:"0.45"},'& [part="chord"]':{flexShrink:"0",fontFamily:"inherit",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-muted)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)",padding:"0 5px"},'& [part="option"][aria-selected="true"] [part="chord"]':{color:"inherit",borderColor:"currentColor"},'& [part="badge"]':{fontSize:"var(--jx-text-xs)",padding:"1px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-border)",color:"var(--jx-fg-dim)"},'& [part="hint"]':{padding:"var(--jx-space-2) var(--jx-space-5)",borderTop:"1px solid var(--jx-border)",color:"var(--jx-fg-muted)",fontSize:"var(--jx-text-xs)"},'& [part="hint"] kbd':{fontFamily:"inherit",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"overlay",hidden:"${state.open ? null : ''}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/close"},value:[]}]},children:[{tagName:"div",attributes:{part:"panel"},onclick:{$prototype:"Function",body:[{stopPropagation:!0}]},children:[{tagName:"div",attributes:{part:"input-row"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},$switch:{$ref:"#/state/hasChip"},cases:{true:{tagName:"span",attributes:{part:"chip"},children:[{tagName:"span",attributes:{part:"chip-label"},textContent:"${state.chipLabel}"},{tagName:"jx-action-button",$props:{label:"Clear mode",hint:"Clear mode (Backspace)",icon:"x",size:"sm"},attributes:{part:"chip-remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}},{tagName:"input",attributes:{part:"input",type:"text",role:"combobox","aria-controls":"quick-search-listbox","aria-expanded":"${state.expanded ? 'true' : 'false'}","aria-activedescendant":"${state.activeId || null}","aria-autocomplete":"list","aria-label":"${state.placeholder}",placeholder:"${state.placeholder}"},value:{$ref:"#/state/query"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{ArrowDown:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[1]}],ArrowUp:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[-1]}],Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/activate"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/close"},value:[]}],Backspace:[{$switch:{$ref:"#/state/canClearMode"},cases:{true:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}]}}]},{tagName:"jx-listbox",attributes:{part:"results",id:"quick-search-listbox"},$props:{label:"Results",active:"${state.activeId}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activateRow"},value:[{$ref:"event#/detail"}]}],description:"One handler for every row, because a row's `select` bubbles. The detail is the row's `value`, which is the index it occupies in `rows` — the same number a hover names, and the number the id is built from."},children:[{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/isEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyHint}"}}},{tagName:"div",attributes:{part:"section-slot",role:"none"},$switch:{$ref:"#/state/showSection"},cases:{true:{tagName:"div",attributes:{part:"group-heading"},textContent:"${state.sectionLabel}"}}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"jx-option",attributes:{part:"option",id:"quick-search-option-${$map.index}","data-kind":"${$map.item.kind}"},$props:{value:"${$map.index}",label:{$ref:"$map/item/name"},description:{$ref:"$map/item/detail"},disabled:{$ref:"$map/item/disabled"}},onmouseenter:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/hover"},value:[{$ref:"$map/index"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"span",attributes:{slot:"end",part:"trailing-slot"},$switch:{$ref:"$map/item/trailing"},cases:{chord:{tagName:"kbd",attributes:{part:"chord"},textContent:"${$map.item.chord}"},recent:{tagName:"span",attributes:{part:"badge"},textContent:"recent"}}}]}}]},{tagName:"div",attributes:{part:"hint"},children:[{tagName:"kbd",textContent:"↑↓"}," move · ",{tagName:"kbd",textContent:"↵"}," run · ",{tagName:"kbd",textContent:"?"}," modes · ",{tagName:"kbd",textContent:">"}," commands · ",{tagName:"kbd",textContent:"@"}," elements"]}]}]}]};var C=[{mode:"files",prefix:"",chip:"Files",placeholder:"Go to a file…",description:"Open a file by any part of its path — pgblog finds pages/blog/index.md."},{mode:"commands",prefix:">",chip:"Commands",placeholder:"Run a command…",description:"Run anything Studio can do, with its keyboard shortcut printed beside it."},{mode:"nodes",prefix:"@",chip:"Symbols",placeholder:"Go to an element in this document…",description:"Select an element in the open document by its Outline name."},{mode:"projects",prefix:"",chip:"Recent Projects",placeholder:"Open a recent project…",description:"Reopen a project you have had open before."},{mode:"picker",prefix:"?",chip:"Modes",placeholder:"Type ? for modes, > for commands, @ for elements…",description:"List these modes."}],X=new Map(C.map((e)=>[e.mode,e])),O=C.filter((e)=>e.prefix!=="");function _(e){return X.get(e)??C[0]}function L(e,t,o){let a=O.find((s)=>t.startsWith(s.prefix));if(a)return L(a.mode,t.slice(1),o);let i=e;if(i==="picker"&&t.trim()!=="")i="files";if(i==="files"&&!o)i="projects";return{mode:i,query:t}}var Y=new Set(["/","-","_","."," "]);function Z(e,t){if(t==="")return 0;let o=e.toLowerCase(),a=t.toLowerCase(),i=o.lastIndexOf("/")+1,s=0,r=0,v=-2;for(let K of a){let h=o.indexOf(K,r);if(h===-1)return null;if(h===v+1)s+=8;if(h===0||Y.has(o[h-1]??""))s+=6;if(h>=i)s+=4;v=h,r=h+1}return s-v*0.01-o.length*0.001}function w(e,t,o){let a=[];for(let[i,s]of e.entries()){let r=Z(o(s),t);if(r!==null)a.push({index:i,item:s,score:r})}return a.toSorted((i,s)=>s.score-i.score||i.index-s.index).map((i)=>i.item)}function q(e){let t=e.args,o=t?.properties;if(!t||!o)return{kind:"none"};let a=Object.keys(o);if(a.length!==1)return{kind:"unsupported"};let i=a[0],s=o[i];if(s.enum)return{kind:"choice",name:i,choices:s.enum.map((r)=>({label:String(r),value:r}))};if(s.type==="boolean")return{kind:"choice",name:i,choices:[{label:"on",value:!0},{label:"off",value:!1}]};return{kind:"unsupported"}}function N(e){return`quick-search-option-${e}`}var D="jx-studio-recent-commands",ee=6;function H(){try{let e=JSON.parse(localStorage.getItem(D)||"[]");return Array.isArray(e)?e.filter((t)=>n(t)):[]}catch{return[]}}function te(e){let t=[e,...H().filter((o)=>o!==e)].slice(0,ee);try{localStorage.setItem(D,JSON.stringify(t))}catch{}}var z=null,x=!1,b="picker",l="",d=0,y=null,j=!1,c=null;function B(){return Zs("popover","quick-search")}function xk(e){z=e??null}function Pg(e="files"){x=!0,b=e,l="",d=0,c=null,y=null,m(),ye(),M()}function k(){x=!1,c=null,m()}function Q(){return S?S.projectRoot:null}function W(){return S!=null}function J(){return L(b,l,W())}function U(e){let t=e.split("/");return t.pop(),t.length>0?t.join("/"):""}function ne(e){if(e.startsWith("/home/"))return`~/${e.split("/").slice(3).join("/")}`;return e}async function M(){if(!x||y!==null||j||!W())return;j=!0,m();try{await Bt(),y=(await p().searchFiles("",ul())).map((t)=>({kind:"file",path:t.path,name:t.name??t.path.split("/").pop()??"",detail:U(t.path),recent:!1}))}catch{y=[]}j=!1,m()}function oe(e){if(e.trim()==="")return RD(Q()??void 0).map((t)=>({kind:"file",path:t.path,name:t.name,detail:U(t.path),recent:!0}));return w(y??[],e.trim(),(t)=>t.path)}function re(e){let t=aw().map((o)=>({kind:"project",root:o.root,name:o.name,detail:ne(o.root)}));return w(t,e.trim(),(o)=>`${o.name}/${o.root}`)}function ie(e,t){let o=H(),a=[];for(let r of e.visible()){if(q(r).kind==="unsupported")continue;if(!(r.menus??["palette"]).includes("palette"))continue;a.push({kind:"command",id:r.id,name:`${r.category}: ${r.title}`,detail:e.disabledReason(r.id)??"",chord:e.keymap.formatBinding(r.id)??"",enabled:e.isEnabled(r.id),recent:o.includes(r.id)})}let i=w(a,t.trim(),(r)=>r.name);if(t.trim()!=="")return i;let s=o.map((r)=>i.find((v)=>v.id===r)).filter((r)=>r!==void 0);return[...s,...i.filter((r)=>!s.includes(r))]}function se(e){let t=u.value;if(!t)return[];let o=_h(t.doc.document).map((a)=>({kind:"node",path:a.path,name:rf(a.node)?String(a.node).slice(0,60):Lr(a.node),detail:a.nodeType}));return w(o,e.trim(),(a)=>a.name)}function ce(){return C.flatMap((e)=>e.mode==="picker"?[]:[{kind:"mode",mode:e.mode,name:e.chip,detail:e.description,chord:e.prefix}])}function de(e){let t=c,o=t.choices.map((a)=>({kind:"arg",commandId:t.command.id,argName:t.name,value:a.value,name:a.label,detail:`${t.command.title} → ${t.name}`}));return w(o,e.trim(),(a)=>a.name)}function le(){let{mode:e,query:t}=J();if(c)return{rows:de(t),showingRecent:!1};switch(e){case"commands":{let o=ae();return{rows:o?ie(o,t):[],showingRecent:t.trim()===""}}case"nodes":return{rows:se(t),showingRecent:!1};case"projects":return{rows:re(t),showingRecent:t.trim()===""};case"picker":return{rows:ce(),showingRecent:!1};default:return{rows:oe(t),showingRecent:t.trim()===""}}}function pe(e){let t=O.find((o)=>e.startsWith(o.prefix));if(t)b=t.mode,l=e.slice(1);else l=e;if(d=0,e!==l)P().query=e;m(),M()}function me(){b="picker",c=null,d=0,m()}function ue(e){b=e,l="",d=0,m(),M()}function G(e,t){let o=ae();if(!o)return;te(e.id),k(),En(o,e.id,t,"Palette")}function A(e){switch(e.kind){case"project":{k(),z?.openRecentProject(e.root);return}case"file":{k(),ab({name:e.name,path:e.path,root:Q()??""}),yi(e.path);return}case"mode":{ue(e.mode);return}case"node":{k(),rt("selection.set",{path:e.path},"Palette");return}case"arg":{G(c.command,{[e.argName]:e.value});return}default:he(e)}}function he(e){let t=ae(),o=t?.get(e.id);if(!t||!o||!e.enabled)return;let a=q(o);if(a.kind==="choice"){c={choices:a.choices,command:o,name:a.name},l="",d=0,m();return}G(o)}function fe(e){let t=e.split(".").pop()?.toLowerCase();if(t==="json")return"file-code";if(t&&Aa(t))return"file-text";return"file"}function ge(e){switch(e.kind){case"project":return"folder-open";case"file":return fe(e.name);case"command":return"play";case"node":return"stack";default:return"caret-right"}}function xe(e,t){if((e.kind==="command"||e.kind==="mode")&&e.chord)return"chord";if(e.kind==="command"&&e.recent)return"recent";return t?"recent":"none"}function be(e){switch(e.kind){case"project":return`project:${e.root}`;case"file":return`file:${e.path}`;case"command":return`command:${e.id}`;case"node":return`node:${e.path.join("/")}`;case"mode":return`mode:${e.mode}`;default:return`arg:${e.value}`}}function ve(e,t){if(j)return"Reading the project's files…";if(t.trim()!=="")return"No results";switch(e){case"projects":return"No recent projects — open one to get started";case"nodes":return"Open a document to jump to its elements";case"commands":return"Type to find any command in Studio";default:return _(e).placeholder}}T("palette",I);var E=null,F=null,f=[];function P(){return E??=g({activate:()=>{let e=f[d];if(e)A(e)},activateRow:(e)=>{let t=f[Number(e)];if(t)A(t)},activeId:"",canClearMode:!1,chipLabel:"",clearMode:me,close:k,emptyHint:"",expanded:!1,hasChip:!1,hover:(e)=>{d=e,P().activeId=N(e)},input:pe,isEmpty:!0,move:(e)=>{if(f.length===0)return;d=Math.max(0,Math.min(d+e,f.length-1)),P().activeId=N(d)},open:!1,placeholder:"",query:"",rows:[],sectionLabel:"",showSection:!1}),E}function ye(){setTimeout(()=>{if(x)B().querySelector('[part="input"]')?.focus()},0)}function m(){let e=P();if(!F)F=R("palette",e,B());if(e.open=x,!x){f=[];return}let{mode:t,query:o}=J(),{rows:a,showingRecent:i}=le(),s=_(t);f=a,e.placeholder=c?`Choose a ${c.name}…`:s.placeholder,e.hasChip=c!==null||t!=="picker",e.chipLabel=c?c.command.title:s.chip,e.query=l,e.canClearMode=l===""&&(c!==null||b!=="picker"),e.rows=a.map((r)=>({chord:(r.kind==="command"||r.kind==="mode")&&r.chord?r.chord:"",detail:r.detail,disabled:r.kind==="command"&&!r.enabled,icon:ge(r),key:be(r),kind:r.kind,name:r.name,trailing:xe(r,i)})),e.expanded=a.length>0,e.activeId=a.length>0?N(d):"",e.isEmpty=a.length===0,e.emptyHint=ve(t,o),e.showSection=i&&a.length>0,e.sectionLabel=c?`${c.command.title} — ${c.name}`:t==="projects"?"Recent projects":t==="commands"?"Recently used":"Recently opened"}
2
- export{xk,Pg};
1
+ import{p}from"./studio-03mqh8ax.js";import{Ht,Na,ul}from"./studio-3w35qvay.js";import{ae}from"./studio-cpkamjdn.js";import{T,R,En,rt,Zs}from"./studio-jttyqrmh.js";import{g}from"./studio-4kzbrr5t.js";import{u}from"./studio-vzgmyt0v.js";import{hw,AD,hb,yi}from"./studio-3zge48z4.js";import{xh,Tr,S}from"./studio-45gyxpcq.js";import{n,lf}from"./studio-zkq3r91p.js";var I={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPalette",$description:'The command palette: a `role="combobox"` field over the kit\'s `jx-listbox`, whose rows are `jx-option`s the host projects. `rows` is the ranked set for the current mode and query; `activeId` is the highlight, and it is ONE string — the id the field points `aria-activedescendant` at and the id the listbox is handed as `active`, so a key moves the caret without the rows reconciling and no row re-decides its own flag. The FIELD is not a `jx-combobox`: this one carries a mode chip inside its box, its Enter runs a command rather than committing a value, and its panel is a centred scrim rather than a popover under a control. Every gesture calls back into panels/quick-search.ts, which owns the modes, the ranking, the recents and what a row does.',tagName:"div",attributes:{part:"palette"},style:{display:"contents",'& [part="overlay"]':{position:"fixed",inset:"0",zIndex:"1000",display:"flex",justifyContent:"center",paddingTop:"60px",background:"rgba(0, 0, 0, 0.4)"},'& [part="overlay"][hidden]':{display:"none"},'& [part="panel"]':{width:"560px",maxWidth:"calc(100vw - 32px)",maxHeight:"420px",display:"flex",flexDirection:"column",alignSelf:"flex-start",background:"var(--jx-bg-overlay)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-md)",boxShadow:"var(--jx-shadow-dialog)",color:"var(--jx-fg)",fontFamily:"var(--jx-font-sans)",overflow:"hidden"},'& [part="input-row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",paddingLeft:"var(--jx-space-4)",background:"var(--jx-bg-input)",borderBottom:"1px solid var(--jx-border)"},'& [part="chip-slot"], & [part="empty-slot"], & [part="section-slot"], & [part="trailing-slot"]':{display:"contents"},'& [part="chip"]':{display:"inline-flex",alignItems:"center",gap:"var(--jx-space-1)",flexShrink:"0",padding:"2px var(--jx-space-1) 2px var(--jx-space-3)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-accent-solid)",color:"var(--jx-accent-fg)",fontSize:"var(--jx-text-sm)"},'& [part="chip-remove"] > [part="control"]':{color:"inherit",opacity:"0.8",":hover":{opacity:"1",background:"transparent"}},'& [part="input"]':{flex:"1",minWidth:"0",padding:"var(--jx-space-4) var(--jx-space-5) var(--jx-space-4) var(--jx-space-1)",font:"inherit",fontSize:"var(--jx-text-lg)",border:"none",outline:"none",background:"none",color:"var(--jx-fg)","::placeholder":{color:"var(--jx-fg-muted)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="results"]':{$description:"The list is the kit's: a `jx-listbox` of `jx-option`, so the highlight is ONE id — `active`, the same string the field points `aria-activedescendant` at — and the listbox's sidecar is the single writer of every row's `selected`. What this surface still decides is density. The kit's row pads itself by `--jx-space-3`; the other half of the 16px optical margin the panel has always had sits here, on the list, so the heading, the rows and the empty sentence line up on one edge instead of each naming it.",flex:"1",paddingInline:"var(--jx-space-3)"},'& [part="option"] [part="label"]':{fontWeight:"500"},'& [part="option"] [part="description"]':{$description:"A `jx-select` row's note is a category at the END of the row, so the kit pushes it there with an auto margin. A palette row's note is a CONTINUATION of its name — the file's directory, the command's category — and the far edge belongs to the chord, which is how this surface teaches the keyboard it replaced. So the auto margin moves to the end slot.",marginInlineStart:"0"},'& [part="option"] [part="end"]':{marginInlineStart:"auto"},'& [part="option"][aria-disabled="true"]':{$description:"An unavailable command is greyed with its `requires` sentence as the subtitle, and that sentence is the reason the row is on screen at all. The kit fades the whole row to 0.45, which would take a muted grey below any readable contrast — so the row keeps its ink and only the name and the glyph dim.",opacity:"1"},'& [part="option"][aria-disabled="true"] [part="label"], & [part="option"][aria-disabled="true"] [part="icon"]':{opacity:"0.45"},'& [part="chord"]':{flexShrink:"0",fontFamily:"inherit",fontSize:"var(--jx-text-xs)",color:"var(--jx-fg-muted)",border:"1px solid var(--jx-border)",borderRadius:"var(--jx-radius-sm)",padding:"0 5px"},'& [part="option"][aria-selected="true"] [part="chord"]':{color:"inherit",borderColor:"currentColor"},'& [part="badge"]':{fontSize:"var(--jx-text-xs)",padding:"1px var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",background:"var(--jx-border)",color:"var(--jx-fg-dim)"},'& [part="hint"]':{padding:"var(--jx-space-2) var(--jx-space-5)",borderTop:"1px solid var(--jx-border)",color:"var(--jx-fg-muted)",fontSize:"var(--jx-text-xs)"},'& [part="hint"] kbd':{fontFamily:"inherit",color:"var(--jx-fg-dim)"}},children:[{tagName:"div",attributes:{part:"overlay",hidden:"${state.open ? null : ''}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/close"},value:[]}]},children:[{tagName:"div",attributes:{part:"panel"},onclick:{$prototype:"Function",body:[{stopPropagation:!0}]},children:[{tagName:"div",attributes:{part:"input-row"},children:[{tagName:"span",attributes:{part:"chip-slot",role:"none"},$switch:{$ref:"#/state/hasChip"},cases:{true:{tagName:"span",attributes:{part:"chip"},children:[{tagName:"span",attributes:{part:"chip-label"},textContent:"${state.chipLabel}"},{tagName:"jx-action-button",$props:{label:"Clear mode",hint:"Clear mode (Backspace)",icon:"x",size:"sm"},attributes:{part:"chip-remove"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}},{tagName:"input",attributes:{part:"input",type:"text",role:"combobox","aria-controls":"quick-search-listbox","aria-expanded":"${state.expanded ? 'true' : 'false'}","aria-activedescendant":"${state.activeId || null}","aria-autocomplete":"list","aria-label":"${state.placeholder}",placeholder:"${state.placeholder}"},value:{$ref:"#/state/query"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{ArrowDown:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[1]}],ArrowUp:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/move"},value:[-1]}],Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/activate"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/close"},value:[]}],Backspace:[{$switch:{$ref:"#/state/canClearMode"},cases:{true:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/clearMode"},value:[]}]}}]}}]}}]},{tagName:"jx-listbox",attributes:{part:"results",id:"quick-search-listbox"},$props:{label:"Results",active:"${state.activeId}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activateRow"},value:[{$ref:"event#/detail"}]}],description:"One handler for every row, because a row's `select` bubbles. The detail is the row's `value`, which is the index it occupies in `rows` — the same number a hover names, and the number the id is built from."},children:[{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/isEmpty"},cases:{true:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyHint}"}}},{tagName:"div",attributes:{part:"section-slot",role:"none"},$switch:{$ref:"#/state/showSection"},cases:{true:{tagName:"div",attributes:{part:"group-heading"},textContent:"${state.sectionLabel}"}}},{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"jx-option",attributes:{part:"option",id:"quick-search-option-${$map.index}","data-kind":"${$map.item.kind}"},$props:{value:"${$map.index}",label:{$ref:"$map/item/name"},description:{$ref:"$map/item/detail"},disabled:{$ref:"$map/item/disabled"}},onmouseenter:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/hover"},value:[{$ref:"$map/index"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"span",attributes:{slot:"end",part:"trailing-slot"},$switch:{$ref:"$map/item/trailing"},cases:{chord:{tagName:"kbd",attributes:{part:"chord"},textContent:"${$map.item.chord}"},recent:{tagName:"span",attributes:{part:"badge"},textContent:"recent"}}}]}}]},{tagName:"div",attributes:{part:"hint"},children:[{tagName:"kbd",textContent:"↑↓"}," move · ",{tagName:"kbd",textContent:"↵"}," run · ",{tagName:"kbd",textContent:"?"}," modes · ",{tagName:"kbd",textContent:">"}," commands · ",{tagName:"kbd",textContent:"@"}," elements"]}]}]}]};var C=[{mode:"files",prefix:"",chip:"Files",placeholder:"Go to a file…",description:"Open a file by any part of its path — pgblog finds pages/blog/index.md."},{mode:"commands",prefix:">",chip:"Commands",placeholder:"Run a command…",description:"Run anything Studio can do, with its keyboard shortcut printed beside it."},{mode:"nodes",prefix:"@",chip:"Symbols",placeholder:"Go to an element in this document…",description:"Select an element in the open document by its Outline name."},{mode:"projects",prefix:"",chip:"Recent Projects",placeholder:"Open a recent project…",description:"Reopen a project you have had open before."},{mode:"picker",prefix:"?",chip:"Modes",placeholder:"Type ? for modes, > for commands, @ for elements…",description:"List these modes."}],X=new Map(C.map((e)=>[e.mode,e])),O=C.filter((e)=>e.prefix!=="");function _(e){return X.get(e)??C[0]}function L(e,t,o){let a=O.find((s)=>t.startsWith(s.prefix));if(a)return L(a.mode,t.slice(1),o);let i=e;if(i==="picker"&&t.trim()!=="")i="files";if(i==="files"&&!o)i="projects";return{mode:i,query:t}}var Y=new Set(["/","-","_","."," "]);function Z(e,t){if(t==="")return 0;let o=e.toLowerCase(),a=t.toLowerCase(),i=o.lastIndexOf("/")+1,s=0,r=0,v=-2;for(let K of a){let h=o.indexOf(K,r);if(h===-1)return null;if(h===v+1)s+=8;if(h===0||Y.has(o[h-1]??""))s+=6;if(h>=i)s+=4;v=h,r=h+1}return s-v*0.01-o.length*0.001}function w(e,t,o){let a=[];for(let[i,s]of e.entries()){let r=Z(o(s),t);if(r!==null)a.push({index:i,item:s,score:r})}return a.toSorted((i,s)=>s.score-i.score||i.index-s.index).map((i)=>i.item)}function q(e){let t=e.args,o=t?.properties;if(!t||!o)return{kind:"none"};let a=Object.keys(o);if(a.length!==1)return{kind:"unsupported"};let i=a[0],s=o[i];if(s.enum)return{kind:"choice",name:i,choices:s.enum.map((r)=>({label:String(r),value:r}))};if(s.type==="boolean")return{kind:"choice",name:i,choices:[{label:"on",value:!0},{label:"off",value:!1}]};return{kind:"unsupported"}}function N(e){return`quick-search-option-${e}`}var D="jx-studio-recent-commands",ee=6;function H(){try{let e=JSON.parse(localStorage.getItem(D)||"[]");return Array.isArray(e)?e.filter((t)=>n(t)):[]}catch{return[]}}function te(e){let t=[e,...H().filter((o)=>o!==e)].slice(0,ee);try{localStorage.setItem(D,JSON.stringify(t))}catch{}}var z=null,x=!1,b="picker",l="",d=0,y=null,j=!1,c=null;function B(){return Zs("popover","quick-search")}function Sk(e){z=e??null}function zg(e="files"){x=!0,b=e,l="",d=0,c=null,y=null,m(),ye(),M()}function k(){x=!1,c=null,m()}function Q(){return S?S.projectRoot:null}function W(){return S!=null}function J(){return L(b,l,W())}function U(e){let t=e.split("/");return t.pop(),t.length>0?t.join("/"):""}function ne(e){if(e.startsWith("/home/"))return`~/${e.split("/").slice(3).join("/")}`;return e}async function M(){if(!x||y!==null||j||!W())return;j=!0,m();try{await Ht(),y=(await p().searchFiles("",ul())).map((t)=>({kind:"file",path:t.path,name:t.name??t.path.split("/").pop()??"",detail:U(t.path),recent:!1}))}catch{y=[]}j=!1,m()}function oe(e){if(e.trim()==="")return AD(Q()??void 0).map((t)=>({kind:"file",path:t.path,name:t.name,detail:U(t.path),recent:!0}));return w(y??[],e.trim(),(t)=>t.path)}function re(e){let t=hw().map((o)=>({kind:"project",root:o.root,name:o.name,detail:ne(o.root)}));return w(t,e.trim(),(o)=>`${o.name}/${o.root}`)}function ie(e,t){let o=H(),a=[];for(let r of e.visible()){if(q(r).kind==="unsupported")continue;if(!(r.menus??["palette"]).includes("palette"))continue;a.push({kind:"command",id:r.id,name:`${r.category}: ${r.title}`,detail:e.disabledReason(r.id)??"",chord:e.keymap.formatBinding(r.id)??"",enabled:e.isEnabled(r.id),recent:o.includes(r.id)})}let i=w(a,t.trim(),(r)=>r.name);if(t.trim()!=="")return i;let s=o.map((r)=>i.find((v)=>v.id===r)).filter((r)=>r!==void 0);return[...s,...i.filter((r)=>!s.includes(r))]}function se(e){let t=u.value;if(!t)return[];let o=xh(t.doc.document).map((a)=>({kind:"node",path:a.path,name:lf(a.node)?String(a.node).slice(0,60):Tr(a.node),detail:a.nodeType}));return w(o,e.trim(),(a)=>a.name)}function ce(){return C.flatMap((e)=>e.mode==="picker"?[]:[{kind:"mode",mode:e.mode,name:e.chip,detail:e.description,chord:e.prefix}])}function de(e){let t=c,o=t.choices.map((a)=>({kind:"arg",commandId:t.command.id,argName:t.name,value:a.value,name:a.label,detail:`${t.command.title} → ${t.name}`}));return w(o,e.trim(),(a)=>a.name)}function le(){let{mode:e,query:t}=J();if(c)return{rows:de(t),showingRecent:!1};switch(e){case"commands":{let o=ae();return{rows:o?ie(o,t):[],showingRecent:t.trim()===""}}case"nodes":return{rows:se(t),showingRecent:!1};case"projects":return{rows:re(t),showingRecent:t.trim()===""};case"picker":return{rows:ce(),showingRecent:!1};default:return{rows:oe(t),showingRecent:t.trim()===""}}}function pe(e){let t=O.find((o)=>e.startsWith(o.prefix));if(t)b=t.mode,l=e.slice(1);else l=e;if(d=0,e!==l)P().query=e;m(),M()}function me(){b="picker",c=null,d=0,m()}function ue(e){b=e,l="",d=0,m(),M()}function G(e,t){let o=ae();if(!o)return;te(e.id),k(),En(o,e.id,t,"Palette")}function A(e){switch(e.kind){case"project":{k(),z?.openRecentProject(e.root);return}case"file":{k(),hb({name:e.name,path:e.path,root:Q()??""}),yi(e.path);return}case"mode":{ue(e.mode);return}case"node":{k(),rt("selection.set",{path:e.path},"Palette");return}case"arg":{G(c.command,{[e.argName]:e.value});return}default:he(e)}}function he(e){let t=ae(),o=t?.get(e.id);if(!t||!o||!e.enabled)return;let a=q(o);if(a.kind==="choice"){c={choices:a.choices,command:o,name:a.name},l="",d=0,m();return}G(o)}function fe(e){let t=e.split(".").pop()?.toLowerCase();if(t==="json")return"file-code";if(t&&Na(t))return"file-text";return"file"}function ge(e){switch(e.kind){case"project":return"folder-open";case"file":return fe(e.name);case"command":return"play";case"node":return"stack";default:return"caret-right"}}function xe(e,t){if((e.kind==="command"||e.kind==="mode")&&e.chord)return"chord";if(e.kind==="command"&&e.recent)return"recent";return t?"recent":"none"}function be(e){switch(e.kind){case"project":return`project:${e.root}`;case"file":return`file:${e.path}`;case"command":return`command:${e.id}`;case"node":return`node:${e.path.join("/")}`;case"mode":return`mode:${e.mode}`;default:return`arg:${e.value}`}}function ve(e,t){if(j)return"Reading the project's files…";if(t.trim()!=="")return"No results";switch(e){case"projects":return"No recent projects — open one to get started";case"nodes":return"Open a document to jump to its elements";case"commands":return"Type to find any command in Studio";default:return _(e).placeholder}}T("palette",I);var E=null,F=null,f=[];function P(){return E??=g({activate:()=>{let e=f[d];if(e)A(e)},activateRow:(e)=>{let t=f[Number(e)];if(t)A(t)},activeId:"",canClearMode:!1,chipLabel:"",clearMode:me,close:k,emptyHint:"",expanded:!1,hasChip:!1,hover:(e)=>{d=e,P().activeId=N(e)},input:pe,isEmpty:!0,move:(e)=>{if(f.length===0)return;d=Math.max(0,Math.min(d+e,f.length-1)),P().activeId=N(d)},open:!1,placeholder:"",query:"",rows:[],sectionLabel:"",showSection:!1}),E}function ye(){setTimeout(()=>{if(x)B().querySelector('[part="input"]')?.focus()},0)}function m(){let e=P();if(!F)F=R("palette",e,B());if(e.open=x,!x){f=[];return}let{mode:t,query:o}=J(),{rows:a,showingRecent:i}=le(),s=_(t);f=a,e.placeholder=c?`Choose a ${c.name}…`:s.placeholder,e.hasChip=c!==null||t!=="picker",e.chipLabel=c?c.command.title:s.chip,e.query=l,e.canClearMode=l===""&&(c!==null||b!=="picker"),e.rows=a.map((r)=>({chord:(r.kind==="command"||r.kind==="mode")&&r.chord?r.chord:"",detail:r.detail,disabled:r.kind==="command"&&!r.enabled,icon:ge(r),key:be(r),kind:r.kind,name:r.name,trailing:xe(r,i)})),e.expanded=a.length>0,e.activeId=a.length>0?N(d):"",e.isEmpty=a.length===0,e.emptyHint=ve(t,o),e.showSection=i&&a.length>0,e.sectionLabel=c?`${c.command.title} — ${c.name}`:t==="projects"?"Recent projects":t==="commands"?"Recently used":"Recently opened"}
2
+ export{Sk,zg};
3
3
 
4
- //# debugId=33E734815414A14464756E2164756E21
5
- //# sourceMappingURL=studio-x3ge4rts.js.map
4
+ //# debugId=1AB9EA86F1519E9464756E2164756E21
5
+ //# sourceMappingURL=studio-3v5cagy9.js.map
@@ -0,0 +1,5 @@
1
+ import{p}from"./studio-03mqh8ax.js";import{n}from"./studio-zkq3r91p.js";import{le}from"./studio-7xag4na8.js";var a=null,P=null,F=null,g=!1;function S(t){return F=t,g=!0,a?E():Promise.resolve()}async function E(){if(!g)return;g=!1;try{let{applyProjectSchemas:t}=await (le("wasktzfg"),import("./monaco-setup-wasktzfg.js"));t(F)}catch{}}function Jm(){if(a)return Promise.resolve(a);return P??=(async()=>{let[t]=await Promise.all([(le("wqrc68ca"),import("./editor-wqrc68ca.js")),(le("wasktzfg"),import("./monaco-setup-wasktzfg.js"))]);return a=t,await E(),a})(),P}function nf(){return a}function Cv(t,o,e){if(!t?.isConnected||o)return!1;return e()}var i=[],d=null;function Ht(){if(!d)d=(async()=>{try{i=await p().listFormats?.()??[]}catch{i=[]}return i})();return d}function Lh(){d=null,i=[],f=null,c=[],x=null,l=[]}var c=[],f=null;function Qc(){if(!f)f=(async()=>{try{c=await p().listExtensions?.()??[]}catch{c=[]}return c})();return f}function kv(){return c}var l=[],x=null;function w(){if(!x)x=(async()=>{try{l=await p().listExtensionCatalog?.()??[]}catch{l=[]}return l})();return x}function Ux(){return l}async function j(t){let o=null;try{o=await t.fetchProjectSchemas?.()??null}catch{}S(o),await (le("b309c020"),import("./jx-validate-b309c020.js")).then(({applyProjectSchemas:e})=>e(o)).catch(()=>!1)}function ec(t){j(t),w(),(le("8ez2rrk8"),import("./extension-sections-8ez2rrk8.js")).then(({syncExtensionSettingsSections:o})=>o()).catch(()=>{})}function Xd(){return i}function Na(t,o){let e=t.startsWith(".")?t.toLowerCase():`.${t.toLowerCase()}`;return i.find((r)=>r.extensions.includes(e)&&(!o||r.capabilities[o]))}function Wi(t){if(!t)return;return i.find((o)=>o.name===t)}function of(t){return Error(`No format class imported for "${t}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function fn(t){if(!t)return;let o=t.lastIndexOf(".");if(o===-1)return;return Na(t.slice(o))}function ul(t){let o=new Set;for(let e of i){if(t&&!e.documentKinds.includes(t))continue;for(let r of e.extensions)o.add(r)}return o.delete(".json"),[...o]}async function Ev(){return await Ht(),[".json",...ul("page")]}function lr(){return i.find((t)=>t.capabilities.serialize&&t.documentKinds.includes("content"))}async function M(t){let o=p();if(!o.formatAction)throw Error("Platform does not support format actions");return o.formatAction(t)}async function oI(t,o,e){return await M({action:"parse",format:t,options:e,source:o})}async function Aa(t,o,e){return await M({action:"serialize",doc:o,format:t,options:e})}function rI(t,o){let e=t?.studio?.documentMode,r=e?.componentWhen;if(r?.frontmatterKey){let s=o[r.frontmatterKey],u=r.matches?new RegExp(r.matches):/./;if(n(s)&&u.test(s))return{document:o,frontmatter:{},mode:"component"}}if(e?.default==="component")return{document:o,frontmatter:{},mode:"component"};let m=o.children??[];if(Array.isArray(m)&&m.length===0)m.push({children:[],tagName:"p"});let b=new Set(["state","imports"]),h={children:m},y={};for(let[s,u]of Object.entries(o)){if(s==="children")continue;if(b.has(s))h[s]=u;else y[s]=u}return{document:h,frontmatter:y,mode:"content"}}
2
+ export{Jm,nf,Cv,Ht,Lh,Qc,kv,Ux,ec,Xd,Na,Wi,of,fn,ul,Ev,lr,oI,Aa,rI};
3
+
4
+ //# debugId=DEA74E46643F00DD64756E2164756E21
5
+ //# sourceMappingURL=studio-3w35qvay.js.map