@jxsuite/studio 5.5.0 → 5.6.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/LICENSE +1 -1
- package/dist/chunks/{2020-g8mwpbkq.js → 2020-zvax9fmb.js} +3 -3
- package/dist/chunks/adapter-6zhjbpmd.js +4 -0
- package/dist/chunks/cf-account-picker-zfycs4k2.js +4 -0
- package/dist/chunks/cf-settings-fpa485q3.js +4 -0
- package/dist/chunks/components-b0vh4sq8.js +4 -0
- package/dist/chunks/content-source-z5t0d0h9.js +4 -0
- package/dist/chunks/convert-to-repeater-x19jr6c7.js +4 -0
- package/dist/chunks/editor-7e23n4a8.js +4 -0
- package/dist/chunks/entry-commands-5cm6aba2.js +4 -0
- package/dist/chunks/extension-sections-y90sa0n4.js +4 -0
- package/dist/chunks/file-ops-hv7gf757.js +4 -0
- package/dist/chunks/files-kb0epdxf.js +4 -0
- package/dist/chunks/format-host-eg1wy2bp.js +4 -0
- package/dist/chunks/fs-events-ky3vxfmh.js +4 -0
- package/dist/chunks/git-panel-yyg3bzp2.js +4 -0
- package/dist/chunks/grid-view-5mqv1cbd.css +1 -0
- package/dist/chunks/grid-view-d9mybhn0.js +51 -0
- package/dist/chunks/iframe-host-9wdf0hes.js +4 -0
- package/dist/chunks/index-2tf0m2ne.js +4 -0
- package/dist/chunks/{index-arg188jq.js → index-vnwy9d44.js} +3 -3
- package/dist/chunks/{javascript-zcdmye2k.js → javascript-f0nrbdjb.js} +2 -2
- package/dist/chunks/{jsonMode-6x5e1nbf.js → jsonMode-nfa90dtf.js} +5 -5
- package/dist/chunks/jx-validate-7w11db9v.js +4 -0
- package/dist/chunks/layers-7zasrpse.js +4 -0
- package/dist/chunks/layers-panel-9nzc4fdq.js +4 -0
- package/dist/chunks/lit-html-5qr7nbng.js +4 -0
- package/dist/chunks/media-picker-maevn9d4.js +4 -0
- package/dist/chunks/menu-wq6q0v3y.js +4 -0
- package/dist/chunks/{monaco-binding-4az2kh5p.js → monaco-binding-antn79jf.js} +3 -3
- package/dist/chunks/monaco-buffer-9ry2rn5x.js +4 -0
- package/dist/chunks/{monaco-setup-d7mwkcx3.js → monaco-setup-k8s40vwg.js} +3 -3
- package/dist/chunks/notify-g91gjd6w.js +4 -0
- package/dist/chunks/platform-jdwjp2vt.js +4 -0
- package/dist/chunks/publish-panel-8yym447p.js +4 -0
- package/dist/chunks/quick-search-9bzm9kh3.js +4 -0
- package/dist/chunks/references-znssfqvq.js +4 -0
- package/dist/chunks/right-panel-czbzktm8.js +4 -0
- package/dist/chunks/section-registry-0rtq73qs.js +4 -0
- package/dist/chunks/studio-011em5cf.js +5 -0
- package/dist/chunks/studio-02y9cb4h.js +6 -0
- package/dist/chunks/{studio-7gqyhjns.js → studio-09n3fyy0.js} +4 -4
- package/dist/chunks/{studio-xcng8nx7.js → studio-0c3fpdqj.js} +5 -5
- package/dist/chunks/studio-0mm38y62.js +5 -0
- package/dist/chunks/studio-0nm2skex.js +4 -0
- package/dist/chunks/{studio-73czgk6a.js → studio-153mwkyq.js} +4 -4
- package/dist/chunks/{studio-f8jyp45j.js → studio-1pxvgx1t.js} +4 -4
- package/dist/chunks/studio-27tc8q0h.js +5 -0
- package/dist/chunks/studio-28pz4s1k.js +5 -0
- package/dist/chunks/{studio-x5esgzct.js → studio-36s6qjgq.js} +4 -4
- package/dist/chunks/studio-4yztve2t.js +5 -0
- package/dist/chunks/{studio-x9sagq2d.js → studio-5fc0728f.js} +7 -7
- package/dist/chunks/{studio-7jazdy6y.js → studio-654fxcr0.js} +4 -4
- package/dist/chunks/studio-6exg5z4x.js +4 -0
- package/dist/chunks/studio-6k1eswp9.js +5 -0
- package/dist/chunks/{studio-5wfrgee9.js → studio-6zyt56ek.js} +4 -4
- package/dist/chunks/studio-7djymzt2.js +5 -0
- package/dist/chunks/{studio-b4epb26c.js → studio-7w04zw8h.js} +7 -7
- package/dist/chunks/studio-805fwp9k.js +5 -0
- package/dist/chunks/{studio-k1eaqyzm.js → studio-81twpmzj.js} +4 -4
- package/dist/chunks/studio-891t1tv9.js +5 -0
- package/dist/chunks/{studio-5n1km79v.js → studio-9n2j9nqk.js} +4 -4
- package/dist/chunks/{studio-he2fhrgp.js → studio-9tkaykt5.js} +4 -4
- package/dist/chunks/studio-ant1zbp3.js +5 -0
- package/dist/chunks/studio-b29h7g7s.js +5 -0
- package/dist/chunks/studio-b5rxwkj2.js +5 -0
- package/dist/chunks/studio-d007j0z3.js +7 -0
- package/dist/chunks/studio-dknr8m7b.js +14 -0
- package/dist/chunks/{studio-eq27rrr0.js → studio-dmymvk2j.js} +3 -3
- package/dist/chunks/studio-dtmdjmqb.js +5 -0
- package/dist/chunks/studio-eb5sty2k.js +5 -0
- package/dist/chunks/{studio-hc9q4j24.js → studio-ebt49j3c.js} +5 -5
- package/dist/chunks/studio-eegyf5vg.js +5 -0
- package/dist/chunks/studio-frv7vjhw.js +5 -0
- package/dist/chunks/studio-ft8pfpp0.js +5 -0
- package/dist/chunks/{studio-mhhc9btt.js → studio-gj4j9e7k.js} +4 -4
- package/dist/chunks/{studio-hf4qdjc8.js → studio-gxna6yta.js} +4 -4
- package/dist/chunks/studio-je15p5v8.js +6 -0
- package/dist/chunks/{studio-21enxdr8.js → studio-jsr14n1s.js} +4 -4
- package/dist/chunks/studio-k9pwvmz8.js +5 -0
- package/dist/chunks/{studio-p1eggxcf.js → studio-ks0ecgjx.js} +3 -3
- package/dist/chunks/studio-mb8jhtr4.js +64 -0
- package/dist/chunks/studio-mf41717j.js +5 -0
- package/dist/chunks/{studio-625ezz59.js → studio-mm8x32gg.js} +4 -4
- package/dist/chunks/{studio-pkkw32j0.js → studio-n2e133d6.js} +4 -4
- package/dist/chunks/{studio-c4pnt1c6.js → studio-njmg0e73.js} +5 -5
- package/dist/chunks/studio-nvykrgbj.js +4 -0
- package/dist/chunks/studio-nw4q9sdn.js +5 -0
- package/dist/chunks/studio-p6avneaq.js +5 -0
- package/dist/chunks/studio-pvj970st.js +5 -0
- package/dist/chunks/studio-r7yeeqc4.js +5 -0
- package/dist/chunks/studio-s85vah66.js +6 -0
- package/dist/chunks/studio-sadckcpp.js +7 -0
- package/dist/chunks/studio-sgzss898.js +9 -0
- package/dist/chunks/{studio-7by9a93k.js → studio-t0v47dpc.js} +4 -4
- package/dist/chunks/{studio-jnb285we.js → studio-tj28pxa1.js} +4 -4
- package/dist/chunks/{studio-6j2jn55a.js → studio-tzs6njnb.js} +8 -8
- package/dist/chunks/studio-vz7b43ng.js +5 -0
- package/dist/chunks/studio-w8w9frjy.js +16 -0
- package/dist/chunks/{studio-xc8ebsts.js → studio-wr0pq67n.js} +4 -4
- package/dist/chunks/{studio-8r4y2x0z.js → studio-y164brht.js} +4 -4
- package/dist/chunks/studio-y17505ge.js +928 -0
- package/dist/chunks/studio-ymsjnvp9.js +5 -0
- package/dist/chunks/studio-z1vdxq0e.js +5 -0
- package/dist/chunks/studio-z47mm077.js +10 -0
- package/dist/chunks/studio-zkkdbbvd.js +9 -0
- package/dist/chunks/{studio-awqghqxv.js → studio-zkvyd3ev.js} +4 -4
- package/dist/chunks/{tsMode-rtwt7w1a.js → tsMode-eq26t9gs.js} +5 -5
- package/dist/chunks/workspace-emt8454d.js +4 -0
- package/dist/chunks/ws-client-3gxqp06s.js +4 -0
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +62 -59
- package/dist/studio.css +1 -1
- package/dist/studio.js +115 -117
- package/package.json +5 -5
- package/src/account/action-flow.ts +294 -0
- package/src/account/action-required.ts +68 -0
- package/src/account-status.ts +29 -1
- package/src/browse/library-model.ts +3 -1
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +3 -1
- package/src/canvas/asset-resolve.ts +79 -1
- package/src/canvas/iframe-entry.ts +38 -1
- package/src/canvas/iframe-host.ts +85 -0
- package/src/canvas/iframe-protocol.ts +13 -0
- package/src/files/asset-versions.ts +294 -0
- package/src/files/files.ts +61 -9
- package/src/files/fs-events.ts +279 -28
- package/src/files/media-meta.ts +2 -1
- package/src/files/media-paths.ts +5 -2
- package/src/files/media-upload.ts +5 -1
- package/src/new-project/add-repo-modal.ts +12 -1
- package/src/new-project/new-project-modal.ts +12 -1
- package/src/panels/git-panel.ts +25 -2
- package/src/platform-errors.ts +61 -1
- package/src/platforms/cloud.ts +389 -50
- package/src/platforms/devserver.ts +17 -1
- package/src/publish/pages-service.ts +17 -7
- package/src/services/ai-models.ts +30 -6
- package/src/services/ai-system-prompt.ts +81 -51
- package/src/settings/preferences-accounts.ts +42 -3
- package/src/settings/preferences-dialog.ts +8 -1
- package/src/studio.ts +18 -1
- package/src/surfaces/dialog.ts +5 -0
- package/src/surfaces/welcome.json +86 -1
- package/src/surfaces/welcome.ts +61 -2
- package/src/types.ts +84 -2
- package/src/ui/ai-managed-connect.ts +41 -4
- package/src/ui/media-picker.ts +2 -1
- package/dist/chunks/adapter-bsbs78x9.js +0 -4
- package/dist/chunks/cf-account-picker-gnm7xeqb.js +0 -4
- package/dist/chunks/cf-settings-9y6jyscp.js +0 -4
- package/dist/chunks/components-s51h3b7c.js +0 -4
- package/dist/chunks/content-source-ty3be0qg.js +0 -4
- package/dist/chunks/convert-to-repeater-c3e7q61z.js +0 -4
- package/dist/chunks/editor-t002b41m.js +0 -4
- package/dist/chunks/entry-commands-sb72e9gy.js +0 -4
- package/dist/chunks/extension-sections-ktn2ntnj.js +0 -4
- package/dist/chunks/file-ops-78zeytkm.js +0 -4
- package/dist/chunks/files-gatzrz8v.js +0 -4
- package/dist/chunks/format-host-r59b1651.js +0 -4
- package/dist/chunks/fs-events-f8h91ndt.js +0 -4
- package/dist/chunks/git-panel-y12zf7nj.js +0 -4
- package/dist/chunks/grid-view-rfd8b2pg.js +0 -51
- package/dist/chunks/grid-view-tafenfm2.css +0 -1
- package/dist/chunks/iframe-host-vsrsj20g.js +0 -4
- package/dist/chunks/index-5aghyrfh.js +0 -4
- package/dist/chunks/jx-validate-653krkrf.js +0 -4
- package/dist/chunks/layers-32p8gtae.js +0 -4
- package/dist/chunks/layers-panel-rs58m105.js +0 -4
- package/dist/chunks/lit-html-54bmkwz3.js +0 -4
- package/dist/chunks/media-picker-5bb04wct.js +0 -4
- package/dist/chunks/menu-cbha7w2e.js +0 -4
- package/dist/chunks/monaco-buffer-9vbbyfr1.js +0 -4
- package/dist/chunks/notify-dc1nz5ar.js +0 -4
- package/dist/chunks/platform-2m49s1zf.js +0 -4
- package/dist/chunks/publish-panel-nx3ycmma.js +0 -4
- package/dist/chunks/quick-search-yzrzh9x3.js +0 -4
- package/dist/chunks/references-vx7mbj9f.js +0 -4
- package/dist/chunks/right-panel-7jzpbxja.js +0 -4
- package/dist/chunks/section-registry-gjryse41.js +0 -4
- package/dist/chunks/studio-3znfhcxg.js +0 -5
- package/dist/chunks/studio-58qam27v.js +0 -4
- package/dist/chunks/studio-6j59fwaw.js +0 -5
- package/dist/chunks/studio-7z69g1gx.js +0 -5
- package/dist/chunks/studio-93j3v6zx.js +0 -5
- package/dist/chunks/studio-9gf6v8zy.js +0 -5
- package/dist/chunks/studio-9rhmettf.js +0 -4
- package/dist/chunks/studio-ac5aq677.js +0 -10
- package/dist/chunks/studio-as65vbns.js +0 -5
- package/dist/chunks/studio-bkv0sga4.js +0 -6
- package/dist/chunks/studio-bttmqef4.js +0 -5
- package/dist/chunks/studio-c3y9d41k.js +0 -5
- package/dist/chunks/studio-ccegp7gz.js +0 -9
- package/dist/chunks/studio-chxabn98.js +0 -6
- package/dist/chunks/studio-cktcdsxz.js +0 -16
- package/dist/chunks/studio-cnspfke5.js +0 -5
- package/dist/chunks/studio-de3p1ktm.js +0 -5
- package/dist/chunks/studio-fsbcn530.js +0 -928
- package/dist/chunks/studio-gftga7a3.js +0 -64
- package/dist/chunks/studio-hf1rpcq0.js +0 -4
- package/dist/chunks/studio-hz02hq70.js +0 -5
- package/dist/chunks/studio-jsv3s3s1.js +0 -5
- package/dist/chunks/studio-ks7cksh0.js +0 -5
- package/dist/chunks/studio-nptx0dbs.js +0 -5
- package/dist/chunks/studio-pg0z7k98.js +0 -5
- package/dist/chunks/studio-pve0b2f2.js +0 -5
- package/dist/chunks/studio-q7zmjv3b.js +0 -6
- package/dist/chunks/studio-rpmvw7kj.js +0 -5
- package/dist/chunks/studio-rwhss52s.js +0 -5
- package/dist/chunks/studio-sbg3g3h0.js +0 -5
- package/dist/chunks/studio-sq1bn60g.js +0 -14
- package/dist/chunks/studio-vwz7rma2.js +0 -5
- package/dist/chunks/studio-wa55e8gf.js +0 -5
- package/dist/chunks/studio-x0mzdha2.js +0 -5
- package/dist/chunks/studio-xrgpakvc.js +0 -9
- package/dist/chunks/studio-xt3djk1w.js +0 -7
- package/dist/chunks/studio-yh3nggx1.js +0 -7
- package/dist/chunks/studio-zmecp6hq.js +0 -5
- package/dist/chunks/workspace-g6dvaete.js +0 -4
- package/dist/chunks/ws-client-shf41j5p.js +0 -4
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{tt}from"./studio-eq27rrr0.js";import{te}from"./studio-ery42sqr.js";import{ne}from"./studio-sq1bn60g.js";import{T,R,rn,kc,On}from"./studio-zmecp6hq.js";import{v,Yi,S}from"./studio-9rhmettf.js";import{f,et}from"./studio-jsv3s3s1.js";import{qt,Ld,za,vp,js,yp,Zt,Wa}from"./studio-de3p1ktm.js";import{Ma}from"./studio-k1eaqyzm.js";import{ku,$E,DE,Ds}from"./studio-rwhss52s.js";import{un,$o,Ou,gL,lp,px,An,g,Bu,Dl,Ha,No,IC,ci,mm,hv}from"./studio-ks7cksh0.js";import{_t,Er,zr}from"./studio-jnb285we.js";import{ls,ET,IT,jb,ds,Hb}from"./studio-cktcdsxz.js";import{oa}from"./studio-xrgpakvc.js";import{Gn}from"./studio-c4pnt1c6.js";import{Tl}from"./studio-8r4y2x0z.js";import{mr,Ps,Fs,hs}from"./studio-b4epb26c.js";import{Yg,Jh,Yh,lw,Zk,Mf}from"./studio-sbg3g3h0.js";import{bc,Wb,ja}from"./studio-x0mzdha2.js";import{gE,l1}from"./studio-ac5aq677.js";import{$t}from"./studio-p1eggxcf.js";import{RE,kr,Uf,qf}from"./studio-6j59fwaw.js";import{Gg,Kg,Jg}from"./studio-mhhc9btt.js";import{na}from"./studio-93j3v6zx.js";import{D,Ol,vt}from"./studio-73czgk6a.js";import{me}from"./studio-7gqyhjns.js";async function $f(){if(Yg(location.search))return!1;let e=f();if(!e.dependenciesNeedInstall||!e.installDependencies)return!1;let t=!1;try{t=await e.dependenciesNeedInstall()}catch{return!1}if(!t)return!1;let n=oa({status:"Running bun install…",title:"Installing dependencies"});try{let o=await e.installDependencies();if(o.ok)return n.done(),!0;n.fail(o.log??"bun install failed")}catch(o){n.fail(o instanceof Error?o.message:String(o))}return!1}var qe=["page","component"],Be={components:"component",pages:"page"};function _(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ge(e){let t=_(e).toLowerCase();for(let[n,o]of Object.entries(Be))if(t.startsWith(`${n}/`))return o;return null}function ee(e){return qe.some((t)=>e.includes(t))}function Ke(e){let t=D?.projectConfig?.layout;if(typeof t!=="string")return!1;return _(t).toLowerCase()===_(e).toLowerCase()}function ge(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let n of Wa(e)){let o=js(n,"parse");if(o&&js(n,"serialize"))t.push({ext:n,label:`${o.name} (${n})`})}return t}function we(){return new Set([".json",...vp().flatMap((e)=>e.extensions)])}function ew(e){if(e===null||e===void 0||e==="")return[];let t=Ge(e);if(t===null||Ke(e)||px(e))return[];let n=Zt(e);if(!(n?Boolean(n.capabilities.parse)&&ee(n.documentKinds):_(e).toLowerCase().endsWith(".json")))return[];let r=[];if(n)r.push({ext:".json",label:"JSON (.json)"});for(let a of Wa()){let i=js(a,"serialize");if(!i||i.name===n?.name||!ee(i.documentKinds)||!i.documentKinds.includes(t))continue;r.push({ext:a,label:`${i.name} (${a})`})}return r}function zk(){let e=new Set([".json"]);for(let t of vp()){if(!t.capabilities.serialize||!ee(t.documentKinds))continue;for(let n of t.extensions)e.add(n)}return[...e].toSorted()}var oe="jx-studio-recent-projects",ye="jx-studio-recent-files",ve=8,Ye=10,M=[];function V(){if(!et())return null;let e=f();return e.getRecentProjects&&e.saveRecentProjects?e:null}function Qe(){try{let e=localStorage.getItem(oe);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function re(){return V()?M:Qe()}function be(e){M=e;let t=V();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(oe,JSON.stringify(e))}catch{}}async function Wk(){let e=V();if(!e)return;try{M=await e.getRecentProjects()}catch{M=[]}}function Ug(){return re().toSorted((e,t)=>t.timestamp-e.timestamp)}function qg(e,t){let n=re().filter((o)=>o.root!==t);if(n.unshift({name:e,root:t,timestamp:Yi()}),n.length>ve)n.length=ve;be(n)}function tw(e){be(re().filter((t)=>t.root!==e))}function Vk(){M=[];let e=V();if(e)e.saveRecentProjects([]);else localStorage.removeItem(oe)}function xe(){try{let e=localStorage.getItem(ye);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Uk(e){let t=xe().toSorted((n,o)=>o.timestamp-n.timestamp);return e==null?t:t.filter((n)=>n.root===e)}function Df(e){let t=xe().filter((r)=>!(r.root===e.root&&r.path===e.path));t.unshift({name:e.name,path:e.path,root:e.root,timestamp:Yi()});let n=new Map,o=[];for(let r of t.toSorted((a,i)=>i.timestamp-a.timestamp)){let a=(n.get(r.root)??0)+1;if(n.set(r.root,a),a<=Ye)o.push(r)}localStorage.setItem(ye,JSON.stringify(o))}var Pe={$schema:"https://jxsuite.com/schema/v1",$id:"StudioFilesPanel",$description:'The Navigator\'s Files tree, as a Jx document over the kit. `files/files.ts` keeps every decision — which directories are listed, which entries `.gitignore` masks, which rows the window draws, what a click on a row means, what the context menu offers and what each verb does to the filesystem — and hands this document one projection: a word saying which of three things to draw, a toolbar whose state is already resolved, and rows whose every field is already a string. Nothing here asks what a file is, how tall the Navigator is, or whether a directory has been read. THE TREE IS `jx-tree`, and that is what this document no longer says: `role="tree"`, `role="treeitem"`, `aria-level`, `aria-posinset`, `aria-setsize`, the roving `tabindex` and the five arrow-key cases were each written out here and written out again in `panel-outline.json`, two copies of one keyboard contract with nothing holding them in agreement. The element owns all of it; what is left here is what this tree IS — a flat projection of rows, each already carrying its own level and set counts, because the DOM holds a WINDOW onto the model and an expanded `node_modules` is eleven rows rather than ten thousand. The window reaches the element as `padtop`/`padbottom`, and a caret move past either comes back as `move` for the flow to scroll and repaint. Four facts a row carries are bound against ONE scope field each — the current path, the selected path, the dragged path and the drop target — so moving the caret or dragging a file re-evaluates an attribute per drawn row instead of rebuilding the list under the reader\'s pointer. The pragmatic-drag-and-drop handles are an ISLAND: the document draws the rows and the tree, and the adapter attaches sources and targets to them through `onNodeCreated` (specs/studio-ui-guidelines.md §9.4).',tagName:"div",attributes:{part:"files"},style:{$description:"What the twenty `.file-tree*`, `.files-toolbar`, `.project-header` and `.project-name` rules in `styles/panels.css` said, keyed on `part` and re-pointed at the studio token layer. Three names could not come with the declarations. The five `var(--spectrum-font-size-50 | -75, …)` reads are the kit's `--jx-text-sm` and `--jx-text-md`, which are the same 11px and 12px — a `--spectrum-*` name is declared by `<sp-theme>` and by nothing else in this package, so a document that reads one is a document whose type size changes when a component it does not use is removed. The `.selected`, `.dragging`, `.drag-over` and `.drag-over-root` classes are `data-` attributes on a part, because a part is the handle now and because a state a handler adds and forgets to take off is exactly the defect a cancelled drag used to leave on screen. MOST OF THE ROW'S OWN RULES ARE GONE, and that is the point of the element rather than an omission: `jx-tree-item` declares the flex line, the one-control-height box the window reserves scroll by, the indent (`--jx-tree-indent` times one less than `level` — exactly the `8 + depth * 16` this file composed per row), the hover and focus states, the selected wash and the faded dragged row. What is left here is what is TRUE OF THIS TREE and not of trees in general: it owns its own scrollbar, a click on a row opens it, and the row a drag is over wears the drop mark this file draws.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"The two states that are not a tree. They are two states and not one sentence: a window with no project at all and a monorepo root that has not been pointed at a site are different situations, and only the second has anything to offer (studio-ui-guidelines.md §11).",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="empty"] p':{margin:"0"},'& [part="frame"]':{display:"flex",flexDirection:"column",height:"100%",minHeight:"0"},'& [part="project-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="project-name"]':{fontSize:"var(--jx-text-md)",fontWeight:"600",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="toolbar"]':{display:"flex",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-3)",borderBottom:"1px solid var(--border)",alignItems:"center",flexShrink:"0"},'& [part="search"]':{flex:"1",minWidth:"0"},'& [part="tree"]':{$description:"The scroller as well as the list. `ui/virtual-window.ts` walks up from the element it is given looking for the nearest thing that scrolls, and finding itself is the shortest answer — which is why the element declares no `overflow` of its own and leaves the question to the two trees that answer it differently. The colour is re-declared because `jx-tree` sets `--jx-fg` on itself, and this panel's text colour is the studio alias of it.",flex:"1",minHeight:"0",overflowY:"auto",color:"var(--fg)"},'& [part="tree"][data-drop="true"]':{background:"var(--hover-bg)"},'& [part="row"]':{$description:"What the element does not decide. A click on a row OPENS it here — a directory unfolds, a file takes a tab — so the pointer is a pointer rather than the element's default arrow; and the gap is the wider one this tree has always drawn between a 16px file glyph and its name.",gap:"var(--jx-space-3)",cursor:"pointer"},'& [part="loading-row"]':{$description:"A directory whose listing has not arrived yet. It holds the place and it is NOT a row: it is not a `jx-tree-item`, so the caret cannot land on it, the set counts do not include it and typeahead cannot match it — and it is replaced by the real rows on the repaint the listing provokes. It draws the same box by hand because it is the only line in this tree the element does not draw, and a placeholder of a different height would desynchronise the window's scroll reservation from the rows it reserves for.",display:"flex",alignItems:"center",boxSizing:"border-box",blockSize:"var(--jx-control-h)",paddingInline:"calc(var(--jx-space-3) + var(--depth, 0) * 16px) var(--jx-space-3)",color:"var(--fg-dim)",fontStyle:"italic",cursor:"default",userSelect:"none",whiteSpace:"nowrap"},'& [part="row-icon"]':{flexShrink:"0",display:"flex",alignItems:"center","--jx-icon-size":"16px"},'& [part="locale"]':{$description:"The language chip. Deliberately declares no block size, no padding and no line height: the row above is one control-height by contract, and a chip that grew the box would desynchronise the window's scroll reservation from the height it reserves by. It only ever shrinks the text. A chip, not a filter term: the search matches the file's name alone, because a query that silently also matched a language would make “why is this file here” unanswerable from what is on screen.",marginInlineStart:"auto",flexShrink:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxInlineSize:"6em"},'& [part="view-slot"], & [part="header-slot"], & [part="locale-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{none:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"No project loaded"}]},welcome:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Open a project folder to get started."},{tagName:"jx-button",attributes:{part:"open-project"},$props:{variant:"accent",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openProject"},value:[]}],description:"The declared `project.open` command, run through the registry — not a second opener of this surface's own. It is the one the chord, the palette and the status bar's PROJECT field already run, so a window that opens a project from here reports the outcome the same way they do (studio-ui-guidelines.md §12.5)."},children:[{tagName:"span",textContent:"Open Project"}]}]},tree:{tagName:"div",attributes:{part:"frame"},children:[{tagName:"div",attributes:{part:"header-slot",role:"none"},$switch:{$ref:"#/state/headerState"},cases:{shown:{tagName:"div",attributes:{part:"project-header"},children:[{tagName:"span",attributes:{part:"project-name",title:"${state.projectName}"},textContent:"${state.projectName}"}]}}},{tagName:"div",attributes:{part:"toolbar"},children:[{$description:"A row of quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, which is the segmented look a choice wants and not the borderless one a toolbar wants; Spectrum's group here was `compact quiet`, a combination the kit spells as compact=false with its members' default quiet.",tagName:"jx-action-group",attributes:{part:"toolbar-actions"},$props:{compact:!1,label:"File tree actions"},children:[{tagName:"jx-action-button",attributes:{part:"new-file"},$props:{size:"sm",icon:"plus",label:"New File",hint:"New File"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newFile"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{size:"sm",icon:"arrows-clockwise",label:"Refresh",hint:"Refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}],description:"The rules go with the listings. Refresh is what an author reaches for after editing a `.gitignore` by hand, and a tree that came back still hiding by the old rules would read as the button not having worked."}},{tagName:"jx-action-button",attributes:{part:"show-ignored"},$props:{size:"sm",icon:{$ref:"#/state/ignoredIcon"},label:{$ref:"#/state/ignoredLabel"},hint:{$ref:"#/state/ignoredLabel"},selected:{$ref:"#/state/ignoredSelected"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleIgnored"},value:[]}],description:"A repaint and nothing else: the ignored entries were never dropped from the cached listings, only from the rows built out of them."}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"Filter files",placeholder:"Filter files…",size:"sm",value:{$ref:"#/state/query"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}],description:"The query matches a file's NAME and nothing else. A directory is kept whatever it says, because hiding the folder a match sits in would leave the match with nowhere to be drawn."}}]},{$description:'The `role="tree"`, and everything that used to be spelled out under it. The element writes the role, the name, the roving tab stop and every row\'s `aria-level` / `aria-posinset` / `aria-setsize`, and it owns the whole ARIA keyboard: the arrows walk the drawn rows without wrapping, `Home` and `End` reach the ends of the MODEL by way of the pads, `ArrowRight` opens a directory and steps into an open one, `ArrowLeft` closes one and otherwise steps out to its parent, `Enter` activates and a printable character is typeahead. Every chord it does not own — cut, copy, paste, delete, rename — passes straight through to the flow, which is the WCAG 2.5.7 obligation this tree carries because dragging a file is the other way to move it. What reaches this document is five events, and each of them is a decision `files.ts` already owned.',tagName:"jx-tree",attributes:{part:"tree",label:"Project files",current:"${state.currentPath}",padtop:"${state.padTop}",padbottom:"${state.padBottom}","data-drop":"${state.rootDrop || null}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"event#/detail/value"}]}],description:"The reader meant that row. This tree is single-select, so the element resolves every modifier to `replace` before it gets here and the detail's `mode` and `anchor` are answers to a question this tree does not ask. There is no `change` handler beside it on purpose: the element OWNS the caret and keeps it across every repaint that does not change `current`, so a second copy of it in the flow would be a variable that only ever went stale."},onactivate:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}],description:"`Enter` or a double click. The same verb a single click reaches, by the same name."},onexpand:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/expand"},value:[{$ref:"event#/detail/value"},{$ref:"event#/detail/expanded"}]}],description:"`ArrowRight`, `ArrowLeft` or the twisty, with ONE dispatcher between them: the detail says the state the row should be PUT INTO, so the flow never has to work out which way a toggle was going."},onmove:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/key"}]}],description:"The caret has to reach a row the window did not draw. The element knows only that the pad on that side is not zero; where the row is in the model, and how far to scroll to bring it into view, is the flow's — which is why this is an event and not a `scrollIntoView`."},ontypeahead:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/typeahead"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/char"}]}],description:"A printable character, on a windowed tree. The same hand-off as `onmove` and for a sharper reason: a move off the end of the slice announces itself, and a letter never does — the element's own search over the drawn rows always answers, and over a `node_modules` of ten thousand entries the answer is whichever of the eleven painted rows happened to start with that letter. So the element dispatches EVERY such character and the flow answers it over the model."},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{item:{tagName:"jx-tree-item",attributes:{part:"row",value:"${$map.item.path}",label:"${$map.item.name}",level:"${$map.item.level}",posinset:"${$map.item.posInSet}",setsize:"${$map.item.setSize}",expanded:"${$map.item.ariaExpanded}",selected:"${state.selectedPath === $map.item.path ? 'true' : 'false'}","data-type":"${$map.item.type}","data-dragging":"${state.dragPath === $map.item.path ? '' : null}","data-drop":"${state.dropPath === $map.item.path ? '' : null}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"$map/item/path"}]}],description:"A single click OPENS the row, which is this tree's own answer and not the element's. `jx-tree` answers a click with `change` and `select`, exactly as it answers an arrow key, and a tree that opened on `select` would open every file the reader arrowed past. So the opening verb is bound here, where a click is a click; what a click MEANS — unfold this directory, take a tab for that file — stays the flow's, and Enter reaches the same verb through `activate`. It does NOT stop the event, which is the correction: the tree's delegated click is what moves the caret and the selection onto the row, so a `stopPropagation` here would leave a reader who clicked a folder with the tab stop still on whatever they had open last. The twisty stops its own click, so opening a directory from the chevron does not also activate the row."},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon",part:"row-icon","aria-hidden":"true"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"div",attributes:{slot:"status",part:"locale-slot",role:"none"},$switch:{$ref:"$map/item/localeState"},cases:{shown:{tagName:"span",attributes:{part:"locale"},textContent:"${$map.item.locale}"}}}]},loading:{$description:"A directory whose listing has not arrived yet. Deliberately not a `jx-tree-item`: there is no file there to select, open, rename or drag, and a row the caret could land on that answers to none of the verbs the caret offers is a stop in the walk with nothing behind it.",tagName:"div",attributes:{part:"loading-row",role:"none","data-loading":"true",style:"--depth:${$map.item.depth}"},textContent:"Loading…"}}}}]}]}}}]};T("files-panel",Pe);function Fe(e,t){e.view=t.view,e.headerState=t.headerState,e.projectName=t.projectName,e.query=t.query,e.ignoredLabel=t.ignoredLabel,e.ignoredIcon=t.ignoredIcon,e.ignoredSelected=t.ignoredSelected,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.selectedPath=t.selectedPath,e.dragPath=t.dragPath,e.dropPath=t.dropPath,e.rootDrop=t.rootDrop,e.currentPath=t.currentPath}function J(){return{currentPath:"",dragPath:"",dropPath:"",headerState:"hidden",ignoredIcon:"eye-slash",ignoredLabel:"Show ignored files",ignoredSelected:!1,padBottom:0,padTop:0,projectName:"",query:"",rootDrop:"",rows:[],selectedPath:"",view:"none"}}function Ze(e){let t=typeof e==="string"?void 0:e.attributes?.part;return typeof t==="string"?t:""}function nt(e){let n=e?.$map?.item;return typeof n?.path==="string"?n:null}function je(e,t,n){let o=v({...J(),...n});Fe(o,t);let r=null,a=!1,i=R("files-panel",o,e,{onNodeCreated:(s,l,c,d)=>{if(a||!(s instanceof HTMLElement))return;let F=Ze(c);if(F==="tree"){n.treeHost(s);return}if(F!=="row")return;let y=nt(d);if(y)n.rowHost(s,y.path,y.type)}}).then((s)=>{if(a){s.dispose();return}r=s});return{connected:()=>!a&&(r===null||r.root.parentNode===e),dispose(){a=!0,r?.dispose(),r=null},ready:i,update:(s)=>{Fe(o,s)}}}async function Lo(e){if(!D)return;try{let t=f(),[n]=await Promise.all([t.listDirectory(e),$E(e)]);D.dirs.set(e,n)}catch{D.dirs.set(e,[])}}function pe(){return Er(_t.showIgnoredFiles)==="true"}function ot(e){zr(_t.showIgnoredFiles,e?"true":"")}async function O_(){try{let e=f(),t=await e.probeRootProject();if(!t)return;let{meta:n,info:o}=t;if(Ld(),qt(),za(e),ku(),Ol({dirs:new Map,expanded:new Set,isSiteProject:o.isSiteProject,name:o.isSiteProject?o.projectConfig?.name||n.name:n.name,projectConfig:(o.isSiteProject?o.projectConfig:null)||null,projectDirs:o.directories||[],projectRoot:".",root:n.root,searchQuery:"",selectedPath:null}),o.isSiteProject)Ha(n.root||".",o.projectConfig||null);if(o.isSiteProject){if(qg(vt().name,n.root),await Yh(),await $f())Ld(),await qt(),za(e);await Lo("."),await Tl(),await Af(),Jh(n.root)}}catch{}}async function M_({renderLeftPanel:e}){try{let t=f(),n=await t.openProject();if(!n)return!1;let{config:o,handle:r}=n;if(IC({document:{children:[],tagName:"div"},id:"initial"}),RE(),Ld(),qt(),za(t),ku(),Ol({...D,dirs:new Map,expanded:new Set,isSiteProject:!0,name:o.name||r.name,projectConfig:o,projectRoot:r.root,searchQuery:"",selectedPath:null}),Ha(r.root,o),await Yh(),await $f())Ld(),await qt(),za(t);await Lo("."),await Tl();let a=new Set(["pages","layouts","components","content","data","public","styles"]),i=vt().dirs.get(".")||[],s=[];for(let l of i)if(l.type==="directory"&&a.has(l.name))s.push(l.name),vt().expanded.add(l.path||l.name),await Lo(l.path||l.name);return vt().projectDirs=s,Mf(),Hb(),ds("files"),qg(vt().name,vt().projectRoot),e(),await Af(),Jh(vt().projectRoot),!0}catch(t){return S.error("Could not open the project.",{detail:te(t),source:"Open Project"}),!1}}async function P_(e){let t=f();if(t.createDestination!=="path")return!1;try{if(await t.activate(e),(await t.gitStatus()).isRepo)return!1;return await t.gitInit(),S.success("Initialized a git repository for this project."),!0}catch(n){return S.warn("Could not initialize a git repository — the project itself was written.",{detail:te(n),source:"Source Control"}),!1}}async function nw(){await qt();let e=[...Wa("page"),".json"],t;try{t=await f().listDirectory("pages")}catch{return null}let n=new Set(t.filter((o)=>o.type==="file").map((o)=>o.name));for(let o of e)if(n.has(`index${o}`))return`pages/index${o}`;return null}async function rt(){let e=await nw();if(e)await Io(e)}async function Af(){let e=IT(g.projectRoot);if(jb(g.projectRoot),e){if(await ET(e,{ensureSecondPane:()=>{Dl(An)},openFile:(n,o)=>Io(n,{focus:!1,paneId:o})})>0)return!0}return await rt(),!1}function at(e,t,n){if(t==="directory")return n?"folder-open":"folder";let o=e.split(".").pop()?.toLowerCase();switch(o){case"css":case"js":case"json":case"ts":return"file-code";case"md":return"file-text";default:return o!==void 0&&Wb(o)?"image":"file"}}function F_(){return tt}function j_(e){}var it=24,p=[],A=null,L=new Map,B=null,Se=null;function ue(){for(let e of L.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return it}function st(){for(let[e,t]of L)if(!t.isConnected)L.delete(e),Oe(t)}function Re(e){let t=L.get(e);return t?.isConnected===!0?t:null}function X(e){return p.find((t)=>!t.loading&&t.path===e)}function ke(e,t,n,o){let r=vt().dirs.get(e);if(!r){Lo(e).then(()=>u()),n.push({depth:t,expanded:!1,key:`loading:${e}`,loading:!0,name:"Loading…",path:e,posInSet:1,setSize:1,type:"file"});return}let a=[...r].toSorted((c,d)=>{if(c.type==="directory"&&d.type!=="directory")return-1;if(c.type!=="directory"&&d.type==="directory")return 1;return c.name.localeCompare(d.name)}),i=pe()?a:a.filter((c)=>!DE(e,c.path,c.type==="directory")),s=vt().searchQuery.toLowerCase(),l=s?i.filter((c)=>c.type==="directory"||c.name.toLowerCase().includes(s)):i;for(let[c,d]of l.entries()){let y=d.type==="directory"&&vt().expanded.has(d.path);if(n.push({depth:t,expanded:y,key:d.path,loading:!1,name:d.name,path:d.path,locale:Ou(d.path,o)??void 0,posInSet:c+1,setSize:l.length,type:d.type}),y)ke(d.path,t+1,n,o)}}function Ee(e){return e===void 0?-1:p.findIndex((t)=>!t.loading&&t.path===e)}function U(e,t){for(let n=e+t;n>=0&&n<p.length;n+=t)if(!p[n].loading)return n;return-1}function lt(e){let t=p[e];if(!t)return-1;for(let n=e-1;n>=0;n--){let o=p[n];if(!o.loading&&o.depth<t.depth)return n}return-1}function ct(){if(A?.isConnected!==!0||O!=="")return;queueMicrotask(u)}function ie(){let e=A;if(e===null)return;B=Jg(B,e,{count:()=>p.length,onChange:ct,rowHeight:ue})}function dt(e){let t=String(e.depth+1);if(e.loading)return{ariaExpanded:"",depth:String(e.depth),icon:"",key:e.key,kind:"loading",level:t,locale:"",localeState:"hidden",name:e.name,path:e.path,posInSet:"",setSize:"",type:e.type};return{ariaExpanded:e.type==="directory"?String(e.expanded):"",depth:String(e.depth),icon:at(e.path,e.type,e.expanded),key:e.key,kind:"item",level:t,locale:e.locale===void 0?"":un(e.locale),localeState:e.locale===void 0?"hidden":"shown",name:e.name,path:e.path,posInSet:String(e.posInSet),setSize:String(e.setSize),type:e.type}}function pt(){if(st(),!D){p=[];let s={...J(),view:"none"};return P=s,s}if(!D.isSiteProject&&D.projectRoot==="."){p=[];let s={...J(),view:"welcome"};return P=s,s}let e=vt();p=[];let{i18n:t}=$o(e.projectConfig??{});ke(".",0,p,t);let n=Gg(A,{count:p.length,rowHeight:ue()}),o=p.slice(n.start,n.end),r=(e.selectedPath!==null&&X(e.selectedPath)?e.selectedPath:"")||o.find((s)=>!s.loading)?.path||"",a=pe(),i={currentPath:r,dragPath:O,dropPath:W,headerState:e.isSiteProject?"shown":"hidden",ignoredIcon:a?"eye":"eye-slash",ignoredLabel:a?"Hide ignored files":"Show ignored files",ignoredSelected:a,padBottom:n.padBottom,padTop:n.padTop,projectName:e.projectConfig?.name||e.name,query:e.searchQuery,rootDrop:Z,rows:o.map((s)=>dt(s)),selectedPath:e.selectedPath??"",view:"tree"};return P=i,i}function se(){if(!w||!P)return;P={...P,dragPath:O,dropPath:W,rootDrop:Z},w.handle.update(P)}function u(){Se?.()}async function ut(){let e=vt();e.dirs.clear(),ku(),await Lo(".");for(let t of e.expanded)await Lo(t);u()}function ft(e){let t=X(e);if(!t)return;if(t.type==="directory"){Ne(e).then(()=>u());return}Io(e)}function ht(e,t){let n=vt();if(X(e)?.type!=="directory"||n.expanded.has(e)===t)return;if(!t){n.expanded.delete(e),u();return}Ne(e).then(()=>u())}function Te(e){if(!D||vt().selectedPath===e)return;vt().selectedPath=e,u()}function mt(e,t){let n=Ee(e),o;switch(t){case"Home":{o=U(-1,1);break}case"End":{o=U(p.length,-1);break}case"ArrowUp":{o=U(n,-1);break}case"ArrowLeft":{o=lt(n);break}case"ArrowDown":case"ArrowRight":{o=U(n,1);break}default:return}De(o)}function gt(e,t){let n=Ee(e),o=p.length;for(let r=1;r<=o;r++){let a=(n+r+o)%o,i=p[a];if(i&&!i.loading&&i.name.trim().toLowerCase().startsWith(t)){De(a);return}}}function De(e){let t=p[e];if(!t)return;if(Te(t.path),Re(t.path))return;Kg(A,e,ue()),u()}async function Ne(e){let t=vt();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await Lo(e)}var z=new Map,G=null,O="",K="",W="",Y=!1,Z="";function wt(e){return[...e.dataTransfer?.types??[]].includes("Files")}function Ce(e,t,n){let o=(i)=>{if(!wt(i))return;if(i.preventDefault(),i.stopPropagation(),i.dataTransfer)i.dataTransfer.dropEffect="copy";n(!0)},r=()=>n(!1),a=(i)=>{n(!1);let s=i.dataTransfer?.files;if(!s?.length)return;i.preventDefault(),i.stopPropagation(),Le(s,t,u)};return e.addEventListener("dragover",o),e.addEventListener("dragleave",r),e.addEventListener("drop",a),()=>{e.removeEventListener("dragover",o),e.removeEventListener("dragleave",r),e.removeEventListener("drop",a)}}function le(e,t){let n=e.replaceAll("\\","/"),o=t.replaceAll("\\","/");if(!n||n===o)return!1;if(n.startsWith(`${o}/`)||o.startsWith(`${n}/`))return!1;return Q(n)!==o}function ae(e,t,n){return n==="directory"&&typeof e==="string"&&le(e,t)}function I(e,t){let n=t?e:"";if(K===e&&W===n)return;K=e,W=n,Ie()}function q(e){if(Y===e)return;Y=e,Ie()}function Ie(){Z=Y&&K===""?"true":"",se()}async function Le(e,t,n){if((await ja([...e],{dir:t})).length===0)return;if(t!==".")vt().expanded.add(t);n()}function yt(e,t){let n=document.createElement("input");n.type="file",n.multiple=!0,n.accept=bc(),n.addEventListener("change",()=>{if(n.files?.length)Le(n.files,e,t)}),n.click()}function bt(e,t,n){Oe(e),L.set(t,e);let o=[hs({element:e,getInitialData(){return{entryType:n,path:t,type:"file-tree"}},onDragStart(){O=t,se()},onDrop(){O="",I("",!1),se()}}),Ce(e,n==="directory"?t:Q(t),(r)=>{I(r?t:"",r)}),Ps({canDrop({source:r}){return r.data.type==="file-tree"},element:e,getData({source:r}){return ae(r.data.path,t,n)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:r}){I(t,ae(r.data.path,t,n))},onDragEnter({source:r}){I(t,ae(r.data.path,t,n))},onDragLeave(){I("",!1)},onDrop(){I("",!1)}})];z.set(e,mr(...o))}function Oe(e){let t=z.get(e);if(t)t(),z.delete(e)}function xt(e){if(G?.element===e)return;Ae(),A=e;let t=Ps({canDrop({source:o}){return o.data.type==="file-tree"&&le(o.data.path,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){q(!0)},onDragLeave(){q(!1)},onDrop(){q(!1)}}),n=Fs({onDrop({source:o,location:r}){let[a]=r.current.dropTargets;if(!a)return;if(o.data.type!=="file-tree")return;if(a.data.type!=="file-tree-target")return;let i=o.data.path,s=a.data.targetDir;if(!le(i,s))return;let l=i.split("/").pop(),c=s==="."?l:`${s}/${l}`;Pt(i,c,u)}});G={cleanup:mr(t,n,Ce(e,".",q)),element:e},ie()}function Ae(){G?.cleanup(),G=null;for(let e of z.values())e();z.clear(),B?.window.destroy(),B=null,A=null,O="",K="",W="",Y=!1,Z=""}async function Pt(e,t,n){let o=f();Ds(e,t);try{let r=await o.renameFile(e,t);Ma();for(let[s]of g.tabs.entries())if(s===e)hv(e,t,t);else if(s.startsWith(`${e}/`)){let l=t+s.slice(e.length);hv(s,l,l)}let a=Q(e),i=Q(t);if(await Lo(a),i!==a)await Lo(i);if(i!==".")vt().expanded.add(i);ze(r,t),n(),qk(`Moved to ${t}`,r,t)}catch(r){S.error(`Could not move ${e}.`,{detail:te(r),path:e,source:"Files"})}}function Q(e){let t=e.replaceAll("\\","/"),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}var H=null;function Me(){H?.close(),H=null}function Ft(e){let t={};if(e.type==="directory"){let n=lp(e.path);if(n?.isSourceRoot===!0&&!n.fileBacked)t.name=n.name;return t}if(t.file=e.path,na(e.path))t.path=e.path;if(ew(e.path).length>0)t.source=e.path;return t}function k(e,t,n,o={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:n,title:t,...o}}function jt(e){let t=ne();if(!t)return[];let n=Ft(e),o=[];for(let r of t.forPlacement("context/file")){let a=r.args;if(!(a?.required??[]).every((l)=>(l in n)))continue;let i={};for(let l of Object.keys(a?.properties??{}))if(l in n)i[l]=n[l];let s=t.disabledReason(r.id);o.push(s===void 0?k(r.id,r.title,()=>{rn(t,r.id,i,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:r.id,requires:s,title:r.title})}return o}function St(e){let t=e.type==="directory",n=[];if(t){if(n.push(k("files.newFile","New File…",()=>{He(e.path,u)}),k("files.upload","Upload Files…",()=>{yt(e.path,u)})),e.path==="pages"||e.path.endsWith("/pages"))n.push(k("files.pagesGrid","Edit Pages in Grid",()=>{l1()}))}else n.push(k("files.open","Open",()=>{Io(e.path)}));return n.push(...jt(e),k("files.rename","Rename…",()=>{Ct(e,u)},{dividerAbove:!0}),k("files.delete","Delete",()=>{It(e,u)},{destructive:!0})),n}function Rt(e,t,n){let o=X(e);if(!o)return;Me();let r=Re(e);H=$t({label:"File actions",onClosed:(a)=>{if(H===a)H=null},opener:r,origin:{x:t,y:n},region:"files",rows:St({name:o.name,path:o.path,type:o.type})})}var kt=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2),E="__other__";function $e(e){return e.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function ce(e){let t=e.lastIndexOf(".");return t>0?e.slice(t):""}function Et(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${js(e.ext)?.name??e.ext} (${e.ext})`}]:ge(e.docKind)).map((n)=>({label:n.label,value:n.ext})),{dividerBefore:!0,label:"Other…",value:E}]}function Tt(e,t,n){let o=e.kind==="choose"?e.defaultExt:e.ext;if(o!==void 0&&t.some((a)=>a.value===o))return o;let r=ce(n);if(r!==""&&t.some((a)=>a.value===r))return r;return t[0]?.value??E}async function iw(e){let{dir:t,format:n,source:o="Files"}=e;await qt();let r=new Set;try{let m=await f().listDirectory(t);r=new Set(m.map((h)=>h.name.toLowerCase()))}catch{}let a=n!==void 0&&n.kind!=="fixed"?n:null,i=a===null?null:Et(a),s=a===null||i===null?"":Tt(a,i,e.suggestedName??""),l=(m,h)=>{let b=m.trim();if(n===void 0||h===E)return b;if(n.kind==="fixed"){let x=$e(b);return x===""?"":`${x}${n.ext}`}return b.toLowerCase().endsWith(h.toLowerCase())?b:`${b}${h}`},c=we(),d=(m,h)=>{let b=m.trim();if(!b)return n?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(n?.kind==="fixed"&&$e(b)==="")return"Enter at least one letter or number.";let x=b.replaceAll("\\","/");if(x.startsWith("/")||x.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(x.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(x.includes("/")&&n!==void 0&&h!==E)return`Pick Other… to create a file in a subfolder of ${t==="."?"the project root":t}.`;let j=ce(x);if(h!==""&&h!==E&&j!==""&&j.toLowerCase()!==h.toLowerCase()&&c.has(j.toLowerCase()))return`You picked ${i?.find((Ue)=>Ue.value===h)?.label??h}; this name ends in ${j}.`;if(n?.kind==="locked"&&h===E){if(j!==""&&j.toLowerCase()!==n.ext.toLowerCase()&&c.has(j.toLowerCase()))return n.because}let he=l(m,h);return r.has(he.toLowerCase())?`${he} already exists in ${t}/.`:""},F=s,y=await On(e.title??"New File",{...i===null?{}:{choice:{initial:s,label:"Format",onChange:(m)=>{F=m},options:()=>i}},confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,...e.suggestedName===void 0?{}:{placeholder:e.suggestedName},select:i===null?"stem":"all",validate:d,value:e.suggestedName??"untitled.json"});if(!y)return null;let N=l(y,F),C=t==="."?N:`${t}/${N}`;Ds(C);let fe=Zt(N),We=typeof e.content==="function"?await e.content(ce(N),N):e.content,_e=n!==void 0&&F!==E,Ve=We??fe?.studio?.newFileTemplate??(fe?"":N.toLowerCase().endsWith(".json")?_e?kt:`{}
|
|
2
|
-
`:"");try{return await f().writeFile(C,Ve),await Lo(t),S.success(`Created ${C}`),C}catch(m){return S.error(`Could not create ${C}.`,{detail:te(m),path:C,source:o}),null}}async function He(e,t){await qt();let n=lp(e);if(n?.unresolvedFormat!=null)S.error(`New files in ${e}/ cannot be constrained to the collection's format.`,{detail:`The "${n.name}" content type declares format "${n.unresolvedFormat}", which no installed extension provides. Install the extension that supplies it, or correct `+"the name in Project Settings › Content Types.",path:e,source:"Files"});let o=n?.ext!=null&&n.unresolvedFormat===null,r=o&&n.isSourceRoot&&n.def.schema!==void 0,a;if(r){let{createEntry:i}=await (me("sb72e9gy"),import("./entry-commands-sb72e9gy.js"));a=await i(n.name,{dir:e})}else a=await iw({dir:e,format:o&&n.ext!==null?{because:`${n.name} entries are ${n.ext} files, so a document of another format here would not be one.`,ext:n.ext,kind:"locked"}:{defaultExt:".json",kind:"choose"},suggestedName:"untitled"});if(a!==null)t()}async function Dt(e,t){let n=await qf(t);return On("Rename",{confirmLabel:"Rename",...n===void 0?{}:{message:n},select:"stem",validate:(o)=>o.trim()?"":"Enter a file name.",value:e})}function Nt(e,t){let n=t.references,o=t.tag?`; tag → <${t.tag.to}> (${t.tag.refsUpdated})`:"";if(n&&n.refsUpdated>0)return`Renamed to ${e}; updated ${n.refsUpdated} reference(s) in ${n.filesChanged} file(s)${o}`;if(o)return`Renamed to ${e}${o}`;return`Renamed to ${e}`}function qk(e,t,n){let o=t.errors??[];if(o.length===0){S.success(e);return}let r=o.length===1?"1 file":`${o.length} files`;S.warn(`${e} — references in ${r} could not be updated`,{detail:o.map((a)=>`${a.path}: ${a.error}`).join(`
|
|
3
|
-
`),path:n,source:"Files"})}function ze(e,t){for(let n of e.references?.files??[])if(n.path!==t&&g.tabs.has(n.path))Nf(n.path)}function de(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function kR(e,t,n){Ma();let o=de(e),r=de(t);if(await Lo(o),r!==o)await Lo(r);if(vt().selectedPath===e)vt().selectedPath=t;ze(n,t)}async function Ct(e,t){let n=await Dt(e.name,e.path);if(!n||n===e.name)return;let o=de(e.path),r=o==="."?n:`${o}/${n}`;Ds(e.path,r);try{let i=await f().renameFile(e.path,r);if(g.tabs.has(e.path))hv(e.path,r,r);await kR(e.path,r,i),t(),qk(Nt(n,i),i,r)}catch(a){S.error(`Could not rename ${e.name}.`,{detail:te(a),path:e.path,source:"Files"})}}async function It(e,t){if(!await Uf(e))return;try{let o=f();Ds(e.path),await o.deleteFile(e.path),Ma();let r=e.path.replaceAll("\\","/"),a=r.includes("/")?r.slice(0,r.lastIndexOf("/")):".";if(await Lo(a),vt().selectedPath===e.path)vt().selectedPath=null;t(),S.success(`Deleted ${e.name}`)}catch(o){S.error(`Could not delete ${e.name}.`,{detail:te(o),path:e.path,source:"Files"})}}function Lt(e,t){let n=t.paneId,o=Bu(e);if(n!==void 0&&o){if(o.activeTabId===e&&t.focus===!1)return;mm(e,n)}ci(e,{focus:t.focus!==!1})}async function Io(e,t={}){let n=t.focus!==!1;for(let[r,a]of g.tabs.entries())if(a.documentPath===e){if(Lt(r,t),n)vt().selectedPath=e;return}if(lw(e)){if(Zk(e,t),n)vt().selectedPath=e;Df({name:e.split("/").pop()||e,path:e,root:vt().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await gE(e,t),n)vt().selectedPath=e;Df({name:e.split("/").pop()||e,path:e,root:vt().projectRoot})}catch(r){S.error(`Could not open ${e}.`,{detail:te(r),path:e,source:"Open File"})}return}let o=f();try{let r=await o.readFile(e);if(!r){if(await qt(),!Zt(e)&&!e.toLowerCase().endsWith(".json"))throw yp(e);return}await qt();let a,i,s=null,l=Zt(e);if(l){let d=await kr(e,r);({document:a}=d),{frontmatter:i}=d}else if(e.endsWith(".json"))({document:a,layout:s}=ls(r));else throw yp(e);if(No({id:e,documentPath:e,document:a,...i!=null&&{frontmatter:i},layout:s,sourceFormat:l?.name??null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}}),n)vt().selectedPath=e;Df({name:e.split("/").pop()||e,path:e,root:vt().projectRoot})}catch(r){S.error(`Could not open ${e}.`,{detail:te(r),path:e,source:"Open File"})}}async function ow(e,t){await Io(t,{focus:!1,paneId:e,preview:!0})}function H_(e){if(gL(e))return;for(let[,t]of g.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){Nf(e);return}}async function Nf(e){for(let[,t]of g.tabs.entries())if(t.documentPath===e){let n=f();try{let o=await n.readFile(e);if(!o)return;if(await qt(),Zt(e)){let{document:r,frontmatter:a}=await kr(e,o);t.doc.document=r,t.doc.content.frontmatter=a}else if(e.endsWith(".json")){let r=ls(o);t.doc.document=r.document,t.doc.layout=r.layout}t.doc.dirty=!1}catch(o){S.error(`Could not reload ${e} after it changed on disk.`,{detail:te(o),key:`reload:${e}`,path:e,source:"Files"})}return}}function B_(){Gn({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",render:()=>tt,afterRender:(e,t)=>{At(t,e.rerender)}})}var Ot={activate:ft,contextMenu:Rt,expand:ht,move:mt,newFile:()=>{He(".",u)},openProject:()=>{kc("project.open",void 0,"Files")},refresh:()=>{ut()},rowHost:bt,search:(e)=>{vt().searchQuery=e,u()},select:Te,toggleIgnored:()=>{ot(!pe()),u()},treeHost:xt,typeahead:gt},w=null,P=null;function At(e,t){let n=e.querySelector(".panel-content")??e;if(Se=t,w&&(w.host!==n||!w.handle.connected()))Mt();let o=pt();if(w)w.handle.update(o);else{let r=je(n,o,Ot);w={handle:r,host:n},r.ready.then(ie)}queueMicrotask(ie)}function Mt(){Me(),w?.handle.dispose(),w=null,P=null,Ae(),L.clear(),p=[]}
|
|
4
|
-
export{$f,ew,zk,Wk,Ug,qg,tw,Vk,Uk,Df,Lo,O_,M_,P_,nw,Af,F_,j_,iw,qk,kR,Io,ow,H_,Nf,B_};
|
|
5
|
-
|
|
6
|
-
//# debugId=27B39EDC6133786464756E2164756E21
|
|
7
|
-
//# sourceMappingURL=studio-xt3djk1w.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{f}from"./studio-jsv3s3s1.js";import{ge,ee,v,Dm}from"./studio-9rhmettf.js";import{ne}from"./studio-sq1bn60g.js";import{Bi,y}from"./studio-cktcdsxz.js";import{D}from"./studio-73czgk6a.js";import{T,R}from"./studio-zmecp6hq.js";function k({slug:e,adapter:t}){let o=new Date().toISOString().slice(0,10);return`${JSON.stringify(t==="cloudflare-workers"?{assets:{binding:"ASSETS",directory:"./dist"},compatibility_date:o,compatibility_flags:["nodejs_compat"],main:"./dist/worker.js",name:e}:{compatibility_date:o,compatibility_flags:["nodejs_compat"],name:e,pages_build_output_dir:"./dist"},null,"\t")}
|
|
2
|
-
`}function u(e,{slug:t,adapter:o}){if(!e)return{content:k({adapter:o,slug:t}),patched:!0};let n;try{n=JSON.parse(e)}catch{return{content:e,patched:!1}}if(n.name=t,o==="cloudflare-workers")delete n.pages_build_output_dir,n.main="./dist/worker.js",n.assets={binding:"ASSETS",directory:"./dist"};else delete n.main,delete n.assets,n.pages_build_output_dir="./dist";return{content:`${JSON.stringify(n,null,"\t")}
|
|
3
|
-
`,patched:!0}}function ud(){try{return typeof f().cfApi==="function"}catch{return!1}}async function l(e,t){let o=f().cfApi;if(!o)throw Error("This platform cannot reach the Cloudflare API");return await o(e,t)}async function FE(){return l("/accounts")}async function j(e,t){try{return await l(`/accounts/${e}/pages/projects/${t}`)}catch{return null}}async function C(e){return l(`/accounts/${e.accountId}/pages/projects`,{method:"POST",body:{name:e.projectName,production_branch:e.productionBranch,build_config:{build_command:"bunx jx build",destination_dir:"dist"},source:{type:"github",config:{owner:e.owner,repo_name:e.repo,production_branch:e.productionBranch,deployments_enabled:!0}}}})}async function Gf(e){let t=await l(`/accounts/${e.accountId}/pages/projects/${e.projectName}/deployments`),[o]=t;if(!o)return null;return{id:o.id,url:o.url,environment:o.environment,stage:o.latest_stage?.name??"unknown",status:o.latest_stage?.status??"unknown",createdOn:o.created_on}}async function w1(e,t){let o={...e.build};if(t===null)delete o.deploy;else o.deploy=t;if(await Bi({build:o}),t!==null){let n=f(),i=null;try{i=await n.readFile("wrangler.jsonc")}catch{i=null}let w=o.adapter==="cloudflare-workers"?"cloudflare-workers":"cloudflare-pages",{content:x,patched:S}=u(i,{adapter:w,slug:t.projectName});if(S)await n.writeFile("wrangler.jsonc",x)}}async function jE(e,t){let n=await j(t.accountId,t.projectName)??await C(t),i={provider:"cloudflare-pages",accountId:t.accountId,projectName:t.projectName,...n.subdomain?{productionUrl:`https://${n.subdomain}`}:{}};return await w1(e,i),i}var m={$schema:"https://jxsuite.com/schema/v1",$id:"StudioPanelDeployChecklist",$description:"The deploy checklist, drawn above the Activity feed in the Bottom dock's Activity tab: what is MISSING before this project can ship, as one row with the chain of prerequisites under it. `publish/deploy-checklist.ts` owns the chain — which link is forged, which is merely unasked, and which command forges the next one — and hands this document a row, four steps and at most one action. Nothing here reads source control, the project config or the command registry. It draws in the Activity tab's own vocabulary because a deploy is an ordered list of stages that finish, which is exactly what a row of that feed already is; a fifth visual idiom for it would be a second design of a thing the tab has.",tagName:"div",attributes:{part:"checklist"},style:{$description:"What `.activity-list`, `.activity-row`, `.activity-row--running`, `.activity-row--done`, `.activity-icon`, `.activity-body`, `.activity-head`, `.activity-title`, `.activity-source`, `.activity-status`, `.activity-steps`, `.activity-step`, `.activity-step--done` and `.activity-step-icon` said in `styles/panels.css`, keyed on `part`. This is the LAST reader of those rules — `surfaces/panel-activity.json` carried its own copy when the feed converted, and left the stylesheet standing because this file still drew from it — so the whole `.problem-*, .activity-*` block is dead once this lands. Three token names could not travel: `--spectrum-font-size-50`, `--spectrum-font-size-75` and `--spectrum-corner-radius-75` resolve only inside `<sp-theme>`, and a document mounted into the dock body is outside it, so each would silently have taken its hard-coded px fallback. They are the kit's own scale here. One thing changed meaning on purpose: the step's `data-state` is the checklist's own three-valued state rather than the two CSS classes it used to collapse into, so `unknown` — \"nobody has asked\" — is a state the styling can tell apart from `todo` the day it should.",display:"block",minWidth:"0",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="list"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",margin:"0",padding:"0",listStyle:"none"},'& [part="row"]':{$description:"The left border is the state, at 3px, which is the one thing that must be legible without reading the row. Its default is the dim foreground so a state nobody has a colour for still draws a border rather than a gap.",display:"flex",alignItems:"flex-start",gap:"var(--jx-space-2)",padding:"6px var(--jx-space-2)",border:"1px solid var(--border)",borderLeft:"3px solid var(--fg-dim)",borderRadius:"var(--radius)",background:"var(--bg-panel)",color:"var(--fg)",fontSize:"var(--jx-text-md)"},'& [part="row"][data-state="running"]':{borderLeftColor:"var(--accent)"},'& [part="row"][data-state="done"]':{borderLeftColor:"var(--success)"},'& [part="state-icon"]':{$description:'Named `state-icon` rather than `icon`: `jx-button` puts `part="icon"` on the glyph slot of every button it draws, and the action button below is inside this same light-DOM tree — a rule on the bare name would reach into the kit\'s own drawing and a devtools query could not tell the two apart.',flex:"none",width:"14px",textAlign:"center",fontWeight:"700",lineHeight:"1.5"},'& [part="row"][data-state="running"] > [part="state-icon"]':{color:"var(--accent)"},'& [part="row"][data-state="done"] > [part="state-icon"]':{color:"var(--success)"},'& [part="row-body"]':{flex:"1",minWidth:"0",display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"2px"},'& [part="head"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",alignSelf:"stretch",minWidth:"0"},'& [part="row-title"]':{fontWeight:"700",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="source"]':{$description:"Pushed to the far edge, so the tab reads as a column of who raised what.",flex:"none",marginLeft:"auto",color:"var(--fg-dim)",fontSize:"var(--jx-text-sm)"},'& [part="summary"]':{color:"var(--fg-dim)",overflowWrap:"anywhere"},'& [part="steps"]':{$description:'The chain, declared up front, so "which link is missing" is answered by looking rather than by reading the summary and remembering what came before it.',display:"flex",flexDirection:"column",gap:"1px",margin:"2px 0 0",padding:"0",listStyle:"none",fontSize:"var(--jx-text-sm)"},'& [part="step"]':{display:"flex",gap:"6px",color:"var(--fg-dim)"},'& [part="step"][data-state="done"] > [part="step-icon"]':{color:"var(--success)"},'& [part="step-icon"]':{flex:"none",width:"10px",textAlign:"center"},'& [part="action"]':{marginTop:"var(--jx-space-1)"}},children:[{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasProject"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{tagName:"li",attributes:{part:"row","data-state":"${state.rowState}"},children:[{tagName:"span",attributes:{part:"state-icon","aria-hidden":"true"},textContent:"${state.rowIcon}"},{tagName:"div",attributes:{part:"row-body"},children:[{tagName:"div",attributes:{part:"head"},children:[{tagName:"span",attributes:{part:"row-title"},textContent:"Deploy checklist"},{tagName:"span",attributes:{part:"source"},textContent:"Publish"}]},{tagName:"div",attributes:{part:"summary"},textContent:"${state.summary}"},{tagName:"ol",attributes:{part:"steps"},children:[{$prototype:"Array",items:{$ref:"#/state/steps"},key:{$ref:"$map/item/id"},map:{tagName:"li",attributes:{part:"step","data-step":"${$map.item.id}","data-state":"${$map.item.state}"},children:[{tagName:"span",attributes:{part:"step-icon","aria-hidden":"true"},textContent:"${$map.item.icon}"},{tagName:"span",attributes:{part:"step-text"},textContent:"${$map.item.text}"}]}}]},{tagName:"span",attributes:{part:"action-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/hasAction"},cases:{true:{tagName:"jx-button",$description:"The recovery button wears the command's own title, so it reads as a verb rather than as a decoration, and a refused command is dimmed with the reason it names in its tooltip. A command the registry does not have, or whose `when` is false, draws NOTHING rather than a dead label — a surface may choose whether to show a command, never whether it exists (§13).",$props:{size:"sm",disabled:{$ref:"#/state/actionDisabled"}},attributes:{part:"action",title:"${state.actionTitle}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/runAction"},value:[]}]},children:[{tagName:"span",textContent:"${state.actionLabel}"}]}}}]}]}]}}}]};T("panel-deploy-checklist",m);var d=null,c=null,a=null,r=null;function A(e,t){e.hasProject=t.hasProject,e.rowState=t.rowState,e.rowIcon=t.rowIcon,e.summary=t.summary,e.steps=t.steps,e.hasAction=t.hasAction,e.actionLabel=t.actionLabel,e.actionTitle=t.actionTitle,e.actionDisabled=t.actionDisabled}function N(e){if(d!==e)return!1;return r===null?a!==null:r.root.parentNode===e}function h(e,t){if(N(e))return;p(),d=e;let o=v({actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",runAction:t.runAction,steps:[],summary:""});c=ge(),c.run(()=>{ee(()=>{A(o,t.project())})});let n=R("panel-deploy-checklist",o,e);a=n,n.then((i)=>{if(a===n)r=i;else i.dispose()})}function p(){c?.stop(),c=null;let e=a;if(a=null,r)r.dispose(),r=null;else if(e)e.then((t)=>t.dispose());d=null}function I(){return D?.projectConfig??null}function ra(){return I()?.build?.deploy}var s=Dm({asked:!1,observed:null});function Qh(e){s.observed=e,s.asked=!0}function _(){let{status:e}=y.git;if(e===null)return{command:"git.init",detail:"Source control has not reported on this project yet.",id:"repo",label:"Track this project with git",state:"unknown"};return e.isRepo?{command:"git.init",detail:`Tracked${e.branch?` — on branch ${e.branch}`:""}.`,id:"repo",label:"Track this project with git",state:"done"}:{command:"git.init",detail:"A deploy ships what the repository holds, so the repository comes first.",id:"repo",label:"Track this project with git",state:"todo"}}function L(){let{status:e}=y.git;if(e===null||!e.isRepo)return{command:"git.createGithubRepository",detail:"A remote is where the provider builds from.",id:"remote",label:"Push to a remote",state:e===null?"unknown":"todo"};if((e.remotes??[]).length===0)return{command:"git.createGithubRepository",detail:"This repository is local only — nothing outside this machine can build it.",id:"remote",label:"Push to a remote",state:"todo"};return e.ahead>0?{command:"git.push",detail:`${e.ahead} commit(s) are not on ${e.remotes[0]} yet, so a build would ship the older tree.`,id:"remote",label:"Push to a remote",state:"todo"}:{command:"git.push",detail:`Up to date with ${e.remotes[0]}.`,id:"remote",label:"Push to a remote",state:"done"}}function O(){let e=ra();if(e)return{command:"publish.setUp",detail:`Cloudflare Pages project ${e.projectName}.`,id:"provider",label:"Connect a deploy provider",state:"done"};return ud()?{command:"publish.setUp",detail:"Connecting one makes every commit build and publish on its own.",id:"provider",label:"Connect a deploy provider",state:"todo"}:{command:"publish.setUp",detail:"This platform cannot reach the Cloudflare API. Commit and push instead — your host "+"runs bunx jx build and serves dist/.",id:"provider",label:"Connect a deploy provider",state:"unknown"}}function E(){if(!ra())return{command:"publish.deploy",detail:"Nothing has been deployed, because no provider is connected.",id:"deployed",label:"Deploy",state:"todo"};if(!s.asked)return{command:"publish.deploy",detail:"Cloudflare has not been asked yet, so this is not a claim that nothing shipped.",id:"deployed",label:"Deploy",state:"unknown"};if(s.observed===null)return{command:"publish.deploy",detail:"Cloudflare reports no deployments for this project.",id:"deployed",label:"Deploy",state:"todo"};let{observed:e}=s;return e.status==="success"?{command:"publish.deploy",detail:`${e.environment} — ${e.url}`,id:"deployed",label:"Deploy",state:"done"}:{command:"publish.deploy",detail:`Last deployment ${e.stage}: ${e.status}.`,id:"deployed",label:"Deploy",state:"todo"}}function g(){return[_(),L(),O(),E()]}function b(){return g().find((e)=>e.state!=="done")??null}function HE(){if(!D)return null;let e=b();if(e)return{command:e.command,label:e.label,title:e.detail};return{command:"publish.openDashboard",label:"Deployed",title:ra()?.productionUrl??"Everything this project needs to ship is in place."}}var W={done:"✓",todo:"·",unknown:"?"};function V(e){return{icon:W[e.state],id:e.id,state:e.state,text:e.state==="done"?e.label:`${e.label} — ${e.detail}`}}function H(e){let t={actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1};if(!e)return t;let o=ne(),n=o?.get(e.command);if(!o||!n||!o.isVisible(e.command))return t;let i=o.disabledReason(e.command);return{actionDisabled:i!==void 0,actionLabel:n.title,actionTitle:i?`${n.title} — requires ${i}`:n.title,hasAction:!0}}function J(){if(!D)return{actionDisabled:!1,actionLabel:"",actionTitle:"",hasAction:!1,hasProject:!1,rowIcon:"",rowState:"running",steps:[],summary:""};let e=g(),t=e.find((o)=>o.state!=="done")??null;return{...H(t),hasProject:!0,rowIcon:t?"⋯":"✓",rowState:t?"running":"done",steps:e.map((o)=>V(o)),summary:t?t.detail:"Everything this project needs to ship is in place."}}function B(){let e=b();if(!e)return;ne()?.run(e.command)}var F={project:J,runAction:B};function BE(e){let t=e.querySelector("[data-deploy-checklist]");if(!t){p();return}h(t,F)}
|
|
4
|
-
export{ud,FE,Gf,w1,jE,ra,Qh,HE,BE};
|
|
5
|
-
|
|
6
|
-
//# debugId=3A5B6B7B6A1AEFB264756E2164756E21
|
|
7
|
-
//# sourceMappingURL=studio-yh3nggx1.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{tt,Ni}from"./studio-eq27rrr0.js";import{KL,Cx,hn,sn,Im,QL,ne}from"./studio-sq1bn60g.js";import{ge,ee,v,Ec,S,Md}from"./studio-9rhmettf.js";import{te}from"./studio-ery42sqr.js";var rt="data-jx-region",ce=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],de=new Set(["dock.bottom"]);function ue(e){let t=e.indexOf("/"),o=t===-1?e:e.slice(0,t),n=t===-1?void 0:e.slice(t+1);if(n===""||o==="")return null;let a=o,i;if(!de.has(o)){let s=o.indexOf(".");if(s!==-1){if(a=o.slice(0,s),i=o.slice(s+1),i==="")return null}}if(!ce.includes(a))return null;return i===void 0?n===void 0?{surface:a}:{part:n,surface:a}:n===void 0?{instance:i,surface:a}:{instance:i,part:n,surface:a}}function fe(e){return ue(e)!==null}function me(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function B(e){return e??document}var pe=[{locate:([,e],t)=>{let n=wp(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return n?[n]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let o=wp("inspector",t);return o?[...o.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function ve(e,t){let o=me(e);if(!fe(o))return[];let n=[...B(t).querySelectorAll(`[data-jx-region="${CSS.escape(o)}"]`)];if(n.length>0)return n;for(let a of pe){let i=o.match(a.pattern);if(i)return a.locate(i,B(t))}return[]}function wp(e,t){return ve(e,t).at(-1)??null}var WC={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 PL(e){return wi(e,"tabs")}function FL(e){return`navigator/panel:${e}`}function jL(e){return`inspector/tab:${e}`}var HL="navigator/statements";function BL(e){return`inspector/statements:${e}`}function mv(e){return`dock.bottom/panel:${e}`}var he={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function zt(e,t){let o=he[e];return t?`overlay.${o}:${t}`:`overlay.${o}`}var k=new Map,Y=1;function Q(e){let t=Y;return Y+=1,k.set(t,{...e,id:t}),t}function H(e){k.delete(e)}function X(){return[...k.values()]}function OL(e){let t=e.toLowerCase();return X().filter((o)=>o.elements.has(t))}function ML(e){return X().filter((t)=>t.name===e)}var P=null;function zC(e=document){return P??=QL({document:e}),P}function Z(){return P??zC()}var L="jx-studio:/surfaces/",w=new Map;function T(e,t){w.set(e,t),Cx(ye(e),t)}function ye(e){return`${L}${e}.json`}function zL(e){return w.get(e)}function be(e){if(!e.startsWith(L)||!e.endsWith(".json"))return;return w.get(e.slice(L.length,-5))}async function R(e,t,o,n={}){let a=w.get(e);if(!a)throw Error(`Studio surface "${e}" is not registered`);if(await Z(),n.region)o.setAttribute(rt,n.region);let i=await KL(a,o,{scope:t,base:L,resolver:be,...n.onNodeCreated?{onNodeCreated:n.onNodeCreated}:{},...n.onNodeMoved?{onNodeMoved:n.onNodeMoved}:{},...n.signal?{signal:n.signal}:{}}),s=(r)=>({dispose:r,elements:i.elements,root:i.root,scope:i.scope});if(n.signal?.aborted)return s(i.dispose);let d=0,l=()=>{i.dispose(),H(d)};return d=Q({elements:i.elements,host:o,name:e,remount:async()=>{l(),await R(e,t,o,n)}}),n.signal?.addEventListener("abort",()=>H(d),{once:!0}),s(l)}var oe={$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",oe);function Nn(e){if(e.querySelector('[part="dialog"]'))return Promise.resolve(e);return new Promise((t)=>{e.addEventListener("jx-ready",function o(n){if(n.target!==e&&!e.querySelector('[part="dialog"]'))return;e.removeEventListener("jx-ready",o),t(e)})})}function Va(e){let t=document.createElement("div");t.style.pointerEvents="auto",t.setAttribute(rt,zt("dialog",e.region)),e.layer.append(t);let o=v({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:(r)=>{o.value=r,e.onInput?.(r)},invalid:!1,message:e.message??"",options:e.choice?.options??[],pick:(r)=>{e.onPick?.(r)},placeholder:e.field?.placeholder??"",secondary:()=>{e.onSecondary?.()},secondaryLabel:e.secondaryLabel??"",size:e.size??"sm",value:e.field?.value??""}),n=null,a=!1,i=()=>{},s=new Promise((r)=>{i=r}),l=R("dialog",o,t).then(async(r)=>{let c=r.root;if(a)return r.dispose(),c;if(n=r,await Promise.race([Nn(c),s]),a)return c;if(e.island?.(c.querySelector('[part="island"]')??c),hn(c),e.field){let y=c.querySelector("jx-textfield");if(y)setTimeout(()=>{if(!a)Im(y,e.field?.select??"all")},0)}return c});return{close(){if(a)return;a=!0,i();let r=n?.root;if(r instanceof HTMLElement)sn(r);n?.dispose(),n=null,t.remove()},host:t,ready:l,update(r){if(r.confirmLabel!==void 0)o.confirmLabel=r.confirmLabel;if(r.cancelLabel!==void 0)o.cancelLabel=r.cancelLabel;if(r.message!==void 0)o.message=r.message,o.hasMessage=r.message!=="";if(r.value!==void 0)o.value=r.value;if(r.placeholder!==void 0)o.placeholder=r.placeholder;if(r.invalid!==void 0)o.invalid=r.invalid;if(r.error!==void 0)if(r.error!==""&&r.error===o.error){o.error="";let c=r.error;queueMicrotask(()=>{o.error=c})}else o.error=r.error;if(r.options!==void 0)o.options=r.options;if(r.chosen!==void 0)o.chosen=r.chosen}}}var re={$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 $e(e){return e instanceof RangeError||e instanceof Error&&e.name==="CommandUnavailableError"}function rn(e,t,o,n=t){let a=(s)=>{if(!$e(s))console.error(`${n}: command "${t}" failed`,s);S.error(te(s),{key:`command.run:${t}`,source:n})},i;try{i=e.run(t,o)}catch(s){return a(s),Promise.resolve()}return Promise.resolve(i).catch(a)}function kc(e,t,o){let n=ne();return n?rn(n,e,t,o):Promise.resolve()}var se,F,q,M;function Lt(e){return(e==="popover"?se:e==="modal"?F:e==="toast"?M:q)||document.body}function VC(){se=document.querySelector("#layer-popover"),F=document.querySelector("#layer-modal"),q=document.querySelector("#layer-dialog"),M=document.querySelector("#layer-toast"),Ce()}var ae="jx-dialog[data-open], dialog[open]";function km(){return Boolean(q?.querySelector(ae)||F?.querySelector(ae))}function Xo(e,t,o={}){let{confirmLabel:n="Confirm",cancelLabel:a="Cancel",destructive:i=!1}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=Va({cancelLabel:a,confirmLabel:n,destructive:i,headline:e,layer:Lt("dialog"),...G(t),onCancel:()=>l(!1),onClosed:()=>l(!1),onConfirm:()=>l(!0)})})}function _x(e,t,o={}){let{saveLabel:n="Save",discardLabel:a="Discard",cancelLabel:i="Cancel"}=o;return new Promise((s)=>{let d=!1,l=(c)=>{if(d)return;d=!0,r.close(),s(c)},r=Va({cancelLabel:i,confirmLabel:n,headline:e,layer:Lt("dialog"),...G(t),onCancel:()=>l("cancel"),onClosed:()=>l("cancel"),onConfirm:()=>l("save"),onSecondary:()=>l("discard"),secondaryLabel:a})})}function G(e){if(typeof e==="string")return{message:e};return{island:(t)=>{Ni(e,t)}}}function On(e,t={}){let{cancelLabel:o="Cancel",choice:n,confirmLabel:a="OK",message:i,mono:s=!1,multiline:d=!1,placeholder:l="",rows:r="3",select:c="all",size:y,validate:J,value:le=""}=t,O=(m)=>J?J(m,b):m.trim()?"":"Enter a value.",p=le,b=n?.initial??"",f="",U=!1,z=()=>typeof l==="function"?l():l,W=()=>n?n.options().map((m)=>({label:m.label,value:m.value})):[];return new Promise((m)=>{let V=!1,N=(u)=>{if(V)return;V=!0,A.close(),m(u)},K=(u)=>{f=u,A.update({error:f,invalid:f!==""})},A=Va({cancelLabel:o,confirmLabel:a,headline:e,layer:Lt("dialog"),...i===void 0?{}:G(i),...n?{choice:{chosen:b,label:n.label,options:W()}}:{},field:{mono:s,multiline:d,placeholder:z(),rows:r,select:c,value:p},...y===void 0?{}:{size:y},onCancel:()=>N(null),onClosed:()=>N(null),onConfirm:()=>{let u=O(p);if(u){K(u);return}N(p.trim())},onInput:(u)=>{U=!0,p=u;let x=O(p);if(x!==f)K(x)},onPick:(u)=>{b=u,n?.onChange?.(u);let x=O(p);f=U||f?x:"",A.update({chosen:b,error:f,invalid:f!=="",options:W(),placeholder:z()})}})})}var C=new Map;function ps(e,t){let o=`${e}:${t}`,n=C.get(o);if(n&&n.parentElement)return n;return n=document.createElement("div"),n.style.pointerEvents="auto",n.setAttribute(rt,zt(e,t)),Lt(e).append(n),C.set(o,n),n}function Em(e,t){let o=`${e}:${t}`,n=C.get(o);if(n)Ni(tt,n),n.remove(),C.delete(o)}var Re=180,Le={error:"✕",info:"ℹ",success:"✓",warn:"!"},j=null,h=new Map,g=new Set;function Te(){return globalThis.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}function we(){try{return new URLSearchParams(globalThis.location?.search??"").get("automation")==="1"}catch{return!1}}function UC(){return[...g].map((e)=>`overlay: toast ${e} settling in`)}function _(e){let t=h.get(e);if(t!==void 0)clearTimeout(t),h.delete(e);g.delete(e),Md(e)}function Ee(e){if(h.has(e.id)||g.has(e.id))return;let t=Te()?0:Re;if(t>0)g.add(e.id),setTimeout(()=>g.delete(e.id),t);let o=e.timeoutMs??0;if(o<=0||we())return;h.set(e.id,setTimeout(()=>_(e.id),o))}T("toasts",re);var I=null,D=null,E=null;function ie(){return I??=v({dismissToast:(e)=>{_(e)},runAction:(e)=>{let t=Ec.find((n)=>n.id===e),o=ne();if(!t?.action||!o)return;_(e),rn(o,t.action,t.actionArgs,"Notifications")},toasts:[]}),I}function Me(e){let t=e.action===void 0?null:ne(),o=e.action,n=t&&o!==void 0?t.get(o):void 0,a=n&&o!==void 0&&t.isVisible(o)?n:null,i=a&&o!==void 0?t.disabledReason(o):void 0;return{actionDisabled:i!==void 0,actionLabel:a?.title??"",actionTitle:a===null||a===void 0?"":i===void 0?a.title:`${a.title} — requires ${i}`,hasAction:a!==null&&a!==void 0,icon:Le[e.severity],id:e.id,message:e.message,severity:e.severity}}function Ce(){if(je(),!M)return;j=ge(),j.run(()=>{ee(()=>{Ec.length,ne();for(let e of Ec)Ee(e);ie().toasts=Ec.map((e)=>Me(e))})}),D=R("toasts",ie(),M),D.then((e)=>{E=e})}function je(){j?.stop(),j=null;for(let t of h.values())clearTimeout(t);h.clear(),g.clear();let e=D;if(D=null,E)E.dispose(),E=null;else if(e)e.then((t)=>t.dispose());I=null}
|
|
2
|
-
export{OL,ML,zC,rt,wp,WC,wi,PL,FL,jL,HL,BL,mv,zt,T,zL,R,Nn,Va,rn,kc,Lt,VC,km,Xo,_x,On,ps,Em,UC};
|
|
3
|
-
|
|
4
|
-
//# debugId=C7498C418896BA4764756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-zmecp6hq.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{An,cp,EC,g,u,Ms,Bn,Bu,Tr,dp,mx,gx,Dl,up,hp,pp,zu,Ha,fp,wc,No,Al,bx,uv,TC,vx,LC,IC,ci,mm,hv,RC}from"./studio-ks7cksh0.js";import"./studio-7jazdy6y.js";import"./studio-de3p1ktm.js";import"./studio-jsv3s3s1.js";import"./studio-9rhmettf.js";export{EC as MAX_PANES,An as PRIMARY_PANE,cp as SECONDARY_PANE,ci as activateTab,Ms as activePane,u as activeTab,LC as closeAllTabs,up as closePane,vx as closeTab,pp as detachTab,Tr as focusPane,zu as insertIntoPane,dp as isPaneFocused,fp as isTabActive,TC as moveTab,mm as moveTabToPane,No as openTab,gx as paneBeside,Bn as paneById,hp as paneIsEmpty,Bu as paneOfTab,bx as promoteDirtyPreviewTabs,Al as promoteTab,Dl as receivingPane,RC as registerTabCommands,hv as renameTab,IC as replaceAllTabs,uv as setTabPinned,Ha as setWorkspaceProject,mx as splitRight,wc as tabIsLive,g as workspace};
|
|
2
|
-
|
|
3
|
-
//# debugId=3D39241D980EC39964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=workspace-g6dvaete.js.map
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{nc,WS,VS,US,gf,e_,bf,$y,t_,n_}from"./studio-6j2jn55a.js";var F=Math.floor;var Q=(t,e)=>t<e?t:e,tt=(t,e)=>t>e?t:e;var _=128;var w=127;var{MAX_SAFE_INTEGER:rt,MIN_SAFE_INTEGER:se}=Number;var nt=()=>new Set;var st=Array.from;var{fromCharCode:Et,fromCodePoint:ie}=String,ce=Et(65535);var Ot=(t)=>{let e=unescape(encodeURIComponent(t)),o=e.length,r=new Uint8Array(o);for(let i=0;i<o;i++)r[i]=e.codePointAt(i);return r},B=typeof TextEncoder<"u"?new TextEncoder:null,Ft=(t)=>B.encode(t),it=B?Ft:Ot;var U=typeof TextDecoder>"u"?null:new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0});if(U&&U.decode(new Uint8Array).length===1)U=null;class at{constructor(){this.cpos=0,this.cbuf=new Uint8Array(100),this.bufs=[]}}var lt=()=>new at;var Mt=(t)=>{let e=t.cpos;for(let o=0;o<t.bufs.length;o++)e+=t.bufs[o].length;return e};var pt=(t)=>{let e=new Uint8Array(Mt(t)),o=0;for(let r=0;r<t.bufs.length;r++){let i=t.bufs[r];e.set(i,o),o+=i.length}return e.set(new Uint8Array(t.cbuf.buffer,0,t.cpos),o),e};var V=(t,e)=>{let o=t.cbuf.length;if(t.cpos===o)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(o*2),t.cpos=0;t.cbuf[t.cpos++]=e};var b=(t,e)=>{while(e>w)V(t,_|w&e),e=F(e/128);V(t,w&e)};var R=new Uint8Array(30000),Nt=R.length/3,Lt=(t,e)=>{if(e.length<Nt){let o=B.encodeInto(e,R).written||0;b(t,o);for(let r=0;r<o;r++)V(t,R[r])}else C(t,it(e))},Pt=(t,e)=>{let o=unescape(encodeURIComponent(e)),r=o.length;b(t,r);for(let i=0;i<r;i++)V(t,o.codePointAt(i))},ut=B&&B.encodeInto?Lt:Pt;var Rt=(t,e)=>{let o=t.cbuf.length,r=t.cpos,i=Q(o-r,e.length),c=e.length-i;if(t.cbuf.set(e.subarray(0,i),r),t.cpos+=i,c>0)t.bufs.push(t.cbuf),t.cbuf=new Uint8Array(tt(o*2,c)),t.cbuf.set(e.subarray(i)),t.cpos=c},C=(t,e)=>{b(t,e.byteLength),Rt(t,e)};var fe=new DataView(new ArrayBuffer(4));var q=(t)=>Error(t);var jt=q("Unexpected end of array"),zt=q("Integer out of Range");class dt{constructor(t){this.arr=t,this.pos=0}}var yt=(t)=>new dt(t);var Yt=(t,e)=>{let o=new Uint8Array(t.arr.buffer,t.pos+t.arr.byteOffset,e);return t.pos+=e,o},M=(t)=>Yt(t,S(t));var ht=(t)=>t.arr[t.pos++];var S=(t)=>{let e=0,o=1,r=t.arr.length;while(t.pos<r){let i=t.arr[t.pos++];if(e=e+(i&w)*o,o*=128,i<_)return e;if(e>rt)throw zt}throw jt};var Wt=(t)=>{let e=S(t);if(e===0)return"";else{let o=String.fromCodePoint(ht(t));if(--e<100)while(e--)o+=String.fromCodePoint(ht(t));else while(e>0){let r=e<1e4?e:1e4,i=t.arr.subarray(t.pos,t.pos+r);t.pos+=r,o+=String.fromCodePoint.apply(null,i),e-=r}return decodeURIComponent(escape(o))}},Ht=(t)=>U.decode(M(t)),xt=U?Ht:Wt;var D=Date.now;var N=()=>new Map;var mt=(t,e,o)=>{let r=t.get(e);if(r===void 0)t.set(e,r=o());return r};class j{constructor(){this._observers=N()}on(t,e){mt(this._observers,t,nt).add(e)}once(t,e){let o=(...r)=>{this.off(t,o),e(...r)};this.on(t,o)}off(t,e){let o=this._observers.get(t);if(o!==void 0){if(o.delete(e),o.size===0)this._observers.delete(t)}}emit(t,e){return st((this._observers.get(t)||N()).values()).forEach((o)=>o(...e))}destroy(){this._observers=N()}}var z=Symbol("Equality");var Jt=Object.keys;var Y=(t)=>Jt(t).length;var bt=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var v=(t,e)=>{if(t===e)return!0;if(t==null||e==null||t.constructor!==e.constructor&&(t.constructor||Object)!==(e.constructor||Object))return!1;if(t[z]!=null)return t[z](e);switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t),e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;break}case Set:{if(t.size!==e.size)return!1;for(let o of t)if(!e.has(o))return!1;break}case Map:{if(t.size!==e.size)return!1;for(let o of t.keys())if(!e.has(o)||!v(t.get(o),e.get(o)))return!1;break}case void 0:case Object:if(Y(t)!==Y(e))return!1;for(let o in t)if(!bt(t,o)||!v(t[o],e[o]))return!1;break;case Array:if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(!v(t[o],e[o]))return!1;break;default:return!1}return!0};var W=30000;class H extends j{constructor(t){super();this.doc=t,this.clientID=t.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let e=D();if(this.getLocalState()!==null&&W/2<=e-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let o=[];if(this.meta.forEach((r,i)=>{if(i!==this.clientID&&W<=e-r.lastUpdated&&this.states.has(i))o.push(i)}),o.length>0)G(this,o,"timeout")},F(W/10)),t.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(t){let e=this.clientID,o=this.meta.get(e),r=o===void 0?0:o.clock+1,i=this.states.get(e);if(t===null)this.states.delete(e);else this.states.set(e,t);this.meta.set(e,{clock:r,lastUpdated:D()});let c=[],l=[],d=[],y=[];if(t===null)y.push(e);else if(i==null){if(t!=null)c.push(e)}else if(l.push(e),!v(i,t))d.push(e);if(c.length>0||d.length>0||y.length>0)this.emit("change",[{added:c,updated:d,removed:y},"local"]);this.emit("update",[{added:c,updated:l,removed:y},"local"])}setLocalStateField(t,e){let o=this.getLocalState();if(o!==null)this.setLocalState({...o,[t]:e})}getStates(){return this.states}}var G=(t,e,o)=>{let r=[];for(let i=0;i<e.length;i++){let c=e[i];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){let l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:D()})}r.push(c)}}if(r.length>0)t.emit("change",[{added:[],updated:[],removed:r},o]),t.emit("update",[{added:[],updated:[],removed:r},o])},X=(t,e,o=t.states)=>{let r=e.length,i=lt();b(i,r);for(let c=0;c<r;c++){let l=e[c],d=o.get(l)||null,y=t.meta.get(l).clock;b(i,l),b(i,y),ut(i,JSON.stringify(d))}return pt(i)};var It=(t,e,o)=>{let r=yt(e),i=D(),c=[],l=[],d=[],y=[],A=S(r);for(let I=0;I<A;I++){let f=S(r),T=S(r),m=JSON.parse(xt(r)),x=t.meta.get(f),k=t.states.get(f),E=x===void 0?0:x.clock;if(E<T||E===T&&m===null&&t.states.has(f)){if(m===null)if(f===t.clientID&&t.getLocalState()!=null)T++;else t.states.delete(f);else t.states.set(f,m);if(t.meta.set(f,{clock:T,lastUpdated:i}),x===void 0&&m!==null)c.push(f);else if(x!==void 0&&m===null)y.push(f);else if(m!==null){if(!v(m,k))d.push(f);l.push(f)}}}if(c.length>0||d.length>0||y.length>0)t.emit("change",[{added:c,updated:d,removed:y},o]);if(c.length>0||l.length>0||y.length>0)t.emit("update",[{added:c,updated:l,removed:y},o])};var Tt=0,L=1,St=2,wt=(t,e)=>{b(t,Tt);let o=US(e);C(t,o)},te=(t,e,o)=>{b(t,L),C(t,VS(e,o))},ee=(t,e,o)=>te(e,o,M(t)),Ut=(t,e,o,r)=>{try{WS(e,M(t),o)}catch(i){if(r!=null)r(i);console.error("Caught error while handling a Yjs update",i)}},Bt=(t,e)=>{b(t,St),C(t,e)},oe=Ut,vt=(t,e,o,r,i)=>{let c=S(t);switch(c){case Tt:ee(t,e,o);break;case L:Ut(t,o,r,i);break;case St:oe(t,o,r,i);break;default:throw Error("Unknown message type")}return c};var ne=1;function Se(t){let e=t.webSocketImpl??globalThis.WebSocket,o=t.openTimeoutMs??1e4,r=new Map,i=new Set,c=new nc,l=new H(c);l.setLocalState(null);let d=null,y=null,A="connecting",I=!1,f=t.reconnectDelayMs??1000,T=null,m=(n)=>{if(A===n)return;A=n;for(let s of i)s(n)},x=(n)=>{if(d&&d.readyState===ne)try{d.send(t_(n))}catch{}},k=(n)=>{x({message:{path:n,type:"open"},type:"control"})};l.on("update",(n,s)=>{if(s==="remote")return;let p=[...n.added,...n.updated,...n.removed];x({body:X(l,p),type:"awareness"})});let E=(n)=>{switch(n.type){case"hello":{y={color:n.color,login:n.login,permission:n.permission,...n.name===void 0?{}:{name:n.name},...n.avatarUrl===void 0?{}:{avatarUrl:n.avatarUrl}};return}case"opened":{let s=r.get(n.path);if(!s)return;if(s.opened&&s.epoch!==n.epoch){Z(n.path,s);return}s.epoch=n.epoch,s.opened=!0,s.resolveOpen?.(!0),s.resolveOpen=null;let p=gf();wt(p,s.doc),x({body:bf(p),epoch:s.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let s=r.get(n.path);if(s)Z(n.path,s);return}case"flush-ack":{let s=r.get(n.path);if(s){for(let p of s.pendingFlush)p();s.pendingFlush.clear()}return}case"doc-dirty":{let s=r.get(n.path);if(s){s.dirty=n.dirty;for(let p of s.dirtyCbs)p(n.dirty)}return}case"error":{if(!n.path)return;let s=r.get(n.path);if(!s)return;if(n.code==="content-not-loaded"&&t.hydratePath&&!s.hydrated){s.hydrated=!0,t.hydratePath(n.path).then(()=>k(n.path),()=>{s.resolveOpen?.(!1),s.resolveOpen=null});return}if(!s.opened)s.resolveOpen?.(!1),s.resolveOpen=null;break}default:break}},At=(n,s,p)=>{let h=r.get(n);if(!h||!h.opened||h.epoch!==s)return;let a=$y(p),g=gf(),K=vt(a,g,h.doc,"remote");if(e_(g)>0)x({body:bf(g),epoch:s,path:n,type:"doc-sync"});if(K===L&&!h.synced)h.synced=!0,h.resolveSynced()},Z=(n,s)=>{r.delete(n),s.resolveOpen?.(!1),s.resolveOpen=null;for(let p of s.resetCbs)p();s.doc.destroy()},J=()=>{if(I)return;m("connecting");let n=t.protocols,s=n===void 0||n.length===0?new e(t.url):new e(t.url,n);d=s,s.binaryType="arraybuffer",s.onopen=()=>{f=t.reconnectDelayMs??1000,m("connected");for(let h of r.keys())k(h);if(l.getLocalState()!==null)x({body:X(l,[l.clientID]),type:"awareness"})},s.onmessage=(p)=>{let h=p.data,a=h instanceof ArrayBuffer?new Uint8Array(h):h instanceof Uint8Array?h:null;if(!a)return;let g;try{g=n_(a)}catch{return}switch(g.type){case"control":{E(g.message);return}case"doc-sync":{At(g.path,g.epoch,g.body);return}case"awareness":{It(l,g.body,"remote");break}default:break}},s.onclose=()=>{if(I)return;m("offline");for(let p of r.values())p.opened=!1;T=setTimeout(J,f),f=Math.min(f*2,30000)},s.onerror=()=>{}};return J(),{destroy(){if(I)return;if(I=!0,T)clearTimeout(T);G(l,[l.clientID],"destroy"),l.destroy(),c.destroy();for(let[n,s]of r)s.resolveOpen?.(!1),s.doc.destroy(),r.delete(n);d?.close()},async openDoc(n){if(I)return null;let s=r.get(n);if(s&&!s.handleDestroyed)return null;let p=()=>{},h=new Promise((u)=>{p=u}),a={dirty:!1,dirtyCbs:new Set,doc:new nc,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:p,synced:!1,whenSynced:h};if(r.set(n,a),a.doc.on("update",(u,P)=>{if(P==="remote"||!a.opened)return;let O=gf();Bt(O,u),x({body:bf(O),epoch:a.epoch,path:n,type:"doc-sync"})}),!await new Promise((u)=>{a.resolveOpen=u;let P=setTimeout(()=>{a.resolveOpen=null,u(!1)},o);a.resolveOpen=(O)=>{clearTimeout(P),u(O)},k(n)})){if(r.get(n)===a)r.delete(n);return a.doc.destroy(),null}return{awareness:l,destroy:()=>{if(a.handleDestroyed)return;if(a.handleDestroyed=!0,r.get(n)===a)r.delete(n),x({path:n,type:"doc-close"});a.doc.destroy()},doc:a.doc,flush:()=>new Promise((u)=>{a.pendingFlush.add(u),x({message:{path:n,type:"flush"},type:"control"})}),identity:()=>y,onDirty:(u)=>(a.dirtyCbs.add(u),u(a.dirty),()=>a.dirtyCbs.delete(u)),onReset:(u)=>(a.resetCbs.add(u),()=>a.resetCbs.delete(u)),onStatus:(u)=>(i.add(u),()=>i.delete(u)),whenSynced:a.whenSynced}},status:()=>A}}export{Se as createWsCollabConnection};
|
|
2
|
-
|
|
3
|
-
//# debugId=2BD2CE1FA927A6DE64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=ws-client-shf41j5p.js.map
|