@jxsuite/studio 9.0.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-89fz3pfy.js → 2020-mkb0qa6p.js} +3 -3
- package/dist/chunks/adapter-xcpsmecx.js +4 -0
- package/dist/chunks/{add-new-flow-nmkqpjym.js → add-new-flow-ptmhmzr9.js} +3 -3
- package/dist/chunks/{cf-account-picker-2e06qxey.js → cf-account-picker-z1sgwpwd.js} +3 -3
- package/dist/chunks/cf-settings-xqvhxxe9.js +4 -0
- package/dist/chunks/components-whsc81a7.js +4 -0
- package/dist/chunks/content-source-jwtxg78w.js +4 -0
- package/dist/chunks/{convert-to-repeater-j9hfcj4f.js → convert-to-repeater-f92ey3kp.js} +3 -3
- package/dist/chunks/editor-zdqdpq1x.js +4 -0
- package/dist/chunks/entry-commands-w8p2fbpt.js +4 -0
- package/dist/chunks/{extension-sections-thfke054.js → extension-sections-y2p1te2r.js} +3 -3
- package/dist/chunks/file-ops-13ab4swj.js +4 -0
- package/dist/chunks/files-zbc8p6v1.js +4 -0
- package/dist/chunks/format-host-zjsbktbx.js +4 -0
- package/dist/chunks/fs-events-t6x0hch6.js +4 -0
- package/dist/chunks/grid-open-fyzdwpkh.js +4 -0
- package/dist/chunks/{grid-view-7d2nx83y.js → grid-view-r22jsqht.js} +5 -5
- package/dist/chunks/iframe-host-kbyqc7pt.js +4 -0
- package/dist/chunks/index-6nvj89vb.js +4 -0
- package/dist/chunks/{index-jxmt7vh8.js → index-pxwwf00y.js} +3 -3
- package/dist/chunks/{javascript-vmqp56ke.js → javascript-pzqryby6.js} +2 -2
- package/dist/chunks/{jsonMode-n3wmpant.js → jsonMode-tcnyxyap.js} +5 -5
- package/dist/chunks/jx-validate-5sp8a4rm.js +4 -0
- package/dist/chunks/layers-panel-qrxj9vr2.js +4 -0
- package/dist/chunks/layers-tpzayggx.js +4 -0
- package/dist/chunks/lit-html-x6nrxsx3.js +4 -0
- package/dist/chunks/media-library-ywppnjrz.js +4 -0
- package/dist/chunks/media-picker-etxgc8qq.js +4 -0
- package/dist/chunks/{monaco-binding-wfhmz89d.js → monaco-binding-bqpge64f.js} +3 -3
- package/dist/chunks/monaco-buffer-qrnqhk0b.js +4 -0
- package/dist/chunks/{monaco-setup-fty7a8vg.js → monaco-setup-1mkab762.js} +3 -3
- package/dist/chunks/notify-kcv38wwe.js +4 -0
- package/dist/chunks/parse-df2kkmhc.js +4 -0
- package/dist/chunks/platform-dtsysmyd.js +4 -0
- package/dist/chunks/publish-panel-evb1rcxt.js +4 -0
- package/dist/chunks/{publish-quick-12hh8926.js → publish-quick-m9vkhahq.js} +3 -3
- package/dist/chunks/publish-workspace-ktk9h536.js +4 -0
- package/dist/chunks/quick-search-2f47fxcw.js +4 -0
- package/dist/chunks/references-5w6ajjv7.js +4 -0
- package/dist/chunks/right-panel-kz0a6byf.js +4 -0
- package/dist/chunks/source-control-1phx90zk.js +4 -0
- package/dist/chunks/{studio-qevf5z9d.js → studio-07k0geap.js} +4 -4
- package/dist/chunks/{studio-k5n4es74.js → studio-0g2sm01j.js} +4 -4
- package/dist/chunks/{studio-7q6jdd4h.js → studio-0hr000ba.js} +4 -4
- package/dist/chunks/{studio-e4rq6x0q.js → studio-1wyp7dt5.js} +4 -4
- package/dist/chunks/{studio-vtey9w98.js → studio-20ap8dds.js} +4 -4
- package/dist/chunks/studio-291gqh98.js +5 -0
- package/dist/chunks/{studio-32d8wyxq.js → studio-37twdaf7.js} +30 -30
- package/dist/chunks/{studio-8pne0rx4.js → studio-4nkm4404.js} +4 -4
- package/dist/chunks/{studio-z1p91z5a.js → studio-4smcnv33.js} +4 -4
- package/dist/chunks/{studio-s4fq9jht.js → studio-4zqfw5ha.js} +4 -4
- package/dist/chunks/{studio-n4qq1n57.js → studio-56egy6vf.js} +4 -4
- package/dist/chunks/{studio-t6dqnnft.js → studio-5dmgmyw4.js} +4 -4
- package/dist/chunks/{studio-9ff0vqff.js → studio-5e7p1vgd.js} +4 -4
- package/dist/chunks/{studio-4qg61g9j.js → studio-5m0w815d.js} +4 -4
- package/dist/chunks/{studio-0rg30pvs.js → studio-695k95bw.js} +4 -4
- package/dist/chunks/{studio-spza69tb.js → studio-6vwvshw8.js} +5 -5
- package/dist/chunks/{studio-ae7a69jc.js → studio-76t560kn.js} +5 -5
- package/dist/chunks/{studio-9gzvypw4.js → studio-7823f0g8.js} +4 -4
- package/dist/chunks/{studio-gskkgfe3.js → studio-7vb997ff.js} +4 -4
- package/dist/chunks/{studio-sc35ttdk.js → studio-8486jn4r.js} +4 -4
- package/dist/chunks/{studio-a6e5fzve.js → studio-848rk4p1.js} +4 -4
- package/dist/chunks/{studio-tyzgte21.js → studio-8jb31dcf.js} +4 -4
- package/dist/chunks/{studio-jr30g4ae.js → studio-8qejv8yf.js} +4 -4
- package/dist/chunks/studio-8x8616xd.js +5 -0
- package/dist/chunks/{studio-kyw47pet.js → studio-9b7177jq.js} +4 -4
- package/dist/chunks/{studio-gk9yk8dj.js → studio-9cp96v90.js} +6 -6
- package/dist/chunks/{studio-h4jbgne2.js → studio-9rcbvksg.js} +6 -6
- package/dist/chunks/{studio-3hpcawh8.js → studio-a3s6frde.js} +3 -3
- package/dist/chunks/{studio-tfmhnwyr.js → studio-ahf3cspq.js} +3 -3
- package/dist/chunks/{studio-6rbaedw2.js → studio-bkmv1h3e.js} +6 -6
- package/dist/chunks/{studio-4j35hgsw.js → studio-brdp85q7.js} +4 -4
- package/dist/chunks/{studio-hcy9zeac.js → studio-cgb97rwv.js} +4 -4
- package/dist/chunks/{studio-gczve8zf.js → studio-ch8gt8vt.js} +3 -3
- package/dist/chunks/studio-cqf1k4qk.js +5 -0
- package/dist/chunks/{studio-myb4mf0h.js → studio-cvz0e00f.js} +4 -4
- package/dist/chunks/{studio-nqexty8x.js → studio-dbgv4fv9.js} +14 -14
- package/dist/chunks/{studio-8hf8qcm1.js → studio-dy2xtt7a.js} +4 -4
- package/dist/chunks/{studio-c88gq88j.js → studio-eesyjg7h.js} +5 -5
- package/dist/chunks/studio-et6t8g4m.js +4 -0
- package/dist/chunks/{studio-qs5fmhtj.js → studio-f2j9et3h.js} +8 -8
- package/dist/chunks/{studio-79r8msnr.js → studio-fep7hr66.js} +4 -4
- package/dist/chunks/{studio-1cfyd1ys.js → studio-fyf7j57j.js} +3 -3
- package/dist/chunks/{studio-mkw17ngg.js → studio-g5prntab.js} +4 -4
- package/dist/chunks/{studio-x2trkhk5.js → studio-ga77mf07.js} +4 -4
- package/dist/chunks/{studio-yjh9gddd.js → studio-ggm7zf70.js} +5 -5
- package/dist/chunks/studio-h7gy12h2.js +5 -0
- package/dist/chunks/{studio-qd0cycm4.js → studio-hsr3k06v.js} +5 -5
- package/dist/chunks/{studio-ztppbam0.js → studio-j933k8nr.js} +4 -4
- package/dist/chunks/studio-jgbvqcgh.js +5 -0
- package/dist/chunks/{studio-xzgp0cp7.js → studio-jh6t5qz4.js} +4 -4
- package/dist/chunks/{studio-k6hbx2fc.js → studio-jw0q5j6k.js} +4 -4
- package/dist/chunks/studio-k4xc5g6h.js +5 -0
- package/dist/chunks/{studio-fg4fj9ec.js → studio-mwnmzx7g.js} +6 -6
- package/dist/chunks/{studio-ekzbgnjp.js → studio-nf0pqpbj.js} +4 -4
- package/dist/chunks/{studio-sm2f0sc6.js → studio-p0nf2e1f.js} +5 -5
- package/dist/chunks/{studio-by8x0jvc.js → studio-pd9dsqpq.js} +4 -4
- package/dist/chunks/{studio-cg54vtet.js → studio-pmzg17fj.js} +4 -4
- package/dist/chunks/{studio-ht81xjkr.js → studio-pzfa2vmb.js} +4 -4
- package/dist/chunks/{studio-9179bsm7.js → studio-qyb5bebs.js} +7 -7
- package/dist/chunks/{studio-aghsg0ds.js → studio-rf8d6p9f.js} +6 -6
- package/dist/chunks/{studio-9ra9e7m4.js → studio-rt498t2v.js} +4 -4
- package/dist/chunks/{studio-trcfer2b.js → studio-s0fg2wav.js} +4 -4
- package/dist/chunks/studio-sd07xva5.js +6 -0
- package/dist/chunks/{studio-apapy17g.js → studio-skynbac3.js} +2 -2
- package/dist/chunks/{studio-nvfa137z.js → studio-t3j8htp7.js} +5 -5
- package/dist/chunks/{studio-ry4789ng.js → studio-thj81e98.js} +6 -6
- package/dist/chunks/{studio-nfwacw31.js → studio-tpy3rdxn.js} +4 -4
- package/dist/chunks/{studio-g45r5vm8.js → studio-va0e63sk.js} +4 -4
- package/dist/chunks/{studio-kqh7fxn6.js → studio-vcz63n42.js} +4 -4
- package/dist/chunks/studio-vffwe9k7.js +5 -0
- package/dist/chunks/{studio-nm86874b.js → studio-vjhej0w5.js} +123 -123
- package/dist/chunks/{studio-ws2r1d7e.js → studio-vxjap704.js} +4 -4
- package/dist/chunks/{studio-9ndgd55w.js → studio-w67vfgy5.js} +4 -4
- package/dist/chunks/{studio-ajw4k8hp.js → studio-x2metr13.js} +3 -3
- package/dist/chunks/{studio-14hh60j8.js → studio-xebavr9s.js} +4 -4
- package/dist/chunks/{studio-4rgem12q.js → studio-yg5n49za.js} +4 -4
- package/dist/chunks/{studio-6k9djnxw.js → studio-yhz5b313.js} +4 -4
- package/dist/chunks/{studio-nfmpmkqb.js → studio-zacvfm31.js} +4 -4
- package/dist/chunks/{studio-ywf9y1e2.js → studio-zsjpsw08.js} +4 -4
- package/dist/chunks/{studio-0nefxhar.js → studio-zxm98z2m.js} +6 -6
- package/dist/chunks/{tsMode-byje4a01.js → tsMode-6vwhy6ty.js} +5 -5
- package/dist/chunks/workspace-d65bz1qk.js +4 -0
- package/dist/chunks/workspace-home-vbg9b3jh.js +4 -0
- package/dist/chunks/{ws-client-h09h6sqg.js → ws-client-zcxkfgmf.js} +3 -3
- package/dist/iframe-entry.js +8 -8
- package/dist/manifest.json +74 -74
- package/dist/studio.js +86 -84
- package/package.json +11 -11
- package/src/canvas/iframe-editable-root.ts +32 -2
- package/src/format/format-host.ts +1 -1
- package/src/github/github-auth-status.ts +2 -2
- package/src/media/media-library.ts +73 -3
- package/src/packages/ensure-deps.ts +5 -5
- package/src/packages/pull-package-sync.ts +4 -4
- package/src/panels/activity-panel.ts +1 -1
- package/src/platform-errors.ts +17 -1
- package/src/platforms/cloud.ts +62 -34
- package/src/publish/publish-changes.ts +136 -4
- package/src/settings/extension-commands.ts +1 -1
- package/src/settings/extension-rows.ts +1 -6
- package/src/settings/extensions-section.ts +3 -6
- package/src/surfaces/block-action-bar.json +1 -3
- package/src/surfaces/media-library.json +35 -0
- package/src/surfaces/media-library.ts +2 -0
- package/src/surfaces/menu.ts +62 -1
- package/src/surfaces/settings-packages.ts +1 -1
- package/src/types.ts +24 -8
- package/src/ui/layers.ts +1 -1
- package/src/ui/progress-modal.ts +3 -3
- package/dist/chunks/adapter-ay13gema.js +0 -4
- package/dist/chunks/cf-settings-5y04810c.js +0 -4
- package/dist/chunks/components-3vf75n83.js +0 -4
- package/dist/chunks/content-source-4f2raf4a.js +0 -4
- package/dist/chunks/editor-645krvtz.js +0 -4
- package/dist/chunks/entry-commands-3qmv8wkr.js +0 -4
- package/dist/chunks/file-ops-kkhp9ma7.js +0 -4
- package/dist/chunks/files-yswdhxrf.js +0 -4
- package/dist/chunks/format-host-4g8ex6bz.js +0 -4
- package/dist/chunks/fs-events-z9gpvc6t.js +0 -4
- package/dist/chunks/grid-open-fm4j183c.js +0 -4
- package/dist/chunks/iframe-host-q7fedsmr.js +0 -4
- package/dist/chunks/index-pt4wh98x.js +0 -4
- package/dist/chunks/jx-validate-19y62knt.js +0 -4
- package/dist/chunks/layers-panel-1qvc83y9.js +0 -4
- package/dist/chunks/layers-qf0bc7ze.js +0 -4
- package/dist/chunks/lit-html-wyqw04y2.js +0 -4
- package/dist/chunks/media-library-f9d5qcjb.js +0 -4
- package/dist/chunks/media-picker-rsb1fmk2.js +0 -4
- package/dist/chunks/monaco-buffer-ak0raadw.js +0 -4
- package/dist/chunks/notify-4qj70q0x.js +0 -4
- package/dist/chunks/parse-n8dfxnqf.js +0 -4
- package/dist/chunks/platform-ehg6t9vd.js +0 -4
- package/dist/chunks/publish-panel-yhmda3cd.js +0 -4
- package/dist/chunks/publish-workspace-hx8qdv9p.js +0 -4
- package/dist/chunks/quick-search-r955m3q1.js +0 -4
- package/dist/chunks/references-8gxv0x7t.js +0 -4
- package/dist/chunks/right-panel-jarwqjpy.js +0 -4
- package/dist/chunks/source-control-84qt25m9.js +0 -4
- package/dist/chunks/studio-2bq7hheq.js +0 -5
- package/dist/chunks/studio-a9k86nq6.js +0 -5
- package/dist/chunks/studio-dvhxxxbd.js +0 -5
- package/dist/chunks/studio-fj6jzgxw.js +0 -5
- package/dist/chunks/studio-ge08zwpv.js +0 -5
- package/dist/chunks/studio-nr0kcqc6.js +0 -5
- package/dist/chunks/studio-psh8mwnw.js +0 -4
- package/dist/chunks/studio-tn7v8gey.js +0 -6
- package/dist/chunks/studio-y47090vq.js +0 -5
- package/dist/chunks/workspace-7q4arnt3.js +0 -4
- package/dist/chunks/workspace-home-ge027kr6.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{te}from"./studio-psh8mwnw.js";import{p}from"./studio-9ndgd55w.js";import{g,C}from"./studio-tfmhnwyr.js";import{iv}from"./studio-ztppbam0.js";import{Ot,Nt,ae}from"./studio-qs5fmhtj.js";import{Fl,mp}from"./studio-nfmpmkqb.js";import{Ue,ft,T,R,Jt,rt,tt}from"./studio-myb4mf0h.js";import{Bu}from"./studio-jr30g4ae.js";import{BD}from"./studio-1cfyd1ys.js";import{Gl}from"./studio-nqexty8x.js";import{S}from"./studio-9ra9e7m4.js";import{n,Q,_,v}from"./studio-ywf9y1e2.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],MR="integrations";function PR(e){return B.some((o)=>o.id===e)}var ve="overview",E=new Map,G=new Set;function D(){for(let e of G)e()}function xd(){D()}function E_(e){return G.add(e),()=>{G.delete(e)}}function Ol(e){E.set(e.key,e),D()}function FR(e){if(E.delete(e))D()}function we(){return[...E.values()].toSorted((e,o)=>e.order-o.order)}function By(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function zk(){return By().flatMap((e)=>e.sections.map((o)=>o.key))}function H(e){return E.get(e)}var L=null,P=ve;function V(){if(L!==null&&E.has(L))return P=L,L=null,P;if(E.has(P))return P;return zk()[0]??P}function T_(e){if(E.has(e))P=e,L=null;else L=e;D()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var W=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Ot(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Jt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(Ue,W),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var ee={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",ee);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var x=new Map,A=new Set,I=new Map;function jR(e,o){let s=S?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return x.set(e,o),null}var J=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=S?.projectConfig;if(!s)return;if(!(await Gl()).ok)return;let i=[];try{i=await Bu(s)}catch(r){C.warn(`Could not validate project.json — ${te(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}J.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:S?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return mp(r,a)}};if(Q(t.setSecrets))i.commitSecret=async(r,l)=>{let a=BD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function j(e){let o=S?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${W}/${e}`}var se=new WeakMap;function w(e){Wk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=j(t)??{},u=x.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&_(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:I.get(t)??"",newState:A.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(N)=>{if(N.parentNode!==o)o.replaceChildren(N)};if((s.settings.layout??"form")!=="map"){let N=`/${i}`;a(Fl(`section:${i}`,s.entrySchema,j(i)??{},{context:ie(i,t,null),errors:J.get(N)??{},onChange:(y)=>{let f=j(i);if(!f)return;oe(f,y),l(),z(N,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=j(i)??{},u=x.get(i)??null,d=u===null?void 0:c[u];if(u===null||!_(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(Fl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:J.get(h)??{},onChange:(N)=>{oe(m,N),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?x.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){A.delete(t()),I.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(I.get(i)??""),l=j(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),x.set(i,r),A.delete(i),I.delete(i),o(`/${i}`)},editNew(i){I.set(t(),i),w(e)},openNew(){A.add(t()),w(e)},removeEntry(){let i=t(),r=x.get(i)??null,l=j(i);if(!r||!l?.[r])return;delete l[r],x.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=x.get(r)??null,a=j(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),x.set(r,c),o(`/${r}`)},select(i){x.set(t(),i),e.echo=null,w(e)}}}function Wk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function F(e){let o=V(),s=By();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:H(o)!==void 0,intro:H(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=iv(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,F(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{T_(y)}});function u(y,f,k){if(s||k!==a)return;l=`Could not show ${H(y)?.label??y}: ${f}`,c.update(F(l))}function d(y){if(s)return;let f=V(),k=c.body();if(k!==t)t=k,r=null;if(!k||!y&&r===f){c.update(F(l));return}let q=r!==f;r=f,l="",c.update(F(l));let K=H(f);if(!K){i=null,k.replaceChildren();return}if(q||!i||i.parentElement!==k)i=document.createElement("div"),k.replaceChildren(i);a+=1;let Y=a;try{let O=K.render(i);if(O instanceof Promise)O.catch((ye)=>{u(f,te(ye),Y)})}catch(O){u(f,te(O),Y)}}let m=()=>E_(()=>{d(!0)}),h=m(),N=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:N,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,M=!1;function be(){return M}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Iu()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Iu(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function HR(){if(M&&b){await b.dialog.ready;return}if(M=!0,b&&!b.dialog.host.isConnected)Re(),M=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Iu(){if(!M)return;M=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){M=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
|
|
2
|
-
export{MR,PR,
|
|
1
|
+
import{ee}from"./studio-et6t8g4m.js";import{p}from"./studio-w67vfgy5.js";import{g,C}from"./studio-ahf3cspq.js";import{ov}from"./studio-j933k8nr.js";import{Ot,Nt,ae}from"./studio-f2j9et3h.js";import{Fl,mp}from"./studio-zacvfm31.js";import{Ue,ft,T,R,Yt,rt,tt}from"./studio-cvz0e00f.js";import{Bu}from"./studio-8qejv8yf.js";import{BD}from"./studio-fyf7j57j.js";import{Gl}from"./studio-dbgv4fv9.js";import{S}from"./studio-rt498t2v.js";import{n,Q,_,v}from"./studio-zsjpsw08.js";var B=[{id:"general",intro:"",label:"General",note:""},{id:"integrations",intro:"Turn on what your site needs. Each one adds its own options where you use it.",label:"Integrations",note:""},{id:"advanced",intro:"Changes here affect every page. Most sites never need them.",label:"Advanced",note:"For developers"}],MR="integrations";function PR(e){return B.some((o)=>o.id===e)}var ve="overview",E=new Map,G=new Set;function D(){for(let e of G)e()}function _d(){D()}function E_(e){return G.add(e),()=>{G.delete(e)}}function Ol(e){E.set(e.key,e),D()}function FR(e){if(E.delete(e))D()}function we(){return[...E.values()].toSorted((e,o)=>e.order-o.order)}function zy(){let e=we();return B.flatMap((o)=>{let s=e.filter((t)=>(t.group??"integrations")===o.id);return s.length===0?[]:[{id:o.id,intro:o.intro,label:o.label,note:o.note,sections:s}]})}function zk(){return zy().flatMap((e)=>e.sections.map((o)=>o.key))}function H(e){return E.get(e)}var L=null,P=ve;function V(){if(L!==null&&E.has(L))return P=L,L=null,P;if(E.has(P))return P;return zk()[0]??P}function T_(e){if(E.has(e))P=e,L=null;else L=e;D()}var X={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsDialog",$description:"Project Settings (§17.1): a `jx-dialog` whose body is the settings editor's two columns, the grouped section list and the section body. The dialog owns modality, Escape and focus restoration, and its one footer answer is Close: every section writes as it is edited, so there is nothing to confirm or cancel. The body is an ISLAND: this document draws the slot and nothing in it, and `settings/settings-dialog.ts` mounts `settings-pane.json` there through `onNodeCreated` (studio-ui-guidelines.md §9.4).",tagName:"jx-dialog",$props:{headline:"Project settings",confirmLabel:"",cancelLabel:"Close",size:"xl"},attributes:{part:"settings"},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},children:[{tagName:"div",attributes:{part:"pane-slot"},style:{$description:"The editor's box is its own (`settings-pane.json`); the slot only gives it the dialog body's width.",minWidth:"0"}}]};T("settings-dialog",X);var W=ft("dialog","settings");function xe(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function Z(e){let o=document.createElement("div");o.style.pointerEvents="auto",e.layer.append(o);let s=!0,t=!1,i=()=>{if(!s)return;s=!1,e.closed()},r=g({closed:i}),l=null,a=(d)=>{if(!t&&s)Ot(d);return d},c=R("settings-dialog",r,o,{onNodeCreated:(d,m,h)=>{if(!t&&d instanceof HTMLElement&&xe(h)==="pane-slot")e.body(d)}}).then(async(d)=>{let m=d.root;if(t)return d.dispose(),m;return l=d,await Yt(m),(m.querySelector('dialog[part="dialog"]')??m).setAttribute(Ue,W),a(m)}),u=()=>{let d=l?.root;if(d instanceof HTMLElement)Nt(d);i()};return{close:u,dispose(){if(t)return;u(),t=!0,l?.dispose(),l=null,o.remove()},host:o,ready:c,show(){if(!t)s=!0;return c.then(a)}}}var te={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsContributed",$description:'The generic settings section behind `$studio.settings` (specs/extensions.md §9.1), as a Jx document over the kit. One document serves both layouts an extension may declare: "form" is a single schema form over the whole section value, "map" is master-detail — the entry keys on the left, the selected entry\'s form on the right. The adapter (`surfaces/settings-contributed.ts`) hands in the title, the layout, the entry rows already marked as selected, and whatever the reader is part-way through typing; `settings/contributed-section.ts` decides what an entry may be named, what reaches `project.json`, and what the validator said about it. The schema form itself is an ISLAND: this document renders `form-host` and nothing inside it, because a form built from a JSON Schema is `ui/schema-form.ts`\'s surface rather than this one\'s — the section places the element that surface hands back. The actions row is the second island: `panels/data-grid.ts` contributes it, and that one is still lit over Spectrum.',tagName:"section",attributes:{part:"contributed"},style:{$description:"What `.settings-section-title`, `.settings-two-col`, `.settings-list-panel`, `.settings-editor-panel`, `.settings-editor-header`, `.settings-empty-state` and `.settings-inline-form` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. This section was the LAST emitter of every one of them except `.settings-empty-state`, which `panels/settings-pane.ts` still writes when a project closes with the editor open — so those rules are dead in the stylesheet from here, and a central sweep removes them rather than this change, which owns no stylesheet. Two values could not come across. `.settings-editor-header h3` read `var(--spectrum-font-size-100, 14px)`, and a document is mounted in the pane rather than inside `<sp-theme>`, so it would have taken its hard-coded fallback every time; the entry name is a kit textfield now and carries the kit's own type ramp. And `.entry-name-input`, `.settings-form-panel`, `.settings-section` and `.contributed-section` had no rule anywhere at all — they were four entries on `check-styles.ts`'s orphan ledger, which is the ledger's point.",display:"block",'& [part="title"]':{margin:"0 0 16px",fontSize:"16px",fontWeight:"600",color:"var(--fg)"},'& [part="actions"]':{$description:"The host-contributed actions row — Test Connection, Push Schema, Open Data Grid on the data sections. `.data-section-actions` never had a rule anywhere, so the row was whatever the buttons stacked up to; it is a row with a gap under it now.",display:"flex",alignItems:"center",flexWrap:"wrap",gap:"8px",marginBottom:"12px"},'& [part="columns"]':{$description:"The 1px gap over the border colour is the divider between the two columns: two panels on `--bg-panel` with `--border` showing through the gap, so nothing draws a rule of its own.",display:"flex",height:"100%",gap:"1px",background:"var(--border)"},'& [part="list"]':{display:"flex",flexDirection:"column",gap:"4px",padding:"12px",width:"200px",minWidth:"200px",background:"var(--bg-panel)",overflowY:"auto"},'& [part="entry"], & [part="new-open"]':{width:"100%"},'& [part="entry"] > [part="control"], & [part="new-open"] > [part="control"]':{$description:"`.settings-list-panel sp-action-button` said `width: 100%; justify-content: flex-start`, and both halves belong to the button the row is made of rather than to the row: a kit action button centres its glyph and its label, which reads as a list of centred names.",width:"100%",justifyContent:"flex-start"},'& [part="new-form"]':{display:"flex",alignItems:"center",gap:"6px"},'& [part="new-field"]':{flex:"1",minWidth:"0"},'& [part="empty"]':{flex:"1",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-panel)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="editor"]':{$description:"`min-width: 0` is the one line `.settings-editor-panel` did not have and needed: a flex child's floor is its content, and the schema form inside this one is a whole form rather than the short cards Data Shapes puts here — so a long pointer or a wide row pushed the column past the right edge of the pane instead of scrolling inside it.",flex:"1",padding:"16px",background:"var(--bg-panel)",overflowY:"auto",minWidth:"0"},'& [part="editor-header"]':{display:"flex",alignItems:"center",gap:"12px",marginBottom:"16px"},'& [part="entry-name"]':{flex:"1",minWidth:"0",maxWidth:"220px"}},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.title}"},{tagName:"div",attributes:{part:"actions-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/actionsState"},cases:{slot:{$description:"An island: the host renders its own actions into this node and the document renders nothing inside it.",tagName:"div",attributes:{part:"actions"}}}},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/layout"},cases:{form:{$description:"An island: `ui/schema-form.ts` draws the whole section value into this node.",tagName:"div",attributes:{part:"form-host"}},map:{tagName:"div",attributes:{part:"columns"},children:[{tagName:"div",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/entries"},key:{$ref:"$map/item/key"},map:{tagName:"jx-action-button",attributes:{part:"entry","data-entry":"${$map.item.key}","data-jx-region":"${$map.item.region}"},$props:{label:"${$map.item.key}",selected:{$ref:"$map/item/selected"},quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"$map/item/key"}]}]},children:[{tagName:"span",textContent:"${$map.item.key}"}]}},{tagName:"div",attributes:{part:"new-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/newState"},cases:{closed:{tagName:"jx-action-button",attributes:{part:"new-open"},$props:{label:"${state.newLabel}",icon:"plus",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openNew"},value:[]}]},children:[{tagName:"span",textContent:"${state.newLabel}"}]},open:{tagName:"div",attributes:{part:"new-form"},children:[{tagName:"jx-textfield",attributes:{part:"new-field"},$props:{label:"${state.newFieldLabel}",placeholder:"${state.newPlaceholder}",size:"sm",value:{$ref:"#/state/newName"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/editNew"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/createNew"},value:[]}],Escape:[{preventDefault:!0},{operator:"call",target:{$ref:"#/state/cancelNew"},value:[]}]}}]}},{tagName:"jx-button",attributes:{part:"new-create"},$props:{size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/createNew"},value:[]}]},children:[{tagName:"span",textContent:"Create"}]}]}}}]},{tagName:"div",attributes:{part:"editor-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/editorState"},cases:{empty:{tagName:"div",attributes:{part:"empty"},textContent:"${state.emptyText}"},editing:{tagName:"div",attributes:{part:"editor","data-jx-region":"${state.editorRegion}"},children:[{tagName:"div",attributes:{part:"editor-header"},children:[{tagName:"jx-textfield",attributes:{part:"entry-name"},$props:{label:"Entry name",size:"sm",value:{$ref:"#/state/entryName"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}]},onkeydown:{$prototype:"Function",body:[{$switch:{$ref:"event#/key"},cases:{Enter:[{operator:"call",target:{$ref:"#/state/renameEntry"},value:[{$ref:"event#/target/value"}]}],Escape:[{operator:"call",target:{$ref:"#/state/cancelRename"},value:[{$ref:"event#/target/value"}]}]}}]}},{tagName:"jx-action-button",attributes:{part:"delete-entry"},$props:{label:"Delete entry",hint:"Delete entry",icon:"trash",quiet:!0,size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/removeEntry"},value:[]}]}}]},{$description:"An island: `ui/schema-form.ts` draws the selected entry into this node.",tagName:"div",attributes:{part:"form-host"}}]}}}]}}}]};T("settings-contributed",te);function Te(){return{actionsState:"none",editorRegion:"",editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:"",emptyText:"",newFieldLabel:"",newLabel:"",newPlaceholder:""}}function Ne(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ne(e,o,s){e.textContent="";let t=g({...Te(),...o}),i=null,r=!1,l=R("settings-contributed",t,e,{onNodeCreated:(a,c,u)=>{if(!(a instanceof HTMLElement))return;let d=Ne(u);if(d==="form-host")s.formSlot(a);else if(d==="actions")s.actionsSlot(a)}}).then((a)=>{let c=a.root;if(r)return a.dispose(),c;return i=a,c});return{attached:()=>{if(r)return!1;let a=i?.root;return a===void 0?!0:a instanceof HTMLElement&&e.contains(a)},dispose(){r=!0,i?.dispose(),i=null},host:e,ready:l,update(a){t.actionsState=a.actionsState,t.editorRegion=a.editorRegion,t.editorState=a.editorState,t.entries=a.entries,t.entryName=a.entryName,t.layout=a.layout,t.newName=a.newName,t.newState=a.newState,t.title=a.title,t.emptyText=a.emptyText,t.newFieldLabel=a.newFieldLabel,t.newLabel=a.newLabel,t.newPlaceholder=a.newPlaceholder}}}var x=new Map,A=new Set,I=new Map;function jR(e,o){let s=S?.projectConfig?.[e],t=v(s)?s:{};if(!Object.hasOwn(t,o))return Object.keys(t);return x.set(e,o),null}var J=new Map;function ke(e,o){let s={},t=[];for(let i of o){let r=i.indexOf(": "),l=r===-1?"":i.slice(0,r),a=r===-1?i:i.slice(r+2);if(l===e){t.push(a);continue}if(!l.startsWith(`${e}/`))continue;let[c]=l.slice(e.length+1).split("/");if(c&&s[c]===void 0)s[c]=a}return{fields:s,section:t}}async function z(e,o){let s=S?.projectConfig;if(!s)return;if(!(await Gl()).ok)return;let i=[];try{i=await Bu(s)}catch(r){C.warn(`Could not validate project.json — ${ee(r)}`,{key:"settings:validator",path:"project.json",source:"Settings",tier:"problem"});return}J.set(e,ke(e,i).fields),o()}function oe(e,o){for(let[s,t]of Object.entries(o))if(t===void 0)delete e[s];else e[s]=t}function U(e){return e.toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z0-9-]/g,"")}function Ce(e,o){if(!e)return{};let s=(i)=>{let r={};for(let[l,a]of Object.entries(i))r[l]=t(a);return r},t=(i)=>{if(n(i))return i.replaceAll("${key}",o);if(Array.isArray(i))return i.map((r)=>t(r));if(v(i))return s(i);return i};return s(e)}function ie(e,o,s=null){let t=p(),i={fieldKeyPrefix:`$settings.${e}`,resolvePointer:(r,l)=>{let a={projectConfig:S?.projectConfig??{}};if(v(l))a.scope=l;if(o.formats!==void 0)a.formats=o.formats;return mp(r,a)}};if(Q(t.setSecrets))i.commitSecret=async(r,l)=>{let a=BD(e,s,r);return await t.setSecrets({set:{[a]:l}}),a};return i}function j(e){let o=S?.projectConfig;if(!o)return null;let s=o[e];if(v(s))return s;let t={};return o[e]=t,t}function re(e){return`${W}/${e}`}var se=new WeakMap;function w(e){Wk(e.container,e.contribution,e.opts)}function le(e,o){e.echo=o,w(e)}var Ee="entry";function je(e){let o=e?.trim().toLowerCase()||Ee,s=`${o.charAt(0).toUpperCase()}${o.slice(1)}`;return{emptyText:`Select ${/^[aeiou]/u.test(o)?"an":"a"} ${o} or create one`,newFieldLabel:`${s} name`,newLabel:`New ${o}`,newPlaceholder:`${U(o)}-name`}}function Me(e){let{contribution:o,opts:s}=e,t=o.key,i=o.title??t,r=s.actions?"slot":"none",l=re("editor"),a=je(o.settings.entry?.noun);if((o.settings.layout??"form")!=="map")return{actionsState:r,editorRegion:l,editorState:"empty",entries:[],entryName:"",layout:"form",newName:"",newState:"closed",title:i,...a};let c=j(t)??{},u=x.get(t)??null,d=u===null?void 0:c[u],m=u!==null&&_(d);return{actionsState:r,editorRegion:l,editorState:m?"editing":"empty",entries:Object.keys(c).map((h)=>({key:h,region:re(`entry:${h}`),selected:h===u})),entryName:e.echo??(m?u:""),layout:"map",newName:I.get(t)??"",newState:A.has(t)?"open":"closed",title:i,...a}}function ce(e){let o=e.formHost;if(!o)return;let{contribution:s,opts:t}=e,i=s.key,r=s.settings.entry?.ui,l=()=>w(e),a=(N)=>{if(N.parentNode!==o)o.replaceChildren(N)};if((s.settings.layout??"form")!=="map"){let N=`/${i}`;a(Fl(`section:${i}`,s.entrySchema,j(i)??{},{context:ie(i,t,null),errors:J.get(N)??{},onChange:(y)=>{let f=j(i);if(!f)return;oe(f,y),l(),z(N,l)},rerender:l,...r!==void 0&&{ui:r}}));return}let c=j(i)??{},u=x.get(i)??null,d=u===null?void 0:c[u];if(u===null||!_(d)){o.replaceChildren();return}let m=d,h=`/${i}/${u}`;a(Fl(`section:${i}:${u}`,s.entrySchema,m,{context:ie(i,t,u),errors:J.get(h)??{},onChange:(N)=>{oe(m,N),l(),z(h,l)},rerender:l,...r!==void 0&&{ui:r}}))}function de(e){let o=e.actionsHost,{actions:s}=e.opts;if(!o)return;if(!s){o.replaceChildren();return}let t=e.contribution.key,i=(e.contribution.settings.layout??"form")==="map"?x.get(t)??null:null;s(o,{rerender:()=>w(e),sectionKey:t,selected:i})}function Pe(e){let o=(i)=>{e.echo=null,w(e),z(i,()=>w(e))},s=()=>{e.echo=null,w(e)},t=()=>e.contribution.key;return{cancelNew(){A.delete(t()),I.delete(t()),w(e)},cancelRename(i){le(e,i),s()},createNew(){let i=t(),r=U(I.get(i)??""),l=j(i);if(!r||!l||l[r])return;l[r]=Ce(e.contribution.settings.entry?.newEntry,r),x.set(i,r),A.delete(i),I.delete(i),o(`/${i}`)},editNew(i){I.set(t(),i),w(e)},openNew(){A.add(t()),w(e)},removeEntry(){let i=t(),r=x.get(i)??null,l=j(i);if(!r||!l?.[r])return;delete l[r],x.set(i,null),o(`/${i}`)},renameEntry(i){le(e,i);let r=t(),l=x.get(r)??null,a=j(r),c=U(i.trim());if(!l||!a||!c||c===l||a[c]){s();return}let u={};for(let[d,m]of Object.entries(a))u[d===l?c:d]=m,delete a[d];Object.assign(a,u),x.set(r,c),o(`/${r}`)},select(i){x.set(t(),i),e.echo=null,w(e)}}}function Wk(e,o,s={}){let t=se.get(e);if(t)t.contribution=o,t.opts=s;let i=t?.handle??null;if(!t||!i?.attached()){i?.dispose();let r={actionsHost:null,container:e,contribution:o,echo:null,formHost:null,handle:null,opts:s};se.set(e,r),i=ne(e,Pe(r),{actionsSlot:(l)=>{r.actionsHost=l,de(r)},formSlot:(l)=>{r.formHost=l,ce(r)}}),r.handle=i,t=r}i.update(Me(t)),de(t),ce(t)}var pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSettingsPane",$description:'The Project Settings dialog\'s two columns: the grouped section list and the section body (§17.1). It draws no section: `panels/settings-pane.ts` keeps the registry, decides which section is current, and renders whichever one that is into the one empty `[part="section-host"]` island this document leaves for it (studio-ui-guidelines.md §9.4), because a section renderer may be a lit template or a mounted document and neither can share a container with this one. The list is three vertical `tablist`s, one per group (General, Integrations, Advanced), each named by its group heading: a tablist may own only tabs, so a heading between two runs of rows has to END one list rather than sit inside it. Each group is one tab stop and the arrow keys move within it. Under the groups, a Moved footnote names what left Project Settings for a workspace, each with a button that goes there.',tagName:"div",attributes:{part:"doc"},style:{$description:'No part below is named `body`, `field`, `label`, `error`, `text` or `actions`: this document is mounted inside a `jx-dialog`, the kit is light DOM, and the dialog draws its own `[part="body"]` around this one, so a rule keyed on that name here would also be a rule the dialog\'s own styles reach.',display:"flex",height:"min(68vh, 640px)",minHeight:"0",background:"var(--bg)",color:"var(--fg)",fontFamily:"var(--jx-font-sans)",textAlign:"initial",'& [part="nav"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-4)",width:"200px",minWidth:"200px",flexShrink:"0",padding:"var(--jx-space-2) var(--jx-space-3) var(--jx-space-2) 0",borderRight:"1px solid var(--border)",overflowY:"auto",fontSize:"13px"},'& [part="group"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="group-title"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",margin:"0",padding:"0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)",fontWeight:"600",letterSpacing:"0.04em",textTransform:"uppercase"},'& [part="group-note"]':{$description:`The Advanced group's "For developers": a qualifier on the heading, not a second heading, so it reads at the heading's size without its weight.`,fontWeight:"400",letterSpacing:"0",textTransform:"none"},'& [part="group-note"]:empty':{display:"none"},'& [part="group-tabs"]':{$description:"The rule a vertical strip draws on its trailing edge is the column's own here: the nav draws one border for all three groups, so each strip drawing its own would stack three short rules beside it.",borderInlineEnd:"0"},'& [part="nav-item"]':{$description:"Full-bleed rows, which a tab is not by default: `jx-tab` centres its label and caps itself at 220px because a horizontal strip is a row of chips. In the nav column the row IS the target, so the label goes to the leading edge and the cap comes off.",maxWidth:"none",justifyContent:"flex-start",padding:"var(--jx-space-2) var(--jx-space-3)"},'& [part="moved"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",marginTop:"auto",padding:"var(--jx-space-3)",borderTop:"1px solid var(--border)",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)"},'& [part="moved-title"]':{margin:"0",fontWeight:"600",color:"var(--fg)"},'& [part="moved-row"]':{display:"flex",alignItems:"center",flexWrap:"wrap",gap:"var(--jx-space-1)"},'& [part="content"]':{flex:"1",minWidth:"0",overflowY:"auto",padding:"var(--jx-space-2) var(--jx-space-5)"},'& [part="group-intro"]':{margin:"0 0 var(--jx-space-3)",color:"var(--fg-dim)",fontSize:"13px"},'& [part="group-intro"]:empty':{display:"none"},'& [part="section-host"]':{display:"block",minWidth:"0"},'& [part="empty"]':{$description:"What the body says when the active section is registered by nobody: every section unregistering at once, which is a project closing while the dialog is open. A blank column beside a list reads as a broken dialog, so it says which it is.",display:"flex",alignItems:"center",justifyContent:"center",minHeight:"120px",margin:"0",color:"var(--fg-dim)",fontSize:"13px"},'& [part="failure"]':{$description:"A section whose renderer threw or rejected. It is said where the section would have been, in the reader's line of sight, because a section that silently draws nothing is indistinguishable from one with nothing to say.",margin:"0",padding:"var(--jx-space-3)",border:"1px solid var(--danger)",borderRadius:"var(--radius)",color:"var(--fg)",fontSize:"13px"}},children:[{tagName:"div",attributes:{part:"nav",role:"none"},children:[{$prototype:"Array",items:{$ref:"#/state/groups"},key:{$ref:"$map/item/id"},map:{tagName:"div",attributes:{part:"group",role:"none","data-group":"${$map.item.id}"},children:[{tagName:"h3",attributes:{part:"group-title",id:"${$map.item.titleId}"},children:[{tagName:"span",textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"group-note"},textContent:"${$map.item.note}"}]},{tagName:"jx-tabs",attributes:{part:"group-tabs",selected:"${state.active}",orientation:"vertical"},$props:{label:{$ref:"$map/item/tabsLabel"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/selectSection"},value:[{$ref:"event#/detail"}]}]},children:[{$prototype:"Array",items:{$ref:"$map/item/sections"},key:{$ref:"$map/item/key"},map:{tagName:"jx-tab",attributes:{part:"nav-item",id:"${$map.item.tabId}","data-section":"${$map.item.key}",value:"${$map.item.key}",label:"${$map.item.label}",panel:"settings-pane-panel"}}}]}]}},{tagName:"div",attributes:{part:"moved",role:"group","aria-labelledby":"settings-pane-moved"},children:[{tagName:"p",attributes:{part:"moved-title",id:"settings-pane-moved"},textContent:"Moved"},{$prototype:"Array",items:{$ref:"#/state/moved"},key:{$ref:"$map/item/workspace"},map:{tagName:"div",attributes:{part:"moved-row","data-moved":"${$map.item.workspace}"},children:[{tagName:"span",textContent:"${$map.item.what} →"},{tagName:"jx-button",attributes:{part:"moved-link"},$props:{size:"sm",quiet:!0,label:{$ref:"$map/item/linkLabel"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMoved"},value:[{$ref:"$map/item/workspace"}]}]},children:[{tagName:"span",textContent:"${$map.item.place}"}]}]}}]}]},{tagName:"jx-tab-panel",attributes:{part:"content",id:"settings-pane-panel"},$props:{active:!0,labelledby:{$ref:"#/state/activeTabId"}},children:[{$description:`The current group's intro ("Changes here affect every page. Most sites never need them."), above whichever of its sections is showing. General has none, and an empty sentence draws nothing.`,tagName:"p",attributes:{part:"group-intro"},textContent:"${state.intro}"},{$description:"The island, and it stays empty: a settings section renders itself, into a host this document never writes into and never reads back (studio-ui-guidelines.md §9.4).",tagName:"div",attributes:{part:"section-host"}},{tagName:"div",attributes:{part:"empty-slot",role:"none"},$switch:{$ref:"#/state/hasSection"},cases:{false:{tagName:"p",attributes:{part:"empty"},textContent:"${state.empty}"}}},{tagName:"div",attributes:{part:"failure-slot",role:"none"},$switch:{$ref:"#/state/failureState"},cases:{failed:{tagName:"p",attributes:{part:"failure",role:"alert"},textContent:"${state.failure}"}}}]}]};T("settings-pane",pe);function He(e){let o=n(e)?void 0:e.attributes?.part;return n(o)?o:""}function ue(e){return e===""?"ok":"failed"}function me(e,o,s){let t=g({...o,...s,failureState:ue(o.failure)});e.textContent="",delete e._$litPart$;let i=null,r=!1,l=null,a=R("settings-pane",t,e,{onNodeCreated:(c,u,d)=>{if(!r&&c instanceof HTMLElement&&He(d)==="section-host")l=c}}).then((c)=>{if(r){c.dispose();return}i=c});return{body:()=>l,dispose(){r=!0,i?.dispose(),i=null,l=null},focusActive(){let c=i?.root;if(c instanceof HTMLElement)c.querySelector('[part="nav-item"][aria-selected="true"]')?.focus()},ready:a,update(c){t.groups=c.groups,t.moved=c.moved,t.activeTabId=c.activeTabId,t.empty=c.empty,t.intro=c.intro,t.hasSection=c.hasSection,t.failure=c.failure,t.failureState=ue(c.failure),t.active=c.active}}}var Ie="No settings sections.",fe=[{place:"Styles › Variables",view:"variables",what:"Colors and fonts",workspace:"styles"},{place:"Publish › Hosting",publishTab:"hosting",what:"Hosting and domain",workspace:"publish"},{inspector:"page",place:"Page tab",what:"Head and SEO defaults",workspace:"design"}];function ge(e){return`settings-nav-${e}`}function Oe(e){return fe.find((o)=>o.workspace===e)??null}function F(e){let o=V(),s=zy();return{active:o,activeTabId:ge(o),empty:Ie,failure:e,groups:s.map((t)=>({id:t.id,label:t.label,note:t.note,sections:t.sections.map((i)=>({key:i.key,label:i.label,tabId:ge(i.key)})),tabsLabel:t.note===""?t.label:`${t.label}, ${t.note.toLowerCase()}`,titleId:`settings-group-${t.id}`})),hasSection:H(o)!==void 0,intro:H(o)?.intro||(s.find((t)=>t.sections.some((i)=>i.key===o))?.intro??""),moved:fe.map((t)=>{let{title:i}=ov(t.workspace),r=t.place??i;return{linkLabel:`${t.what}: ${r}. Go to ${i}`,place:r,what:t.what,workspace:t.workspace}})}}function he(e,o){let s=!1,t=null,i=null,r=null,l="",a=0,c=me(e,F(l),{openMoved:(y)=>{let f=Oe(y);if(f!==null)o.openMoved(f.workspace,f.inspector,f.view,f.publishTab)},selectSection:(y)=>{T_(y)}});function u(y,f,k){if(s||k!==a)return;l=`Could not show ${H(y)?.label??y}: ${f}`,c.update(F(l))}function d(y){if(s)return;let f=V(),k=c.body();if(k!==t)t=k,r=null;if(!k||!y&&r===f){c.update(F(l));return}let q=r!==f;r=f,l="",c.update(F(l));let K=H(f);if(!K){i=null,k.replaceChildren();return}if(q||!i||i.parentElement!==k)i=document.createElement("div"),k.replaceChildren(i);a+=1;let Y=a;try{let O=K.render(i);if(O instanceof Promise)O.catch((ye)=>{u(f,ee(ye),Y)})}catch(O){u(f,ee(O),Y)}}let m=()=>E_(()=>{d(!0)}),h=m(),N=c.ready.then(()=>{d(!0)});return{dispose(){if(s)return;s=!0,h?.(),h=null,c.dispose()},focusActive:()=>{c.focusActive()},ready:N,resume(){if(s||h!==null)return;h=m(),i=null,d(!0)},suspend(){h?.(),h=null}}}var b=null,M=!1;function be(){return M}function De(){let e={dialog:Z({body:(o)=>{e.pane=he(o,{openMoved:(s,t,i,r)=>{Ae(s,t,i,r)}})},closed:()=>{if(b===e)Iu()},layer:tt("dialog")}),pane:null};return e}async function Ae(e,o,s,t){if(Iu(),s!==void 0){await rt("styles.open",{view:s},"Settings");return}if(t!==void 0){await rt("publish.open",{tab:t},"Settings");return}if(await rt("view.setWorkspace",{workspace:e},"Settings"),o===void 0)return;if(await rt("view.setRightPanel",{open:!0},"Settings"),ae()?.isEnabled("view.setRightTab")===!0)await rt("view.setRightTab",{tab:o},"Settings")}async function HR(){if(M&&b){await b.dialog.ready;return}if(M=!0,b&&!b.dialog.host.isConnected)Re(),M=!0;let e=b;if(e)e.pane?.resume(),await e.dialog.show();else e=De(),b=e,await e.dialog.ready;let o=e.pane;if(o===null||b!==e||!be())return;if(await o.ready,b===e&&be())o.focusActive()}function Iu(){if(!M)return;M=!1,b?.pane?.suspend(),b?.dialog.close()}function Re(){M=!1;let e=b;b=null,e?.pane?.dispose(),e?.dialog.dispose()}
|
|
2
|
+
export{MR,PR,_d,E_,Ol,FR,zy,zk,T_,jR,Wk,HR,Iu};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=51349F206A48F52D64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-1wyp7dt5.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{
|
|
1
|
+
import{ee}from"./studio-et6t8g4m.js";import{p,_e}from"./studio-w67vfgy5.js";import{C}from"./studio-ahf3cspq.js";import{Sr}from"./studio-0hr000ba.js";import{A$,dv,h}from"./studio-j933k8nr.js";import{MC,Si,wv}from"./studio-4nkm4404.js";import{us,Wd,tO}from"./studio-pd9dsqpq.js";import{Js,e$,t$,Ys,nn,rC,n$,sh}from"./studio-5dmgmyw4.js";import{S}from"./studio-rt498t2v.js";function d(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var x=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Wc(){return(_e()?p().assetCapabilities?.accept:void 0)??x}function Md(t){return Ys.has(nn(t))}function Vc(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=nn(t.name);if(Js.has(n))return"image";if(e$.has(n))return"video";if(t$.has(n))return"audio";return"file"}var ZL=new Set([".woff",".woff2",".ttf",".otf"]);function dA(t){if(ZL.has(nn(t)))return"font";let e=Vc({name:t});return e==="file"?"document":e}var y=/^content\/([^/]+)\//,_a="public/media";function XL(t){let e=t?y.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:_a}function uA(t){let e=t.replaceAll("\\","/");return e===_a||/^content\/[^/]+\/images$/.test(e)}function A(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function w(t,e){if(!e.has(t))return t;let n=nn(t),r=n?t.slice(0,-n.length):t;for(let i=1;;i++){let o=`${r}-${i}${n}`;if(!e.has(o))return o}}function E(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var f=null;function hA(t){f=t}async function QL(t){await f?.(t)}function b(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function M(t,e){let n=(o)=>e==="image"?Js.has(nn(o.name)):Md(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)C.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Sa(t,e={}){let n=e.only===void 0?[...t]:M([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??XL(h.value?.documentPath??null),o;try{let s=await us(()=>r.listDirectory(i));o=new Set(s.map((l)=>l.name))}catch{o=new Set}let u=_e()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let s of n){if(u!==void 0&&s.size>u){C.error(`${s.name} is too large.`,{detail:`This backend accepts at most ${d(u)}; that file is ${d(s.size)}.`,source:"Media"});continue}let l=w(s.name,o);o.add(l);let m=E(i,l);try{let{path:c}=await r.uploadFile(m,s);Wd([c]),a.push({kind:Vc(s),name:l,path:c,ref:A(c)})}catch(c){C.error(`Could not upload ${s.name}.`,{detail:ee(c),path:m,source:"Media"})}}if(a.length>0)C.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await f?.(i);return a}var O=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function g(t){return O.find((e)=>e.has(t))??new Set([t])}function pA(t){return[...g(nn(t))].join(",")}function v(t,e){return g(nn(t)).has(nn(e.name))}async function fA(t,e){let n=t.split("/").pop()??t;if(!v(t,e))return C.error(`${e.name} cannot replace ${n}.`,{detail:`${n} is ${nn(t)||"a file with no extension"} and ${e.name} is ${nn(e.name)||"a file with no extension"}. Every page that uses ${n} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let r=_e()?p().assetCapabilities?.maxUploadBytes:void 0;if(r!==void 0&&e.size>r)return C.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${d(r)}; that file is ${d(e.size)}.`,source:"Media"}),!1;let i;try{({path:i}=await p().uploadFile(t,e))}catch(o){return C.error(`Could not replace ${n}.`,{detail:ee(o),path:t,source:"Media"}),!1}if(Wd([t,i]),Sr(),await QL(b(t)),i!==t)return C.warn(`${n} was not replaced.`,{detail:`The backend stored the new file as ${i}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return C.success(`Replaced ${n}`),!0}function mA(t){let e=Si(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function jb(t){let e=Si(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function I(){return S?.projectConfig?.content??null}function N(t){return dv(t,I(),n$())}function F(t,e){return`${Si(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function Hb(t){let e=Si(t);if(e.startsWith(`${MC}/`))return`/${e.slice(MC.length+1)}`;let n=N(e);return n?`/${F(e,n)}`:`/${e}`}function tr(t){let e=Si(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=sh();if(n==="repo")return A$(`${r}${wv(e)}`,tO(e));return rC(`/${wv(Hb(e).slice(1))}`)}
|
|
2
|
+
export{Wc,Md,Vc,ZL,dA,_a,XL,uA,hA,QL,Sa,pA,fA,mA,jb,Hb,tr};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=A7E590EC832B29D564756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-20ap8dds.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ee}from"./studio-et6t8g4m.js";import{Oe,ir,Ud,h}from"./studio-j933k8nr.js";import{C}from"./studio-ahf3cspq.js";import{p}from"./studio-w67vfgy5.js";import{Ne,xa,Hc}from"./studio-nf0pqpbj.js";import{Qn}from"./studio-cvz0e00f.js";import{lw,lb}from"./studio-jw0q5j6k.js";import{xS}from"./studio-ga77mf07.js";import{Co}from"./studio-dbgv4fv9.js";import{Ut,zi}from"./studio-rt498t2v.js";import{oe}from"./studio-tpy3rdxn.js";import{_,it}from"./studio-zsjpsw08.js";function ew(){let t=h.value,e=Oe(t?.session.selection);if(!t||!e||e.length<2)return null;let o=oe(t.doc.document,e);if(!o||!o.tagName)return null;return{node:o,path:e}}async function rm(){let t=ew();if(!t)return;let e=await b(g(t.node));if(!e)return;await cE(e.toLowerCase())}async function cE(t){let e=h.value,o=ew();if(!e||!o)return null;let{node:m,path:f}=o,l=v(m);l.tagName=t;let r=`components/${t}.json`,c=Hc(e.documentPath,r),u=f;if(!Ud(e,(n)=>{let s=Ut(u)??[],d=zi(u),a=n;for(let i of s)a=a[i];if(!Array.isArray(a.children))a.children=[];if(a.children[d]={tagName:t},!n.$elements)n.$elements=[];if(!n.$elements.some((i)=>_(i)&&("$ref"in i)&&i.$ref===c))n.$elements.push({$ref:c})}))return null;try{await p().writeFile(r,Co(l,null)),await xa();let s=xS(l);if(C.success(`Converted to <${t}>`),s)C.warn(`<${t}> has a slot problem: ${s}`,{path:r,source:"Components",tier:"problem"});return r}catch(n){return C.error(`Could not save the <${t}> component.`,{detail:ee(n),path:r,source:"Components"}),null}}function g(t){if(t.$id){let o=lb(t.$id);if(o!=="")return o}let e=(it(t.tagName)||"div").toLowerCase();return e.includes("-")?e:lb(e)}function v(t){let e=ir(t);return delete e.$id,delete e.$layout,delete e.$paths,e}function N(t){let e=t.trim().toLowerCase(),o=lw(e);if(o!=="")return o;return Ne.some((m)=>m.tagName===e)?`Component <${e}> already exists`:""}function b(t){return Qn("Convert to Component",{confirmLabel:"Convert",message:"Enter a hyphenated tag name for the new component.",placeholder:"my-component",validate:N,value:t})}
|
|
2
|
+
export{ew,rm,cE};
|
|
3
|
+
|
|
4
|
+
//# debugId=07970D617D0AB42164756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-291gqh98.js.map
|