@jxsuite/studio 10.1.0 → 10.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-mkb0qa6p.js → 2020-bx702wqa.js} +3 -3
- package/dist/chunks/adapter-pp011m5x.js +4 -0
- package/dist/chunks/add-new-flow-ecqmzz76.js +4 -0
- package/dist/chunks/cf-account-picker-c07znkqt.js +4 -0
- package/dist/chunks/cf-settings-0v2bmqy0.js +4 -0
- package/dist/chunks/components-yn0dn2pq.js +4 -0
- package/dist/chunks/content-source-g0j41yy6.js +4 -0
- package/dist/chunks/{convert-to-repeater-f92ey3kp.js → convert-to-repeater-sbjk7tgn.js} +3 -3
- package/dist/chunks/editor-xz02jeh1.js +4 -0
- package/dist/chunks/entry-commands-kmt02crp.js +4 -0
- package/dist/chunks/extension-sections-0rprf12d.js +4 -0
- package/dist/chunks/file-ops-mexj5qed.js +4 -0
- package/dist/chunks/files-b2tcppdd.js +4 -0
- package/dist/chunks/format-host-btsevv0c.js +4 -0
- package/dist/chunks/fs-events-r0apejva.js +4 -0
- package/dist/chunks/grid-open-n2a8xkht.js +4 -0
- package/dist/chunks/{grid-view-r22jsqht.js → grid-view-tghcwrrt.js} +12 -12
- package/dist/chunks/iframe-host-gx0ypyh3.js +4 -0
- package/dist/chunks/index-bs4k9tr6.js +4 -0
- package/dist/chunks/{index-pxwwf00y.js → index-vr006kbt.js} +3 -3
- package/dist/chunks/{javascript-pzqryby6.js → javascript-z1g3s9fd.js} +2 -2
- package/dist/chunks/{jsonMode-tcnyxyap.js → jsonMode-7szwg8c4.js} +5 -5
- package/dist/chunks/jx-validate-ymf10teh.js +4 -0
- package/dist/chunks/layers-p9nfya38.js +4 -0
- package/dist/chunks/layers-panel-tt1hzhhf.js +4 -0
- package/dist/chunks/lit-html-x18n2sfz.js +4 -0
- package/dist/chunks/media-library-0n45gv8r.js +4 -0
- package/dist/chunks/media-picker-s09at95z.js +4 -0
- package/dist/chunks/{monaco-binding-bqpge64f.js → monaco-binding-v42w9c1v.js} +3 -3
- package/dist/chunks/monaco-buffer-een2ea0v.js +4 -0
- package/dist/chunks/{monaco-setup-1mkab762.js → monaco-setup-7bffxd6v.js} +3 -3
- package/dist/chunks/notify-qwb8radt.js +4 -0
- package/dist/chunks/parse-v77xtwv7.js +4 -0
- package/dist/chunks/platform-8jnez0wr.js +4 -0
- package/dist/chunks/publish-panel-aysnj611.js +4 -0
- package/dist/chunks/{publish-quick-m9vkhahq.js → publish-quick-kpbqs9mz.js} +3 -3
- package/dist/chunks/publish-workspace-nd0a8q99.js +4 -0
- package/dist/chunks/quick-search-vg0jkhk2.js +4 -0
- package/dist/chunks/references-a7v6a0e2.js +4 -0
- package/dist/chunks/right-panel-cvk1vxx5.js +4 -0
- package/dist/chunks/source-control-fsqzc6he.js +4 -0
- package/dist/chunks/studio-05jfwbmf.js +5 -0
- package/dist/chunks/{studio-qyb5bebs.js → studio-0q5jwddh.js} +7 -7
- package/dist/chunks/{studio-cvz0e00f.js → studio-0w2dr0q8.js} +4 -4
- package/dist/chunks/{studio-eesyjg7h.js → studio-1tzpds97.js} +5 -5
- package/dist/chunks/{studio-a3s6frde.js → studio-216b27sv.js} +3 -3
- package/dist/chunks/studio-2ejhqns4.js +5 -0
- package/dist/chunks/studio-2r90cts3.js +16 -0
- package/dist/chunks/{studio-dy2xtt7a.js → studio-399a25za.js} +4 -4
- package/dist/chunks/studio-399xknkb.js +6 -0
- package/dist/chunks/{studio-jh6t5qz4.js → studio-43y04qck.js} +4 -4
- package/dist/chunks/{studio-skynbac3.js → studio-4g8yb6jn.js} +2 -2
- package/dist/chunks/{studio-jw0q5j6k.js → studio-4jhw38b2.js} +4 -4
- package/dist/chunks/{studio-4smcnv33.js → studio-4ncmwqw5.js} +4 -4
- package/dist/chunks/studio-5atwjgkj.js +7 -0
- package/dist/chunks/{studio-vcz63n42.js → studio-5frqk7c0.js} +4 -4
- package/dist/chunks/{studio-hsr3k06v.js → studio-646nn2ys.js} +5 -5
- package/dist/chunks/{studio-ch8gt8vt.js → studio-6cwj6xrx.js} +4 -4
- package/dist/chunks/studio-6hzdjfv0.js +5 -0
- package/dist/chunks/{studio-9cp96v90.js → studio-71m92v9s.js} +7 -7
- package/dist/chunks/{studio-brdp85q7.js → studio-75kcdbsk.js} +4 -4
- package/dist/chunks/{studio-6vwvshw8.js → studio-78pywnp2.js} +5 -5
- package/dist/chunks/{studio-ggm7zf70.js → studio-86r8hp7r.js} +5 -5
- package/dist/chunks/studio-886t6ztg.js +5 -0
- package/dist/chunks/{studio-5dmgmyw4.js → studio-8wnvtr4z.js} +4 -4
- package/dist/chunks/studio-8z66jk4z.js +5 -0
- package/dist/chunks/{studio-x2metr13.js → studio-9rbe2xpw.js} +3 -3
- package/dist/chunks/{studio-8qejv8yf.js → studio-awxwjawq.js} +4 -4
- package/dist/chunks/studio-b2qpt0xy.js +14 -0
- package/dist/chunks/{studio-9rcbvksg.js → studio-bvs9kpst.js} +7 -7
- package/dist/chunks/studio-c71806xz.js +7 -0
- package/dist/chunks/{studio-vjhej0w5.js → studio-cbwks69x.js} +140 -140
- package/dist/chunks/studio-cg1bfyhf.js +9 -0
- package/dist/chunks/studio-cg710sk9.js +5 -0
- package/dist/chunks/studio-cw0wb9qk.js +7 -0
- package/dist/chunks/studio-cyheys7k.js +5 -0
- package/dist/chunks/studio-ea5m9kg5.js +5 -0
- package/dist/chunks/{studio-4nkm4404.js → studio-ea74s8c1.js} +4 -4
- package/dist/chunks/{studio-37twdaf7.js → studio-efdxjwyp.js} +34 -34
- package/dist/chunks/{studio-pmzg17fj.js → studio-egmw2837.js} +4 -4
- package/dist/chunks/{studio-8jb31dcf.js → studio-er5f383a.js} +4 -4
- package/dist/chunks/studio-f746039f.js +5 -0
- package/dist/chunks/studio-fmdymd9v.js +5 -0
- package/dist/chunks/studio-gcm12z00.js +6 -0
- package/dist/chunks/{studio-t3j8htp7.js → studio-gj98m8gy.js} +5 -5
- package/dist/chunks/{studio-cgb97rwv.js → studio-hasbgjah.js} +4 -4
- package/dist/chunks/studio-hhp4x8xf.js +6 -0
- package/dist/chunks/{studio-848rk4p1.js → studio-hz5n7x27.js} +4 -4
- package/dist/chunks/{studio-0g2sm01j.js → studio-j3d2fjqz.js} +4 -4
- package/dist/chunks/studio-jeraxdgv.js +7 -0
- package/dist/chunks/studio-jvgek9xt.js +5 -0
- package/dist/chunks/studio-jws1a87n.js +5 -0
- package/dist/chunks/studio-k2sz13zg.js +5 -0
- package/dist/chunks/studio-k3m4jkdk.js +5 -0
- package/dist/chunks/{studio-7vb997ff.js → studio-kg1abnz0.js} +4 -4
- package/dist/chunks/{studio-s0fg2wav.js → studio-kg5ya5r2.js} +4 -4
- package/dist/chunks/studio-khwbgrtg.js +5 -0
- package/dist/chunks/studio-mx6wzh25.js +5 -0
- package/dist/chunks/studio-mxs3ar9t.js +5 -0
- package/dist/chunks/studio-nm4szey4.js +5 -0
- package/dist/chunks/studio-nqxqf8p2.js +4 -0
- package/dist/chunks/{studio-07k0geap.js → studio-pjtntksy.js} +4 -4
- package/dist/chunks/studio-qh8berdz.js +5 -0
- package/dist/chunks/studio-qn7z4krm.js +5 -0
- package/dist/chunks/studio-qyed0ah6.js +5 -0
- package/dist/chunks/{studio-5e7p1vgd.js → studio-r4bcdwhq.js} +4 -4
- package/dist/chunks/{studio-mwnmzx7g.js → studio-r7pf0rkv.js} +6 -6
- package/dist/chunks/studio-rtfnhrdg.js +5 -0
- package/dist/chunks/{studio-zacvfm31.js → studio-rzqaz21g.js} +4 -4
- package/dist/chunks/studio-s5tzw84t.js +5 -0
- package/dist/chunks/{studio-nf0pqpbj.js → studio-sevbc3xv.js} +4 -4
- package/dist/chunks/{studio-va0e63sk.js → studio-sxdb9h3q.js} +6 -6
- package/dist/chunks/studio-t51y8v1d.js +5 -0
- package/dist/chunks/{studio-pd9dsqpq.js → studio-t98vq4r6.js} +4 -4
- package/dist/chunks/studio-th7z3fg7.js +5 -0
- package/dist/chunks/studio-tsxpqvh0.js +6 -0
- package/dist/chunks/{studio-7823f0g8.js → studio-v1yascv2.js} +4 -4
- package/dist/chunks/{studio-tpy3rdxn.js → studio-wc6za3zs.js} +4 -4
- package/dist/chunks/{studio-5m0w815d.js → studio-wxq6v5sv.js} +4 -4
- package/dist/chunks/{studio-ahf3cspq.js → studio-y60sts62.js} +3 -3
- package/dist/chunks/studio-ybnwymxw.js +5 -0
- package/dist/chunks/studio-zndrqawb.js +5 -0
- package/dist/chunks/studio-zwaxn5s2.js +5 -0
- package/dist/chunks/{tsMode-6vwhy6ty.js → tsMode-f54j66ym.js} +5 -5
- package/dist/chunks/workspace-home-x1787wpv.js +4 -0
- package/dist/chunks/workspace-zpe1np43.js +4 -0
- package/dist/chunks/{ws-client-zcxkfgmf.js → ws-client-e8kj684q.js} +3 -3
- package/dist/manifest.json +76 -75
- package/dist/studio.js +81 -82
- package/package.json +4 -4
- package/src/browse/library-model.ts +56 -23
- package/src/commands/context.ts +1 -0
- package/src/editor/shortcuts.ts +3 -0
- package/src/panels/data-grid.ts +0 -4
- package/src/panels/settings-menu.ts +3 -3
- package/src/panels/settings-pane.ts +42 -56
- package/src/services/ai-import-tools.ts +6 -3
- package/src/services/ai-models.ts +65 -11
- package/src/services/ai-settings.ts +45 -5
- package/src/services/document-assistant.ts +5 -2
- package/src/services/settings/definitions.ts +19 -0
- package/src/settings/contributed-section.ts +16 -7
- package/src/settings/css-vars-editor.ts +4 -4
- package/src/settings/general-settings.ts +1 -4
- package/src/settings/preferences-accounts.ts +2 -2
- package/src/settings/preferences-dialog.ts +4 -2
- package/src/settings/project-sections.ts +1 -1
- package/src/settings/section-registry.ts +5 -4
- package/src/settings/settings-document.ts +33 -24
- package/src/settings/settings-workspace.ts +205 -0
- package/src/shell.ts +31 -6
- package/src/surfaces/ai-credentials-form.json +59 -5
- package/src/surfaces/ai-credentials-form.ts +15 -2
- package/src/surfaces/commandbar.ts +7 -3
- package/src/surfaces/settings-contributed.json +4 -4
- package/src/surfaces/settings-contributed.ts +2 -2
- package/src/surfaces/settings-pane.json +262 -180
- package/src/surfaces/settings-pane.ts +63 -14
- package/src/ui/ai-credentials-form.ts +128 -11
- package/src/ui/regions.ts +5 -5
- package/src/workspace/tab-workspace.ts +3 -2
- package/src/workspace/workspace-home.ts +18 -4
- package/src/workspace/workspace-ids.ts +40 -7
- package/dist/chunks/adapter-xcpsmecx.js +0 -4
- package/dist/chunks/add-new-flow-ptmhmzr9.js +0 -4
- package/dist/chunks/cf-account-picker-z1sgwpwd.js +0 -4
- package/dist/chunks/cf-settings-xqvhxxe9.js +0 -4
- package/dist/chunks/components-whsc81a7.js +0 -4
- package/dist/chunks/content-source-jwtxg78w.js +0 -4
- package/dist/chunks/editor-zdqdpq1x.js +0 -4
- package/dist/chunks/entry-commands-w8p2fbpt.js +0 -4
- package/dist/chunks/extension-sections-y2p1te2r.js +0 -4
- package/dist/chunks/file-ops-13ab4swj.js +0 -4
- package/dist/chunks/files-zbc8p6v1.js +0 -4
- package/dist/chunks/format-host-zjsbktbx.js +0 -4
- package/dist/chunks/fs-events-t6x0hch6.js +0 -4
- package/dist/chunks/grid-open-fyzdwpkh.js +0 -4
- package/dist/chunks/iframe-host-kbyqc7pt.js +0 -4
- package/dist/chunks/index-6nvj89vb.js +0 -4
- package/dist/chunks/jx-validate-5sp8a4rm.js +0 -4
- package/dist/chunks/layers-panel-qrxj9vr2.js +0 -4
- package/dist/chunks/layers-tpzayggx.js +0 -4
- package/dist/chunks/lit-html-x6nrxsx3.js +0 -4
- package/dist/chunks/media-library-ywppnjrz.js +0 -4
- package/dist/chunks/media-picker-etxgc8qq.js +0 -4
- package/dist/chunks/monaco-buffer-qrnqhk0b.js +0 -4
- package/dist/chunks/notify-kcv38wwe.js +0 -4
- package/dist/chunks/parse-df2kkmhc.js +0 -4
- package/dist/chunks/platform-dtsysmyd.js +0 -4
- package/dist/chunks/publish-panel-evb1rcxt.js +0 -4
- package/dist/chunks/publish-workspace-ktk9h536.js +0 -4
- package/dist/chunks/quick-search-2f47fxcw.js +0 -4
- package/dist/chunks/references-5w6ajjv7.js +0 -4
- package/dist/chunks/right-panel-kz0a6byf.js +0 -4
- package/dist/chunks/source-control-1phx90zk.js +0 -4
- package/dist/chunks/studio-0hr000ba.js +0 -5
- package/dist/chunks/studio-1wyp7dt5.js +0 -5
- package/dist/chunks/studio-20ap8dds.js +0 -5
- package/dist/chunks/studio-291gqh98.js +0 -5
- package/dist/chunks/studio-4zqfw5ha.js +0 -5
- package/dist/chunks/studio-56egy6vf.js +0 -5
- package/dist/chunks/studio-695k95bw.js +0 -5
- package/dist/chunks/studio-732mw0g8.js +0 -5
- package/dist/chunks/studio-76t560kn.js +0 -6
- package/dist/chunks/studio-8486jn4r.js +0 -5
- package/dist/chunks/studio-8x8616xd.js +0 -5
- package/dist/chunks/studio-bkmv1h3e.js +0 -9
- package/dist/chunks/studio-cqf1k4qk.js +0 -5
- package/dist/chunks/studio-dbgv4fv9.js +0 -16
- package/dist/chunks/studio-et6t8g4m.js +0 -4
- package/dist/chunks/studio-f2j9et3h.js +0 -14
- package/dist/chunks/studio-fep7hr66.js +0 -7
- package/dist/chunks/studio-fyf7j57j.js +0 -5
- package/dist/chunks/studio-g5prntab.js +0 -5
- package/dist/chunks/studio-ga77mf07.js +0 -5
- package/dist/chunks/studio-h7gy12h2.js +0 -5
- package/dist/chunks/studio-j933k8nr.js +0 -5
- package/dist/chunks/studio-jgbvqcgh.js +0 -5
- package/dist/chunks/studio-k4xc5g6h.js +0 -5
- package/dist/chunks/studio-p0nf2e1f.js +0 -6
- package/dist/chunks/studio-pzfa2vmb.js +0 -5
- package/dist/chunks/studio-rf8d6p9f.js +0 -7
- package/dist/chunks/studio-rt498t2v.js +0 -5
- package/dist/chunks/studio-sd07xva5.js +0 -6
- package/dist/chunks/studio-thj81e98.js +0 -7
- package/dist/chunks/studio-tyw7tk0x.js +0 -5
- package/dist/chunks/studio-vffwe9k7.js +0 -5
- package/dist/chunks/studio-vxjap704.js +0 -5
- package/dist/chunks/studio-w67vfgy5.js +0 -5
- package/dist/chunks/studio-xebavr9s.js +0 -5
- package/dist/chunks/studio-yg5n49za.js +0 -5
- package/dist/chunks/studio-yhz5b313.js +0 -5
- package/dist/chunks/studio-zsjpsw08.js +0 -5
- package/dist/chunks/studio-zxm98z2m.js +0 -7
- package/dist/chunks/workspace-d65bz1qk.js +0 -4
- package/dist/chunks/workspace-home-vbg9b3jh.js +0 -4
- package/src/settings/settings-dialog.ts +0 -192
- package/src/surfaces/settings-dialog.json +0 -51
- package/src/surfaces/settings-dialog.ts +0 -169
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p,_e}from"./studio-w67vfgy5.js";import{Ne,Zw,xa,jc}from"./studio-nf0pqpbj.js";import{g}from"./studio-ahf3cspq.js";import{ln,Ia,Y,Cr,Up,h}from"./studio-j933k8nr.js";import{Ev}from"./studio-848rk4p1.js";import{Vc,Sa,tr}from"./studio-20ap8dds.js";import{Wr}from"./studio-va0e63sk.js";import{ZT,nl,Rb}from"./studio-695k95bw.js";import{mt}from"./studio-x2metr13.js";import{T,R,rt}from"./studio-cvz0e00f.js";import{Xn}from"./studio-ggm7zf70.js";import{gb}from"./studio-mwnmzx7g.js";import{Wu}from"./studio-pmzg17fj.js";import{Vy,GR,Zg,Cd,KR,JR,qk,Uy,qy}from"./studio-rf8d6p9f.js";import{cm}from"./studio-bkmv1h3e.js";import{Sw,Cw,bp}from"./studio-76t560kn.js";import{S,xn}from"./studio-rt498t2v.js";import{n,Z,v}from"./studio-zsjpsw08.js";import{le}from"./studio-0g2sm01j.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Ia(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function E(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function VR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>Cr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Up(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let u={fragment:E(i),type:"block"};if(r)Rb(e,{type:r.instruction},u,te(r,m));else Rb(e,{type:"make-child"},u,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};T("site-panel",O);function A(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function I(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...A(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,u,P,f)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=I(f,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=I(f,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=I(f,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,F=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await ZT(e)).contentType}async function se(e){let[t,a]=await Promise.all([cm(["pages","layouts"],p()),Ev()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));F=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let u=await gb(i).catch(()=>null);if(e===b&&u)l.set(i,u.length)})),e===b)C()}function pe(){if((!N||F)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Jg(e){if(b+=1,F=!0,x=null,e===void 0||e.some((t)=>me(t)))D=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var D=!1,M=!1;function de(){if(M||Zw&&!D||!_e())return;M=!0,D=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=Cd(a.tagName),o=`<${a.tagName}>`,s=L(a);if(!Zg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:Vy(s!==null&&s===t),tagName:a.tagName}]})}function L(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>Zg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:Vy(r.file===a),src:r.isImage?tr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...A(),filter:w};let e=GR(w),t=h.value?.documentPath??null,a=pe();de();let r=Wu(),o=a?KR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=JR(o,e),l=ge(),m=a?qk(a.layouts,t,"",l):[],i=a?qk(a.layouts,t,e,l):[],u=!Zw,P=_("",t),f=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:f,componentsCount:k(P.length,f.length,u),componentsState:j(u,P.length,f.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("zbc8p6v1"),import("./files-zbc8p6v1.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{rt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=L(t);if(a){U(a);return}rt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{rt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await Cw(a,e.cache);if(r&&c===e&&t.isConnected&&!qy(t))Uy(t,r)}function q(e,t,a){let r=Wr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{nl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:jc(t),type:"block"}:null}function ve(e){let t=Wu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:E({kind:Vc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:Sw(),handle:null,host:e,observer:bp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=L(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function UR(){Xn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>mt,afterRender:(e,t)=>{xe(we(t))}})}function qR(){if(c)G(c);c=null,w="",b+=1,N=null,F=!1,x=null,D=!0,M=!1}
|
|
2
|
-
export{
|
|
1
|
+
import{p,_e}from"./studio-jws1a87n.js";import{Ne,Zw,xa,Hc}from"./studio-sevbc3xv.js";import{g}from"./studio-y60sts62.js";import{ln,Da,Y,Cr,Gp,h}from"./studio-k2sz13zg.js";import{Ev}from"./studio-hz5n7x27.js";import{Uc,Sa,tr}from"./studio-f746039f.js";import{Wr}from"./studio-sxdb9h3q.js";import{eL,rl,Nb}from"./studio-rtfnhrdg.js";import{ft}from"./studio-9rbe2xpw.js";import{L,R,nt}from"./studio-0w2dr0q8.js";import{Xn}from"./studio-86r8hp7r.js";import{vb}from"./studio-r7pf0rkv.js";import{zu}from"./studio-egmw2837.js";import{Vy,XR,Qg,kd,QR,eD,Jk,Uy,qy}from"./studio-jeraxdgv.js";import{um}from"./studio-cg1bfyhf.js";import{Sw,Cw,vp}from"./studio-399xknkb.js";import{S,xn}from"./studio-cg710sk9.js";import{n,Z,v}from"./studio-8z66jk4z.js";import{le}from"./studio-j3d2fjqz.js";var X=new Map([["img","src"],["source","src"],["video","poster"]]);function ee(e,t,a=Ne){if(!e||t!=="image")return{mode:"insert"};let r=X.get(e.tagName);if(r)return{attr:r,mode:"replace-attr",path:e.path};if(e.tagName.includes("-")){let s=(a.find((l)=>l.tagName===e.tagName)?.props??[]).filter((l)=>Da(l.format));if(s.length===1)return{mode:"replace-prop",path:e.path,prop:s[0].name}}return{mode:"insert"}}function F(e){switch(e.kind){case"image":return{attributes:{src:e.ref},tagName:"img"};case"video":return{attributes:{controls:"",src:e.ref},tagName:"video"};case"audio":return{attributes:{controls:"",src:e.ref},tagName:"audio"};default:return{attributes:{href:e.ref},tagName:"a",textContent:e.name}}}function te(e,t){let a=[...e.targetPath],r=a.at(-1);if(t===0||!Z(r))return a;return a[a.length-1]=r+t,a}async function JR(e,t,a,r){if(!e||t.length===0)return;let o=await Sa(t),[s]=o;if(!s)return;let l=ee(a,s.kind);if(l.mode==="replace-attr"){Y(e,(m)=>Cr(m,l.path,l.attr,s.ref));return}if(l.mode==="replace-prop"){Y(e,(m)=>Gp(m,l.path,l.prop,s.ref));return}for(let[m,i]of o.entries()){let u={fragment:F(i),type:"block"};if(r)Nb(e,{type:r.instruction},u,te(r,m));else Nb(e,{type:"make-child"},u,[])}}var O={$schema:"https://jxsuite.com/schema/v1",$id:"StudioSitePanel",$description:"The Site panel (specs/studio.md §5.7): the project as an author thinks of it, pages by address and then the parts pages are made of. Four sections under a header holding one filter and a + that opens Add new (`file.new`, §9.1.1). `panels/site-panel.ts` keeps every decision: which files are pages, the route order and nesting (`panels/site-model.ts`, over `@jxsuite/site/routes`), how many entries a collection has and how many pages use a template, which media the project holds (the Media section is a short strip of the first few, and the rest are one click away in Media), what a click opens and what a drag inserts. This document draws rows whose every field is already a string, and a section state that is one of loading, empty, nomatch or listed, so a section a filter empties keeps its heading and says why. Component previews are an island the flow fills, and the drag sources are registered by the adapter through `onNodeCreated`.",tagName:"div",attributes:{part:"site"},style:{$description:"The Site panel's own look, keyed on `part`. Rows are native buttons, because a row opens one thing and a button is the element that says so to every reader; the selected row is the one whose `data-selected` is true, which the flow sets from the focused pane's document. A collection heading is not a button: it opens nothing in Design, and its pages are the buttons under it, indented one step. Component cards and media thumbnails are drag sources as well as buttons; the adapter registers the drags through `onNodeCreated`, so nothing here names a drag.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="filter"]':{flex:"1",minWidth:"0"},'& [part="sections"]':{flex:"1",minHeight:"0",overflowY:"auto",padding:"var(--jx-space-1) 0 var(--jx-space-4)"},'& [part="section"]':{padding:"var(--jx-space-2) 0"},'& [part="section-head"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3) var(--jx-space-1)"},'& [part="section-title"]':{margin:"0",fontSize:"var(--jx-text-sm)",fontWeight:"700",letterSpacing:"0.06em",textTransform:"uppercase",color:"var(--fg-dim)"},'& [part="section-count"]':{fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="open-media"]':{marginLeft:"auto"},'& [part="no-project"]':{margin:"0",padding:"var(--jx-space-6) var(--jx-space-4)",textAlign:"center",lineHeight:"1.5",color:"var(--fg-dim)"},'& [part="note"]':{margin:"0",padding:"var(--jx-space-1) var(--jx-space-3)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="rows"]':{display:"flex",flexDirection:"column"},'& [part="page-row"], & [part="template-row"], & [part="collection-row"]':{display:"flex",alignItems:"baseline",gap:"var(--jx-space-2)",width:"100%",boxSizing:"border-box",minHeight:"26px",padding:"var(--jx-space-1) var(--jx-space-3)",border:"none",background:"transparent",color:"inherit",font:"inherit",textAlign:"start"},'& [part="page-row"], & [part="template-row"]':{cursor:"pointer",":hover":{background:"var(--hover-bg)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"}},'& [part="page-row"][data-nested="true"]':{paddingLeft:"calc(var(--jx-space-3) + var(--jx-space-4))"},'& [data-selected="true"]':{background:"var(--accent-15)",color:"var(--fg)"},'& [part="collection-row"]':{color:"var(--fg-dim)"},'& [part="row-label"]':{flex:"1",minWidth:"0",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-detail"]':{flexShrink:"0",maxWidth:"55%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)"},'& [part="cards"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(96px, 1fr))",gap:"var(--jx-space-2)",padding:"0 var(--jx-space-3)"},'& [part="component-card"]':{display:"flex",flexDirection:"column",width:"100%",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-md)",background:"var(--bg-panel)",color:"inherit",font:"inherit",cursor:"grab",":hover":{borderColor:"var(--fg-dim)"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="card-preview"]':{$description:"A live render on the light document surface the Insert panel's element cards use (`--canvas-*` does not follow the theme, because what is drawn here is a page's part, and a site's dark text on the dark chrome read as an empty black box). It is drawn at half size, so a component laid out for a page shows its face rather than a clipped corner of one oversized glyph. The render is in the island's own shadow root (`mountPreview` in `browse/library-preview.ts`), so no rule here can reach its elements: the half size is the island's `zoom`, which lays the render out twice as wide and draws it at half, and the 128px height is the 64px box at that zoom. The broken-image rule went into the root with it.",position:"relative",height:"128px",zoom:"0.5",overflow:"hidden",pointerEvents:"none",background:"white",color:"var(--canvas-fg-2)",fontSize:"var(--jx-text-md)"},'& [part="card-label"]':{padding:"var(--jx-space-1) var(--jx-space-2)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontSize:"var(--jx-text-sm)",textAlign:"start"},'& [part="thumbs"]':{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(56px, 1fr))",gap:"var(--jx-space-1)",padding:"0 var(--jx-space-3)"},'& [part="media-strip"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-2)"},'& [part="media-more"]':{alignSelf:"flex-start",marginInline:"var(--jx-space-3)"},'& [part="media-thumb"]':{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",aspectRatio:"1",padding:"0",overflow:"hidden",border:"1px solid var(--border)",borderRadius:"var(--jx-radius-sm)",background:"var(--bg-panel)",color:"var(--fg-dim)",font:"inherit",cursor:"grab",":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"1px"}},'& [part="thumb-image"]':{width:"100%",height:"100%",objectFit:"cover"},'& [part="thumb-name"]':{padding:"var(--jx-space-1)",overflow:"hidden",fontSize:"var(--jx-text-xs)",wordBreak:"break-all"}},children:[{tagName:"div",attributes:{part:"header"},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{size:"sm",type:"search",clearable:!0,label:"Filter the site",placeholder:"Filter the site…",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"jx-action-button",attributes:{part:"add"},$props:{size:"sm",icon:"plus",label:"Add new",hint:"Add new",haspopup:"dialog"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/add"},value:[]}]}}]},{tagName:"div",attributes:{part:"body-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/body"},cases:{none:{tagName:"p",attributes:{part:"no-project"},textContent:"Open a project to see its pages, templates, components and media."},project:{tagName:"div",attributes:{part:"sections"},children:[{tagName:"section",attributes:{part:"section","data-section":"pages","aria-labelledby":"site-section-pages"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-pages"},textContent:"Pages"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.pagesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/pagesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No pages yet. Add one with +."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/pages"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"page-item",role:"listitem","data-kind":"${$map.item.kind}"},$switch:{$ref:"$map/item/kind"},cases:{collection:{tagName:"div",attributes:{part:"collection-row"},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},page:{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]},"entry-page":{tagName:"button",attributes:{part:"page-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}","data-nested":"true"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}}}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"templates","aria-labelledby":"site-section-templates"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-templates"},textContent:"Templates"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.templatesCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/templatesState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No templates in layouts/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"rows",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/templates"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"template-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"template-row",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-label"},textContent:"${$map.item.label}"},{tagName:"span",attributes:{part:"row-detail"},textContent:"${$map.item.detail}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"components","aria-labelledby":"site-section-components"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-components"},textContent:"Components"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.componentsCount}"}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/componentsState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No components yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"cards",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/components"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"card-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"component-card",type:"button","data-tag":"${$map.item.tagName}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"${$map.item.hint}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openComponent"},value:[{$ref:"$map/item/tagName"}]}]},children:[{$description:'The preview ISLAND: empty here, filled by the flow with the component rendered live from the Library\'s preview cache as the card scrolls into view (specs/studio-ui-guidelines.md §9.4). It is `inert`, not merely `aria-hidden`: a component\'s own links and buttons stay focusable under `aria-hidden`, and Chrome then counts their text into the card\'s name ("Contact Us Today Eer cta", "◀ ▶ Eer reviews"). Inert takes the render out of the accessibility tree, the tab order and the pointer at once, so the card is named by its label alone.',tagName:"div",attributes:{part:"card-preview",inert:""}},{tagName:"span",attributes:{part:"card-label"},textContent:"${$map.item.label}"}]}]}}]}}}]},{tagName:"section",attributes:{part:"section","data-section":"media","aria-labelledby":"site-section-media"},children:[{tagName:"div",attributes:{part:"section-head"},children:[{tagName:"h3",attributes:{part:"section-title",id:"site-section-media"},textContent:"Media"},{tagName:"span",attributes:{part:"section-count"},textContent:"${state.mediaCount}"},{tagName:"jx-button",attributes:{part:"open-media"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"Open Media"}]}]},{tagName:"div",attributes:{part:"section-body",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/mediaState"},cases:{loading:{tagName:"p",attributes:{part:"note"},textContent:"Reading the project…"},empty:{tagName:"p",attributes:{part:"note"},textContent:"No media in public/ yet."},nomatch:{tagName:"p",attributes:{part:"note"},textContent:"Nothing here matches the filter."},listed:{tagName:"div",attributes:{part:"media-strip"},children:[{tagName:"div",attributes:{part:"thumbs",role:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/media"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"thumb-item",role:"listitem"},children:[{tagName:"button",attributes:{part:"media-thumb",type:"button","data-path":"${$map.item.path}","data-selected":"${$map.item.selected}","aria-current":"${$map.item.selected === 'true' ? 'true' : null}",title:"Open ${$map.item.name} in Media, or drag it onto the canvas","aria-label":"${$map.item.name}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/open"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumb"},cases:{image:{tagName:"img",attributes:{part:"thumb-image",src:"${$map.item.src}",alt:"",loading:"lazy",draggable:"false"}},file:{tagName:"span",attributes:{part:"thumb-name"},textContent:"${$map.item.name}"}}}]}]}}]},{tagName:"jx-button",attributes:{part:"media-more",hidden:"${state.mediaMore === '' ? '' : null}"},$props:{size:"sm",variant:"secondary",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openMedia"},value:[]}]},children:[{tagName:"span",textContent:"${state.mediaMore}"}]}]}}}]}]}}}]};L("site-panel",O);function I(){return{body:"none",components:[],componentsCount:"",componentsState:"loading",filter:"",media:[],mediaCount:"",mediaMore:"",mediaState:"loading",pages:[],pagesCount:"",pagesState:"loading",templates:[],templatesCount:"",templatesState:"loading"}}function z(e,t){e.body=t.body,e.filter=t.filter,e.pages=t.pages,e.pagesState=t.pagesState,e.pagesCount=t.pagesCount,e.templates=t.templates,e.templatesState=t.templatesState,e.templatesCount=t.templatesCount,e.components=t.components,e.componentsState=t.componentsState,e.componentsCount=t.componentsCount,e.media=t.media,e.mediaState=t.mediaState,e.mediaCount=t.mediaCount,e.mediaMore=t.mediaMore}function ne(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function re(e){let t=e?.$map,a=v(t)?t.item:void 0;return v(a)?a:null}function E(e,t){let a=re(e)?.[t];return n(a)?a:""}function J(e,t,a,r){let o=g({...I(),...a});z(o,t);let s=null,l=!1,m=R("site-panel",o,e,{onNodeCreated:(i,u,P,f)=>{if(l||!(i instanceof HTMLElement))return;switch(ne(P)){case"card-preview":{let d=E(f,"tagName");if(d!=="")r.preview(i,d);break}case"component-card":{let d=E(f,"tagName");if(d!=="")r.componentSource(i,d);break}case"media-thumb":{let d=E(f,"path");if(d!=="")r.mediaSource(i,d);break}default:break}}}).then((i)=>{if(l)return i.dispose(),i;return s=i,i});return{connected:()=>!l&&(s===null||s.root.parentNode===e),dispose(){l=!0,s?.dispose(),s=null},ready:m,update:(i)=>{z(o,i)}}}var N=null,D=!1,x=null,b=0;function ie(){return Object.keys(S?.projectConfig?.content??{})}async function oe(e){return(await eL(e)).contentType}async function se(e){let[t,a]=await Promise.all([um(["pages","layouts"],p()),Ev()]),r=t.files.filter((i)=>i.path.startsWith("pages/")),o=await Promise.all(r.map(async(i)=>({contentType:i.path.includes("[")?await oe(i.path):null,path:i.path})));if(e!==b)return;let s=N?.collections,l=new Map(ie().map((i)=>[i,s?.get(i)??null]));D=!1,N={collections:l,layouts:t.files.flatMap((i)=>i.path.startsWith("layouts/")?[i.path]:[]),pageExtensions:a,pages:o},C();let m=new Set(o.flatMap((i)=>i.contentType&&l.has(i.contentType)?[i.contentType]:[]));if(await Promise.all([...m].map(async(i)=>{let u=await vb(i).catch(()=>null);if(e===b&&u)l.set(i,u.length)})),e===b)C()}function pe(){if((!N||D)&&!x&&_e()&&S){let e=b;x=se(e).finally(()=>{if(e===b)x=null})}return N}function Zg(e){if(b+=1,D=!0,x=null,e===void 0||e.some((t)=>me(t)))T=!0;if(c)C()}var ce=["pages/","layouts/","content/","public/"];function me(e){if(e.startsWith("components/"))return!0;return e.endsWith(".json")&&e!=="project.json"&&!ce.some((t)=>e.startsWith(t))}var T=!1,M=!1;function de(){if(M||Zw&&!T||!_e())return;M=!0,T=!1,xa().finally(()=>{M=!1,C()})}function _(e,t){return Ne.flatMap((a)=>{let r=kd(a.tagName),o=`<${a.tagName}>`,s=A(a);if(!Qg(e,a.tagName,s??"",a.package??""))return[];return[{hint:s?`Open ${o}, or drag it onto the canvas`:`${o} from ${a.package??"a package"}: open Packages, or drag it onto the canvas`,key:a.tagName,label:r,path:s??"",selected:Vy(s!==null&&s===t),tagName:a.tagName}]})}function A(e){return e?.path!==void 0&&e.source!=="npm"?e.path:null}var V=8;function ue(e,t){return e>t?`Show all ${e} in Media`:""}function W(e,t,a){return e.flatMap((r)=>Qg(t,r.name,r.file)?[{key:r.file,name:r.name,path:r.file,selected:Vy(r.file===a),src:r.isImage?tr(r.file):"",thumb:r.isImage?"image":"file"}]:[])}function ge(){let e=S?.projectConfig?.defaults?.layout;return n(e)?e.replace(/^\.\//,""):null}var w="";function j(e,t,a){if(e)return"loading";if(t===0)return"empty";return a===0?"nomatch":"listed"}function k(e,t,a){if(a||e===0)return"";return t===e?String(e):`${t} of ${e}`}function B(){if(!S)return{...I(),filter:w};let e=XR(w),t=h.value?.documentPath??null,a=pe();de();let r=zu(),o=a?QR(a.pages,a.collections,t,{extensions:a.pageExtensions,i18n:ln(S.projectConfig??{}).i18n}):[],s=eD(o,e),l=ge(),m=a?Jk(a.layouts,t,"",l):[],i=a?Jk(a.layouts,t,e,l):[],u=!Zw,P=_("",t),f=_(e,t),d=r?W(r,"",t):[],y=r?W(r,e,t):[],H=(K)=>K.filter((Q)=>Q.kind!=="collection").length;return{body:"project",components:f,componentsCount:k(P.length,f.length,u),componentsState:j(u,P.length,f.length),filter:w,media:y.slice(0,V),mediaCount:k(d.length,y.length,r===null),mediaMore:ue(y.length,Math.min(y.length,V)),mediaState:j(r===null,d.length,y.length),pages:s,pagesCount:k(H(o),H(s),a===null),pagesState:j(a===null,o.length,s.length),templates:i,templatesCount:k(m.length,i.length,a===null),templatesState:j(a===null,m.length,i.length)}}function U(e){(le("b2tcppdd"),import("./files-b2tcppdd.js")).then(({openFileInTab:t})=>t(e))}var fe={add:()=>{nt("file.new",{},"Site panel")},open:U,openComponent:(e)=>{let t=Ne.find((r)=>r.tagName===e);if(!t)return;let a=A(t);if(a){U(a);return}nt("view.setActivity",{tab:"packages"},"Site panel")},openMedia:()=>{nt("view.setWorkspace",{workspace:"media"},"Site panel")},setFilter:(e)=>{w=e,C()}},c=null;async function he(e,t,a){let r=await Cw(a,e.cache);if(r&&c===e&&t.isConnected&&!qy(t))Uy(t,r)}function q(e,t,a){let r=Wr({element:t,getInitialData:()=>a()??{},onGenerateDragPreview:({nativeSetDragImage:o})=>{rl({nativeSetDragImage:o})}});e.sources.set(t,r)}function be(e){for(let[t,a]of e.sources)if(!t.isConnected)a(),e.sources.delete(t);e.observer.releaseDetached()}function G(e){e.handle?.dispose();for(let t of e.sources.values())t();e.sources.clear(),e.observer.destroy(),e.cache.clear()}function ye(e){let t=Ne.find((a)=>a.tagName===e);return t?{fragment:Hc(t),type:"block"}:null}function ve(e){let t=zu()?.find((r)=>r.file===e);if(!t)return null;return{fragment:F({kind:Uc({name:t.name}),name:t.name,path:t.file,ref:t.ref}),type:"block"}}function xe(e){if(c&&(c.host!==e||c.handle?.connected()===!1))G(c),c=null;if(c){c.handle?.update(B()),be(c);return}let t=new Map,a={cache:Sw(),handle:null,host:e,observer:vp((r)=>{let o=r instanceof HTMLElement?t.get(r):void 0;if(o!==void 0&&r instanceof HTMLElement)t.delete(r),he(a,r,o)}),pending:t,sources:new Map};c=a,a.handle=J(e,B(),fe,{componentSource:(r,o)=>{q(a,r,()=>ye(o))},mediaSource:(r,o)=>{q(a,r,()=>ve(o))},preview:(r,o)=>{let s=A(Ne.find((l)=>l.tagName===o));if(s)t.set(r,s),a.observer.observe(r)}})}function C(){xn("leftPanel")}function we(e){return e.querySelector(".panel-content")??e}function YR(){Xn({id:"site",title:"Site",level:"project",dock:"navigator",icon:"browser",render:()=>ft,afterRender:(e,t)=>{xe(we(t))}})}function ZR(){if(c)G(c);c=null,w="",b+=1,N=null,D=!1,x=null,T=!0,M=!1}
|
|
2
|
+
export{JR,Zg,YR,ZR};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=CB1BE9E6DD0393F664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-v1yascv2.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n,Z,_}from"./studio-
|
|
2
|
-
export{Se,oe,Lv,$v,FC,
|
|
1
|
+
import{n,Z,_}from"./studio-8z66jk4z.js";function y(t){return JSON.parse(JSON.stringify(t))}function Se(t){return t===void 0||t===null?t:y(t)}function oe(t,e){let r=t;for(let o of e){if(r==null)return;r=r[o]}return r}function Lv(t){if(Array.isArray(t))throw TypeError("Cannot insert into a children array; parentPath must point at a node");if(!t.children)t.children=[];if(!Array.isArray(t.children))throw TypeError("Cannot insert into mapped-array children; edit the map template instead");return t.children}function $v(t,e){let{op:r}=e;switch(e.op){case"set-key":{let o=oe(t,e.path);if(!o)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(e.value===void 0)delete o[e.key];else o[e.key]=Se(e.value);return}case"insert-child":{l(t,e.parentPath).splice(e.index,0,Se(e.node));return}case"remove-child":{l(t,e.parentPath).splice(e.index,1);return}case"set-child":{l(t,e.parentPath).splice(e.index,1,Se(e.node));return}case"move-child":{P(e);let o=l(t,e.fromParentPath),a=l(t,e.toParentPath),[i]=o.splice(e.fromIndex,1);a.splice(e.toIndex,0,i);return}default:break}throw Error(`unknown-doc-op:${r}`)}function l(t,e){let r=oe(t,e);if(r==null)throw TypeError(`doc-op-node-not-found:${e.join("/")}`);return Lv(r)}function FC(t,e,r,o,a){let i=t.length,c=i<e.length&&t.every((s,u)=>s===e[u]),d=e[i+1];if(!c||e[i]!=="children"||!Z(d))return e;if(a?d<r:d<=r)return e;let h=[...e];return h[i+1]=d+o,h}function P(t){let e=[...t.fromParentPath,"children",t.fromIndex],r=t.toParentPath;if(r.length>=e.length&&e.every((o,a)=>o===r[a]))throw Error(`doc-op-move-into-self:${r.join("/")}`)}function lf(t,e){return t<0?Math.max(e+t,0):Math.min(t,e)}function jC(t,e){let{op:r}=e;switch(b(e),e.op){case"set-key":{let o=oe(t,e.path);if(o===void 0)throw Error(`doc-op-node-not-found:${e.path.join("/")}`);if(!_(o)||Array.isArray(o))throw TypeError(`doc-op-not-a-node:${e.path.join("/")}`);let a=Se(o[e.key]);return a===void 0?{key:e.key,op:"set-key",path:e.path}:{key:e.key,op:"set-key",path:e.path,value:a}}case"insert-child":{let{length:o}=f(t,e.parentPath);return{index:lf(e.index,o),op:"remove-child",parentPath:e.parentPath}}case"remove-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"insert-child",parentPath:e.parentPath}}case"set-child":{let o=x(t,e.parentPath,e.index);return{index:e.index,node:o,op:"set-child",parentPath:e.parentPath}}case"move-child":{P(e);let o=J(t,e.fromParentPath);m(o,e.fromParentPath,e.fromIndex);let a=f(t,e.toParentPath),i=lf(e.toIndex,a.length-(a===o?1:0));return{fromIndex:i,fromParentPath:FC(e.fromParentPath,e.toParentPath,e.fromIndex,-1,!1),op:"move-child",toIndex:e.fromIndex,toParentPath:FC(e.toParentPath,e.fromParentPath,i,1,!0)}}default:break}throw Error(`unknown-doc-op:${r}`)}function b(t){let e=[];if(t.op==="move-child")e.push([t.fromParentPath,t.fromIndex],[t.toParentPath,t.toIndex]);else if(t.op==="insert-child"||t.op==="remove-child"||t.op==="set-child")e.push([t.parentPath,t.index]);for(let[r,o]of e)if(!Number.isInteger(o))throw TypeError(`doc-op-index:${[...r,"children",String(o)].join("/")}`)}function J(t,e){let r=oe(t,e);return r&&Array.isArray(r.children)?r.children:null}function m(t,e,r){if(!t||r<0||r>=t.length)throw Error(`doc-op-node-not-found:${[...e,"children",r].join("/")}`)}function x(t,e,r){let o=J(t,e);return m(o,e,r),Se(o[r])}function f(t,e){let r=oe(t,e);if(!_(r)||Array.isArray(r))throw Error(`doc-op-node-not-found:${e.join("/")}`);if(r.children===void 0)return[];if(!Array.isArray(r.children))throw TypeError(`doc-op-mapped-children:${e.join("/")}`);return r.children}function na(t,e){if(t.length>e.length)return!1;return t.every((r,o)=>r===e[o])}function g(t,e){let r=Math.min(t.length,e.length);for(let o=0;o<r;o++){let a=t[o],i=e[o];if(a===i)continue;if(Z(a)&&Z(i))return a-i;return String(a)<String(i)?-1:1}return t.length-e.length}function w(t){let e=[];for(let r of t)if(!t.some((o)=>!v(o,r)&&na(o,r)))e.push([...r]);return e}function v(t,e){return t.length===e.length&&na(t,e)}function cf(t){let e=t?.at(-1);return t&&t.at(-2)==="children"&&Z(e)?{index:e,parentPath:t.slice(0,-2)}:null}function eu(t){return cf(t)!==null}function Xm(t){return w(t).filter((e)=>eu(e)).toSorted((e,r)=>g(r,e))}function qx(t){if(Z(t)&&Number.isInteger(t))return t;return n(t)&&/^(?:0|[1-9]\d*)$/.test(t)?Number(t):null}function Gx(t,e,r,o){let a=cf(e),i=a&&oe(t,a.parentPath),c=oe(t,r);if(!a||!i||!Array.isArray(i.children)||!c)return null;if(i.children[a.index]===void 0)return null;let d=i===c,h=d&&a.index<o?o-1:o,s=Array.isArray(c.children)?c.children.length:0,u={fromIndex:a.index,fromParentPath:a.parentPath,op:"move-child",toIndex:lf(h,s-(d?1:0)),toParentPath:r},p=jC(t,u);return{forward:u,inverse:p}}
|
|
2
|
+
export{Se,oe,Lv,$v,FC,lf,jC,na,cf,eu,Xm,qx,Gx};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=5CE3C96C2660970E64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-wc6za3zs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{m,_i,jt}from"./studio-j933k8nr.js";import{ge,ne,g}from"./studio-ahf3cspq.js";import{nn}from"./studio-5dmgmyw4.js";import{Md,Vc,ZL,Hb,tr}from"./studio-20ap8dds.js";import{xp}from"./studio-732mw0g8.js";import{Dd,Nd,qu,_p,WT}from"./studio-vcz63n42.js";import{Ow,Gu,lN}from"./studio-qyb5bebs.js";import{xi,T,R}from"./studio-cvz0e00f.js";import{le}from"./studio-0g2sm01j.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};T("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function FT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function Dw(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function jT(e){let t=nn(e);if(ZL.has(t))return"font";let a=Vc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function HT(e,t){let a=[Vc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(WT(t.bytes));if(t?.modified)a.push(`modified ${xp(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function BT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${tr(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function zT(e){let t=lN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function C(e){let{openFileInTab:t}=await (le("zbc8p6v1"),import("./files-zbc8p6v1.js"));await t(e)}function iN(e,t){let{paneId:a,wrap:r}=e;if(FT(a,t))return;Dw(a);let i=t.documentPath??"",s=tr(i),p=Hb(i),n=nn(i),x=jT(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Nd(i),l=Ow(i);if(!Dd(i))qu(i).then(u);if(l===null||l.status==="pending")Gu(i).then(u);let f=BT(i);return{extLabel:n||"this file",facts:HT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:xi(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...zT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(_p(i,d,l))u()},openDocument:(d)=>{C(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var H={children:[],tagName:"div"};function Nw(e){return Md(e)}function A(e){return nn(e)===".svg"?[b,"source"]:[b]}function ym(e,t={}){let a=m.tabs.get(e);if(a)return jt(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:A(e)},document:structuredClone(H),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
|
|
2
|
-
export{
|
|
1
|
+
import{m,_i,Pt}from"./studio-k2sz13zg.js";import{ge,ne,g}from"./studio-y60sts62.js";import{tn}from"./studio-8wnvtr4z.js";import{Pd,Uc,e$,zb,tr}from"./studio-f746039f.js";import{_p}from"./studio-s5tzw84t.js";import{Nd,Ad,Uu,Sp,qT}from"./studio-5frqk7c0.js";import{Ow,qu,pN}from"./studio-0q5jwddh.js";import{Qn,L,R}from"./studio-0w2dr0q8.js";import{le}from"./studio-j3d2fjqz.js";var M={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaPane",$description:"The Media viewer: a pane that SHOWS a file the studio has no document model for — an image at its own size, a video or audio player, an embedded PDF, a font set in a pangram, or an honest line about a format nothing here can draw. The adapter hands in one projection: which of the six stages to draw, the URL that loads it, the file's name and facts, the reference a document would write for it, and the documents that already do. Nothing here decides anything; a control asks the host to copy, to open a path, or to record the pixel size the browser just learned.",tagName:"div",attributes:{part:"viewer","data-jx-region":"${state.region}"},style:{$description:"What `.media-viewer`, `.media-stage`, `.media-image`, `.media-video`, `.media-embed`, `.media-audio`, `.media-specimen`, `.media-specimen-line`, `.media-unviewable`, `.media-note`, `.media-details`, `.media-name`, `.media-facts`, `.media-ref`, `.media-ref-value`, `.media-usage`, `.media-usage-title`, `.media-usage-headline`, `.media-usage-list`, `.media-usage-link` and `.media-usage-count` said in `styles/overlays.css`, keyed on `part` and re-pointed at the studio token layer. All twenty-two were this surface's alone, so the stylesheet block goes with the conversion rather than being copied. Eight `var(--spectrum-font-size-…)` names could not come with the declarations: every one of them resolves only inside `<sp-theme>`, and this document is mounted in a pane stage that is outside it, so each would silently have taken its hex fallback — they are the kit's `--jx-text-xs`, `--jx-text-sm`, `--jx-text-md` and `--jx-text-lg` instead.",height:"100%",display:"flex",gap:"var(--jx-space-5)",padding:"var(--jx-space-5)",overflowY:"auto",background:"var(--bg-panel)",fontFamily:"var(--jx-font-sans)",color:"var(--fg)",'& [part="asset-slot"], & [part="usage-slot"], & [part="list-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"},'& [part="stage"]':{$description:"The asset takes the room and the details column keeps a fixed width, so the file is the thing being looked at and the facts about it are beside it rather than on top of it.",flex:"1",minWidth:"0",display:"flex",alignItems:"flex-start",justifyContent:"center"},'& [part="image"]':{$description:"Never larger than its own pixels: an upscaled thumbnail is a lie about the asset, and judging whether an imported image is big enough is the whole reason somebody opens this.",maxWidth:"100%",height:"auto",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="video"], & [part="embed"]':{width:"100%",maxHeight:"70vh",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)"},'& [part="audio"]':{width:"100%"},'& [part="specimen"]':{$description:"A font is shown by being USED. The face itself arrives as a `@font-face` the adapter writes, under a family name generated from the path so two specimens open side by side cannot claim the same one; the element carries only that NAME, as a custom property, and the fallback stack that catches a face the browser refuses stays here where it is a rule rather than data.",width:"100%",padding:"var(--jx-space-5)",border:"1px solid var(--border)",borderRadius:"var(--radius)",background:"var(--bg-input)",color:"var(--fg)",fontFamily:"var(--jx-specimen-family, system-ui), system-ui, sans-serif"},'& [part="specimen-line"]':{margin:"0 0 var(--jx-space-4)",lineHeight:"1.3",overflowWrap:"anywhere"},'& [part="specimen-line"][data-size="48"]':{fontSize:"48px"},'& [part="specimen-line"][data-size="32"]':{fontSize:"32px"},'& [part="specimen-line"][data-size="24"]':{fontSize:"24px"},'& [part="specimen-line"][data-size="18"]':{fontSize:"18px"},'& [part="specimen-line"][data-size="14"]':{fontSize:"var(--jx-text-lg)"},'& [part="unviewable"]':{$description:"Not a failure state. A file the browser cannot render is a zip, or a format this build has never heard of, so the box says what the file IS and that the project still builds with it in.",padding:"var(--jx-space-6)",border:"1px dashed var(--border)",borderRadius:"var(--radius)",color:"var(--fg-dim)",textAlign:"center"},'& [part="note"]':{fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="details"]':{flex:"0 0 260px",display:"flex",flexDirection:"column",gap:"var(--jx-space-4)"},'& [part="title"]':{margin:"0",fontSize:"var(--jx-text-lg)",color:"var(--fg)",overflowWrap:"anywhere"},'& [part="facts"]':{$description:'Kind, pixel size, bytes and modified date, joined by the adapter. Each is omitted rather than zeroed when it is not known: a real file can almost be `0 × 0` or `0 B`, so neither may double as "we did not find out".',margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="ref"]':{$description:"The reference a document writes for this file — `/hero.jpg` for `public/hero.jpg`, which shares not one segment with it. Getting this wrong is the commonest way an image goes missing from a page, which is why it is on screen next to a button that copies it.",display:"flex",alignItems:"center",gap:"6px"},'& [part="ref-value"]':{flex:"1",minWidth:"0",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-sm)",background:"var(--bg-input)",border:"1px solid var(--border)",borderRadius:"var(--radius)",padding:"3px 6px",overflowWrap:"anywhere"},'& [part="usage"]':{display:"flex",flexDirection:"column"},'& [part="group-title"]':{margin:"0 0 var(--jx-space-2)",fontSize:"var(--jx-text-md)",fontWeight:"500",color:"var(--fg-dim)"},'& [part="message"]':{margin:"0",fontSize:"var(--jx-text-md)",color:"var(--fg-dim)"},'& [part="list"]':{listStyle:"none",margin:"var(--jx-space-3) 0 0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)"},'& [part="row"]':{display:"flex",alignItems:"baseline",gap:"6px",fontSize:"var(--jx-text-md)"},'& [part="file-path"]':{$description:'The path is a control, not a label: it opens the document that references this file. A plain button rather than a `jx-button`, for the reason the Problems rows give — what it has to look like is a line of text, and every fill, border and control height the kit draws would have to be taken back off again. Named `file-path` and not `path` because `jx-icon` puts `part="path"` on the `<path>` of every glyph it draws, so `[part="path"]` would select this button and any SVG path beside it.',flex:"1",minWidth:"0",margin:"0",padding:"0",background:"none",border:"none",borderRadius:"var(--jx-radius-xs)",textAlign:"left",color:"var(--accent)",cursor:"pointer",font:"inherit",overflowWrap:"anywhere",":hover":{textDecoration:"underline"},":focus-visible":{outline:"var(--jx-focus-ring)",outlineOffset:"2px"}},'& [part="count"]':{flex:"0 0 auto",fontFamily:"var(--font-mono)",fontSize:"var(--jx-text-xs)",color:"var(--fg-dim)"}},children:[{tagName:"div",attributes:{part:"stage"},children:[{tagName:"div",attributes:{part:"asset-slot",role:"none"},$switch:{$ref:"#/state/kind"},cases:{image:{tagName:"img",attributes:{part:"image",src:"${state.src}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/imageLoaded"},value:[{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}],description:"The only honest source of pixel dimensions in a browser is an image that has loaded, and this viewer is showing one at full size anyway. The host decides whether the numbers are new; a repeat load of the same picture must not repaint the pane."}},video:{tagName:"video",attributes:{part:"video",src:"${state.src}",controls:!0}},audio:{tagName:"audio",attributes:{part:"audio",src:"${state.src}",controls:!0}},embed:{tagName:"embed",attributes:{part:"embed",src:"${state.src}",type:"application/pdf",title:"${state.name}"}},font:{tagName:"div",attributes:{part:"specimen",style:"${state.specimenFamily}"},children:[{tagName:"style",textContent:"${state.fontFace}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"48"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"32"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"24"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"18"},textContent:"${state.specimen}"},{tagName:"p",attributes:{part:"specimen-line","data-size":"14"},textContent:"${state.specimen}"}]},unviewable:{tagName:"div",attributes:{part:"unviewable"},children:[{tagName:"p",children:[{tagName:"span",textContent:"Jx has no viewer for "},{tagName:"code",textContent:"${state.extLabel}"},{tagName:"span",textContent:"."}]},{tagName:"p",attributes:{part:"note"},textContent:"The file is in the project and builds normally."}]}}}]},{tagName:"div",attributes:{part:"details"},children:[{tagName:"h3",attributes:{part:"title"},textContent:"${state.name}"},{tagName:"p",attributes:{part:"facts"},textContent:"${state.facts}"},{tagName:"div",attributes:{part:"ref"},children:[{tagName:"code",attributes:{part:"ref-value"},textContent:"${state.ref}"},{tagName:"jx-action-button",$props:{size:"sm",quiet:!0,hint:"Copy the reference"},attributes:{part:"copy"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/copyRef"}}]},children:[{tagName:"span",textContent:"Copy"}]}]},{tagName:"div",attributes:{part:"usage-slot",role:"none"},$switch:{$ref:"#/state/usageState"},cases:{shown:{tagName:"div",attributes:{part:"usage"},children:[{tagName:"h4",attributes:{part:"group-title"},textContent:"Used by"},{tagName:"p",attributes:{part:"message"},textContent:"${state.usageHeadline}"},{tagName:"div",attributes:{part:"list-slot",role:"none"},$switch:{$ref:"#/state/hasUsageFiles"},cases:{true:{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/usageFiles"},key:{$ref:"$map/item/path"},map:{tagName:"li",attributes:{part:"row","data-usage":"${$map.item.path}"},children:[{tagName:"button",attributes:{part:"file-path",type:"button"},textContent:"${$map.item.path}",onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openDocument"},value:[{$ref:"$map/item/path"}]}]}},{tagName:"span",attributes:{part:"count"},textContent:"${$map.item.count}"}]}}]}}}]}}}]}]};L("media-pane",M);function S(e,t){e.region=t.region,e.name=t.name,e.kind=t.kind,e.src=t.src,e.facts=t.facts,e.ref=t.ref,e.specimen=t.specimen,e.specimenFamily=t.specimenFamily,e.fontFace=t.fontFace,e.extLabel=t.extLabel,e.usageState=t.usageState,e.usageHeadline=t.usageHeadline,e.usageFiles=t.usageFiles,e.hasUsageFiles=t.usageFiles.length>0}function F(e,t,a){e.replaceChildren();let r=g({copyRef:a.copyRef,extLabel:"",facts:"",fontFace:"",hasUsageFiles:!1,imageLoaded:a.imageLoaded,kind:"unviewable",name:"",openDocument:a.openDocument,ref:"",region:"",specimen:"",specimenFamily:"",src:"",usageFiles:[],usageHeadline:"",usageState:"hidden"});S(r,t);let i=null,s=!1,p=R("media-pane",r,e).then((n)=>{if(s)n.dispose();else i=n;return n.root});return{attached:()=>{if(s)return!1;let n=i?.root;return n===void 0?!0:n instanceof HTMLElement&&e.contains(n)},dispose(){s=!0,i?.dispose(),i=null},ready:p,update:(n)=>S(r,n)}}var b="media",k="The quick brown fox jumps over the lazy dog",c=new Map;function h(e){return c.get(e)??null}function BT(e,t){let a=h(e);return a!==null&&a.tabId===t.id&&a.wrap.isConnected&&a.surface.attached()}function Dw(e){let t=c.get(e);if(!t)return;t.scope.stop(),t.surface.dispose(),c.delete(e)}function zT(e){let t=tn(e);if(e$.has(t))return"font";let a=Uc({name:e});if(a==="image"||a==="video"||a==="audio")return a;return t===".pdf"?"embed":"unviewable"}function WT(e,t){let a=[Uc({name:e})];if(t?.width!=null&&t.height!=null)a.push(`${t.width} × ${t.height}`);if(t?.bytes!=null)a.push(qT(t.bytes));if(t?.modified)a.push(`modified ${_p(new Date(t.modified))}`);return a.join(" · ")}function z(e){return`jx-specimen-${e.replaceAll(/[^a-zA-Z0-9]/g,"-")}`}function VT(e){let t=z(e);return{fontFace:`@font-face { font-family: "${t}"; src: url("${tr(e)}"); }`,specimen:k,specimenFamily:`--jx-specimen-family: "${t}"`}}function UT(e){let t=pN(e);if(t===null)return{usageFiles:[],usageHeadline:"",usageState:"hidden"};return{usageFiles:(e?.status==="ready"?e.result.files:[]).map((r)=>({count:String(r.count),path:r.path})),usageHeadline:t,usageState:"shown"}}async function T(e){let{openFileInTab:t}=await (le("b2tcppdd"),import("./files-b2tcppdd.js"));await t(e)}function lN(e,t){let{paneId:a,wrap:r}=e;if(BT(a,t))return;Dw(a);let i=t.documentPath??"",s=tr(i),p=zb(i),n=tn(i),x=zT(i),o=null,u=()=>{if(o!==null&&h(a)===o)y()},v=()=>{let d=Ad(i),l=Ow(i);if(!Nd(i))Uu(i).then(u);if(l===null||l.status==="pending")qu(i).then(u);let f=VT(i);return{extLabel:n||"this file",facts:WT(i,d),fontFace:x==="font"?f.fontFace:"",kind:x,name:i.split("/").pop()??"",ref:p,region:Qn(a,"media"),specimen:f.specimen,specimenFamily:f.specimenFamily,src:s,...UT(l)}},y=()=>{o?.surface.update(v())},w=ge(),N=F(r,v(),{copyRef:()=>{if("clipboard"in navigator)navigator.clipboard.writeText(p)},imageLoaded:(d,l)=>{if(Sp(i,d,l))u()},openDocument:(d)=>{T(d)}});o={paneId:a,scope:w,surface:N,tabId:t.id,wrap:r},c.set(a,o),w.run(()=>{ne(()=>{if(h(a)!==o)return;t.documentPath,y()})})}var C={children:[],tagName:"div"};function Nw(e){return Pd(e)}function H(e){return tn(e)===".svg"?[b,"source"]:[b]}function xm(e,t={}){let a=m.tabs.get(e);if(a)return Pt(e,{focus:t.focus!==!1}),a;return _i({capabilities:{modes:H(e)},document:structuredClone(C),documentPath:e,id:e,sourceFormat:null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1}})}
|
|
2
|
+
export{BT,Dw,zT,WT,VT,UT,lN,Nw,xm};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=4A9429D8EF09643F64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-wxq6v5sv.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Z}from"./studio-zsjpsw08.js";function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var Ke=Object.prototype.hasOwnProperty,j=(e,t)=>Ke.call(e,t),A=Array.isArray,k=(e)=>me(e)==="[object Map]";var he=(e)=>typeof e==="function",ze=(e)=>typeof e==="string",O=(e)=>typeof e==="symbol",R=(e)=>e!==null&&typeof e==="object";var We=Object.prototype.toString,me=(e)=>We.call(e),_e=(e)=>me(e).slice(8,-1);var H=(e)=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ge=/-\w/g,_t=U((e)=>e.replace(Ge,(t)=>t.slice(1).toUpperCase())),$e=/\B([A-Z])/g,yt=U((e)=>e.replace($e,"-$1").toLowerCase()),ye=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vt=U((e)=>e?`on${ye(e)}`:""),E=(e,t)=>!Object.is(e,t);var Ye="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Et=q(Ye+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class Se{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function ge(e){return new Se(e)}function ea(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Te(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ve(this),Ne(this);let e=f,t=_;f=this,_=!0;try{return this.fn()}finally{xe(this),f=e,_=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ve(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(ee(this))this.run()}get dirty(){return ee(this)}}var we=0,M,L;function Te(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function se(){we++}function oe(){if(--we>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function Ne(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xe(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Be(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ee(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ae(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ae(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ee(e)))return;e.flags|=2;let t=e.dep,n=f,r=_;f=e,_=!0;try{Ne(e);let i=e.fn(e._value);if(t.version===0||E(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,_=r,xe(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Be(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function ne(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var _=!0,Oe=[];function Kr(){Oe.push(_),_=!1}function Jr(){let e=Oe.pop();_=e===void 0?!0:e}function PC(e,t=!1){if(f instanceof W)f.cleanup=e}function ve(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Re{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!_||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Re(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;De(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){se();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{oe()}}}function De(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)De(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,N=Symbol(""),ie=Symbol(""),V=Symbol("");function h(e,t,n){if(_&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function w(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(se(),t==="clear")o.forEach(a);else{let c=A(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,m)=>{if(m==="length"||m===V||!O(m)&&m>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}break;case"set":if(k(e))a(o.get(N));break}}}oe()}function D(e){let t=de(e);if(t===e)return t;if(h(t,"iterate",V),T(e))return t;if(!S(e))return t.map(v);return _v(e)?t.map((n)=>x(v(n))):t.map(x)}function ce(e){return h(e=de(e),"iterate",V),e}function y(e,t){if(S(e))return _v(e)?x(v(t)):x(t);return v(t)}var qe={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>y(this,e))},concat(...e){return D(this).concat(...e.map((t)=>A(t)?D(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=y(this,e[1]),e))},every(e,t){return b(this,"every",e,t,void 0,arguments)},filter(e,t){return b(this,"filter",e,t,(n)=>n.map((r)=>y(this,r)),arguments)},find(e,t){return b(this,"find",e,t,(n)=>y(this,n),arguments)},findIndex(e,t){return b(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return b(this,"findLast",e,t,(n)=>y(this,n),arguments)},findLastIndex(e,t){return b(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return b(this,"forEach",e,t,void 0,arguments)},includes(...e){return Q(this,"includes",e)},indexOf(...e){return Q(this,"indexOf",e)},join(e){return D(this).join(e)},lastIndexOf(...e){return Q(this,"lastIndexOf",e)},map(e,t){return b(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return be(this,"reduce",e,t)},reduceRight(e,...t){return be(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return b(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return D(this).toReversed()},toSorted(e){return D(this).toSorted(e)},toSpliced(...e){return D(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>y(this,e))}};function J(e,t,n){let r=ce(e),i=r[t],s=i.call(r);if(r!==e&&!T(e)){if(s[Symbol.toStringTag]==="Array Iterator"){let o=Object.create(Object.getPrototypeOf(s));if(o.next=()=>Ee(s.next(),n),i!==ke[t])Object.defineProperties(o,{return:{get(){let a=s.return;return typeof a==="function"?a.bind(s):a}},throw:{get(){let a=s.throw;return typeof a==="function"?a.bind(s):a}}});return o}s._next=s.next,s.next=()=>Ee(s._next(),n)}return s}function Ee(e,t){if(!e.done)e.value=t(e.value);return e}var ke=Array.prototype;function b(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!T(e),c=o[t];if(c!==ke[t]){let p=c.apply(e,s);return a?v(p):p}let l=n;if(o!==e){if(a)l=function(p,m){return n.call(this,y(e,p),m,e)};else if(n.length>2)l=function(p,m){return n.call(this,p,m,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function be(e,t,n,r){let i=ce(e),s=i!==e&&!T(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=y(e,l);return n.call(this,l,y(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?y(e,c):c}function Q(e,t,n){let r=de(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ct(n[0]))return n[0]=de(n[0]),r[t](...n);return i}function I(e,t,n=[]){Kr(),se();let r=de(e)[t].apply(e,n);return oe(),Jr(),r}var Xe=q("__proto__,__v_isRef,__isVue"),Ce=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(O));function Je(e){if(!O(e))e=String(e);let t=de(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?ot:Pe:i?Le:Me).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=A(e);if(!r){let a;if(s&&(a=qe[t]))return a;if(t==="hasOwnProperty")return Je}let o=Reflect.get(e,t,Ch(e)?e:n);if(O(t)?Ce.has(t):Xe(t))return o;if(!r)h(e,"get",t);if(i)return o;if(Ch(o)){let a=s&&H(t)?o:o.value;return r&&R(a)?G(a):a}if(R(o))return r?G(o):g(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=A(e)&&H(t);if(!this._isShallow){let c=S(i);if(!T(n)&&!S(n))i=de(i),n=de(n);if(!s&&Ch(i)&&!Ch(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,Ch(e)?e:r);if(e===de(r)&&a){if(!o)w(e,"add",t,n);else if(E(n,i))w(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)w(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!O(t)||!Ce.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",A(e)?"length":N),Reflect.ownKeys(e)}}class Ie extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ze=new fe,Qe=new Ie,et=new fe(!0);var re=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function tt(e,t,n){return function(...r){let i=this.__v_raw,s=de(i),o=k(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?re:t?x:v;return!t&&h(s,"iterate",c?ie:N),F(Object.create(l),{next(){let{value:p,done:m}=l.next();return m?{value:p,done:m}:{value:a?[u(p[0]),u(p[1])]:u(p),done:m}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nt(e,t){let n={get(i){let s=this.__v_raw,o=de(s),a=de(i);if(!e){if(E(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?re:e?x:v;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(de(i),"iterate",N),i.size},has(i){let s=this.__v_raw,o=de(s),a=de(i);if(!e){if(E(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=de(a),l=t?re:e?x:v;return!e&&h(c,"iterate",N),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=de(this),o=K(s),a=de(i),c=!t&&!T(i)&&!S(i)?a:i;if(!(o.has.call(s,c)||E(i,c)&&o.has.call(s,i)||E(a,c)&&o.has.call(s,a)))s.add(c),w(s,"add",c,c);return this},set(i,s){if(!t&&!T(s)&&!S(s))s=de(s);let o=de(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=de(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)w(o,"add",i,s);else if(E(s,u))w(o,"set",i,s,u);return this},delete(i){let s=de(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=de(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)w(s,"delete",i,void 0,l);return u},clear(){let i=de(this),s=i.size!==0,o=void 0,a=i.clear();if(s)w(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=tt(i,e,t)}),n}function ue(e,t){let n=nt(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_isShallow")return t;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var it={get:ue(!1,!1)},rt={get:ue(!1,!0)},st={get:ue(!0,!1)};var Me=new WeakMap,Le=new WeakMap,Pe=new WeakMap,ot=new WeakMap;function at(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function g(e){if(S(e))return e;return pe(e,!1,Ze,it,Me)}function xv(e){return pe(e,!1,et,rt,Le)}function G(e){return pe(e,!0,Qe,st,Pe)}function pe(e,t,n,r,i){if(!R(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=at(_e(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function _v(e){if(S(e))return _v(e.__v_raw);return!!(e&&e.__v_isReactive)}function S(e){return!!(e&&e.__v_isReadonly)}function T(e){return!!(e&&e.__v_isShallow)}function ct(e){return e?!!e.__v_raw:!1}function de(e){let t=e&&e.__v_raw;return t?de(t):e}var v=(e)=>R(e)?g(e):e,x=(e)=>R(e)?G(e):e;function Ch(e){return e?e.__v_isRef===!0:!1}function kh(e){return Ve(e,!1)}function Da(e){return Ve(e,!0)}function Ve(e,t){if(Ch(e))return e;return new Fe(e,t)}class Fe{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:de(e),this._value=t?e:v(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||T(e)||S(e);if(e=n?e:de(e),E(e,t))this._rawValue=e,this._value=n?e:v(e),this.dep.trigger()}}class je{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return Te(this,!0),!0}get value(){let e=this.dep.track();if(Ae(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function Eh(e,t,n=!1){let r,i;if(he(e))r=e;else r=e.get,i=e.set;return new je(r,i,n)}var lt={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ft(e){if(typeof document>"u")return null;let t=lt[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function Vx(e,t="polite"){if(e==="")return;let n=ft(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var ef=60000,He=null;function ar(){return He??Date.now()}function rM(e){let t=e instanceof Date?e.getTime():Z(e)?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return He=t,t}var ut={error:"problem",info:"toast",success:"toast",warn:"toast"},pt={error:8000,info:4000,success:4000,warn:8000},Ue=0;function dt(){return Ue+=1,`n${Ue}`}var Xd=g([]),ta=g([]),ht=4;function gt(e){return e==="problem"?ta:Xd}function mt(e,t,n,r){let i={at:ar(),id:dt(),message:t,severity:e,tier:n};if(r.action!==void 0)i.action=r.action;if(r.actionArgs!==void 0)i.actionArgs=r.actionArgs;if(r.detail!==void 0)i.detail=r.detail;if(r.source!==void 0)i.source=r.source;if(r.path!==void 0)i.path=r.path;if(r.key!==void 0)i.key=r.key;if(n==="toast")i.timeoutMs=r.timeoutMs??pt[e];return i}function C(e,t,n={}){let r=n.tier??ut[e],i=mt(e,t,r,n),s=gt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(Xd.length>ht)Xd.shift();return Vx(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>C(e,t,n)}C.success=B("success");C.info=B("info");C.warn=B("warn");C.error=B("error");function Th(e){for(let t of[Xd,ta]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function dl(e){let t=e?ta.filter((r)=>!e(r)):[],n=ta.length-t.length;return ta.splice(0,ta.length,...t),n}function tf(e){let t=[];for(let n of ta){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function Sv(e){return e===void 0?ta.length:ta.filter((t)=>t.severity===e).length}export{ge,ea,ne,Kr,Jr,PC,g,xv,_v,de,Ch,kh,Da,Eh,Vx,ef,ar,rM,Xd,ta,C,Th,dl,tf,Sv};
|
|
1
|
+
import{Z}from"./studio-8z66jk4z.js";function q(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return(n)=>(n in t)}var F=Object.assign;var Ke=Object.prototype.hasOwnProperty,j=(e,t)=>Ke.call(e,t),A=Array.isArray,k=(e)=>me(e)==="[object Map]";var he=(e)=>typeof e==="function",ze=(e)=>typeof e==="string",O=(e)=>typeof e==="symbol",R=(e)=>e!==null&&typeof e==="object";var We=Object.prototype.toString,me=(e)=>We.call(e),_e=(e)=>me(e).slice(8,-1);var H=(e)=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e;var U=(e)=>{let t=Object.create(null);return(n)=>t[n]||(t[n]=e(n))},Ge=/-\w/g,_t=U((e)=>e.replace(Ge,(t)=>t.slice(1).toUpperCase())),$e=/\B([A-Z])/g,yt=U((e)=>e.replace($e,"-$1").toLowerCase()),ye=U((e)=>e.charAt(0).toUpperCase()+e.slice(1)),vt=U((e)=>e?`on${ye(e)}`:""),E=(e,t)=>!Object.is(e,t);var Ye="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly";var Et=q(Ye+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");var d;class Se{constructor(e=!1){if(this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&d)if(d.active)this.parent=d,this.index=(d.scopes||(d.scopes=[])).push(this)-1;else this._active=!1,this._warnOnRun=!1}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active){if(this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let r=this.scopes.slice();for(e=0,t=r.length;e<t;e++)r[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}}run(e){if(this._active){let t=d;try{return d=this,e()}finally{d=t}}}on(){if(++this._on===1)this.prevScope=d,d=this}off(){if(this._on>0&&--this._on===0){if(d===this)d=this.prevScope;else{let e=d;while(e){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();this.effects.length=0;for(t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let r=this.scopes.slice();for(t=0,n=r.length;t<n;t++)r[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let r=this.parent.scopes.pop();if(r&&r!==this)this.parent.scopes[this.index]=r,r.index=this.index}this.parent=void 0}}}function ge(e){return new Se(e)}function ea(e,t=!1){if(d)d.cleanups.push(e)}var f;var X=new WeakSet;class W{constructor(e){if(this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,d)if(d.active)d.effects.push(this);else this.flags&=-2}pause(){this.flags|=64}resume(){if(this.flags&64){if(this.flags&=-65,X.has(this))X.delete(this),this.trigger()}}notify(){if(this.flags&2&&!(this.flags&32))return;if(!(this.flags&8))Te(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ve(this),Ne(this);let e=f,t=_;f=this,_=!0;try{return this.fn()}finally{xe(this),f=e,_=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)ae(e);this.deps=this.depsTail=void 0,ve(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){if(this.flags&64)X.add(this);else if(this.scheduler)this.scheduler();else this.runIfDirty()}runIfDirty(){if(ee(this))this.run()}get dirty(){return ee(this)}}var we=0,M,L;function Te(e,t=!1){if(e.flags|=8,t){e.next=L,L=e;return}e.next=M,M=e}function se(){we++}function oe(){if(--we>0)return;if(L){let t=L;L=void 0;while(t){let n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;while(M){let t=M;M=void 0;while(t){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){if(!e)e=r}t=n}}if(e)throw e}function Ne(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xe(e){let t,n=e.depsTail,r=n;while(r){let i=r.prevDep;if(r.version===-1){if(r===n)n=i;ae(r),Be(r)}else t=r;r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function ee(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ae(t.dep.computed)||t.dep.version!==t.version))return!0;if(e._dirty)return!0;return!1}function Ae(e){if(e.flags&4&&!(e.flags&16))return;if(e.flags&=-17,e.globalVersion===P)return;if(e.globalVersion=P,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ee(e)))return;e.flags|=2;let t=e.dep,n=f,r=_;f=e,_=!0;try{Ne(e);let i=e.fn(e._value);if(t.version===0||E(i,e._value))e.flags|=128,e._value=i,t.version++}catch(i){throw t.version++,i}finally{f=n,_=r,xe(e),e.flags&=-3}}function ae(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r)r.nextSub=i,e.prevSub=void 0;if(i)i.prevSub=r,e.nextSub=void 0;if(n.subs===e){if(n.subs=r,!r&&n.computed){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)ae(s,!0)}}if(!t&&!--n.sc&&n.map)n.map.delete(n.key)}function Be(e){let{prevDep:t,nextDep:n}=e;if(t)t.nextDep=n,e.prevDep=void 0;if(n)n.prevDep=t,e.nextDep=void 0}function ne(e,t){if(e.effect instanceof W)e=e.effect.fn;let n=new W(e);if(t)F(n,t);try{n.run()}catch(i){throw n.stop(),i}let r=n.run.bind(n);return r.effect=n,r}var _=!0,Oe=[];function Kr(){Oe.push(_),_=!1}function Jr(){let e=Oe.pop();_=e===void 0?!0:e}function PC(e,t=!1){if(f instanceof W)f.cleanup=e}function ve(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let n=f;f=void 0;try{t()}finally{f=n}}}var P=0;class Re{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Y{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!f||!_||f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==f){if(t=this.activeLink=new Re(f,this),!f.deps)f.deps=f.depsTail=t;else t.prevDep=f.depsTail,f.depsTail.nextDep=t,f.depsTail=t;De(t)}else if(t.version===-1){if(t.version=this.version,t.nextDep){let n=t.nextDep;if(n.prevDep=t.prevDep,t.prevDep)t.prevDep.nextDep=n;if(t.prevDep=f.depsTail,t.nextDep=void 0,f.depsTail.nextDep=t,f.depsTail=t,f.deps===t)f.deps=n}}return t}trigger(e){this.version++,P++,this.notify(e)}notify(e){se();try{for(let t=this.subs;t;t=t.prevSub)if(t.sub.notify())t.sub.dep.notify()}finally{oe()}}}function De(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)De(r)}let n=e.dep.subs;if(n!==e){if(e.prevSub=n,n)n.nextSub=e}e.dep.subs=e}}var te=new WeakMap,N=Symbol(""),ie=Symbol(""),V=Symbol("");function h(e,t,n){if(_&&f){let r=te.get(e);if(!r)te.set(e,r=new Map);let i=r.get(n);if(!i)r.set(n,i=new Y),i.map=r,i.key=n;i.track()}}function w(e,t,n,r,i,s){let o=te.get(e);if(!o){P++;return}let a=(c)=>{if(c)c.trigger()};if(se(),t==="clear")o.forEach(a);else{let c=A(e),l=c&&H(n);if(c&&n==="length"){let u=Number(r);o.forEach((p,m)=>{if(m==="length"||m===V||!O(m)&&m>=u)a(p)})}else{if(n!==void 0||o.has(void 0))a(o.get(n));if(l)a(o.get(V));switch(t){case"add":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}else if(l)a(o.get("length"));break;case"delete":if(!c){if(a(o.get(N)),k(e))a(o.get(ie))}break;case"set":if(k(e))a(o.get(N));break}}}oe()}function D(e){let t=de(e);if(t===e)return t;if(h(t,"iterate",V),T(e))return t;if(!S(e))return t.map(v);return _v(e)?t.map((n)=>x(v(n))):t.map(x)}function ce(e){return h(e=de(e),"iterate",V),e}function y(e,t){if(S(e))return _v(e)?x(v(t)):x(t);return v(t)}var qe={__proto__:null,[Symbol.iterator](){return J(this,Symbol.iterator,(e)=>y(this,e))},concat(...e){return D(this).concat(...e.map((t)=>A(t)?D(t):t))},entries(){return J(this,"entries",(e)=>(e[1]=y(this,e[1]),e))},every(e,t){return b(this,"every",e,t,void 0,arguments)},filter(e,t){return b(this,"filter",e,t,(n)=>n.map((r)=>y(this,r)),arguments)},find(e,t){return b(this,"find",e,t,(n)=>y(this,n),arguments)},findIndex(e,t){return b(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return b(this,"findLast",e,t,(n)=>y(this,n),arguments)},findLastIndex(e,t){return b(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return b(this,"forEach",e,t,void 0,arguments)},includes(...e){return Q(this,"includes",e)},indexOf(...e){return Q(this,"indexOf",e)},join(e){return D(this).join(e)},lastIndexOf(...e){return Q(this,"lastIndexOf",e)},map(e,t){return b(this,"map",e,t,void 0,arguments)},pop(){return I(this,"pop")},push(...e){return I(this,"push",e)},reduce(e,...t){return be(this,"reduce",e,t)},reduceRight(e,...t){return be(this,"reduceRight",e,t)},shift(){return I(this,"shift")},some(e,t){return b(this,"some",e,t,void 0,arguments)},splice(...e){return I(this,"splice",e)},toReversed(){return D(this).toReversed()},toSorted(e){return D(this).toSorted(e)},toSpliced(...e){return D(this).toSpliced(...e)},unshift(...e){return I(this,"unshift",e)},values(){return J(this,"values",(e)=>y(this,e))}};function J(e,t,n){let r=ce(e),i=r[t],s=i.call(r);if(r!==e&&!T(e)){if(s[Symbol.toStringTag]==="Array Iterator"){let o=Object.create(Object.getPrototypeOf(s));if(o.next=()=>Ee(s.next(),n),i!==ke[t])Object.defineProperties(o,{return:{get(){let a=s.return;return typeof a==="function"?a.bind(s):a}},throw:{get(){let a=s.throw;return typeof a==="function"?a.bind(s):a}}});return o}s._next=s.next,s.next=()=>Ee(s._next(),n)}return s}function Ee(e,t){if(!e.done)e.value=t(e.value);return e}var ke=Array.prototype;function b(e,t,n,r,i,s){let o=ce(e),a=o!==e&&!T(e),c=o[t];if(c!==ke[t]){let p=c.apply(e,s);return a?v(p):p}let l=n;if(o!==e){if(a)l=function(p,m){return n.call(this,y(e,p),m,e)};else if(n.length>2)l=function(p,m){return n.call(this,p,m,e)}}let u=c.call(o,l,r);return a&&i?i(u):u}function be(e,t,n,r){let i=ce(e),s=i!==e&&!T(e),o=n,a=!1;if(i!==e){if(s)a=r.length===0,o=function(l,u,p){if(a)a=!1,l=y(e,l);return n.call(this,l,y(e,u),p,e)};else if(n.length>3)o=function(l,u,p){return n.call(this,l,u,p,e)}}let c=i[t](o,...r);return a?y(e,c):c}function Q(e,t,n){let r=de(e);h(r,"iterate",V);let i=r[t](...n);if((i===-1||i===!1)&&ct(n[0]))return n[0]=de(n[0]),r[t](...n);return i}function I(e,t,n=[]){Kr(),se();let r=de(e)[t].apply(e,n);return oe(),Jr(),r}var Xe=q("__proto__,__v_isRef,__isVue"),Ce=new Set(Object.getOwnPropertyNames(Symbol).filter((e)=>e!=="arguments"&&e!=="caller").map((e)=>Symbol[e]).filter(O));function Je(e){if(!O(e))e=String(e);let t=de(this);return h(t,"has",e),t.hasOwnProperty(e)}class le{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t==="__v_skip")return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t==="__v_isReactive")return!r;else if(t==="__v_isReadonly")return r;else if(t==="__v_isShallow")return i;else if(t==="__v_raw"){if(n===(r?i?ot:Pe:i?Le:Me).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n))return e;return}let s=A(e);if(!r){let a;if(s&&(a=qe[t]))return a;if(t==="hasOwnProperty")return Je}let o=Reflect.get(e,t,kh(e)?e:n);if(O(t)?Ce.has(t):Xe(t))return o;if(!r)h(e,"get",t);if(i)return o;if(kh(o)){let a=s&&H(t)?o:o.value;return r&&R(a)?G(a):a}if(R(o))return r?G(o):g(o);return o}}class fe extends le{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],s=A(e)&&H(t);if(!this._isShallow){let c=S(i);if(!T(n)&&!S(n))i=de(i),n=de(n);if(!s&&kh(i)&&!kh(n))if(c)return!0;else return i.value=n,!0}let o=s?Number(t)<e.length:j(e,t),a=Reflect.set(e,t,n,kh(e)?e:r);if(e===de(r)&&a){if(!o)w(e,"add",t,n);else if(E(n,i))w(e,"set",t,n,i)}return a}deleteProperty(e,t){let n=j(e,t),r=e[t],i=Reflect.deleteProperty(e,t);if(i&&n)w(e,"delete",t,void 0,r);return i}has(e,t){let n=Reflect.has(e,t);if(!O(t)||!Ce.has(t))h(e,"has",t);return n}ownKeys(e){return h(e,"iterate",A(e)?"length":N),Reflect.ownKeys(e)}}class Ie extends le{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}var Ze=new fe,Qe=new Ie,et=new fe(!0);var re=(e)=>e,K=(e)=>Reflect.getPrototypeOf(e);function tt(e,t,n){return function(...r){let i=this.__v_raw,s=de(i),o=k(s),a=e==="entries"||e===Symbol.iterator&&o,c=e==="keys"&&o,l=i[e](...r),u=n?re:t?x:v;return!t&&h(s,"iterate",c?ie:N),F(Object.create(l),{next(){let{value:p,done:m}=l.next();return m?{value:p,done:m}:{value:a?[u(p[0]),u(p[1])]:u(p),done:m}}})}}function z(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function nt(e,t){let n={get(i){let s=this.__v_raw,o=de(s),a=de(i);if(!e){if(E(i,a))h(o,"get",i);h(o,"get",a)}let{has:c}=K(o),l=t?re:e?x:v;if(c.call(o,i))return l(s.get(i));else if(c.call(o,a))return l(s.get(a));else if(s!==o)s.get(i)},get size(){let i=this.__v_raw;return!e&&h(de(i),"iterate",N),i.size},has(i){let s=this.__v_raw,o=de(s),a=de(i);if(!e){if(E(i,a))h(o,"has",i);h(o,"has",a)}return i===a?s.has(i):s.has(i)||s.has(a)},forEach(i,s){let o=this,a=o.__v_raw,c=de(a),l=t?re:e?x:v;return!e&&h(c,"iterate",N),a.forEach((u,p)=>i.call(s,l(u),l(p),o))}};return F(n,e?{add:z("add"),set:z("set"),delete:z("delete"),clear:z("clear")}:{add(i){let s=de(this),o=K(s),a=de(i),c=!t&&!T(i)&&!S(i)?a:i;if(!(o.has.call(s,c)||E(i,c)&&o.has.call(s,i)||E(a,c)&&o.has.call(s,a)))s.add(c),w(s,"add",c,c);return this},set(i,s){if(!t&&!T(s)&&!S(s))s=de(s);let o=de(this),{has:a,get:c}=K(o),l=a.call(o,i);if(!l)i=de(i),l=a.call(o,i);let u=c.call(o,i);if(o.set(i,s),!l)w(o,"add",i,s);else if(E(s,u))w(o,"set",i,s,u);return this},delete(i){let s=de(this),{has:o,get:a}=K(s),c=o.call(s,i);if(!c)i=de(i),c=o.call(s,i);let l=a?a.call(s,i):void 0,u=s.delete(i);if(c)w(s,"delete",i,void 0,l);return u},clear(){let i=de(this),s=i.size!==0,o=void 0,a=i.clear();if(s)w(i,"clear",void 0,void 0,void 0);return a}}),["keys","values","entries",Symbol.iterator].forEach((i)=>{n[i]=tt(i,e,t)}),n}function ue(e,t){let n=nt(e,t);return(r,i,s)=>{if(i==="__v_isReactive")return!e;else if(i==="__v_isReadonly")return e;else if(i==="__v_isShallow")return t;else if(i==="__v_raw")return r;return Reflect.get(j(n,i)&&i in r?n:r,i,s)}}var it={get:ue(!1,!1)},rt={get:ue(!1,!0)},st={get:ue(!0,!1)};var Me=new WeakMap,Le=new WeakMap,Pe=new WeakMap,ot=new WeakMap;function at(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function g(e){if(S(e))return e;return pe(e,!1,Ze,it,Me)}function xv(e){return pe(e,!1,et,rt,Le)}function G(e){return pe(e,!0,Qe,st,Pe)}function pe(e,t,n,r,i){if(!R(e))return e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;if(e.__v_skip||!Object.isExtensible(e))return e;let s=i.get(e);if(s)return s;let o=at(_e(e));if(o===0)return e;let a=new Proxy(e,o===2?r:n);return i.set(e,a),a}function _v(e){if(S(e))return _v(e.__v_raw);return!!(e&&e.__v_isReactive)}function S(e){return!!(e&&e.__v_isReadonly)}function T(e){return!!(e&&e.__v_isShallow)}function ct(e){return e?!!e.__v_raw:!1}function de(e){let t=e&&e.__v_raw;return t?de(t):e}var v=(e)=>R(e)?g(e):e,x=(e)=>R(e)?G(e):e;function kh(e){return e?e.__v_isRef===!0:!1}function Eh(e){return Ve(e,!1)}function Oa(e){return Ve(e,!0)}function Ve(e,t){if(kh(e))return e;return new Fe(e,t)}class Fe{constructor(e,t){this.dep=new Y,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:de(e),this._value=t?e:v(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||T(e)||S(e);if(e=n?e:de(e),E(e,t))this._rawValue=e,this._value=n?e:v(e),this.dep.trigger()}}class je{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Y(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=P-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&f!==this)return Te(this,!0),!0}get value(){let e=this.dep.track();if(Ae(this),e)e.version=this.dep.version;return this._value}set value(e){if(this.setter)this.setter(e)}}function Th(e,t,n=!1){let r,i;if(he(e))r=e;else r=e.get,i=e.set;return new je(r,i,n)}var lt={assertive:"jx-live-assertive",polite:"jx-live-polite"};function ft(e){if(typeof document>"u")return null;let t=lt[e],n=document.querySelector(`#${t}`);if(n)return n;let r=document.createElement("div");return r.id=t,r.setAttribute("aria-live",e),r.setAttribute("role",e==="assertive"?"alert":"status"),r.setAttribute("aria-atomic","true"),r.style.cssText="position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0",document.body.append(r),r}function Vx(e,t="polite"){if(e==="")return;let n=ft(t);if(!n)return;n.textContent="",setTimeout(()=>{n.textContent=e},0)}var nf=60000,He=null;function ar(){return He??Date.now()}function pM(e){let t=e instanceof Date?e.getTime():Z(e)?e:Date.parse(e);if(!Number.isFinite(t))throw TypeError(`clock: cannot pin to ${JSON.stringify(e)}`);return He=t,t}var ut={error:"problem",info:"toast",success:"toast",warn:"toast"},pt={error:8000,info:4000,success:4000,warn:8000},Ue=0;function dt(){return Ue+=1,`n${Ue}`}var Xd=g([]),ta=g([]),ht=4;function gt(e){return e==="problem"?ta:Xd}function mt(e,t,n,r){let i={at:ar(),id:dt(),message:t,severity:e,tier:n};if(r.action!==void 0)i.action=r.action;if(r.actionArgs!==void 0)i.actionArgs=r.actionArgs;if(r.detail!==void 0)i.detail=r.detail;if(r.source!==void 0)i.source=r.source;if(r.path!==void 0)i.path=r.path;if(r.key!==void 0)i.key=r.key;if(n==="toast")i.timeoutMs=r.timeoutMs??pt[e];return i}function C(e,t,n={}){let r=n.tier??ut[e],i=mt(e,t,r,n),s=gt(r);if(i.key!==void 0){let o=s.findIndex((a)=>a.key===i.key);if(o!==-1)s.splice(o,1)}if(s.push(i),r==="toast")while(Xd.length>ht)Xd.shift();return Vx(i.source===void 0?i.message:`${i.source}: ${i.message}`,e==="error"?"assertive":"polite"),i}function B(e){return(t,n={})=>C(e,t,n)}C.success=B("success");C.info=B("info");C.warn=B("warn");C.error=B("error");function Lh(e){for(let t of[Xd,ta]){let n=t.findIndex((r)=>r.id===e);if(n!==-1)return t.splice(n,1),!0}return!1}function pl(e){let t=e?ta.filter((r)=>!e(r)):[],n=ta.length-t.length;return ta.splice(0,ta.length,...t),n}function of(e){let t=[];for(let n of ta){if(n.source!==e)continue;let r={message:n.message,severity:n.severity};if(n.detail!==void 0)r.detail=n.detail;if(n.path!==void 0)r.path=n.path;if(n.key!==void 0)r.key=n.key;if(n.action!==void 0)r.action=n.action;if(n.actionArgs!==void 0)r.actionArgs=n.actionArgs;t.push(r)}return t}function Sv(e){return e===void 0?ta.length:ta.filter((t)=>t.severity===e).length}export{ge,ea,ne,Kr,Jr,PC,g,xv,_v,de,kh,Eh,Oa,Th,Vx,nf,ar,pM,Xd,ta,C,Lh,pl,of,Sv};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
4
|
-
//# sourceMappingURL=studio-
|
|
3
|
+
//# debugId=EC9646D8A6F555FA64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=studio-y60sts62.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{LT,$T,IT}from"./studio-5atwjgkj.js";import{p,_e}from"./studio-jws1a87n.js";import{hb,ME,PE}from"./studio-cyheys7k.js";import{SA,dx,cl,Ca,DA,ds,Zl,px}from"./studio-hhp4x8xf.js";import{le}from"./studio-j3d2fjqz.js";var t="checking",i=null;function uw(){return _e()&&Boolean(p().cfConnect)}async function ub(){if(!uw())return;i??=(async()=>{try{t=await p().cfConnection?.()??null}catch{t=null}i=null,pm()})(),await i}function DD(){if(uw()&&t==="checking"&&!i)ub()}function ND(){t="checking",i=null}async function d(){let n=await p().cfConnect?.();if(n?.status==="connected"&&!n.connection.accountId){let{openCfAccountPicker:e}=await (le("c07znkqt"),import("./cf-account-picker-c07znkqt.js"));await e()}ds(),await ub()}function s(){let n={id:"disconnect",label:"Disconnect",run:async()=>{await p().cfDisconnect?.(),ds(),await ub()},variant:"negative"},e=(r)=>({id:r==="Connect"?"connect":"reconnect",label:r,run:d,variant:"accent"}),o={id:"cloudflare",label:"Cloudflare",revoke:()=>{}};if(t==="checking")return{...o,actions:[],connected:!1,detail:"Checking your connection…"};if(!t?.connected)return{...o,actions:[e("Connect")],connected:!1,detail:"Not connected. Connecting publishes this site and runs the assistant on Workers AI."};let c=()=>{n.run()};if(t.needsReconnect)return{...o,actions:[e("Reconnect"),n],connected:!0,detail:"Connection expired. Reconnect to keep publishing and the assistant working.",revoke:c};if(t.needsAccount||!t.accountId)return{...o,actions:[{id:"choose-account",label:"Choose account",run:async()=>{let{openCfAccountPicker:r}=await (le("c07znkqt"),import("./cf-account-picker-c07znkqt.js"));if(await r())ds(),await ub()},variant:"accent"},n],connected:!0,detail:"Connected, but no account is chosen yet — publishing and the assistant need one.",revoke:c};return{...o,actions:[n],connected:!0,detail:`Connected — ${t.accountName??t.accountId}.`,revoke:c}}function l(){let n=hb(),e=ME();return{connected:Boolean(n),detail:n?`Connected${e?` — account ${e}`:""}.`:"Not connected. Publishing will ask when it needs it.",id:"cloudflare",label:"Cloudflare",revoke:PE}}function u(n){let e={id:n.id,label:n.label,run:async()=>{await px(n)}};if(n.primary)e.variant="accent";return e}function f(n){return{actions:(n.actions??[]).map((e)=>u(e)),connected:n.connected??!1,detail:n.detail,id:`platform:${n.id}`,label:n.label,revoke:()=>{}}}function AE(){let n=LT(),e=Zl(),o=cl();return[{id:"github",label:"GitHub",detail:n?$T()==="desktop"?"Signed in — the token is in this app's config folder, readable only by you.":"Signed in — a device-flow token is stored in this browser.":"Not signed in. Cloning and pushing will ask when they need it.",connected:Boolean(n),revoke:IT},{id:"ai",label:"AI provider",detail:dx()?`${Ca()==="anthropic"?"Anthropic key":"Key"} stored. Model ${e}${o?` via ${o}`:""}.`:"No key stored. The Assistant section is where one is entered.",connected:dx(),revoke:DA},uw()?s():l(),...SA().map((c)=>f(c))]}function AD(n){let e=AE().find((o)=>o.id===n);if(!e)return!1;return e.revoke(),pm(),!0}var a=new Set;function OD(n){return a.add(n),()=>{a.delete(n)}}function pm(){for(let n of a)n()}
|
|
2
|
+
export{uw,ub,DD,ND,AE,AD,OD,pm};
|
|
3
|
+
|
|
4
|
+
//# debugId=47D538BBE76B693F64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-ybnwymxw.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{Q}from"./studio-nqxqf8p2.js";import{uI,p,_e}from"./studio-jws1a87n.js";import{Ys,tn}from"./studio-8wnvtr4z.js";import{fn}from"./studio-hz5n7x27.js";import{Tn,m,h,_i,Pt}from"./studio-k2sz13zg.js";import{g,ar,C}from"./studio-y60sts62.js";import{Kt,zt}from"./studio-b2qpt0xy.js";import{Nw}from"./studio-wxq6v5sv.js";import{u}from"./studio-2r90cts3.js";import{Ve,wt,L,R,sn,dt,qo,ei,w$}from"./studio-0w2dr0q8.js";import{hS}from"./studio-5atwjgkj.js";import{Us,uN,il}from"./studio-0q5jwddh.js";import{hi,_m,Gl,gL,vL,Mb}from"./studio-rtfnhrdg.js";import{XD}from"./studio-zndrqawb.js";import{nM,S,rM,sr}from"./studio-cg710sk9.js";import{n,ee,_,v}from"./studio-8z66jk4z.js";import{le}from"./studio-j3d2fjqz.js";var bt={children:[],tagName:"div"},vt=new Set(["bunfig.json","jsconfig.json","package-lock.json","package.json","tsconfig.json","wrangler.json"]);function yb(t){let e=t.slice(t.lastIndexOf("/")+1);if(vt.has(e)||e.endsWith(".schema.json"))return!1;return t.endsWith(".json")||Boolean(fn(t))}function B(t,e){if(t.startsWith("../")||t.includes("/../"))return`"${t}" is outside this project, so its comparison belongs to the project that owns it.`;if(e==="R")return"A renamed file's comparison needs both paths, and Studio does not model the old name yet.";if(Nw(t))return`"${t}" is an image or media file, and a comparison of one is not text.`;return null}function xt(){return["git-diff"]}function St(t){let e=m.tabs.get(t);if(e)return Pt(t),e;return _i({capabilities:{modes:xt()},document:structuredClone(bt),documentPath:t,id:t,sourceFormat:null})}async function V(t){if(!yb(t))return St(t);let e=await (le("b2tcppdd"),import("./files-b2tcppdd.js"));return await e.openFileInTab(t,{canvasMode:"git-diff"}),[...m.tabs.values()].find((o)=>o.documentPath===t)??null}var W={$schema:"https://jxsuite.com/schema/v1",$id:"StudioGithubPublish",$description:"Create GitHub Repository: the three things the flow needs before it calls the API — the repository's name, an optional description, and whether it is private. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answer buttons. Nothing here reaches GitHub: `github/github-publish.ts` keeps the token, the request and the activity, and this document only collects.",tagName:"jx-dialog",$props:{headline:"Create GitHub Repository",confirmLabel:"Create Repository",cancelLabel:"Cancel",size:"sm"},attributes:{part:"github-publish"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'What is NOT here is most of the conversion. `.github-publish-dialog` was a flex column with an 8px gap and `8px 0` of padding: the gap is the one thing it said that nothing else draws, and `jx-dialog`\'s own body already pads the content, so only the gap survives. `.github-publish-dialog sp-textfield { width: 100% }` had nothing to transcribe either — a `jx-field` row is a grid whose control cell stretches, so the field fills the row without being told to. The three `sp-field-label`s are gone with them, because `jx-field` draws the label AND names the control from it; the third of them carried no `for` at all, so "Visibility" was text beside a switch rather than a name for it.','& [part="rows"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"}},children:[{tagName:"div",attributes:{part:"rows"},children:[{tagName:"jx-field",$props:{span:!0,label:"Repository name"},attributes:{part:"row","data-field":"name"},children:[{tagName:"jx-textfield",$props:{placeholder:"my-project",value:{$ref:"#/state/name"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setName"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Description (optional)"},attributes:{part:"row","data-field":"description"},children:[{tagName:"jx-textfield",$props:{placeholder:"A brief description",value:{$ref:"#/state/description"}},attributes:{part:"field"},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setDescription"},value:[{$ref:"event#/target/value"}]}]}}]},{tagName:"jx-field",$props:{span:!0,label:"Visibility"},attributes:{part:"row","data-field":"visibility"},children:[{tagName:"div",$description:'The row opens with a plain `div`, and that is the whole reason it exists: `jx-field` names the first thing slotted into it that observes `labelledby`, so a switch slotted straight in would be announced "Visibility" over the top of the words printed beside it. A `div` observes no naming, so the switch keeps the name its own label gives it.',attributes:{part:"visibility-row"},children:[{tagName:"jx-switch",attributes:{part:"toggle"},$props:{checked:{$ref:"#/state/isPrivate"}},onchange:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setPrivate"},value:[{$ref:"event#/target/checked"}]}]},children:[{tagName:"span",textContent:"Private repository"}]}]}]}]}]};L("github-publish",W);function q(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(Ve,wt("dialog","github-publish")),t.layer.append(e);let o=!1,r=()=>{if(o)return;o=!0,t.onClosed()},i=()=>o,a=g({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm({description:a.description,isPrivate:a.isPrivate,name:a.name})},description:"",isPrivate:!0,name:t.name,setDescription:(l)=>{a.description=l},setName:(l)=>{a.name=l},setPrivate:(l)=>{a.isPrivate=l}}),s=null,d=R("github-publish",a,e).then(async(l)=>{s=l;let f=l.root;if(i())return l.dispose(),f;if(await sn(f),i())return f;return Kt(f),f});return{close(){if(o)return;let l=s?.root;if(l instanceof HTMLElement)zt(l);s?.dispose(),s=null,e.remove(),r()},host:e,ready:d}}var k=["Create the repository","Add the remote","Push"];function kt(t){return new Promise((e)=>{let o=!1,r=(a)=>{if(o)return;o=!0,e(a)},i=q({layer:dt("dialog"),name:t,onCancel:()=>{i.close()},onClosed:()=>{r(null)},onConfirm:(a)=>{r({...a,name:a.name||t}),i.close()}})})}async function z({projectName:t}){let e=await hS();if(!e)return!1;let o=await kt(t);if(!o)return!1;let r=Us({source:"Source Control",status:`Creating ${o.name}…`,steps:[...k],title:"Create GitHub repository"});r.step(k[0]);let i;try{i=await fetch("https://api.github.com/user/repos",{body:JSON.stringify({auto_init:!1,description:o.description,name:o.name,private:o.isPrivate}),headers:{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json"},method:"POST"})}catch(c){return r.log(Q(c)),r.fail("Could not reach GitHub to create the repository.",{action:"git.createGithubRepository"}),!1}if(!i.ok){let c=await i.json();return r.log(c.errors?.[0]?.message||c.message||`GitHub answered ${i.status}.`),r.fail("Could not create the GitHub repository.",{action:"git.createGithubRepository"}),!1}let a=await i.json();r.log(`Created ${a.html_url}`);let s=p();r.step(k[1]);try{await s.gitAddRemote("origin",a.clone_url)}catch(c){return r.log(Q(c)),r.fail("The repository was created, but the remote could not be added.",{action:"view.setWorkspace",actionArgs:{workspace:"publish"}}),!1}r.step(k[2]);try{await s.gitPush({setUpstream:!0})}catch(c){return r.log(Q(c)),r.fail("The repository was created, but the push failed.",{action:"git.push"}),!1}let{refreshGitStatus:d}=await (le("fsqzc6he"),import("./source-control-fsqzc6he.js"));return await d(),r.done(a.html_url),C.success(`Repository created: ${a.html_url}`,{key:"github.repo"}),!0}var w=[];function jt(){return _e()&&ee(p().listProjects)}async function aS(){if(!jt()){w=[];return}try{w=await p().listProjects?.()??[]}catch{w=[]}}function JD(){return w}function X(t){w=t}var K=2,Rt=1e4;class Z extends Error{blockedBy;constructor(t,e){super(t.length===0?`Studio did not report ${K} consecutive quiet frames within ${e}ms`:`Studio was not idle after ${e}ms — blocked by ${t.join("; ")}`);this.name="NotIdleError",this.blockedBy=t}}function Y(){return[{blockers:()=>{let t=rM();return t>0?[`render: ${t} renderer(s) mid-paint`]:[]},name:"render"},{blockers:gL,name:"canvas"},{blockers:()=>{let t=uI();if(t.length===0)return[];return[`platform: ${t.length} in-flight (${[...new Set(t)].join(", ")})`]},name:"platform"},{blockers:w$,name:"overlay"},{blockers:uN,name:"activity"},{blockers:XD,name:"grid"}]}function At(t=Y()){let e=[];for(let o of t)e.push(...o.blockers());return e}function tt(t={}){let{frames:e=K,now:o=()=>Date.now(),raf:r=(s)=>{requestAnimationFrame(()=>s())},sources:i=Y(),timeoutMs:a=Rt}=t;return new Promise((s,d)=>{let c=o()+a,l=0,f=!1,J=[],H=()=>{if(f)return;let P=At(i);if(P.length>0)J=P,l=0;else if(l+=1,l>=e){f=!0,s();return}if(o()>=c){f=!0,d(new Z(P.length>0?P:J,a));return}r(H)};r(H)})}var et=/\.toggle[A-Z]/;function $t(t){return t.replace(/\.toggle([A-Z])/,(e,o)=>`.set${o}`)}function ot(t){return!et.test(t.id)}var Dt={"file.contextMenu":{disposition:"refused",note:"opening a menu to press an item names a control; the ITEM is the command"},"layers.contextMenu":{disposition:"refused",note:"matched RENDERED TEXT, which R1 of scripts/screenshots/README.md forbids; a row is addressed by its data-jx-path"},"project.showWelcome":{disposition:"refused",note:"cold start is a startup profile (?profile=fresh), not an action"},"settings.setSection":{disposition:"refused",note:`mirrored the section registry's LABELS; say settings.open { section: "contexts" }`},"view.setStatus":{disposition:"refused",note:"the status bar is not staged — if a capture needs a calm shell, the app must BE calm"}},Et=new Map(Object.entries(Dt)),Tt={openSettings:'a user opens Settings — run("settings.open")',select:'a user selects a node — run("selection.set", { path })',setActivity:'a user picks a Navigator panel — run("navigator.showPanel", { panel })',setRightTab:'a user picks an Inspector tab — run("inspector.setTab", { tab })',setStatus:"the status bar reports what the app just did; staging it is the one lie the Remote Rule (studio.md §13.5) names outright",setZoom:'a user zooms — run("canvas.setZoom", { zoom })'},Gt=new Map(Object.entries(Tt));function G(t,e){let o=t[e];if(o===void 0)return[];if(!Array.isArray(o))throw TypeError(`seed argument "${e}" must be an array`);return o}function It(t,e){let o=t[e];if(!_(o))throw TypeError(`seed argument "${e}" must be an object`);return o}function Ut(t,e){let o=t[e];if(o===void 0)return;if(!n(o))throw TypeError(`seed argument "${e}" must be a string`);return o}function Lt(t){return[{boundary:"the assistant's model stream",id:"seed.assistant",run:(e)=>{t.seedAssistantMessages(G(e,"messages"))}},{boundary:"the collaboration websocket (awareness + sync)",id:"seed.collab",run:(e)=>{let o=h.value;if(!o)return;let r=Tn(o);r.status="synced",r.active=!0;let i=[];for(let a of G(e,"peers")){let s={...a.state};s.focusedPath??=o.documentPath,i.push({...a,state:s})}r.peers=i,sr()}},{boundary:"the Cloudflare Pages API",id:"seed.publish",run:(e)=>{let o=Ut(e,"accountId"),r={deployment:It(e,"deployment")};if(o)r.accountId=o;t.seedPublishConnected(r)}},{boundary:"the platform's git routes (`gitStatus` / `gitBranches` / `gitLog`)",id:"seed.git",run:(e)=>{let{status:o,branches:r,log:i}=e;u.git.status=o??null,u.git.branches=r??null,u.git.logEntries=i??null,u.git.loading=!1,u.git.error=null,sr()}},{boundary:"the platform's recent-projects store (desktop IPC / cloud API)",id:"seed.projectList",run:(e)=>{X(G(e,"projects")),sr()}}]}class I extends Error{id;constructor(t,e){super(`automation refuses "${t}" — ${e}`);this.name="AutomationRefusedError",this.id=t}}function Mt(t){let e=[];for(let o of t.visible()){if(!ot(o))continue;let r=t.disabledReason(o.id),i={enabled:r===void 0,id:o.id,title:o.title};if(o.args)i.args=o.args;if(r!==void 0)i.requires=r;e.push(i)}return e}function Nt(t,e,o){if(o.has(t))return`"${t}" is a seed, not a command — call seed("${t}", …)`;let r=Et.get(t);if(r)return`"${t}" is refused by spec §13.5: ${r.note}`;let i=e.list().filter((a)=>ot(a)).map((a)=>a.id);return`unknown command "${t}" — the registry declares ${i.length} scriptable id(s)`}function Ot(t){let e=new Map(Lt(t).map((r)=>[r.id,r])),o=new Set(e.keys());return{probe:{commands:()=>Mt(t.registry),idle:(r={})=>tt(r),pointAt:(r)=>vL(r.path),revealPath:(r)=>Mb(r),seeds:()=>[...e.values()].map((r)=>({boundary:r.boundary,id:r.id})),state:()=>t.registry.context()},async run(r,i={}){if(et.test(r))throw new I(r,`it names a delta against state the caller cannot observe; call "${$t(r)}"`);let{registry:a}=t;if(!a.get(r))throw Error(Nt(r,a,o));await a.run(r,i)},async seed(r,i={}){let a=r.startsWith("seed.")?r.slice(5):r,s=Gt.get(a);if(s)throw new I(r,`a seed stands in for a remote, never for a user: ${s}`);let d=e.get(r.startsWith("seed.")?r:`seed.${r}`);if(!d)throw Error(`unknown seed "${r}" — declared seeds are ${[...e.keys()].join(", ")}`);await d.run(i)}}}function yw(t){return new URLSearchParams(t).get("automation")==="1"}function YD(t){if(!yw(location.search))return!1;return globalThis.__jxAutomation=Ot(t),!0}var rt={$schema:"https://jxsuite.com/schema/v1",$id:"StudioJxsuiteUpdate",$description:"The on-open offer to bring a project's `@jxsuite/*` dependencies up to their newest published versions: one sentence, and the packages that would move. A `jx-dialog`, so the platform owns modality, Escape, focus restoration and the backdrop, and the kit draws both answers. Nothing here asks the registry or writes a manifest: `packages/jxsuite-update.ts` keeps the lookup, the dismissal key and the install, and this document only says what is on offer.",tagName:"jx-dialog",$props:{headline:"Update @jxsuite packages?",confirmLabel:"Update",cancelLabel:"Not now",size:"sm"},attributes:{part:"jxsuite-update"},onconfirm:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/confirm"},value:[]}]},oncancel:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/cancel"},value:[]}]},onclose:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/closed"},value:[]}]},style:{$description:'The old body was a lit template with no stylesheet at all, which is why the conversion is mostly a deletion. Two `<br />`s stood in for a paragraph break, and one `<span style="white-space: pre-line">` held every package as a single `\\n`-joined string — a list spelled as whitespace. Neither is addressable and neither announces as what it is, so a screen reader read one run-on line and a test could only match a substring of it. It is a `<ul>` of keyed rows now: the list says how many packages there are, and each row is `[data-package]`. The one token repair travels with it — that span asked for `--spectrum-font-size-75`, which resolves only inside `<sp-theme>`, and a document mounted in the dialog layer is outside it, so the size silently fell back to the hard-coded `12px` written beside it.','& [part="offer"]':{display:"flex",flexDirection:"column",gap:"var(--jx-space-3)"},'& [part="lede"]':{margin:"0"},'& [part="list"]':{$description:"Capped and scrolling, because the count is the registry's rather than this dialog's: a project that has not been opened in a year can have every `@jxsuite/*` package behind at once, and a dialog that grows past the viewport puts its own Update button off screen.",listStyle:"none",margin:"0",padding:"0",display:"flex",flexDirection:"column",gap:"var(--jx-space-1)",maxHeight:"240px",overflowY:"auto"},'& [part="package"]':{display:"flex",justifyContent:"space-between",alignItems:"baseline",gap:"var(--jx-space-3)",fontSize:"var(--jx-text-sm)"},'& [part="package-name"]':{color:"var(--fg)"},'& [part="package-move"]':{$description:"Tabular figures, so a column of versions does not jitter between rows of different widths.",color:"var(--fg-dim)",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"}},children:[{tagName:"div",attributes:{part:"offer"},children:[{tagName:"p",attributes:{part:"lede"},textContent:"Newer versions of these packages have been published. Update the project to them?"},{tagName:"ul",attributes:{part:"list"},children:[{$prototype:"Array",items:{$ref:"#/state/packages"},key:{$ref:"$map/item/name"},map:{tagName:"li",attributes:{part:"package","data-package":"${$map.item.name}"},children:[{tagName:"span",attributes:{part:"package-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"package-move"},textContent:"${$map.item.current} → ${$map.item.target}"}]}}]}]}]};L("jxsuite-update",rt);function nt(t){let e=document.createElement("div");e.style.pointerEvents="auto",e.setAttribute(Ve,wt("dialog","jxsuite-update")),t.layer.append(e);let o=!1,r=()=>{if(o)return;o=!0,t.onClosed()},i=()=>o,a=g({cancel:()=>{t.onCancel()},closed:r,confirm:()=>{t.onConfirm()},packages:t.packages}),s=null,d=R("jxsuite-update",a,e).then(async(c)=>{s=c;let l=c.root;if(i())return c.dispose(),l;if(await sn(l),i())return l;return Kt(l),l});return{close(){let c=s?.root;if(c instanceof HTMLElement)zt(c);s?.dispose(),s=null,e.remove(),r()},host:e,ready:d}}function ww(t){return t.replace(/^[\^~>=<v\s]+/,"").trim().split(/\s+/)[0]??""}function it(t){if(t.includes(":"))return!1;return/^\d+\.\d+/.test(ww(t))}function at(t){let e=ww(t).split(/[-+]/)[0]??"",[o=0,r=0,i=0]=e.split(".").map((a)=>Math.trunc(Number(a))||0);return[o,r,i]}function _t(t,e){let o=at(t),r=at(e);for(let i=0;i<3;i++){let a=o[i]??0,s=r[i]??0;if(a!==s)return a<s?-1:1}return 0}function lS(t,e){if(!it(t)||!it(e))return!1;return _t(e,t)>0}var U="@jxsuite/";async function M(){let t=p();if(!t.packageVersions)return[];let e;try{e=await t.packageVersions()}catch{return[]}let o=[];for(let r of e)if(r.name.startsWith(U)&&lS(r.current,r.latest))o.push({current:r.current,dev:Boolean(r.dev),latest:r.latest,name:r.name});return o}function st(t,e){let o=e.map((r)=>`${r.name}@${r.latest}`).toSorted().join(",");return`jx:jxsuite-update-dismissed:${t}:${o}`}function Jt(t,e){try{return localStorage.getItem(st(t,e))==="1"}catch{return!1}}function Ht(t,e){try{localStorage.setItem(st(t,e),"1")}catch{}}async function N(t){let e=p();if(!e.setPackageVersions||t.length===0)return;let o=il({status:"Updating @jxsuite packages…",title:"Updating dependencies"});try{let r=await e.setPackageVersions(t.map((i)=>({dev:i.dev,name:i.name,version:`^${i.latest}`})));if(r.ok)o.done(),C.success(`Updated ${t.length} @jxsuite package(s) to their latest versions.`);else o.fail(r.log??"Update failed")}catch(r){o.fail(r instanceof Error?r.message:String(r))}}function Bt(t){return new Promise((e)=>{let o=!1,r=(d)=>{if(o)return;o=!0,e(d)},i=!1,a=()=>{if(i)return;i=!0,s.close()},s=nt({layer:dt("dialog"),onCancel:()=>{a()},onClosed:()=>{r(!1),a()},onConfirm:()=>{r(!0),a()},packages:t.map((d)=>({current:d.current,name:d.name,target:`^${d.latest}`}))})})}async function bm(t){if(yw(location.search))return;if(!p().setPackageVersions)return;let o=await M();if(o.length===0||Jt(t,o))return;if(!await Bt(o)){Ht(t,o);return}await N(o)}var j=["package.json","bun.lock","bun.lockb"],Vt=new Set(["??","U"]),Wt=25;function A(t){if(Array.isArray(t))return t.map((e)=>A(e));if(v(t)){let e={};for(let[o,r]of Object.entries(t).toSorted(([i],[a])=>i<a?-1:1))e[o]=A(r);return e}return t}function ct(t){let e={...t};for(let o of["dependencies","devDependencies"]){let r=e[o];if(!v(r))continue;let i={...r};for(let a of Object.keys(i))if(a.startsWith(U))i[a]="*";e[o]=i}return e}function qt(t,e){if(t===null||e===null)return!1;let o,r;try{o=JSON.parse(t),r=JSON.parse(e)}catch{return!1}if(!v(o)||!v(r))return!1;return JSON.stringify(A(ct(o)))===JSON.stringify(A(ct(r)))}async function D(t,e){try{return await p().gitShow({path:t,ref:e})}catch{return null}}async function ut(t){try{return await p().readFile(t)}catch{return null}}async function pt(t){let e=[],o=[],r=!0;for(let i of j){let a=t.files.filter((c)=>c.path===i);if(a.length===0)continue;let s=await D(i,"@{u}");if(a.every((c)=>Vt.has(c.status))){if(s!==null)o.push(i);continue}let d=await D(i,"HEAD");if(s===null||s===d)continue;if(e.push(i),i==="package.json")r&&=qt(d,await ut(i))}return{automated:r,discard:e,removeUntracked:o}}function mt(t){return t.discard.length===0&&t.removeUntracked.length===0}async function Xt(t){let e=[...new Set(t.files.filter((o)=>!j.includes(o.path)).map((o)=>o.path))];if(e.length>Wt)return!0;for(let o of e){let r=await D(o,"@{u}");if(r!==null&&r!==await D(o,"HEAD"))return!0}return!1}async function Zt(t){let e=p();if(t.discard.length>0)await e.gitUnstage(t.discard),await e.gitDiscard(t.discard);for(let o of t.removeUntracked)await e.deleteFile(o)}async function O(){let t=p(),e=[];try{e=await M()}catch{e=[]}if(e.length>0&&t.setPackageVersions){await N(e);return}if(!t.installDependencies)return;let o=il({status:"Installing dependencies…",title:"Syncing dependencies"});try{let r=await t.installDependencies();if(r.ok)o.done();else o.fail(r.log??"Install failed")}catch(r){o.fail(Q(r))}}async function ft(t){let e=p();try{await Zt(t)}catch(o){throw Error(`Could not reset local package files: ${Q(o)}`,{cause:o})}try{await e.gitPull()}catch(o){throw await O(),o}C.warn("Local package updates were superseded by pulled changes.",{source:"Source Control"}),await O()}async function Qt(t){let e=p(),o;try{o=await e.gitStatus()}catch{throw t}if(!(o.behind>0))throw t;let r=await pt(o);if(mt(r)||await Xt(o))throw t;if(!r.automated){if(!await qo("Discard local package changes?","package.json / bun.lock have local edits that conflict with incoming changes. Discard them, pull, and re-sync packages?",{confirmLabel:"Discard and pull",destructive:!0}))throw t}await ft(r)}async function lt(){let t;try{let e=await p().listDirectory("");t=new Set(e.filter((o)=>o.type==="file").map((o)=>o.name))}catch{t=new Set(j)}return Promise.all(j.map((e)=>t.has(e)?ut(e):Promise.resolve(null)))}async function F(){let t=p(),e=await lt(),o=null;try{await t.gitFetch(),o=await t.gitStatus()}catch{o=null}if(o&&o.behind>0){let i=await pt(o);if(!mt(i)&&i.automated){await ft(i);return}}try{await t.gitPull()}catch(i){await Qt(i);return}let r=await lt();if(e.some((i,a)=>i!==r[a]))await O()}async function vm(){let t=p();try{let e=await t.gitStatus();if(!e.isRepo||!Array.isArray(e.remotes)||e.remotes.length===0)return}catch{return}C.info("Syncing project…",{key:"project.sync",source:"Source Control"});try{await F()}catch(e){C.warn("The project could not be synced with its remote.",{detail:Q(e),key:"project.sync",source:"Source Control",tier:"problem"})}}async function Yt(){let t=p(),{git:e}=u,o;try{o=await t.gitStatus()}catch(r){e.error=Q(r);return}if(e.status=o,!o.isRepo){e.branches=null;return}try{e.branches=await t.gitBranches()}catch(r){e.error=Q(r)}}async function ks(){if(!S)return;let{git:t}=u;t.loading=!0,t.error=null;try{if(await Yt(),t.lastUpdated=ar(),t.rev+=1,await te(),t.logEntries!==null)await cS()}catch(e){t.error=Q(e)}finally{t.loading=!1}}async function te(){let t=u.git.diffState;if(!t)return;let e=u.git.status?.files.find((o)=>o.path===t.filePath);if(!e||!gt(e.status)){u.git.diffState=null;return}try{u.git.diffState=await T(t.filePath,e.status)}catch{}}async function lT(t){if(u.git.rev+=1,!u.git.loading)ks();let e=u.git.diffState;if(!t||e?.filePath!==t)return;try{u.git.diffState=await T(t,e.fileStatus)}catch{}}async function cS(){try{u.git.logEntries=await p().gitLog(30)}catch(t){u.git.error=Q(t)}}async function dS(t){let e=p();if(!e.gitClone){C.warn("Cloning is not supported on this platform.",{source:"Source Control"});return}let o=await ei("Clone Git Repository",{confirmLabel:"Clone",message:"Repository URL",placeholder:"https://github.com/user/repo.git",validate:(r)=>r.trim()?"":"Enter a repository URL."});if(!o)return;try{C.info("Cloning repository…",{key:"git.clone",source:"Source Control"});let r=await e.gitClone(o);if(r.root)C.success("Clone complete.",{key:"git.clone"}),await t.openRecentProject(r.root)}catch(r){C.error("Could not clone the repository.",{detail:Q(r),key:"git.clone",source:"Source Control"})}}function wb(){return _e()&&Boolean(p().gitClone)}function Vs(){return _e()&&p().gitHosted===!0}function cT(){return _e()&&ee(p().createPullRequest)}var oe=new Map([["A","added"],["D","deleted"],["M","modified"],["R","renamed"],["U","untracked"]]);function re(t){return oe.get(t)??"changed"}var ne=new Map([["A","NEW"],["D","DELETED"],["M","EDIT"],["R","RENAMED"],["U","NEW"]]);function dT(t){return ne.get(t)??"EDIT"}var ie=new Set(["M","A","U","D"]);function gt(t){return ie.has(t)}async function T(t,e){let o=p(),r=e!=="A"&&e!=="U",i=e!=="D",[a,s]=await Promise.all([r?o.gitShow({path:t,ref:"HEAD"}):Promise.resolve(""),i?o.readFile(t):Promise.resolve("")]);return{currentContent:s,filePath:t,fileStatus:e,originalContent:a}}async function uT(t,e){try{return await T(t,e)}catch(o){return console.warn("loadDiffForLens:",Q(o)),null}}var E={};function hT(t){E=t}function pT(){E.cloneRepository?.()}function ht(t){return u.git.status?.files.find((e)=>e.path===t)}async function fT(t){let e=ht(t);if(!e)return;let o=gt(e.status)?B(e.path,e.status):`"${e.path}" has no change this view can open.`;if(o){u.git.error=o;return}try{u.git.loading=!0;let r=await T(e.path,e.status);u.git.diffState=r,E.setGitDiffState?.(r);let i=await V(e.path);if(i)E.setCanvasMode?.(i,"git-diff")}catch(r){u.git.error=`Failed to load diff: ${Q(r)}`}finally{u.git.loading=!1}}async function y(t){let e=p();u.git.loading=!0,u.git.error=null;try{return await t(e),await ks(),!0}catch(o){return u.git.error=Q(o),u.git.loading=!1,!1}}async function ae(){try{C.info("Initializing repository…",{key:"git.init"}),await p().gitInit(),C.success("Repository initialized.",{key:"git.init"})}catch(t){C.error("Could not initialize the repository.",{action:"git.init",detail:Q(t),key:"git.init",source:"Source Control"});return}await ks()}async function se(){await y((t)=>t.gitPush())}async function mT(){await y((t)=>t.gitFetch())}async function gT(){u.git.loading=!0,u.git.error=null;try{await F(),await ks()}catch(t){u.git.error=Q(t),u.git.loading=!1}}async function ce(){await z({projectName:S?.name||"my-project"})}async function ue(){if(await hS())C.success("Signed in to GitHub.",{key:"github.auth"})}async function bT(t,e){await y((o)=>e?o.gitStage([t]):o.gitUnstage([t]))}async function vT(t){let e=(u.git.status?.files??[]).filter((o)=>Boolean(o.staged)!==t).map((o)=>o.path);if(e.length===0)return;await y((o)=>t?o.gitStage(e):o.gitUnstage(e))}var b={paths:new Set,root:""};function pe(){let t=S?.projectRoot??"";if(b.root!==t)b={paths:new Set,root:t};let e=u.git.status?.files??[],o=new Set(e.map((i)=>i.path));for(let i of b.paths)if(!o.has(i))b.paths.delete(i);let r=e.filter((i)=>!b.paths.has(i.path));for(let i of r)b.paths.add(i.path);return r.filter((i)=>!i.staged).map((i)=>i.path)}async function yT(){if(u.git.loading||!u.git.status?.isRepo)return;let t=pe();if(t.length>0)await y((e)=>e.gitStage(t))}async function wT(t){if(ht(t)?.status==="U")return;if(!await qo("Discard Changes",`Discard changes to ${t}?`,{confirmLabel:"Discard",destructive:!0}))return;await y((o)=>o.gitDiscard([t]))}async function xT(){let{branches:t,status:e}=u.git,o=await ei("New Branch",{confirmLabel:"Create",message:`Branching from ${t?.current||e?.branch||"the current branch"}.`,placeholder:"feature/my-change",validate:(r)=>r.trim()?"":"Enter a branch name."});if(o)await y((r)=>r.gitCreateBranch(o.trim()))}async function _T(t){if(t===u.git.branches?.current)return;if(Vs()){if(!await qo("Switch Branch",`Each branch opens in its own session, so switching to ${t} reloads Studio on that branch.`,{confirmLabel:"Switch and reload"}))return}await y((e)=>e.gitCheckout(t))}function uS(t){let e=t.path.split("/"),o=e.pop()??t.path,r=e.join("/"),i=re(t.status);return{cannotDiscard:t.status==="U",dir:r,hasDir:r!=="",included:Boolean(t.staged),key:t.path,label:`${t.path}, ${i}`,name:o,path:t.path,status:t.status,statusWord:i}}var yt=[["components","Components"],["layouts","Layouts"],["styles","Styles"]];function de(t){let e=Gl(t);if(e!==null)return e;let[o]=t.split("/");if(o==="pages")return hi;if(yt.some(([r])=>r===o))return`folder:${o}`;return Ys.has(tn(t))?"media":"other"}function ST(t){let e=[..._m().map((r)=>[r.key,r.title]),...yt.map(([r,i])=>[`folder:${r}`,i]),["media","Media"],["other","Other"]],o=new Map;for(let r of t){let i=de(r.path);o.set(i,[...o.get(i)??[],r])}return e.flatMap(([r,i])=>{let a=o.get(r);return a?[{files:a.map((s)=>uS(s)),key:r,name:i}]:[]})}function CT(t){return{hash:t.hash.slice(0,7),key:t.hash,message:t.message,meta:`${t.author} · ${xw(t.date)}`}}function xw(t){let e=new Date(t),o=ar()-e.getTime(),r=Math.floor(o/60000);if(r<1)return"just now";if(r<60)return`${r}m ago`;let i=Math.floor(r/60);if(i<24)return`${i}h ago`;let a=Math.floor(i/24);if(a<30)return`${a}d ago`;return e.toLocaleDateString()}function kT(t){return t?`Last updated ${new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`:""}var x=null;function ET(){if(x)return;x=setInterval(()=>{if(u.workspace==="publish"&&!u.git.loading)ks()},nM)}function xb(){if(x)clearInterval(x),x=null;b={paths:new Set,root:""}}function me(){return[{category:"Source Control",id:"git.init",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"an open project that git is not already tracking",when:(t)=>t.project.open,enablement:(t)=>!t.project.isRepo,run:async()=>{await ae()},title:"Initialize Repository"},{category:"Source Control",id:"git.createGithubRepository",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await ce()},title:"Create GitHub Repository"},{category:"Source Control",id:"git.push",level:"project",menus:["commandbar/overflow","palette"],group:"7_scm",requires:"a project tracked by git",when:(t)=>t.project.open,enablement:(t)=>t.project.isRepo,run:async()=>{await se()},title:"Push"},{category:"Source Control",id:"git.signInToGithub",level:"application",menus:["palette"],group:"7_scm",run:async()=>{await ue()},title:"Sign In to GitHub"}]}function TT(t){t.registerAll(me())}
|
|
2
|
+
export{aS,JD,yw,YD,ww,lS,bm,vm,yb,ks,lT,cS,dS,wb,Vs,cT,dT,uT,hT,pT,fT,mT,gT,bT,vT,yT,wT,xT,_T,uS,ST,CT,xw,kT,ET,xb,TT};
|
|
3
|
+
|
|
4
|
+
//# debugId=6EFA393F8AF87BA864756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-zwaxn5s2.js.map
|