@jxsuite/studio 8.0.1 → 9.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-5wtzce5g.js → 2020-89fz3pfy.js} +3 -3
- package/dist/chunks/adapter-ay13gema.js +4 -0
- package/dist/chunks/add-new-flow-nmkqpjym.js +4 -0
- package/dist/chunks/cf-account-picker-2e06qxey.js +4 -0
- package/dist/chunks/cf-settings-5y04810c.js +4 -0
- package/dist/chunks/color-04361ttk.js +4 -0
- package/dist/chunks/{color-area-6rbra5dy.js → color-area-h8dbasp1.js} +2 -2
- package/dist/chunks/{color-field-gy56c94g.js → color-field-qv5r2b16.js} +3 -3
- package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-nz2mrzky.js} +2 -2
- package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
- package/dist/chunks/components-3vf75n83.js +4 -0
- package/dist/chunks/content-source-4f2raf4a.js +4 -0
- package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-j9hfcj4f.js} +3 -3
- package/dist/chunks/editor-645krvtz.js +4 -0
- package/dist/chunks/entry-commands-3qmv8wkr.js +4 -0
- package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-thfke054.js} +3 -3
- package/dist/chunks/file-ops-kkhp9ma7.js +4 -0
- package/dist/chunks/files-yswdhxrf.js +4 -0
- package/dist/chunks/format-host-4g8ex6bz.js +4 -0
- package/dist/chunks/fs-events-z9gpvc6t.js +4 -0
- package/dist/chunks/grid-open-fm4j183c.js +4 -0
- package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-7d2nx83y.js} +16 -15
- package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
- package/dist/chunks/{iframe-entry-pkgmcgp0.js → iframe-entry-2x9bn5ng.js} +4 -4
- package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
- package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
- package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-btck0e9s.js} +4 -4
- package/dist/chunks/iframe-host-q7fedsmr.js +4 -0
- package/dist/chunks/{index-32eqzv1k.js → index-jxmt7vh8.js} +3 -3
- package/dist/chunks/index-pt4wh98x.js +4 -0
- package/dist/chunks/{javascript-pjp734q4.js → javascript-vmqp56ke.js} +2 -2
- package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-n3wmpant.js} +5 -5
- package/dist/chunks/jx-validate-19y62knt.js +4 -0
- package/dist/chunks/layers-panel-1qvc83y9.js +4 -0
- package/dist/chunks/layers-qf0bc7ze.js +4 -0
- package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
- package/dist/chunks/lit-html-wyqw04y2.js +4 -0
- package/dist/chunks/media-library-f9d5qcjb.js +4 -0
- package/dist/chunks/media-picker-rsb1fmk2.js +4 -0
- package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
- package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-wfhmz89d.js} +3 -3
- package/dist/chunks/monaco-buffer-ak0raadw.js +4 -0
- package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-fty7a8vg.js} +3 -3
- package/dist/chunks/notify-4qj70q0x.js +4 -0
- package/dist/chunks/parse-n8dfxnqf.js +4 -0
- package/dist/chunks/platform-ehg6t9vd.js +4 -0
- package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
- package/dist/chunks/publish-panel-yhmda3cd.js +4 -0
- package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-12hh8926.js} +3 -3
- package/dist/chunks/publish-workspace-hx8qdv9p.js +4 -0
- package/dist/chunks/quick-search-r955m3q1.js +4 -0
- package/dist/chunks/references-8gxv0x7t.js +4 -0
- package/dist/chunks/right-panel-jarwqjpy.js +4 -0
- package/dist/chunks/source-control-84qt25m9.js +4 -0
- package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
- package/dist/chunks/studio-0nefxhar.js +7 -0
- package/dist/chunks/studio-0rg30pvs.js +5 -0
- package/dist/chunks/{studio-s32578pn.js → studio-14hh60j8.js} +4 -4
- package/dist/chunks/studio-1cfyd1ys.js +5 -0
- package/dist/chunks/studio-2bq7hheq.js +5 -0
- package/dist/chunks/{studio-zz9qe3rw.js → studio-32d8wyxq.js} +37 -37
- package/dist/chunks/studio-3hpcawh8.js +4 -0
- package/dist/chunks/{studio-svb7yyve.js → studio-4j35hgsw.js} +4 -4
- package/dist/chunks/{studio-x1x167jh.js → studio-4qg61g9j.js} +4 -4
- package/dist/chunks/studio-4rgem12q.js +5 -0
- package/dist/chunks/studio-6k9djnxw.js +5 -0
- package/dist/chunks/studio-6rbaedw2.js +9 -0
- package/dist/chunks/studio-732mw0g8.js +5 -0
- package/dist/chunks/studio-79r8msnr.js +7 -0
- package/dist/chunks/studio-7q6jdd4h.js +5 -0
- package/dist/chunks/{studio-r5qy30vx.js → studio-8hf8qcm1.js} +4 -4
- package/dist/chunks/{studio-8tr6cfrc.js → studio-8pne0rx4.js} +4 -4
- package/dist/chunks/{studio-y0n7yxea.js → studio-9179bsm7.js} +7 -7
- package/dist/chunks/{studio-pbxa5fpc.js → studio-9ff0vqff.js} +3 -3
- package/dist/chunks/studio-9gzvypw4.js +5 -0
- package/dist/chunks/studio-9ndgd55w.js +5 -0
- package/dist/chunks/studio-9ra9e7m4.js +5 -0
- package/dist/chunks/studio-a6e5fzve.js +5 -0
- package/dist/chunks/studio-a9k86nq6.js +5 -0
- package/dist/chunks/studio-ae7a69jc.js +6 -0
- package/dist/chunks/studio-aghsg0ds.js +7 -0
- package/dist/chunks/{studio-k3xxbagr.js → studio-ajw4k8hp.js} +3 -3
- package/dist/chunks/{studio-qmn1xc24.js → studio-apapy17g.js} +4 -4
- package/dist/chunks/{studio-8m0y2qe7.js → studio-by8x0jvc.js} +4 -4
- package/dist/chunks/{studio-wbcjbhy1.js → studio-c88gq88j.js} +5 -5
- package/dist/chunks/{studio-n0c5h6mf.js → studio-cg54vtet.js} +4 -4
- package/dist/chunks/studio-dvhxxxbd.js +5 -0
- package/dist/chunks/{studio-3q40e3rj.js → studio-e4rq6x0q.js} +4 -4
- package/dist/chunks/{studio-fbhxxc5f.js → studio-ekzbgnjp.js} +4 -4
- package/dist/chunks/studio-fg4fj9ec.js +10 -0
- package/dist/chunks/studio-fj6jzgxw.js +5 -0
- package/dist/chunks/{studio-nh6d342n.js → studio-g45r5vm8.js} +7 -7
- package/dist/chunks/{studio-a2bvaptz.js → studio-gczve8zf.js} +4 -4
- package/dist/chunks/studio-ge08zwpv.js +5 -0
- package/dist/chunks/studio-gk9yk8dj.js +12 -0
- package/dist/chunks/{studio-bbe4c90a.js → studio-gskkgfe3.js} +4 -4
- package/dist/chunks/{studio-83mk4bgg.js → studio-h4jbgne2.js} +8 -8
- package/dist/chunks/{studio-b7y5mr30.js → studio-hcy9zeac.js} +4 -4
- package/dist/chunks/studio-ht81xjkr.js +5 -0
- package/dist/chunks/{studio-jaaz8ce9.js → studio-jr30g4ae.js} +4 -4
- package/dist/chunks/{studio-qgh13jtz.js → studio-k5n4es74.js} +4 -4
- package/dist/chunks/{studio-ccv2svc6.js → studio-k6hbx2fc.js} +4 -4
- package/dist/chunks/{studio-9tmebf0s.js → studio-kqh7fxn6.js} +4 -4
- package/dist/chunks/{studio-q0mvbaq6.js → studio-kyw47pet.js} +4 -4
- package/dist/chunks/studio-mkw17ngg.js +5 -0
- package/dist/chunks/{studio-x9hsze61.js → studio-myb4mf0h.js} +4 -4
- package/dist/chunks/studio-n4qq1n57.js +5 -0
- package/dist/chunks/studio-nfmpmkqb.js +5 -0
- package/dist/chunks/studio-nfwacw31.js +5 -0
- package/dist/chunks/{studio-rthyg42z.js → studio-nm86874b.js} +172 -172
- package/dist/chunks/studio-nqexty8x.js +16 -0
- package/dist/chunks/studio-nr0kcqc6.js +5 -0
- package/dist/chunks/{studio-jsgf2q5k.js → studio-nvfa137z.js} +5 -5
- package/dist/chunks/studio-psh8mwnw.js +4 -0
- package/dist/chunks/studio-qd0cycm4.js +9 -0
- package/dist/chunks/{studio-tfkznv39.js → studio-qevf5z9d.js} +4 -4
- package/dist/chunks/studio-qs5fmhtj.js +14 -0
- package/dist/chunks/studio-ry4789ng.js +7 -0
- package/dist/chunks/studio-s4fq9jht.js +5 -0
- package/dist/chunks/studio-sc35ttdk.js +5 -0
- package/dist/chunks/studio-sm2f0sc6.js +6 -0
- package/dist/chunks/{studio-3qeh9t0h.js → studio-spza69tb.js} +5 -5
- package/dist/chunks/studio-t6dqnnft.js +5 -0
- package/dist/chunks/{studio-43sd2mam.js → studio-tfmhnwyr.js} +3 -3
- package/dist/chunks/studio-tn7v8gey.js +6 -0
- package/dist/chunks/{studio-tft6r105.js → studio-trcfer2b.js} +4 -4
- package/dist/chunks/studio-tyw7tk0x.js +5 -0
- package/dist/chunks/{studio-jcnsdaep.js → studio-tyzgte21.js} +4 -4
- package/dist/chunks/studio-vtey9w98.js +5 -0
- package/dist/chunks/studio-ws2r1d7e.js +5 -0
- package/dist/chunks/studio-x2trkhk5.js +5 -0
- package/dist/chunks/{studio-mn0476ag.js → studio-xzgp0cp7.js} +4 -4
- package/dist/chunks/studio-y47090vq.js +5 -0
- package/dist/chunks/{studio-5g0rprdt.js → studio-yjh9gddd.js} +5 -5
- package/dist/chunks/studio-ywf9y1e2.js +5 -0
- package/dist/chunks/{studio-k7evxqh4.js → studio-z1p91z5a.js} +4 -4
- package/dist/chunks/studio-ztppbam0.js +5 -0
- package/dist/chunks/{toast-host-1yg5ar8d.js → toast-host-g3r2s0kn.js} +2 -2
- package/dist/chunks/toast-w11qpkyz.js +4 -0
- package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
- package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
- package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-byje4a01.js} +5 -5
- package/dist/chunks/workspace-7q4arnt3.js +4 -0
- package/dist/chunks/workspace-home-ge027kr6.js +4 -0
- package/dist/chunks/{ws-client-bv552sfx.js → ws-client-h09h6sqg.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +76 -76
- package/dist/studio.js +88 -88
- package/package.json +15 -16
- package/src/browse/component-examples.ts +15 -224
- package/src/browse/library-preview.ts +6 -13
- package/src/browse/preview-root.ts +7 -4
- package/src/canvas/canvas-utils.ts +18 -4
- package/src/canvas/iframe-editable-root.ts +13 -4
- package/src/canvas/iframe-entry.ts +3 -1
- package/src/canvas/iframe-interaction.ts +11 -2
- package/src/canvas/iframe-render.ts +25 -3
- package/src/canvas/preview-placeholder.ts +120 -0
- package/src/collab/collab-session.ts +6 -2
- package/src/commands/context.ts +4 -0
- package/src/commands/defaults.ts +2 -0
- package/src/commands/live-context.ts +2 -0
- package/src/editor/shortcuts.ts +3 -0
- package/src/files/files.ts +6 -3
- package/src/new-project/new-project-modal.ts +1 -4
- package/src/panels/ai-panel.ts +27 -34
- package/src/panels/component-preview.ts +5 -0
- package/src/panels/pane-context.ts +43 -18
- package/src/panels/site-model.ts +7 -19
- package/src/panels/site-panel.ts +2 -25
- package/src/panels/stylebook-doc.ts +2 -53
- package/src/platform.ts +20 -0
- package/src/platforms/devserver.ts +2 -120
- package/src/services/ai-ask.ts +29 -171
- package/src/services/ai-command-tools.ts +40 -50
- package/src/services/ai-import-tools.ts +4 -5
- package/src/services/ai-project-tools.ts +13 -3
- package/src/services/ai-tools.ts +26 -564
- package/src/services/ai-writes.ts +84 -2
- package/src/services/document-assistant.ts +29 -58
- package/src/services/harness/assistant-tools.ts +68 -0
- package/src/services/harness/interaction-store.ts +118 -0
- package/src/services/harness/studio-documents.ts +105 -0
- package/src/services/harness/turn-hooks.ts +1 -6
- package/src/services/project-adoption.ts +8 -16
- package/src/services/references.ts +0 -0
- package/src/services/tool-executor.ts +25 -22
- package/src/state.ts +3 -13
- package/src/style/stylebook-specimens.ts +11 -15
- package/src/surfaces/files-panel.json +12 -0
- package/src/surfaces/files-panel.ts +5 -2
- package/src/surfaces/pane-context.json +286 -265
- package/src/surfaces/pane-context.ts +17 -8
- package/src/surfaces/welcome.ts +4 -1
- package/src/tabs/selection.ts +14 -109
- package/src/tabs/tab.ts +15 -7
- package/src/tabs/transact.ts +316 -124
- package/src/types.ts +13 -8
- package/src/utils/geometry.ts +49 -2
- package/dist/chunks/adapter-5tphg7xe.js +0 -4
- package/dist/chunks/add-new-flow-psym14sn.js +0 -4
- package/dist/chunks/cf-account-picker-haqazq5r.js +0 -4
- package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
- package/dist/chunks/color-m7r1vk54.js +0 -4
- package/dist/chunks/components-r22xca09.js +0 -4
- package/dist/chunks/content-source-mmppmcyg.js +0 -4
- package/dist/chunks/editor-ccd9jwsa.js +0 -4
- package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
- package/dist/chunks/file-ops-qnab36ek.js +0 -4
- package/dist/chunks/files-rcn56qvm.js +0 -4
- package/dist/chunks/format-host-yxz0kjjs.js +0 -4
- package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
- package/dist/chunks/grid-open-4z1g062t.js +0 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
- package/dist/chunks/index-f0jn7nnp.js +0 -4
- package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
- package/dist/chunks/layers-bgyr11tr.js +0 -4
- package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
- package/dist/chunks/lit-html-v9gh687x.js +0 -4
- package/dist/chunks/media-library-sq468wts.js +0 -4
- package/dist/chunks/media-picker-shfe59pt.js +0 -4
- package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
- package/dist/chunks/notify-kzrjr3fv.js +0 -4
- package/dist/chunks/parse-v77xtwv7.js +0 -4
- package/dist/chunks/platform-7v4rtd7m.js +0 -4
- package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
- package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
- package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
- package/dist/chunks/references-9547rg5s.js +0 -4
- package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
- package/dist/chunks/source-control-kwktr9y6.js +0 -4
- package/dist/chunks/studio-03ct6yfv.js +0 -9
- package/dist/chunks/studio-07rcfje3.js +0 -5
- package/dist/chunks/studio-3e54qh39.js +0 -7
- package/dist/chunks/studio-3exxhz5g.js +0 -5
- package/dist/chunks/studio-3qqjeep5.js +0 -6
- package/dist/chunks/studio-4hp8pkyt.js +0 -5
- package/dist/chunks/studio-58xg6j2q.js +0 -9
- package/dist/chunks/studio-6m380wp7.js +0 -5
- package/dist/chunks/studio-80jyh1xh.js +0 -4
- package/dist/chunks/studio-8vcvfs7r.js +0 -6
- package/dist/chunks/studio-bavb31r0.js +0 -5
- package/dist/chunks/studio-c05wdnt3.js +0 -5
- package/dist/chunks/studio-d5grtb9e.js +0 -16
- package/dist/chunks/studio-df0baea9.js +0 -5
- package/dist/chunks/studio-dgk4dqtx.js +0 -7
- package/dist/chunks/studio-e1g64q43.js +0 -5
- package/dist/chunks/studio-ed1hp6zf.js +0 -6
- package/dist/chunks/studio-ed3xx40h.js +0 -7
- package/dist/chunks/studio-f14e1zdj.js +0 -5
- package/dist/chunks/studio-fyh0jc96.js +0 -5
- package/dist/chunks/studio-gcxk20n7.js +0 -5
- package/dist/chunks/studio-kt3pjkwd.js +0 -5
- package/dist/chunks/studio-m8g16bgz.js +0 -5
- package/dist/chunks/studio-mx1smyq0.js +0 -5
- package/dist/chunks/studio-nqxqf8p2.js +0 -4
- package/dist/chunks/studio-p4nrkvqr.js +0 -5
- package/dist/chunks/studio-pgmvdv7z.js +0 -7
- package/dist/chunks/studio-ph84avkf.js +0 -5
- package/dist/chunks/studio-q0tccd43.js +0 -5
- package/dist/chunks/studio-q7rtx6zq.js +0 -14
- package/dist/chunks/studio-qwdqwkj0.js +0 -5
- package/dist/chunks/studio-rj9eamf8.js +0 -5
- package/dist/chunks/studio-rptgsk96.js +0 -5
- package/dist/chunks/studio-s19tp1xr.js +0 -5
- package/dist/chunks/studio-syreb644.js +0 -5
- package/dist/chunks/studio-tf9jryb1.js +0 -10
- package/dist/chunks/studio-txf2kysx.js +0 -5
- package/dist/chunks/studio-v8867ddv.js +0 -12
- package/dist/chunks/studio-vxq7fcvv.js +0 -5
- package/dist/chunks/studio-w4rz9hdk.js +0 -5
- package/dist/chunks/studio-wc649wss.js +0 -5
- package/dist/chunks/studio-wys23mxz.js +0 -5
- package/dist/chunks/studio-y3ahhdpx.js +0 -5
- package/dist/chunks/studio-z97c48fk.js +0 -5
- package/dist/chunks/studio-zat62m0c.js +0 -5
- package/dist/chunks/studio-zcd2e7yz.js +0 -5
- package/dist/chunks/toast-1gv0h53h.js +0 -4
- package/dist/chunks/workspace-dz7nxfhv.js +0 -4
- package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
- package/src/services/directory-picker.ts +0 -187
- package/src/services/gated-registry.ts +0 -77
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{te}from"./studio-psh8mwnw.js";import{cw,Hu}from"./studio-nfmpmkqb.js";import{T,R}from"./studio-myb4mf0h.js";import{g}from"./studio-tfmhnwyr.js";import{Jc,Nx}from"./studio-ztppbam0.js";import{Hl,bm}from"./studio-cg54vtet.js";import{n,v}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";var z_=["string","number","boolean","array","object","reference"],W_=["","image","date","color"],Ed={format:"",name:"",required:!1,type:"string"};function ib(e){if(e.$ref)return"reference";return e.type||"string"}function Td(e){if(e.type==="array"&&e.items?.format)return e.items.format;return e.format||""}function va(e,s){switch(e){case"number":return{type:"number"};case"boolean":return{type:"boolean"};case"array":return s?{items:{format:s,type:"string"},type:"array"}:{items:{type:"string"},type:"array"};case"object":return{properties:{},required:[],type:"object"};case"reference":return{$ref:"#/content/"};default:return s?{format:s,type:"string"}:{type:"string"}}}var B={$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",B);function _(){return{addFormat:"",addHasFormat:!0,addName:"",addRequired:!1,addState:"closed",addType:"string",fields:[],formatOptions:[],targets:[],typeOptions:[]}}function E(e,s){e.textContent="";let t=g({..._(),...s}),o=null,r=!0,l=!1,p=()=>R("schema-builder",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.addFormat=d.addFormat,t.addHasFormat=d.addHasFormat,t.addName=d.addName,t.addRequired=d.addRequired,t.addState=d.addState,t.addType=d.addType,t.fields=d.fields,t.formatOptions=d.formatOptions,t.targets=d.targets,t.typeOptions=d.typeOptions,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioReferenceField",$description:'The `reference` form control — site-architecture.md §6.1\'s `{ "$ref": "#/content/x" }` and site-architecture.md §7.4\'s entry picker. Registered once and dispatched to by `ui/schema-form.ts` for any property whose `$ref` names a collection, so the settings forms, the entry editor and an array-of-objects cell all draw the same control without any of them knowing it exists. `ui/form-controls.ts` decides which of the three states the field is in and what each gesture commits; nothing here reads a schema or lists a directory. The three states are drawn as three different controls on purpose: a picker while the entries are known, a TEXT field while they are not — a failed read leaves the value editable with the reason beside it, because swapping it for an empty dropdown would present "no entries" and "could not find out" as the same screen — and a disabled picker saying so while the read is in flight.',tagName:"div",attributes:{part:"reference",role:"none"},style:{$description:"The five `.reference-*` rules from `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Two values could not come with them. The note read `var(--spectrum-font-size-50, 11px)`, which resolves only inside `<sp-theme>` — this document is mounted in a settings pane, an entry editor or a frontmatter card, all outside that element, so it would silently have taken its hard-coded fallback every time. And `.reference-missing` coloured ONE row of the dropdown red; the kit's select offers a row a face, a swatch and a border style but no tone, so the dangling entry says what it is in words (\"— not found\") and the colour is not replaced by a second channel. The 6px gap comes onto the kit's spacing scale.",display:"flex",flex:"1",minWidth:"0",alignItems:"center",gap:"var(--jx-space-2)",'& [part="picker"], & [part="text"]':{flex:"1",minWidth:"0"},'& [part="note"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",lineHeight:"1.4"},'& [part="note"][data-tone="danger"]':{$description:"A listing that failed is a FAULT rather than a fact about the project, and the two notes this control draws are otherwise the same sentence in the same place.",color:"var(--danger)"},'& [part="retry"]':{flex:"none"}},children:[{tagName:"div",attributes:{part:"control-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/kind"},cases:{picker:{$description:"The collection's entries. The empty row is `\"\"` rather than a sentinel, because the kit's select treats the empty string as a legal value a reader can arrow to; a dangling reference is kept in the list and marked, since blanking the field would delete the evidence and the value in one repaint. While the read is in flight the same control is disabled and offers one row saying so.",tagName:"jx-select",attributes:{part:"picker"},$props:{size:"sm",label:{$ref:"#/state/label"},options:{$ref:"#/state/options"},value:{$ref:"#/state/value"},disabled:{$ref:"#/state/disabled"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/choose"},value:[{$ref:"event#/target/value"}]}]}},text:{$description:"The id as the string it is: what a reader gets when the choices could not be listed, and when the control was named by a `ui.control` override on a property that references nothing. Refusing to draw anything would lose the value that is already there.",tagName:"jx-textfield",attributes:{part:"text"},$props:{size:"sm",label:{$ref:"#/state/label"},value:{$ref:"#/state/value"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}]}}}},{tagName:"div",attributes:{part:"note-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasNote"},cases:{true:{tagName:"p",attributes:{part:"note","data-tone":"${state.noteTone}",role:"status"},textContent:"${state.note}"}}},{tagName:"div",attributes:{part:"retry-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/canRetry"},cases:{true:{$description:"Offered only where there is something to try again — a listing that failed. It used to be offered only where the HOST passed a repaint hook, because a template control cannot draw a second frame of its own and a button that cannot do the thing it is named after is worse than its absence. A mounted control redraws itself, so the condition is now the failure rather than the host.",tagName:"jx-action-button",attributes:{part:"retry"},$props:{size:"sm",quiet:!0,label:"Retry listing entries"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/retry"},value:[]}]},children:[{tagName:"span",textContent:"Retry"}]}}}]};T("reference-field",M);function Y(){return{canRetry:!1,disabled:!0,hasNote:!1,kind:"picker",label:"",note:"",noteTone:"dim",options:[],value:""}}function L(e,s){e.textContent="";let t=g({...Y(),...s}),o=null,r=!0,l=!1,p=()=>R("reference-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.canRetry=d.canRetry,t.disabled=d.disabled,t.hasNote=d.hasNote,t.kind=d.kind,t.label=d.label,t.note=d.note,t.noteTone=d.noteTone,t.options=d.options,t.value=d.value,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var V={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSecretField",$description:'The `secret` form control (specs/extensions.md §9.1, §13): one password field whose VALUE goes to the platform\'s secret store and never to project.json. A descriptor names it with `"ui": { "<field>": { "control": "secret" } }`, and `ui/schema-form.ts` mounts it into the empty host its own document announces for that field. **A surface never renders back the secret it describes, and this document is where that is visible rather than remembered**: the only thing bound to the field\'s value is `#/state/shown`, a scope path whose whole purpose is to hold nothing. What the field is worth is said in the placeholder instead — the env NAME the store gave it, which is the only half of a secret a screen may carry. `ui/form-controls.ts` decides everything else: whether the host has a secret store at all, what the placeholder says, what a commit is worth and what the field persists.',tagName:"div",attributes:{part:"secret",role:"none"},style:{$description:"`.secret-field` carried no rule anywhere — it was one of `check-styles.ts`'s ALLOWED_ORPHANS, a class emitted only so a test could find the control — so there is nothing to translate and the wrapper takes no box of its own. The field takes the width of the control host the form drew, which is the flex item; a kit field is inline-flex by default and would otherwise sit at its intrinsic width in a row sized for it.",display:"contents",'& [part="field"]':{width:"100%"}},children:[{$description:"`autocomplete: new-password` because this is a place to PUT a secret rather than to prove one: without it a password manager offers to fill the field with a credential belonging to whatever site the reader last logged in to, and the offer is the manager's own UI drawn over an editor. The value binding is `#/state/shown` and nothing else ever writes to it — see the document description.",tagName:"jx-textfield",attributes:{part:"field"},$props:{type:"password",size:"sm",autocomplete:"new-password",label:{$ref:"#/state/label"},placeholder:{$ref:"#/state/placeholder"},disabled:{$ref:"#/state/disabled"},value:{$ref:"#/state/shown"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"event#/target/value"}]}],description:"The change bubbles out of the field's own input, so what the reader typed is read off the event rather than off the element — and it is read here, handed to the flow, and never written back onto the scope."}}]};T("secret-field",V);function G(){return{disabled:!0,label:"",placeholder:"Not set"}}function z(e,s){e.textContent="";let t=g({...G(),...s,shown:""}),o=null,r=!0,l=!1,p=()=>R("secret-field",t,e).then((d)=>{let y=d.root;if(r=!1,l)return d.dispose(),y;return o=d,y}),u=p();return{clear(){t.shown=" ",t.shown=""},dispose(){l=!0,o?.dispose(),o=null,e.textContent=""},host:e,ready:u,update(d){if(t.disabled=d.disabled,t.label=d.label,t.placeholder=d.placeholder,l||r||o!==null&&e.contains(o.root))return;o?.dispose(),o=null,r=!0,e.textContent="",p()}}}var Q=z_.map((e)=>({label:e,value:e})),Z=W_.map((e)=>({label:e||"(none)",value:e})),P=[],I=" ";function ee(e){let s=e.resolvePointer("#/$context/content"),t=v(s)?Object.keys(s):[],o=t.join(" ");if(o!==I)I=o,P=t.map((r)=>({label:r,value:r}));return P}function S(e){return e==="string"||e==="array"}function re(e){if(!v(e))return{properties:{},required:[],type:"object"};return e}function ae(e){return JSON.parse(JSON.stringify(e))}function ne(e){let s=e;return s.type??="object",s.properties??={},s.required??=[],s}function k(e){return`name:${e}`}function q(e){return`required:${e}`}function H(e,s){return`${e} ${s}`}function O(e,s,t){return e.echo?.id===s?e.echo.value:t}function oe(e,s,t,o,r){let l=H(s,t),p=ib(o);return{format:Td(o),hasFormat:S(p),key:t,name:O(e,k(l),t),parent:s,required:O(e,q(l),r),type:p}}function ie(e,s,t,o,r){let l=ib(t),p=l==="object",u=e.drafts.get(s),d=t.required??[];return{children:p?Object.entries(t.properties??{}).map(([y,h])=>oe(e,s,y,h,d.includes(y))):[],draftName:u?.name??"",draftType:u?.type??"string",extra:l==="reference"&&r?"reference":p?"nested":"none",format:Td(t),hasFormat:S(l),key:s,label:Jc(s),name:O(e,k(s),s),refTarget:t.$ref?t.$ref.replace(/^#\/[^/]+\//,""):"",required:O(e,q(s),o),type:l}}function W(e,s,t){let o={};for(let[r,l]of Object.entries(e))o[r===s?t:r]=l,delete e[r];Object.assign(e,o)}function C(e,s,t){e.required??=[];let o=e.required.indexOf(s);if(t&&o===-1)e.required.push(s);if(!t&&o!==-1)e.required.splice(o,1)}function se(e,s){let t=s,o=null,r={add:{...Ed},addOpen:!1,drafts:new Map,echo:null},l=()=>o??re(t.value),p=()=>{let a=l(),i=a.required??[],c=ee(t.ctx);return{addFormat:r.add.format,addHasFormat:S(r.add.type),addName:r.add.name,addRequired:r.add.required,addState:r.addOpen?"open":"closed",addType:r.add.type,fields:Object.entries(a.properties??{}).map(([m,f])=>ie(r,m,f,i.includes(m),c.length>0)),formatOptions:Z,targets:c,typeOptions:Q}},u=()=>D.update(p()),d=(a,i)=>{r.echo={id:a,value:i},u()},y=()=>{r.echo=null,u()},h=(a)=>{let i=ae(l()),c=ne(i);if(!a(c)){y();return}o=c,r.echo=null,t.onChange(i),u()},w=(a,i)=>a.properties[i],A=(a)=>{let i=r.drafts.get(a);if(!i)i={name:"",type:"string"},r.drafts.set(a,i);return i},D=E(e,{addNested(a){let i=A(a),c=Nx(i.name.trim());if(!c)return;h((m)=>{let f=w(m,a);if(!f)return!1;return f.properties??={},f.properties[c]=va(i.type||"string"),i.name="",!0})},cancelAdd(){r.addOpen=!1,r.add={...Ed},u()},confirmAdd(){let a=Nx(r.add.name.trim());if(!a)return;let{format:i,required:c,type:m}=r.add;r.addOpen=!1,r.add={...Ed},h((f)=>{if(f.properties[a]=va(m,i||void 0),c)C(f,a,!0);return!0})},editAddFormat(a){r.add.format=a,u()},editAddName(a){r.add.name=a,u()},editAddRequired(a){r.add.required=a,u()},editAddType(a){r.add.type=a,u()},editDraftName(a,i){A(a).name=i,u()},editDraftType(a,i){A(a).type=i,u()},openAdd(){r.addOpen=!0,r.add={...Ed},u()},removeField(a){h((i)=>{if(!i.properties[a])return!1;return delete i.properties[a],i.required=i.required.filter((c)=>c!==a),!0})},removeNested(a,i){h((c)=>{let m=w(c,a);if(!m?.properties?.[i])return!1;if(delete m.properties[i],m.required)m.required=m.required.filter((f)=>f!==i);return!0})},renameField(a,i){d(k(a),i);let c=Nx(i.trim());h((m)=>{if(!m.properties[a]||!c||c===a||m.properties[c])return!1;return W(m.properties,a,c),m.required=m.required.map((f)=>f===a?c:f),!0})},renameNested(a,i,c){d(k(H(a,i)),c);let m=Nx(c.trim());h((f)=>{let b=w(f,a);if(!b?.properties?.[i]||!m||m===i||b.properties[m])return!1;if(W(b.properties,i,m),b.required)b.required=b.required.map((N)=>N===i?m:N);return!0})},setFormat(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;return c.properties[a]=va(m.type||"string",i||void 0),!0})},setNestedFormat(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;return f.properties[i]=va(b.type||"string",c||void 0),!0})},setNestedRequired(a,i,c){d(q(H(a,i)),c),h((m)=>{let f=w(m,a);if(!f)return!1;return C(f,i,c),!0})},setNestedType(a,i,c){h((m)=>{let f=w(m,a),b=f?.properties?.[i];if(!f?.properties||!b)return!1;let N=S(c)?Td(b):void 0;return f.properties[i]=va(c,N||void 0),!0})},setRequired(a,i){d(q(a),i),h((c)=>{if(!c.properties[a])return!1;return C(c,a,i),!0})},setTarget(a,i){h((c)=>{if(!c.properties[a])return!1;return c.properties[a]={$ref:`#/content/${i}`},!0})},setType(a,i){h((c)=>{let m=c.properties[a];if(!m)return!1;let f=S(i)?Td(m):void 0;return c.properties[a]=va(i,f||void 0),!0})}});return u(),{dispose:()=>D.dispose(),update(a){t=a,o=null,r.echo=null,u()}}}var de={mount:se};cw("schema-builder",de);function J(e){return n(e)&&e?e:null}function ce(e,s){let t=s,o=()=>{let l=J(t.value);r.update({disabled:!t.ctx.commitSecret,label:t.key,placeholder:l?`Stored as ${l}`:"Not set"})},r=z(e,{commit(l){let{commitSecret:p}=t.ctx;if(!p||!l)return;r.clear();let{key:u,onChange:d}=t,y=J(t.value);Promise.resolve(p(u,l)).then((h)=>{if(n(h)&&h&&h!==y)d(h)})}});return o(),{dispose:()=>r.dispose(),update(l){t=l,o()}}}var pe={mount:ce};cw("secret",pe);function me(e,s){let t=s,o=()=>{Hl(e,t.key,n(t.value)?t.value:"",(r)=>t.onChange(r===""?void 0:r),{images:!0})};return o(),{dispose:()=>bm(e),update(r){t=r,o()}}}var ue={mount:me};cw("media",ue);var F=new Map,j=new Map,x=new Map;function lm(e){if(e===void 0)F.clear(),j.clear(),x.clear();else F.delete(e),j.delete(e),x.delete(e)}function fe(e){let s=F.get(e);if(s)return s;let t=(le("4f2raf4a"),import("./content-source-4f2raf4a.js")).then((o)=>o.listCollectionEntryIds(e));return F.set(e,t),t}function vE(e,s){let t=j.get(e);if(t)return t;let o=fe(e),r=x.get(e);if(r){if(s)r.add(s);return null}x.set(e,new Set(s?[s]:[]));let l=(p)=>{if(F.get(e)!==o)return;let u=x.get(e);x.delete(e),j.set(e,p);for(let d of u??[])d()};return o.then((p)=>l({ids:p}),(p)=>l({error:te(p)})),null}function he(e,s){let t=n(e.value)?e.value:"",o={canRetry:!1,disabled:!1,hasNote:!1,label:e.key,note:"",noteTone:"dim",options:[],value:t},r=Hu(e.schema);if(r===null)return{...o,hasNote:!0,kind:"text",note:'No collection referenced — add "$ref": "#/content/<type>" to this field.'};let l=vE(r,s);if(l===null)return{...o,disabled:!0,kind:"picker",options:[{label:"Loading…",value:t}]};if("error"in l)return{...o,canRetry:!0,hasNote:!0,kind:"text",note:`Could not list ${r} entries — ${l.error}`,noteTone:"danger"};let p=t!==""&&!l.ids.includes(t);return{...o,hasNote:l.ids.length===0,kind:"picker",note:l.ids.length===0?`No ${r} entries yet.`:"",options:[{label:"—",value:""},...p?[{label:`${t} — not found`,value:t}]:[],...l.ids.map((u)=>({label:u,value:u}))]}}function ge(e,s){let t=s,o=!1,r=()=>{if(!o)l.update(he(t,r))},l=L(e,{choose(p){t.onChange(p===""?void 0:p)},edit(p){t.onChange(p.trim()||void 0)},retry(){let p=Hu(t.schema);if(p!==null)lm(p);r()}});return r(),{dispose(){o=!0,l.dispose()},update(p){t=p,r()}}}var ye={mount:ge};cw("reference",ye);
|
|
2
|
+
export{z_,W_,Ed,ib,Td,va,lm,vE};
|
|
3
|
+
|
|
4
|
+
//# debugId=401309381CEC098C64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-ht81xjkr.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{Jx,Yx}from"./studio-881z1xrx.js";import{n,v}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{Jx,Yx}from"./studio-881z1xrx.js";import{n,v}from"./studio-ywf9y1e2.js";import{ip,le}from"./studio-k5n4es74.js";var a={document:Jx,project:Yx},i={...a},s={document:null,project:null},d=!1;function u(e){return s[e]??=(async()=>{try{let{default:t}=await (le("89fz3pfy"),import("./2020-89fz3pfy.js").then((m)=>ip(m.default,1))),{default:r}=await (le("jxmt7vh8"),import("./index-jxmt7vh8.js").then((m)=>ip(m.default,1))),o=new t({allErrors:!0,strict:!1,allowUnionTypes:!0});return r(o),o.compile(i[e])}catch(t){if(!d)d=!0,console.error(`[jx] ${e} schema validation is unavailable — the AI assistant's schema gate is a `+"no-op for this session:",t);return null}})(),s[e]}function p(e){return v(e)&&Object.keys(e).length>0}function X2(e){let t=e?.document,r=e?.project,o=p(t)?t:a.document,c=p(r)?r:a.project,m=o!==a.document||c!==a.project;if(o===i.document&&c===i.project)return m;return i.document=o,i.project=c,s.document=null,s.project=null,m}var j=["unevaluatedProperty","additionalProperty","missingProperty"];function l(e){return(e.errors||[]).map((t)=>{let r=j.find((c)=>n(t.params[c])),o=r?` (${String(t.params[r])})`:"";return`${t.instancePath||"(root)"}: ${t.message}${o}`})}async function hm(e){let t=await u("document");if(!t||t(e))return[];return l(t)}async function Q2(e){let t=await u("document");if(!t)return null;return t(e)?[]:l(t)}async function Bu(e){let t=await u("project");if(!t||t(e))return[];return l(t)}
|
|
2
|
+
export{X2,hm,Q2,Bu};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=862CC439A0A0B2F464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-jr30g4ae.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var s=Object.create;var{getPrototypeOf:t,defineProperty:n,getOwnPropertyNames:u}=Object;var q=Object.prototype.hasOwnProperty;function v(a){return this[a]}var w,x,
|
|
2
|
-
export{
|
|
1
|
+
var s=Object.create;var{getPrototypeOf:t,defineProperty:n,getOwnPropertyNames:u}=Object;var q=Object.prototype.hasOwnProperty;function v(a){return this[a]}var w,x,ip=(a,b,c)=>{var i=a!=null&&typeof a==="object";if(i){var f=b?w??=new WeakMap:x??=new WeakMap,d=f.get(a);if(d)return d}c=a!=null?s(t(a)):{};let g=b||!a||!a.__esModule||!q.call(a,"default")?n(c,"default",{value:a,enumerable:!0}):c;if(a&&typeof a==="object"||typeof a==="function"){for(let e of u(a))if(!q.call(g,e))n(g,e,{get:v.bind(a,e),enumerable:!0})}if(i)f.set(a,g);return g};var pe=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports);var y=(a)=>a;function z(a,b){this[a]=y.bind(null,b)}var eo=(a,b)=>{for(var c in b)n(a,c,{get:b[c],enumerable:!0,configurable:!0,set:z.bind(b,c)})};var r,o,m,le=(a,b)=>{for(var[c,i,f]of r||[])for(var d=[a],g=globalThis,e=g.document,p,k,l,h,j;k=d.pop();)if(!o[k]&&(l=i[k])){o[k]=1;for(h=1;h<l.length;h++)d.push(f[l[h]]);if(!b&&k!==a&&(p=e&&e.head)){if(m===void 0)m=(h=e.querySelector("meta[property=csp-nonce]"))&&(h.nonce||h.getAttribute("nonce"))||"";if(j=e.createElement("link"),j.rel="modulepreload",j.crossOrigin="",m)j.nonce=m;j.href=new g.URL(l[0],c),p.appendChild(j)}}},G2=(a,b,c,i)=>{for(var f={},d=0;d<b.length;d++)f[b[d]]=c[d];(r||=[]).push([a,f,b]),o||={},le(b[i],1)};
|
|
2
|
+
export{ip,pe,eo,le,G2};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=EF96E641A2CD513D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-k5n4es74.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{as}from"./studio-trcfer2b.js";var r="site-",f=new Set(["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),o=[[183,183],[192,214],[216,246],[248,893],[895,8191],[8204,8205],[8255,8256],[8304,8591],[11264,12271],[12289,55295],[63744,64975],[65008,65533],[65536,983039]];function n(e){return`${String.fromCodePoint(92)}u{${e.toString(16)}}`}var a=[String.raw`\-.0-9_a-z`,...o.map(([e,t])=>`${n(e)}-${n(t)}`)].join(""),s=new RegExp(`^[${a}]$`,"u");function aw(e){if(e==="")return"Enter a tag name.";if(!/^[a-z]/.test(e))return"A tag name starts with a lower-case letter.";for(let t of e.slice(1))if(!s.test(t))return/[A-Z]/.test(t)?"A tag name is lower case.":`“${t}” cannot appear in a tag name.`;if(!e.includes("-"))return"A tag name needs a hyphen, such as my-card.";if(f.has(e))return`<${e}> is reserved by HTML.`;return""}function ab(e){let t=as(e).replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"");if(t==="")return"";return/^[a-z]/.test(t)&&t.includes("-")?t:`${r}${t}`}
|
|
2
|
+
export{aw,ab};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=CFB1CAD40B22D7F764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-k6hbx2fc.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-9ndgd55w.js";import{Si}from"./studio-8pne0rx4.js";import{us}from"./studio-by8x0jvc.js";import{nn}from"./studio-t6dqnnft.js";import{Wc,fA,Fb}from"./studio-vtey9w98.js";import{Z}from"./studio-ywf9y1e2.js";var u=new Map,h=new Map,d=new Map,g=new Set;function m(e){return nn(e)===".svg"}function c(e){let t=e===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(e),n=t?Number(t[1]):Number.NaN;return n>0?n:null}function M(e){let t=new DOMParser().parseFromString(e,"image/svg+xml").documentElement;if(t.localName!=="svg")return null;let n=c(t.getAttribute("width")),i=c(t.getAttribute("height")),r=(t.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=r[2]??Number.NaN,l=r[3]??Number.NaN,a=r.length===4&&o>0&&l>0,s=null;if(n!==null&&i!==null)s={height:i,width:n};else if(a&&n!==null)s={height:n*l/o,width:n};else if(a&&i!==null)s={height:i,width:i*o/l};else if(a)s={height:l,width:o};return s&&{height:Math.round(s.height),width:Math.round(s.width)}}async function b(e){g.add(e);try{let t=M(await p().readFile(e));if(t&&t.width>0&&t.height>0)d.set(e,t)}catch{}}function Rd(e){let t=Si(e);return u.has(t)&&(!m(t)||g.has(t))}function f(e,t){let n=fA(e),i=d.get(e);return{bytes:Z(t?.size)?t.size:null,ext:nn(n),height:i?.height??null,kind:Wc({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function Dd(e){return u.get(Si(e))??null}function iN(e){for(let t of e){if(t.type!=="file")continue;let n=Si(t.path);if(!u.has(n))u.set(n,f(n,t))}}async function qu(e){let t=Si(e),n=u.get(t);if(n&&Rd(t))return n;let i=h.get(t);if(i)return i;let r=(async()=>{if(m(t)&&!g.has(t))await b(t);if(n){let a=d.get(t);return{...n,height:a?.height??null,width:a?.width??null}}let l;try{l=(await us(()=>p().listDirectory(Fb(t)))).find((s)=>Si(s.path)===t)}catch{l=void 0}return f(t,l)})();h.set(t,r);let o=await r;return h.delete(t),u.set(t,o),o}function _p(e,t,n){if(!(t>0&&n>0))return!1;let i=Si(e);if(m(i))return!1;let r=d.get(i);if(r&&r.width===t&&r.height===n)return!1;d.set(i,{height:n,width:t});let o=u.get(i);if(o)u.set(i,{...o,height:n,width:t});return!0}function oN(){u.clear(),d.clear(),g.clear()}function WT(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function Aw(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(WT(e.bytes));return t.join(" · ")}
|
|
2
|
+
export{Rd,Dd,iN,qu,_p,oN,WT,Aw};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=7386B99F4F26428664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-kqh7fxn6.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function m(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function
|
|
2
|
-
export{
|
|
1
|
+
function m(s,n={}){let t=n.baseMs??1000,o=n.maxMs??30000,i=n.random??Math.random,e=Math.min(o,t*2**Math.max(0,s));return e/2+i()*e/2}function ky(s,n={}){let t=n.win??(typeof window>"u"?void 0:window),o=n.doc??(typeof document>"u"?void 0:document),i=0,e=null,r=!1,a=()=>{if(e=null,!r)s()},c=()=>{if(r||e===null)return;clearTimeout(e),i=0,a()},u=(d)=>{if(d.persisted)c()},l=()=>{if(o?.visibilityState==="visible")c()};return t?.addEventListener("online",c),t?.addEventListener("pageshow",u),o?.addEventListener("visibilitychange",l),{dispose(){if(r)return;if(r=!0,e!==null)clearTimeout(e),e=null;t?.removeEventListener("online",c),t?.removeEventListener("pageshow",u),o?.removeEventListener("visibilitychange",l)},opened(){i=0},scheduleRetry(){if(r||e!==null)return;let d=m(i,n);i+=1,e=setTimeout(a,d)},wake:c}}
|
|
2
|
+
export{ky};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=299FBD6E991CCBF664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-kyw47pet.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Ht,Wi,fn,lr,Aa}from"./studio-a6e5fzve.js";import{C}from"./studio-tfmhnwyr.js";import{Pn,Kc,St,Hi,Ce,To,We,Wd,u}from"./studio-ztppbam0.js";import{Lo}from"./studio-8pne0rx4.js";import{te}from"./studio-psh8mwnw.js";import{lm}from"./studio-ht81xjkr.js";import{_a}from"./studio-vtey9w98.js";import{WD,tT}from"./studio-fg4fj9ec.js";import{Co}from"./studio-nqexty8x.js";import{yr,Zu}from"./studio-0rg30pvs.js";import{aw,ab}from"./studio-k6hbx2fc.js";import{sb}from"./studio-6rbaedw2.js";import{Ml}from"./studio-ge08zwpv.js";import{ya,Ic,GE}from"./studio-n4qq1n57.js";import{as,pb}from"./studio-trcfer2b.js";import{v}from"./studio-ywf9y1e2.js";import{le}from"./studio-k5n4es74.js";var tb=["page","collection","template","component","media","entry"],tw={collection:{cta:"Create collection",hint:"Posts, products, team… with a page each",icon:"stack",id:"collection",label:"Collection",nameLabel:"Collection name",placeholder:"Recipes"},component:{cta:"Create component",hint:"A reusable block for any page",icon:"cube",id:"component",label:"Component",nameLabel:"Component name",placeholder:"Pricing table"},entry:{cta:"Create entry",hint:"A new item in a collection",icon:"file-text",id:"entry",label:"Entry",nameLabel:"Entry name",placeholder:"My first post"},media:{cta:"Upload",hint:"Images, video, documents",icon:"image",id:"media",label:"Media",nameLabel:"",placeholder:""},page:{cta:"Create page",hint:"A new URL on your site",icon:"file",id:"page",label:"Page",nameLabel:"Page name",placeholder:"Pricing"},template:{cta:"Create template",hint:"Shared frame that pages sit inside",icon:"frame-corners",id:"template",label:"Template",nameLabel:"Template name",placeholder:"Landing"}},Hs="blank",$c="article",P_="selection",sm="copy",nw=["title","image","richText","date","tags","number","link"],F_={date:{key:"date",label:"Date",schema:{format:"date",type:"string"}},image:{key:"cover",label:"Image",schema:{format:"image",type:"string"}},link:{key:"link",label:"Link",schema:{format:"uri",type:"string"}},number:{key:"number",label:"Number",schema:{type:"number"}},richText:{key:null,label:"Rich text",schema:null},tags:{key:"tags",label:"Tags",schema:{items:{type:"string"},type:"array"}},title:{key:"title",label:"Title",schema:{type:"string"}}},hE=["title","image","richText"];function p(e,n){return e==="."||e===""?n:`${e}/${n}`}function Qa(e){return e.replace(/^\.\//,"")}function j_(e,n){let t=n.defaultLayout;if(e===Hs||e==="")return t?!1:void 0;if(t&&Qa(t)===Qa(e))return;return e}function Mu(e){let n=e.defaultLayout;if(n)return e.layouts.find((r)=>Qa(r.ref)===Qa(n))?.ref??n;return e.layouts[0]?.ref??Hs}function H_(e,n){let t=Pn(n??"");if(t!==null){let r=e.layouts.find((o)=>Qa(o.ref).replace(/\.json$/i,"").split("/").some((l)=>Pn(l)===t));if(r)return r.ref}return Mu(e)}function R(e){return e.trim().replaceAll("\\","/").split("/").map((n)=>as(n)).filter((n)=>n!=="")}function I(e){let n={};for(let r of nw){let o=F_[r];if(e.includes(r)&&o.key!==null&&o.schema!==null)n[o.key]={...o.schema}}let t={properties:n,type:"object"};if(e.includes("title"))t.required=["title"];return t}function cD(e,n){let t=e?.properties??{};return nw.filter((r)=>{let{key:o}=F_[r];return o===null?n:Object.hasOwn(t,o)})}function w(e,n){let t=GE(e.schema);if(n!==void 0&&n!==""&&e.schema?.properties?.title!==void 0)t.title=n;if(e.ext===".json"||e.formatName===null)return{doc:t,format:null};return{doc:{...t,children:[]},format:e.formatName,frontmatter:Object.keys(t).length>0}}function pE(e,n,t,r){let o=[];if(n.includes("title"))o.push({tagName:"h1",textContent:"${state.entry.data.title}"});if(n.includes("image"))o.push({attributes:{alt:n.includes("title")?"${state.entry.data.title}":"",loading:"lazy",src:"${state.entry.data.cover}"},tagName:"img"});if(n.includes("richText")&&r.contentFormat!==null)o.push({children:"${state.entry.$children}",tagName:"div"});let i={};if(t!==void 0)i.$layout=t;return i.$paths={contentType:e,field:"id",param:"slug"},i.title=n.includes("title")?"${state.entry.data.title}":Zu(e),i.state={entry:{$prototype:"ContentEntry",$src:"@jxsuite/parser/ContentEntry.class.json",contentType:e,field:"id",id:{$ref:"#/$params/slug"}}},i.tagName="article",i.children=o,i}function am(e,n){let t=n.i18n??null,r=Pn(e);return t!==null&&r!==null&&t.locales.includes(r)?r:null}function nb(e){return e.dir.includes(Lo)}function _(e,n){return e.localeDirs?.[n]??e.dir.replace(Lo,n.toLowerCase())}function E(e,n,t){let r=t.i18n??null;if(n===null||r===null)return e;return Kc(e,n,{...r,locales:[...r.locales]})??e}function J(e){let n=e.lastIndexOf("/");return n===-1?[".",e]:[e.slice(0,n),e.slice(n+1)]}function W(e,n,t){if(n.startFrom===sm&&n.copyOf!==void 0){let r=t.componentDocs?.get(n.copyOf);if(r){let o=JSON.parse(JSON.stringify(r));return delete o.$id,o.tagName=e,o}}return{children:[],tagName:e}}function B(e,n,t){let r=n.startFrom??Mu(t),o=r===$c&&t.article!==null?t.article:null,i=o?.ext??".json",l=n.url===void 0?[as(e)].filter((m)=>m!==""):R(n.url),a=l.length===0?n.url===void 0?"":"index":l.at(-1),s=["pages",...l.slice(0,-1)].join("/"),c=a===""?"":`${a}${i}`,f=am(n.locale,t),d=c===""?p(s,c):E(p(s,c),f,t),b=c===""?s:J(d)[0],g=e.trim(),y;if(o)y={doc:{children:[{tagName:"h1",textContent:g}],title:g},format:o.name,frontmatter:!0};else{let m={},h=j_(r===$c?Hs:r,t);if(h!==void 0)m.$layout=h;m.title=g,m.tagName="main",m.children=[{tagName:"h1",textContent:g}],y={doc:m,format:null}}let N=c===""?"":yr(d).urlPattern;return{content:y,dir:b,ext:i,extraWrites:[],fileName:c,kind:"page",path:d,route:N,saved:c===""?"":`Saved as ${d} · opens at ${N}`}}function K(e,n,t){let r=as(e),o=n.fields??hE,i=t.i18n??null,l=i!==null&&n.localized!==!1,a=`content/${r}`,s=l?`${a}/${i.defaultLocale.toLowerCase()}`:a,c=t.contentFormat,f=c?.ext??".json",d=Zu(r),b=r===""?"":`first-${d.replaceAll(" ","-")}${f}`,g=I(o),y=structuredClone(g),N={format:c?.name??"json",schema:v(y)?y:{},source:l?`./${a}/${Lo}`:`./${a}`},m=w({ext:f,formatName:c?.name??null,schema:g},`First ${d}`),h=[],k,L="";if(n.ownPage!==!1&&r!==""){let j=n.pageTemplate??Mu(t),D=l?[i.defaultLocale,...i.locales.filter((x)=>x!==i.defaultLocale)]:[null],T=[];for(let x of D){let O=E(`pages/${r}/[slug].json`,x,t),A=x===null||j!==Mu(t)?j:H_(t,x);k??=yr(O).urlPattern,h.push({body:{doc:pE(r,o,j_(A,t),t),format:null},path:O}),T.push(O)}L=T.length===1?`, and ${T[0]} at ${k}`:`, and a page in each language (${T.join(", ")})`}let P={config:{entry:N,name:r},content:m,dir:s,ext:f,extraWrites:h,fileName:b,kind:"collection",path:p(s,b),saved:r===""?"":l?`Adds a “${r}” collection to project.json with one folder per language under ${a}/, a first entry in ${s}/${L}.`:`Adds a “${r}” collection to project.json, a ${s}/ folder with a first entry${L}.`};if(k!==void 0)P.route=k;return P}function M(e,n){let t=as(e),r=t===""?"":`${t}.json`,o=p("layouts",r),i={},l=n.startFrom??"";if(l!==""&&l!==Hs)i.$layout=l;return i.tagName="div",i.children=[{children:[{tagName:"slot"}],tagName:"main"}],{content:{doc:i,format:null},dir:"layouts",ext:".json",extraWrites:[],fileName:r,kind:"template",path:o,saved:r===""?"":`Saved as ${o} with one slot.`}}function z(e,n,t){let r=ab(e),o=r===""?"":`${r}.json`,i=p("components",o);return{content:{doc:W(r,n,t),format:null},dir:"components",ext:".json",extraWrites:[],fileName:o,kind:"component",path:i,saved:o===""?"":`Saved as ${i} with tag <${r}>.`,tag:r}}function U(e,n,t){let r=t.collections.find((d)=>d.name===n.collection)??null,o=as(e),i=r?.ext??".json",l=am(n.locale,t),a=r!==null&&nb(r)&&l===null,s=r===null?"content":nb(r)&&l!==null?_(r,l):r.dir,c=o===""||r===null||a?"":`${o}${i}`,f=p(s,c);return{content:r?w(r,e.trim()):{doc:{},format:null},dir:s,ext:i,extraWrites:[],fileName:c,kind:"entry",path:f,saved:c===""?"":`Saved as ${f} in ${r.name}.`}}function fE(e,n,t,r){switch(e){case"page":return B(n,t,r);case"collection":return K(n,t,r);case"template":return M(n,t);case"component":return z(n,t,r);case"entry":return U(n,t,r);default:{let o=t.files??0;return{content:{doc:{},format:null},dir:_a,ext:"",extraWrites:[],fileName:"",kind:e,path:_a,saved:o===0?`Saved under ${_a}/. No folder to choose.`:`${o===1?"1 file":`${o} files`} will be saved under ${_a}/.`}}}}function q(e,n){let t=e.lastIndexOf("/"),r=t===-1?".":e.slice(0,t),o=n(r);return pb(e.slice(t+1),"",{dir:r,taken:o??new Set})}function S(e){if(e.kind!=="page"||e.fileName==="")return[];let n=e.fileName.slice(0,e.fileName.length-e.ext.length);if(n!=="index")return[{dir:e.dir,stem:n},{dir:p(e.dir,n),stem:"index"}];let t=e.dir.lastIndexOf("/");if(t===-1)return[{dir:e.dir,stem:n}];return[{dir:e.dir,stem:n},{dir:e.dir.slice(0,t),stem:e.dir.slice(t+1)}]}function V(e,n){let t=e.fileName.toLowerCase();for(let{dir:r,stem:o}of S(e)){let i=`${o.toLowerCase()}.`;for(let l of n(r)??[])if(l.startsWith(i)&&!(r===e.dir&&l===t))return p(r,l)}return null}function H(e){return pb(e,"",{choice:{ext:"",kind:"fixed"},dir:".",taken:new Set})}function mE(e,n,t,r,o){if(e.kind==="media")return(t.files??0)===0?"Drop files here, or browse for them.":"";let i=H(n);if(i!=="")return i;switch(e.kind){case"page":{if(t.url!==void 0){if(t.url.replaceAll("\\","/").split("/").includes(".."))return"A URL cannot step outside the site.";if(!t.url.trim().startsWith("/"))return"A URL starts with a slash, such as /pricing."}let a=V(e,o);if(a!==null)return`${a} already opens at ${e.route??"/"}.`;break}case"component":{let a=e.tag??"",s=aw(a);if(s!=="")return s;if(r.componentTags.includes(a))return`A component named <${a}> already exists.`;if(t.startFrom===P_&&r.hasSelection!==!0)return"Select an element on the canvas to make a component from it.";if(t.startFrom===sm&&(t.copyOf===void 0||r.componentDocs?.get(t.copyOf)===void 0))return"Choose the component to copy.";break}case"collection":{let a=e.config?.name??"";if(r.declaredContent.includes(a))return`A collection named “${a}” already exists.`;if(o("content")?.has(a)===!0)return`content/${a}/ already exists.`;break}case"entry":{let a=r.collections.find((s)=>s.name===t.collection);if(!a)return"Choose the collection this entry belongs to.";if(nb(a)&&am(t.locale,r)===null)return`Choose the language this ${Zu(a.name)} is written in.`;break}default:break}let l=[...e.kind==="collection"?[]:[e.path],...e.extraWrites.map((a)=>a.path)];for(let a of l){let s=q(a,o);if(s!=="")return s}return""}function gE(e){let n=new Set,t=(r)=>{let o=r.lastIndexOf("/");n.add(o===-1?".":r.slice(0,o))};if(e.kind==="media")return[];if(e.kind==="collection")n.add("content");else if(e.fileName!=="")t(e.path);for(let r of e.extraWrites)t(r.path);for(let{dir:r}of S(e))n.add(r);return[...n]}function dD(e){let n=(r)=>r==="."?0:r.split("/").length,t=new Map;for(let r of e){let o=n(r);t.set(o,[...t.get(o)??[],r])}return[...t.entries()].toSorted(([r],[o])=>r-o).map(([,r])=>r)}function uD(e,n){if(e===".")return!1;let t=e.lastIndexOf("/"),r=n.get(t===-1?".":e.slice(0,t));return r!==void 0&&!r.has(e.slice(t+1).toLowerCase())}function B_(e){if(e.ext===".json")return null;return(e.def.format?Wi(e.def.format)?.name:void 0)??fn(`untitled${e.ext}`)?.name??lr()?.name??null}async function G(e){let n=w({ext:e.ext,formatName:B_(e),schema:e.schema});if(n.format===null)return Co(n.doc,null);return Aa(n.format,n.doc,{frontmatter:n.frontmatter??!1,mode:"roundtrip"})}async function Y2(e,n={}){let t=ya(e);if(!t)return C.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 Ht().catch(()=>{});let r;try{r=await G(t)}catch(s){return C.error(`Could not prepare a new ${t.name} entry.`,{detail:te(s),path:t.dir,source:"Content"}),null}let o=n.dir,i=o!==void 0&&Wd(o)?.name===t.name?o:t.dir;if(i.includes(Lo))return C.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 (le("yswdhxrf"),import("./files-yswdhxrf.js")),a=await l({content:r,dir:i,format:{ext:t.ext,kind:"fixed"},source:"Content",suggestedName:"untitled",title:`New ${t.name} entry`});if(a===null)return null;return lm(t.name),await Ml(a),a}function F(){let e=u.value;return e&&Ic(e.documentPath)?e:null}function Y(){return[{args:Ce({path:We("Project-relative path of the entry file to open.")}),category:"File",id:"content.openEntry",level:"project",menus:["context/file","palette"],group:"1_file",requires:"an open project",when:(e)=>e.project.open,run:async(e,n)=>{await Ml(St("content.openEntry",n,"path"))},title:"Open Entry"},{args:Ce({draft:To("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:()=>F()!==null,undo:"document",run:(e,n)=>{let t=F();if(!t)throw Error("content.setDraft: the active document is not a content entry");sb(t,Hi("content.setDraft",n,"draft"))},title:"Set Draft"},{args:Ce({include:To("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,n)=>{WD(Hi("content.setIncludeDrafts",n,"include")),await tT()},title:"Include Drafts"}]}function bE(e){e.registerAll(Y())}
|
|
2
|
+
export{tb,tw,Hs,$c,P_,sm,nw,F_,hE,Qa,j_,Mu,H_,cD,pE,am,nb,fE,mE,gE,dD,uD,B_,Y2,bE};
|
|
3
|
+
|
|
4
|
+
//# debugId=466AE0DD27DC0A1D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-mkw17ngg.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{mt,io}from"./studio-k3xxbagr.js";import{UA,bC,Pt,Nt,uh,ZA,ae}from"./studio-q7rtx6zq.js";import{ge,ne,g,eu,C,Lh}from"./studio-43sd2mam.js";import{Q}from"./studio-nqxqf8p2.js";import{n,te}from"./studio-vxq7fcvv.js";var qe="data-jx-region",fe=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],pe=new Set(["dock.bottom"]);function me(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),r=t===-1?void 0:e.slice(t+1);if(r===""||o==="")return null;let s=o,i;if(!pe.has(o)){let c=o.indexOf(".");if(c!==-1){if(s=o.slice(0,c),i=o.slice(c+1),i==="")return null}}let l=fe.find((c)=>c===s);if(l===void 0)return null;return i===void 0?r===void 0?{surface:l}:{part:r,surface:l}:r===void 0?{instance:i,surface:l}:{instance:i,part:r,surface:l}}function ve(e){return me(e)!==null}function he(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function X(e){return e??document}var be=[{locate:([,e],t)=>{let r=Mp(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return r?[r]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Mp("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ye(e,t){let o=he(e);if(!ve(o))return[];let r=[...X(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(r.length>0)return r;for(let s of be){let i=o.match(s.pattern);if(i)return s.locate(i,X(t))}return[]}function Mp(e,t){return ye(e,t).at(-1)??null}var b$={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function wi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function FA(e){return wi(e,"tabs")}function jA(e){return`navigator/panel:${e}`}function HA(e){return`inspector/tab:${e}`}var BA="navigator/statements";function zA(e){return`inspector/statements:${e}`}function fx(e){return`dock.bottom/panel:${e}`}var xe={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function ft(e,t){let o=xe[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var _=new Map,Z=1;function ee(e){let t=Z;return Z+=1,_.set(t,{...e,id:t}),t}function I(e){_.delete(e)}function oe(){return[..._.values()]}function MA(e){let t=e.toLowerCase();return oe().filter((o)=>o.elements.has(t))}function PA(e){return oe().filter((t)=>t.name===e)}var F=null;function g$(e=document){return F??=ZA({document:e}),F}function re(){return F??g$()}var E="jx-studio:/surfaces/",M=new Map;function T(e,t){M.set(e,t),bC(Se(e),t)}function Se(e){return`${E}${e}.json`}function WA(e){return M.get(e)}function $e(e){if(!e.startsWith(E)||!e.endsWith(".json"))return;return M.get(e.slice(E.length,-5))}async function R(e,t,o,r={}){let s=M.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await re(),r.region)o.setAttribute(qe,r.region);let i={scope:t,base:E,resolver:$e};if(r.onNodeCreated)i.onNodeCreated=r.onNodeCreated;if(r.onNodeMoved)i.onNodeMoved=r.onNodeMoved;if(r.signal)i.signal=r.signal;let l=await UA(s,o,i),c=(a)=>({dispose:a,elements:l.elements,root:l.root,scope:l.scope});if(r.signal?.aborted)return c(l.dispose);let d=0,p=()=>{l.dispose(),I(d)};return d=ee({elements:l.elements,host:o,name:e,remount:async()=>{p(),await R(e,t,o,r)}}),r.signal?.addEventListener("abort",()=>I(d),{once:!0}),c(p)}var ie={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",ie);function Jt(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Zs(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(qe,ft("dialog",e.region)),e.layer.append(t);let o=g({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,s=!1,i=()=>s,l=()=>{},c=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let u=a.root;if(i())return a.dispose(),u;if(r=a,await Promise.race([Jt(u),c]),i())return u;if(e.island?.(u.querySelector('[part="island"]')??u),Pt(u),e.field){let x=u.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!s)uh(x,e.field?.select??"all")},0)}return u});return{close(){if(s)return;s=!0,l();let a=r?.root;if(a instanceof HTMLElement)Nt(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let u=a.error;queueMicrotask(()=>{o.error=u})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function Te(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function Tn(e,t,o,r=t){let s=(l)=>{if(!Te(l))console.error(`${r}: command "${t}" failed`,l);C.error(Q(l),{key:`command.run:${t}`,source:r})},i;try{i=e.run(t,o)}catch(l){return s(l),Promise.resolve()}return Promise.resolve(i).catch(s)}function rt(e,t,o){let r=ae();return r?Tn(r,e,t,o):Promise.resolve()}var de=null,z=null,J=null,j=null;function tt(e){return(e==="popover"?de:e==="modal"?z:e==="toast"?j:J)??document.body}function v$(){de=document.querySelector("#layer-popover"),z=document.querySelector("#layer-modal"),J=document.querySelector("#layer-dialog"),j=document.querySelector("#layer-toast"),Ne()}var le="jx-dialog[data-open], dialog[open]";function Wb(){return Boolean(J?.querySelector(le)||z?.querySelector(le))}function y$(){return document.querySelector(":popover-open")!==null}function Ko(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:s="Cancel",destructive:i=!1}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Zs({cancelLabel:s,confirmLabel:r,destructive:i,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d(!1),onClosed:()=>d(!1),onConfirm:()=>d(!0)})})}function gC(e,t,o={}){let{saveLabel:r="Save",discardLabel:s="Discard",cancelLabel:i="Cancel"}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Zs({cancelLabel:i,confirmLabel:r,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d("cancel"),onClosed:()=>d("cancel"),onConfirm:()=>d("save"),onSecondary:()=>d("discard"),secondaryLabel:s})})}function U(e){if(n(e))return{message:e};return{island:(t)=>{io(e,t)}}}function xi(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:s="OK",message:i,mono:l=!1,multiline:c=!1,placeholder:d="",rows:p="3",select:a="all",size:u,validate:x,value:ue=""}=t,P=(v)=>x?x(v,L):v.trim()?"":"Enter a value.",h=ue,L=r?.initial??"",m="",V=!1,W=()=>te(d)?d():d,K=()=>r?r.options().map((v)=>({label:v.label,value:v.value})):[];return new Promise((v)=>{let B=!1,D=(f)=>{if(B)return;B=!0,k.close(),v(f)},Y=(f)=>{m=f,k.update({error:m,invalid:m!==""})},S={cancelLabel:o,confirmLabel:s,headline:e,layer:tt("dialog"),onCancel:()=>D(null),onClosed:()=>D(null),onConfirm:()=>{let f=P(h);if(f){Y(f);return}D(h.trim())},onInput:(f)=>{V=!0,h=f;let w=P(h);if(w!==m)Y(w)},onPick:(f)=>{L=f,r?.onChange?.(f);let w=P(h);m=V||m?w:"",k.update({chosen:L,error:m,invalid:m!=="",options:K(),placeholder:W()})}};if(i!==void 0)Object.assign(S,U(i));if(r)S.choice={chosen:L,label:r.label,options:K()};if(S.field={mono:l,multiline:c,placeholder:W(),rows:p,select:a,value:h},u!==void 0)S.size=u;let k=Zs(S)})}var N=new Map;function Xs(e,t){let o=`${e}:${t}`,r=N.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(qe,ft(e,t)),tt(e).append(r),N.set(o,r),r}function Vb(e,t){let o=`${e}:${t}`,r=N.get(o);if(r)io(mt,r),r.remove(),N.delete(o)}var we=180,Ee={error:"✕",info:"ℹ",success:"✓",warn:"!"},A=null,y=new Map,b=new Set;function Me(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function Oe(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function w$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function q(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),Lh(e)}function Ce(e){if(y.has(e.id)||b.has(e.id))return;let t=Me()?0:we;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||Oe())return;y.set(e.id,setTimeout(()=>q(e.id),o))}T("toasts",se);var G=null,H=null,O=null;function ce(){return G??=g({dismissToast:(e)=>{q(e)},runAction:(e)=>{let t=eu.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;q(e),Tn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),G}function je(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,s=r&&o!==void 0&&t.isVisible(o)?r:null,i=s&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:s?.title??"",actionTitle:s===null?"":i===void 0?s.title:`${s.title} — requires ${i}`,hasAction:s!==null,icon:Ee[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ne(){if(Ae(),!j)return;A=ge(),A.run(()=>{ne(()=>{eu.length,ae();for(let e of eu)Ce(e);ce().toasts=eu.map((e)=>je(e))})}),H=R("toasts",ce(),j),H.then((e)=>{O=e})}function Ae(){A?.stop(),A=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=H;if(H=null,O)O.dispose(),O=null;else if(e)e.then((t)=>t.dispose());G=null}
|
|
2
|
-
export{
|
|
1
|
+
import{mt,io}from"./studio-ajw4k8hp.js";import{WA,fC,Ot,Nt,dh,JA,ae}from"./studio-qs5fmhtj.js";import{ge,ne,g,Zd,C,Th}from"./studio-tfmhnwyr.js";import{te}from"./studio-psh8mwnw.js";import{n,Q}from"./studio-ywf9y1e2.js";var Ue="data-jx-region",fe=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],pe=new Set(["dock.bottom"]);function me(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),r=t===-1?void 0:e.slice(t+1);if(r===""||o==="")return null;let s=o,i;if(!pe.has(o)){let c=o.indexOf(".");if(c!==-1){if(s=o.slice(0,c),i=o.slice(c+1),i==="")return null}}let l=fe.find((c)=>c===s);if(l===void 0)return null;return i===void 0?r===void 0?{surface:l}:{part:r,surface:l}:r===void 0?{instance:i,surface:l}:{instance:i,part:r,surface:l}}function ve(e){return me(e)!==null}function he(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function X(e){return e??document}var be=[{locate:([,e],t)=>{let r=Op(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return r?[r]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=Op("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ye(e,t){let o=he(e);if(!ve(o))return[];let r=[...X(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(r.length>0)return r;for(let s of be){let i=o.match(s.pattern);if(i)return s.locate(i,X(t))}return[]}function Op(e,t){return ye(e,t).at(-1)??null}var p$={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function wi(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function MA(e){return wi(e,"tabs")}function PA(e){return`navigator/panel:${e}`}function FA(e){return`inspector/tab:${e}`}var jA="navigator/statements";function HA(e){return`inspector/statements:${e}`}function mx(e){return`dock.bottom/panel:${e}`}var xe={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function ft(e,t){let o=xe[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var _=new Map,Z=1;function ee(e){let t=Z;return Z+=1,_.set(t,{...e,id:t}),t}function I(e){_.delete(e)}function oe(){return[..._.values()]}function AA(e){let t=e.toLowerCase();return oe().filter((o)=>o.elements.has(t))}function OA(e){return oe().filter((t)=>t.name===e)}var F=null;function h$(e=document){return F??=JA({document:e}),F}function re(){return F??h$()}var E="jx-studio:/surfaces/",M=new Map;function T(e,t){M.set(e,t),fC(Se(e),t)}function Se(e){return`${E}${e}.json`}function BA(e){return M.get(e)}function $e(e){if(!e.startsWith(E)||!e.endsWith(".json"))return;return M.get(e.slice(E.length,-5))}async function R(e,t,o,r={}){let s=M.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await re(),r.region)o.setAttribute(Ue,r.region);let i={scope:t,base:E,resolver:$e};if(r.onNodeCreated)i.onNodeCreated=r.onNodeCreated;if(r.onNodeMoved)i.onNodeMoved=r.onNodeMoved;if(r.signal)i.signal=r.signal;let l=await WA(s,o,i),c=(a)=>({dispose:a,elements:l.elements,root:l.root,scope:l.scope});if(r.signal?.aborted)return c(l.dispose);let d=0,p=()=>{l.dispose(),I(d)};return d=ee({elements:l.elements,host:o,name:e,remount:async()=>{p(),await R(e,t,o,r)}}),r.signal?.addEventListener("abort",()=>I(d),{once:!0}),c(p)}var ie={$schema:"https://jxsuite.com/schema/v1",$id:"StudioDialog",$description:"Studio's confirm, save-or-discard and prompt dialogs: one jx-dialog whose body is projected from the adapter's scope. `message` is a sentence; `choice` is a `jx-select` over the options; `field` is the prompt's jx-textfield with its refusal. The four answers call the host's functions, and the host decides when the dialog closes.",tagName:"jx-dialog",$props:{headline:{$ref:"#/state/headline"},confirmLabel:{$ref:"#/state/confirmLabel"},secondaryLabel:{$ref:"#/state/secondaryLabel"},cancelLabel:{$ref:"#/state/cancelLabel"},destructive:{$ref:"#/state/destructive"},size:{$ref:"#/state/size"}},attributes:{headline:"${state.headline}","confirm-label":"${state.confirmLabel || null}","secondary-label":"${state.secondaryLabel || null}","cancel-label":"${state.cancelLabel || null}",part:"dialog-host"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},onsecondary:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/secondary"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{'& [part="message"]':{$description:"The one part of a dialog that is text rather than interface, so it opts back in to selection. The root sets `user-select: none` and `styles/tokens.json` restates it on every `dialog`, so the headline, the labels and the buttons around this sentence stay unselectable; a message is often the thing a reader copies into a search or a bug report.",margin:"0 0 var(--jx-space-3)",userSelect:"text"},'& [part="message"]:last-child':{margin:"0"},'& [part="island"] > p, & [part="island"] > span, & [part="island"] > strong, & [part="island"] > em, & [part="island"] > code':{$description:"The island's own prose is the message's other form — a body richer than a sentence, written straight into the island from a lit template (studio-ui-guidelines.md §9.4) — so it is selectable for the same reason `[part=\"message\"]` is. The opt-in stops at those children because the island is ALSO the mount point for a whole document: the Open Grid picker and Push Schema's plan put their surfaces here, and `user-select` inherits, so a rule on the island itself would hand selection to every heading, source row and button they draw, which is the interface the policy exists to keep unselectable. A mounted surface roots a `div`; a message writes paragraphs and text-level spans, so the two forms are told apart by the child that arrives.",userSelect:"text"},'& [part="island"]:empty':{display:"none"},'& [part="message-slot"], & [part="choice-slot"], & [part="field-slot"]':{display:"contents"},'& [part="choice-row"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0 0 var(--jx-space-3)"},'& [part="choice-label"]':{fontSize:"var(--jx-text-sm)",color:"var(--jx-fg-dim)"},"& jx-textfield":{width:"100%"}},children:[{tagName:"div",attributes:{part:"message-slot",role:"none"},$switch:{$ref:"#/state/hasMessage"},cases:{true:{tagName:"p",attributes:{part:"message"},textContent:"${state.message}"}}},{tagName:"div",attributes:{part:"island"}},{tagName:"div",attributes:{part:"choice-slot",role:"none"},$switch:{$ref:"#/state/hasChoice"},cases:{true:{tagName:"div",attributes:{part:"choice-row"},children:[{tagName:"span",attributes:{part:"choice-label"},textContent:"${state.choiceLabel}"},{tagName:"jx-select",$props:{label:{$ref:"#/state/choiceLabel"},options:{$ref:"#/state/options"},value:{$ref:"#/state/chosen"}},attributes:{part:"choice"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"event#/target/value"}]}]}}]}}},{tagName:"div",attributes:{part:"field-slot",role:"none"},$switch:{$ref:"#/state/hasField"},cases:{true:{tagName:"jx-textfield",$props:{label:{$ref:"#/state/headline"},value:{$ref:"#/state/value"},placeholder:{$ref:"#/state/placeholder"},invalid:{$ref:"#/state/invalid"},error:{$ref:"#/state/error"},multiline:{$ref:"#/state/multiline"},rows:{$ref:"#/state/rows"},mono:{$ref:"#/state/mono"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/input"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"#/state/singleLine"},cases:{true:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]}}]}}]},$description:"The prompt's one field. `multiline` is what makes it a paste box rather than a line: an import the author copied out of a `_redirects` file is column-aligned, so it also asks for `mono`. A multiline field takes Enter as a newline, which is why the Enter-confirms handler below is guarded on it — a paste box whose second line submits the dialog cannot be typed into."}}}]};T("dialog",ie);function Jt(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(r){if(r.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Ys(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(Ue,ft("dialog",e.region)),e.layer.append(t);let o=g({cancel:()=>{e.onCancel()},cancelLabel:e.cancelLabel,choiceLabel:e.choice?.label??"",chosen:e.choice?.chosen??"",closed:()=>{e.onClosed()},confirm:()=>{e.onConfirm()},confirmLabel:e.confirmLabel,destructive:e.destructive===!0,error:"",hasChoice:e.choice!==void 0,hasField:e.field!==void 0,mono:e.field?.mono===!0,multiline:e.field?.multiline===!0,rows:e.field?.rows??"3",singleLine:e.field!==void 0&&e.field.multiline!==!0?"true":"false",hasMessage:e.message!==void 0&&e.message!=="",headline:e.headline,input:(a)=>{o.value=a,e.onInput?.(a)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(a)=>{e.onPick?.(a)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),r=null,s=!1,i=()=>s,l=()=>{},c=new Promise((a)=>{l=a}),p=R("dialog",o,t).then(async(a)=>{let u=a.root;if(i())return a.dispose(),u;if(r=a,await Promise.race([Jt(u),c]),i())return u;if(e.island?.(u.querySelector('[part="island"]')??u),Ot(u),e.field){let x=u.querySelector("jx-textfield");if(x)setTimeout(()=>{if(!s)dh(x,e.field?.select??"all")},0)}return u});return{close(){if(s)return;s=!0,l();let a=r?.root;if(a instanceof HTMLElement)Nt(a);r?.dispose(),r=null,t.remove()},host:t,ready:p,update(a){if(a.confirmLabel!==void 0)o.confirmLabel=a.confirmLabel;if(a.cancelLabel!==void 0)o.cancelLabel=a.cancelLabel;if(a.secondaryLabel!==void 0)o.secondaryLabel=a.secondaryLabel;if(a.message!==void 0)o.message=a.message,o.hasMessage=a.message!=="";if(a.value!==void 0)o.value=a.value;if(a.placeholder!==void 0)o.placeholder=a.placeholder;if(a.invalid!==void 0)o.invalid=a.invalid;if(a.error!==void 0)if(a.error!==""&&a.error===o.error){o.error="";let u=a.error;queueMicrotask(()=>{o.error=u})}else o.error=a.error;if(a.options!==void 0)o.options=a.options;if(a.chosen!==void 0)o.chosen=a.chosen}}}var se={$schema:"https://jxsuite.com/schema/v1",$id:"StudioToasts",$description:"The toast stack: a rendering of the notification service's toasts, newest last. Each row is projected by ui/layers.ts with its severity glyph and, where a recovery command exists, that command's title and gate; the two buttons call back into the host, which owns the records and their timers.",tagName:"div",attributes:{part:"stack"},style:{position:"absolute",right:"var(--jx-space-4)",bottom:"36px",display:"flex",flexDirection:"column",gap:"var(--jx-space-3)",alignItems:"flex-end",maxWidth:"min(420px, calc(100vw - 24px))",'& [part="toast"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",pointerEvents:"auto",padding:"var(--jx-space-3)",border:"1px solid var(--jx-border)",borderLeft:"3px solid var(--jx-fg-dim)",borderRadius:"var(--jx-radius-md)",background:"var(--jx-bg-panel)",color:"var(--jx-fg)",fontSize:"var(--jx-text-sm)",lineHeight:"var(--jx-leading-sm)",boxShadow:"var(--jx-shadow-popover)"},'& [part="toast"][data-severity="success"]':{borderLeftColor:"var(--jx-success)"},'& [part="toast"][data-severity="info"]':{borderLeftColor:"var(--jx-accent)"},'& [part="toast"][data-severity="warn"]':{borderLeftColor:"var(--jx-warning)"},'& [part="toast"][data-severity="error"]':{borderLeftColor:"var(--jx-danger)"},'& [part="icon"]':{flex:"none",width:"14px",textAlign:"center",fontWeight:"700"},'& [data-severity="success"] [part="icon"]':{color:"var(--jx-success)"},'& [data-severity="info"] [part="icon"]':{color:"var(--jx-accent)"},'& [data-severity="warn"] [part="icon"]':{color:"var(--jx-warning)"},'& [data-severity="error"] [part="icon"]':{color:"var(--jx-danger)"},'& [part="message"]':{flex:"1",minWidth:"0",overflow:"hidden",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"3"},'& [part="action-slot"]':{display:"contents"},'& [part="action"] > [part="control"]':{color:"var(--jx-accent)"}},children:[{$prototype:"Array",items:{$ref:"#/state/toasts"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"toast","data-severity":"${$map.item.severity}"},children:[{tagName:"span",attributes:{part:"icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"message"},textContent:"${$map.item.message}"},{tagName:"span",attributes:{part:"action-slot",role:"none"},$switch:{$ref:"$map/item/hasAction"},cases:{true:{tagName:"jx-button",$props:{size:"sm",quiet:!0,disabled:{$ref:"$map/item/actionDisabled"}},attributes:{part:"action",title:"${$map.item.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[{$ref:"$map/item/id"}]}]},children:[{tagName:"span",textContent:"${$map.item.actionLabel}"}]}}},{tagName:"jx-action-button",$props:{label:"Dismiss notification",hint:"Dismiss notification",icon:"x",size:"sm"},attributes:{part:"dismiss"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/dismissToast"},value:[{$ref:"$map/item/id"}]}]}}]}}]};function Te(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function En(e,t,o,r=t){let s=(l)=>{if(!Te(l))console.error(`${r}: command "${t}" failed`,l);C.error(te(l),{key:`command.run:${t}`,source:r})},i;try{i=e.run(t,o)}catch(l){return s(l),Promise.resolve()}return Promise.resolve(i).catch(s)}function rt(e,t,o){let r=ae();return r?En(r,e,t,o):Promise.resolve()}var de=null,z=null,J=null,j=null;function tt(e){return(e==="popover"?de:e==="modal"?z:e==="toast"?j:J)??document.body}function f$(){de=document.querySelector("#layer-popover"),z=document.querySelector("#layer-modal"),J=document.querySelector("#layer-dialog"),j=document.querySelector("#layer-toast"),Ne()}var le="jx-dialog[data-open], dialog[open]";function Ub(){return Boolean(J?.querySelector(le)||z?.querySelector(le))}function m$(){return document.querySelector(":popover-open")!==null}function qo(e,t,o={}){let{confirmLabel:r="Confirm",cancelLabel:s="Cancel",destructive:i=!1}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:s,confirmLabel:r,destructive:i,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d(!1),onClosed:()=>d(!1),onConfirm:()=>d(!0)})})}function pC(e,t,o={}){let{saveLabel:r="Save",discardLabel:s="Discard",cancelLabel:i="Cancel"}=o;return new Promise((l)=>{let c=!1,d=(a)=>{if(c)return;c=!0,p.close(),l(a)},p=Ys({cancelLabel:i,confirmLabel:r,headline:e,layer:tt("dialog"),...U(t),onCancel:()=>d("cancel"),onClosed:()=>d("cancel"),onConfirm:()=>d("save"),onSecondary:()=>d("discard"),secondaryLabel:s})})}function U(e){if(n(e))return{message:e};return{island:(t)=>{io(e,t)}}}function xi(e,t={}){let{cancelLabel:o="Cancel",choice:r,confirmLabel:s="OK",message:i,mono:l=!1,multiline:c=!1,placeholder:d="",rows:p="3",select:a="all",size:u,validate:x,value:ue=""}=t,P=(v)=>x?x(v,L):v.trim()?"":"Enter a value.",h=ue,L=r?.initial??"",m="",V=!1,W=()=>Q(d)?d():d,K=()=>r?r.options().map((v)=>({label:v.label,value:v.value})):[];return new Promise((v)=>{let B=!1,D=(f)=>{if(B)return;B=!0,k.close(),v(f)},Y=(f)=>{m=f,k.update({error:m,invalid:m!==""})},S={cancelLabel:o,confirmLabel:s,headline:e,layer:tt("dialog"),onCancel:()=>D(null),onClosed:()=>D(null),onConfirm:()=>{let f=P(h);if(f){Y(f);return}D(h.trim())},onInput:(f)=>{V=!0,h=f;let w=P(h);if(w!==m)Y(w)},onPick:(f)=>{L=f,r?.onChange?.(f);let w=P(h);m=V||m?w:"",k.update({chosen:L,error:m,invalid:m!=="",options:K(),placeholder:W()})}};if(i!==void 0)Object.assign(S,U(i));if(r)S.choice={chosen:L,label:r.label,options:K()};if(S.field={mono:l,multiline:c,placeholder:W(),rows:p,select:a,value:h},u!==void 0)S.size=u;let k=Ys(S)})}var N=new Map;function Zs(e,t){let o=`${e}:${t}`,r=N.get(o);if(r&&r.parentElement)return r;return r=document.createElement("div"),r.style.pointerEvents="auto",r.setAttribute(Ue,ft(e,t)),tt(e).append(r),N.set(o,r),r}function qb(e,t){let o=`${e}:${t}`,r=N.get(o);if(r)io(mt,r),r.remove(),N.delete(o)}var we=180,Ee={error:"✕",info:"ℹ",success:"✓",warn:"!"},A=null,y=new Map,b=new Set;function Me(){if(!("matchMedia"in globalThis))return!1;return globalThis.matchMedia("(prefers-reduced-motion: reduce)").matches===!0}function Oe(){try{return new URLSearchParams(globalThis.location.search).get("automation")==="1"}catch{return!1}}function g$(){return[...b].map((e)=>`overlay: toast ${e} settling in`)}function q(e){let t=y.get(e);if(t!==void 0)clearTimeout(t),y.delete(e);b.delete(e),Th(e)}function Ce(e){if(y.has(e.id)||b.has(e.id))return;let t=Me()?0:we;if(t>0)b.add(e.id),setTimeout(()=>b.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||Oe())return;y.set(e.id,setTimeout(()=>q(e.id),o))}T("toasts",se);var G=null,H=null,O=null;function ce(){return G??=g({dismissToast:(e)=>{q(e)},runAction:(e)=>{let t=Zd.find((r)=>r.id===e),o=ae();if(!t?.action||!o)return;q(e),En(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),G}function je(e){let t=e.action===void 0?null:ae(),o=e.action,r=t&&o!==void 0?t.get(o):void 0,s=r&&o!==void 0&&t.isVisible(o)?r:null,i=s&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:s?.title??"",actionTitle:s===null?"":i===void 0?s.title:`${s.title} — requires ${i}`,hasAction:s!==null,icon:Ee[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ne(){if(Ae(),!j)return;A=ge(),A.run(()=>{ne(()=>{Zd.length,ae();for(let e of Zd)Ce(e);ce().toasts=Zd.map((e)=>je(e))})}),H=R("toasts",ce(),j),H.then((e)=>{O=e})}function Ae(){A?.stop(),A=null;for(let t of y.values())clearTimeout(t);y.clear(),b.clear();let e=H;if(H=null,O)O.dispose(),O=null;else if(e)e.then((t)=>t.dispose());G=null}
|
|
2
|
+
export{AA,OA,h$,Ue,Op,p$,wi,MA,PA,FA,jA,HA,mx,ft,T,BA,R,Jt,Ys,En,rt,tt,f$,Ub,m$,qo,pC,xi,Zs,qb,g$};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=5C519E11B5D939E964756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-myb4mf0h.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{bh}from"./studio-ztppbam0.js";import{fb}from"./studio-fg4fj9ec.js";import{S}from"./studio-9ra9e7m4.js";import{n,_}from"./studio-ywf9y1e2.js";function qE(){return Object.keys(S?.projectConfig?.content??{})}function ya(e){let t=fb(e);if(!t)return null;if(/\.[a-z\d]+$/i.test(t.dir))return null;return{def:t.def,dir:t.dir,ext:t.ext,name:t.name,schema:t.def.schema??null}}function bw(){return qE().map((e)=>ya(e)).filter((e)=>e!==null)}function Ic(e){let t=bh(e??null,S?.projectConfig);return t?ya(t.name):null}function FD(e){let t=bh(e??null,S?.projectConfig),r=t?fb(t.name):null;if(!t||!r)return null;return{def:r.def,dir:r.dir,ext:r.ext,name:r.name,schema:t.schema}}function c(e){if(e===null||!_(e))return e;return JSON.parse(JSON.stringify(e))}function u(e){if(n(e.$ref))return"";switch(e.type){case"boolean":return!1;case"integer":case"number":return 0;case"array":return[];case"object":return GE(e);default:return""}}function GE(e){let t=e?.properties;if(!t)return{};let r=new Set(Array.isArray(e.required)?e.required:[]),o={};for(let[i,l]of Object.entries(t))if(l.default!==void 0)o[i]=c(l.default);else if(r.has(i))o[i]=u(l);return o}function jD(e,t){return(Array.isArray(e?.required)?e.required:[]).filter((o)=>t[o]===void 0)}
|
|
2
|
+
export{qE,ya,bw,Ic,FD,GE,jD};
|
|
3
|
+
|
|
4
|
+
//# debugId=76BF7B88C8AA6E1164756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-n4qq1n57.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{zA}from"./studio-qs5fmhtj.js";import{bC,u}from"./studio-ztppbam0.js";import{g}from"./studio-tfmhnwyr.js";import{T,R}from"./studio-myb4mf0h.js";import{Xt}from"./studio-9ff0vqff.js";import{Se}from"./studio-nfwacw31.js";import{n,Z,Ze,_,v,Me,Oa,Ma}from"./studio-ywf9y1e2.js";var B={anyOf:[{additionalProperties:!1,description:"Two-way: `target` is the test, `value` the tag when it is truthy, `initial` the tag when it is not.",properties:{initial:{$ref:"#/$defs/TagName"},operator:{const:"?:",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/TagName"}},required:["operator","target","value","initial"],title:"?: — the tag when the test holds, and the tag when it does not"},{additionalProperties:!1,description:"Multiway: `target` is the discriminant, matched against case keys by its string form. "+"`default` is required — an element with no tag cannot exist.",properties:{cases:{additionalProperties:{$ref:"#/$defs/TagName"},type:"object"},default:{$ref:"#/$defs/TagName"},operator:{const:"switch",type:"string"},target:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target","cases","default"],title:"switch — one tag per discriminant value, with a required fallback"}],description:"A tag name chosen at element creation. Every branch resolves to a `TagName`, so the candidate set is enumerable without evaluating anything."},G={anyOf:[{$ref:"#/$defs/TagName"},{additionalProperties:!1,properties:{$expression:{$ref:"#/$defs/TagExpression"}},required:["$expression"],type:"object"}]};var K={description:"HTML element tag name or custom element name (must contain a hyphen per Web Components spec). "+"A NAME, never an expression: no `${…}` position in the pipeline evaluates a tagName. Use "+"`$switch`/`cases` to vary the element.",minLength:1,pattern:"^[a-zA-Z][a-zA-Z0-9._-]*$",type:"string"};var Y={oneOf:[{type:"string"},{$ref:"#/$defs/RefObject"}]};var Ce={additionalProperties:!0,description:"A page-level <head> entry. Defines meta tags, link tags, script tags, etc.",properties:{attributes:{additionalProperties:{oneOf:[{type:"string"},{type:"boolean"}]},type:"object"},children:{items:{$ref:"#/$defs/HeadEntry"},type:"array"},tagName:{type:"string"},textContent:{description:"Element content. An object is serialized to JSON inside the tag — that is how a "+'JSON-LD block (`<script type="application/ld+json">`) is authored.',oneOf:[{type:"string"},{type:"object"}]}},required:["tagName"],type:"object"};var Ee={description:"Reference to a $defs type definition in the current component.",examples:["#/$defs/Count","#/$defs/TodoItem","#/$defs/Status"],pattern:String.raw`^#/\$defs/`,type:"string"};var Re={description:"Reference to an external Jx component file.",examples:["./card.json","https://cdn.example.com/button.json"],pattern:String.raw`^(\./|\.\./).*\.json$|^https?://`,type:"string"};var Pe={description:"Reference to the current Array map iteration context.",examples:["$map/item","$map/index","$map/item/text","$map/item/done"],pattern:String.raw`^\$map/(item|index)(/.*)?$`,type:"string"};var X={additionalProperties:!1,description:"A $ref binding. Resolves to a state entry (reactive) or plain value (static).",properties:{$ref:{$ref:"#/$defs/AnyRef"}},required:["$ref"],type:"object"};var H={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/StyleObject"}]},description:"CSS style definition. camelCase property names follow CSSOM convention. Keys starting with :, ., &, or [ are treated as nested CSS selectors. Keys matching $media breakpoint names (or other @-prefixed at-rules) group nested rules. Nesting is recursive: selector and at-rule groups may nest to arbitrary depth "+"(e.g. breakpoint → selector → pseudo-class), mirroring the compiler's recursive emission. "+"An object carrying $ref is a reactive VALUE, and the runtime reads it as one. It also matches the nested-block branch vacuously, since a block admits a string under any key, which is why these branches are anyOf rather than oneOf. A DECLARATION at-rule (@font-face, @property, @position-try, @counter-style) may hold an ARRAY of blocks, which is that key written more than once, in order: an object's keys are "+"unique, so @font-face — the at-rule whose identity is not in its key — could not otherwise "+"state a family's second weight at all.",patternProperties:{"^@(font-face|property|position-try|counter-style)":{anyOf:[{$ref:"#/$defs/StyleObject"},{items:{$ref:"#/$defs/StyleObject"},minItems:1,type:"array"}]}},properties:{$description:{description:"Why this rule exists. Emitted as a comment by static builds, ignored at runtime.",type:"string"}},type:"object"};var q={additionalProperties:!1,description:"Dynamic mapped list. Re-renders when the items state entry changes.",properties:{$prototype:{const:"Array",type:"string"},filter:{$ref:"#/$defs/RefObject"},items:{oneOf:[{$ref:"#/$defs/RefObject"},{type:"array"}]},key:{additionalProperties:!1,description:"The identity of each rendered row: a $map/item pointer read per item. A row whose key survives a change keeps its DOM node and its effects across reorders, insertions and "+"removals; without a key, rows are keyed by index. $map/index is not a key — an index "+"names a position, not a row.",properties:{$ref:{pattern:String.raw`^\$map/item(/.+)?$`,type:"string"}},required:["$ref"],type:"object"},map:{$ref:"#/$defs/ElementDef"},sort:{$ref:"#/$defs/RefObject"}},required:["$prototype","items","map"],type:"object"},Ae={description:"Array of child definitions — elements, text, or Array namespaces (dynamic lists) mixed "+"freely. A bare Array namespace (the whole children slot is one dynamic list) is also "+"accepted for backward compatibility, as is a ${…} template string that resolves at build "+"time to an array of child definitions.",oneOf:[{items:{anyOf:[{$ref:"#/$defs/ElementDef"},{$ref:"#/$defs/SwitchNode"},{$ref:"#/$defs/ArrayNamespace"},{type:"string"},{type:"number"}]},type:"array"},{$ref:"#/$defs/ArrayNamespace"},{description:"Computed children — a ${…} template that resolves at build time to an array of child "+'definitions (e.g. "${state.entry.$children}" for parsed content). A bare plain-text string is NOT a valid children value; text children must be array items.',pattern:String.raw`\$\{`,type:"string"}]};var Q={additionalProperties:{oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{$ref:"#/$defs/RefObject"}]},description:"HTML attributes and ARIA attributes set via element.setAttribute().",type:"object"},ee={additionalProperties:{anyOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"array"},{type:"object"},{$ref:"#/$defs/RefObject"}]},description:"Explicit prop passing at a component boundary.",type:"object"},te={oneOf:[{type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{$ref:"#/$defs/RefObject"}]},re={additionalProperties:!1,description:"Reactive $ref that drives which case to render: a state entry, or inside a mapped array's template the row's $map/item or $map/index (spec §14.1).",properties:{$ref:{oneOf:[{$ref:"#/$defs/StateRef"},{$ref:"#/$defs/MapRef"}],type:"string"}},required:["$ref"],type:"object"};var oe={additionalProperties:!1,description:'A function declaration. $prototype must be "Function". body (inline) and $src (external) are mutually exclusive. First parameter is always state (the reactive scope).',properties:{$export:{description:"Named export in $src module. Defaults to the state key name.",type:"string"},$lazy:{description:"Load $src on first call instead of importing it up front. The function then returns a "+"promise, so it may only be called from a handler or lifecycle hook — never bound as a "+"computed value. Use it for code most visitors never reach.",type:"boolean"},$prototype:{const:"Function",type:"string"},$src:{description:"External module specifier. Mutually exclusive with body.",examples:["./counter.js","npm:@myorg/validators"],type:"string"},arguments:{description:"Legacy alias for parameters: bare string parameter names (state may be listed explicitly as the first name). Superseded by parameters.",examples:[["state","event"]],items:{type:"string"},type:"array"},body:{description:"Inline function body: an opaque JS source string (first implicit parameter is state), or a structured statement array (spec §20) — explicit structured function declaration, analyzable by tooling and editable visually. The escalation ladder within the shape is structured statements → JS string.",examples:["state.count++",'state.items.push({ id: Date.now(), text: "", done: false })','return state.score >= 90 ? "gold" : "silver"',[{operator:"push",target:{$ref:"#/state/cart"},value:1},{dispatchEvent:"cart-changed",detail:{$ref:"#/state/cart"}}]],oneOf:[{type:"string"},{$ref:"#/$defs/StatementList"}]},description:{type:"string"},emits:{description:"Array of CEM-compatible Event objects this function dispatches. Used for CEM extraction and studio event discovery.",items:{$ref:"#/$defs/CemEvent"},type:"array"},name:{description:"Explicit function name. Defaults to the state key name.",type:"string"},parameters:{description:"Function parameters (after the implicit state parameter). Accepts CEM-compatible parameter objects or bare string names for backward compatibility.",examples:[["event"],[{name:"event",type:{text:"Event"}}],[{description:"Item identifier",name:"id",type:{text:"number"}}]],items:{oneOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"},type:{description:"Return type for tooling (JSON Schema or CEM { text } format)."}},required:["$prototype"],type:"object"};var Fe={additionalProperties:!1,description:"A JSON Pointer $ref operand within an expression node. $args/<name> resolves a named formula's parameter (callable entries only).",properties:{$ref:{pattern:String.raw`^(\$map/|\$reduce/|\$args/|event#/|#/|parent#/|window#/|document#/)`,type:"string"}},required:["$ref"],type:"object"},Ne={anyOf:[{not:{pattern:String.raw`\$\{`},type:"string"},{type:"number"},{type:"boolean"},{type:"null"},{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"},{description:"Plain-object literal (e.g. an Intl options bag). Objects carrying $ref or operator keys are pointers/nodes, never literals.",not:{anyOf:[{required:["$ref"]},{required:["operator"]}]},type:"object"}],description:"A non-reactive operand: scalar, plain-object literal, or array of operands."};var Te={additionalProperties:!1,description:"The core expression node. operator + target, with value gated by arity.",oneOf:[{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/UnaryOperator"}},required:["operator"],title:"Unary — target only, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/BinaryOperator"}},required:["operator","value"],title:"Binary — left in target, right in value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/AssignmentOperator"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"Assignment — writable target, value required"},{not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{operator:{$ref:"#/$defs/NoArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator"],title:"pop / shift — array receiver, no value"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/OneArgMethod"},target:{$ref:"#/$defs/ExpressionPointer"}},required:["operator","value"],title:"push / unshift — array receiver, single value argument"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/SpliceMethod"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},minItems:1,type:"array"}},required:["operator","value"],title:"splice — array receiver, [start, deleteCount, ...items]"},{properties:{operator:{$ref:"#/$defs/ReduceMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value","initial"],title:"reduce — pure fold over a pointer or derived array; seed in initial"},{not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/MapFilterMethod"},target:{anyOf:[{$ref:"#/$defs/ExpressionPointer"},{$ref:"#/$defs/ExpressionNode"}]},value:{$ref:"#/$defs/ExpressionNode"}},required:["operator","value"],title:"map / filter — pure over a pointer or derived array; per-item expression in value"},{description:"The ECMAScript conditional (ternary) operator, pure: target is the test, value the consequent, initial the alternate (the reduce precedent for repurposing initial). Chain else-if by nesting another ?: node in initial.",properties:{operator:{$ref:"#/$defs/ConditionalOperator"}},required:["operator","value","initial"],title:"?: — pure conditional; test in target, consequent in value, alternate in initial"},{description:"Value-keyed multiway selection, pure: target is the discriminant (matched against case keys by its string form, like element-level $switch), cases maps matched values to result operands, default is the operand when no case matches (result is undefined without it). Condition-chain branching composes from nested ?: nodes instead.",not:{anyOf:[{required:["value"]},{required:["initial"]}]},properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},type:"object"},default:{$ref:"#/$defs/ExpressionOperand"},operator:{$ref:"#/$defs/SwitchOperator"}},required:["operator","cases"],title:"switch — pure value-keyed selection; discriminant in target, results in cases/default"},{description:"A pure standard-library method call: target is the receiver (any operand — never mutated; change-by-copy names replace the mutating originals), value the optional argument (bare scalar) or argument list (array). A missing receiver or method yields undefined, matching null-safe path reads.",not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/PureMethod"}},required:["operator"],title:"Pure method — genuine prototype methods; receiver in target, args in value"},{description:"Invoke a callable, pure in formula position: target is the callee pointer — a named formula entry (#/state/…) or a blessed pure global via window#/ (Math.*, JSON.*, Object.keys/values/entries, and "+`${zA()}) — and value is the positional argument list (the splice args-in-value precedent). Argument order follows the callee's declared parameters.`,not:{required:["initial"]},properties:{operator:{$ref:"#/$defs/CallOperator"},target:{$ref:"#/$defs/ExpressionPointer"},value:{items:{$ref:"#/$defs/ExpressionOperand"},type:"array"}},required:["operator"],title:"call — invoke a named formula or blessed global; callee in target, args in value"}],properties:{cases:{additionalProperties:{$ref:"#/$defs/ExpressionOperand"},description:"switch only: matched discriminant value (string form) → result operand.",type:"object"},default:{$ref:"#/$defs/ExpressionOperand",description:"switch only: result operand when no case key matches."},initial:{$ref:"#/$defs/ExpressionOperand"},operator:{type:"string"},target:{$ref:"#/$defs/ExpressionOperand"},value:{$ref:"#/$defs/ExpressionOperand"}},required:["operator","target"],type:"object"},ne={additionalProperties:!1,description:"A declarative expression entry (Shape 5). Used as a state entry or inline event handler. With parameters it is a named formula: a pure, reusable computation invoked via the call operator, its parameters resolved through $args/<name> refs in the body.",properties:{$description:{type:"string"},$expression:{$ref:"#/$defs/ExpressionNode"},$title:{type:"string"},parameters:{description:"Named-formula parameters (CEM convention, as on Function entries): bare names or CEM parameter objects. Present ⇒ the entry is callable, not a computed value.",items:{anyOf:[{type:"string"},{$ref:"#/$defs/CemParameter"}]},type:"array"}},required:["$expression"],type:"object"};var De={description:"A single state entry. Shape is determined by value type: "+"scalar/array → naked reactive property, string with ${} → computed, "+'object with $prototype: "Function" → function, '+"object with $prototype: <other> → data source, "+"object with type and default → typed reactive property, "+"plain object → naked object reactive property.",oneOf:[{type:"number"},{type:"boolean"},{type:"null"},{type:"string"},{type:"array"},{$ref:"#/$defs/TypedStateDef"},{$ref:"#/$defs/FunctionDef"},{$ref:"#/$defs/ExternalClassDef"},{$ref:"#/$defs/ExpressionEntry"},{not:{anyOf:[{required:["$prototype"]},{required:["default"]},{required:["type"]},{required:["$expression"]}]},type:"object"}]};var Je={description:"Format participation marker. A class carrying this block is auto-discovered from the project imports map and used for file-extension dispatch by the compiler, server, and studio.",properties:{documentKinds:{description:'"page"/"component" allow the extension in pages/components discovery; "content" allows it as a content-type source.',items:{enum:["page","component","content"],type:"string"},type:"array"},exportTarget:{description:"When true, site builds emit a serialized sidecar per page in this format.",type:"boolean"},extensions:{description:'File extensions this format claims, with leading dot (e.g. [".md"]).',items:{pattern:String.raw`^\.`,type:"string"},minItems:1,type:"array"},mediaType:{description:"MIME type for the format (icons, labels, HTTP).",type:"string"},remote:{description:"When true, the load capability accepts http(s) URLs as sources.",type:"boolean"}},required:["extensions"],type:"object"},qe={additionalProperties:!1,description:"Project-section admission block (specs/extensions.md §9). A class carrying this block owns "+"the project.json section named by `key`; hosts dispatch that section's data through the class's projectData/resolvePaths capabilities.",properties:{description:{type:"string"},key:{description:"The project.json top-level section this class owns (exclusive per project).",type:"string"},referenceable:{description:"Whether section entries can be referenced from documents (e.g. content types).",type:"boolean"},title:{type:"string"}},required:["key"],type:"object"},Le={additionalProperties:!1,description:"Server-mount admission block (specs/extensions.md §11). A class carrying this block mounts "+"routes under its /_jx/ basePath in the site worker and dev server.",properties:{basePath:{description:"Route subtree this class mounts — must be under /_jx/ (exclusive per project).",examples:["/_jx/data","/_jx/auth"],type:"string"},module:{description:"Module specifier exporting the mount handler.",type:"string"},order:{description:"Mount order (ascending; default 100).",type:"number"}},required:["basePath"],type:"object"},Ve={description:"Connection-provider admission block (specs/extensions.md §12). A class carrying this block "+"provides database connections of the given provider/kind.",properties:{kind:{description:"SQL dialect family the provider speaks.",enum:["sqlite","postgres"],type:"string"},local:{description:"Local-development substitute provider (e.g. sqlite for D1).",type:"string"},module:{description:"Module specifier exporting the provider implementation.",type:"string"},provider:{description:"Provider identifier (e.g. d1, supabase, sqlite).",type:"string"},serve:{description:"Module specifier exporting the serve-time worker binding.",type:"string"}},required:["provider","kind"],type:"object"};var lw=[301,302,303,307,308],He={description:"Schema for Jx project.json files. A project.json file is the root anchor file for a Jx project, declaring site metadata, default settings, global styles, extensions, and build configuration. Open by design: extension-contributed sections (e.g. `content`) are opaque top-level keys; the generated per-project entry document (project.schema.json) closes the composition.",properties:{$defs:{description:"Global type definitions available to all pages.",type:"object"},$elements:{description:"Global custom element dependencies available to all pages. Items are $ref objects or npm package specifier strings.",items:{oneOf:[{additionalProperties:!1,properties:{$ref:{type:"string"}},required:["$ref"],type:"object"},{type:"string"}]},type:"array"},$head:{description:"Global <head> entries applied to all pages. Array of element definitions for meta tags, link tags, script tags, etc.",examples:[[{attributes:{href:"/favicon.svg",rel:"icon"},tagName:"link"},{attributes:{content:"Jx",name:"generator"},tagName:"meta"}]],items:{properties:{attributes:{additionalProperties:{type:"string"},type:"object"},tagName:{type:"string"}},type:"object"},type:"array"},$media:{additionalProperties:{type:"string"},description:'Named media breakpoints following CSS @custom-media convention. Available in all component style objects. Declaring a pure color-scheme query (e.g. "--dark": "(prefers-color-scheme: dark)") additionally opts the site into the forced-scheme contract: @--dark style blocks are dual-emitted so a data-color-scheme attribute on <html> overrides the OS preference, color-scheme is declared on :root, and a pre-paint script restores the '+"visitor's persisted choice (spec §9.5).",examples:[{"--dark":"(prefers-color-scheme: dark)","--lg":"(min-width: 1024px)","--md":"(min-width: 768px)","--sm":"(min-width: 640px)"}],type:"object"},$schema:{description:"Relative path to the generated per-project schema (conventionally ./project.schema.json, written by `jx schema`).",type:"string"},build:{description:"Build configuration.",properties:{adapter:{description:"Platform adapter for deployment-specific output.",enum:["static","cloudflare-pages","cloudflare-workers","node","bun"],type:"string"},deploy:{additionalProperties:!1,description:"Deployment tracking: the hosting project this repo publishes to. Identifiers "+"only (no secrets) — safe to commit; Studio uses it to tell whether the publish "+"workflow already exists. `adapter` says how the build is packaged; `deploy` says where it ships.",properties:{accountId:{description:"Hosting account id (e.g. the Cloudflare account id).",type:"string"},productionUrl:{description:"Production URL of the connected hosting project.",type:"string"},projectName:{description:"Hosting project name (e.g. the Cloudflare Pages project).",pattern:"^[a-z0-9][a-z0-9-]*$",type:"string"},provider:{description:"Hosting provider the project is connected to.",enum:["cloudflare-pages"],type:"string"}},required:["provider","accountId","projectName"],type:"object"},format:{default:"directory",description:"Reserved; currently unused. Accepted for forward compatibility with single-file output (desktop single-file mode) — the build emits per-route directories regardless.",enum:["directory","single"],type:"string"},outDir:{default:"./dist",description:"Output directory for compiled site.",type:"string"},headers:{additionalProperties:!1,description:"Emit dist/_headers — the response headers only the build can know. Honored by "+"Cloudflare Pages/Workers assets and Netlify; on the node/bun adapters the file documents what a reverse proxy in front of them must send.",properties:{cache:{default:"auto",description:'"auto" marks the content-addressed image variants immutable (RFC 8246) and revalidates everything else (RFC 9111). "off" emits no Cache-Control at all.',enum:["auto","off"],type:"string"},enabled:{default:!0,type:"boolean"},rules:{additionalProperties:{additionalProperties:{type:"string"},type:"object"},description:"Verbatim rules, merged after the generated block.",propertyNames:{pattern:"^/"},type:"object"},security:{additionalProperties:!1,properties:{contentTypeOptions:{default:!0,type:"boolean"},csp:{default:!1,description:"CSP Level 3. Off by default: unlike the other security headers this one "+"governs code the build cannot see — a third-party script that loads a "+"second script, a widget that opens a frame — so turning it on is a change "+"to verify in the browser console, not a safe default. `script-src` is derived from the inline scripts and external origins the build emitted; `style-src` keeps 'unsafe-inline', because per-page <style> blocks and per-element style attributes have no site-wide hash.",oneOf:[{type:"boolean"},{const:"report-only"},{additionalProperties:!1,properties:{directives:{additionalProperties:{oneOf:[{type:"string"},{const:!1}]},description:"Replace (string) or remove (false) a computed directive. A replacement is wholesale, so an addition restates the defaults.",type:"object"},mode:{default:"enforce",enum:["enforce","report-only"]},reportUri:{format:"uri-reference",type:"string"}},type:"object"}]},frameOptions:{default:"SAMEORIGIN",oneOf:[{enum:["DENY","SAMEORIGIN"],type:"string"},{const:!1}]},hsts:{default:!1,description:"RFC 6797. Off by default: a wrong max-age locks the apex domain to HTTPS for that long, and the mistake is invisible until a certificate lapses. `preload` requires `includeSubDomains` and is a build error without it.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{includeSubDomains:{default:!0,type:"boolean"},maxAge:{default:31536000,minimum:0,type:"integer"},preload:{default:!1,type:"boolean"}},type:"object"}]},permissionsPolicy:{default:"camera=(), microphone=(), geolocation=()",oneOf:[{type:"string"},{const:!1}]},referrerPolicy:{default:"strict-origin-when-cross-origin",oneOf:[{enum:["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],type:"string"},{const:!1}]}},type:"object"}},type:"object"},sitemap:{default:!0,description:"Generate sitemap.xml from the route table (requires `url`). Set false to disable.",type:"boolean"},trailingSlash:{default:"always",description:"Trailing slash behavior for generated URLs.",enum:["always","never","ignore"],type:"string"}},type:"object"},copy:{additionalProperties:{type:"string"},description:"Declarative file copy map. Keys are source paths (relative to project root), values are destination paths (relative to outDir).",type:"object"},defaults:{description:"Default settings applied to all pages unless overridden.",properties:{charset:{default:"utf8",description:"Default charset for the page.",type:"string"},dir:{description:"Base direction for the <html> element. Omitted when unset — a page's `$dir` "+"overrides it. Right-to-left content renders left-to-right without this.",enum:["ltr","rtl","auto"],type:"string"},lang:{default:"en",description:"Default lang attribute for the <html> element. A page's `$lang` overrides it.",type:"string"},layout:{default:null,description:"Default layout file path applied to all pages. Set to null to render pages without a layout.",examples:["./layouts/base.json"],oneOf:[{type:"string"},{type:"null"}]},shadow:{default:!1,description:"Default shadow-DOM mode for every component (spec.md §16.6). Off unless set: a "+"shadow root isolates component styles from the page and replaces the <slot> emulation with real slot distribution. A component's own `$shadow` overrides this in both directions.",oneOf:[{enum:["open","closed"],type:"string"},{const:!1,type:"boolean"}]}},type:"object"},extensions:{description:"Extension packages: bare package names (resolved project-first through the package exports map) or relative paths. Each must export jx-extension.json.",examples:[["@jxsuite/parser"]],items:{type:"string"},type:"array"},manifest:{additionalProperties:!1,description:'W3C Web App Manifest, emitted as manifest.webmanifest with a <link rel="manifest"> on every page. Absent means no manifest: it is a claim that a site is meant to be installed, and most are not.',properties:{backgroundColor:{type:"string"},categories:{items:{type:"string"},type:"array"},description:{type:"string"},dir:{enum:["ltr","rtl","auto"],type:"string"},display:{default:"standalone",enum:["fullscreen","standalone","minimal-ui","browser"],type:"string"},enabled:{default:!0,type:"boolean"},icons:{description:"Icons at 192px and 512px are what browsers require before offering to install the site; the build warns when either is missing.",items:{additionalProperties:!1,properties:{purpose:{type:"string"},sizes:{examples:["192x192"],type:"string"},src:{type:"string"},type:{type:"string"}},required:["src"],type:"object"},type:"array"},lang:{type:"string"},name:{description:"Defaults to the project name.",type:"string"},orientation:{type:"string"},scope:{type:"string"},shortName:{type:"string"},startUrl:{default:"/",type:"string"},themeColor:{type:"string"}},type:"object"},serviceWorker:{default:!1,description:"W3C Service Worker, emitted as sw.js. Off unless declared — a worker is sticky, so it "+"is the one output that can keep breaking visitors after a deploy tries to fix them. **Turning it off means `false`, not deleting the key**: `false` emits a tombstone at the same URL that unregisters the old worker and clears its caches, and a 404 there is not an instruction to stop. HTML is always network-first; only the content-addressed /images/_optimized/* is served cache-first.",oneOf:[{type:"boolean"},{additionalProperties:!1,properties:{enabled:{default:!0,type:"boolean"},offlineFallback:{description:"Page served for a failed navigation. Added to `precache` if not already there.",type:"string"},precache:{description:"Site-absolute URLs fetched at install time. Each must be a file this build produces; one that is not fails the build, because a single unreachable entry stops the worker installing at all.",items:{pattern:"^/",type:"string"},type:"array"},scope:{default:"/",type:"string"}},type:"object"}]},securityTxt:{additionalProperties:!1,description:"RFC 9116 security.txt, emitted at .well-known/security.txt. `expires` is required by "+"§2.5.5 and an absent or past value is a build error — an expired file advertises a "+"reporting channel while telling the reporter not to trust it. A hand-placed public/.well-known/security.txt shadows this, which is how a clearsigned file ships.",properties:{acknowledgments:{items:{type:"string"},type:"array"},canonical:{type:"string"},contact:{description:"At least one mailto:, https: or tel: URI (§2.5.3).",items:{type:"string"},type:"array"},enabled:{default:!0,type:"boolean"},encryption:{items:{type:"string"},type:"array"},expires:{format:"date-time",type:"string"},hiring:{items:{type:"string"},type:"array"},policy:{items:{type:"string"},type:"array"},preferredLanguages:{description:"BCP 47 tags, validated and canonicalized like i18n.locales.",items:{pattern:bC,type:"string"},type:"array"}},type:"object"},i18n:{description:"Internationalization configuration.",properties:{defaultLocale:{description:"Default locale, as a BCP 47 language tag. The pattern catches shape errors (`en_US`, `en--US`); the build is the authority on well-formedness.",examples:["en"],pattern:bC,type:"string"},locales:{description:"Available locales, as BCP 47 language tags.",examples:[["en","fr","de"]],items:{pattern:bC,type:"string"},type:"array"},routing:{description:"Locale routing strategy.",enum:["prefix-except-default","prefix-always"],type:"string"}},type:"object"},images:{$ref:"#/$defs/ImageConfig"},imports:{additionalProperties:{type:"string"},description:"Global import map: $prototype names to .class.json file paths. Makes external classes available by name in all pages.",examples:[{Markdown:"@jxsuite/parser/Markdown.class.json",MarkdownCollection:"@jxsuite/parser/MarkdownCollection.class.json"}],type:"object"},name:{default:"Jx Site",description:"Human-readable project name.",examples:["My Portfolio","Jx Example Site"],type:"string"},redirects:{additionalProperties:{oneOf:[{description:"Destination path or URL; implies a 301.",type:"string"},{additionalProperties:!1,description:"A redirect with an explicit RFC 9110 §15.4 status.",properties:{destination:{type:"string"},status:{default:301,description:"RFC 9110 §15.4 redirection status. 307 and 308 preserve the request method; "+"301 and 302 historically do not.",enum:[...lw],type:"integer"}},required:["destination"],type:"object"},{additionalProperties:!1,description:"A rewrite (proxy): the destination's content is served AT the source URL, with no "+"redirect. Emitted as status 200 in `_redirects`, which is the host convention — "+"not an HTTP redirection status.",properties:{destination:{type:"string"},rewrite:{const:!0,type:"boolean"}},required:["destination","rewrite"],type:"object"}]},description:"Static redirect and rewrite rules. Keys are source paths in URLPattern pathname syntax.",examples:[{"/api/*":{destination:"https://api.example.com/*",rewrite:!0},"/legacy/*":{destination:"/archive/*",status:308},"/old-about":"/about"}],propertyNames:{pattern:"^/"},type:"object"},state:{description:"Site-wide reactive state available to all pages.",type:"object"},style:{additionalProperties:{oneOf:[{type:"string"},{type:"number"},{$ref:"#/$defs/StyleObject"}]},description:"Global CSS styles applied to the <body> element. Uses the same camelCase CSSOM convention and recursive selector/at-rule nesting as component styles.",type:"object"},url:{description:"Production URL of the deployed site.",examples:["https://example.com","https://jxsuite.com"],type:"string"}},type:"object"};var Ie={additionalProperties:!1,description:"Schema for jx-extension.json manifests. Located at the extension package root and exported so hosts can resolve <package>/jx-extension.json through the exports map.",properties:{$schema:{type:"string"},classes:{additionalProperties:{type:"string"},description:"$prototype-visible class name → class descriptor path, relative to the manifest.",type:"object"},description:{description:"One-line description.",type:"string"},name:{description:"Package name; must match package.json.",type:"string"},schemas:{additionalProperties:!1,description:"Schema fragments this package contributes, relative to the manifest.",properties:{document:{description:"Document-schema fragment (positions like $paths values).",type:"string"},fields:{description:"Field-union fragment: its $defs members are unioned into the per-project "+"field-schema resource as extension field extras (specs/extensions.md §5.3).",type:"string"},project:{description:"Project-schema fragment (top-level project.json sections).",type:"string"}},type:"object"},title:{description:"Human-readable name for studio surfaces.",type:"string"}},required:["name"],type:"object"};var _e=["literal","ref","template","expression","function"],zo={expression:"Formula",function:"Inline function",literal:"Fixed value",ref:"From data…",template:"Mixed text"},q_={expression:"Computed from other values, built up operator by operator.",function:"Code that runs when this fires.",literal:"A value you type here, the same every time.",ref:"The current value of a signal, picked from a list.",template:"Text with ${…} placeholders that fill in from signals."};function Pu(e){if(Me(e))return"ref";if(Oa(e))return"function";if(Ma(e))return"template";if(_(e)&&"$expression"in e)return"expression";return"literal"}var We={oneOf:[{$ref:"#/$defs/RefObject"},{$ref:"#/$defs/ExpressionEntry"},{$ref:"#/$defs/FunctionDef"}]},Ue=new Map([["ExpressionEntry",ne],["FunctionDef",oe],["RefObject",X],["StyleObject",H]]);function ze(e){let{properties:t,required:r}=e;return Array.isArray(r)&&r.includes("$ref")&&v(t)&&Boolean(t.$ref)}function Be(e){let{required:t}=e;return Array.isArray(t)&&t.includes("$expression")}function Ge(e){let{properties:t}=e;return v(t)&&v(t.$prototype)&&t.$prototype.const==="Function"}function Ke(e){return e.type==="string"&&e.pattern===void 0&&e.enum===void 0&&e.const===void 0}var Ye=new Set(["array","boolean","integer","null","number","object","string"]);function ie(e,t){if(!v(e))return;if(t.seen.has(e))return;t.seen.add(e);let r=n(e.$ref)?e.$ref:void 0;if(r!==void 0&&Object.keys(e).length===1){let o=r.startsWith("#/$defs/")?r.slice(8):r,l=Ue.get(o);if(l)ie(l,t);else t.unresolved.add(r);return}if(ze(e)){t.found.add("ref");return}if(Be(e)){t.found.add("expression");return}if(Ge(e)){t.found.add("function");return}let a=!1;for(let o of["oneOf","anyOf","allOf"]){let l=e[o];if(Array.isArray(l)){a=!0;for(let y of l)ie(y,t)}}if(a)return;if(Ke(e)){t.found.add("literal"),t.found.add("template");return}if(e.enum!==void 0||e.const!==void 0){t.found.add("literal");return}if(n(e.type)&&Ye.has(e.type))t.found.add("literal")}function Xe(e){let t={found:new Set,seen:new Set,unresolved:new Set};return ie(e,t),{caps:_e.filter((r)=>t.found.has(r)),unresolved:[...t.unresolved].toSorted()}}function ae(e){return Xe(e).caps}var Qe={anyOf:[K,...G.anyOf.slice(1)]},ED=B.anyOf.map((e)=>e.properties.operator.const),et={attribute:Q.additionalProperties,componentProp:ee.additionalProperties,elementProperty:te,eventHandler:We,repeaterFilter:q.properties.filter,repeaterItems:q.properties.items,repeaterSort:q.properties.sort,styleProperty:H.additionalProperties,switchDiscriminant:re,elementTag:Qe,textProperty:Y},de=new Map;function IE(e){let t=de.get(e);if(t)return t;let r=ae(et[e]);return de.set(e,r),r}function Ld(e){return n(e)?IE(e):ae(e.schema)}function me(e){return{anyOf:[ae(e).length>0?e:{type:"string"},{$ref:"#/$defs/RefObject"}]}}var pe=new Map,se=new Map;function ce(e,t){return`${u.value?.id??"-"}|${e}|${t}`}function ue(e){return`${u.value?.id??"-"}|${e}`}function pp(e,t,r){pe.set(ce(e,t),Se(r))}function fp(e,t){return pe.has(ce(e,t))}function tt(e,t){return Se(pe.get(ce(e,t)))}function rt(e,t){se.set(ue(e),t)}function fe(e){return e==="literal"||e==="template"}function Fu(e,t){let r=ue(e),a=Pu(t),o=se.get(r),l=o!==void 0&&fe(o)&&fe(a)?o:a;return se.set(r,l),l}function ju(e,t){switch(e){case"ref":{let[r]=t.stateDefs;return r?{$ref:`#/state/${r}`}:{$ref:t.extraSignals?.[0]?.value??""}}case"template":{let[r]=t.stateDefs;return r?`\${state.${r}}`:"${}"}case"expression":return{$expression:{operator:"??",target:null,value:null}};case"function":return{$prototype:"Function",body:"",parameters:[]};default:return t.literalDefault}}function $d(e,t,r,a,o){return pp(e,t,a),rt(e,r),fp(e,r)?tt(e,r):o}var he={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSchemaForm",$description:"The shared schema→form engine as a document: one row per property of a JSON Schema, drawn from a projection `ui/schema-form.ts` computes. Nothing here reads a schema. The flow decides which of nine controls a property gets, what its options are, which rungs of the value ladder the position permits, what a commit is worth and whether the value is refused; this document draws the answer. That split is what lets the Entry editor, Project Settings and the Signals panel all embed the same form and get the same row — and it is why the engine hands back a HOST ELEMENT rather than a template: a document clears the host it is given, so a caller that is still lit renders an empty element for it and puts it in its own tree (studio-ui-guidelines.md §9.3, §9.4).",tagName:"div",attributes:{part:"form"},style:{$description:"What `.style-row`, `.style-row-label`, `.style-row--invalid`, `.style-row-error`, `.style-row-error-count`, `.array-object-field`, `.array-object-row` and `.schema-param-editor` said in `styles/inspector.css`, keyed on `part` and re-pointed at the studio token layer. Those rules are DEAD in the stylesheet now rather than shared: `ui/field-row.ts` drew the same row for the inspector panels and `ui/expression-editor.ts` the same array rows, and both converted, so this document's copy is the only emitter left. Every `--spectrum-font-size-*` reference is gone rather than renamed — those names resolve only inside `<sp-theme>`, and a document mounted in a settings pane or an entry editor is outside it, so each would silently have taken its hard-coded fallback.",display:"contents",'& [part="field"]':{padding:"var(--jx-space-1) 0"},'& [part="value"]':{$description:"The control line: the source chip, then whatever the rung draws. `min-width: 0` is load-bearing — without it a monospaced pointer or a long JSON line pushes the row past the pane's right edge instead of scrolling inside its own control.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="value"] > *':{minWidth:"0"},'& [part="widget"] > *':{$description:"The switch wrapper is `display: contents`, so whatever rung it drew is the flex item of the line above rather than a box inside a box — which is what keeps `min-width: 0` reaching the control that actually needs it.",flex:"1",minWidth:"0"},'& [part="source"]':{$description:"Quiet while the value is fixed, accent-tinted the moment it is produced from something else — the one place in the row that says a value is not what it looks like.",flex:"none",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="source"][data-source="bound"]':{color:"var(--accent)"},'& [part="pointer-group"]':{display:"flex",flex:"1",gap:"var(--jx-space-2)",minWidth:"0"},'& [part="pointer-group"] > *':{flex:"1",minWidth:"0"},'& [part="json"]':{display:"flex",flexDirection:"column",flex:"1",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="chips"]':{display:"flex",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="chip"]':{padding:"1px var(--jx-space-2)",borderRadius:"var(--radius)",background:"var(--bg)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column",flex:"1",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="row"]':{$description:"Wraps rather than scrolls: an item with five declared properties in a 260px inspector is a column of controls, not a horizontal scroller nobody finds the end of.",display:"flex",flexWrap:"wrap",alignItems:"center",gap:"var(--jx-space-1)",minWidth:"0"},'& [part="row"] > [part="cell"]:only-of-type > *':{$description:"A row of one cell (an item of a list of single values: a category, a picture) gives that cell the row's width, so a list reads as the fields around it do rather than as a column of stubs.",flex:"1",minWidth:"0"},'& [part="row-add"]':{alignSelf:"flex-start"},'& [part="field-error"]':{$description:"The left rule is what makes the line read as belonging to the control above it rather than to the row below.",margin:"var(--jx-space-1) 0 0",paddingLeft:"var(--jx-space-2)",borderLeft:"2px solid var(--danger)",fontSize:"var(--jx-text-sm)",lineHeight:"1.35",color:"var(--danger)"},'& [part="field-error-count"]':{marginLeft:"var(--jx-space-1)",fontFamily:"var(--font-mono)",opacity:"0.75"}},children:[{$prototype:"Array",items:{$ref:"#/state/fields"},key:{$ref:"$map/item/key"},map:{$description:"One property of the schema. `jx-field` owns the label, the required mark, the invalid shade and the association between the label and whatever control ends up in the slot, so none of that is written here — which is the whole of what the four hand-rolled `.style-row` variants used to carry.",tagName:"jx-field",attributes:{part:"field","data-prop":"${$map.item.prop}"},$props:{label:{$ref:"$map/item/label"},description:{$ref:"$map/item/description"},required:{$ref:"$map/item/required"},invalid:{$ref:"$map/item/invalid"},span:!0},children:[{tagName:"div",attributes:{part:"value",role:"none"},children:[{tagName:"span",attributes:{part:"source-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChip"},cases:{true:{$description:"The Value Source chip (§6.6): what produces this value, in the same four words every other bindable position in Studio uses. It opens the rung picker rather than cycling, so any rung the position permits is one action away. Drawn only where the host named somewhere a value could come from — a settings form that names none edits fixed values and shows no chip.",tagName:"jx-action-button",attributes:{part:"source","data-source":"${$map.item.source}"},$props:{label:{$ref:"$map/item/sourceName"},hint:{$ref:"$map/item/sourceHint"},size:"sm",haspopup:"menu",disabled:{$ref:"$map/item/sourceLocked"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pickSource"},value:[{$ref:"$map/item/key"},{$ref:"event#/currentTarget"}]}]},children:[{tagName:"span",textContent:"${$map.item.sourceLabel}"}]}}},{tagName:"span",attributes:{part:"widget",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{$description:"The default control, and the one every scalar without a narrower answer lands on. Commits on input, debounced by the flow, which is what makes the canvas and the preview follow a value being typed rather than waiting for a blur.",tagName:"jx-textfield",attributes:{part:"text"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},size:"sm",invalid:{$ref:"$map/item/invalid"},mono:{$ref:"$map/item/mono"},multiline:{$ref:"$map/item/multiline"},type:{$ref:"$map/item/inputType"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},template:{$description:"The Mixed text rung: a string with `${…}` holes in it. Monospaced because what is being written is half text and half pointer, and committed on change rather than on input — a half-typed placeholder is not a template anybody meant.",tagName:"jx-textfield",attributes:{part:"template"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:"${state.templatePlaceholder}",size:"sm",mono:!0},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},pointer:{$description:"The From data… rung. It is TWO controls over one value because the kit has no combobox and this rung needs one: the list is a set of suggestions rather than a whitelist (a value may point at a route param, a signal, or a pointer neither the form nor its host enumerates), so the select offers what the host named and the field accepts anything. Picking a row writes the field; typing a pointer the host never named leaves the select showing it, because a select whose value matches no option synthesises the row rather than lying about what it holds.",tagName:"span",attributes:{part:"pointer-group",role:"none"},children:[{tagName:"jx-textfield",attributes:{part:"pointer"},$props:{label:"${$map.item.label} pointer",value:{$ref:"$map/item/value"},placeholder:"#/state/…",size:"sm",mono:!0},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},{tagName:"span",attributes:{part:"pointer-pick-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasOptions"},cases:{true:{tagName:"jx-select",attributes:{part:"pointer-pick"},$props:{label:"${$map.item.label} source",options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}}}]},select:{$description:"A closed set the schema itself declares, or one the host resolved through a `#/$context/…` pointer. The empty row is offered only where the property is optional — a required field has no “none” to choose.",tagName:"jx-select",attributes:{part:"select"},$props:{label:{$ref:"$map/item/label"},options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm",invalid:{$ref:"$map/item/invalid"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},checkbox:{tagName:"jx-checkbox",attributes:{part:"checkbox"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commitChecked"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},number:{$description:"`min`, `max` and `step` come straight off the property schema, so the control refuses out-of-range input before the flow has to say why. The stepper is off: these are configuration values that get typed, not nudged.",tagName:"jx-number-field",attributes:{part:"number"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},min:{$ref:"$map/item/min"},max:{$ref:"$map/item/max"},step:{$ref:"$map/item/step"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/commit"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},json:{$description:"A value with structure, edited as the JSON it is. The chips above it are a read of the shape currently held — property name and declared type — so the common case (“what is in here?”) is answered without reading the text. The flow parses on a debounce and keeps the last parsable value; a mid-keystroke `{` is not a refusal.",tagName:"span",attributes:{part:"json",role:"none"},children:[{tagName:"span",attributes:{part:"chips-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasChips"},cases:{true:{tagName:"span",attributes:{part:"chips",role:"none"},children:[{$prototype:"Array",items:{$ref:"$map/item/chips"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"chip"},textContent:"${$map.item.label}"}}]}}},{tagName:"jx-textfield",attributes:{part:"json-text"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/placeholder"},size:"sm",mono:!0,multiline:!0,grows:!0},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editJson"},value:[{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}}]},rows:{$description:"An array whose items have a declared shape: one row per item, one cell per declared property of an object item, or one cell for a single-value item (a list of categories, a gallery of pictures), with a remove beside each and one add below. The alternative was the raw-JSON editor, which is what an array of anything else still gets: a shape the schema states is a shape the form can draw.",tagName:"span",attributes:{part:"rows",role:"none"},children:[{$prototype:"Array",items:{$ref:"$map/item/rows"},key:{$ref:"$map/item/key"},map:{tagName:"span",attributes:{part:"row",role:"none","data-row":"${$map.item.key}"},children:[{$prototype:"Array",items:{$ref:"$map/item/cells"},key:{$ref:"$map/item/id"},map:{tagName:"span",attributes:{part:"cell",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{text:{tagName:"jx-textfield",attributes:{part:"cell-text"},$description:"Committed on input AND on change: a cell showing a pointer is committed when it is left, exactly as the pointer field above is, and a cell showing text follows the canvas while it is typed. The two never disagree — a change after an input carries the same string.",$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},placeholder:{$ref:"$map/item/label"},size:"sm"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},select:{tagName:"jx-select",attributes:{part:"cell-select"},$props:{label:{$ref:"$map/item/label"},options:{$ref:"$map/item/options"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},checkbox:{tagName:"jx-checkbox",attributes:{part:"cell-checkbox"},$props:{label:{$ref:"$map/item/label"},checked:{$ref:"$map/item/checked"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCellChecked"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/checked"}]}]}},number:{tagName:"jx-number-field",attributes:{part:"cell-number"},$props:{label:{$ref:"$map/item/label"},value:{$ref:"$map/item/value"},size:"sm"},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editCell"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/row"},{$ref:"$map/item/key"},{$ref:"event#/target/value"}]}]}},control:{$description:"A cell a registered control owns: a relationship to another collection, or a picture (the media field). The document draws the empty host and nothing inside it; `ui/schema-form.ts` mounts the control into it, by the same dispatch a FIELD host gets. An extension's control is its own surface rather than part of this one, and the seam between them is this empty node.",tagName:"span",attributes:{part:"cell-control-host","data-control":"${$map.item.id}",role:"none"}}}}},{tagName:"jx-action-button",attributes:{part:"row-remove"},$props:{icon:"trash",label:"${$map.item.removeLabel}",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeRow"},value:[{$ref:"$map/item/field"},{$ref:"$map/item/key"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"row-add"},$props:{icon:"plus",label:"${$map.item.addLabel}",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/addRow"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"Add"}]}]},control:{$description:"A field a registered control owns outright — `schema-builder`, `secret`, or the `reference` picker. The document draws the empty host and the flow MOUNTS the control into it: the registry's contract (specs/extensions.md §9.1) is a control that owns a host, all three built-ins are documents of their own, and a document clears the host it is given — which is why this node is drawn empty and never written to twice.",tagName:"div",attributes:{part:"control-host","data-control":{$ref:"$map/item/key"},role:"none"}}}}]},{tagName:"span",attributes:{part:"error-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasError"},cases:{true:{$description:'§16.1\'s inline tier: why this value is refused, said AT the control that refuses it and for exactly as long as the value stays bad. `role="alert"` so it is announced when it appears, and a repeat counter from two up — “it refused me again” is otherwise indistinguishable from “the field is still red from last time”.',tagName:"p",attributes:{part:"field-error",role:"alert"},children:[{tagName:"span",attributes:{part:"field-error-text"},textContent:"${$map.item.error}"},{tagName:"span",attributes:{part:"error-count-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/hasCount"},cases:{true:{tagName:"span",attributes:{part:"field-error-count"},textContent:"${$map.item.errorCount}"}}}]}}}]}}]};T("schema-form",he);function nt(e,t){let r=t?.$map,a=v(r)&&v(r.item)?r.item:void 0,o=e==="control-host"?a?.key:e==="cell-control-host"?a?.id:void 0;return n(o)?o:""}function it(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function ye(e,t,r){let a=document.createElement("div");a.style.display="contents";let o=g({...e,...t,templatePlaceholder:"${state.…}"}),l=null,y=!1,b=!1;function d(){y=!0,R("schema-form",o,a,{onNodeCreated:(m,f,S,w)=>{if(!(m instanceof HTMLElement))return;let O=nt(it(S),w);if(O!=="")r(O,m)}}).then((m)=>{if(y=!1,b){m.dispose();return}l=m})}return d(),{dispose(){b=!0,l?.dispose(),l=null,a.textContent=""},host:a,update(m){if(o.fields=m.fields,b||y||l!==null&&a.contains(l.root))return;l?.dispose(),l=null,a.textContent="",d()}}}var M=new Map;function cw(e,t){M.set(e,t)}var at=/^#\/content\/([^/]+)$/;function Hu(e){let t=e?.$ref,r=n(t)?at.exec(t):null;return r?r[1]:null}var ge={resolvePointer:()=>{}};function xe(e,t,r){if(Array.isArray(e))return e;let a;if(v(e)){let l=e.$ref;if(n(l))a=l}else if(n(e))a=e;if(a===void 0||!t)return;let o=t.resolvePointer(a,r);if(Array.isArray(o))return o.map(String);if(v(o))return Object.keys(o);return}function be(e,t){if(e.trim()==="")return Number.NaN;return t?Math.trunc(Number(e)):Number(e)}function $e(e){return e.format!=="json-schema"&&e.type!=="object"&&e.type!=="array"}function st(e){return[...(e.signals??[]).map((t)=>({label:t,value:`#/state/${t}`})),...(e.params??[]).map((t)=>({label:`$params/${t}`,value:`#/$params/${t}`}))]}var F="__none__";function ve(e){if(e===void 0||e===null)return"";return _(e)?JSON.stringify(e,null,2):String(e)}function pt(e,t,r){if(Me(t))return"";if(t===void 0||t===null||t==="")return r?"Required.":"";if(Array.isArray(e.enum)&&!e.enum.includes(t))return`Choose one of: ${e.enum.map(String).join(", ")}.`;if(e.type==="number"||e.type==="integer"){let o=Z(t)?t:Number(t);if(!Number.isFinite(o))return"Enter a number.";if(e.type==="integer"&&!Number.isInteger(o))return"Enter a whole number.";if(e.minimum!==void 0&&o<e.minimum)return`Must be ${e.minimum} or more.`;if(e.maximum!==void 0&&o>e.maximum)return`Must be ${e.maximum} or less.`;return""}if(e.type==="boolean"&&!Ze(t))return"Must be true or false.";if(e.type==="array"&&!Array.isArray(t))return"Must be a list.";if(e.type==="object"&&!v(t))return"Must be an object.";return""}var ct=500,lt=400,I=new Map;function Fl(e,t,r,a){dt(e);let o=I.get(e);if(!o)o=mt(),I.set(e,o);return o.update(t,r,a),o.host}function dt(e){for(let[t,r]of I)if(t!==e&&!r.host.isConnected)r.dispose(),I.delete(t)}function mt(){let e={},t={},r={onChange:()=>{}},a=ge,o=new Map,l=new Map,y=new Map,b=new Map,d=null,m=(i,s,c)=>{if(clearTimeout(l.get(i)),s<=0){c();return}l.set(i,setTimeout(c,s))},f=(i,s)=>{clearTimeout(l.get(i)),l.delete(i),s()},S=(i,s)=>{r.onChange({[i]:s})},w=(i,s)=>{if(i.commit==="none")return;switch(i.commit){case"ref":{let c=s.trim();S(i.prop,c?{$ref:c}:void 0);return}case"template":{S(i.prop,s);return}case"select":{S(i.prop,s===F?void 0:s);return}case"number":{let c=be(s,i.schema.type==="integer");S(i.prop,Number.isNaN(c)?void 0:c);return}case"json":{try{S(i.prop,JSON.parse(s))}catch{}return}default:{if(i.member!==void 0){let c=t[i.prop],h=v(c)?{...c}:{};if(s)h[i.member]=s;else delete h[i.member];S(i.prop,Object.keys(h).length>0?h:void 0);return}S(i.prop,s||void 0)}}},O=(i,s)=>{let c;if(s.length>0)c=i.scalarItems?s.map((h)=>h[le]??""):s;S(i.prop,c)},P=(i)=>{let s=[];for(let c of i.rows??[])s.push({...c});return s},W={addRow:(i)=>{let s=o.get(i);if(!s?.itemProps)return;let c={};for(let[h,x]of Object.entries(s.itemProps))if(x.default!==void 0)c[h]=x.default;O(s,[...P(s),c]),r.rerender?.()},commit:(i,s)=>{let c=o.get(i);if(c)f(i,()=>w(c,s))},commitChecked:(i,s)=>{let c=o.get(i);if(c)S(c.prop,s)},edit:(i,s)=>{let c=o.get(i);if(c&&c.debounceMs>0)m(i,c.debounceMs,()=>w(c,s))},editCell:(i,s,c,h)=>{p(i,s,c,h)},editCellChecked:(i,s,c,h)=>{p(i,s,c,h)},editJson:(i,s)=>{let c=o.get(i);if(c)m(i,ct,()=>w(c,s))},pickSource:(i,s)=>{U(i,s)},removeRow:(i,s)=>{let c=o.get(i);if(!c)return;let h=Number(s);O(c,P(c).filter((x,C)=>C!==h)),r.rerender?.()}};function p(i,s,c,h){let x=o.get(i);if(!x?.itemProps)return;let C=Number(s),J=P(x),E=J[C];if(!E)return;let A=x.itemProps[c];J[C]={...E,[c]:L(A,h,x.refCells?.has(`${i}/${s}/${c}`)??!1)},O(x,J)}function L(i,s,c){if(Ze(s))return s;let h=String(s);if(c){let x=h.trim();return x?{$ref:x}:void 0}if(i?.type==="integer"||i?.type==="number"){let x=be(h,i.type==="integer");return Number.isNaN(x)?void 0:x}if(h===F||h==="")return;return h}function U(i,s){let c=o.get(i);if(!c?.ladder)return;let{fieldKey:h,mode:x,offered:C,sources:J}=c.ladder;d?.close(),d=Xt({label:"Value source",onClosed:()=>{d=null},opener:s,region:"value-source",rows:C.map((E)=>({checked:E===x?"true":"false",destructive:!1,disabled:!1,dividerAbove:!1,id:E,title:zo[E]})),run:(E)=>{let A=C.find((ke)=>ke===E);if(A===void 0||A===x)return;let z=c.schema.default;if(x==="ref"&&z!==void 0&&!fp(h,"literal"))pp(h,"literal",z);S(c.prop,$d(h,x,A,Se(t[c.prop]),ju(A,{extraSignals:J,literalDefault:z,stateDefs:[]})))}})}function N(i){let s=o.get(i);if(s?.control)return{args:{ctx:a,key:s.prop,onChange:(c)=>S(s.prop,c),rerender:r.rerender,schema:s.schema,value:t[s.prop]},control:s.control};for(let c of o.values()){let h=c.cellControls?.get(i);if(!h)continue;let x=(c.rows??[])[Number(h.row)]??{};return{args:{ctx:a,key:h.key,onChange:(C)=>p(c.prop,h.row,h.key,C),rerender:r.rerender,schema:h.schema,value:x[h.key]},control:h.control}}return}function D(i,s){let c=N(i);if(!c)return;let h=b.get(i);if(h?.host===s){h.handle.update(c.args);return}h?.handle.dispose(),b.set(i,{handle:c.control.mount(s,c.args),host:s})}function V(){for(let[i,s]of b)if(!N(i))s.handle.dispose(),b.delete(i)}function j(){V();for(let[i,s]of y)D(i,s)}let k=ye({fields:[]},W,(i,s)=>{y.set(i,s),D(i,s)});return{dispose(){for(let i of l.values())clearTimeout(i);l.clear(),d?.close(),d=null;for(let i of b.values())i.handle.dispose();b.clear(),y.clear(),o.clear(),k.dispose()},host:k.host,update(i,s,c){e=i,t=s,r=c,a=c.context??ge,o.clear(),k.update({fields:ft(e,t,r,a,o)}),j()}}}function ft(e,t,r,a,o){let l=new Set(e.required),y=st(a);return Object.entries(e.properties??{}).flatMap(([b,d])=>{let m={ctx:a,opts:r,plans:o,required:l.has(b),sources:y,value:t},f=je(b,d,m);return f.kind==="control"&&we(d)&&d.properties?.alt?[f,yt(b,m)]:[f]})}var ut=new Set(["src","alt","width","height","title"]);function we(e){let t=e.properties??{};return e.type==="object"&&t.src?.type==="string"&&Object.keys(t).every((r)=>ut.has(r))}function ht(e){let t=(r)=>{let a=v(r.value)?r.value:{},{src:o}=a;return{...r,onChange:(l)=>{if(l===o)return;let{height:y,width:b,...d}=a,m;if(l!==void 0&&l!=="")m={...d,src:l};r.onChange(m)},value:n(o)?o:void 0}};return{mount(r,a){let o=e.mount(r,t(a));return{dispose:()=>o.dispose(),update:(l)=>o.update(t(l))}}}}function yt(e,t){let r=`${e}/alt`,a=t.value[e],o=v(a)?a.alt:void 0,l=je(r,{type:"string"},{...t,required:!1}),y=t.plans.get(r);if(y)y.prop=e,y.member="alt";return{...l,label:`${t.opts.ui?.[e]?.label??e} alt text`,value:n(o)?o:""}}function je(e,t,r){let{ctx:a,opts:o,plans:l,required:y,sources:b,value:d}=r,m=d[e],f={commit:"text",debounceMs:lt,prop:e,schema:t};l.set(e,f);let S=o.errors?.[e]||pt(t,m,Boolean(o.showRequired)&&y),w=o.errorCounts?.[e],O=o.ui?.[e]?.control,P=O?M.get(O):void 0,W=b.length>0&&$e(t)&&!O,p={addLabel:`Add ${e}`,checked:!1,chips:[],description:t.description??"",error:S,errorCount:w!==void 0&&w>1?`×${w}`:"",hasChip:!1,hasChips:!1,hasCount:w!==void 0&&w>1,hasError:S!=="",hasOptions:!1,invalid:S!=="",key:e,kind:"text",label:o.ui?.[e]?.label??e,max:"",min:"",mono:!1,multiline:!1,inputType:"text",options:[],placeholder:"",prop:t.name||e,required:y,rows:[],source:"fixed",sourceHint:"",sourceLabel:"",sourceLocked:!1,sourceName:"",step:"",value:""};if(W){let j=`${a.fieldKeyPrefix??""}.${e}`,k=Fu(j,m),i=Ld({schema:me(t)});if(f.ladder={fieldKey:j,mode:k,offered:i,sources:b},p.hasChip=!0,p.sourceLabel=zo[k],p.sourceHint=q_[k],p.source=k==="literal"?"fixed":"bound",p.sourceLocked=!i.some((s)=>s!==k),p.sourceName=p.sourceLocked?`Value source: ${p.sourceLabel} (no other source available here)`:`Value source: ${p.sourceLabel} — click to change`,k==="ref")return f.commit="ref",f.debounceMs=0,p.kind="pointer",p.value=Me(m)?m.$ref:"",p.options=b.map((s)=>({label:s.label,value:s.value})),p.hasOptions=p.options.length>0,p;if(k==="template")return f.commit="template",f.debounceMs=0,p.kind="template",p.value=String(m??""),p}if(P)return f.commit="none",f.control=P,p.kind="control",p;if(Me(m)&&$e(t))return f.commit="ref",f.debounceMs=0,p.kind="text",p.mono=!0,p.value=m.$ref,p.placeholder=e,p;if(Hu(t)!==null){let j=M.get("reference");if(j)return f.commit="none",f.control=j,p.kind="control",p}if(t.format==="image"){let j=M.get("media");if(j)return f.commit="none",f.control=j,p.kind="control",p}let L=we(t)?M.get("media"):void 0;if(L)return f.commit="none",f.control=ht(L),p.kind="control",p;let U=o.ui?.[e]?.enum??t.enum,N=xe(U,a,d);if(N)return f.commit="select",f.debounceMs=0,p.kind="select",p.value=m!==void 0?String(m):t.default!==void 0?String(t.default):F,p.options=[...y?[]:[{label:"—",value:F}],...N.map((j)=>({label:j,value:j}))],p;if(t.type==="boolean")return f.commit="none",p.kind="checkbox",p.checked=Boolean(m??t.default??!1),p;if(t.type==="integer"||t.type==="number")return f.commit="number",f.debounceMs=0,p.kind="number",p.value=m!==void 0?String(m):"",p.placeholder=t.default!=null?String(t.default):"",p.min=t.minimum!==void 0?String(t.minimum):"",p.max=t.maximum!==void 0?String(t.maximum):"",p.step=t.type==="integer"?"1":"",p;if(t.format==="json-schema")return f.commit="json",p.kind="json",p.value=m!==void 0?JSON.stringify(m,null,2):"",p.placeholder=t.description??"JSON Schema defining the data shape…",p.chips=bt(m),p.hasChips=p.chips.length>0,p;if(t.type==="array"&&t.items?.type==="object"&&t.items.properties)return $t(e,t.items.properties,r,f,p);if(t.type==="array"&&St(t.items))return xt(e,t.items,r,f,p);let D=Array.isArray(t.type)?t.type:[t.type];if(D.includes("array")||D.includes("object"))return f.commit="json",p.kind="json",p.value=m!==void 0?JSON.stringify(m,null,2):"",p.placeholder=t.default!==void 0?JSON.stringify(t.default):"",p;p.kind="text",p.value=ve(m),p.placeholder=t.default!==void 0?String(t.default):t.examples?.[0]??"",p.inputType=gt.get(t.format??"")??"text";let V=/^"?(\d{4}-\d{2}-\d{2})/.exec(p.value);if(p.inputType==="date"&&V)p.value=V[1]??p.value;return p}var gt=new Map([["date","date"],["email","email"],["uri","url"]]);function bt(e){if(!v(e))return[];let{properties:t}=e;if(e.$ref||t===null||!_(t))return[];return Object.entries(t).map(([r,a])=>({key:r,label:`${r}: ${String((v(a)?a.type:void 0)??"any")}`}))}function $t(e,t,r,a,o){let l=r.value[e],y=Array.isArray(l)?l:[];return a.commit="none",a.itemProps=t,a.rows=y,a.cellControls=new Map,a.refCells=new Set,o.kind="rows",o.rows=y.map((b,d)=>Oe(e,String(d),b,t,r,a)),o}var le="value";function St(e){if(e===void 0||e.format==="json-schema")return!1;if(Hu(e)!==null||Array.isArray(e.enum))return!0;return e.type==="string"||e.type==="number"||e.type==="integer"||e.type==="boolean"}function xt(e,t,r,a,o){let l=r.value[e],y=[];if(Array.isArray(l))y=l;else if(l!==void 0&&l!==null&&l!=="")y=[l];let b=y.map((f)=>({[le]:f})),d={[le]:t},m=r.opts.ui?.[e]?.label??e;return a.commit="none",a.itemProps=d,a.rows=b,a.scalarItems=!0,a.cellControls=new Map,a.refCells=new Set,o.kind="rows",o.rows=b.map((f,S)=>{let w=Oe(e,String(S),f,d,r,a);for(let O of w.cells)O.label=`${m} ${S+1}`;return w}),o}function Oe(e,t,r,a,o,l){return{cells:Object.entries(a).map(([y,b])=>vt(e,t,y,b,r[y],o,l)),field:e,key:t,removeLabel:`Remove ${e} ${Number(t)+1}`}}function vt(e,t,r,a,o,l,y){let b=`${e}/${t}/${r}`,d={checked:!1,field:e,id:b,key:r,kind:"text",label:r,options:[],row:t,value:""};if(Me(o))return d.value=o.$ref,y.refCells?.add(b),d;if(Hu(a)!==null){let S=M.get("reference");if(S)return d.kind="control",y.cellControls?.set(b,{control:S,key:r,row:t,schema:a}),d}let m=a.format==="image"?M.get("media"):void 0;if(m)return d.kind="control",y.cellControls?.set(b,{control:m,key:r,row:t,schema:a}),d;let f=xe(a.enum,l.ctx,l.value);if(f)return d.kind="select",d.value=o!==void 0?String(o):F,d.options=[{label:"—",value:F},...f.map((S)=>({label:S,value:S}))],d;if(a.type==="boolean")return d.kind="checkbox",d.checked=Boolean(o),d;if(a.type==="integer"||a.type==="number")return d.kind="number",d.value=o!==void 0?String(o):"",d;return d.value=ve(o),d}var wt=/^\{@(\w+)\}$/;function mp(e,t){if(!e.startsWith("#/$context/"))return;let r=[];for(let o of e.slice(11).split("/")){let l=o.match(wt);if(l){let y=t.scope?.[l[1]];if(!n(y)&&!Z(y))return;let b=String(y);if(!b)return;r.push(b)}else r.push(o)}if(r[0]==="$formats"){if(r.length!==1)return;return(t.formats??[]).map((o)=>o.name)}let a=t.projectConfig;for(let o of r){if(!_(a))return;a=a[o]}return a}
|
|
2
|
+
export{lw,zo,q_,Pu,ED,IE,Ld,pp,fp,Fu,ju,$d,cw,Hu,Fl,mp};
|
|
3
|
+
|
|
4
|
+
//# debugId=470A414D46EF7B1264756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-nfmpmkqb.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n,Z,_}from"./studio-ywf9y1e2.js";function y(t){return JSON.parse(JSON.stringify(t))}function Se(t){return t===void 0||t===null?t:y(t)}function oe(t,e){let r=t;for(let o of e){if(r==null)return;r=r[o]}return r}function Tv(t){if(Array.isArray(t))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!t.children)t.children=[];if(!Array.isArray(t.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return t.children}function Lv(t,e){let{op:r}=e;switch(e.op){case"set-key":{let o=oe(t,e.path);if(!o)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete o[e.key];else o[e.key]=Se(e.value);return}case"insert-child":{l(t,e.parentPath).splice(e.index,0,Se(e.node));return}case"remove-child":{l(t,e.parentPath).splice(e.index,1);return}case"set-child":{l(t,e.parentPath).splice(e.index,1,Se(e.node));return}case"move-child":{P(e);let o=l(t,e.fromParentPath),a=l(t,e.toParentPath),[i]=o.splice(e.fromIndex,1);a.splice(e.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${r}`)}function l(t,e){let r=oe(t,e);if(r==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return Tv(r)}function FC(t,e,r,o,a){let i=t.length,c=i<e.length&&t.every((s,u)=>s===e[u]),d=e[i+1];if(!c||e[i]!=="children"||!Z(d))return e;if(a?d<r:d<=r)return e;let h=[...e];return h[i+1]=d+o,h}function P(t){let e=[...t.fromParentPath,"children",t.fromIndex],r=t.toParentPath;if(r.length>=e.length&&e.every((o,a)=>o===r[a]))throw Error(`doc-op-move-into-self:${r.join("/")}`)}function sf(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function jC(t,e){let{op:r}=e;switch(b(e),e.op){case"set-key":{let o=oe(t,e.path);if(o===void 0)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(!_(o)||Array.isArray(o))throw TypeError(`doc-op-not-a-node:${e.path.join("/")}`);let a=Se(o[e.key]);return a===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:a}}case"insert-child":{let{length:o}=f(t,e.parentPath);return{index:sf(e.index,o),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"set-child",parentPath:e.parentPath}}case"move-child":{P(e);let o=J(t,e.fromParentPath);m(o,e.fromParentPath,e.fromIndex);let a=f(t,e.toParentPath),i=sf(e.toIndex,a.length-(a===o?1:0));return{fromIndex:i,fromParentPath:FC(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:FC(e.toParentPath,e.fromParentPath,i,1,!0)}}default:break}throw Error(`unknown-doc-op:${r}`)}function b(t){let e=[];if(t.op==="move-child")e.push([t.fromParentPath,t.fromIndex],[t.toParentPath,t.toIndex]);else if(t.op==="insert-child"||t.op==="remove-child"||t.op==="set-child")e.push([t.parentPath,t.index]);for(let[r,o]of e)if(!Number.isInteger(o))throw TypeError(`doc-op-index:${[...r,"children",String(o)].join("/")}`)}function J(t,e){let r=oe(t,e);return r&&Array.isArray(r.children)?r.children:null}function m(t,e,r){if(!t||r<0||r>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",r].join("/")}`)}function x(t,e,r){let o=J(t,e);return m(o,e,r),Se(o[r])}function f(t,e){let r=oe(t,e);if(!_(r)||Array.isArray(r))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(r.children===void 0)return[];if(!Array.isArray(r.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return r.children}function ta(t,e){if(t.length>e.length)return!1;return t.every((r,o)=>r===e[o])}function g(t,e){let r=Math.min(t.length,e.length);for(let o=0;o<r;o++){let a=t[o],i=e[o];if(a===i)continue;if(Z(a)&&Z(i))return a-i;return String(a)<String(i)?-1:1}return t.length-e.length}function w(t){let e=[];for(let r of t)if(!t.some((o)=>!v(o,r)&&ta(o,r)))e.push([...r]);return e}function v(t,e){return t.length===e.length&&ta(t,e)}function af(t){let e=t?.at(-1);return t&&t.at(-2)==="children"&&Z(e)?{index:e,parentPath:t.slice(0,-2)}:null}function Qd(t){return af(t)!==null}function Jm(t){return w(t).filter((e)=>Qd(e)).toSorted((e,r)=>g(r,e))}function qx(t){if(Z(t)&&Number.isInteger(t))return t;return n(t)&&/^(?:0|[1-9]\d*)$/.test(t)?Number(t):null}function Gx(t,e,r,o){let a=af(e),i=a&&oe(t,a.parentPath),c=oe(t,r);if(!a||!i||!Array.isArray(i.children)||!c)return null;if(i.children[a.index]===void 0)return null;let d=i===c,h=d&&a.index<o?o-1:o,s=Array.isArray(c.children)?c.children.length:0,u={fromIndex:a.index,fromParentPath:a.parentPath,op:"move-child",toIndex:sf(h,s-(d?1:0)),toParentPath:r},p=jC(t,u);return{forward:u,inverse:p}}
|
|
2
|
+
export{Se,oe,Tv,Lv,FC,sf,jC,ta,af,Qd,Jm,qx,Gx};
|
|
3
|
+
|
|
4
|
+
//# debugId=B48BD0A2B57EE7B664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-nfwacw31.js.map
|