@jxsuite/studio 8.0.0 → 8.1.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 (219) hide show
  1. package/dist/chunks/{2020-5wtzce5g.js → 2020-dg097k3e.js} +3 -3
  2. package/dist/chunks/adapter-tck81zft.js +4 -0
  3. package/dist/chunks/{add-new-flow-psym14sn.js → add-new-flow-a1w0bnm6.js} +3 -3
  4. package/dist/chunks/{cf-account-picker-haqazq5r.js → cf-account-picker-ce3kp3x1.js} +3 -3
  5. package/dist/chunks/cf-settings-7ye6x7g2.js +4 -0
  6. package/dist/chunks/color-4gj49xq6.js +4 -0
  7. package/dist/chunks/{color-area-6rbra5dy.js → color-area-vh9cew51.js} +2 -2
  8. package/dist/chunks/{color-field-gy56c94g.js → color-field-e78f16bs.js} +3 -3
  9. package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-fg4yhvk6.js} +2 -2
  10. package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
  11. package/dist/chunks/components-qce0v93f.js +4 -0
  12. package/dist/chunks/content-source-jjx8kgzr.js +4 -0
  13. package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-grnmea6c.js} +3 -3
  14. package/dist/chunks/editor-bkja5dbv.js +4 -0
  15. package/dist/chunks/entry-commands-1wh0btvg.js +4 -0
  16. package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-rp7fkega.js} +3 -3
  17. package/dist/chunks/file-ops-6pe4z7an.js +4 -0
  18. package/dist/chunks/files-ybpp3j38.js +4 -0
  19. package/dist/chunks/format-host-3mtbhxk1.js +4 -0
  20. package/dist/chunks/fs-events-xfanfxds.js +4 -0
  21. package/dist/chunks/grid-open-dg5qmnaj.js +4 -0
  22. package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-x26rfpz1.js} +16 -15
  23. package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
  24. package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-02wzcyvy.js} +4 -4
  25. package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
  26. package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
  27. package/dist/chunks/iframe-host-j2bk2xkc.js +4 -0
  28. package/dist/chunks/{index-32eqzv1k.js → index-203h71wy.js} +3 -3
  29. package/dist/chunks/index-fkrm7pdk.js +4 -0
  30. package/dist/chunks/{javascript-pjp734q4.js → javascript-ww5pv5ae.js} +2 -2
  31. package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-vwbdwwq3.js} +6 -6
  32. package/dist/chunks/jx-validate-w7v32f6a.js +4 -0
  33. package/dist/chunks/layers-g7j732cm.js +4 -0
  34. package/dist/chunks/layers-panel-gjrsxcck.js +4 -0
  35. package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
  36. package/dist/chunks/lit-html-jdfz9rhc.js +4 -0
  37. package/dist/chunks/media-library-9j0v4wmk.js +4 -0
  38. package/dist/chunks/media-picker-cpyyt2m0.js +4 -0
  39. package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
  40. package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-63tqze27.js} +3 -3
  41. package/dist/chunks/monaco-buffer-9wcme176.js +4 -0
  42. package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-zyyynnj8.js} +3 -3
  43. package/dist/chunks/notify-rahnnnv4.js +4 -0
  44. package/dist/chunks/platform-b2aqv7v5.js +4 -0
  45. package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
  46. package/dist/chunks/publish-panel-4yk2461b.js +4 -0
  47. package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-ajzdhhs6.js} +3 -3
  48. package/dist/chunks/publish-workspace-mxestzcf.js +4 -0
  49. package/dist/chunks/quick-search-9g6z65b0.js +4 -0
  50. package/dist/chunks/references-c26enpxs.js +4 -0
  51. package/dist/chunks/right-panel-9d0e0yg7.js +4 -0
  52. package/dist/chunks/source-control-xyn3a8ds.js +4 -0
  53. package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
  54. package/dist/chunks/{studio-x9hsze61.js → studio-02phtmqn.js} +4 -4
  55. package/dist/chunks/{studio-4hp8pkyt.js → studio-0khd0xdw.js} +4 -4
  56. package/dist/chunks/studio-1fvzq9vs.js +5 -0
  57. package/dist/chunks/studio-1gdfsr49.js +12 -0
  58. package/dist/chunks/{studio-3q40e3rj.js → studio-1meqbxns.js} +4 -4
  59. package/dist/chunks/{studio-q0tccd43.js → studio-1yhz0s8p.js} +4 -4
  60. package/dist/chunks/studio-25a5by3h.js +5 -0
  61. package/dist/chunks/{studio-k3xxbagr.js → studio-2b8443ms.js} +3 -3
  62. package/dist/chunks/{studio-3qqjeep5.js → studio-2c2mjyzj.js} +5 -5
  63. package/dist/chunks/studio-2dtc90zs.js +10 -0
  64. package/dist/chunks/{studio-9tmebf0s.js → studio-332hesdk.js} +4 -4
  65. package/dist/chunks/{studio-03ct6yfv.js → studio-3pndhat0.js} +8 -8
  66. package/dist/chunks/{studio-s32578pn.js → studio-3q6n9qvq.js} +4 -4
  67. package/dist/chunks/studio-4dsdnan2.js +9 -0
  68. package/dist/chunks/{studio-ed1hp6zf.js → studio-4fjqdzrb.js} +5 -5
  69. package/dist/chunks/{studio-jcnsdaep.js → studio-533py3yy.js} +4 -4
  70. package/dist/chunks/studio-5abge3wy.js +5 -0
  71. package/dist/chunks/{studio-8tr6cfrc.js → studio-6vrxzkba.js} +4 -4
  72. package/dist/chunks/{studio-jaaz8ce9.js → studio-73wz63nn.js} +4 -4
  73. package/dist/chunks/{studio-bavb31r0.js → studio-74nzv280.js} +4 -4
  74. package/dist/chunks/{studio-q7rtx6zq.js → studio-7cg75gtj.js} +7 -7
  75. package/dist/chunks/studio-89cwmnae.js +5 -0
  76. package/dist/chunks/studio-8m1t83kn.js +7 -0
  77. package/dist/chunks/{studio-q0mvbaq6.js → studio-8nyw10dp.js} +4 -4
  78. package/dist/chunks/{studio-83mk4bgg.js → studio-94ppxeqy.js} +8 -8
  79. package/dist/chunks/{studio-qmn1xc24.js → studio-957jg8g3.js} +4 -4
  80. package/dist/chunks/{studio-r5qy30vx.js → studio-9wyqyfqy.js} +4 -4
  81. package/dist/chunks/studio-a3evp7f6.js +6 -0
  82. package/dist/chunks/{studio-n0c5h6mf.js → studio-a6x058ew.js} +4 -4
  83. package/dist/chunks/studio-ana67wax.js +5 -0
  84. package/dist/chunks/studio-b4xhpcwy.js +4 -0
  85. package/dist/chunks/studio-bf0rgyf7.js +5 -0
  86. package/dist/chunks/{studio-x1x167jh.js → studio-bqgs90r8.js} +4 -4
  87. package/dist/chunks/{studio-qwdqwkj0.js → studio-c4rcaftm.js} +4 -4
  88. package/dist/chunks/{studio-mn0476ag.js → studio-c5dj3dzk.js} +4 -4
  89. package/dist/chunks/studio-cgjt1zce.js +5 -0
  90. package/dist/chunks/{studio-bbe4c90a.js → studio-cpdzrdgp.js} +4 -4
  91. package/dist/chunks/studio-cq87hree.js +5 -0
  92. package/dist/chunks/studio-d140sy8e.js +5 -0
  93. package/dist/chunks/{studio-jsgf2q5k.js → studio-dmn7gpba.js} +5 -5
  94. package/dist/chunks/studio-e8pzjjhf.js +5 -0
  95. package/dist/chunks/{studio-dgk4dqtx.js → studio-f8kz3krj.js} +5 -5
  96. package/dist/chunks/{studio-qgh13jtz.js → studio-fqs1a22a.js} +4 -4
  97. package/dist/chunks/{studio-syreb644.js → studio-fw3jp9m7.js} +4 -4
  98. package/dist/chunks/{studio-ed3xx40h.js → studio-g6ysm05p.js} +6 -6
  99. package/dist/chunks/studio-gmhd0j3f.js +5 -0
  100. package/dist/chunks/{studio-p4nrkvqr.js → studio-gqpty626.js} +4 -4
  101. package/dist/chunks/{studio-kt3pjkwd.js → studio-grp684wx.js} +4 -4
  102. package/dist/chunks/{studio-df0baea9.js → studio-h98520qr.js} +4 -4
  103. package/dist/chunks/{studio-8m0y2qe7.js → studio-hnx1h1pr.js} +4 -4
  104. package/dist/chunks/studio-hvxt8z79.js +5 -0
  105. package/dist/chunks/{studio-43sd2mam.js → studio-hw60n5dh.js} +3 -3
  106. package/dist/chunks/{studio-wbcjbhy1.js → studio-hxq1ebp0.js} +6 -6
  107. package/dist/chunks/{studio-wys23mxz.js → studio-j4e627w1.js} +4 -4
  108. package/dist/chunks/{studio-ccv2svc6.js → studio-j5jqvyn3.js} +4 -4
  109. package/dist/chunks/{studio-881z1xrx.js → studio-jqrg9xxg.js} +4 -4
  110. package/dist/chunks/{studio-b7y5mr30.js → studio-kdseew9m.js} +4 -4
  111. package/dist/chunks/studio-kt2j51sa.js +5 -0
  112. package/dist/chunks/{studio-d5grtb9e.js → studio-m4w6sygj.js} +9 -9
  113. package/dist/chunks/{studio-zz9qe3rw.js → studio-mmqr9awv.js} +37 -37
  114. package/dist/chunks/{studio-5g0rprdt.js → studio-nm9qev4p.js} +5 -5
  115. package/dist/chunks/{studio-tft6r105.js → studio-nsv7g1qn.js} +4 -4
  116. package/dist/chunks/{studio-3e54qh39.js → studio-p89w12s2.js} +5 -5
  117. package/dist/chunks/{studio-y3ahhdpx.js → studio-pbagym4j.js} +4 -4
  118. package/dist/chunks/{studio-w4rz9hdk.js → studio-pr23qhrw.js} +4 -4
  119. package/dist/chunks/{studio-6m380wp7.js → studio-r4ya3sb2.js} +4 -4
  120. package/dist/chunks/studio-rdnezzkd.js +6 -0
  121. package/dist/chunks/{studio-f14e1zdj.js → studio-rm9m3z60.js} +4 -4
  122. package/dist/chunks/studio-tpmnbgmt.js +5 -0
  123. package/dist/chunks/studio-ttxhq5yt.js +5 -0
  124. package/dist/chunks/{studio-nh6d342n.js → studio-txkx6586.js} +6 -6
  125. package/dist/chunks/{studio-a2bvaptz.js → studio-v0gsjav0.js} +4 -4
  126. package/dist/chunks/{studio-fbhxxc5f.js → studio-v2ek69cb.js} +4 -4
  127. package/dist/chunks/{studio-y0n7yxea.js → studio-wcakp5bt.js} +7 -7
  128. package/dist/chunks/{studio-k7evxqh4.js → studio-x3ge4rts.js} +4 -4
  129. package/dist/chunks/{studio-pbxa5fpc.js → studio-xddgbwhe.js} +3 -3
  130. package/dist/chunks/{studio-c05wdnt3.js → studio-y1x65h5r.js} +4 -4
  131. package/dist/chunks/{studio-rthyg42z.js → studio-z42kysg7.js} +169 -169
  132. package/dist/chunks/studio-zf188hnd.js +5 -0
  133. package/dist/chunks/{studio-tfkznv39.js → studio-zht0x0v3.js} +4 -4
  134. package/dist/chunks/{studio-svb7yyve.js → studio-zm7dnr9g.js} +4 -4
  135. package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
  136. package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
  137. package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-vra2hh7y.js} +5 -5
  138. package/dist/chunks/workspace-3nt93k48.js +4 -0
  139. package/dist/chunks/workspace-home-zbgyqqws.js +4 -0
  140. package/dist/chunks/{ws-client-bv552sfx.js → ws-client-72x5n99j.js} +3 -3
  141. package/dist/iframe-entry.js +14 -14
  142. package/dist/manifest.json +75 -75
  143. package/dist/studio.js +80 -80
  144. package/package.json +11 -11
  145. package/src/browse/component-examples.ts +15 -224
  146. package/src/browse/library-preview.ts +6 -13
  147. package/src/browse/preview-root.ts +7 -4
  148. package/src/canvas/canvas-utils.ts +18 -4
  149. package/src/canvas/iframe-editable-root.ts +13 -4
  150. package/src/canvas/iframe-entry.ts +3 -1
  151. package/src/canvas/iframe-interaction.ts +11 -2
  152. package/src/canvas/iframe-render.ts +25 -3
  153. package/src/canvas/preview-placeholder.ts +120 -0
  154. package/src/editor/shortcuts.ts +3 -0
  155. package/src/panels/component-preview.ts +5 -0
  156. package/src/panels/pane-context.ts +43 -18
  157. package/src/panels/site-model.ts +7 -19
  158. package/src/panels/site-panel.ts +2 -25
  159. package/src/panels/stylebook-doc.ts +2 -53
  160. package/src/services/references.ts +0 -0
  161. package/src/style/stylebook-specimens.ts +11 -15
  162. package/src/surfaces/pane-context.json +286 -265
  163. package/src/surfaces/pane-context.ts +17 -8
  164. package/src/tabs/tab.ts +5 -6
  165. package/src/utils/geometry.ts +49 -2
  166. package/dist/chunks/adapter-5tphg7xe.js +0 -4
  167. package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
  168. package/dist/chunks/color-m7r1vk54.js +0 -4
  169. package/dist/chunks/components-r22xca09.js +0 -4
  170. package/dist/chunks/content-source-mmppmcyg.js +0 -4
  171. package/dist/chunks/editor-ccd9jwsa.js +0 -4
  172. package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
  173. package/dist/chunks/file-ops-qnab36ek.js +0 -4
  174. package/dist/chunks/files-rcn56qvm.js +0 -4
  175. package/dist/chunks/format-host-yxz0kjjs.js +0 -4
  176. package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
  177. package/dist/chunks/grid-open-4z1g062t.js +0 -4
  178. package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
  179. package/dist/chunks/index-f0jn7nnp.js +0 -4
  180. package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
  181. package/dist/chunks/layers-bgyr11tr.js +0 -4
  182. package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
  183. package/dist/chunks/lit-html-v9gh687x.js +0 -4
  184. package/dist/chunks/media-library-sq468wts.js +0 -4
  185. package/dist/chunks/media-picker-shfe59pt.js +0 -4
  186. package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
  187. package/dist/chunks/notify-kzrjr3fv.js +0 -4
  188. package/dist/chunks/platform-7v4rtd7m.js +0 -4
  189. package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
  190. package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
  191. package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
  192. package/dist/chunks/references-9547rg5s.js +0 -4
  193. package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
  194. package/dist/chunks/source-control-kwktr9y6.js +0 -4
  195. package/dist/chunks/studio-07rcfje3.js +0 -5
  196. package/dist/chunks/studio-3exxhz5g.js +0 -5
  197. package/dist/chunks/studio-3qeh9t0h.js +0 -6
  198. package/dist/chunks/studio-58xg6j2q.js +0 -9
  199. package/dist/chunks/studio-80jyh1xh.js +0 -4
  200. package/dist/chunks/studio-8vcvfs7r.js +0 -6
  201. package/dist/chunks/studio-fyh0jc96.js +0 -5
  202. package/dist/chunks/studio-gcxk20n7.js +0 -5
  203. package/dist/chunks/studio-m8g16bgz.js +0 -5
  204. package/dist/chunks/studio-mx1smyq0.js +0 -5
  205. package/dist/chunks/studio-pgmvdv7z.js +0 -7
  206. package/dist/chunks/studio-ph84avkf.js +0 -5
  207. package/dist/chunks/studio-rj9eamf8.js +0 -5
  208. package/dist/chunks/studio-rptgsk96.js +0 -5
  209. package/dist/chunks/studio-s19tp1xr.js +0 -5
  210. package/dist/chunks/studio-tf9jryb1.js +0 -10
  211. package/dist/chunks/studio-txf2kysx.js +0 -5
  212. package/dist/chunks/studio-v8867ddv.js +0 -12
  213. package/dist/chunks/studio-vxq7fcvv.js +0 -5
  214. package/dist/chunks/studio-wc649wss.js +0 -5
  215. package/dist/chunks/studio-z97c48fk.js +0 -5
  216. package/dist/chunks/studio-zat62m0c.js +0 -5
  217. package/dist/chunks/studio-zcd2e7yz.js +0 -5
  218. package/dist/chunks/workspace-dz7nxfhv.js +0 -4
  219. package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
@@ -1,5 +1,5 @@
1
- import{p,_e}from"./studio-w4rz9hdk.js";import{qe,ft,T,R,tt}from"./studio-x9hsze61.js";import{g}from"./studio-43sd2mam.js";import{hs}from"./studio-8m0y2qe7.js";import{ze,Js,Ys,on,Kc}from"./studio-ph84avkf.js";import{qc,uA,Ca,Fb,rr}from"./studio-3exxhz5g.js";import{Ad,Od,ZD,qu,yp,XD,Lw}from"./studio-9tmebf0s.js";import{Vx,xn}from"./studio-gcxk20n7.js";import{le}from"./studio-qgh13jtz.js";var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, because a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};T("media-field",C);function G(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function D(t,e,o){let i=g({browse:o.browse,edit:o.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:o.upload,value:e.value,warm:o.warm}),a=null,r=!1;return R("media-field",i,t).then((n)=>{if(r){n.dispose();return}a=n}),{dispose(){r=!0,a?.dispose(),a=null},update:(n)=>G(i,n)}}function Vu(t){let{anchor:e,name:o,scope:i,slot:a}=t,r=document.createElement("div");r.style.pointerEvents="auto",r.setAttribute(qe,ft("popover",a)),tt("popover").append(r);let n=new AbortController,s=null,l=null,c=!1,N=()=>n.signal.aborted,H=(x)=>{if(c)return;if(c=!0,n.abort(),l?.dispose(),l=null,r.remove(),x)t.onDismissed?.()},U=(async()=>{let x={signal:n.signal};if(t.onNodeCreated)x.onNodeCreated=t.onNodeCreated;let I=await R(o,i,r,x);if(N())return;if(l=I,s=I.root,s.setAttribute(qe,ft("popover",a)),s.addEventListener("toggle",(S)=>{if("newState"in S&&S.newState==="closed")H(!0)}),!s.hasAttribute("popover"))await new Promise((S)=>{s?.addEventListener("jx-ready",()=>S(),{once:!0})});if(N())return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();H(!1)},host:r,isOpen:()=>!c,ready:U}}var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{justifyContent:"flex-start"},'& [part="browse-all"]':{$description:"The last row, set apart by a rule: it does not pick a file, it opens the picker that shows all of them.",marginTop:"var(--jx-space-1)",paddingTop:"var(--jx-space-2)",borderTop:"1px solid var(--border)",justifyContent:"flex-start"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so, and the marker is a control (the rule studio.md §5.6 states for every truncation marker): it raises the cap by fifty, so every file the Media workspace lists can be reached from here without a search. Inert "…21 more" text was the panel holding the answer and not showing it.',tagName:"jx-button",attributes:{part:"more"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showMore"},value:[]}]},children:[{tagName:"span",textContent:"${state.moreLabel}"}]}}},{tagName:"jx-button",attributes:{part:"browse-all"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browseAll"},value:[]}]},children:[{tagName:"span",textContent:"${state.browseAllLabel}"}]}]}]};T("media-browser",_);var X="media-picker";function Y(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel,t.browseAllLabel=e.browseAllLabel}function V(t,e,o){let i=g({browseAll:e.browseAll,browseAllLabel:t.browseAllLabel,emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,showMore:e.showMore,x:t.x,y:t.y}),a={anchor:o,name:"media-browser",scope:i,slot:X};if(e.dismissed)a.onDismissed=e.dismissed;let r=Vu(a);return r.ready.then(()=>{if(r.isOpen())r.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:r.close,host:r.host,isOpen:r.isOpen,ready:r.ready,update:(n)=>Y(i,n)}}var b=[],M=!1,L="images";function DT(t){let e=t.replaceAll("\\","/");return e.startsWith("public/")||new RegExp(`^content/[^/]+/${L}/`).test(e)}async function B(t,e){let o=[];try{let i=await hs(()=>e.listDirectory(t));ZD(i);for(let a of i)if(a.type==="directory"){let r=await B(a.path,e);o.push(...r)}else{let r=on(a.name);if(Ys.has(r))o.push({file:a.path,isImage:Js.has(r),kind:uA(a.name),name:a.name,ref:Fb(a.path)})}}catch{}return o}async function Q(t){let e;try{e=(await t.listDirectory("content")).filter((a)=>a.type==="directory").map((a)=>a.path)}catch{return[]}let o=[];for(let i of e){let a=!1;try{a=(await t.listDirectory(i)).some((n)=>n.type==="directory"&&n.name===L)}catch{}if(a)o.push(...await B(`${i}/${L}`,t))}return o}async function Z(t){try{let e=await t.listDirectory(".");return new Set(e.filter((o)=>o.type==="directory").map((o)=>o.name).filter((o)=>o==="public"||o==="content"))}catch{return new Set(["public","content"])}}var h=null,E=0,O=new Set;function NT(t){return O.add(t),()=>{O.delete(t)}}function q(){for(let t of O)t()}function k(){if(M)return Promise.resolve();if(h)return h;if(!_e())return Promise.resolve();let t=E,e=(async()=>{let o=p(),i=await Z(o),[a,r]=await Promise.all([i.has("public")?B("public",o):[],i.has("content")?Q(o):[]]);if(t!==E)return;b=[...a,...r],M=!0,h=null,xn("leftPanel","rightPanel"),q()})();return h=e,e}function Uu(){if(!M)return k(),null;return b}function kw(){b=[],M=!1,E+=1,h=null,XD(),q()}var z=null;function ee(){return z??=(le("sq468wts"),import("./media-library-sq468wts.js")),z}async function O2(t,e={}){(await ee()).openMediaPickDialog({images:e.images===!0,onPick:t})}var y=50,d=null,f=null,v="",u=y,w={},A={x:0,y:0};function m(){let t=v.toLowerCase(),e=w.images?b.filter((r)=>r.isImage):b,o=t?e.filter((r)=>r.ref.toLowerCase().includes(t)||r.name.toLowerCase().includes(t)):e,a=o.slice(0,u).map((r)=>{let n=Lw(Od(r.file));return{caption:n,captionState:n?"shown":"hidden",file:r.file,key:r.file,name:r.name,path:r.ref,thumbSrc:r.isImage?rr(r.file):"",thumbState:r.isImage?"shown":"hidden"}});return{browseAllLabel:w.images?"Browse all images…":"Browse all media…",emptyLabel:e.length>0?"No matches":w.images?"No images in this project yet":"No media in this project yet",filter:v,moreLabel:`Show ${Math.min(o.length-u,y)} more`,moreState:o.length>u?"shown":"hidden",rows:a,rowsState:a.length>0?"listed":"empty",x:A.x,y:A.y}}function P(){let t=d;d=null,f=null,v="",u=y,t?.close()}var j=0;function te(t,e,o){if(!yp(t,e,o)){if(!Ad(t))qu(t).then(()=>d?.update(m()));return}if(j!==0)return;j=requestAnimationFrame(()=>{j=0,d?.update(m())})}function gS(t,e,o={}){P(),k().then(()=>d?.update(m())),f=e,w=o;let i=ze(t);A={x:i.left,y:i.bottom+4},d=V(m(),{browseAll:()=>{let a=f,r=w;if(P(),a)O2(a,r)},dismissed:()=>{d=null,f=null,v="",u=y},measure:te,pick:(a)=>{let r=f;P(),r?.(a)},showMore:()=>{u+=y,d?.update(m())},setFilter:(a)=>{v=a,d?.update(m())}},t)}async function M2(t,e){let o=await Ca([...t]),[i]=o;if(i)e(i.ref)}function bS(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=qc(),e.addEventListener("change",()=>{if(e.files?.length)M2(e.files,t)}),e.click()}var re=400,F=new WeakMap;function W(t,e){let o=Js.has(on(e));return{label:t,thumbSrc:o&&e?Kc(e):"",thumbState:o&&e?"shown":"hidden",value:e}}function Hl(t,e,o,i,a={}){k();let r=F.get(t);if(r){r.prop=e,r.commit=i,r.options=a,r.handle.update(W(e,o));return}let n={commit:i,options:a,prop:e},s=D(t,W(e,o),{browse:(l)=>{gS(l,(c)=>n.commit(c),n.options)},edit:(l)=>Vx(`media:${n.prop}`,re,(c)=>n.commit(c))(l),upload:()=>bS((l)=>n.commit(l)),warm:()=>{k()}});F.set(t,Object.assign(n,{handle:s}))}function pm(t){let e=F.get(t);if(e)F.delete(t),e.handle.dispose()}
2
- export{Vu,DT,NT,Uu,kw,O2,gS,M2,bS,Hl,pm};
1
+ import{p,_e}from"./studio-pr23qhrw.js";import{qe,ft,T,R,tt}from"./studio-02phtmqn.js";import{g}from"./studio-hw60n5dh.js";import{us}from"./studio-hnx1h1pr.js";import{He,Ks,Js,nn,Uc}from"./studio-gmhd0j3f.js";import{Wc,sA,Sa,Ob,or}from"./studio-hvxt8z79.js";import{Dd,Nd,qD,Uu,yp,GD,Cw}from"./studio-332hesdk.js";import{Bx,xn}from"./studio-ana67wax.js";import{le}from"./studio-fqs1a22a.js";var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, because a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};T("media-field",C);function G(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function D(t,e,o){let i=g({browse:o.browse,edit:o.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:o.upload,value:e.value,warm:o.warm}),a=null,r=!1;return R("media-field",i,t).then((n)=>{if(r){n.dispose();return}a=n}),{dispose(){r=!0,a?.dispose(),a=null},update:(n)=>G(i,n)}}function Wu(t){let{anchor:e,name:o,scope:i,slot:a}=t,r=document.createElement("div");r.style.pointerEvents="auto",r.setAttribute(qe,ft("popover",a)),tt("popover").append(r);let n=new AbortController,s=null,l=null,c=!1,N=()=>n.signal.aborted,H=(x)=>{if(c)return;if(c=!0,n.abort(),l?.dispose(),l=null,r.remove(),x)t.onDismissed?.()},U=(async()=>{let x={signal:n.signal};if(t.onNodeCreated)x.onNodeCreated=t.onNodeCreated;let I=await R(o,i,r,x);if(N())return;if(l=I,s=I.root,s.setAttribute(qe,ft("popover",a)),s.addEventListener("toggle",(S)=>{if("newState"in S&&S.newState==="closed")H(!0)}),!s.hasAttribute("popover"))await new Promise((S)=>{s?.addEventListener("jx-ready",()=>S(),{once:!0})});if(N())return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();H(!1)},host:r,isOpen:()=>!c,ready:U}}var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{justifyContent:"flex-start"},'& [part="browse-all"]':{$description:"The last row, set apart by a rule: it does not pick a file, it opens the picker that shows all of them.",marginTop:"var(--jx-space-1)",paddingTop:"var(--jx-space-2)",borderTop:"1px solid var(--border)",justifyContent:"flex-start"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so, and the marker is a control (the rule studio.md §5.6 states for every truncation marker): it raises the cap by fifty, so every file the Media workspace lists can be reached from here without a search. Inert "…21 more" text was the panel holding the answer and not showing it.',tagName:"jx-button",attributes:{part:"more"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showMore"},value:[]}]},children:[{tagName:"span",textContent:"${state.moreLabel}"}]}}},{tagName:"jx-button",attributes:{part:"browse-all"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browseAll"},value:[]}]},children:[{tagName:"span",textContent:"${state.browseAllLabel}"}]}]}]};T("media-browser",_);var X="media-picker";function Y(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel,t.browseAllLabel=e.browseAllLabel}function V(t,e,o){let i=g({browseAll:e.browseAll,browseAllLabel:t.browseAllLabel,emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,showMore:e.showMore,x:t.x,y:t.y}),a={anchor:o,name:"media-browser",scope:i,slot:X};if(e.dismissed)a.onDismissed=e.dismissed;let r=Wu(a);return r.ready.then(()=>{if(r.isOpen())r.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:r.close,host:r.host,isOpen:r.isOpen,ready:r.ready,update:(n)=>Y(i,n)}}var b=[],M=!1,L="images";function ET(t){let e=t.replaceAll("\\","/");return e.startsWith("public/")||new RegExp(`^content/[^/]+/${L}/`).test(e)}async function B(t,e){let o=[];try{let i=await us(()=>e.listDirectory(t));qD(i);for(let a of i)if(a.type==="directory"){let r=await B(a.path,e);o.push(...r)}else{let r=nn(a.name);if(Js.has(r))o.push({file:a.path,isImage:Ks.has(r),kind:sA(a.name),name:a.name,ref:Ob(a.path)})}}catch{}return o}async function Q(t){let e;try{e=(await t.listDirectory("content")).filter((a)=>a.type==="directory").map((a)=>a.path)}catch{return[]}let o=[];for(let i of e){let a=!1;try{a=(await t.listDirectory(i)).some((n)=>n.type==="directory"&&n.name===L)}catch{}if(a)o.push(...await B(`${i}/${L}`,t))}return o}async function Z(t){try{let e=await t.listDirectory(".");return new Set(e.filter((o)=>o.type==="directory").map((o)=>o.name).filter((o)=>o==="public"||o==="content"))}catch{return new Set(["public","content"])}}var h=null,E=0,O=new Set;function TT(t){return O.add(t),()=>{O.delete(t)}}function q(){for(let t of O)t()}function k(){if(M)return Promise.resolve();if(h)return h;if(!_e())return Promise.resolve();let t=E,e=(async()=>{let o=p(),i=await Z(o),[a,r]=await Promise.all([i.has("public")?B("public",o):[],i.has("content")?Q(o):[]]);if(t!==E)return;b=[...a,...r],M=!0,h=null,xn("leftPanel","rightPanel"),q()})();return h=e,e}function Vu(){if(!M)return k(),null;return b}function xw(){b=[],M=!1,E+=1,h=null,GD(),q()}var z=null;function ee(){return z??=(le("9j0v4wmk"),import("./media-library-9j0v4wmk.js")),z}async function I2(t,e={}){(await ee()).openMediaPickDialog({images:e.images===!0,onPick:t})}var y=50,d=null,f=null,v="",u=y,w={},A={x:0,y:0};function m(){let t=v.toLowerCase(),e=w.images?b.filter((r)=>r.isImage):b,o=t?e.filter((r)=>r.ref.toLowerCase().includes(t)||r.name.toLowerCase().includes(t)):e,a=o.slice(0,u).map((r)=>{let n=Cw(Nd(r.file));return{caption:n,captionState:n?"shown":"hidden",file:r.file,key:r.file,name:r.name,path:r.ref,thumbSrc:r.isImage?or(r.file):"",thumbState:r.isImage?"shown":"hidden"}});return{browseAllLabel:w.images?"Browse all images…":"Browse all media…",emptyLabel:e.length>0?"No matches":w.images?"No images in this project yet":"No media in this project yet",filter:v,moreLabel:`Show ${Math.min(o.length-u,y)} more`,moreState:o.length>u?"shown":"hidden",rows:a,rowsState:a.length>0?"listed":"empty",x:A.x,y:A.y}}function P(){let t=d;d=null,f=null,v="",u=y,t?.close()}var j=0;function te(t,e,o){if(!yp(t,e,o)){if(!Dd(t))Uu(t).then(()=>d?.update(m()));return}if(j!==0)return;j=requestAnimationFrame(()=>{j=0,d?.update(m())})}function pS(t,e,o={}){P(),k().then(()=>d?.update(m())),f=e,w=o;let i=He(t);A={x:i.left,y:i.bottom+4},d=V(m(),{browseAll:()=>{let a=f,r=w;if(P(),a)I2(a,r)},dismissed:()=>{d=null,f=null,v="",u=y},measure:te,pick:(a)=>{let r=f;P(),r?.(a)},showMore:()=>{u+=y,d?.update(m())},setFilter:(a)=>{v=a,d?.update(m())}},t)}async function R2(t,e){let o=await Sa([...t]),[i]=o;if(i)e(i.ref)}function fS(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=Wc(),e.addEventListener("change",()=>{if(e.files?.length)R2(e.files,t)}),e.click()}var re=400,F=new WeakMap;function W(t,e){let o=Ks.has(nn(e));return{label:t,thumbSrc:o&&e?Uc(e):"",thumbState:o&&e?"shown":"hidden",value:e}}function jl(t,e,o,i,a={}){k();let r=F.get(t);if(r){r.prop=e,r.commit=i,r.options=a,r.handle.update(W(e,o));return}let n={commit:i,options:a,prop:e},s=D(t,W(e,o),{browse:(l)=>{pS(l,(c)=>n.commit(c),n.options)},edit:(l)=>Bx(`media:${n.prop}`,re,(c)=>n.commit(c))(l),upload:()=>fS((l)=>n.commit(l)),warm:()=>{k()}});F.set(t,Object.assign(n,{handle:s}))}function fm(t){let e=F.get(t);if(e)F.delete(t),e.handle.dispose()}
2
+ export{Wu,ET,TT,Vu,xw,I2,pS,R2,fS,jl,fm};
3
3
 
4
- //# debugId=EBC31114606187AF64756E2164756E21
5
- //# sourceMappingURL=studio-n0c5h6mf.js.map
4
+ //# debugId=DD1C14295610A07864756E2164756E21
5
+ //# sourceMappingURL=studio-a6x058ew.js.map
@@ -0,0 +1,5 @@
1
+ import{n,Z,Xe,te,_,v,Oe,Yo,qn,sf,it}from"./studio-kt2j51sa.js";var pv=400;var Zp=350,NC=300,jO=30000;function sr(e){return Array.isArray(e?.children)?e.children:[]}function fv(e,t,i=""){if(!_(e))return e;if(Array.isArray(e)){for(let[l,s]of e.entries())fv(s,t,`${i}/${l}`);return e}let r=e,{children:o}=r;if(Yo(o)){let l=o;t?.(i,l),r.children=[l]}if(Array.isArray(r.children))for(let[l,s]of r.children.entries())fv(s,t,`${i}/children/${l}`);if(r.$prototype==="Array"&&_(r.map))fv(r.map,t,`${i}/map`);if(_(r.cases))for(let[l,s]of Object.entries(r.cases))fv(s,t,`${i}/cases/${U$(l)}`);return e}function U$(e){return String(e).replaceAll("~","~0").replaceAll("/","~1")}function At(e){return e.length>=2?e.slice(0,-2):null}function hi(e){return e.at(-1)}function q$(e){return e.join("/")}function Tr(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((i,r)=>i===t[r])}function ec(e,t){if(e.length>t.length)return!1;return e.every((i,r)=>i===t[r])}function _h(e,t=[],i=0){let r=[];return u(e,t,i,r,!1),r}function u(e,t,i,r,o){if(n(e)||Z(e)||Xe(e)){if(!o)r.push({depth:i,node:e,nodeType:"text",path:t});return}if(e.$prototype==="Array"){if(!o)r.push({depth:i,node:e,nodeType:"map",path:t});let s=e.map;if(_(s))u(s,[...t,"map"],i+1,r,!1);return}if(!o)r.push({depth:i,node:e,nodeType:"element",path:t});if(e.$props&&it(e.tagName).includes("-")&&!Array.isArray(e.children))return;let{children:l}=e;if(Array.isArray(l))for(let s=0;s<l.length;s++){let a=[...t,"children",s];u(l[s],a,i+1,r,!1)}else if(Yo(l))u(l,[...t,"children"],i+1,r,!1);if(e.$switch&&_(e.cases))for(let[s,a]of Object.entries(e.cases)){let p=[...t,"cases",s];if(_(a)&&a.$ref)r.push({depth:i+1,node:a,nodeType:"case-ref",path:p});else if(_(a))r.push({depth:i+1,node:a,nodeType:"case",path:p}),u(a,p,i+2,r,!0)}}function Lr(e){if(!e)return"?";if(e.$prototype==="Array"){let{items:r}=e;return`Repeater → ${(Oe(r)?r.$ref:void 0)||"items"}`}if(e.$title)return e.$title;if(e.$id)return e.$id;if(e.tagName==="slot"){let r=e.attributes?.name;return n(r)&&r.trim()?`slot: ${r.trim()}`:"slot"}let t=it(e.tagName)||"div",i=e.$switch?" ⇆":"";if(n(e.textContent)&&e.textContent.length>0)return`${t} — ${e.textContent.slice(0,24)}${i}`;return t+i}var S=null;function ed(e){S=e}function wn(){return S}function Sh(e){return _(e)}function Xp(e){if(Array.isArray(e))return e.map((i)=>Xp(i));if(!qn(e))return e;let t={};for(let[i,r]of Object.entries(e)){if(i.startsWith("on")&&sf(r))continue;if(i==="children")t.children=Array.isArray(r)?r.map((o)=>Xp(o)):Xp(r);else if(i==="cases"&&Sh(r)){let o={};for(let[l,s]of Object.entries(r))o[l]=Xp(s);t.cases=o}else if(i==="state"&&Sh(r)){let o={};for(let[l,s]of Object.entries(r)){if(v(s)&&s.timing==="server")continue;o[l]=s}t.state=o}else t[i]=r}return t}var AC=null,Ch=null,G$=null,K$=null,J$=null;function c(e){let t=document.querySelector(`#${e}`);return t instanceof HTMLElement?t:null}function HO(){AC=c("activity-bar"),Ch=c("left-panel"),G$=c("right-panel"),K$=c("toolbar"),J$=c("statusbar")}function Qp(e,t){if(!e)throw TypeError(`#${t} is not in the shell yet; initShellRefs() has not found it`);return e}var Wm=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Y$=[":hover",":focus",":active",":focus-within",":focus-visible",":disabled",":first-child",":last-child","::before","::after","::placeholder"];function Hx(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}var f=new Map;function Bx(e,t,i){let r=t??pv;return(...o)=>{clearTimeout(f.get(e)),f.set(e,setTimeout(()=>{f.delete(e),i(...o)},r))}}function BO(e){clearTimeout(f.get(e)),f.delete(e)}var x=new Map;function b(e){return(_(e)||te(e))&&"then"in e&&te(e.then)}var d=0;function zO(){return d}function m(e,t){d+=1;let i=()=>{d-=1},r=null;try{let o=t();if(b(o))r=o}catch(o){console.error(`Renderer "${e}" failed:`,o)}if(!r){i();return}r.then(i,(o)=>{console.error(`Renderer "${e}" failed:`,o),i()})}function Vm(e,t){x.set(e,t)}function ar(){for(let[e,t]of x.entries())m(e,t)}function xn(...e){for(let t of e){let i=x.get(t);if(!i)continue;m(t,i)}}function cl(e,t){if(e){if(t.selection!==void 0)e.session.selection=t.selection;if(t.hover!==void 0)e.session.hover=t.hover;if(t.clipboard!==void 0)e.session.clipboard=t.clipboard;if(t.ui)Object.assign(e.session.ui,t.ui);if(t.canvas)Object.assign(e.session.canvas,t.canvas)}}function Da(e,t,i){if(e)e.session.ui[t]=i}function WO(e,t){if(e)Object.assign(e.session.canvas,t)}
2
+ export{pv,Zp,NC,jO,sr,fv,U$,At,hi,q$,Tr,ec,_h,Lr,S,ed,wn,Sh,Xp,AC,Ch,G$,K$,J$,HO,Qp,Wm,Y$,Hx,Bx,BO,zO,Vm,ar,xn,cl,Da,WO};
3
+
4
+ //# debugId=036FD6E3871E0C6364756E2164756E21
5
+ //# sourceMappingURL=studio-ana67wax.js.map
@@ -0,0 +1,4 @@
1
+ import{wy,ba,Z0,rs,X0,ss}from"./studio-94ppxeqy.js";import{$e}from"./studio-gqpty626.js";import{n,Z,v}from"./studio-kt2j51sa.js";var PI="meta",FI="frontmatter",jI="structure",HI="source",BI=2;function m(e){return v(e)}function xu(e){return e.getMap(PI)}function zI(e){return e.getMap(FI)}function Rg(e){return e.getMap(jI)}function WI(e){return e.getText(HI)}var Y=new Set(["textContent"]),h=new Set(["style","attributes","$props"]);function y(e,t){let o=e.toString();if(o===t)return!1;let r=0,s=Math.min(o.length,t.length);while(r<s&&o[r]===t[r])r+=1;let a=o.length,i=t.length;while(a>r&&i>r&&o[a-1]===t[i-1])a-=1,i-=1;if(a>r)e.delete(r,a-r);if(i>r)e.insert(r,t.slice(r,i));return!0}function f(e){let t=new rs;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;t.set(o,m(r)?f(r):$e(r))}return t}function g(e,t){for(let o of[...e.keys()])if(!(o in t)||t[o]===void 0)e.delete(o);for(let[o,r]of Object.entries(t)){if(r===void 0)continue;let s=e.get(o);if(m(r))if(s instanceof rs)g(s,r);else e.set(o,f(r));else if(!b(s,r))e.set(o,$e(r))}}function b(e,t){if(e===t)return!0;if(e instanceof rs||e instanceof ba||e instanceof ss)return!1;return JSON.stringify(e??null)===JSON.stringify(t??null)}function d(e){return n(e)?new ss(e):VI(e)}function Bf(e){let t=new ba;return t.insert(0,e.map((o)=>d(o))),t}function VI(e){if(!m(e))throw TypeError("collab-schema: a document node must be a plain object");let t=new rs;for(let[o,r]of Object.entries(e)){if(r===void 0)continue;if(o==="children"&&Array.isArray(r))t.set(o,Bf(r));else if(Y.has(o)&&n(r))t.set(o,new ss(r));else if(h.has(o)&&m(r))t.set(o,f(r));else t.set(o,$e(r))}return t}function S(e){return Object.fromEntries(Array.from(e.entries(),([t,o])=>[t,zf(o)]))}function E(e){if(n(e))return e;return e instanceof ss?e.toString():S(e)}function zf(e){if(e instanceof rs)return S(e);if(e instanceof ba)return e.toArray().map((t)=>zf(t));if(e instanceof ss)return e.toString();return e}function i2(e){return S(Rg(e))}function J0(e,t){let o=Rg(e);for(let r of t)if(o instanceof rs)o=o.get(String(r));else if(o instanceof ba){let s=Number(r);if(!Number.isInteger(s)||s<0||s>=o.length)return;o=o.get(s)}else return;return o}function ak(e,t,o){let r=WI(e);if(r.toString()===t)return!1;return e.transact(()=>{y(r,t)},o),!0}function o2(e,t,o={}){let r=xu(e);if(r.get("structureSeeded")===!0)return!1;return e.transact(()=>{let s=Rg(e);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))s.set(i,Bf(c));else s.set(i,$e(c))}let a=zI(e);for(let[i,c]of Object.entries(o.frontmatter??{}))if(c!==void 0)a.set(i,$e(c));r.set("schemaVersion",BI),r.set("canonical","structure"),r.set("canonicalRev",0),r.set("sourceFormat",o.sourceFormat??null),r.set("structureSeeded",!0)},o.origin),!0}var r2="jx-local",s2="jx-mirror",a2="jx-seed";class _u extends Error{constructor(e){super(`collab-path-unresolved:${e.join("/")}`);this.name="CollabPathError"}}function O(e,t){let o=J0(e,t);if(!(o instanceof rs))throw new _u(t);return o}function p(e,t,o){let r=O(e,t),s=r.get("children");if(s instanceof ba)return s;if(o&&s===void 0){let a=new ba;return r.set("children",a),a}throw new _u([...t,"children"])}function J(e,t,o){let r=e.get(t);if(t==="children"&&Array.isArray(o)){e.set(t,Bf(o));return}if(Y.has(t)&&n(o)){if(r instanceof ss)y(r,o);else e.set(t,new ss(o));return}if(h.has(t)&&v(o)){if(r instanceof rs)g(r,o);else e.set(t,f(o));return}e.set(t,$e(o))}function V(e,t){let{op:o}=t;switch(t.op){case"set-key":{let r=O(e,t.path);if(t.value===void 0)r.delete(t.key);else J(r,t.key,t.value);return}case"insert-child":{let r=p(e,t.parentPath,!0);if(t.index<0||t.index>r.length)throw new _u([...t.parentPath,"children",t.index]);r.insert(t.index,[d(t.node)]);return}case"remove-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new _u([...t.parentPath,"children",t.index]);r.delete(t.index,1);return}case"set-child":{let r=p(e,t.parentPath,!1);if(t.index<0||t.index>=r.length)throw new _u([...t.parentPath,"children",t.index]);let s=r.get(t.index);if(s instanceof ss&&n(t.node)){y(s,t.node);return}r.delete(t.index,1),r.insert(t.index,[d(t.node)]);return}case"move-child":{let r=p(e,t.fromParentPath,!1),s=p(e,t.toParentPath,!0);if(t.fromIndex<0||t.fromIndex>=r.length)throw new _u([...t.fromParentPath,"children",t.fromIndex]);let a=zf(r.get(t.fromIndex));if(r.delete(t.fromIndex,1),t.toIndex<0||t.toIndex>s.length)throw new _u([...t.toParentPath,"children",t.toIndex]);s.insert(t.toIndex,[d(a)]);return}default:throw Error(`unknown-doc-op:${o}`)}}function l2(e,t,o){e.transact(()=>{for(let r of t)V(e,r)},o)}function w(e){for(let t=0;t<e.length;t++){let o=e[t];if(!n(o))continue;if(h.has(o))return{key:o,nodePath:e.slice(0,t)};if(Y.has(o))return{key:o,nodePath:e.slice(0,t)}}return null}function P(e){return e instanceof ss||e instanceof rs||n(e)}function C(e){return e.every((t)=>n(t)||Z(t))}function c2(e){if(e.length===0)return[];let t=e.map((s)=>s.path);if(!t.every((s)=>C(s)))return null;for(let s=0;s<t.length;s++)for(let a=0;a<t.length;a++){if(s===a)continue;let i=t[s],c=t[a];if(i.length<=c.length&&i.every((u,l)=>u===c[l]))return null}if(e.filter((s)=>s instanceof wy).length>1)return null;let r=[];for(let s of e){let{path:a}=s,i=w(a);if(i){let{doc:c}=s.target;if(!c)return null;let u=J0(c,[...i.nodePath,i.key]);if(u===void 0)return null;r.push({key:i.key,op:"set-key",path:i.nodePath,value:zf(u)});continue}if(s instanceof X0){let c=a.at(-1);if(a.at(-2)==="children"&&Z(c)){r.push({index:c,node:s.target.toString(),op:"set-child",parentPath:a.slice(0,-2)});continue}return null}if(s instanceof Z0){let c=s.target;for(let[u,l]of s.changes.keys)if(l.action==="delete")r.push({key:u,op:"set-key",path:a});else r.push({key:u,op:"set-key",path:a,value:zf(c.get(u))})}else if(s instanceof wy){if(a.at(-1)!=="children")return null;let c=a.slice(0,-1),u=0;for(let l of s.changes.delta)if(l.retain!==void 0)u+=l.retain;else if(l.delete!==void 0)for(let x=0;x<l.delete;x++)r.push({index:u,op:"remove-child",parentPath:c});else if(l.insert!==void 0){let x=Array.isArray(l.insert)?l.insert:[l.insert];for(let D of x){if(!P(D))return null;r.push({index:u,node:E(D),op:"insert-child",parentPath:c}),u+=1}}}else return null}return r}function d2(e,t,o){e.transact(()=>{let r=Rg(e),s=[...r.keys()];for(let i of s)if(!(i in t)||t[i]===void 0)r.delete(i);for(let[i,c]of Object.entries(t)){if(c===void 0)continue;if(i==="children"&&Array.isArray(c))r.set(i,Bf(c));else r.set(i,$e(c))}let a=xu(e);a.set("canonicalRev",Number(a.get("canonicalRev")??0)+1)},o)}function lk(e){return xu(e).get("canonical")==="source"?"source":"structure"}function ck(e){return Number(xu(e).get("canonicalRev")??0)}function u2(e,t,o){if(lk(e)==="source")return!1;return e.transact(()=>{ak(e,t,o);let r=xu(e);r.set("canonical","source"),r.set("canonicalRev",ck(e)+1)},o),!0}function h2(e,t){if(lk(e)!=="source")return!1;return e.transact(()=>{let o=xu(e);o.set("canonical","structure"),o.set("canonicalRev",ck(e)+1)},t),!0}function p2(e,t,o){let r=[];for(let[s,a]of e.getStates()){let i=a;if(s!==o&&i.mode==="source"&&i.focusedPath===t)r.push(s)}return r}function f2(e,t){let o=e.clientID,r=e.getStates().get(o);if(r?.mode!=="source"||r.focusedPath!==t)return!1;let s=o;for(let[a,i]of e.getStates()){let c=i;if(c.mode==="source"&&c.focusedPath===t&&c.canWrite!==!1&&a<s)s=a}return s===o}var dk=["#4f9cf9","#e5484d","#30a46c","#f5a524","#8e4ec6","#00a2c7","#e93d82","#a8845c"];function m2(e){let t=5381;for(let r=0;r<e.length;r++)t=Math.imul(t,33)+(e.codePointAt(r)??0);let o=Math.abs(t)%dk.length;return dk[o]}export{PI,FI,jI,HI,BI,xu,zI,Rg,WI,Bf,VI,zf,i2,J0,ak,o2,r2,s2,a2,_u,l2,c2,d2,lk,ck,u2,h2,p2,f2,dk,m2};
2
+
3
+ //# debugId=03841A12917F43E164756E2164756E21
4
+ //# sourceMappingURL=studio-b4xhpcwy.js.map
@@ -0,0 +1,5 @@
1
+ import{jA}from"./studio-7cg75gtj.js";import{mC,u}from"./studio-y1x65h5r.js";import{g}from"./studio-hw60n5dh.js";import{T,R}from"./studio-02phtmqn.js";import{Xt}from"./studio-xddgbwhe.js";import{$e}from"./studio-gqpty626.js";import{n,Z,Xe,_,v,Oe,Ma,Pa}from"./studio-kt2j51sa.js";var B={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},G={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]};var K={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"};var Y={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]};var Ee={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"};var Me={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"};var Re={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"};var Pe={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:String.raw`^\$map/(item|index)(/.*)?$`,type:"string"};var X={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"};var H={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"};var q={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item. A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Ae={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]};var Q={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},ee={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},te={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},re={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"};var oe={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"};var Fe={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},Ne={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."};var Te={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${jA()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},ne={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"};var De={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]};var Je={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},qe={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Le={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Ve={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"};var ow=[301,302,303,307,308],He={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:mC,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:mC,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:mC,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...ow],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"};var Ie={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"};var _e=["literal","ref","template","expression","function"],Vo={expression:"Formula",function:"Inline function",literal:"Fixed value",ref:"From data…",template:"Mixed text"},V_={expression:"Computed from other values, built up operator by operator.",function:"Code that runs when this fires.",literal:"A value you type here, the same every time.",ref:"The current value of a signal, picked from a list.",template:"Text with ${…} placeholders that fill in from signals."};function Fu(e){if(Oe(e))return"ref";if(Ma(e))return"function";if(Pa(e))return"template";if(_(e)&&"$expression"in e)return"expression";return"literal"}var We={oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]},Ue=new Map([["ExpressionEntry",ne],["FunctionDef",oe],["RefObject",X],["StyleObject",H]]);function ze(e){let{properties:t,required:r}=e;return Array.isArray(r)&&r.includes("$ref")&&v(t)&&Boolean(t.$ref)}function Be(e){let{required:t}=e;return Array.isArray(t)&&t.includes("$expression")}function Ge(e){let{properties:t}=e;return v(t)&&v(t.$prototype)&&t.$prototype.const==="Function"}function Ke(e){return e.type==="string"&&e.pattern===void 0&&e.enum===void 0&&e.const===void 0}var Ye=new Set(["array","boolean","integer","null","number","object","string"]);function ie(e,t){if(!v(e))return;if(t.seen.has(e))return;t.seen.add(e);let r=n(e.$ref)?e.$ref:void 0;if(r!==void 0&&Object.keys(e).length===1){let o=r.startsWith("#/$defs/")?r.slice(8):r,l=Ue.get(o);if(l)ie(l,t);else t.unresolved.add(r);return}if(ze(e)){t.found.add("ref");return}if(Be(e)){t.found.add("expression");return}if(Ge(e)){t.found.add("function");return}let a=!1;for(let o of["oneOf","anyOf","allOf"]){let l=e[o];if(Array.isArray(l)){a=!0;for(let y of l)ie(y,t)}}if(a)return;if(Ke(e)){t.found.add("literal"),t.found.add("template");return}if(e.enum!==void 0||e.const!==void 0){t.found.add("literal");return}if(n(e.type)&&Ye.has(e.type))t.found.add("literal")}function Qe(e){let t={found:new Set,seen:new Set,unresolved:new Set};return ie(e,t),{caps:_e.filter((r)=>t.found.has(r)),unresolved:[...t.unresolved].toSorted()}}function ae(e){return Qe(e).caps}var Ze={anyOf:[K,...G.anyOf.slice(1)]},SD=B.anyOf.map((e)=>e.properties.operator.const),et={attribute:Q.additionalProperties,componentProp:ee.additionalProperties,elementProperty:te,eventHandler:We,repeaterFilter:q.properties.filter,repeaterItems:q.properties.items,repeaterSort:q.properties.sort,styleProperty:H.additionalProperties,switchDiscriminant:re,elementTag:Ze,textProperty:Y},de=new Map;function LE(e){let t=de.get(e);if(t)return t;let r=ae(et[e]);return de.set(e,r),r}function Id(e){return n(e)?LE(e):ae(e.schema)}function me(e){return{anyOf:[ae(e).length>0?e:{type:"string"},{$ref:"#/$defs/RefObject"}]}}var pe=new Map,se=new Map;function ce(e,t){return`${u.value?.id??"-"}|${e}|${t}`}function ue(e){return`${u.value?.id??"-"}|${e}`}function fp(e,t,r){pe.set(ce(e,t),$e(r))}function mp(e,t){return pe.has(ce(e,t))}function tt(e,t){return $e(pe.get(ce(e,t)))}function rt(e,t){se.set(ue(e),t)}function fe(e){return e==="literal"||e==="template"}function ju(e,t){let r=ue(e),a=Fu(t),o=se.get(r),l=o!==void 0&&fe(o)&&fe(a)?o:a;return se.set(r,l),l}function Hu(e,t){switch(e){case"ref":{let[r]=t.stateDefs;return r?{$ref:`#/state/${r}`}:{$ref:t.extraSignals?.[0]?.value??""}}case"template":{let[r]=t.stateDefs;return r?`\${state.${r}}`:"${}"}case"expression":return{$expression:{operator:"??",target:null,value:null}};case"function":return{$prototype:"Function",body:"",parameters:[]};default:return t.literalDefault}}function Rd(e,t,r,a,o){return fp(e,t,a),rt(e,r),mp(e,r)?tt(e,r):o}var he={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaForm",$description:"The shared schema→form engine as a document: one row per property of a JSON Schema, drawn from a projection `ui/schema-form.ts` computes. Nothing here reads a schema. The flow decides which of nine controls a property gets, what its options are, which rungs of the value ladder the position permits, what a commit is worth and whether the value is refused; this document draws the answer. That split is what lets the Entry editor, Project Settings and the Signals panel all embed the same form and get the same row — and it is why the engine hands back a HOST ELEMENT rather than a template: a document clears the host it is given, so a caller that is still lit renders an empty element for it and puts it in its own tree (studio-ui-guidelines.md §9.3, §9.4).",tagName:"div",attributes:{part:"form"},style:{$description:"What `.style-row`, `.style-row-label`, `.style-row--invalid`, `.style-row-error`, `.style-row-error-count`, `.array-object-field`, `.array-object-row` and `.schema-param-editor` said in `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Those rules are DEAD in the stylesheet now rather than shared: `ui/field-row.ts` drew the same row for the inspector panels and `ui/expression-editor.ts` the same array rows, and both converted, so this document's copy is the only emitter left. Every `--spectrum-font-size-*` reference is gone rather than renamed — those names resolve only inside `<sp-theme>`, and a document mounted in a settings pane or an entry editor is outside it, so each would silently have taken its hard-coded fallback.",display:"contents",'& [part="field"]':{padding:"var(--jx-space-1) 0"},'& [part="value"]':{$description:"The control line: the source chip, then whatever the rung draws. `min-width: 0` is load-bearing — without it a monospaced pointer or a long JSON line pushes the row past the pane's right edge instead of scrolling inside its own control.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="value"] > *':{minWidth:"0"},'& [part="widget"] > *':{$description:"The switch wrapper is `display: contents`, so whatever rung it drew is the flex item of the line above rather than a box inside a box — which is what keeps `min-width: 0` reaching the control that actually needs it.",flex:"1",minWidth:"0"},'& [part="source"]':{$description:"Quiet while the value is fixed, accent-tinted the moment it is produced from something else — the one place in the row that says a value is not what it looks like.",flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="source"][data-source="bound"]':{color:"var(--accent)"},'& [part="pointer-group"]':{display:"flex",flex:"1",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="pointer-group"] > *':{flex:"1",minWidth:"0"},'& [part="json"]':{display:"flex",flexDirection:"column",flex:"1",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="chips"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="chip"]':{padding:"1px var(--jx-space-2)",borderRadius:"var(--radius)",background:"var(--bg)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",flex:"1",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="row"]':{$description:"Wraps rather than scrolls: an item with five declared properties in a 260px inspector is a column of controls, not a horizontal scroller nobody finds the end of.",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="row"] > [part="cell"]:only-of-type > *':{$description:"A row of one cell (an item of a list of single values: a category, a picture) gives that cell the row's width, so a list reads as the fields around it do rather than as a column of stubs.",flex:"1",minWidth:"0"},'& [part="row-add"]':{alignSelf:"flex-start"},'& [part="field-error"]':{$description:"The left rule is what makes the line read as belonging to the control above it rather than to the row below.",margin:"var(--jx-space-1) 0 0",paddingLeft:"var(--jx-space-2)",borderLeft:"2px solid var(--danger)",fontSize:"var(--jx-text-sm)",lineHeight:"1.35",color:"var(--danger)"},'& [part="field-error-count"]':{marginLeft:"var(--jx-space-1)",fontFamily:"var(--font-mono)",opacity:"0.75"}},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{$description:"One property of the schema. `jx-field` owns the label, the required mark, the invalid shade and the association between the label and whatever control ends up in the slot, so none of that is written here — which is the whole of what the four hand-rolled `.style-row` variants used to carry.",tagName:"jx-field",attributes:{part:"field","data-prop":"${$map.item.prop}"},$props:{label:{$ref:"$map/item/label"},description:{$ref:"$map/item/description"},required:{$ref:"$map/item/required"},invalid:{$ref:"$map/item/invalid"},span:!0},children:[{tagName:"div",attributes:{part:"value",role:"none"},children:[{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChip"},cases:{true:{$description:"The Value Source chip (§6.6): what produces this value, in the same four words every other bindable position in Studio uses. It opens the rung picker rather than cycling, so any rung the position permits is one action away. Drawn only where the host named somewhere a value could come from — a settings form that names none edits fixed values and shows no chip.",tagName:"jx-action-button",attributes:{part:"source","data-source":"${$map.item.source}"},$props:{label:{$ref:"$map/item/sourceName"},hint:{$ref:"$map/item/sourceHint"},size:"sm",haspopup:"menu",disabled:{$ref:"$map/item/sourceLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]}}},{tagName:"span",attributes:{part:"widget",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{$description:"The default control, and the one every scalar without a narrower answer lands on. Commits on input, debounced by the flow, which is what makes the canvas and the preview follow a value being typed rather than waiting for a blur.",tagName:"jx-textfield",attributes:{part:"text"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},size:"sm",invalid:{$ref:"$map/item/invalid"},mono:{$ref:"$map/item/mono"},multiline:{$ref:"$map/item/multiline"},type:{$ref:"$map/item/inputType"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},template:{$description:"The Mixed text rung: a string with `${…}` holes in it. Monospaced because what is being written is half text and half pointer, and committed on change rather than on input — a half-typed placeholder is not a template anybody meant.",tagName:"jx-textfield",attributes:{part:"template"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:"${state.templatePlaceholder}",size:"sm",mono:!0},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},pointer:{$description:"The From data… rung. It is TWO controls over one value because the kit has no combobox and this rung needs one: the list is a set of suggestions rather than a whitelist (a value may point at a route param, a signal, or a pointer neither the form nor its host enumerates), so the select offers what the host named and the field accepts anything. Picking a row writes the field; typing a pointer the host never named leaves the select showing it, because a select whose value matches no option synthesises the row rather than lying about what it holds.",tagName:"span",attributes:{part:"pointer-group",role:"none"},children:[{tagName:"jx-textfield",attributes:{part:"pointer"},$props:{label:"${$map.item.label} pointer",value:{$ref:"$map/item/value"},placeholder:"#/state/…",size:"sm",mono:!0},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"span",attributes:{part:"pointer-pick-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasOptions"},cases:{true:{tagName:"jx-select",attributes:{part:"pointer-pick"},$props:{label:"${$map.item.label} source",options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}}]},select:{$description:"A closed set the schema itself declares, or one the host resolved through a `#/$context/…` pointer. The empty row is offered only where the property is optional — a required field has no “none” to choose.",tagName:"jx-select",attributes:{part:"select"},$props:{label:{$ref:"$map/item/label"},options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm",invalid:{$ref:"$map/item/invalid"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},checkbox:{tagName:"jx-checkbox",attributes:{part:"checkbox"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitChecked"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},number:{$description:"`min`, `max` and `step` come straight off the property schema, so the control refuses out-of-range input before the flow has to say why. The stepper is off: these are configuration values that get typed, not nudged.",tagName:"jx-number-field",attributes:{part:"number"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},min:{$ref:"$map/item/min"},max:{$ref:"$map/item/max"},step:{$ref:"$map/item/step"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},json:{$description:"A value with structure, edited as the JSON it is. The chips above it are a read of the shape currently held — property name and declared type — so the common case (“what is in here?”) is answered without reading the text. The flow parses on a debounce and keeps the last parsable value; a mid-keystroke `{` is not a refusal.",tagName:"span",attributes:{part:"json",role:"none"},children:[{tagName:"span",attributes:{part:"chips-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChips"},cases:{true:{tagName:"span",attributes:{part:"chips",role:"none"},children:[{$prototype:"Array",items:{$ref:"$map/item/chips"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"chip"},textContent:"${$map.item.label}"}}]}}},{tagName:"jx-textfield",attributes:{part:"json-text"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},size:"sm",mono:!0,multiline:!0,grows:!0},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editJson"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},rows:{$description:"An array whose items have a declared shape: one row per item, one cell per declared property of an object item, or one cell for a single-value item (a list of categories, a gallery of pictures), with a remove beside each and one add below. The alternative was the raw-JSON editor, which is what an array of anything else still gets: a shape the schema states is a shape the form can draw.",tagName:"span",attributes:{part:"rows",role:"none"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"row",role:"none","data-row":"${$map.item.key}"},children:[{$prototype:"Array",items:{$ref:"$map/item/cells"},key:{$ref:"$map/item/id"},map:{tagName:"span",attributes:{part:"cell",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{tagName:"jx-textfield",attributes:{part:"cell-text"},$description:"Committed on input AND on change: a cell showing a pointer is committed when it is left, exactly as the pointer field above is, and a cell showing text follows the canvas while it is typed. The two never disagree — a change after an input carries the same string.",$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/label"},size:"sm"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},select:{tagName:"jx-select",attributes:{part:"cell-select"},$props:{label:{$ref:"$map/item/label"},options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},checkbox:{tagName:"jx-checkbox",attributes:{part:"cell-checkbox"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCellChecked"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"cell-number"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},control:{$description:"A cell a registered control owns: a relationship to another collection, or a picture (the media field). The document draws the empty host and nothing inside it; `ui/schema-form.ts` mounts the control into it, by the same dispatch a FIELD host gets. An extension's control is its own surface rather than part of this one, and the seam between them is this empty node.",tagName:"span",attributes:{part:"cell-control-host","data-control":"${$map.item.id}",role:"none"}}}}},{tagName:"jx-action-button",attributes:{part:"row-remove"},$props:{icon:"trash",label:"${$map.item.removeLabel}",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeRow"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"row-add"},$props:{icon:"plus",label:"${$map.item.addLabel}",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addRow"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"Add"}]}]},control:{$description:"A field a registered control owns outright — `schema-builder`, `secret`, or the `reference` picker. The document draws the empty host and the flow MOUNTS the control into it: the registry's contract (specs/extensions.md §9.1) is a control that owns a host, all three built-ins are documents of their own, and a document clears the host it is given — which is why this node is drawn empty and never written to twice.",tagName:"div",attributes:{part:"control-host","data-control":{$ref:"$map/item/key"},role:"none"}}}}]},{tagName:"span",attributes:{part:"error-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasError"},cases:{true:{$description:'§16.1\'s inline tier: why this value is refused, said AT the control that refuses it and for exactly as long as the value stays bad. `role="alert"` so it is announced when it appears, and a repeat counter from two up — “it refused me again” is otherwise indistinguishable from “the field is still red from last time”.',tagName:"p",attributes:{part:"field-error",role:"alert"},children:[{tagName:"span",attributes:{part:"field-error-text"},textContent:"${$map.item.error}"},{tagName:"span",attributes:{part:"error-count-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasCount"},cases:{true:{tagName:"span",attributes:{part:"field-error-count"},textContent:"${$map.item.errorCount}"}}}]}}}]}}]};T("schema-form",he);function nt(e,t){let r=t?.$map,a=v(r)&&v(r.item)?r.item:void 0,o=e==="control-host"?a?.key:e==="cell-control-host"?a?.id:void 0;return n(o)?o:""}function it(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function ye(e,t,r){let a=document.createElement("div");a.style.display="contents";let o=g({...e,...t,templatePlaceholder:"${state.…}"}),l=null,y=!1,b=!1;function d(){y=!0,R("schema-form",o,a,{onNodeCreated:(m,f,S,w)=>{if(!(m instanceof HTMLElement))return;let O=nt(it(S),w);if(O!=="")r(O,m)}}).then((m)=>{if(y=!1,b){m.dispose();return}l=m})}return d(),{dispose(){b=!0,l?.dispose(),l=null,a.textContent=""},host:a,update(m){if(o.fields=m.fields,b||y||l!==null&&a.contains(l.root))return;l?.dispose(),l=null,a.textContent="",d()}}}var M=new Map;function rw(e,t){M.set(e,t)}var at=/^#\/content\/([^/]+)$/;function Bu(e){let t=e?.$ref,r=n(t)?at.exec(t):null;return r?r[1]:null}var ge={resolvePointer:()=>{}};function xe(e,t,r){if(Array.isArray(e))return e;let a;if(v(e)){let l=e.$ref;if(n(l))a=l}else if(n(e))a=e;if(a===void 0||!t)return;let o=t.resolvePointer(a,r);if(Array.isArray(o))return o.map(String);if(v(o))return Object.keys(o);return}function be(e,t){if(e.trim()==="")return Number.NaN;return t?Math.trunc(Number(e)):Number(e)}function Se(e){return e.format!=="json-schema"&&e.type!=="object"&&e.type!=="array"}function st(e){return[...(e.signals??[]).map((t)=>({label:t,value:`#/state/${t}`})),...(e.params??[]).map((t)=>({label:`$params/${t}`,value:`#/$params/${t}`}))]}var F="__none__";function ve(e){if(e===void 0||e===null)return"";return _(e)?JSON.stringify(e,null,2):String(e)}function pt(e,t,r){if(Oe(t))return"";if(t===void 0||t===null||t==="")return r?"Required.":"";if(Array.isArray(e.enum)&&!e.enum.includes(t))return`Choose one of: ${e.enum.map(String).join(", ")}.`;if(e.type==="number"||e.type==="integer"){let o=Z(t)?t:Number(t);if(!Number.isFinite(o))return"Enter a number.";if(e.type==="integer"&&!Number.isInteger(o))return"Enter a whole number.";if(e.minimum!==void 0&&o<e.minimum)return`Must be ${e.minimum} or more.`;if(e.maximum!==void 0&&o>e.maximum)return`Must be ${e.maximum} or less.`;return""}if(e.type==="boolean"&&!Xe(t))return"Must be true or false.";if(e.type==="array"&&!Array.isArray(t))return"Must be a list.";if(e.type==="object"&&!v(t))return"Must be an object.";return""}var ct=500,lt=400,I=new Map;function Fl(e,t,r,a){dt(e);let o=I.get(e);if(!o)o=mt(),I.set(e,o);return o.update(t,r,a),o.host}function dt(e){for(let[t,r]of I)if(t!==e&&!r.host.isConnected)r.dispose(),I.delete(t)}function mt(){let e={},t={},r={onChange:()=>{}},a=ge,o=new Map,l=new Map,y=new Map,b=new Map,d=null,m=(i,s,c)=>{if(clearTimeout(l.get(i)),s<=0){c();return}l.set(i,setTimeout(c,s))},f=(i,s)=>{clearTimeout(l.get(i)),l.delete(i),s()},S=(i,s)=>{r.onChange({[i]:s})},w=(i,s)=>{if(i.commit==="none")return;switch(i.commit){case"ref":{let c=s.trim();S(i.prop,c?{$ref:c}:void 0);return}case"template":{S(i.prop,s);return}case"select":{S(i.prop,s===F?void 0:s);return}case"number":{let c=be(s,i.schema.type==="integer");S(i.prop,Number.isNaN(c)?void 0:c);return}case"json":{try{S(i.prop,JSON.parse(s))}catch{}return}default:{if(i.member!==void 0){let c=t[i.prop],h=v(c)?{...c}:{};if(s)h[i.member]=s;else delete h[i.member];S(i.prop,Object.keys(h).length>0?h:void 0);return}S(i.prop,s||void 0)}}},O=(i,s)=>{let c;if(s.length>0)c=i.scalarItems?s.map((h)=>h[le]??""):s;S(i.prop,c)},P=(i)=>{let s=[];for(let c of i.rows??[])s.push({...c});return s},W={addRow:(i)=>{let s=o.get(i);if(!s?.itemProps)return;let c={};for(let[h,x]of Object.entries(s.itemProps))if(x.default!==void 0)c[h]=x.default;O(s,[...P(s),c]),r.rerender?.()},commit:(i,s)=>{let c=o.get(i);if(c)f(i,()=>w(c,s))},commitChecked:(i,s)=>{let c=o.get(i);if(c)S(c.prop,s)},edit:(i,s)=>{let c=o.get(i);if(c&&c.debounceMs>0)m(i,c.debounceMs,()=>w(c,s))},editCell:(i,s,c,h)=>{p(i,s,c,h)},editCellChecked:(i,s,c,h)=>{p(i,s,c,h)},editJson:(i,s)=>{let c=o.get(i);if(c)m(i,ct,()=>w(c,s))},pickSource:(i,s)=>{U(i,s)},removeRow:(i,s)=>{let c=o.get(i);if(!c)return;let h=Number(s);O(c,P(c).filter((x,C)=>C!==h)),r.rerender?.()}};function p(i,s,c,h){let x=o.get(i);if(!x?.itemProps)return;let C=Number(s),J=P(x),E=J[C];if(!E)return;let A=x.itemProps[c];J[C]={...E,[c]:L(A,h,x.refCells?.has(`${i}/${s}/${c}`)??!1)},O(x,J)}function L(i,s,c){if(Xe(s))return s;let h=String(s);if(c){let x=h.trim();return x?{$ref:x}:void 0}if(i?.type==="integer"||i?.type==="number"){let x=be(h,i.type==="integer");return Number.isNaN(x)?void 0:x}if(h===F||h==="")return;return h}function U(i,s){let c=o.get(i);if(!c?.ladder)return;let{fieldKey:h,mode:x,offered:C,sources:J}=c.ladder;d?.close(),d=Xt({label:"Value source",onClosed:()=>{d=null},opener:s,region:"value-source",rows:C.map((E)=>({checked:E===x?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:E,title:Vo[E]})),run:(E)=>{let A=C.find((Ce)=>Ce===E);if(A===void 0||A===x)return;let z=c.schema.default;if(x==="ref"&&z!==void 0&&!mp(h,"literal"))fp(h,"literal",z);S(c.prop,Rd(h,x,A,$e(t[c.prop]),Hu(A,{extraSignals:J,literalDefault:z,stateDefs:[]})))}})}function N(i){let s=o.get(i);if(s?.control)return{args:{ctx:a,key:s.prop,onChange:(c)=>S(s.prop,c),rerender:r.rerender,schema:s.schema,value:t[s.prop]},control:s.control};for(let c of o.values()){let h=c.cellControls?.get(i);if(!h)continue;let x=(c.rows??[])[Number(h.row)]??{};return{args:{ctx:a,key:h.key,onChange:(C)=>p(c.prop,h.row,h.key,C),rerender:r.rerender,schema:h.schema,value:x[h.key]},control:h.control}}return}function D(i,s){let c=N(i);if(!c)return;let h=b.get(i);if(h?.host===s){h.handle.update(c.args);return}h?.handle.dispose(),b.set(i,{handle:c.control.mount(s,c.args),host:s})}function V(){for(let[i,s]of b)if(!N(i))s.handle.dispose(),b.delete(i)}function j(){V();for(let[i,s]of y)D(i,s)}let k=ye({fields:[]},W,(i,s)=>{y.set(i,s),D(i,s)});return{dispose(){for(let i of l.values())clearTimeout(i);l.clear(),d?.close(),d=null;for(let i of b.values())i.handle.dispose();b.clear(),y.clear(),o.clear(),k.dispose()},host:k.host,update(i,s,c){e=i,t=s,r=c,a=c.context??ge,o.clear(),k.update({fields:ft(e,t,r,a,o)}),j()}}}function ft(e,t,r,a,o){let l=new Set(e.required),y=st(a);return Object.entries(e.properties??{}).flatMap(([b,d])=>{let m={ctx:a,opts:r,plans:o,required:l.has(b),sources:y,value:t},f=je(b,d,m);return f.kind==="control"&&we(d)&&d.properties?.alt?[f,yt(b,m)]:[f]})}var ut=new Set(["src","alt","width","height","title"]);function we(e){let t=e.properties??{};return e.type==="object"&&t.src?.type==="string"&&Object.keys(t).every((r)=>ut.has(r))}function ht(e){let t=(r)=>{let a=v(r.value)?r.value:{},{src:o}=a;return{...r,onChange:(l)=>{if(l===o)return;let{height:y,width:b,...d}=a,m;if(l!==void 0&&l!=="")m={...d,src:l};r.onChange(m)},value:n(o)?o:void 0}};return{mount(r,a){let o=e.mount(r,t(a));return{dispose:()=>o.dispose(),update:(l)=>o.update(t(l))}}}}function yt(e,t){let r=`${e}/alt`,a=t.value[e],o=v(a)?a.alt:void 0,l=je(r,{type:"string"},{...t,required:!1}),y=t.plans.get(r);if(y)y.prop=e,y.member="alt";return{...l,label:`${t.opts.ui?.[e]?.label??e} alt text`,value:n(o)?o:""}}function je(e,t,r){let{ctx:a,opts:o,plans:l,required:y,sources:b,value:d}=r,m=d[e],f={commit:"text",debounceMs:lt,prop:e,schema:t};l.set(e,f);let S=o.errors?.[e]||pt(t,m,Boolean(o.showRequired)&&y),w=o.errorCounts?.[e],O=o.ui?.[e]?.control,P=O?M.get(O):void 0,W=b.length>0&&Se(t)&&!O,p={addLabel:`Add ${e}`,checked:!1,chips:[],description:t.description??"",error:S,errorCount:w!==void 0&&w>1?`×${w}`:"",hasChip:!1,hasChips:!1,hasCount:w!==void 0&&w>1,hasError:S!=="",hasOptions:!1,invalid:S!=="",key:e,kind:"text",label:o.ui?.[e]?.label??e,max:"",min:"",mono:!1,multiline:!1,inputType:"text",options:[],placeholder:"",prop:t.name||e,required:y,rows:[],source:"fixed",sourceHint:"",sourceLabel:"",sourceLocked:!1,sourceName:"",step:"",value:""};if(W){let j=`${a.fieldKeyPrefix??""}.${e}`,k=ju(j,m),i=Id({schema:me(t)});if(f.ladder={fieldKey:j,mode:k,offered:i,sources:b},p.hasChip=!0,p.sourceLabel=Vo[k],p.sourceHint=V_[k],p.source=k==="literal"?"fixed":"bound",p.sourceLocked=!i.some((s)=>s!==k),p.sourceName=p.sourceLocked?`Value source: ${p.sourceLabel} (no other source available here)`:`Value source: ${p.sourceLabel} — click to change`,k==="ref")return f.commit="ref",f.debounceMs=0,p.kind="pointer",p.value=Oe(m)?m.$ref:"",p.options=b.map((s)=>({label:s.label,value:s.value})),p.hasOptions=p.options.length>0,p;if(k==="template")return f.commit="template",f.debounceMs=0,p.kind="template",p.value=String(m??""),p}if(P)return f.commit="none",f.control=P,p.kind="control",p;if(Oe(m)&&Se(t))return f.commit="ref",f.debounceMs=0,p.kind="text",p.mono=!0,p.value=m.$ref,p.placeholder=e,p;if(Bu(t)!==null){let j=M.get("reference");if(j)return f.commit="none",f.control=j,p.kind="control",p}if(t.format==="image"){let j=M.get("media");if(j)return f.commit="none",f.control=j,p.kind="control",p}let L=we(t)?M.get("media"):void 0;if(L)return f.commit="none",f.control=ht(L),p.kind="control",p;let U=o.ui?.[e]?.enum??t.enum,N=xe(U,a,d);if(N)return f.commit="select",f.debounceMs=0,p.kind="select",p.value=m!==void 0?String(m):t.default!==void 0?String(t.default):F,p.options=[...y?[]:[{label:"—",value:F}],...N.map((j)=>({label:j,value:j}))],p;if(t.type==="boolean")return f.commit="none",p.kind="checkbox",p.checked=Boolean(m??t.default??!1),p;if(t.type==="integer"||t.type==="number")return f.commit="number",f.debounceMs=0,p.kind="number",p.value=m!==void 0?String(m):"",p.placeholder=t.default!=null?String(t.default):"",p.min=t.minimum!==void 0?String(t.minimum):"",p.max=t.maximum!==void 0?String(t.maximum):"",p.step=t.type==="integer"?"1":"",p;if(t.format==="json-schema")return f.commit="json",p.kind="json",p.value=m!==void 0?JSON.stringify(m,null,2):"",p.placeholder=t.description??"JSON Schema defining the data shape…",p.chips=bt(m),p.hasChips=p.chips.length>0,p;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties)return $t(e,t.items.properties,r,f,p);if(t.type==="array"&&St(t.items))return xt(e,t.items,r,f,p);let D=Array.isArray(t.type)?t.type:[t.type];if(D.includes("array")||D.includes("object"))return f.commit="json",p.kind="json",p.value=m!==void 0?JSON.stringify(m,null,2):"",p.placeholder=t.default!==void 0?JSON.stringify(t.default):"",p;p.kind="text",p.value=ve(m),p.placeholder=t.default!==void 0?String(t.default):t.examples?.[0]??"",p.inputType=gt.get(t.format??"")??"text";let V=/^"?(\d{4}-\d{2}-\d{2})/.exec(p.value);if(p.inputType==="date"&&V)p.value=V[1]??p.value;return p}var gt=new Map([["date","date"],["email","email"],["uri","url"]]);function bt(e){if(!v(e))return[];let{properties:t}=e;if(e.$ref||t===null||!_(t))return[];return Object.entries(t).map(([r,a])=>({key:r,label:`${r}: ${String((v(a)?a.type:void 0)??"any")}`}))}function $t(e,t,r,a,o){let l=r.value[e],y=Array.isArray(l)?l:[];return a.commit="none",a.itemProps=t,a.rows=y,a.cellControls=new Map,a.refCells=new Set,o.kind="rows",o.rows=y.map((b,d)=>ke(e,String(d),b,t,r,a)),o}var le="value";function St(e){if(e===void 0||e.format==="json-schema")return!1;if(Bu(e)!==null||Array.isArray(e.enum))return!0;return e.type==="string"||e.type==="number"||e.type==="integer"||e.type==="boolean"}function xt(e,t,r,a,o){let l=r.value[e],y=[];if(Array.isArray(l))y=l;else if(l!==void 0&&l!==null&&l!=="")y=[l];let b=y.map((f)=>({[le]:f})),d={[le]:t},m=r.opts.ui?.[e]?.label??e;return a.commit="none",a.itemProps=d,a.rows=b,a.scalarItems=!0,a.cellControls=new Map,a.refCells=new Set,o.kind="rows",o.rows=b.map((f,S)=>{let w=ke(e,String(S),f,d,r,a);for(let O of w.cells)O.label=`${m} ${S+1}`;return w}),o}function ke(e,t,r,a,o,l){return{cells:Object.entries(a).map(([y,b])=>vt(e,t,y,b,r[y],o,l)),field:e,key:t,removeLabel:`Remove ${e} ${Number(t)+1}`}}function vt(e,t,r,a,o,l,y){let b=`${e}/${t}/${r}`,d={checked:!1,field:e,id:b,key:r,kind:"text",label:r,options:[],row:t,value:""};if(Oe(o))return d.value=o.$ref,y.refCells?.add(b),d;if(Bu(a)!==null){let S=M.get("reference");if(S)return d.kind="control",y.cellControls?.set(b,{control:S,key:r,row:t,schema:a}),d}let m=a.format==="image"?M.get("media"):void 0;if(m)return d.kind="control",y.cellControls?.set(b,{control:m,key:r,row:t,schema:a}),d;let f=xe(a.enum,l.ctx,l.value);if(f)return d.kind="select",d.value=o!==void 0?String(o):F,d.options=[{label:"—",value:F},...f.map((S)=>({label:S,value:S}))],d;if(a.type==="boolean")return d.kind="checkbox",d.checked=Boolean(o),d;if(a.type==="integer"||a.type==="number")return d.kind="number",d.value=o!==void 0?String(o):"",d;return d.value=ve(o),d}var wt=/^\{@(\w+)\}$/;function gp(e,t){if(!e.startsWith("#/$context/"))return;let r=[];for(let o of e.slice(11).split("/")){let l=o.match(wt);if(l){let y=t.scope?.[l[1]];if(!n(y)&&!Z(y))return;let b=String(y);if(!b)return;r.push(b)}else r.push(o)}if(r[0]==="$formats"){if(r.length!==1)return;return(t.formats??[]).map((o)=>o.name)}let a=t.projectConfig;for(let o of r){if(!_(a))return;a=a[o]}return a}
2
+ export{ow,Vo,V_,Fu,SD,LE,Id,fp,mp,ju,Hu,Rd,rw,Bu,Fl,gp};
3
+
4
+ //# debugId=E2F791BEAB18CFE664756E2164756E21
5
+ //# sourceMappingURL=studio-bf0rgyf7.js.map
@@ -1,5 +1,5 @@
1
- import{m,_i,Bt}from"./studio-c05wdnt3.js";import{ge,ne,g}from"./studio-43sd2mam.js";import{on}from"./studio-ph84avkf.js";import{jd,Gc,t$,Fb,rr}from"./studio-3exxhz5g.js";import{vp}from"./studio-e1g64q43.js";import{Ad,Od,qu,yp,jT}from"./studio-9tmebf0s.js";import{Ow,Ju,cN}from"./studio-y0n7yxea.js";import{wi,T,R}from"./studio-x9hsze61.js";import{le}from"./studio-qgh13jtz.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function AT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function Ew(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function OT(e){let t=on(e);if(t$.has(t))return"font";let a=Gc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function MT(e,t){let a=[Gc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(jT(t.bytes));if(t?.modified)a.push(`modified ${vp(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function PT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${rr(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function FT(e){let t=cN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function C(e){let{openFileInTab:t}=await (le("rcn56qvm"),import("./files-rcn56qvm.js"));await t(e)}function YD(e,t){let{paneId:a,wrap:r}=e;if(AT(a,t))return;Ew(a);let i=t.documentPath??"",s=rr(i),p=Fb(i),n=on(i),x=OT(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Od(i),l=Ow(i);if(!Ad(i))qu(i).then(u);if(l===null||l.status==="pending")Ju(i).then(u);let f=PT(i);return{extLabel:n||"this file",facts:MT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:wi(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...FT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(yp(i,d,l))u()},openDocument:(d)=>{C(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var H={children:[],tagName:"div"};function Tw(e){return jd(e)}function A(e){return on(e)===".svg"?[b,"source"]:[b]}function fb(e,t={}){let a=m.tabs.get(e);if(a)return Bt(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:A(e)},document:structuredClone(H),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
2
- export{AT,Ew,OT,MT,PT,FT,YD,Tw,fb};
1
+ import{m,_i,Ht}from"./studio-y1x65h5r.js";import{ge,ne,g}from"./studio-hw60n5dh.js";import{nn}from"./studio-gmhd0j3f.js";import{Pd,Vc,JL,Ob,or}from"./studio-hvxt8z79.js";import{vp}from"./studio-e1g64q43.js";import{Dd,Nd,Uu,yp,NT}from"./studio-332hesdk.js";import{Rw,Ku,oN}from"./studio-wcakp5bt.js";import{wi,T,R}from"./studio-02phtmqn.js";import{le}from"./studio-fqs1a22a.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function LT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function _w(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function $T(e){let t=nn(e);if(JL.has(t))return"font";let a=Vc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function IT(e,t){let a=[Vc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(NT(t.bytes));if(t?.modified)a.push(`modified ${vp(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function RT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${or(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function DT(e){let t=oN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function C(e){let{openFileInTab:t}=await (le("ybpp3j38"),import("./files-ybpp3j38.js"));await t(e)}function UD(e,t){let{paneId:a,wrap:r}=e;if(LT(a,t))return;_w(a);let i=t.documentPath??"",s=or(i),p=Ob(i),n=nn(i),x=$T(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Nd(i),l=Rw(i);if(!Dd(i))Uu(i).then(u);if(l===null||l.status==="pending")Ku(i).then(u);let f=RT(i);return{extLabel:n||"this file",facts:IT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:wi(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...DT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(yp(i,d,l))u()},openDocument:(d)=>{C(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var H={children:[],tagName:"div"};function Sw(e){return Pd(e)}function A(e){return nn(e)===".svg"?[b,"source"]:[b]}function pb(e,t={}){let a=m.tabs.get(e);if(a)return Ht(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:A(e)},document:structuredClone(H),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
2
+ export{LT,_w,$T,IT,RT,DT,UD,Sw,pb};
3
3
 
4
- //# debugId=256A365D5C5FE59264756E2164756E21
5
- //# sourceMappingURL=studio-x1x167jh.js.map
4
+ //# debugId=0415CEFD091A4C2264756E2164756E21
5
+ //# sourceMappingURL=studio-bqgs90r8.js.map