@jxsuite/studio 5.6.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-zvax9fmb.js → 2020-cs2sb9t1.js} +3 -3
- package/dist/chunks/adapter-y5gdq19c.js +4 -0
- package/dist/chunks/{cf-account-picker-zfycs4k2.js → cf-account-picker-bb2yq946.js} +3 -3
- package/dist/chunks/cf-settings-20dznc3j.js +4 -0
- package/dist/chunks/components-q037dya7.js +4 -0
- package/dist/chunks/content-source-t0q184js.js +4 -0
- package/dist/chunks/{convert-to-repeater-x19jr6c7.js → convert-to-repeater-vqkt7s3s.js} +3 -3
- package/dist/chunks/editor-j5sq149q.js +4 -0
- package/dist/chunks/entry-commands-fxzgcc4k.js +4 -0
- package/dist/chunks/{extension-sections-y90sa0n4.js → extension-sections-8beq9ac3.js} +3 -3
- package/dist/chunks/file-ops-2n77759h.js +4 -0
- package/dist/chunks/files-fjy7zpxt.js +4 -0
- package/dist/chunks/format-host-wj3mf3n8.js +4 -0
- package/dist/chunks/fs-events-7kcgn4e9.js +4 -0
- package/dist/chunks/git-panel-7z2mpt2d.js +4 -0
- package/dist/chunks/{grid-view-d9mybhn0.js → grid-view-ca10def6.js} +10 -10
- package/dist/chunks/iframe-host-a0zjd6xp.js +4 -0
- package/dist/chunks/{index-vnwy9d44.js → index-9ydfe04y.js} +3 -3
- package/dist/chunks/index-m0x5ztax.js +4 -0
- package/dist/chunks/{javascript-f0nrbdjb.js → javascript-d9pqgc2p.js} +2 -2
- package/dist/chunks/{jsonMode-nfa90dtf.js → jsonMode-800yvbem.js} +4 -4
- package/dist/chunks/jx-validate-zc9zp77s.js +4 -0
- package/dist/chunks/layers-p677nrh5.js +4 -0
- package/dist/chunks/layers-panel-y4w1dq90.js +4 -0
- package/dist/chunks/lit-html-cfn61dn7.js +4 -0
- package/dist/chunks/media-picker-xg7yjpz9.js +4 -0
- package/dist/chunks/menu-fpekzj6w.js +4 -0
- package/dist/chunks/{monaco-binding-antn79jf.js → monaco-binding-62dtmgbf.js} +3 -3
- package/dist/chunks/monaco-buffer-nn4dtx27.js +4 -0
- package/dist/chunks/{monaco-setup-k8s40vwg.js → monaco-setup-tj13ndtm.js} +3 -3
- package/dist/chunks/notify-ahs57a2z.js +4 -0
- package/dist/chunks/platform-v9xyfkbx.js +4 -0
- package/dist/chunks/publish-panel-xtbfgg2r.js +4 -0
- package/dist/chunks/quick-search-d3a6m7j3.js +4 -0
- package/dist/chunks/references-99ws0b0m.js +4 -0
- package/dist/chunks/right-panel-31vbk5xp.js +4 -0
- package/dist/chunks/section-registry-b2yzp9sw.js +4 -0
- package/dist/chunks/{studio-y17505ge.js → studio-01kbbqg3.js} +207 -207
- package/dist/chunks/{studio-gxna6yta.js → studio-01qza1n3.js} +4 -4
- package/dist/chunks/{studio-n2e133d6.js → studio-03wwfvyt.js} +4 -4
- package/dist/chunks/{studio-09n3fyy0.js → studio-0bbxhhce.js} +4 -4
- package/dist/chunks/studio-1a99w39s.js +5 -0
- package/dist/chunks/studio-1q6amtph.js +5 -0
- package/dist/chunks/{studio-eegyf5vg.js → studio-1wvfxkyy.js} +4 -4
- package/dist/chunks/{studio-z47mm077.js → studio-3ck2a5c4.js} +6 -6
- package/dist/chunks/{studio-ymsjnvp9.js → studio-4fde4a0x.js} +4 -4
- package/dist/chunks/{studio-je15p5v8.js → studio-4jj9gme2.js} +5 -5
- package/dist/chunks/{studio-w8w9frjy.js → studio-4m50vh74.js} +12 -12
- package/dist/chunks/{studio-891t1tv9.js → studio-4r0sjtx8.js} +4 -4
- package/dist/chunks/{studio-6exg5z4x.js → studio-4xppwncr.js} +3 -3
- package/dist/chunks/{studio-011em5cf.js → studio-5d7wfmnp.js} +4 -4
- package/dist/chunks/{studio-zkkdbbvd.js → studio-5e9zsamh.js} +6 -6
- package/dist/chunks/{studio-pvj970st.js → studio-5gs9th4b.js} +4 -4
- package/dist/chunks/{studio-dtmdjmqb.js → studio-5vy2wfm5.js} +4 -4
- package/dist/chunks/{studio-654fxcr0.js → studio-7pgy3xaf.js} +4 -4
- package/dist/chunks/{studio-z1vdxq0e.js → studio-7qvs7v0m.js} +4 -4
- package/dist/chunks/studio-84rtc120.js +5 -0
- package/dist/chunks/{studio-ks0ecgjx.js → studio-8xcwewjq.js} +4 -4
- package/dist/chunks/{studio-sadckcpp.js → studio-aekhcdzw.js} +5 -5
- package/dist/chunks/{studio-mf41717j.js → studio-aje966s9.js} +4 -4
- package/dist/chunks/studio-aqmph6k4.js +5 -0
- package/dist/chunks/{studio-28pz4s1k.js → studio-bftp4n4b.js} +4 -4
- package/dist/chunks/{studio-tzs6njnb.js → studio-c6zdm25z.js} +7 -7
- package/dist/chunks/{studio-sgzss898.js → studio-capk0583.js} +7 -7
- package/dist/chunks/{studio-805fwp9k.js → studio-cbr9czkn.js} +4 -4
- package/dist/chunks/{studio-1pxvgx1t.js → studio-chdmwwzw.js} +4 -4
- package/dist/chunks/{studio-dknr8m7b.js → studio-cp1gbff9.js} +7 -7
- package/dist/chunks/{studio-ft8pfpp0.js → studio-cqmtbg2p.js} +4 -4
- package/dist/chunks/studio-e47215hh.js +5 -0
- package/dist/chunks/{studio-9n2j9nqk.js → studio-edbtvcd1.js} +4 -4
- package/dist/chunks/{studio-mm8x32gg.js → studio-evwgp1ym.js} +4 -4
- package/dist/chunks/{studio-02y9cb4h.js → studio-fbx6twps.js} +5 -5
- package/dist/chunks/{studio-0nm2skex.js → studio-fqq890ap.js} +3 -3
- package/dist/chunks/studio-fthwn4kf.js +5 -0
- package/dist/chunks/{studio-s85vah66.js → studio-g8dsj3d2.js} +5 -5
- package/dist/chunks/{studio-0c3fpdqj.js → studio-ge5fqjth.js} +5 -5
- package/dist/chunks/{studio-ebt49j3c.js → studio-gjknvzam.js} +5 -5
- package/dist/chunks/{studio-zkvyd3ev.js → studio-gp02nqnw.js} +4 -4
- package/dist/chunks/{studio-5fc0728f.js → studio-hjbg8d5y.js} +7 -7
- package/dist/chunks/{studio-d007j0z3.js → studio-hnvnfbdv.js} +6 -6
- package/dist/chunks/{studio-b5rxwkj2.js → studio-mk00zd5d.js} +4 -4
- package/dist/chunks/{studio-36s6qjgq.js → studio-n78gjfy8.js} +4 -4
- package/dist/chunks/studio-nbxqcgvf.js +5 -0
- package/dist/chunks/{studio-y164brht.js → studio-pwqfmt4p.js} +4 -4
- package/dist/chunks/studio-qa73881a.js +5 -0
- package/dist/chunks/{studio-6zyt56ek.js → studio-r3kaka4d.js} +4 -4
- package/dist/chunks/{studio-njmg0e73.js → studio-rmn2dz59.js} +5 -5
- package/dist/chunks/{studio-wr0pq67n.js → studio-rr4xkv81.js} +4 -4
- package/dist/chunks/{studio-tj28pxa1.js → studio-semd1s8s.js} +4 -4
- package/dist/chunks/{studio-7w04zw8h.js → studio-st75kn99.js} +5 -5
- package/dist/chunks/{studio-dmymvk2j.js → studio-sxc0zvpt.js} +3 -3
- package/dist/chunks/studio-t1eedsyx.js +4 -0
- package/dist/chunks/{studio-9tkaykt5.js → studio-tmeq6mjb.js} +4 -4
- package/dist/chunks/{studio-153mwkyq.js → studio-tp642n5g.js} +4 -4
- package/dist/chunks/{studio-t0v47dpc.js → studio-tzegmy4w.js} +4 -4
- package/dist/chunks/studio-vavmwshr.js +5 -0
- package/dist/chunks/studio-x5g1xk77.js +5 -0
- package/dist/chunks/studio-x92tgnee.js +64 -0
- package/dist/chunks/{studio-4yztve2t.js → studio-xg1942as.js} +4 -4
- package/dist/chunks/{studio-k9pwvmz8.js → studio-xkfs0dp2.js} +4 -4
- package/dist/chunks/{studio-6k1eswp9.js → studio-y7jehjrp.js} +4 -4
- package/dist/chunks/{studio-81twpmzj.js → studio-yr04mv2j.js} +4 -4
- package/dist/chunks/{studio-gj4j9e7k.js → studio-zd4kayn2.js} +4 -4
- package/dist/chunks/{studio-jsr14n1s.js → studio-zev8ssp1.js} +4 -4
- package/dist/chunks/{studio-r7yeeqc4.js → studio-ztvcxm3w.js} +4 -4
- package/dist/chunks/{tsMode-eq26t9gs.js → tsMode-k9s9fcag.js} +4 -4
- package/dist/chunks/workspace-5vmgsagj.js +4 -0
- package/dist/chunks/{ws-client-3gxqp06s.js → ws-client-0ja08haa.js} +3 -3
- package/dist/iframe-entry.js +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +95 -95
- package/package.json +12 -12
- package/src/canvas/stage-scrollbar.ts +7 -7
- package/src/files/file-ops.ts +5 -8
- package/src/panels/jump-bar.ts +132 -158
- package/src/panels/pane-context.ts +8 -8
- package/src/panels/pane-grid.ts +18 -26
- package/src/panels/style-panel.ts +2 -2
- package/src/services/context-manager.ts +41 -70
- package/src/services/document-assistant.ts +12 -3
- package/src/services/harness/chat-reducer.ts +115 -0
- package/src/services/harness/turn-hooks.ts +50 -0
- package/src/services/tool-executor.ts +69 -288
- package/src/services/tool-outcomes.ts +12 -10
- package/src/studio.ts +2 -5
- package/src/surfaces/block-action-bar.json +6 -1
- package/src/surfaces/jump-bar.json +9 -12
- package/src/surfaces/jump-bar.ts +15 -16
- package/src/surfaces/pane-context.json +2 -2
- package/src/surfaces/pane-grid.json +8 -25
- package/src/surfaces/pane-grid.ts +7 -8
- package/src/surfaces/statusbar.json +71 -3
- package/src/surfaces/statusbar.ts +66 -139
- package/src/surfaces/style-panel.json +3 -3
- package/src/surfaces/style-panel.ts +11 -1
- package/src/ui/schema-form.ts +6 -2
- package/dist/chunks/adapter-6zhjbpmd.js +0 -4
- package/dist/chunks/cf-settings-fpa485q3.js +0 -4
- package/dist/chunks/components-b0vh4sq8.js +0 -4
- package/dist/chunks/content-source-z5t0d0h9.js +0 -4
- package/dist/chunks/editor-7e23n4a8.js +0 -4
- package/dist/chunks/entry-commands-5cm6aba2.js +0 -4
- package/dist/chunks/file-ops-hv7gf757.js +0 -4
- package/dist/chunks/files-kb0epdxf.js +0 -4
- package/dist/chunks/format-host-eg1wy2bp.js +0 -4
- package/dist/chunks/fs-events-ky3vxfmh.js +0 -4
- package/dist/chunks/git-panel-yyg3bzp2.js +0 -4
- package/dist/chunks/iframe-host-9wdf0hes.js +0 -4
- package/dist/chunks/index-2tf0m2ne.js +0 -4
- package/dist/chunks/jx-validate-7w11db9v.js +0 -4
- package/dist/chunks/layers-7zasrpse.js +0 -4
- package/dist/chunks/layers-panel-9nzc4fdq.js +0 -4
- package/dist/chunks/lit-html-5qr7nbng.js +0 -4
- package/dist/chunks/media-picker-maevn9d4.js +0 -4
- package/dist/chunks/menu-wq6q0v3y.js +0 -4
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +0 -4
- package/dist/chunks/notify-g91gjd6w.js +0 -4
- package/dist/chunks/platform-jdwjp2vt.js +0 -4
- package/dist/chunks/publish-panel-8yym447p.js +0 -4
- package/dist/chunks/quick-search-9bzm9kh3.js +0 -4
- package/dist/chunks/references-znssfqvq.js +0 -4
- package/dist/chunks/right-panel-czbzktm8.js +0 -4
- package/dist/chunks/section-registry-0rtq73qs.js +0 -4
- package/dist/chunks/studio-0mm38y62.js +0 -5
- package/dist/chunks/studio-27tc8q0h.js +0 -5
- package/dist/chunks/studio-7djymzt2.js +0 -5
- package/dist/chunks/studio-ant1zbp3.js +0 -5
- package/dist/chunks/studio-b29h7g7s.js +0 -5
- package/dist/chunks/studio-eb5sty2k.js +0 -5
- package/dist/chunks/studio-frv7vjhw.js +0 -5
- package/dist/chunks/studio-mb8jhtr4.js +0 -64
- package/dist/chunks/studio-nvykrgbj.js +0 -4
- package/dist/chunks/studio-nw4q9sdn.js +0 -5
- package/dist/chunks/studio-p6avneaq.js +0 -5
- package/dist/chunks/studio-vz7b43ng.js +0 -5
- package/dist/chunks/workspace-emt8454d.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{qt,wi,Zt,$r,Us}from"./studio-ft8pfpp0.js";import{ge,Q,v,S}from"./studio-0nm2skex.js";import{vi,q,Ol,ot,yi,li,ke,fa,ro,je,Dx,vp,Ml,xv,g,u,ci}from"./studio-27tc8q0h.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-dknr8m7b.js";import{Mw,ku,fd,Eu}from"./studio-jsr14n1s.js";import{xi,T,R}from"./studio-z1vdxq0e.js";import{fc,bb,Tu,Jf,BE,R1}from"./studio-4yztve2t.js";import{pr}from"./studio-w8w9frjy.js";import{KE}from"./studio-eb5sty2k.js";import{Ew,ub,sa,w1,EE}from"./studio-frv7vjhw.js";import{D}from"./studio-153mwkyq.js";import{Ae}from"./studio-mm8x32gg.js";import{me}from"./studio-09n3fyy0.js";var Cw=["string","number","boolean","array","object","reference"],Sw=["","image","date","color"];function Vf(e){if(e.$ref)return"reference";return e.type||"string"}function uc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Os(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Se=Cw.map((e)=>({label:e,value:e})),Fe=Sw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Ne(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,ee=t.map((n)=>({label:n,value:n}));return ee}function E(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Te(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function Ee(e,r,t,a,n){let s=V(r,t),l=Vf(a);return{format:uc(a),hasFormat:E(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=Vf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,h])=>Ee(e,r,w,h,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:uc(t),hasFormat:E(s),key:r,label:Ml(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Ne(t.ctx);return{addFormat:n.add.format,addHasFormat:E(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([m,f])=>Ce(n,m,f,d.includes(m),c.length>0)),formatOptions:Fe,targets:c,typeOptions:Se}},p=()=>N.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},h=(i)=>{let d=Te(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},N=Y(e,{addNested(i){let d=x(i),c=xv(d.name.trim());if(!c)return;h((m)=>{let f=y(m,i);if(!f)return!1;return f.properties??={},f.properties[c]=Os(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=xv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:m}=n.add;n.addOpen=!1,n.add={...j},h((f)=>{if(f.properties[i]=Os(m,d||void 0),c)M(f,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){h((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){h((c)=>{let m=y(c,i);if(!m?.properties?.[d])return!1;if(delete m.properties[d],m.required)m.required=m.required.filter((f)=>f!==d);return!0})},renameField(i,d){o(A(i),d);let c=xv(d.trim());h((m)=>{if(!m.properties[i]||!c||c===i||m.properties[c])return!1;return ae(m.properties,i,c),m.required=m.required.map((f)=>f===i?c:f),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let m=xv(c.trim());h((f)=>{let b=y(f,i);if(!b?.properties?.[d]||!m||m===d||b.properties[m])return!1;if(ae(b.properties,d,m),b.required)b.required=b.required.map((C)=>C===d?m:C);return!0})},setFormat(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;return c.properties[i]=Os(m.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;return f.properties[d]=Os(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),h((m)=>{let f=y(m,i);if(!f)return!1;return M(f,d,c),!0})},setNestedType(i,d,c){h((m)=>{let f=y(m,i),b=f?.properties?.[d];if(!f?.properties||!b)return!1;let C=E(c)?uc(b):void 0;return f.properties[d]=Os(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),h((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){h((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){h((c)=>{let m=c.properties[i];if(!m)return!1;let f=E(d)?uc(m):void 0;return c.properties[i]=Os(d,f||void 0),!0})}});return p(),{dispose:()=>N.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var De={mount:Re};Mw("schema-builder",De);function oe(e){return typeof e==="string"&&e?e:null}function qe(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((h)=>{if(typeof h==="string"&&h&&h!==w)o(h)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var He={mount:qe};Mw("secret",He);var k=new Map,P=new Map,F=new Map;function B(e){if(e===void 0)k.clear(),P.clear(),F.clear();else k.delete(e),P.delete(e),F.delete(e)}function Oe(e){let r=k.get(e);if(r)return r;let t=(me("z5t0d0h9"),import("./content-source-z5t0d0h9.js")).then((a)=>a.listCollectionEntryIds(e));return k.set(e,t),t}function b1(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=F.get(e);if(n){if(r)n.add(r);return null}F.set(e,new Set(r?[r]:[]));let s=(l)=>{if(k.get(e)!==a)return;let p=F.get(e);F.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=ku(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=b1(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=ku(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};Mw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,h)=>{if(o instanceof HTMLElement&&Be(h)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Uf(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);vi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,KE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Ol(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function v1(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function db(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,fc,r))}function SE(e){let r=sa(e.documentPath),t=Uf(e);if(!r||!Jf(r.schema,t))return null;let a=Tu(t);return{draft:a,text:a?"Draft":"Published",title:a?bb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Eu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of EE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=xi(e,"entry"),n=xi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:bb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Uf(r),l=Tu(s);return{collection:t.name,draft:l,draftAxis:Jf(t.schema,s)?"shown":"hidden",draftHint:bb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:bb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function kE(e,r){let{paneId:t,wrap:a}=e;if(v1(t,r))return;db(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Uf(r),N=fd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(N.parentNode!==s)s.replaceChildren(N)},o=()=>{let y=sa(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),h=le(a,ue(t,r,sa(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(sa(r.documentPath))}});n={paneId:t,scope:w,surface:h,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{Q(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("kb0epdxf"),import("./files-kb0epdxf.js"));await r(e);for(let[t,a]of g.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return ub().map((e)=>e.name)}async function Ue(e){let r=w1(e.schema),t=(e.def.format?wi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??$r()?.name;if(e.ext===".json"||t===void 0)return pr(r,null);return Us(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function kw(e,r={}){let t=Ew(e);if(!t)return S.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return S.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&vp(n)?.name===t.name?n:t.dir;if(s.includes(Dx))return S.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("kb0epdxf"),import("./files-kb0epdxf.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&sa(e.documentPath)?e:null}function Ye(){return[{args:ke({collection:fa(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await kw(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:ke({path:je("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:ke({draft:ro("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,yi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:ke({include:ro("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{BE(yi("content.setIncludeDrafts",r,"include")),await R1()},title:"Include Drafts"}]}function y1(e){e.registerAll(Ye())}
|
|
2
|
-
export{
|
|
1
|
+
import{qt,wi,Zt,Dr,Us}from"./studio-cqmtbg2p.js";import{ge,Q,v,k}from"./studio-fqq890ap.js";import{vi,q,Ol,ot,yi,li,Se,fa,oo,He,Dx,bp,Ml,xv,m,u,ci}from"./studio-x5g1xk77.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-cp1gbff9.js";import{Pw,Eu,fd,Tu}from"./studio-zev8ssp1.js";import{Zi,T,R}from"./studio-7qvs7v0m.js";import{fc,mb,Lu,Gf,FE,I1}from"./studio-xg1942as.js";import{pr}from"./studio-4m50vh74.js";import{HE}from"./studio-qa73881a.js";import{Tw,cb,sa,y1,CE}from"./studio-84rtc120.js";import{D}from"./studio-tp642n5g.js";import{Ae}from"./studio-evwgp1ym.js";import{me}from"./studio-0bbxhhce.js";var kw=["string","number","boolean","array","object","reference"],Sw=["","image","date","color"];function zf(e){if(e.$ref)return"reference";return e.type||"string"}function uc(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function Ms(e,r){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return r?{items:{format:r,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return r?{format:r,type:"string"}:{type:"string"}}}var U={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaBuilder",$description:'The `schema-builder` form control (specs/extensions.md §9.1): the visual editor for a JSON Schema object, drawn as one card per property. A descriptor names it with `"ui": { "<prop>": { "control": "schema-builder" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. The adapter (`surfaces/schema-builder.ts`) hands in the fields already classified and every draft the reader is part-way through typing; `ui/form-controls.ts` decides what a field may be renamed to and what reaches the host\'s `onChange`. Nothing here reads a schema: a document that re-derived a field\'s type while drawing would be a second opinion about what one module already owns. **The card is `surfaces/settings-defs.json`\'s, part for part.** Data Shapes edits the project\'s `$defs` and this edits a content type\'s `schema`; they are the same object with the same six controls per row, so the row vocabulary — `card`, `field-row`, `field-label`, `field-name`, `field-type`, `field-format`, `field-required`, `field-delete`, `nested`, `nested-card`, `nested-add-name`/`-type`/`-button`, `ref-target`, `add-form` — is ONE vocabulary, and the row views it is drawn from are that surface\'s own types rather than a second declaration of them. What differs is only what encloses it: Data Shapes carries the two-column chrome that chooses WHICH shape is being edited, and this one is handed the object to edit.',tagName:"div",attributes:{part:"builder"},style:{$description:"What `.schema-builder`, `.schema-field-list`, `.schema-field-card`, `.schema-field-row`, `.schema-field-nested`, `.schema-field-name-input`, `.schema-nested-add`, `.schema-nested-add-name` and `.schema-add-field` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer — the same translation `surfaces/settings-defs.json` carries, because it is the same card. Two values could not come with them. `.schema-field-card--nested` read `var(--spectrum-gray-300, #444)`, and the caption was an `sp-field-label` at whatever size Spectrum drew it; a document is mounted in the pane rather than inside `<sp-theme>`, so both would have taken their hard-coded fallback every time. The nested card takes the studio layer's `--border`, and the caption says what it is in the type ramp instead.",display:"block",'& [part="fields"]':{display:"flex",flexDirection:"column",gap:"4px",marginBottom:"12px"},'& [part="card"], & [part="nested-card"]':{border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"6px 10px"},'& [part="field-row"]':{display:"flex",alignItems:"center",gap:"8px"},'& [part="field-label"]':{$description:"The field's name in words: a caption on the row rather than a label for a control, since the raw key beside it is what the reader edits and what carries the accessible name.",flex:"none",minWidth:"84px",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="field-name"]':{flex:"1",maxWidth:"140px"},'& [part="nested"]':{marginLeft:"16px",marginTop:"6px",paddingLeft:"8px",borderLeft:"2px solid var(--border)",display:"flex",flexDirection:"column",gap:"4px"},'& [part="ref-target"]':{display:"flex",marginTop:"6px",maxWidth:"220px"},'& [part="nested-add"]':{display:"flex",alignItems:"center",gap:"6px",padding:"4px 0"},'& [part="nested-add-name"]':{flex:"1",maxWidth:"120px"},'& [part="add-form"]':{display:"flex",alignItems:"center",gap:"8px",padding:"8px 0"}},children:[{tagName:"div",attributes:{part:"fields"},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card","data-field":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"span",attributes:{part:"field-label"},textContent:"${$map.item.label}"},{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.label}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameField"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.label}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFormat"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",$description:"Whether the object requires this field. The word on screen is the name: `Req` is slotted rather than passed as `label`, because the kit's switch wraps its control in the label the slot lands in, and a second name would be announced over the top of it. Which row it belongs to is the tooltip's job instead, which is what `hint` is.",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.label}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRequired"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.label}",hint:"Delete ${$map.item.label}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeField"},value:[{$ref:"$map/item/key"}]}]}}]},{tagName:"div",attributes:{part:"extra-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/extra"},cases:{reference:{tagName:"div",attributes:{part:"ref-target"},children:[{tagName:"jx-select",attributes:{part:"ref-target-select"},$props:{label:"Target for ${$map.item.label}",size:"sm",options:{$ref:"#/state/targets"},value:{$ref:"$map/item/refTarget"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setTarget"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},nested:{tagName:"div",attributes:{part:"nested"},children:[{$prototype:"Array",items:{$ref:"$map/item/children"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"nested-card","data-nested":"${$map.item.key}"},children:[{tagName:"div",attributes:{part:"field-row"},children:[{tagName:"jx-textfield",attributes:{part:"field-name"},$props:{label:"Name for ${$map.item.parent}.${$map.item.key}",size:"sm",value:{$ref:"$map/item/name"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-select",attributes:{part:"field-type"},$props:{label:"Type for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/type"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedType"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"field-format"},$props:{label:"Format for ${$map.item.parent}.${$map.item.key}",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"$map/item/format"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedFormat"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"field-required"},$props:{hint:"Require ${$map.item.parent}.${$map.item.key}",size:"sm",checked:{$ref:"$map/item/required"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setNestedRequired"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Req"}]},{tagName:"jx-action-button",attributes:{part:"field-delete"},$props:{label:"Delete ${$map.item.parent}.${$map.item.key}",hint:"Delete ${$map.item.parent}.${$map.item.key}",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeNested"},value:[{$ref:"$map/item/parent"},{$ref:"$map/item/key"}]}]}}]}]}},{tagName:"div",attributes:{part:"nested-add"},children:[{tagName:"jx-textfield",attributes:{part:"nested-add-name"},$props:{label:"New field in ${$map.item.label}",placeholder:"field name",size:"sm",value:{$ref:"$map/item/draftName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftName"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-select",attributes:{part:"nested-add-type"},$props:{label:"Type of the new field in ${$map.item.label}",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"$map/item/draftType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editDraftType"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"nested-add-button"},$props:{label:"Add a field to ${$map.item.label}",hint:"Add a field to ${$map.item.label}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addNested"},value:[{$ref:"$map/item/key"}]}]}}]}]}}}]}}]},{tagName:"div",attributes:{part:"add-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"add-open"},$props:{label:"Add Field",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add Field"}]},open:{tagName:"div",attributes:{part:"add-form"},children:[{tagName:"jx-textfield",attributes:{part:"add-name"},$props:{label:"New field name",placeholder:"Field name",size:"sm",value:{$ref:"#/state/addName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddName"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]}}]}},{tagName:"jx-select",attributes:{part:"add-type"},$props:{label:"Type of the new field",size:"sm",options:{$ref:"#/state/typeOptions"},value:{$ref:"#/state/addType"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddType"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"add-format-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/addHasFormat"},cases:{true:{tagName:"jx-select",attributes:{part:"add-format"},$props:{label:"Format of the new field",size:"sm",options:{$ref:"#/state/formatOptions"},value:{$ref:"#/state/addFormat"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddFormat"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"jx-switch",attributes:{part:"add-required"},$props:{hint:"Require the new field",size:"sm",checked:{$ref:"#/state/addRequired"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editAddRequired"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Required"}]},{tagName:"jx-button",attributes:{part:"add-confirm"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirmAdd"},value:[]}]},children:[{tagName:"span",textContent:"Add"}]},{tagName:"jx-button",attributes:{part:"add-cancel"},$props:{size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancelAdd"},value:[]}]},children:[{tagName:"span",textContent:"Cancel"}]}]}}}]};T("schema-builder",U);function be(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function Y(e,r){e.textContent="";let t=v({...be(),...r}),a=null,n=!0,s=!1,l=()=>R("schema-builder",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.addFormat=o.addFormat,t.addHasFormat=o.addHasFormat,t.addName=o.addName,t.addRequired=o.addRequired,t.addState=o.addState,t.addType=o.addType,t.fields=o.fields,t.formatOptions=o.formatOptions,t.targets=o.targets,t.typeOptions=o.typeOptions,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var G={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",G);function ve(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function K(e,r){e.textContent="";let t=v({...ve(),...r}),a=null,n=!0,s=!1,l=()=>R("reference-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.canRetry=o.canRetry,t.disabled=o.disabled,t.hasNote=o.hasNote,t.kind=o.kind,t.label=o.label,t.note=o.note,t.noteTone=o.noteTone,t.options=o.options,t.value=o.value,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",X);function xe(){return{disabled:!0,label:"",placeholder:"Not set"}}function Z(e,r){e.textContent="";let t=v({...xe(),...r,shown:""}),a=null,n=!0,s=!1,l=()=>R("secret-field",t,e).then((o)=>{if(n=!1,s)return o.dispose(),o.root;return a=o,o.root}),p=l();return{clear(){t.shown=" ",t.shown=""},dispose(){s=!0,a?.dispose(),a=null,e.textContent=""},host:e,ready:p,update(o){if(t.disabled=o.disabled,t.label=o.label,t.placeholder=o.placeholder,s||n||a!==null&&e.contains(a.root))return;a?.dispose(),a=null,n=!0,e.textContent="",l()}}}var Fe=kw.map((e)=>({label:e,value:e})),Ne=Sw.map((e)=>({label:e||"(none)",value:e})),j={format:"",name:"",required:!1,type:"string"},ee=[],re=" ";function Te(e){let r=e.resolvePointer("#/$context/content"),t=r&&typeof r==="object"&&!Array.isArray(r)?Object.keys(r):[],a=t.join(" ");if(a!==re)re=a,ee=t.map((n)=>({label:n,value:n}));return ee}function N(e){return e==="string"||e==="array"}function ie(e){return e&&typeof e==="object"&&!Array.isArray(e)?e:{properties:{},required:[],type:"object"}}function Ee(e){let r=JSON.parse(JSON.stringify(ie(e)));return r.type??="object",r.properties??={},r.required??=[],r}function A(e){return`name:${e}`}function H(e){return`required:${e}`}function V(e,r){return`${e} ${r}`}function O(e,r,t){return e.echo?.id===r?e.echo.value:t}function ke(e,r,t,a,n){let s=V(r,t),l=zf(a);return{format:uc(a),hasFormat:N(l),key:t,name:O(e,A(s),t),parent:r,required:O(e,H(s),n),type:l}}function Ce(e,r,t,a,n){let s=zf(t),l=s==="object",p=e.drafts.get(r),o=t.required??[];return{children:l?Object.entries(t.properties??{}).map(([w,g])=>ke(e,r,w,g,o.includes(w))):[],draftName:p?.name??"",draftType:p?.type??"string",extra:s==="reference"&&n?"reference":l?"nested":"none",format:uc(t),hasFormat:N(s),key:r,label:Ml(r),name:O(e,A(r),r),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,H(r),a),type:s}}function ae(e,r,t){let a={};for(let[n,s]of Object.entries(e))a[n===r?t:n]=s,delete e[n];Object.assign(e,a)}function M(e,r,t){e.required??=[];let a=e.required.indexOf(r);if(t&&a===-1)e.required.push(r);if(!t&&a!==-1)e.required.splice(a,1)}function Re(e,r){let t=r,a=null,n={add:{...j},addOpen:!1,drafts:new Map,echo:null},s=()=>a??ie(t.value),l=()=>{let i=s(),d=i.required??[],c=Te(t.ctx);return{addFormat:n.add.format,addHasFormat:N(n.add.type),addName:n.add.name,addRequired:n.add.required,addState:n.addOpen?"open":"closed",addType:n.add.type,fields:Object.entries(i.properties??{}).map(([f,h])=>Ce(n,f,h,d.includes(f),c.length>0)),formatOptions:Ne,targets:c,typeOptions:Fe}},p=()=>F.update(l()),o=(i,d)=>{n.echo={id:i,value:d},p()},w=()=>{n.echo=null,p()},g=(i)=>{let d=Ee(s());if(!i(d)){w();return}a=d,n.echo=null,t.onChange(d),p()},y=(i,d)=>i.properties[d],x=(i)=>{let d=n.drafts.get(i);if(!d)d={name:"",type:"string"},n.drafts.set(i,d);return d},F=Y(e,{addNested(i){let d=x(i),c=xv(d.name.trim());if(!c)return;g((f)=>{let h=y(f,i);if(!h)return!1;return h.properties??={},h.properties[c]=Ms(d.type||"string"),d.name="",!0})},cancelAdd(){n.addOpen=!1,n.add={...j},p()},confirmAdd(){let i=xv(n.add.name.trim());if(!i)return;let{format:d,required:c,type:f}=n.add;n.addOpen=!1,n.add={...j},g((h)=>{if(h.properties[i]=Ms(f,d||void 0),c)M(h,i,!0);return!0})},editAddFormat(i){n.add.format=i,p()},editAddName(i){n.add.name=i,p()},editAddRequired(i){n.add.required=i,p()},editAddType(i){n.add.type=i,p()},editDraftName(i,d){x(i).name=d,p()},editDraftType(i,d){x(i).type=d,p()},openAdd(){n.addOpen=!0,n.add={...j},p()},removeField(i){g((d)=>{if(!d.properties[i])return!1;return delete d.properties[i],d.required=d.required.filter((c)=>c!==i),!0})},removeNested(i,d){g((c)=>{let f=y(c,i);if(!f?.properties?.[d])return!1;if(delete f.properties[d],f.required)f.required=f.required.filter((h)=>h!==d);return!0})},renameField(i,d){o(A(i),d);let c=xv(d.trim());g((f)=>{if(!f.properties[i]||!c||c===i||f.properties[c])return!1;return ae(f.properties,i,c),f.required=f.required.map((h)=>h===i?c:h),!0})},renameNested(i,d,c){o(A(V(i,d)),c);let f=xv(c.trim());g((h)=>{let b=y(h,i);if(!b?.properties?.[d]||!f||f===d||b.properties[f])return!1;if(ae(b.properties,d,f),b.required)b.required=b.required.map((C)=>C===d?f:C);return!0})},setFormat(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;return c.properties[i]=Ms(f.type||"string",d||void 0),!0})},setNestedFormat(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;return h.properties[d]=Ms(b.type||"string",c||void 0),!0})},setNestedRequired(i,d,c){o(H(V(i,d)),c),g((f)=>{let h=y(f,i);if(!h)return!1;return M(h,d,c),!0})},setNestedType(i,d,c){g((f)=>{let h=y(f,i),b=h?.properties?.[d];if(!h?.properties||!b)return!1;let C=N(c)?uc(b):void 0;return h.properties[d]=Ms(c,C||void 0),!0})},setRequired(i,d){o(H(i),d),g((c)=>{if(!c.properties[i])return!1;return M(c,i,d),!0})},setTarget(i,d){g((c)=>{if(!c.properties[i])return!1;return c.properties[i]={$ref:`#/content/${d}`},!0})},setType(i,d){g((c)=>{let f=c.properties[i];if(!f)return!1;let h=N(d)?uc(f):void 0;return c.properties[i]=Ms(d,h||void 0),!0})}});return p(),{dispose:()=>F.dispose(),update(i){t=i,a=null,n.echo=null,p()}}}var je={mount:Re};Pw("schema-builder",je);function oe(e){return typeof e==="string"&&e?e:null}function De(e,r){let t=r,a=()=>{let s=oe(t.value);n.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:s?`Stored as ${s}`:"Not set"})},n=Z(e,{commit(s){let{commitSecret:l}=t.ctx;if(!l||!s)return;n.clear();let{key:p,onChange:o}=t,w=oe(t.value);Promise.resolve(l(p,s)).then((g)=>{if(typeof g==="string"&&g&&g!==w)o(g)})}});return a(),{dispose:()=>n.dispose(),update(s){t=s,a()}}}var qe={mount:De};Pw("secret",qe);var E=new Map,P=new Map,S=new Map;function B(e){if(e===void 0)E.clear(),P.clear(),S.clear();else E.delete(e),P.delete(e),S.delete(e)}function Oe(e){let r=E.get(e);if(r)return r;let t=(me("t0q184js"),import("./content-source-t0q184js.js")).then((a)=>a.listCollectionEntryIds(e));return E.set(e,t),t}function g1(e,r){let t=P.get(e);if(t)return t;let a=Oe(e),n=S.get(e);if(n){if(r)n.add(r);return null}S.set(e,new Set(r?[r]:[]));let s=(l)=>{if(E.get(e)!==a)return;let p=S.get(e);S.delete(e),P.set(e,l);for(let o of p??[])o()};return a.then((l)=>s({ids:l}),(l)=>s({error:te(l)})),null}function Pe(e,r){let t=typeof e.value==="string"?e.value:"",a={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},n=Eu(e.schema);if(n===null)return{...a,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let s=g1(n,r);if(s===null)return{...a,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in s)return{...a,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${n} entries — ${s.error}`,noteTone:"danger"};let l=t!==""&&!s.ids.includes(t);return{...a,hasNote:s.ids.length===0,kind:"picker",note:s.ids.length===0?`No ${n} entries yet.`:"",options:[{label:"—",value:""},...l?[{label:`${t} — not found`,value:t}]:[],...s.ids.map((p)=>({label:p,value:p}))]}}function Le(e,r){let t=r,a=!1,n=()=>{if(!a)s.update(Pe(t,n))},s=K(e,{choose(l){t.onChange(l===""?void 0:l)},edit(l){t.onChange(l.trim()||void 0)},retry(){let l=Eu(t.schema);if(l!==null)B(l);n()}});return n(),{dispose(){a=!0,s.dispose()},update(l){t=l,n()}}}var Me={mount:Le};Pw("reference",Me);var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioEntryEditor",$description:"The Entry editor (site-architecture.md §7.4) — one content entry's fields, in a pane, as a Jx document over the kit. The adapter (`surfaces/entry-editor.ts`) hands in a projection; `content/entry-editor.ts` decides everything in it — which collection the file belongs to, which record its fields live in, which required keys are absent and what a draft flag commits into. The FORM is an island: a schema is `ui/schema-form.ts`'s subject, so this document renders an empty `fields` node and the flow places the element that engine hands back (studio-ui-guidelines.md §9.3, §9.4). That is the whole of the difference between this and the card the lit version drew, and it is why the engine converting in batch 7 is what unblocked this one.",tagName:"div",attributes:{part:"entry","data-jx-region":"${state.region}"},style:{$description:"What `.entry-editor`, `.entry-editor-header`, `.entry-editor-collection`, `.entry-draft-switch`, `.entry-editor-fields`, `.entry-editor-note` and `.entry-editor-empty` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This editor was the only emitter of all seven, so those rules are dead in the stylesheet from here; a central sweep removes them rather than this change, which owns no stylesheet. Every `--spectrum-font-size-*` reference is gone rather than renamed: those names resolve only inside `<sp-theme>`, and a pane editor is mounted outside it, so each would silently have taken its hard-coded fallback.",height:"100%",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-4)",marginBottom:"var(--jx-space-5)"},'& [part="name"]':{margin:"0",fontSize:"var(--jx-text-lg)",fontWeight:"600",color:"var(--fg)"},'& [part="collection"]':{padding:"1px var(--jx-space-3)",borderRadius:"var(--radius)",background:"var(--bg)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="draft"]':{$description:"Pushed to the far end of the header rather than placed there: the heading and the collection chip are both content-width, so `margin-left: auto` is what keeps the switch on the right edge whatever the entry is called.",marginLeft:"auto"},'& [part="fields"]':{$description:"The schema form's host is `display: contents`, so its rows are the flex items of THIS box — which is why the column lives here and not inside the engine.",display:"flex",flexDirection:"column"},'& [part="note"]':{margin:"0 0 var(--jx-space-4)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"},'& [part="empty"]':{display:"flex",maxWidth:"46ch",flexDirection:"column",alignItems:"flex-start",gap:"var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",lineHeight:"1.5"}},children:[{tagName:"div",attributes:{part:"stage-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/stage"},cases:{entry:{tagName:"div",attributes:{part:"body",role:"none"},style:{display:"contents"},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"h3",attributes:{part:"name"},textContent:"${state.name}"},{tagName:"span",attributes:{part:"collection"},textContent:"${state.collection}"},{tagName:"div",attributes:{part:"draft-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/draftAxis"},cases:{shown:{$description:"No `label`: the slotted word is on screen and carries the name, so an aria-label would be read twice. The tooltip is `hint`, which is what DRAFT_MEANING has always been.",tagName:"jx-switch",attributes:{part:"draft"},$props:{checked:{$ref:"#/state/draft"},hint:"${state.draftHint}",size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDraft"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Draft"}]}}}]},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/noteState"},cases:{shown:{tagName:"p",attributes:{part:"note"},textContent:"${state.note}"}}},{$description:"An island: `ui/schema-form.ts` draws this entry's fields into this node, and nothing in this document knows what a schema is.",tagName:"div",attributes:{part:"fields","data-jx-region":"${state.fieldsRegion}"}}]},empty:{$description:"The mode is reachable from the palette and from `__jxAutomation` on any tab, so this state is real: it names the reason and the fix rather than drawing an empty form.",tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",attributes:{part:"empty-line"},textContent:"${state.emptyLine}"},{tagName:"p",attributes:{part:"note"},children:[{tagName:"span",textContent:"A collection is a "},{tagName:"code",textContent:"content"},{tagName:"span",textContent:" entry in "},{tagName:"code",textContent:"project.json"},{tagName:"span",textContent:" whose "},{tagName:"code",textContent:"source"},{tagName:"span",textContent:" directory contains this file and which declares a "},{tagName:"code",textContent:"schema"},{tagName:"span",textContent:"."}]},{tagName:"jx-action-button",attributes:{part:"content-types"},$props:{label:"Content types",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openContentTypes"},value:[]}]},children:[{tagName:"span",textContent:"Content types…"}]}]}}}]};T("entry-editor",se);function de(e,r){e.region=r.region,e.fieldsRegion=r.fieldsRegion,e.stage=r.stage,e.name=r.name,e.collection=r.collection,e.draftAxis=r.draftAxis,e.draft=r.draft,e.draftHint=r.draftHint,e.noteState=r.noteState,e.note=r.note,e.emptyLine=r.emptyLine}function Be(e){let t=e?.attributes?.part;return typeof t==="string"?t:""}function le(e,r,t,a){e.replaceChildren();let n=v({collection:"",draft:!1,draftAxis:"hidden",draftHint:"",emptyLine:"",fieldsRegion:"",name:"",note:"",noteState:"hidden",openContentTypes:t.openContentTypes,region:"",setDraft:t.setDraft,stage:"empty"});de(n,r);let s=null,l=!1,p=R("entry-editor",n,e,{onNodeCreated:(o,w,g)=>{if(o instanceof HTMLElement&&Be(g)==="fields")a.fieldsSlot(o)}}).then((o)=>{if(l)return o.dispose(),o.root;return s=o,o.root});return{attached:()=>{if(l)return!1;let o=s?.root;return o===void 0?!0:o instanceof HTMLElement&&e.contains(o)},dispose(){l=!0,s?.dispose(),s=null},ready:p,update:(o)=>de(n,o)}}function ce(e){return e.doc.sourceFormat==null&&e.doc.mode!=="content"}function Wf(e){return ce(e)?e.doc.document:e.doc.content?.frontmatter??{}}function ze(e,r,t){let a=e.doc.document,n=Object.hasOwn(a,r)?Ae(a[r]):void 0,s=t===void 0||t===null||t==="";if(s)delete a[r];else a[r]=t;let l=s?void 0:Ae(t);vi({forward:{key:r,op:"set-key",path:[],value:l},inverse:{key:r,op:"set-key",path:[],value:n}}),e.doc.dirty=!0,HE()}function z(e,r,t){if(ce(e))ze(e,r,t);else Ol(e,r,t)}function pe(e,r){q(e,(t)=>{for(let[a,n]of Object.entries(r))z(t,a,n)})}var fe="entry",Ie=[fe],L=new Map;function I(e){return L.get(e)??null}function b1(e,r){let t=I(e);return t!==null&&t.tabId===r.id&&t.wrap.isConnected&&t.surface.attached()}function lb(e){let r=L.get(e);if(!r)return;r.scope.stop(),r.surface.dispose(),L.delete(e)}function _(e,r){q(e,(t)=>z(t,fc,r))}function xE(e){let r=sa(e.documentPath),t=Wf(e);if(!r||!Gf(r.schema,t))return null;let a=Lu(t);return{draft:a,text:a?"Draft":"Published",title:a?mb:"Not marked a draft."}}function _e(e){return{fieldKeyPrefix:`entry:${e.id}`,resolvePointer:(r,t)=>Tu(r,{projectConfig:D?.projectConfig??{},scope:t})}}function We(e,r){let t={};for(let a of CE(e.schema,r))t[a]="Required — this entry does not have one.";return t}function Je(e){return`${e.documentPath??"This document"} is not an entry of any content collection, so there is no schema to draw a form from.`}function ue(e,r,t){let a=Zi(e,"entry"),n=Zi(e,"entry/fields");if(!t)return{collection:"",draft:!1,draftAxis:"hidden",draftHint:mb,emptyLine:Je(r),fieldsRegion:n,name:"",note:"",noteState:"hidden",region:a,stage:"empty"};let s=Wf(r),l=Lu(s);return{collection:t.name,draft:l,draftAxis:Gf(t.schema,s)?"shown":"hidden",draftHint:mb,emptyLine:"",fieldsRegion:n,name:r.documentPath?.split("/").pop()??"Untitled",note:mb,noteState:l?"shown":"hidden",region:a,stage:"entry"}}function _E(e,r){let{paneId:t,wrap:a}=e;if(b1(t,r))return;lb(t);let n=null,s=null,l=()=>{if(n!==null&&I(t)===n)o()},p=(y)=>{if(!s||!y)return;let x=Wf(r),F=fd(`entry:${t}`,y.schema,x,{context:_e(r),errors:We(y,x),onChange:(i)=>pe(r,i),rerender:l});if(F.parentNode!==s)s.replaceChildren(F)},o=()=>{let y=sa(r.documentPath);if(!y)s=null;n?.surface.update(ue(t,r,y)),p(y)},w=ge(),g=le(a,ue(t,r,sa(r.documentPath)),{openContentTypes:()=>{ne()?.run("settings.open",{section:"content"})},setDraft:(y)=>_(r,y)},{fieldsSlot:(y)=>{s=y,p(sa(r.documentPath))}});n={paneId:t,scope:w,surface:g,tabId:r.id,wrap:a},L.set(t,n),w.run(()=>{Q(()=>{if(I(t)!==n)return;r.doc.document,r.doc.content?.frontmatter,D?.projectConfig?.content,o()})})}async function W(e){let{openFileInTab:r}=await (me("fjy7zpxt"),import("./files-fjy7zpxt.js"));await r(e);for(let[t,a]of m.tabs.entries()){if(a.documentPath!==e)continue;for(let n of Ie)if(!a.capabilities.modes.includes(n))a.capabilities.modes.unshift(n);return a.session.ui.canvasMode=fe,a.session.ui.preview=!1,ci(t),a}return null}function J(){return cb().map((e)=>e.name)}async function Ue(e){let r=y1(e.schema),t=(e.def.format?wi(e.def.format)?.name:void 0)??Zt(`untitled${e.ext}`)?.name??Dr()?.name;if(e.ext===".json"||t===void 0)return pr(r,null);return Us(t,{...r,children:[]},{frontmatter:Object.keys(r).length>0,mode:"roundtrip"})}async function Ew(e,r={}){let t=Tw(e);if(!t)return k.error(`No content collection named "${e}" to create an entry in.`,{detail:"A collection needs a `content` entry in project.json whose `source` is a directory. A collection whose source names a single file (a CSV catalogue) has rows, not entry files.",source:"Content"}),null;await qt().catch(()=>{});let a;try{a=await Ue(t)}catch(o){return k.error(`Could not prepare a new ${t.name} entry.`,{detail:te(o),path:t.dir,source:"Content"}),null}let n=r.dir,s=n!==void 0&&bp(n)?.name===t.name?n:t.dir;if(s.includes(Dx))return k.error(`"${t.name}" is a localized collection.`,{detail:`Its entries live in one directory per language (${t.dir}). Open the folder for the language you are writing in and create the entry there.`,path:t.dir,source:"Content"}),null;let{createFileIn:l}=await (me("fjy7zpxt"),import("./files-fjy7zpxt.js")),p=await l({content:a,dir:s,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(p===null)return null;return B(t.name),await W(p),p}function he(){let e=u.value;return e&&sa(e.documentPath)?e:null}function Ye(){return[{args:Se({collection:fa(J,"The content collection the entry is created in.")}),category:"File",id:"content.newEntry",level:"project",menus:["palette"],group:"1_file",requires:"a project with a directory-backed content collection",when:(e)=>e.project.open,enablement:()=>J().length>0,undo:"project",run:async(e,r)=>{let t=J();await Ew(li("content.newEntry",r,"collection",t))},title:"New Entry"},{args:Se({path:He("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{await W(ot("content.openEntry",r,"path"))},title:"Open Entry Form"},{args:Se({draft:oo("True marks the open entry a draft; false marks it published. Written as a `draft` field on the entry.")}),category:"Document",id:"content.setDraft",level:"document",menus:["context/tab","palette"],group:"3_document",requires:"a content entry open",when:(e)=>e.document.open,enablement:()=>he()!==null,undo:"document",run:(e,r)=>{let t=he();if(!t)throw Error("content.setDraft: the active document is not a content entry");_(t,yi("content.setDraft",r,"draft"))},title:"Set Draft"},{args:Se({include:oo("True lists entries marked `draft: true` alongside the rest.")}),category:"View",id:"content.setIncludeDrafts",level:"project",menus:["palette"],group:"2_view",requires:"an open project",when:(e)=>e.project.open,run:async(e,r)=>{FE(yi("content.setIncludeDrafts",r,"include")),await I1()},title:"Include Drafts"}]}function v1(e){e.registerAll(Ye())}
|
|
2
|
+
export{kw,Sw,zf,uc,Ms,g1,Wf,b1,lb,xE,_E,Ew,v1};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=78AC37E2BAC6191964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-cbr9czkn.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{hn,sn,ne}from"./studio-dknr8m7b.js";import{p}from"./studio-6k1eswp9.js";import{Tr}from"./studio-28pz4s1k.js";import{v}from"./studio-0nm2skex.js";import{rt,zt,T,R,Nn,Ct}from"./studio-z1vdxq0e.js";import{gd,oT,em,j1,rT,ca,rp}from"./studio-sadckcpp.js";import{Df,D_}from"./studio-vz7b43ng.js";import{D}from"./studio-153mwkyq.js";import{me}from"./studio-09n3fyy0.js";var P={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",P);var S="https://github.com/apps/cloudflare-pages/installations/new";function F(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:F(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:S,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function C(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let l="",g=!1,N=()=>{if(g)return;g=!0,e.onClosed()},d=v({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{l="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{l=o},submit:()=>{e.onSubmit()},verify:()=>{let o=l;l="",e.onSaveToken(o)}}),b=null,k=R("publish",d,t).then(async(o)=>{b=o;let u=o.root;if(g)return o.dispose(),u;if(await Nn(u),g)return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(rt,zt("modal","publish")),hn(u),u});return{close(){let o=b?.root;if(o instanceof HTMLElement)sn(o);b?.dispose(),b=null,l="",t.remove(),N()},host:t,ready:k,update(o){Object.assign(d,w(o))}}}var m=null,s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return D?.projectConfig??null}function I(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=ca();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function j(){let e=gd(),t=s==="loading"?null:s;return{accounts:f.map((l)=>({label:l.name,value:l.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:i?{environment:i.environment,stage:i.stage,status:i.status,url:i.url}:null,error:a,form:{...n},hosted:e&&typeof p().cfConnect==="function",lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:s==="loading",replacing:h,supported:e,tokenStored:Df()!==""}}function r(){if(m){m.update(j());return}m=C({layer:Ct("modal"),onClosed:V,onConnect:()=>{O()},onDisconnect:()=>{M()},onField:(e,t)=>{n={...n,[e]:t}},onOpenAccounts:E,onRefresh:()=>{y()},onReplaceToken:()=>{h=!0,a="",r()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{_()},view:j()})}async function y(){s="loading",r();try{if(s=await p().cfConnection?.()??null,s?.connected&&!s.needsReconnect){f=await oT(),n={...n,accountId:s.accountId??f[0]?.id??""};let e=ca();if(e)i=await em(e),rp(i)}}catch(e){s=null,a=e instanceof Error?e.message:String(e)}r()}async function U(e){let t=e.trim();if(!t){a="Paste a token, or use Preferences › Accounts to forget the stored one.",r();return}D_(t),h=!1,a="",await y()}function E(){ne()?.run("app.preferences",{section:"accounts"})}async function O(){c=!0,a="",r();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")a="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (me("zfycs4k2"),import("./cf-account-picker-zfycs4k2.js"));await t()}}catch(e){a=e instanceof Error?e.message:String(e)}c=!1,Tr(),await y()}async function _(){let e=x();if(!e)return;if(!n.projectName||!n.owner||!n.repo||!n.accountId){a="Account, project name, and the GitHub owner/repo are all required.",r();return}c=!0,a="",r();try{let t=await rT(e,{accountId:n.accountId,owner:n.owner,productionBranch:n.branch||"main",projectName:n.projectName,repo:n.repo});i=await em(t).catch(()=>null)}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}async function M(){let e=x();if(!e)return;c=!0,r();try{await j1(e,null),i=null}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}function V(){let e=m;m=null,e?.close()}function C_(e){s={accountId:e.accountId??"demo-account",connected:!0},f=[],i=e.deployment,rp(e.deployment),a="",c=!1,h=!1,r()}function b$(){let e=x(),{owner:t,repo:l}=H();s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:t,projectName:ca()?.projectName??I(e?.name??""),repo:l},r(),y()}
|
|
2
|
-
export{
|
|
1
|
+
import{un,rn,ne}from"./studio-cp1gbff9.js";import{p}from"./studio-y7jehjrp.js";import{Tr}from"./studio-bftp4n4b.js";import{v}from"./studio-fqq890ap.js";import{rt,zt,T,R,An,Ct}from"./studio-7qvs7v0m.js";import{gd,YE,Zf,P1,ZE,ca,rp}from"./studio-aekhcdzw.js";import{Rf,$_}from"./studio-1a99w39s.js";import{D}from"./studio-tp642n5g.js";import{me}from"./studio-0bbxhhce.js";var P={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPublish",$description:"Publish: the one-click Cloudflare Pages flow, as a `jx-dialog` over the kit. Eight bodies, one at a time, because the reader is at exactly one point of a chain — a host that cannot reach Cloudflare at all, a question still in flight, a connection that lapsed, an invitation to connect, a stored token Cloudflare refused, a field to paste a replacement into, the create-and-connect form, and the connected status. `publish/publish-panel.ts` keeps every one of those decisions and the calls that settle them; this document knows only which of the eight it was told to draw. **The token is never painted.** The field below binds no `value` — it is written by the reader and read once, on its way to storage — so a stored secret cannot reach the attribute, the serialised HTML or the accessibility tree, which is `studio.md` §15 rule 1 written as a missing binding rather than as a rule somebody remembers.",tagName:"jx-dialog",$props:{headline:"Publish",confirmLabel:"",cancelLabel:"Close",size:"md"},attributes:{part:"publish"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:"What the five `.publish-*` names carried, keyed on `part`, and most of them do not survive the move. `.publish-modal` and its `.new-project-modal` base were a fixed card, a scroll body, a border, a shadow and a `z-index: 1000` — a modal `<dialog>` is every one of those, and the top layer is what the z-index was climbing towards. `.publish-field` was a label stacked over a control, which is `jx-field`'s whole shape. What is left is the column gap between bodies, the two button rows, the hint and the refusal. Nothing here uses `--spectrum-*`: those custom properties resolve only inside `<sp-theme>`, and a document mounted in a layer host is outside it, so each would silently have taken its hard-coded fallback.",'& [part="body"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="note"], & [part="status-line"], & [part="deployment"]':{margin:"0",lineHeight:"1.5"},'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="actions"]':{$description:'Wraps rather than overflows (studio-ui-guidelines.md §4.6): two buttons whose labels are whole phrases — "Verify & Connect", "Preferences › Accounts" — are wider than a narrow dialog at the sizes a reader may have set.',display:"flex",flexWrap:"wrap",gap:"var(--jx-space-2)"},'& [part="submit"]':{alignSelf:"flex-start"},'& [part="hint"]':{$description:"Publishing rides every commit, so the connected body's only job is to say what is already happening. Dim, because it is a standing fact rather than something to act on.",margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="failure"]':{$description:'`failure` and not `error`: `jx-textfield` and `jx-select` each draw a `[part="error"]` of their own inside this same tree, and the kit is light DOM — a scoped rule on that name would restyle the token field\'s refusal line too.',margin:"0",color:"var(--danger)",lineHeight:"1.5"},'& [part="link"], & [part="install-link"]':{color:"var(--accent)",textDecoration:"underline"},"& code":{fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)"}},children:[{tagName:"div",attributes:{part:"body"},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{unsupported:{tagName:"p",attributes:{part:"note"},children:["This platform cannot reach the Cloudflare API. Publish by committing and pushing — your host builds ",{tagName:"code",textContent:"bunx jx build"}," and serves ",{tagName:"code",textContent:"dist/"},"."]},loading:{tagName:"p",attributes:{part:"note"},textContent:"Checking Cloudflare connection…"},lapsed:{tagName:"div",attributes:{part:"lapsed",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Your Cloudflare connection has expired, so publishing cannot reach your account. Reconnect to restore it — this site's Pages project and its settings are untouched."},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"reconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"${state.connectLabel}"}]}]},hosted:{tagName:"div",attributes:{part:"hosted",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Connect your Cloudflare account to publish this site."},{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"connect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/connect"},value:[]}]},children:[{tagName:"span",textContent:"Connect Cloudflare"}]}]},stored:{tagName:"div",attributes:{part:"stored",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"A Cloudflare API token is stored on this machine, and Cloudflare did not accept it. It may have been revoked, or it may be missing the Account Settings Read and Pages Read/Write permissions."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"replace"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/replace"},value:[]}]},children:[{tagName:"span",textContent:"Replace token"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},token:{tagName:"div",attributes:{part:"token-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},textContent:"Paste a Cloudflare API token (permissions: Account Settings Read, Pages Read/Write). It is stored on this machine and only sent to the same-origin proxy — Studio never renders it back."},{tagName:"jx-field",$props:{span:!0,label:"API token"},attributes:{part:"token-row","data-field":"token"},children:[{tagName:"jx-textfield",$description:"No `value` binding, and its absence is the contract: a secret may pass through a field the reader typed it into and may never be painted into one they did not. The draft lives in the adapter's closure until Verify reads it, so nothing here — not the attribute, not the accessibility tree, not a DOM dump — has ever held it.",$props:{type:"password",placeholder:"cf_..."},attributes:{part:"token"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setToken"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"verify"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/verify"},value:[]}]},children:[{tagName:"span",textContent:"Verify & Connect"}]},{tagName:"jx-button",$props:{quiet:!0},attributes:{part:"accounts"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openAccounts"},value:[]}]},children:[{tagName:"span",textContent:"Preferences › Accounts"}]}]}]},form:{tagName:"div",attributes:{part:"connect-form",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"note"},children:["Create a Cloudflare Pages project connected to this repository. Every commit then builds and publishes automatically (",{tagName:"code",textContent:"bunx jx build"},")."]},{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Account"},attributes:{part:"row","data-field":"account"},children:[{tagName:"jx-select",$props:{options:{$ref:"#/state/accountOptions"},value:{$ref:"#/state/accountId"}},attributes:{part:"account"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setAccount"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Pages project name"},attributes:{part:"row","data-field":"projectName"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/projectName"}},attributes:{part:"project-name"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setProjectName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub owner"},attributes:{part:"row","data-field":"owner"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/owner"}},attributes:{part:"owner"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setOwner"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"GitHub repository"},attributes:{part:"row","data-field":"repo"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/repo"}},attributes:{part:"repo"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setRepo"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Production branch"},attributes:{part:"row","data-field":"branch"},children:[{tagName:"jx-textfield",$props:{value:{$ref:"#/state/branch"}},attributes:{part:"branch"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setBranch"},value:[{$ref:"event#/target/value"}]}]}}]}]},{tagName:"jx-button",$props:{variant:"accent",disabled:{$ref:"#/state/busy"}},attributes:{part:"submit"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/submit"},value:[]}]},children:[{tagName:"span",textContent:"${state.submitLabel}"}]}]},status:{tagName:"div",attributes:{part:"status",role:"none"},style:{display:"contents"},children:[{tagName:"p",attributes:{part:"status-line"},children:["Connected to Pages project ",{tagName:"strong",attributes:{part:"project-name"},textContent:"${state.deployProject}"},{tagName:"span",attributes:{part:"site-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProductionUrl"},cases:{true:{tagName:"span",children:[" — ",{tagName:"a",attributes:{part:"link",href:"${state.productionUrl}",target:"_blank",rel:"noreferrer"},textContent:"${state.productionUrl}"}]}}}]},{tagName:"div",attributes:{part:"deployment-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasDeployment"},cases:{true:{tagName:"p",attributes:{part:"deployment"},children:["Latest deployment: ",{tagName:"strong",attributes:{part:"deployment-state"},textContent:"${state.deploymentState}"}," (${state.deploymentEnvironment}) — ",{tagName:"a",attributes:{part:"link",href:"${state.deploymentUrl}",target:"_blank",rel:"noreferrer"},textContent:"preview"}]},false:{tagName:"p",attributes:{part:"deployment"},textContent:"No deployments yet — the first commit after connecting triggers one."}}},{tagName:"p",attributes:{part:"hint"},textContent:"Publishing happens automatically on every commit."},{tagName:"div",attributes:{part:"actions"},children:[{tagName:"jx-button",$props:{disabled:{$ref:"#/state/busy"}},attributes:{part:"refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}]},children:[{tagName:"span",textContent:"Refresh"}]},{tagName:"jx-button",$props:{variant:"negative",disabled:{$ref:"#/state/busy"}},attributes:{part:"disconnect"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/disconnect"},value:[]}]},children:[{tagName:"span",textContent:"Disconnect"}]}]}]}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasFailure"},cases:{true:{tagName:"p",attributes:{part:"failure"},children:["${state.failure}",{tagName:"span",attributes:{part:"pages-app-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/needsPagesApp"},cases:{true:{tagName:"span",children:[" — if the Cloudflare Pages GitHub App is not installed on the repository, ",{tagName:"a",attributes:{part:"install-link",href:"${state.pagesAppUrl}",target:"_blank",rel:"noreferrer"},textContent:"install it"}," and retry."]}}}]}}}]}]};T("publish",P);var S="https://github.com/apps/cloudflare-pages/installations/new";function F(e){if(!e.supported)return"unsupported";if(e.loading)return"loading";if(e.connected&&e.lapsed)return"lapsed";if(!e.connected){if(e.hosted)return"hosted";return e.tokenStored&&!e.replacing?"stored":"token"}return e.deploy?"status":"form"}function w(e){let{error:t}=e;return{accountId:e.form.accountId,accountOptions:e.accounts,body:F(e),branch:e.form.branch,busy:e.busy,connectLabel:e.busy?"Reconnecting…":"Reconnect Cloudflare",deploymentEnvironment:e.deployment?.environment??"",deploymentState:e.deployment?`${e.deployment.stage}: ${e.deployment.status}`:"",deploymentUrl:e.deployment?.url??"",deployProject:e.deploy?.projectName??"",failure:t,hasDeployment:e.deployment!==null,hasFailure:t!=="",hasProductionUrl:(e.deploy?.productionUrl??"")!=="",needsPagesApp:/github/i.test(t)&&/app|install|source|repo/i.test(t),owner:e.form.owner,pagesAppUrl:S,productionUrl:e.deploy?.productionUrl??"",projectName:e.form.projectName,repo:e.form.repo,submitLabel:e.busy?"Connecting…":"Create & Connect"}}function C(e){let t=document.createElement("div");t.style.pointerEvents="auto",e.layer.append(t);let l="",g=!1,N=()=>{if(g)return;g=!0,e.onClosed()},d=v({...w(e.view),closed:N,connect:()=>{e.onConnect()},disconnect:()=>{e.onDisconnect()},openAccounts:()=>{e.onOpenAccounts()},refresh:()=>{e.onRefresh()},replace:()=>{l="",e.onReplaceToken()},setAccount:(o)=>{d.accountId=o,e.onField("accountId",o)},setBranch:(o)=>{d.branch=o,e.onField("branch",o)},setOwner:(o)=>{d.owner=o,e.onField("owner",o)},setProjectName:(o)=>{d.projectName=o,e.onField("projectName",o)},setRepo:(o)=>{d.repo=o,e.onField("repo",o)},setToken:(o)=>{l=o},submit:()=>{e.onSubmit()},verify:()=>{let o=l;l="",e.onSaveToken(o)}}),b=null,k=R("publish",d,t).then(async(o)=>{b=o;let u=o.root;if(g)return o.dispose(),u;if(await An(u),g)return u;return(u.querySelector('dialog[part="dialog"]')??u).setAttribute(rt,zt("modal","publish")),un(u),u});return{close(){let o=b?.root;if(o instanceof HTMLElement)rn(o);b?.dispose(),b=null,l="",t.remove(),N()},host:t,ready:k,update(o){Object.assign(d,w(o))}}}var m=null,s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:"",projectName:"",repo:""};function x(){return D?.projectConfig??null}function I(e){return e.toLowerCase().replaceAll(/[^a-z0-9]+/g,"-").replaceAll(/^-+|-+$/g,"").slice(0,58)||"site"}function H(){let e=p().projectRoot,t=/^([\w.-]+)\/([\w.-]+)(?:@.+)?$/.exec(e);return t?{owner:t[1],repo:t[2]}:{owner:"",repo:""}}function L(){let e=ca();return e?{productionUrl:e.productionUrl??"",projectName:e.projectName}:null}function j(){let e=gd(),t=s==="loading"?null:s;return{accounts:f.map((l)=>({label:l.name,value:l.id})),busy:c,connected:t?.connected===!0,deploy:L(),deployment:i?{environment:i.environment,stage:i.stage,status:i.status,url:i.url}:null,error:a,form:{...n},hosted:e&&typeof p().cfConnect==="function",lapsed:t?.connected===!0&&t.needsReconnect===!0,loading:s==="loading",replacing:h,supported:e,tokenStored:Rf()!==""}}function r(){if(m){m.update(j());return}m=C({layer:Ct("modal"),onClosed:V,onConnect:()=>{O()},onDisconnect:()=>{M()},onField:(e,t)=>{n={...n,[e]:t}},onOpenAccounts:E,onRefresh:()=>{y()},onReplaceToken:()=>{h=!0,a="",r()},onSaveToken:(e)=>{U(e)},onSubmit:()=>{_()},view:j()})}async function y(){s="loading",r();try{if(s=await p().cfConnection?.()??null,s?.connected&&!s.needsReconnect){f=await YE(),n={...n,accountId:s.accountId??f[0]?.id??""};let e=ca();if(e)i=await Zf(e),rp(i)}}catch(e){s=null,a=e instanceof Error?e.message:String(e)}r()}async function U(e){let t=e.trim();if(!t){a="Paste a token, or use Preferences › Accounts to forget the stored one.",r();return}$_(t),h=!1,a="",await y()}function E(){ne()?.run("app.preferences",{section:"accounts"})}async function O(){c=!0,a="",r();try{let e=await p().cfConnect?.()??null;if(e?.status==="timeout")a="The Cloudflare window didn't finish. Sign in there, then reconnect — nothing was changed.";else if(e?.status==="connected"&&!e.connection.accountId){let{openCfAccountPicker:t}=await (me("bb2yq946"),import("./cf-account-picker-bb2yq946.js"));await t()}}catch(e){a=e instanceof Error?e.message:String(e)}c=!1,Tr(),await y()}async function _(){let e=x();if(!e)return;if(!n.projectName||!n.owner||!n.repo||!n.accountId){a="Account, project name, and the GitHub owner/repo are all required.",r();return}c=!0,a="",r();try{let t=await ZE(e,{accountId:n.accountId,owner:n.owner,productionBranch:n.branch||"main",projectName:n.projectName,repo:n.repo});i=await Zf(t).catch(()=>null)}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}async function M(){let e=x();if(!e)return;c=!0,r();try{await P1(e,null),i=null}catch(t){a=t instanceof Error?t.message:String(t)}c=!1,r()}function V(){let e=m;m=null,e?.close()}function __(e){s={accountId:e.accountId??"demo-account",connected:!0},f=[],i=e.deployment,rp(e.deployment),a="",c=!1,h=!1,r()}function u$(){let e=x(),{owner:t,repo:l}=H();s="loading",f=[],i=null,a="",c=!1,h=!1,n={accountId:"",branch:"main",owner:t,projectName:ca()?.projectName??I(e?.name??""),repo:l},r(),y()}
|
|
2
|
+
export{__,u$};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=86CB7ADEC271EE1764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-chdmwwzw.js.map
|