@jxsuite/studio 10.2.0 → 10.4.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-bx702wqa.js → 2020-906vx2dq.js} +3 -3
- package/dist/chunks/adapter-hnvad61x.js +4 -0
- package/dist/chunks/add-new-flow-v0pm96mr.js +4 -0
- package/dist/chunks/cf-account-picker-xb8vvt2h.js +4 -0
- package/dist/chunks/cf-settings-mkbcz4z2.js +4 -0
- package/dist/chunks/components-w5zqwva1.js +4 -0
- package/dist/chunks/content-source-g38w0d3f.js +4 -0
- package/dist/chunks/convert-to-repeater-r8sfxjjm.js +4 -0
- package/dist/chunks/editor-wvf5e6j9.js +4 -0
- package/dist/chunks/entry-commands-t13dyw3c.js +4 -0
- package/dist/chunks/extension-sections-vjzw46xb.js +4 -0
- package/dist/chunks/file-ops-1sghzgcr.js +4 -0
- package/dist/chunks/files-zrqtgt41.js +4 -0
- package/dist/chunks/format-host-9gy76erh.js +4 -0
- package/dist/chunks/fs-events-45rhg3me.js +4 -0
- package/dist/chunks/grid-open-t4fq6bbm.js +4 -0
- package/dist/chunks/{grid-view-tghcwrrt.js → grid-view-2f03wcgw.js} +16 -16
- package/dist/chunks/icons-gb967qc8.js +4 -0
- package/dist/chunks/iframe-host-9aq8ze3q.js +4 -0
- package/dist/chunks/image-bake-4afr4y6a.js +4 -0
- package/dist/chunks/image-editor-x7t8jbjn.js +4 -0
- package/dist/chunks/index-f9qr7kzh.js +4 -0
- package/dist/chunks/{index-vr006kbt.js → index-yjrfeks8.js} +3 -3
- package/dist/chunks/{javascript-z1g3s9fd.js → javascript-hy2mws8v.js} +3 -3
- package/dist/chunks/{jsonMode-7szwg8c4.js → jsonMode-vj30te2h.js} +6 -6
- package/dist/chunks/jx-validate-r4ax11e3.js +4 -0
- package/dist/chunks/layers-m49nmwvx.js +4 -0
- package/dist/chunks/layers-panel-zr92pwdp.js +4 -0
- package/dist/chunks/lit-html-k2mb9k0r.js +4 -0
- package/dist/chunks/media-library-j74rt0w4.js +4 -0
- package/dist/chunks/media-open-mypr0k6b.js +4 -0
- package/dist/chunks/media-picker-pemtbsjv.js +4 -0
- package/dist/chunks/{monaco-binding-v42w9c1v.js → monaco-binding-a51py33c.js} +3 -3
- package/dist/chunks/monaco-buffer-pa0g6ax7.js +4 -0
- package/dist/chunks/{monaco-setup-7bffxd6v.js → monaco-setup-0hw9f835.js} +3 -3
- package/dist/chunks/notify-bwehrp7q.js +4 -0
- package/dist/chunks/parse-hee7ne9b.js +4 -0
- package/dist/chunks/platform-kv0k65cy.js +4 -0
- package/dist/chunks/publish-panel-vg1n880b.js +4 -0
- package/dist/chunks/publish-quick-4fwngwrw.js +4 -0
- package/dist/chunks/publish-workspace-jv4w2bx2.js +4 -0
- package/dist/chunks/quick-search-nh29rt8a.js +4 -0
- package/dist/chunks/references-vqyr5s9x.js +4 -0
- package/dist/chunks/right-panel-3ws9f2w0.js +4 -0
- package/dist/chunks/source-control-h3hcs5gy.js +4 -0
- package/dist/chunks/{studio-j3d2fjqz.js → studio-0939t1q1.js} +4 -4
- package/dist/chunks/studio-0gvvqj3h.js +5 -0
- package/dist/chunks/studio-0khd8xtx.js +4 -0
- package/dist/chunks/{studio-9b7177jq.js → studio-0x6f3nk9.js} +4 -4
- package/dist/chunks/studio-1410q5dw.js +5 -0
- package/dist/chunks/studio-1ctnw3xv.js +5 -0
- package/dist/chunks/studio-1ks5d9y4.js +5 -0
- package/dist/chunks/{studio-awxwjawq.js → studio-1y9mab9m.js} +4 -4
- package/dist/chunks/studio-2e4hry72.js +6 -0
- package/dist/chunks/studio-2kpxm0eh.js +7 -0
- package/dist/chunks/studio-2pk7kc7z.js +5 -0
- package/dist/chunks/studio-2x972v58.js +5 -0
- package/dist/chunks/studio-2zz4qbv9.js +5 -0
- package/dist/chunks/{studio-bvs9kpst.js → studio-3na1r48j.js} +8 -8
- package/dist/chunks/studio-3pz4t5a2.js +5 -0
- package/dist/chunks/studio-3qr08sxq.js +4 -0
- package/dist/chunks/{studio-75kcdbsk.js → studio-45mj4jqe.js} +4 -4
- package/dist/chunks/studio-4bgvvzhv.js +5 -0
- package/dist/chunks/studio-4f7thq0p.js +5 -0
- package/dist/chunks/studio-4fnb5648.js +5 -0
- package/dist/chunks/studio-4zd6an2b.js +5 -0
- package/dist/chunks/{studio-9rbe2xpw.js → studio-5tet77de.js} +3 -3
- package/dist/chunks/studio-61rg2cz5.js +5 -0
- package/dist/chunks/{studio-ybnwymxw.js → studio-7rrdbvex.js} +4 -4
- package/dist/chunks/{studio-sxdb9h3q.js → studio-90zkgne5.js} +7 -7
- package/dist/chunks/studio-9c6cbq2c.js +4 -0
- package/dist/chunks/studio-9dq7rwc7.js +5 -0
- package/dist/chunks/studio-9gr7xs9r.js +6 -0
- package/dist/chunks/studio-a88ej93p.js +7 -0
- package/dist/chunks/{studio-er5f383a.js → studio-abh9kfdh.js} +4 -4
- package/dist/chunks/studio-acer0g8w.js +5 -0
- package/dist/chunks/{studio-qh8berdz.js → studio-amaz545p.js} +4 -4
- package/dist/chunks/studio-az3wvyh2.js +5 -0
- package/dist/chunks/studio-bg8pzprg.js +5 -0
- package/dist/chunks/{studio-399a25za.js → studio-bnc50f9h.js} +4 -4
- package/dist/chunks/studio-brh8d2pr.js +5 -0
- package/dist/chunks/{studio-646nn2ys.js → studio-c2fa783p.js} +5 -5
- package/dist/chunks/studio-cfnn70h1.js +5 -0
- package/dist/chunks/{studio-rzqaz21g.js → studio-cqxj4fcy.js} +4 -4
- package/dist/chunks/studio-cw11h078.js +5 -0
- package/dist/chunks/studio-daksw8kh.js +5 -0
- package/dist/chunks/studio-dn56z7sn.js +5 -0
- package/dist/chunks/studio-egnjpyde.js +9 -0
- package/dist/chunks/studio-ejrypvmq.js +5 -0
- package/dist/chunks/studio-eqcddvc2.js +928 -0
- package/dist/chunks/studio-evq47j2z.js +5 -0
- package/dist/chunks/{studio-r7pf0rkv.js → studio-frc16j8v.js} +7 -7
- package/dist/chunks/studio-g0hxtcga.js +5 -0
- package/dist/chunks/{studio-th7z3fg7.js → studio-g9brbewz.js} +4 -4
- package/dist/chunks/studio-gnazwtv3.js +5 -0
- package/dist/chunks/studio-hfqpfmpk.js +5 -0
- package/dist/chunks/studio-hh394phe.js +5 -0
- package/dist/chunks/{studio-pjtntksy.js → studio-j0zf5x2x.js} +4 -4
- package/dist/chunks/studio-j5fcp6gj.js +5 -0
- package/dist/chunks/studio-jd1qb1st.js +7 -0
- package/dist/chunks/studio-jma2q8r9.js +5 -0
- package/dist/chunks/studio-k0xzrse2.js +64 -0
- package/dist/chunks/studio-k1xqrgm5.js +5 -0
- package/dist/chunks/studio-k2evngrj.js +7 -0
- package/dist/chunks/studio-k3we3kqb.js +5 -0
- package/dist/chunks/studio-knsjyx7n.js +5 -0
- package/dist/chunks/studio-mrjtnm62.js +5 -0
- package/dist/chunks/{studio-sevbc3xv.js → studio-n9qba0gx.js} +4 -4
- package/dist/chunks/{studio-ea74s8c1.js → studio-nvcn2ykc.js} +4 -4
- package/dist/chunks/studio-nwf0c32p.js +5 -0
- package/dist/chunks/studio-nzemfbkk.js +14 -0
- package/dist/chunks/{studio-43y04qck.js → studio-pj216fmn.js} +4 -4
- package/dist/chunks/{studio-4g8yb6jn.js → studio-pm17wdc4.js} +4 -4
- package/dist/chunks/studio-pwctzka3.js +16 -0
- package/dist/chunks/{studio-71m92v9s.js → studio-q80fg1d6.js} +7 -7
- package/dist/chunks/studio-q9hx2qp0.js +5 -0
- package/dist/chunks/studio-qrzmfaf6.js +5 -0
- package/dist/chunks/{studio-86r8hp7r.js → studio-r6mx7vm5.js} +5 -5
- package/dist/chunks/studio-rr00ex23.js +7 -0
- package/dist/chunks/{studio-4jhw38b2.js → studio-s24mhq0z.js} +4 -4
- package/dist/chunks/studio-sce30r7b.js +4 -0
- package/dist/chunks/studio-swedpd82.js +5 -0
- package/dist/chunks/studio-tmfcn347.js +6 -0
- package/dist/chunks/studio-tpxcryf2.js +5 -0
- package/dist/chunks/{studio-wc6za3zs.js → studio-v5wktj6f.js} +4 -4
- package/dist/chunks/studio-v7a7yb5w.js +9 -0
- package/dist/chunks/{studio-kg1abnz0.js → studio-vpevkfxw.js} +4 -4
- package/dist/chunks/{studio-881z1xrx.js → studio-wmjmsw0p.js} +4 -4
- package/dist/chunks/studio-wqfaqw4m.js +5 -0
- package/dist/chunks/{studio-hhp4x8xf.js → studio-xpx91fby.js} +5 -5
- package/dist/chunks/studio-xva3hzkv.js +5 -0
- package/dist/chunks/{studio-6hzdjfv0.js → studio-xx3r3sb0.js} +4 -4
- package/dist/chunks/{studio-cg1bfyhf.js → studio-z3fztxrp.js} +8 -8
- package/dist/chunks/studio-z9453ypn.js +6 -0
- package/dist/chunks/{tsMode-f54j66ym.js → tsMode-jg1dtphj.js} +7 -7
- package/dist/chunks/workspace-6ztqcrsh.js +4 -0
- package/dist/chunks/workspace-home-rse9h8a0.js +4 -0
- package/dist/chunks/{ws-client-e8kj684q.js → ws-client-arz2qsy9.js} +3 -3
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +83 -78
- package/dist/studio.js +84 -84
- package/package.json +11 -11
- package/src/browse/library-pane.ts +44 -29
- package/src/browse/library-preview.ts +6 -2
- package/src/canvas/asset-refs.ts +13 -4
- package/src/canvas/asset-resolve.ts +54 -11
- package/src/canvas/canvas-render.ts +25 -0
- package/src/canvas/iframe-entry.ts +5 -1
- package/src/canvas/iframe-host.ts +16 -6
- package/src/canvas/iframe-protocol.ts +9 -1
- package/src/commands/context.ts +5 -0
- package/src/commands/live-context.ts +5 -2
- package/src/editor/shortcuts.ts +3 -0
- package/src/files/asset-versions.ts +108 -2
- package/src/files/file-ops.ts +11 -1
- package/src/files/files.ts +111 -48
- package/src/files/media-paths.ts +12 -4
- package/src/files/media-upload.ts +195 -21
- package/src/files/new-file-name.ts +39 -1
- package/src/media/image-bake.ts +164 -0
- package/src/media/image-editor.ts +846 -0
- package/src/media/image-format.ts +262 -0
- package/src/media/image-recipe.ts +651 -0
- package/src/media/media-commands.ts +65 -1
- package/src/media/media-library-model.ts +1 -1
- package/src/media/media-library.ts +175 -15
- package/src/media/media-open.ts +156 -3
- package/src/media/media-pane.ts +8 -4
- package/src/panels/pane-context.ts +6 -1
- package/src/panels/tab-strip.ts +12 -3
- package/src/studio.ts +13 -2
- package/src/surfaces/image-editor.json +1390 -0
- package/src/surfaces/image-editor.ts +272 -0
- package/src/surfaces/inspector-dock.json +3 -3
- package/src/surfaces/media-library.json +129 -1
- package/src/surfaces/media-library.ts +17 -2
- package/src/types.ts +2 -1
- package/src/workspace/tab-workspace.ts +2 -1
- package/src/workspace/workspace-switch.ts +3 -1
- package/src/workspace/workspace.ts +22 -1
- package/dist/chunks/adapter-pp011m5x.js +0 -4
- package/dist/chunks/add-new-flow-ecqmzz76.js +0 -4
- package/dist/chunks/cf-account-picker-c07znkqt.js +0 -4
- package/dist/chunks/cf-settings-0v2bmqy0.js +0 -4
- package/dist/chunks/components-yn0dn2pq.js +0 -4
- package/dist/chunks/content-source-g0j41yy6.js +0 -4
- package/dist/chunks/convert-to-repeater-sbjk7tgn.js +0 -4
- package/dist/chunks/editor-xz02jeh1.js +0 -4
- package/dist/chunks/entry-commands-kmt02crp.js +0 -4
- package/dist/chunks/extension-sections-0rprf12d.js +0 -4
- package/dist/chunks/file-ops-mexj5qed.js +0 -4
- package/dist/chunks/files-b2tcppdd.js +0 -4
- package/dist/chunks/format-host-btsevv0c.js +0 -4
- package/dist/chunks/fs-events-r0apejva.js +0 -4
- package/dist/chunks/grid-open-n2a8xkht.js +0 -4
- package/dist/chunks/icons-853n6qt3.js +0 -4
- package/dist/chunks/iframe-host-gx0ypyh3.js +0 -4
- package/dist/chunks/index-bs4k9tr6.js +0 -4
- package/dist/chunks/jx-validate-ymf10teh.js +0 -4
- package/dist/chunks/layers-p9nfya38.js +0 -4
- package/dist/chunks/layers-panel-tt1hzhhf.js +0 -4
- package/dist/chunks/lit-html-x18n2sfz.js +0 -4
- package/dist/chunks/media-library-0n45gv8r.js +0 -4
- package/dist/chunks/media-picker-s09at95z.js +0 -4
- package/dist/chunks/monaco-buffer-een2ea0v.js +0 -4
- package/dist/chunks/notify-qwb8radt.js +0 -4
- package/dist/chunks/parse-v77xtwv7.js +0 -4
- package/dist/chunks/platform-8jnez0wr.js +0 -4
- package/dist/chunks/publish-panel-aysnj611.js +0 -4
- package/dist/chunks/publish-quick-kpbqs9mz.js +0 -4
- package/dist/chunks/publish-workspace-nd0a8q99.js +0 -4
- package/dist/chunks/quick-search-vg0jkhk2.js +0 -4
- package/dist/chunks/references-a7v6a0e2.js +0 -4
- package/dist/chunks/right-panel-cvk1vxx5.js +0 -4
- package/dist/chunks/source-control-fsqzc6he.js +0 -4
- package/dist/chunks/studio-05jfwbmf.js +0 -5
- package/dist/chunks/studio-0q5jwddh.js +0 -9
- package/dist/chunks/studio-0w2dr0q8.js +0 -5
- package/dist/chunks/studio-1tzpds97.js +0 -9
- package/dist/chunks/studio-216b27sv.js +0 -4
- package/dist/chunks/studio-2ejhqns4.js +0 -5
- package/dist/chunks/studio-2r90cts3.js +0 -16
- package/dist/chunks/studio-399xknkb.js +0 -6
- package/dist/chunks/studio-4ncmwqw5.js +0 -5
- package/dist/chunks/studio-5atwjgkj.js +0 -7
- package/dist/chunks/studio-5frqk7c0.js +0 -5
- package/dist/chunks/studio-6cwj6xrx.js +0 -5
- package/dist/chunks/studio-78pywnp2.js +0 -6
- package/dist/chunks/studio-886t6ztg.js +0 -5
- package/dist/chunks/studio-8wnvtr4z.js +0 -5
- package/dist/chunks/studio-8z66jk4z.js +0 -5
- package/dist/chunks/studio-b2qpt0xy.js +0 -14
- package/dist/chunks/studio-c71806xz.js +0 -7
- package/dist/chunks/studio-cbwks69x.js +0 -928
- package/dist/chunks/studio-cg710sk9.js +0 -5
- package/dist/chunks/studio-cw0wb9qk.js +0 -7
- package/dist/chunks/studio-cyheys7k.js +0 -5
- package/dist/chunks/studio-ea5m9kg5.js +0 -5
- package/dist/chunks/studio-efdxjwyp.js +0 -64
- package/dist/chunks/studio-egmw2837.js +0 -5
- package/dist/chunks/studio-f746039f.js +0 -5
- package/dist/chunks/studio-fmdymd9v.js +0 -5
- package/dist/chunks/studio-gcm12z00.js +0 -6
- package/dist/chunks/studio-gj98m8gy.js +0 -7
- package/dist/chunks/studio-hasbgjah.js +0 -5
- package/dist/chunks/studio-hz5n7x27.js +0 -5
- package/dist/chunks/studio-jeraxdgv.js +0 -7
- package/dist/chunks/studio-jvgek9xt.js +0 -5
- package/dist/chunks/studio-jws1a87n.js +0 -5
- package/dist/chunks/studio-k2sz13zg.js +0 -5
- package/dist/chunks/studio-k3m4jkdk.js +0 -5
- package/dist/chunks/studio-kg5ya5r2.js +0 -5
- package/dist/chunks/studio-khwbgrtg.js +0 -5
- package/dist/chunks/studio-mx6wzh25.js +0 -5
- package/dist/chunks/studio-mxs3ar9t.js +0 -5
- package/dist/chunks/studio-nm4szey4.js +0 -5
- package/dist/chunks/studio-nqxqf8p2.js +0 -4
- package/dist/chunks/studio-qn7z4krm.js +0 -5
- package/dist/chunks/studio-qyed0ah6.js +0 -5
- package/dist/chunks/studio-r4bcdwhq.js +0 -5
- package/dist/chunks/studio-rtfnhrdg.js +0 -5
- package/dist/chunks/studio-s5tzw84t.js +0 -5
- package/dist/chunks/studio-t51y8v1d.js +0 -5
- package/dist/chunks/studio-t98vq4r6.js +0 -5
- package/dist/chunks/studio-tsxpqvh0.js +0 -6
- package/dist/chunks/studio-v1yascv2.js +0 -5
- package/dist/chunks/studio-wxq6v5sv.js +0 -5
- package/dist/chunks/studio-y60sts62.js +0 -4
- package/dist/chunks/studio-zndrqawb.js +0 -5
- package/dist/chunks/studio-zwaxn5s2.js +0 -5
- package/dist/chunks/workspace-home-x1787wpv.js +0 -4
- package/dist/chunks/workspace-zpe1np43.js +0 -4
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,ye}from"./studio-4fnb5648.js";import{dt}from"./studio-tpxcryf2.js";import{$s}from"./studio-hh394phe.js";import{oa,ra,At}from"./studio-1ks5d9y4.js";import{Jc,IO,Ys,rv,nr,Vd,Yc,OO,hh,fl,MO,Px}from"./studio-61rg2cz5.js";import{Xc}from"./studio-acer0g8w.js";import{a0,wn}from"./studio-4f7thq0p.js";import{Ve,vt,E,R}from"./studio-9dq7rwc7.js";import{Me}from"./studio-0gvvqj3h.js";import{g}from"./studio-3qr08sxq.js";import{ce}from"./studio-0939t1q1.js";var C={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaField",$description:"The media field: a thumbnail of what the value names, the value itself, and the two doors to a different one. It is a LEAF a caller interpolates — the Inspector's Content tab, the Signals panel and the grid's image-cell panel each draw an empty host and `ui/media-picker.ts` mounts this into it — so it has no chrome of its own and takes its width from whatever row it lands in. **Browse is addressed through its `part`, not through a class.** `ui/regions.ts` derives `inspector/field:<prop>/browse` by finding the Browse control inside the Inspector's own `[data-prop]` row; the handle used to be `.media-picker-browse`, and a document emits no class, so `[part=\"browse\"]` is the handle now. The four `.media-picker*` rules from `styles/overlays.css` are TRANSCRIBED here rather than shared, because a class a document does not emit cannot style it. `--radius` becomes `--jx-radius-sm` on the way, because a document mounted in a pane's stage is outside `<sp-theme>` and would otherwise take a fallback rather than follow the theme.",tagName:"div",attributes:{part:"media-field"},style:{$description:"The row's own layout and the four transcribed `.media-picker*` rules. Upload and Browse never shrink, so the FIELD is what yields width when the row is narrow — the buttons would otherwise collapse into unreadable stubs before the text did.",display:"flex",alignItems:"center",gap:"var(--jx-space-1)",flex:"1",minWidth:"0",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="value"]':{flex:"1",minWidth:"0"},'& [part="upload"]':{flexShrink:"0"},'& [part="browse"]':{flexShrink:"0"},'& [part="thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",border:"1px solid var(--border)",flexShrink:"0"}},children:[{tagName:"span",attributes:{part:"thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/thumbState"},cases:{shown:{$description:"Decorative on purpose: the field beside it already states the path in text, so a caption here would be the same fact twice to a screen reader and nothing to anyone else.",tagName:"img",attributes:{part:"thumb",src:"${state.thumbSrc}",alt:""}}}},{tagName:"jx-textfield",attributes:{part:"value"},$props:{size:"sm",label:"${state.label}",placeholder:"/image.jpg",value:{$ref:"#/state/value"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/edit"},value:[{$ref:"event#/target/value"}]}],description:"Every keystroke, because the host debounces it: the canvas follows the typing without a document write per character."},onfocus:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/warm"},value:[]}],description:"Entering the field is the earliest honest signal that a pick is coming, so the project's media are listed then rather than when Browse is pressed."}},{tagName:"jx-action-button",attributes:{part:"upload"},$props:{size:"sm",quiet:!0,icon:"upload-simple",label:"Upload media",hint:"Upload media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/upload"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"browse"},$props:{size:"sm",quiet:!0,icon:"image",label:"Browse media",hint:"Browse media"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browse"},value:[{$ref:"event#/currentTarget"}]}],description:"The button hands over ITSELF: the browser is a popover and the platform wants its invoker, both so a second press on this control toggles rather than reopens and so focus comes back here when it closes."}}]};E("media-field",C);function G(t,e){t.label=e.label,t.value=e.value,t.thumbState=e.thumbState,t.thumbSrc=e.thumbSrc}function D(t,e,o){let i=g({browse:o.browse,edit:o.edit,label:e.label,thumbSrc:e.thumbSrc,thumbState:e.thumbState,upload:o.upload,value:e.value,warm:o.warm}),a=null,r=!1;return R("media-field",i,t).then((n)=>{if(r){n.dispose();return}a=n}),{dispose(){r=!0,a?.dispose(),a=null},update:(n)=>G(i,n)}}function qu(t){let{anchor:e,name:o,scope:i,slot:a}=t,r=document.createElement("div");r.style.pointerEvents="auto",r.setAttribute(Ve,vt("popover",a)),dt("popover").append(r);let n=new AbortController,s=null,l=null,c=!1,T=()=>n.signal.aborted,H=(x)=>{if(c)return;if(c=!0,n.abort(),l?.dispose(),l=null,r.remove(),x)t.onDismissed?.()},U=(async()=>{let x={signal:n.signal};if(t.onNodeCreated)x.onNodeCreated=t.onNodeCreated;let I=await R(o,i,r,x);if(T())return;if(l=I,s=I.root,s.setAttribute(Ve,vt("popover",a)),s.addEventListener("toggle",(S)=>{if("newState"in S&&S.newState==="closed")H(!0)}),!s.hasAttribute("popover"))await new Promise((S)=>{s?.addEventListener("jx-ready",()=>S(),{once:!0})});if(T())return;s.showPopover(e?{source:e}:void 0)})();return{close:()=>{if(c)return;if(s?.open)s.hidePopover();H(!1)},host:r,isOpen:()=>!c,ready:U}}var _={$schema:"https://jxsuite.com/schema/v1",$id:"StudioMediaBrowser",$description:'The project\'s media, offered under whatever control asked for them. **Not the kit menu, and the difference is the thumbnails.** `surfaces/menu.json` is the settled answer to "a list of actions" and a `MenuRowProjection` carries a title, a chord and a gate — there is nowhere in it for a picture, nowhere for the size caption beside it, and a `jx-menu` is itself `popover=auto`, so a filter field cannot stand above one inside a panel. This is a browser: you pick an image by looking at it. **It is a `jx-popover`, so the PLATFORM owns dismissal** — light dismiss, Escape, the top layer and focus back to the invoker are the popover\'s contract, which is why nothing here binds a document listener and why the panel can paint over a modal `<dialog>` that the layer-div popover it replaces could not. The rows are plain buttons in a group, exactly as `grid-views.json`\'s saved views are: a list of buttons is reachable by Tab, and a `role="listbox"` would be a keyboard contract nothing here implements.',tagName:"jx-popover",attributes:{part:"media-browser"},$props:{label:"Project media",x:{$ref:"#/state/x"},y:{$ref:"#/state/y"}},children:[{tagName:"div",attributes:{part:"body"},style:{$description:"A search box that stays put and a list that scrolls under it. The panel itself never scrolls — `jx-popover` says why — so the box is here rather than on the host.",display:"flex",flexDirection:"column",gap:"var(--jx-space-2)",padding:"var(--jx-space-2)",minWidth:"260px",maxHeight:"360px",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="rows"]':{display:"flex",flexDirection:"column",gap:"2px",overflowY:"auto",minHeight:"0"},'& [part="row"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-2)",textAlign:"left",background:"none",border:"none",color:"var(--fg)",font:"inherit",padding:"var(--jx-space-1) var(--jx-space-2)",borderRadius:"var(--jx-radius-sm)",cursor:"pointer",minWidth:"0"},'& [part="row"]:hover':{background:"var(--bg-hover)"},'& [part="row"]:focus-visible':{outline:"var(--jx-focus-ring)",outlineOffset:"-2px"},'& [part="row-thumb"]':{width:"24px",height:"24px",objectFit:"cover",borderRadius:"var(--jx-radius-sm)",flexShrink:"0"},'& [part="row-text"]':{display:"flex",flexDirection:"column",minWidth:"0"},'& [part="row-name"]':{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="row-caption"]':{color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="empty"]':{margin:"0",color:"var(--fg-dim)",fontSize:"var(--jx-text-xs)"},'& [part="more"]':{justifyContent:"flex-start"},'& [part="browse-all"]':{$description:"The last row, set apart by a rule: it does not pick a file, it opens the picker that shows all of them.",marginTop:"var(--jx-space-1)",paddingTop:"var(--jx-space-2)",borderTop:"1px solid var(--border)",justifyContent:"flex-start"}},children:[{tagName:"jx-textfield",attributes:{part:"filter"},$props:{type:"search",size:"sm",label:"Search media",placeholder:"Search media…",autocomplete:"off",value:{$ref:"#/state/filter"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/setFilter"},value:[{$ref:"event#/target/value"}]}]}},{tagName:"div",attributes:{part:"rows-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/rowsState"},cases:{empty:{tagName:"p",attributes:{part:"empty"},textContent:"${state.emptyLabel}"},listed:{tagName:"div",attributes:{part:"rows"},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{$description:"One file. The row hands back the value a pick writes — the site URL — rather than an index, so the list may be filtered under it without changing what any row means.",tagName:"button",attributes:{part:"row",type:"button","data-path":"${$map.item.path}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/pick"},value:[{$ref:"$map/item/path"}]}]},children:[{tagName:"span",attributes:{part:"row-thumb-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/thumbState"},cases:{shown:{$description:"Decorative: the row's own text names the file. The load handler is the whole of the dimensions caption — measuring an image is a decode the `<img>` has finished by the time `load` fires, so the numbers are a read of work already done rather than a second fetch per row.",tagName:"img",attributes:{part:"row-thumb",src:"${$map.item.thumbSrc}",alt:""},onload:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/measure"},value:[{$ref:"$map/item/file"},{$ref:"event#/target/naturalWidth"},{$ref:"event#/target/naturalHeight"}]}]}}}},{tagName:"span",attributes:{part:"row-text"},children:[{tagName:"span",attributes:{part:"row-name"},textContent:"${$map.item.name}"},{tagName:"span",attributes:{part:"row-caption-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/captionState"},cases:{shown:{tagName:"span",attributes:{part:"row-caption"},textContent:"${$map.item.caption}"}}}]}]}}]}}},{tagName:"div",attributes:{part:"more-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"#/state/moreState"},cases:{shown:{$description:'A truncated list says so, and the marker is a control (the rule studio.md §5.6 states for every truncation marker): it raises the cap by fifty, so every file the Media workspace lists can be reached from here without a search. Inert "…21 more" text was the panel holding the answer and not showing it.',tagName:"jx-button",attributes:{part:"more"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/showMore"},value:[]}]},children:[{tagName:"span",textContent:"${state.moreLabel}"}]}}},{tagName:"jx-button",attributes:{part:"browse-all"},$props:{variant:"secondary",size:"sm",quiet:!0},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/browseAll"},value:[]}]},children:[{tagName:"span",textContent:"${state.browseAllLabel}"}]}]}]};E("media-browser",_);var X="media-picker";function Y(t,e){t.x=e.x,t.y=e.y,t.filter=e.filter,t.rowsState=e.rowsState,t.rows=e.rows,t.emptyLabel=e.emptyLabel,t.moreState=e.moreState,t.moreLabel=e.moreLabel,t.browseAllLabel=e.browseAllLabel}function V(t,e,o){let i=g({browseAll:e.browseAll,browseAllLabel:t.browseAllLabel,emptyLabel:t.emptyLabel,filter:t.filter,measure:e.measure,moreLabel:t.moreLabel,moreState:t.moreState,pick:e.pick,rows:t.rows,rowsState:t.rowsState,setFilter:e.setFilter,showMore:e.showMore,x:t.x,y:t.y}),a={anchor:o,name:"media-browser",scope:i,slot:X};if(e.dismissed)a.onDismissed=e.dismissed;let r=qu(a);return r.ready.then(()=>{if(r.isOpen())r.host.querySelector('[part="filter"] [part="input"]')?.focus()}),{close:r.close,host:r.host,isOpen:r.isOpen,ready:r.ready,update:(n)=>Y(i,n)}}var b=[],M=!1,L="images";function kT(t){let e=t.replaceAll("\\","/");return e.startsWith("public/")||new RegExp(`^content/[^/]+/${L}/`).test(e)}async function N(t,e){let o=[];try{let i=await $s(()=>e.listDirectory(t));OO(i);for(let a of i)if(a.type==="directory"){let r=await N(a.path,e);o.push(...r)}else{let r=At(a.name);if(ra.has(r))o.push({file:a.path,isImage:oa.has(r),kind:IO(a.name),name:a.name,ref:rv(a.path)})}}catch{}return o}async function Q(t){let e;try{e=(await t.listDirectory("content")).filter((a)=>a.type==="directory").map((a)=>a.path)}catch{return[]}let o=[];for(let i of e){let a=!1;try{a=(await t.listDirectory(i)).some((n)=>n.type==="directory"&&n.name===L)}catch{}if(a)o.push(...await N(`${i}/${L}`,t))}return o}async function Z(t){try{let e=await t.listDirectory(".");return new Set(e.filter((o)=>o.type==="directory").map((o)=>o.name).filter((o)=>o==="public"||o==="content"))}catch{return new Set(["public","content"])}}var h=null,O=0,A=new Set;function ET(t){return A.add(t),()=>{A.delete(t)}}function q(){for(let t of A)t()}function k(){if(M)return Promise.resolve();if(h)return h;if(!ye())return Promise.resolve();let t=O,e=(async()=>{let o=p(),i=await Z(o),[a,r]=await Promise.all([i.has("public")?N("public",o):[],i.has("content")?Q(o):[]]);if(t!==O)return;b=[...a,...r],M=!0,h=null,wn("leftPanel","rightPanel"),q()})();return h=e,e}function Gu(){if(!M)return k(),null;return b}function Dw(){b=[],M=!1,O+=1,h=null,MO(),q()}var z=null;function ee(){return z??=(ce("j74rt0w4"),import("./media-library-j74rt0w4.js")),z}async function zP(t,e={}){(await ee()).openMediaPickDialog({images:e.images===!0,onPick:t})}var y=50,d=null,f=null,v="",u=y,w={},B={x:0,y:0};function m(){let t=v.toLowerCase(),e=w.images?b.filter((r)=>r.isImage):b,o=t?e.filter((r)=>r.ref.toLowerCase().includes(t)||r.name.toLowerCase().includes(t)):e,a=o.slice(0,u).map((r)=>{let n=Px(Yc(r.file));return{caption:n,captionState:n?"shown":"hidden",file:r.file,key:r.file,name:r.name,path:r.ref,thumbSrc:r.isImage?nr(r.file):"",thumbState:r.isImage?"shown":"hidden"}});return{browseAllLabel:w.images?"Browse all images…":"Browse all media…",emptyLabel:e.length>0?"No matches":w.images?"No images in this project yet":"No media in this project yet",filter:v,moreLabel:`Show ${Math.min(o.length-u,y)} more`,moreState:o.length>u?"shown":"hidden",rows:a,rowsState:a.length>0?"listed":"empty",x:B.x,y:B.y}}function P(){let t=d;d=null,f=null,v="",u=y,t?.close()}var j=0;function te(t,e,o){if(!fl(t,e,o)){if(!Vd(t))hh(t).then(()=>d?.update(m()));return}if(j!==0)return;j=requestAnimationFrame(()=>{j=0,d?.update(m())})}function ES(t,e,o={}){P(),k().then(()=>d?.update(m())),f=e,w=o;let i=Me(t);B={x:i.left,y:i.bottom+4},d=V(m(),{browseAll:()=>{let a=f,r=w;if(P(),a)zP(a,r)},dismissed:()=>{d=null,f=null,v="",u=y},measure:te,pick:(a)=>{let r=f;P(),r?.(a)},showMore:()=>{u+=y,d?.update(m())},setFilter:(a)=>{v=a,d?.update(m())}},t)}async function WP(t,e){let o=await Ys([...t]),[i]=o;if(i)e(i.ref)}function TS(t){let e=document.createElement("input");e.type="file",e.multiple=!0,e.accept=Jc(),e.addEventListener("change",()=>{if(e.files?.length)WP(e.files,t)}),e.click()}var re=400,F=new WeakMap;function W(t,e){let o=oa.has(At(e));return{label:t,thumbSrc:o&&e?Xc(e):"",thumbState:o&&e?"shown":"hidden",value:e}}function Kl(t,e,o,i,a={}){k();let r=F.get(t);if(r){r.prop=e,r.commit=i,r.options=a,r.handle.update(W(e,o));return}let n={commit:i,options:a,prop:e},s=D(t,W(e,o),{browse:(l)=>{ES(l,(c)=>n.commit(c),n.options)},edit:(l)=>a0(`media:${n.prop}`,re,(c)=>n.commit(c))(l),upload:()=>TS((l)=>n.commit(l)),warm:()=>{k()}});F.set(t,Object.assign(n,{handle:s}))}function Cm(t){let e=F.get(t);if(e)F.delete(t),e.handle.dispose()}
|
|
2
|
+
export{qu,kT,ET,Gu,Dw,zP,ES,WP,TS,Kl,Cm};
|
|
3
|
+
|
|
4
|
+
//# debugId=903D685F11A1727A64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-4bgvvzhv.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n,Y,Ze,Q,_,v,Pe,Go,Jn,xf,it}from"./studio-k3we3kqb.js";var Lv=400;var tf=350,d1=300,MM=30000;function rr(e){return Array.isArray(e?.children)?e.children:[]}function $v(e,t,i=""){if(!_(e))return e;if(Array.isArray(e)){for(let[l,s]of e.entries())$v(s,t,`${i}/${l}`);return e}let r=e,{children:o}=r;if(Go(o)){let l=o;t?.(i,l),r.children=[l]}if(Array.isArray(r.children))for(let[l,s]of r.children.entries())$v(s,t,`${i}/children/${l}`);if(r.$prototype==="Array"&&_(r.map))$v(r.map,t,`${i}/map`);if(_(r.cases))for(let[l,s]of Object.entries(r.cases))$v(s,t,`${i}/cases/${LI(l)}`);return e}function LI(e){return String(e).replaceAll("~","~0").replaceAll("/","~1")}function Vt(e){return e.length>=2?e.slice(0,-2):null}function zi(e){return e.at(-1)}function $I(e){return e.join("/")}function Cr(e,t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;return e.every((i,r)=>i===t[r])}function kh(e,t=[],i=0){let r=[];return u(e,t,i,r,!1),r}function u(e,t,i,r,o){if(n(e)||Y(e)||Ze(e)){if(!o)r.push({depth:i,node:e,nodeType:"text",path:t});return}if(e.$prototype==="Array"){if(!o)r.push({depth:i,node:e,nodeType:"map",path:t});let s=e.map;if(_(s))u(s,[...t,"map"],i+1,r,!1);return}if(!o)r.push({depth:i,node:e,nodeType:"element",path:t});if(e.$props&&it(e.tagName).includes("-")&&!Array.isArray(e.children))return;let{children:l}=e;if(Array.isArray(l))for(let s=0;s<l.length;s++){let a=[...t,"children",s];u(l[s],a,i+1,r,!1)}else if(Go(l))u(l,[...t,"children"],i+1,r,!1);if(e.$switch&&_(e.cases))for(let[s,a]of Object.entries(e.cases)){let p=[...t,"cases",s];if(_(a)&&a.$ref)r.push({depth:i+1,node:a,nodeType:"case-ref",path:p});else if(_(a))r.push({depth:i+1,node:a,nodeType:"case",path:p}),u(a,p,i+2,r,!0)}}function kr(e){if(!e)return"?";if(e.$prototype==="Array"){let{items:r}=e;return`Repeater → ${(Pe(r)?r.$ref:void 0)||"items"}`}if(e.$title)return e.$title;if(e.$id)return e.$id;if(e.tagName==="slot"){let r=e.attributes?.name;return n(r)&&r.trim()?`slot: ${r.trim()}`:"slot"}let t=it(e.tagName)||"div",i=e.$switch?" ⇆":"";if(n(e.textContent)&&e.textContent.length>0)return`${t} — ${e.textContent.slice(0,24)}${i}`;return t+i}var C=null;function id(e){C=e}function _n(){return C}function Eh(e){return _(e)}function nf(e){if(Array.isArray(e))return e.map((i)=>nf(i));if(!Jn(e))return e;let t={};for(let[i,r]of Object.entries(e)){if(i.startsWith("on")&&xf(r))continue;if(i==="children")t.children=Array.isArray(r)?r.map((o)=>nf(o)):nf(r);else if(i==="cases"&&Eh(r)){let o={};for(let[l,s]of Object.entries(r))o[l]=nf(s);t.cases=o}else if(i==="state"&&Eh(r)){let o={};for(let[l,s]of Object.entries(r)){if(v(s)&&s.timing==="server")continue;o[l]=s}t.state=o}else t[i]=r}return t}var u1=null,Th=null,II=null,RI=null,DI=null;function c(e){let t=document.querySelector(`#${e}`);return t instanceof HTMLElement?t:null}function PM(){u1=c("activity-bar"),Th=c("left-panel"),II=c("right-panel"),RI=c("toolbar"),DI=c("statusbar")}function of(e,t){if(!e)throw TypeError(`#${t} is not in the shell yet; initShellRefs() has not found it`);return e}var ig=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),NI=[":hover",":focus",":active",":focus-within",":focus-visible",":disabled",":first-child",":last-child","::before","::after","::placeholder"];function s0(e){return e.startsWith(":")||e.startsWith(".")||e.startsWith("&")||e.startsWith("[")}var f=new Map;function a0(e,t,i){let r=t??Lv;return(...o)=>{clearTimeout(f.get(e)),f.set(e,setTimeout(()=>{f.delete(e),i(...o)},r))}}function FM(e){clearTimeout(f.get(e)),f.delete(e)}var x=new Map;function y(e){return(_(e)||Q(e))&&"then"in e&&Q(e.then)}var d=0;function jM(){return d}function m(e,t){d+=1;let i=()=>{d-=1},r=null;try{let o=t();if(y(o))r=o}catch(o){console.error(`Renderer "${e}" failed:`,o)}if(!r){i();return}r.then(i,(o)=>{console.error(`Renderer "${e}" failed:`,o),i()})}function og(e,t){x.set(e,t)}function sr(){for(let[e,t]of x.entries())m(e,t)}function wn(...e){for(let t of e){let i=x.get(t);if(!i)continue;m(t,i)}}function vl(e,t){if(e){if(t.selection!==void 0)e.session.selection=t.selection;if(t.hover!==void 0)e.session.hover=t.hover;if(t.clipboard!==void 0)e.session.clipboard=t.clipboard;if(t.ui)Object.assign(e.session.ui,t.ui);if(t.canvas)Object.assign(e.session.canvas,t.canvas)}}function Na(e,t,i){if(e)e.session.ui[t]=i}function HM(e,t){if(e)Object.assign(e.session.canvas,t)}
|
|
2
|
+
export{Lv,tf,d1,MM,rr,$v,LI,Vt,zi,$I,Cr,kh,kr,C,id,_n,Eh,nf,u1,Th,II,RI,DI,PM,of,ig,NI,s0,a0,FM,jM,og,sr,wn,vl,Na,HM};
|
|
3
|
+
|
|
4
|
+
//# debugId=C365A06DD248F72464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-4f7thq0p.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n,Q,_}from"./studio-k3we3kqb.js";function cf(r){if(!r)return!1;if(Q(r.openProject))return!0;return r.openProjectPicker==="repo-list"&&Q(r.listRepos)&&Q(r.importProject)}function MI(r){globalThis.__jxPlatform=r}function Av(){return globalThis.__jxLauncher}var a=new Map;function PI(){let r=[];for(let[o,i]of a)for(let t=0;t<i;t++)r.push(o);return r}function s(r){a.set(r,(a.get(r)??0)+1)}function c(r){let o=(a.get(r)??1)-1;if(o>0)a.set(r,o);else a.delete(r)}function g(r){return(_(r)||Q(r))&&"then"in r&&Q(r.then)}function d(r,o,i){return(...t)=>{let e=o.apply(i,t);if(!g(e))return e;s(r);let u=()=>{c(r)};return e.then(u,u),e}}function P(r){let o=new Map;return new Proxy(r,{get(i,t){let e=i[t];if(!Q(e)||!n(t))return e;let u=o.get(t);if(u&&u.raw===e)return u.wrapper;let f=d(t,e,i);return o.set(t,{raw:e,wrapper:f}),f}})}var l=null;function p(){let r=globalThis.__jxPlatform;if(!r)throw Error("No platform registered. Call registerPlatform() before starting Studio.");if(l?.raw!==r)l={raw:r,wrapped:P(r)};return l.wrapped}function ye(){return globalThis.__jxPlatform!=null}
|
|
2
|
+
export{cf,MI,Av,PI,p,ye};
|
|
3
|
+
|
|
4
|
+
//# debugId=0FF027347A2E50BA64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-4fnb5648.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,ye}from"./studio-4fnb5648.js";import{X}from"./studio-9c6cbq2c.js";import{Q}from"./studio-k3we3kqb.js";function ph(){return ye()&&Q(p().findReferences)}function u(e){return`${e.path??""}\x00${e.tagName??""}`}var i=new Map,o=new Map;function qd(e){if(!ph())return{status:"unsupported"};return i.get(u(e))??(o.has(u(e))?{status:"pending"}:null)}async function La(e){if(!ph())return{status:"unsupported"};if(!e.path&&!e.tagName)return{status:"failed",message:"no target to look for"};let t=u(e),s=i.get(t);if(s)return s;let r=o.get(t);if(r)return r;let n={};if(e.path!==void 0)n.path=e.path;if(e.tagName!==void 0)n.tagName=e.tagName;let a=(async()=>{try{return{result:await p().findReferences(n),status:"ready"}}catch(c){return{message:X(c),status:"failed"}}})();o.set(t,a);let d=f,l=await a;if(o.get(t)===a)o.delete(t);if(d!==f)return l;return i.set(t,l),l}function nI(e){return i.delete(u(e)),La(e)}var f=0,g=new Set;function us(){f+=1,i.clear(),o.clear();for(let e of g)e()}function iI(e){return g.add(e),()=>{g.delete(e)}}function h(e){let t=0;for(let s of e.files)if(s.path.startsWith("pages/"))t+=1;return{others:e.files.length-t,pages:t}}function lv(e){let{others:t,pages:s}=h(e);if(s===0&&t===0)return"Not used yet";let r=t===1?"file":"files";if(s===0)return`Used in ${t} ${r}`;let n=`Used on ${s} page${s===1?"":"s"}`;return t===0?n:`${n} and ${t} other ${r}`}function oI(e,t){if(e.status==="unsupported")return null;if(e.status==="pending")return"Counting references…";if(e.status==="failed")return`References could not be counted (${e.message}) — this may break more than it appears to.`;let{files:s,refsTotal:r}=e.result;if(s.length===0)return t==="delete"?"Nothing else in this project refers to it.":"Nothing else in this project refers to it, so nothing needs updating.";let n=`${r} reference${r===1?"":"s"} in ${s.length} file${s.length===1?"":"s"}`,a=e.result.errors.length>0?" (at least — some documents could not be read)":"";if(t==="delete")return`${n}${a} will break. Those files stay on disk; the references in them stop resolving.`;if(t==="convert")return`${n}${a} will be updated automatically to point at the new file.`;return`${n}${a} will be updated automatically. Nothing else changes.`}function cv(e){return e.files.toSorted((t,s)=>s.count-t.count||t.path.localeCompare(s.path))}
|
|
2
|
+
export{ph,qd,La,nI,us,iI,lv,oI,cv};
|
|
3
|
+
|
|
4
|
+
//# debugId=CFBB8E3997E1C26E64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-4zd6an2b.js.map
|
|
@@ -2,7 +2,7 @@ var C=globalThis,O=(t)=>t,b=C.trustedTypes,j=b?b.createPolicy("lit-html",{create
|
|
|
2
2
|
\f\r](?:([^\\s"'>=/]+)([
|
|
3
3
|
\f\r]*=[
|
|
4
4
|
\f\r]*(?:[^
|
|
5
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),
|
|
5
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),R=/'/g,V=/"/g,z=/^(?:script|style|textarea|title)$/i,E=(t)=>(e,...s)=>({_$litType$:t,strings:e,values:s}),Wr=E(1),J=E(2),K=E(3),Zc=Symbol.for("lit-noChange"),ft=Symbol.for("lit-nothing"),W=new WeakMap,u=g.createTreeWalker(g,129);function Z(t,e){if(!w(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return j!==void 0?j.createHTML(e):e}var k=(t,e)=>{let s=t.length-1,i=[],n,l=e===2?"<svg>":e===3?"<math>":"",r=y;for(let o=0;o<s;o++){let a=t[o],T,h,A=-1,_=0;for(;_<a.length&&(r.lastIndex=_,h=r.exec(a),h!==null);)_=r.lastIndex,r===y?h[1]==="!--"?r=D:h[1]!==void 0?r=L:h[2]!==void 0?(z.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=p):h[3]!==void 0&&(r=p):r===p?h[0]===">"?(r=n??y,A=-1):h[1]===void 0?A=-2:(A=r.lastIndex-h[2].length,T=h[1],r=h[3]===void 0?p:h[3]==='"'?V:R):r===V||r===R?r=p:r===D||r===L?r=y:(r=p,n=void 0);let d=r===p&&t[o+1].startsWith("/>")?" ":"";l+=r===y?a+q:A>=0?(i.push(T),a.slice(0,A)+"$lit$"+a.slice(A)+c+d):a+c+(A===-2?o:d)}return[Z(t,l+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class N{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,l=0,r=t.length-1,o=this.parts,[a,T]=k(t,e);if(this.el=N.createElement(a,s),u.currentNode=this.el.content,e===2||e===3){let h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(i=u.nextNode())!==null&&o.length<r;){if(i.nodeType===1){if(i.hasAttributes())for(let h of i.getAttributeNames())if(h.endsWith("$lit$")){let A=T[l++],_=i.getAttribute(h).split(c),d=/([.?@])?(.*)/.exec(A);o.push({type:1,index:n,name:d[2],strings:_,ctor:d[1]==="."?I:d[1]==="?"?S:d[1]==="@"?P:v}),i.removeAttribute(h)}else h.startsWith(c)&&(o.push({type:6,index:n}),i.removeAttribute(h));if(z.test(i.tagName)){let h=i.textContent.split(c),A=h.length-1;if(A>0){i.textContent=b?b.emptyScript:"";for(let _=0;_<A;_++)i.append(h[_],x()),u.nextNode(),o.push({type:2,index:++n});i.append(h[A],x())}}}else if(i.nodeType===8)if(i.data===M)o.push({type:2,index:n});else{let h=-1;for(;(h=i.data.indexOf(c,h+1))!==-1;)o.push({type:7,index:n}),h+=c.length-1}n++}}static createElement(t,e){let s=g.createElement("template");return s.innerHTML=t,s}}function f(t,e,s=t,i){if(e===Zc)return e;let n=i!==void 0?s._$Co?.[i]:s._$Cl,l=H(e)?void 0:e._$litDirective$;return n?.constructor!==l&&(n?._$AO?.(!1),l===void 0?n=void 0:(n=new l(t),n._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=n:s._$Cl=n),n!==void 0&&(e=f(t,n._$AS(t,e.values),n,i)),e}class B{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){let{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??g).importNode(e,!0);u.currentNode=i;let n=u.nextNode(),l=0,r=0,o=s[0];for(;o!==void 0;){if(l===o.index){let a;o.type===2?a=new m(n,n.nextSibling,this,t):o.type===1?a=new o.ctor(n,o.name,o.strings,this,t):o.type===6&&(a=new U(n,this,t)),this._$AV.push(a),o=s[++r]}l!==o?.index&&(n=u.nextNode(),l++)}return u.currentNode=g,i}p(t){let e=0;for(let s of this._$AV)s!==void 0&&(s.strings!==void 0?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class m{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=ft,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=f(this,t,e),H(t)?t===ft||t==null||t===""?(this._$AH!==ft&&this._$AR(),this._$AH=ft):t!==this._$AH&&t!==Zc&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):F(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ft&&H(this._$AH)?this._$AA.nextSibling.data=t:this.T(g.createTextNode(t)),this._$AH=t}$(t){let{values:e,_$litType$:s}=t,i=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=N.createElement(Z(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new B(i,this),l=n.u(this.options);n.p(e),this.T(l),this._$AH=n}}_$AC(t){let e=W.get(t.strings);return e===void 0&&W.set(t.strings,e=new N(t)),e}k(t){w(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,s,i=0;for(let n of t)i===e.length?e.push(s=new m(this.O(x()),this.O(x()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){let s=O(t).nextSibling;O(t).remove(),t=s}}setConnected(t){this._$AM===void 0&&(this._$Cv=t,this._$AP?.(t))}}class v{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=ft,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||s[0]!==""||s[1]!==""?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=ft}_$AI(t,e=this,s,i){let n=this.strings,l=!1;if(n===void 0)t=f(this,t,e,0),l=!H(t)||t!==this._$AH&&t!==Zc,l&&(this._$AH=t);else{let r=t,o,a;for(t=n[0],o=0;o<n.length-1;o++)a=f(this,r[s+o],e,o),a===Zc&&(a=this._$AH[o]),l||=!H(a)||a!==this._$AH[o],a===ft?t=ft:t!==ft&&(t+=(a??"")+n[o+1]),this._$AH[o]=a}l&&!i&&this.j(t)}j(t){t===ft?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends v{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ft?void 0:t}}class S extends v{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ft)}}class P extends v{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=f(this,t,e,0)??ft)===Zc)return;let s=this._$AH,i=t===ft&&s!==ft||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==ft&&(s===ft||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class U{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){f(this,t)}}var eI={M:"$lit$",P:c,A:M,C:1,L:k,R:B,D:F,V:f,I:m,H:v,N:S,U:P,B:I,F:U},G=C.litHtmlPolyfillSupport;G?.(N,m),(C.litHtmlVersions??=[]).push("3.3.3");var io=(t,e,s)=>{let i=s?.renderBefore??e,n=i._$litPart$;if(n===void 0){let l=s?.renderBefore??null;i._$litPart$=n=new m(e.insertBefore(x(),l),l,void 0,s??{})}return n._$AI(t),n};export{Wr,Zc,ft,eI,io};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=B0F4542A6C5B6EBD64756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-5tet77de.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{X}from"./studio-9c6cbq2c.js";import{p,ye}from"./studio-4fnb5648.js";import{w}from"./studio-sce30r7b.js";import{us}from"./studio-4zd6an2b.js";import{fI,Yx,xv,h}from"./studio-knsjyx7n.js";import{v1,mi,zv}from"./studio-nvcn2ykc.js";import{$s,Kd,HO,BO,zO}from"./studio-hh394phe.js";import{Ls}from"./studio-bnc50f9h.js";import{oa,tR,nR,ra,At}from"./studio-1ks5d9y4.js";import{GC,rI,mh}from"./studio-acer0g8w.js";import{C}from"./studio-4f7thq0p.js";import{Y}from"./studio-k3we3kqb.js";var UC="__other__";function ds(t){return t.trim().toLowerCase().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d-]/g,"")}function q$(t){let e=t.lastIndexOf(".");return e>0?t.slice(e):""}function G$(t,e,n){let r=t.trim();if(n===void 0||e==="__other__")return r;if(n.kind==="fixed"){let i=ds(r);return i===""?"":`${i}${n.ext}`}return r.toLowerCase().endsWith(e.toLowerCase())?r:`${r}${e}`}function iv(t,e,n){let{choice:r,dir:i,known:o=new Set,rows:s=null,taken:a}=n,l=t.trim();if(!l)return r?.kind==="fixed"?"Enter a name.":"Enter a file name.";if(r?.kind==="fixed"&&ds(l)==="")return"Enter at least one letter or number.";let d=l.replaceAll("\\","/");if(d.startsWith("/")||d.endsWith("/"))return"Enter a name, not a path that starts or ends with a slash.";if(d.split("/").includes(".."))return"A name cannot step outside the destination folder.";if(d.includes("/")&&r!==void 0&&e!=="__other__")return`Pick Other… to create a file in a subfolder of ${i==="."?"the project root":i}.`;let u=q$(d);if(e!==""&&e!=="__other__"&&u!==""&&u.toLowerCase()!==e.toLowerCase()&&o.has(u.toLowerCase()))return`You picked ${s?.find((v)=>v.value===e)?.label??e}; this name ends in ${u}.`;if(r?.kind==="locked"&&e==="__other__"){if(u!==""&&u.toLowerCase()!==r.ext.toLowerCase()&&o.has(u.toLowerCase()))return r.because}let m=G$(t,e,r);return a.has(m.toLowerCase())?`${m} already exists in ${i}/.`:""}function Wm(t,e,n){let r=e.trim();if(r==="")return"Enter a file name.";if(/[/\\]/.test(r))return"Enter a name, not a path. A rename keeps the file in its folder.";let i=(t.split("/").pop()??t).toLowerCase();if(r.startsWith(".")&&!i.startsWith("."))return"A name cannot start with a dot: hidden files are not listed, so the file could disappear.";let o=r.toLowerCase();if(o!==i&&[...n].some((s)=>s.toLowerCase()===o))return`${r} already exists in this folder.`;return""}function x(t){let e=["B","KB","MB","GB"],n=t,r=0;while(n>=1024&&r<e.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${e[r]}`}var R=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function Jc(){return(ye()?p().assetCapabilities?.accept:void 0)??R}function zd(t){return ra.has(At(t))}function Wd(t){let e=t.type??"";if(e.startsWith("image/"))return"image";if(e.startsWith("video/"))return"video";if(e.startsWith("audio/"))return"audio";let n=At(t.name);if(oa.has(n))return"image";if(tR.has(n))return"video";if(nR.has(n))return"audio";return"file"}var K$=new Set([".woff",".woff2",".ttf",".otf"]);function IO(t){if(K$.has(At(t)))return"font";let e=Wd({name:t});return e==="file"?"document":e}var k=/^content\/([^/]+)\//,Ta="public/media";function J$(t){let e=t?k.exec(t.replaceAll("\\","/")):null;return e?`content/${e[1]}/images`:Ta}function RO(t){let e=t.replaceAll("\\","/");return e===Ta||/^content\/[^/]+\/images$/.test(e)}function T(t){let e=t.replaceAll("\\","/");if(e.startsWith("public/"))return e.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(e);if(n)return`./${n[1]}`;return`./${e}`}function P(t,e){let n=new Set([...e].map((o)=>o.toLowerCase()));if(!n.has(t.toLowerCase()))return t;let r=At(t),i=r?t.slice(0,-r.length):t;for(let o=1;;o++){let s=`${i}-${o}${r}`;if(!n.has(s.toLowerCase()))return s}}function Y$(t,e){let n=t.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?e:`${n}/${e}`}var y=null;function DO(t){y=t}async function Nx(t,e){await(e===void 0?y?.(t):y?.(t,e))}function M(t){let e=t.replaceAll("\\","/"),n=e.lastIndexOf("/");return n>0?e.slice(0,n):"."}function I(t,e){let n=(o)=>e==="image"?oa.has(At(o.name)):zd(o.name),r=[],i=[];for(let o of t)if(n(o))r.push(o);else i.push(o.name);if(i.length>0)w.warn(i.length===1?`Skipped ${i[0]}`:`Skipped ${i.length} files`,{detail:e==="image"?`Only images can be used here: ${i.join(", ")}.`:`Studio lists images, video, audio, PDFs and fonts as media, so ${i.join(", ")} would not appear in it.`,source:"Media"});return r}async function Ys(t,e={}){let n=e.only===void 0?[...t]:I([...t],e.only);if(n.length===0)return[];let r=p(),i=e.dir??J$(h.value?.documentPath??null),o=e.source??"Media",s;try{let d=await $s(()=>r.listDirectory(i));s=new Set(d.map((u)=>u.name))}catch(d){if(e.dirExists===!0)return w.error(`Could not write to ${i}/.`,{detail:`The folder could not be read to choose a name that overwrites nothing: ${X(d)}`,path:i,source:o}),[];s=new Set}let a=ye()?p().assetCapabilities?.maxUploadBytes:void 0,l=[];for(let d of n){if(a!==void 0&&d.size>a){w.error(`${d.name} is too large.`,{detail:`This backend accepts at most ${x(a)}; that file is ${x(d.size)}.`,source:"Media"});continue}let u=P(d.name,s);s.add(u);let m=Y$(i,u);try{let{path:f}=await(e.write?e.write(m):r.uploadFile(m,d));Kd([f]),l.push({kind:Wd(d),name:u,path:f,ref:T(f)})}catch(f){w.error(`Could not upload ${d.name}.`,{detail:X(f),path:m,source:o})}}if(l.length>0){if(e.quiet!==!0)w.success(l.length===1?`Uploaded ${l[0].name} to ${i}/`:`Uploaded ${l.length} files to ${i}/`);await y?.(i)}return l}function L(t){try{let e=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0}).decode(t);return e.startsWith("\uFEFF")?null:e}catch{return null}}function D(t){let e=t.slice(0,t.length-At(t).length);return`${e.replace(/-copy(?:-\d+)?$/,"")}-copy${t.slice(e.length)}`}async function Ax(t,e={}){let n=t.split("/").pop()??t,r=e.source??"Media",i;try{let a=p();if(a.readFileBytes===void 0)throw Error("This backend cannot read a file's raw bytes.");i=await a.readFileBytes(t)}catch(a){return w.error(`Could not duplicate ${n}.`,{detail:X(a),path:t,source:r}),null}let o=e.document===!0?L(i):null,[s]=await Ys([new File([i],D(n))],{dir:M(t),dirExists:!0,quiet:!0,source:r,...o!==null&&{write:async(a)=>(await p().writeFile(a,o),{path:a})}});if(!s)return null;if(s.path===t)return w.warn(`${n} was not duplicated.`,{detail:"The backend keeps identical files once, so it made no second file.",path:t,source:r}),null;return w.success(`Duplicated ${n} as ${s.name}`),s}var z=[new Set([".jpg",".jpeg"]),new Set([".tif",".tiff"])];function A(t){return z.find((e)=>e.has(t))??new Set([t])}function NO(t){return[...A(At(t))].join(",")}function N(t,e){return A(At(t)).has(At(e.name))}function AO(t,e,n){let r=Wm(t,e,n);if(r!=="")return r;if(!N(t,{name:e.trim()}))return`Keep the ${At(t)} extension. A rename does not convert the file, so another extension would break it on every page.`;return""}async function Ox(t,e,n={}){let r=t.split("/").pop()??t;if(!N(t,e))return w.error(`${e.name} cannot replace ${r}.`,{detail:`${r} is ${At(t)||"a file with no extension"} and ${e.name} is ${At(e.name)||"a file with no extension"}. Every page that uses ${r} would get bytes its address does not describe; choose a file of the same type, or upload it as a new file.`,path:t,source:"Media"}),!1;let i=ye()?p().assetCapabilities?.maxUploadBytes:void 0;if(i!==void 0&&e.size>i)return w.error(`${e.name} is too large.`,{detail:`This backend accepts at most ${x(i)}; that file is ${x(e.size)}.`,source:"Media"}),!1;Ls(t);let o;try{({path:o}=await p().uploadFile(t,e))}catch(s){return w.error(`Could not replace ${r}.`,{detail:X(s),path:t,source:"Media"}),!1}if(Kd([t,o]),o===t)BO(t);if(us(),await(o===t?Nx(M(t),t):Nx(M(t))),o!==t)return w.warn(`${r} was not replaced.`,{detail:`The backend stored the new file as ${o}, so every reference still shows the old one.`,path:t,source:"Media",tier:"problem"}),!1;return w.success(n.note===void 0?`Replaced ${r}`:`Replaced ${r}: ${n.note}`),!0}function Mx(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?e:e.slice(n+1)}function ov(t){let e=mi(t),n=e.lastIndexOf("/");return n===-1?".":e.slice(0,n)}function B(){return C?.projectConfig?.content??null}function _(t){return xv(t,B(),rI())}function U(t,e){return`${mi(e.urlPrefix)}/${t.slice(e.dir.length+1)}`}function rv(t){let e=mi(t);if(e.startsWith(`${v1}/`))return`/${e.slice(v1.length+1)}`;let n=_(e);return n?`/${U(e,n)}`:`/${e}`}function nr(t){let e=mi(t);if(e==="")return t;let{space:n,fileBaseUrl:r}=mh(),i=zO(e);if(n==="repo")return Yx(fI(`${r}${zv(e)}`,HO(e)),i);let o=zv(rv(e).slice(1));return Yx(GC(`/${o}`),i)}var c=new Map,E=new Map,g=new Map,b=new Set;function S(t){return At(t)===".svg"}function F(t){let e=t===null?null:/^\s*(\d+(?:\.\d+)?)\s*(?:px)?\s*$/.exec(t),n=e?Number(e[1]):Number.NaN;return n>0?n:null}function j(t){let e=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;if(e.localName!=="svg")return null;let n=F(e.getAttribute("width")),r=F(e.getAttribute("height")),i=(e.getAttribute("viewBox")??"").trim().split(/[\s,]+/).map(Number),o=i[2]??Number.NaN,s=i[3]??Number.NaN,a=i.length===4&&o>0&&s>0,l=null;if(n!==null&&r!==null)l={height:r,width:n};else if(a&&n!==null)l={height:n*s/o,width:n};else if(a&&r!==null)l={height:r,width:r*o/s};else if(a)l={height:s,width:o};return l&&{height:Math.round(l.height),width:Math.round(l.width)}}async function K(t){b.add(t);try{let e=j(await p().readFile(t));if(e&&e.width>0&&e.height>0)g.set(t,e)}catch{}}function Vd(t){let e=mi(t);return c.has(e)&&(!S(e)||b.has(e))}function O(t,e){let n=Mx(t),r=g.get(t);return{bytes:Y(e?.size)?e.size:null,ext:At(n),height:r?.height??null,kind:Wd({name:n}),modified:e?.modified??null,name:n,path:t,width:r?.width??null}}function Yc(t){return c.get(mi(t))??null}function OO(t){for(let e of t){if(e.type!=="file")continue;let n=mi(e.path);if(!c.has(n))c.set(n,O(n,e))}}async function hh(t){let e=mi(t),n=c.get(e);if(n&&Vd(e))return n;let r=E.get(e);if(r)return r;let i=(async()=>{if(S(e)&&!b.has(e))await K(e);if(n){let a=g.get(e);return{...n,height:a?.height??null,width:a?.width??null}}let s;try{s=(await $s(()=>p().listDirectory(ov(e)))).find((l)=>mi(l.path)===e)}catch{s=void 0}return O(e,s)})();E.set(e,i);let o=await i;return E.delete(e),c.set(e,o),o}function fl(t,e,n){if(!(e>0&&n>0))return!1;let r=mi(t);if(S(r))return!1;let i=g.get(r);if(i&&i.width===e&&i.height===n)return!1;g.set(r,{height:n,width:e});let o=c.get(r);if(o)c.set(r,{...o,height:n,width:e});return!0}function MO(){c.clear(),g.clear(),b.clear()}function Vm(t){if(t<1024)return`${t} B`;if(t<1048576)return`${Math.round(t/1024)} KB`;return`${(t/1048576).toFixed(1)} MB`}function Px(t){if(!t)return"";let e=[];if(t.width!==null&&t.height!==null)e.push(`${t.width} × ${t.height}`);if(t.bytes!==null)e.push(Vm(t.bytes));return e.join(" · ")}
|
|
2
|
+
export{UC,ds,q$,G$,iv,Wm,Jc,zd,Wd,K$,IO,Ta,J$,RO,Y$,DO,Nx,Ys,Ax,NO,AO,Ox,Mx,ov,rv,nr,Vd,Yc,OO,hh,fl,MO,Vm,Px};
|
|
3
|
+
|
|
4
|
+
//# debugId=44F9FA380FD26FC664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-61rg2cz5.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
export{uw,ub,DD,ND,
|
|
1
|
+
import{vL,yL,wL}from"./studio-k2evngrj.js";import{p,ye}from"./studio-4fnb5648.js";import{hb,OE,ME}from"./studio-k1xqrgm5.js";import{uA,tx,cl,Ca,wA,cs,Xl,ox}from"./studio-xpx91fby.js";import{ce}from"./studio-0939t1q1.js";var t="checking",i=null;function uw(){return ye()&&Boolean(p().cfConnect)}async function ub(){if(!uw())return;i??=(async()=>{try{t=await p().cfConnection?.()??null}catch{t=null}i=null,um()})(),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 (ce("xb8vvt2h"),import("./cf-account-picker-xb8vvt2h.js"));await e()}cs(),await ub()}function s(){let n={id:"disconnect",label:"Disconnect",run:async()=>{await p().cfDisconnect?.(),cs(),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 (ce("xb8vvt2h"),import("./cf-account-picker-xb8vvt2h.js"));if(await r())cs(),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=OE();return{connected:Boolean(n),detail:n?`Connected${e?` — account ${e}`:""}.`:"Not connected. Publishing will ask when it needs it.",id:"cloudflare",label:"Cloudflare",revoke:ME}}function u(n){let e={id:n.id,label:n.label,run:async()=>{await ox(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 DE(){let n=vL(),e=Xl(),o=cl();return[{id:"github",label:"GitHub",detail:n?yL()==="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:wL},{id:"ai",label:"AI provider",detail:tx()?`${Ca()==="anthropic"?"Anthropic key":"Key"} stored. Model ${e}${o?` via ${o}`:""}.`:"No key stored. The Assistant section is where one is entered.",connected:tx(),revoke:wA},uw()?s():l(),...uA().map((c)=>f(c))]}function AD(n){let e=DE().find((o)=>o.id===n);if(!e)return!1;return e.revoke(),um(),!0}var a=new Set;function OD(n){return a.add(n),()=>{a.delete(n)}}function um(){for(let n of a)n()}
|
|
2
|
+
export{uw,ub,DD,ND,DE,AD,OD,um};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=887E2B94A6C0DAF664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-7rrdbvex.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
2
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=
|
|
4
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function Ot(e,r){if(e){if(typeof e=="string")return ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,r):void 0}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function se(e){return e.slice(0).reverse()}function Ge(e){var{typeKey:r,defaultDropEffect:t}=e,n=new WeakMap,o="data-drop-target-for-".concat(r),i="[".concat(o,"]");function u(s){return n.set(s.element,s),function(){return n.delete(s.element)}}function l(s){if(!1)var p;var m=
|
|
5
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function St(e,r){if(e){if(typeof e=="string")return Ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,r):void 0}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Pt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$e(Object(t),!0).forEach(function(n){
|
|
1
|
+
import{pp,pe}from"./studio-0939t1q1.js";var ne=pe(function(be){Object.defineProperty(be,"__esModule",{value:!0});be.bind=void 0;function at(e,r){var{type:t,listener:n,options:o}=r;return e.addEventListener(t,n,o),function i(){e.removeEventListener(t,n,o)}}be.bind=at});var Te=pe(function(k){var N=k&&k.__assign||function(){return N=Object.assign||function(e){for(var r,t=1,n=arguments.length;t<n;t++){r=arguments[t];for(var o in r)if(Object.prototype.hasOwnProperty.call(r,o))e[o]=r[o]}return e},N.apply(this,arguments)};Object.defineProperty(k,"__esModule",{value:!0});k.bindAll=void 0;var it=ne();function xe(e){if(typeof e>"u")return;if(typeof e==="boolean")return{capture:e};return e}function ut(e,r){if(r==null)return e;var t=N(N({},e),{options:N(N({},xe(r)),xe(e.options))});return t}function lt(e,r,t){var n=r.map(function(o){var i=ut(o,t);return(0,it.bind)(e,i)});return function o(){n.forEach(function(i){return i()})}}k.bindAll=lt});var R=pe(function(V){Object.defineProperty(V,"__esModule",{value:!0});V.bindAll=V.bind=void 0;var ct=ne();Object.defineProperty(V,"bind",{enumerable:!0,get:function(){return ct.bind}});var st=Te();Object.defineProperty(V,"bindAll",{enumerable:!0,get:function(){return st.bindAll}})});function me(e){if(Array.isArray(e))return e}function ge(e,r){var t=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(t!=null){var n,o,i,u,l=[],a=!0,c=!1;try{if(i=(t=t.call(e)).next,r===0){if(Object(t)!==t)return;a=!1}else for(;!(a=(n=i.call(t)).done)&&(l.push(n.value),l.length!==r);a=!0);}catch(d){c=!0,o=d}finally{try{if(!a&&t.return!=null&&(u=t.return(),Object(u)!==u))return}finally{if(c)throw o}}return l}}function L(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function X(e,r){if(e){if(typeof e=="string")return L(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?L(e,r):void 0}}function ye(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function B(e,r){return me(e)||ge(e,r)||X(e,r)||ye()}var ot=pp(R());var q="data-pdnd-honey-pot";function z(e){return e instanceof Element&&e.hasAttribute(q)}function G(e){var r=document.elementsFromPoint(e.x,e.y),t=B(r,2),n=t[0],o=t[1];if(!n)return null;if(z(n))return o!==null&&o!==void 0?o:null;return n}function H(e){return H=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},H(e)}function we(e,r){if(H(e)!="object"||!e)return e;var t;if(typeof Symbol<"u"&&(t=e[Symbol.toPrimitive])!==void 0){var n=t.call(e,r||"default");if(H(n)!="object")return n;throw TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function De(e){var r=we(e,"string");return H(r)=="symbol"?r:r+""}function pl(e,r,t){return(r=De(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}var Y=pp(R());var Ae=2147483647;var Oe={inset:"unset",border:"none",padding:0,margin:0,overflow:"visible",color:"inherit",background:"transparent",width:"auto",height:"auto"};function A(e){var r=null;return function t(){if(!r){for(var n=arguments.length,o=Array(n),i=0;i<n;i++)o[i]=arguments[i];var u=e.apply(this,o);r={result:u}}return r.result}}var Z=A(function e(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype.showPopover==="function"});function Ee(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Se(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?Ee(Object(t),!0).forEach(function(n){pl(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):Ee(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}var U=2,Pe=U/2;function ft(e){return{x:Math.floor(e.x),y:Math.floor(e.y)}}function dt(e){return{x:e.x-Pe,y:e.y-Pe}}function vt(e){return{x:Math.max(e.x,0),y:Math.max(e.y,0)}}function mt(e){return{x:Math.min(e.x,window.innerWidth-U),y:Math.min(e.y,window.innerHeight-U)}}function je(e){var r=e.client,t=mt(vt(dt(ft(r))));return DOMRect.fromRect({x:t.x,y:t.y,width:U,height:U})}function Ie(e){var r=e.clientRect;return{left:"".concat(r.left,"px"),top:"".concat(r.top,"px"),width:"".concat(r.width,"px"),height:"".concat(r.height,"px")}}function gt(e){var{client:r,clientRect:t}=e;return r.x>=t.x&&r.x<=t.x+t.width&&r.y>=t.y&&r.y<=t.y+t.height}function yt(e){var r=e.initial,t=document.createElement("div");if(t.setAttribute(q,"true"),Z())t.setAttribute("popover","manual");var n=je({client:r});if(Object.assign(t.style,Se(Se({position:"fixed"},Z()?Oe:{zIndex:Ae}),{},{backgroundColor:"transparent",padding:0,margin:0,boxSizing:"border-box",pointerEvents:"auto"},Ie({clientRect:n}))),document.body.appendChild(t),Z())t.showPopover();var o=Y.bind(window,{type:"pointermove",listener:function i(u){var l={x:u.clientX,y:u.clientY};n=je({client:l}),Object.assign(t.style,Ie({clientRect:n}))},options:{capture:!0}});return function i(u){var l=u.current;if(o(),gt({client:l,clientRect:n})){t.remove();return}function a(){c(),t.remove()}var c=Y.bindAll(window,[{type:"pointerdown",listener:a},{type:"pointermove",listener:a},{type:"focusin",listener:a},{type:"focusout",listener:a},{type:"dragstart",listener:a},{type:"dragenter",listener:a},{type:"dragover",listener:a}],{capture:!0})}}function Fe(){var e=null;function r(){return e=null,Y.bind(window,{type:"pointermove",listener:function n(o){e={x:o.clientX,y:o.clientY}},options:{capture:!0}})}function t(){var n=null;return function o(i){var{eventName:u,payload:l}=i;if(u==="onDragStart"){var a=l.location.initial.input,c=e!==null&&e!==void 0?e:{x:a.clientX,y:a.clientY};n=yt({initial:c})}if(u==="onDrop"){var d,f=l.location.current.input;(d=n)===null||d===void 0||d({current:{x:f.clientX,y:f.clientY}}),n=null,e=null}}}return{bindEvents:r,getOnPostDispatch:t}}function He(e){if(Array.isArray(e))return L(e)}function Ce(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Me(){throw TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function J(e){return He(e)||Ce(e)||X(e)||Me()}var Xe=pp(R());var Ne=A(function e(){return navigator.userAgent.includes("Firefox")});var W=A(function e(){var r=navigator,t=r.userAgent;return t.includes("AppleWebKit")&&!t.includes("Chrome")});function bt(e){return"nodeName"in e}function ke(e){return bt(e)&&e.ownerDocument!==document}var We=pp(R());var Q={isLeavingWindow:Symbol("leaving"),isEnteringWindow:Symbol("entering")};(function e(){if(typeof window>"u")return;if(!W())return;function r(){return{enterCount:0,isOverWindow:!1}}var t=r();function n(){t=r()}We.bindAll(window,[{type:"dragstart",listener:function o(){t.enterCount=0,t.isOverWindow=!0}},{type:"drop",listener:n},{type:"dragend",listener:n},{type:"dragenter",listener:function o(i){if(!t.isOverWindow&&t.enterCount===0)i[Q.isEnteringWindow]=!0;t.isOverWindow=!0,t.enterCount++}},{type:"dragleave",listener:function o(i){if(t.enterCount--,t.isOverWindow&&t.enterCount===0)i[Q.isLeavingWindow]=!0,t.isOverWindow=!1}}],{capture:!0})})();function Ke(e){var r=e.dragLeave;if(!W())return!1;return r.hasOwnProperty(Q.isLeavingWindow)}function Le(e){var r=e.dragLeave,{type:t,relatedTarget:n}=r;if(t!=="dragleave")return!1;if(W())return Ke({dragLeave:r});if(n==null)return!0;if(Ne())return ke(n);return n instanceof HTMLIFrameElement}function Re(e){var r=e.onDragEnd;return[{type:"pointermove",listener:function(){var t=0;return function n(){if(t<20){t++;return}r()}}()},{type:"pointerdown",listener:r}]}function C(e){return{altKey:e.altKey,button:e.button,buttons:e.buttons,ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY}}var ht=function e(r){var t=[],n=null,o=function i(){for(var u=arguments.length,l=Array(u),a=0;a<u;a++)l[a]=arguments[a];if(t=l,n)return;n=requestAnimationFrame(function(){n=null,r.apply(void 0,t)})};return o.cancel=function(){if(!n)return;cancelAnimationFrame(n),n=null},o},Ue=ht;var oe=Ue(function(e){return e()}),_=function(){var e=null;function r(n){var o=requestAnimationFrame(function(){e=null,n()});e={frameId:o,fn:n}}function t(){if(e)cancelAnimationFrame(e.frameId),e.fn(),e=null}return{schedule:r,flush:t}}();function Ye(e){var{source:r,initial:t,dispatchEvent:n}=e,o={dropTargets:[]};function i(l){n(l),o={dropTargets:l.payload.location.current.dropTargets}}var u={start:function l(a){var c=a.nativeSetDragImage,d={current:t,previous:o,initial:t};i({eventName:"onGenerateDragPreview",payload:{source:r,location:d,nativeSetDragImage:c}}),_.schedule(function(){i({eventName:"onDragStart",payload:{source:r,location:d}})})},dragUpdate:function l(a){var c=a.current;_.flush(),oe.cancel(),i({eventName:"onDropTargetChange",payload:{source:r,location:{initial:t,previous:o,current:c}}})},drag:function l(a){var c=a.current;oe(function(){_.flush();var d={initial:t,previous:o,current:c};i({eventName:"onDrag",payload:{source:r,location:d}})})},drop:function l(a){var{current:c,updatedSourcePayload:d}=a;_.flush(),oe.cancel(),i({eventName:"onDrop",payload:{source:d!==null&&d!==void 0?d:r,location:{current:c,previous:o,initial:t}}})}};return u}var ie={isActive:!1};function Be(){return!ie.isActive}function xt(e){if(e.dataTransfer)return e.dataTransfer.setDragImage.bind(e.dataTransfer);return null}function Tt(e){var{current:r,next:t}=e;if(r.length!==t.length)return!0;for(var n=0;n<r.length;n++)if(r[n].element!==t[n].element)return!0;return!1}function wt(e){var{event:r,dragType:t,getDropTargetsOver:n,dispatchEvent:o}=e;if(!Be())return;var i=Dt({event:r,dragType:t,getDropTargetsOver:n});ie.isActive=!0;var u={current:i};ae({event:r,current:i.dropTargets});var l=Ye({source:t.payload,dispatchEvent:o,initial:i});function a(s){var p=Tt({current:u.current.dropTargets,next:s.dropTargets});if(u.current=s,p)l.dragUpdate({current:u.current})}function c(s){var p=C(s),m=z(s.target)?G({x:p.clientX,y:p.clientY}):s.target,g=n({target:m,input:p,source:t.payload,current:u.current.dropTargets});if(g.length)s.preventDefault(),ae({event:s,current:g});a({dropTargets:g,input:p})}function d(){if(u.current.dropTargets.length)a({dropTargets:[],input:u.current.input});l.drop({current:u.current,updatedSourcePayload:null}),f()}function f(){ie.isActive=!1,w()}var w=Xe.bindAll(window,[{type:"dragover",listener:function s(p){c(p),l.drag({current:u.current})}},{type:"dragenter",listener:c},{type:"dragleave",listener:function s(p){if(!Le({dragLeave:p}))return;if(a({input:u.current.input,dropTargets:[]}),t.startedFrom==="external")d()}},{type:"drop",listener:function s(p){if(u.current={dropTargets:u.current.dropTargets,input:C(p)},!u.current.dropTargets.length){d();return}p.preventDefault(),ae({event:p,current:u.current.dropTargets}),l.drop({current:u.current,updatedSourcePayload:t.type==="external"?t.getDropPayload(p):null}),f()}},{type:"dragend",listener:function s(p){u.current={dropTargets:u.current.dropTargets,input:C(p)},d()}}].concat(J(Re({onDragEnd:d}))),{capture:!0});l.start({nativeSetDragImage:xt(r)})}function ae(e){var r,{event:t,current:n}=e,o=(r=n[0])===null||r===void 0?void 0:r.dropEffect;if(o!=null&&t.dataTransfer)t.dataTransfer.dropEffect=o}function Dt(e){var{event:r,dragType:t,getDropTargetsOver:n}=e,o=C(r);if(t.startedFrom==="external")return{input:o,dropTargets:[]};var i=n({input:o,source:t.payload,target:r.target,current:[]});return{input:o,dropTargets:i}}var ue={canStart:Be,start:wt};var le=new Map;function At(e){var{typeKey:r,mount:t}=e,n=le.get(r);if(n)return n.usageCount++,n;var o={typeKey:r,unmount:t(),usageCount:1};return le.set(r,o),o}function Ve(e){var r=At(e);return function t(){if(r.usageCount--,r.usageCount>0)return;r.unmount(),le.delete(e.typeKey)}}function Br(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];return function n(){r.forEach(function(o){return o()})}}function ee(e,r){var{attribute:t,value:n}=r;return e.setAttribute(t,n),function(){return e.removeAttribute(t)}}function qe(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function F(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?qe(Object(t),!0).forEach(function(n){pl(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):qe(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function ce(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=Ot(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function Ot(e,r){if(e){if(typeof e=="string")return ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ze(e,r):void 0}}function ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function se(e){return e.slice(0).reverse()}function Ge(e){var{typeKey:r,defaultDropEffect:t}=e,n=new WeakMap,o="data-drop-target-for-".concat(r),i="[".concat(o,"]");function u(s){return n.set(s.element,s),function(){return n.delete(s.element)}}function l(s){if(!1)var p;var m=Br(ee(s.element,{attribute:o,value:"true"}),u(s));return A(m)}function a(s){var p,m,g,D,{source:y,target:h,input:b,result:T}=s,v=T===void 0?[]:T;if(h==null)return v;if(!(h instanceof Element)){if(h instanceof Node)return a({source:y,target:h.parentElement,input:b,result:v});return v}var P=h.closest(i);if(P==null)return v;var x=n.get(P);if(x==null)return v;var E={input:b,source:y,element:x.element};if(x.canDrop&&!x.canDrop(E))return a({source:y,target:x.element.parentElement,input:b,result:v});var S=(p=(m=x.getData)===null||m===void 0?void 0:m.call(x,E))!==null&&p!==void 0?p:{},j=(g=(D=x.getDropEffect)===null||D===void 0?void 0:D.call(x,E))!==null&&g!==void 0?g:t,O={data:S,element:x.element,dropEffect:j,isActiveDueToStickiness:!1};return a({source:y,target:x.element.parentElement,input:b,result:[].concat(J(v),[O])})}function c(s){var{eventName:p,payload:m}=s,g=ce(m.location.current.dropTargets),D;try{for(g.s();!(D=g.n()).done;){var y,h=D.value,b=n.get(h.element),T=F(F({},m),{},{self:h});b===null||b===void 0||(y=b[p])===null||y===void 0||y.call(b,T)}}catch(v){g.e(v)}finally{g.f()}}var d={onGenerateDragPreview:c,onDrag:c,onDragStart:c,onDrop:c,onDropTargetChange:function s(p){var m=p.payload,g=new Set(m.location.current.dropTargets.map(function(K){return K.element})),D=new Set,y=ce(m.location.previous.dropTargets),h;try{for(y.s();!(h=y.n()).done;){var b,T=h.value;D.add(T.element);var v=n.get(T.element),P=g.has(T.element),x=F(F({},m),{},{self:T});if(v===null||v===void 0||(b=v.onDropTargetChange)===null||b===void 0||b.call(v,x),!P){var E;v===null||v===void 0||(E=v.onDragLeave)===null||E===void 0||E.call(v,x)}}}catch(K){y.e(K)}finally{y.f()}var S=ce(m.location.current.dropTargets),j;try{for(S.s();!(j=S.n()).done;){var O,M,re=j.value;if(D.has(re.element))continue;var ve=F(F({},m),{},{self:re}),I=n.get(re.element);I===null||I===void 0||(O=I.onDropTargetChange)===null||O===void 0||O.call(I,ve),I===null||I===void 0||(M=I.onDragEnter)===null||M===void 0||M.call(I,ve)}}catch(K){S.e(K)}finally{S.f()}}};function f(s){d[s.eventName](s)}function w(s){var{source:p,target:m,input:g,current:D}=s,y=a({source:p,target:m,input:g});if(y.length>=D.length)return y;var h=se(D),b=se(y),T=[];for(var v=0;v<h.length;v++){var P,x=h[v],E=b[v];if(E!=null){T.push(E);continue}var S=T[v-1],j=h[v-1];if((S===null||S===void 0?void 0:S.element)!==(j===null||j===void 0?void 0:j.element))break;var O=n.get(x.element);if(!O)break;var M={input:g,source:p,element:O.element};if(O.canDrop&&!O.canDrop(M))break;if(!((P=O.getIsSticky)!==null&&P!==void 0&&P.call(O,M)))break;T.push(F(F({},x),{},{isActiveDueToStickiness:!0}))}return se(T)}return{dropTargetForConsumers:l,getIsOver:w,dispatchEvent:f}}function Et(e,r){var t=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!t){if(Array.isArray(e)||(t=St(e))||r&&e&&typeof e.length=="number"){t&&(e=t);var n=0,o=function a(){};return{s:o,n:function a(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function a(c){throw c},f:o}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,u=!0,l=!1;return{s:function a(){t=t.call(e)},n:function a(){var c=t.next();return u=c.done,c},e:function a(c){l=!0,i=c},f:function a(){try{u||t.return==null||t.return()}finally{if(l)throw i}}}}function St(e,r){if(e){if(typeof e=="string")return Ze(e,r);var t={}.toString.call(e).slice(8,-1);return t==="Object"&&e.constructor&&(t=e.constructor.name),t==="Map"||t==="Set"?Array.from(e):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ze(e,r):void 0}}function Ze(e,r){(r==null||r>e.length)&&(r=e.length);for(var t=0,n=Array(r);t<r;t++)n[t]=e[t];return n}function $e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),t.push.apply(t,n)}return t}function Pt(e){for(var r=1;r<arguments.length;r++){var t=arguments[r]!=null?arguments[r]:{};r%2?$e(Object(t),!0).forEach(function(n){pl(e,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):$e(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})}return e}function Je(){var e=new Set,r=null;function t(i){if(!r)return;if(!i.canMonitor||i.canMonitor(r.canMonitorArgs))r.active.add(i)}function n(i){var u=Pt({},i);e.add(u),t(u);function l(){if(e.delete(u),r)r.active.delete(u)}return A(l)}function o(i){var{eventName:u,payload:l}=i;if(u==="onGenerateDragPreview"){r={canMonitorArgs:{initial:l.location.initial,source:l.source},active:new Set};var a=Et(e),c;try{for(a.s();!(c=a.n()).done;){var d=c.value;t(d)}}catch(g){a.e(g)}finally{a.f()}}if(!r)return;var f=Array.from(r.active);for(var w=0,s=f;w<s.length;w++){var p=s[w];if(r.active.has(p)){var m;(m=p[u])===null||m===void 0||m.call(p,l)}}if(u==="onDrop")r.active.clear(),r=null}return{dispatchEvent:o,monitorForConsumers:n}}function Qe(e){var{typeKey:r,mount:t,dispatchEventToSource:n,onPostDispatch:o,defaultDropEffect:i}=e,u=Je(),l=Ge({typeKey:r,defaultDropEffect:i});function a(f){n===null||n===void 0||n(f),l.dispatchEvent(f),u.dispatchEvent(f),o===null||o===void 0||o(f)}function c(f){var{event:w,dragType:s}=f;ue.start({event:w,dragType:s,getDropTargetsOver:l.getIsOver,dispatchEvent:a})}function d(){function f(){var w={canStart:ue.canStart,start:c};return t(w)}return Ve({typeKey:r,mount:f})}return{registerUsage:d,dropTarget:l.dropTargetForConsumers,monitor:u.monitorForConsumers}}var _e=A(function e(){return navigator.userAgent.toLocaleLowerCase().includes("android")}),et="pdnd:android-fallback";var fe="text/plain";var tt="text/uri-list";var rt="application/vnd.pdnd";var te=new WeakMap;function jt(e){return te.set(e.element,e),function r(){te.delete(e.element)}}var nt=Fe(),de=Qe({typeKey:"element",defaultDropEffect:"move",mount:function e(r){return Br(nt.bindEvents(),ot.bind(document,{type:"dragstart",listener:function t(n){var o,i,u,l,a,c;if(!r.canStart(n))return;if(n.defaultPrevented)return;if(!n.dataTransfer)return;var d=n.target;if(!(d instanceof HTMLElement))return;var f=te.get(d);if(!f)return;var w=C(n),s={element:f.element,dragHandle:(o=f.dragHandle)!==null&&o!==void 0?o:null,input:w};if(f.canDrag&&!f.canDrag(s)){n.preventDefault();return}if(f.dragHandle){var p=G({x:w.clientX,y:w.clientY});if(!f.dragHandle.contains(p)){n.preventDefault();return}}var m=(i=(u=f.getInitialDataForExternal)===null||u===void 0?void 0:u.call(f,s))!==null&&i!==void 0?i:null;if(m)for(var g=0,D=Object.entries(m);g<D.length;g++){var y=B(D[g],2),h=y[0],b=y[1];n.dataTransfer.setData(h,b!==null&&b!==void 0?b:"")}if(_e()&&!n.dataTransfer.types.includes(fe)&&!n.dataTransfer.types.includes(tt))n.dataTransfer.setData(fe,et);n.dataTransfer.setData(rt,"");var T={element:f.element,dragHandle:(l=f.dragHandle)!==null&&l!==void 0?l:null,data:(a=(c=f.getInitialData)===null||c===void 0?void 0:c.call(f,s))!==null&&a!==void 0?a:{}},v={type:"element",payload:T,startedFrom:"internal"};r.start({event:n,dragType:v})}}))},dispatchEventToSource:function e(r){var t,n,{eventName:o,payload:i}=r;(t=te.get(i.source.element))===null||t===void 0||(n=t[o])===null||n===void 0||n.call(t,i)},onPostDispatch:nt.getOnPostDispatch()}),{dropTarget:Ks,monitor:Js}=de;function zr(e){if(!1)var r;var t=Br(de.registerUsage(),jt(e),ee(e.element,{attribute:"draggable",value:"true"}));return A(t)}export{pl,Br,Ks,Js,zr};
|
|
6
6
|
|
|
7
|
-
//# debugId=
|
|
8
|
-
//# sourceMappingURL=studio-
|
|
7
|
+
//# debugId=59FD0439E93E257D64756E2164756E21
|
|
8
|
+
//# sourceMappingURL=studio-90zkgne5.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{ZM,f1,i2}from"./studio-nzemfbkk.js";var d=null;function FI(e=document){return d??=i2({document:e}),d}function m(){return d??FI()}var Ve="data-jx-region",M=["rail","navigator","inspector","pane","dock.bottom","statusbar","commandbar","overlay"],T=new Set(["dock.bottom"]);function O(e){let t=e.indexOf("/"),n=t===-1?e:e.slice(0,t),o=t===-1?void 0:e.slice(t+1);if(o===""||n==="")return null;let s=n,r;if(!T.has(n)){let a=n.indexOf(".");if(a!==-1){if(s=n.slice(0,a),r=n.slice(a+1),r==="")return null}}let i=M.find((a)=>a===s);if(i===void 0)return null;return r===void 0?o===void 0?{surface:i}:{part:o,surface:i}:o===void 0?{instance:r,surface:i}:{instance:r,part:o,surface:i}}function A(e){return O(e)!==null}function N(e){if(e==="pane")return"pane.primary";return e.startsWith("pane/")?`pane.primary/${e.slice(5)}`:e}function x(e){return e??document}var w=[{locate:([,e],t)=>{let o=hf(`inspector/field:${e}`,t)?.querySelector('[part="browse"]');return o?[o]:[]},pattern:/^inspector\/field:(.+)\/browse$/},{locate:([,e],t)=>{let n=hf("inspector",t);return n?[...n.querySelectorAll(`[data-prop="${CSS.escape(e)}"]`)]:[]},pattern:/^inspector\/field:(.+)$/}];function I(e,t){let n=N(e);if(!A(n))return[];let o=[...x(t).querySelectorAll(`[data-jx-region="${CSS.escape(n)}"]`)];if(o.length>0)return o;for(let s of w){let r=n.match(s.pattern);if(r)return s.locate(r,x(t))}return[]}function hf(e,t){return I(e,t).at(-1)??null}var jI={dock:"dock.bottom",inspector:"inspector",navigator:"navigator",pane:"pane.primary",rail:"rail",status:"statusbar"};function Ln(e,t){return t?`pane.${e}/${t}`:`pane.${e}`}function VM(e){return Ln(e,"tabs")}function UM(e){return`navigator/panel:${e}`}function qM(e){return`inspector/tab:${e}`}var GM="navigator/statements";function KM(e){return`inspector/statements:${e}`}function u0(e){return`dock.bottom/panel:${e}`}var h={dialog:"dialog",modal:"dialog",popover:"menu",toast:"toasts"};function vt(e,t){let n=h[e];return t?`overlay.${n}:${t}`:`overlay.${n}`}var g=new Map,S=1;function y(e){let t=S;return S+=1,g.set(t,{...e,id:t}),t}function p(e){g.delete(e)}function v(){return[...g.values()]}function zM(e){let t=e.toLowerCase();return v().filter((n)=>n.elements.has(t))}function WM(e){return v().filter((t)=>t.name===e)}var c="jx-studio:/surfaces/",u=new Map;function E(e,t){u.set(e,t),f1(H(e),t)}function H(e){return`${c}${e}.json`}function JM(e){return u.get(e)}function L(e){if(!e.startsWith(c)||!e.endsWith(".json"))return;return u.get(e.slice(c.length,-5))}async function R(e,t,n,o={}){let s=u.get(e);if(!s)throw Error(`Studio surface "${e}" is not registered`);if(await m(),o.region)n.setAttribute(Ve,o.region);let r={scope:t,base:c,resolver:L};if(o.onNodeCreated)r.onNodeCreated=o.onNodeCreated;if(o.onNodeMoved)r.onNodeMoved=o.onNodeMoved;if(o.signal)r.signal=o.signal;let i=await ZM(s,n,r),a=(b)=>({dispose:b,elements:i.elements,root:i.root,scope:i.scope});if(o.signal?.aborted)return a(i.dispose);let l=0,f=()=>{i.dispose(),p(l)};return l=y({elements:i.elements,host:n,name:e,remount:async()=>{f(),await R(e,t,n,o)}}),o.signal?.addEventListener("abort",()=>p(l),{once:!0}),a(f)}
|
|
2
|
+
export{zM,WM,FI,Ve,hf,jI,Ln,VM,UM,qM,GM,KM,u0,vt,E,JM,R};
|
|
3
|
+
|
|
4
|
+
//# debugId=1C7B5B37616C53CE64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-9dq7rwc7.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{p}from"./studio-4fnb5648.js";import{C}from"./studio-4f7thq0p.js";import{af}from"./studio-q9hx2qp0.js";import{oe}from"./studio-v5wktj6f.js";import{v,T0}from"./studio-k3we3kqb.js";async function qw(e,o){return p().codeService(e,o)}async function KN(e){return p().locateFile(e)}var Yu=new Map;async function Gw(e,o){let s=e.$prototype?C?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||s;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(Yu.has(r))return Yu.get(r);try{let n=p(),i=!s&&o.documentPath?`${location.origin}/${o.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return Yu.set(r,a),a}catch{return Yu.set(r,null),null}}function ZT(e,o){let s=e.getModel();if(!s)return;let t=af();if(!t)return;let r=o.flatMap((n)=>{let i=n.labels?.[0];if(!i)return[];let{line:a,column:c,length:u}=i.span;return[{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:c+(u||1),endLineNumber:a,message:n.message+(n.help?`
|
|
2
|
+
${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:c,startLineNumber:a}]});t.editor.setModelMarkers(s,"oxlint",r)}function JN(e,o){let s=(t)=>{if(!v(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return T0(r)};if(e.type==="def"){let t=e.defName?s(o?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!o||!e.path)return["state","event"];let t=oe(o,e.path),r=t&&e.eventKey?s(t[e.eventKey]):null;if(r)return r}return["state","event"]}
|
|
3
|
+
export{qw,KN,Yu,Gw,ZT,JN};
|
|
4
|
+
|
|
5
|
+
//# debugId=EFAA4A356901D95164756E2164756E21
|
|
6
|
+
//# sourceMappingURL=studio-9gr7xs9r.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{ft}from"./studio-5tet77de.js";import{X}from"./studio-9c6cbq2c.js";import{Tn,nt,Fn}from"./studio-tpxcryf2.js";import{ar,w}from"./studio-sce30r7b.js";import{ae}from"./studio-wqfaqw4m.js";import{cf,p,ye}from"./studio-4fnb5648.js";import{jt,Ih,sc,ou,Aa,lf,fn,wl}from"./studio-q9hx2qp0.js";import{us}from"./studio-4zd6an2b.js";import{$s,Um}from"./studio-hh394phe.js";import{Wt,ln,go,Gm,wv,Jd,Gn,fi,m,Da,oc,rc,Si,SI,Ft,kv,CI}from"./studio-knsjyx7n.js";import{Wp,PO,FO,Ls}from"./studio-bnc50f9h.js";import{rt,Eo,xr}from"./studio-g9brbewz.js";import{Es,fO,z$,yO,Ix,Rx}from"./studio-pwctzka3.js";import{sl}from"./studio-v7a7yb5w.js";import{ei}from"./studio-r6mx7vm5.js";import{Ea}from"./studio-n9qba0gx.js";import{yf}from"./studio-1ks5d9y4.js";import{Br,Ks,Js,zr}from"./studio-90zkgne5.js";import{Kw,Im,Rm,Fb}from"./studio-mrjtnm62.js";import{UC,q$,G$,iv,Wm,Jc,Ys}from"./studio-61rg2cz5.js";import{HT,HS}from"./studio-2zz4qbv9.js";import{Qw}from"./studio-3pz4t5a2.js";import{qN,Fr,Ab,Ob}from"./studio-hfqpfmpk.js";import{jb,Zu}from"./studio-jma2q8r9.js";import{zt}from"./studio-daksw8kh.js";import{Fw,jw,Hw}from"./studio-g0hxtcga.js";import{Fc}from"./studio-qrzmfaf6.js";import{Vs}from"./studio-j0zf5x2x.js";import{C,id,_n}from"./studio-4f7thq0p.js";import{E,R}from"./studio-9dq7rwc7.js";import{g}from"./studio-3qr08sxq.js";import{n,_}from"./studio-k3we3kqb.js";import{ce}from"./studio-0939t1q1.js";async function Lb(){if(Kw(location.search))return!1;let e=p();if(!e.dependenciesNeedInstall||!e.installDependencies)return!1;let t=!1;try{t=await e.dependenciesNeedInstall()}catch{return!1}if(!t)return!1;let o=sl({status:"Installing dependencies…",title:"Installing dependencies"});try{let r=await e.installDependencies();if(r.ok)return o.done(),!0;o.fail(r.log??"Install failed")}catch(r){o.fail(r instanceof Error?r.message:String(r))}return!1}var Le=["page","component"],Me={components:"component",pages:"page"};function L(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ae(e){let t=L(e).toLowerCase();for(let[o,r]of Object.entries(Me))if(t.startsWith(`${o}/`))return r;return null}function K(e){return Le.some((t)=>e.includes(t))}function He(e){let t=C?.projectConfig?.layout;if(!n(t))return!1;return L(t).toLowerCase()===L(e).toLowerCase()}function $S(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let o of wl(e)){let r=Aa(o,"parse");if(r&&Aa(o,"serialize"))t.push({ext:o,label:`${r.name} (${o})`})}return t}function ie(){return new Set([".json",...ou().flatMap((e)=>e.extensions)])}function IS(e){if(e===null||e===void 0||e==="")return[];let t=Ae(e);if(t===null||He(e)||Gn(e))return[];let o=fn(e);if(!(o?Boolean(o.capabilities.parse)&&K(o.documentKinds):L(e).toLowerCase().endsWith(".json")))return[];let a=[];if(o)a.push({ext:".json",label:"JSON (.json)"});for(let i of wl()){let s=Aa(i,"serialize");if(!s||s.name===o?.name||!K(s.documentKinds)||!s.documentKinds.includes(t))continue;a.push({ext:i,label:`${s.name} (${i})`})}return a}function RN(){let e=new Set([".json"]);for(let t of ou()){if(!t.capabilities.serialize||!K(t.documentKinds))continue;for(let o of t.extensions)e.add(o)}return[...e].toSorted()}var Y="jx-studio-recent-projects",le="jx-studio-recent-files",se=8,We=10,T=[];function M(){if(!ye())return null;let e=p();return ze(e)?e:null}function ze(e){return Boolean(e.getRecentProjects&&e.saveRecentProjects)}function _e(){try{let e=localStorage.getItem(Y);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Q(){return M()?T:_e()}function de(e){T=e;let t=M();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(Y,JSON.stringify(e))}catch{}}async function DN(){let e=M();if(!e)return;try{T=await e.getRecentProjects()}catch{T=[]}}function Nw(){return Q().toSorted((e,t)=>t.timestamp-e.timestamp)}function Aw(e,t){let o=Q().filter((r)=>r.root!==t);if(o.unshift({name:e,root:t,timestamp:ar()}),o.length>se)o.length=se;de(o)}function RS(e){de(Q().filter((t)=>t.root!==e))}function NN(){T=[];let e=M();if(e)e.saveRecentProjects([]);else localStorage.removeItem(Y)}function pe(){try{let e=localStorage.getItem(le);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function AN(e){let t=pe().toSorted((o,r)=>r.timestamp-o.timestamp);return e==null?t:t.filter((o)=>o.root===e)}function $b(e){let t=pe().filter((a)=>!(a.root===e.root&&a.path===e.path));t.unshift({name:e.name,path:e.path,root:e.root,timestamp:ar()});let o=new Map,r=[];for(let a of t.toSorted((i,s)=>s.timestamp-i.timestamp)){let i=(o.get(a.root)??0)+1;if(o.set(a.root,i),i<=We)r.push(a)}localStorage.setItem(le,JSON.stringify(r))}var ue={$schema:"https://jxsuite.com/schema/v1",$id:"StudioFilesPanel",$description:'The Navigator\'s Files tree, as a Jx document over the kit. `files/files.ts` keeps every decision — which directories are listed, which entries `.gitignore` masks, which rows the window draws, what a click on a row means, what the context menu offers and what each verb does to the filesystem — and hands this document one projection: a word saying which of three things to draw, a toolbar whose state is already resolved, and rows whose every field is already a string. Nothing here asks what a file is, how tall the Navigator is, or whether a directory has been read. THE TREE IS `jx-tree`, and that is what this document no longer says: `role="tree"`, `role="treeitem"`, `aria-level`, `aria-posinset`, `aria-setsize`, the roving `tabindex` and the five arrow-key cases were each written out here and written out again in `panel-outline.json`, two copies of one keyboard contract with nothing holding them in agreement. The element owns all of it; what is left here is what this tree IS — a flat projection of rows, each already carrying its own level and set counts, because the DOM holds a WINDOW onto the model and an expanded `node_modules` is eleven rows rather than ten thousand. The window reaches the element as `padtop`/`padbottom`, and a caret move past either comes back as `move` for the flow to scroll and repaint. Four facts a row carries are bound against ONE scope field each — the current path, the selected path, the dragged path and the drop target — so moving the caret or dragging a file re-evaluates an attribute per drawn row instead of rebuilding the list under the reader\'s pointer. The pragmatic-drag-and-drop handles are an ISLAND: the document draws the rows and the tree, and the adapter attaches sources and targets to them through `onNodeCreated` (specs/studio-ui-guidelines.md §9.4).',tagName:"div",attributes:{part:"files"},style:{$description:"What the twenty `.file-tree*`, `.files-toolbar`, `.project-header` and `.project-name` rules in `styles/panels.css` said, keyed on `part` and re-pointed at the studio token layer. Three names could not come with the declarations. The five `var(--spectrum-font-size-50 | -75, …)` reads are the kit's `--jx-text-sm` and `--jx-text-md`, which are the same 11px and 12px — a `--spectrum-*` name is declared by `<sp-theme>` and by nothing else in this package, so a document that reads one is a document whose type size changes when a component it does not use is removed. The `.selected`, `.dragging`, `.drag-over` and `.drag-over-root` classes are `data-` attributes on a part, because a part is the handle now and because a state a handler adds and forgets to take off is exactly the defect a cancelled drag used to leave on screen. MOST OF THE ROW'S OWN RULES ARE GONE, and that is the point of the element rather than an omission: `jx-tree-item` declares the flex line, the one-control-height box the window reserves scroll by, the indent (`--jx-tree-indent` times one less than `level` — exactly the `8 + depth * 16` this file composed per row), the hover and focus states, the selected wash and the faded dragged row. What is left here is what is TRUE OF THIS TREE and not of trees in general: it owns its own scrollbar, a click on a row opens it, and the row a drag is over wears the drop mark this file draws.",display:"flex",flexDirection:"column",height:"100%",minHeight:"0",overflow:"hidden",fontFamily:"var(--jx-font-sans)",fontSize:"var(--jx-text-md)",color:"var(--fg)",'& [part="empty"]':{$description:"The two states that are not a tree. They are two states and not one sentence: a window with no project at all and a monorepo root that has not been pointed at a site are different situations, and only the second has anything to offer (studio-ui-guidelines.md §11).",padding:"var(--jx-space-6)",textAlign:"center",color:"var(--fg-dim)",fontSize:"var(--jx-text-md)",display:"flex",flexDirection:"column",alignItems:"center",gap:"var(--jx-space-4)"},'& [part="empty"] p':{margin:"0"},'& [part="frame"]':{display:"flex",flexDirection:"column",height:"100%",minHeight:"0"},'& [part="project-header"]':{display:"flex",alignItems:"center",gap:"var(--jx-space-3)",padding:"var(--jx-space-3) var(--jx-space-4)",borderBottom:"1px solid var(--border)",flexShrink:"0"},'& [part="project-name"]':{fontSize:"var(--jx-text-md)",fontWeight:"600",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},'& [part="toolbar"]':{display:"flex",gap:"var(--jx-space-2)",padding:"var(--jx-space-2) var(--jx-space-3)",borderBottom:"1px solid var(--border)",alignItems:"center",flexShrink:"0"},'& [part="search"]':{flex:"1",minWidth:"0"},'& [part="tree"]':{$description:"The scroller as well as the list. `ui/virtual-window.ts` walks up from the element it is given looking for the nearest thing that scrolls, and finding itself is the shortest answer — which is why the element declares no `overflow` of its own and leaves the question to the two trees that answer it differently. The colour is re-declared because `jx-tree` sets `--jx-fg` on itself, and this panel's text colour is the studio alias of it.",flex:"1",minHeight:"0",overflowY:"auto",color:"var(--fg)"},'& [part="tree"][data-drop="true"]':{background:"var(--hover-bg)"},'& [part="row"]':{$description:"What the element does not decide. A click on a row OPENS it here — a directory unfolds, a file takes a tab — so the pointer is a pointer rather than the element's default arrow; and the gap is the wider one this tree has always drawn between a 16px file glyph and its name.",gap:"var(--jx-space-3)",cursor:"pointer"},'& [part="loading-row"]':{$description:"A directory whose listing has not arrived yet. It holds the place and it is NOT a row: it is not a `jx-tree-item`, so the caret cannot land on it, the set counts do not include it and typeahead cannot match it — and it is replaced by the real rows on the repaint the listing provokes. It draws the same box by hand because it is the only line in this tree the element does not draw, and a placeholder of a different height would desynchronise the window's scroll reservation from the rows it reserves for.",display:"flex",alignItems:"center",boxSizing:"border-box",blockSize:"var(--jx-control-h)",paddingInline:"calc(var(--jx-space-3) + var(--depth, 0) * 16px) var(--jx-space-3)",color:"var(--fg-dim)",fontStyle:"italic",cursor:"default",userSelect:"none",whiteSpace:"nowrap"},'& [part="row-icon"]':{flexShrink:"0",display:"flex",alignItems:"center","--jx-icon-size":"16px"},'& [part="locale"]':{$description:"The language chip. Deliberately declares no block size, no padding and no line height: the row above is one control-height by contract, and a chip that grew the box would desynchronise the window's scroll reservation from the height it reserves by. It only ever shrinks the text. A chip, not a filter term: the search matches the file's name alone, because a query that silently also matched a language would make “why is this file here” unanswerable from what is on screen.",marginInlineStart:"auto",flexShrink:"0",fontSize:"var(--jx-text-sm)",color:"var(--fg-dim)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxInlineSize:"6em"},'& [part="view-slot"], & [part="header-slot"], & [part="locale-slot"]':{$description:"A `$switch` renders its own container, and none of these three is a box: each stands exactly where its case does, so the case's own rule is the only one that lays anything out.",display:"contents"}},children:[{tagName:"div",attributes:{part:"view-slot",role:"none"},$switch:{$ref:"#/state/view"},cases:{none:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"No project loaded"}]},address:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Add ?project= and a project folder's absolute path to this page's address to open it."}]},welcome:{tagName:"div",attributes:{part:"empty"},children:[{tagName:"p",textContent:"Open a project folder to get started."},{tagName:"jx-button",attributes:{part:"open-project"},$props:{variant:"accent",size:"sm"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/openProject"},value:[]}],description:"The declared `project.open` command, run through the registry — not a second opener of this surface's own. It is the one the chord, the palette and the status bar's PROJECT field already run, so a window that opens a project from here reports the outcome the same way they do (studio-ui-guidelines.md §12.5)."},children:[{tagName:"span",textContent:"Open Project"}]}]},tree:{tagName:"div",attributes:{part:"frame"},children:[{tagName:"div",attributes:{part:"header-slot",role:"none"},$switch:{$ref:"#/state/headerState"},cases:{shown:{tagName:"div",attributes:{part:"project-header"},children:[{tagName:"span",attributes:{part:"project-name",title:"${state.projectName}"},textContent:"${state.projectName}"}]}}},{tagName:"div",attributes:{part:"toolbar"},children:[{$description:"A row of quiet tools, so NOT compact. A compact group draws every member's frame and fill whatever its quiet says, which is the segmented look a choice wants and not the borderless one a toolbar wants; Spectrum's group here was `compact quiet`, a combination the kit spells as compact=false with its members' default quiet.",tagName:"jx-action-group",attributes:{part:"toolbar-actions"},$props:{compact:!1,label:"File tree actions"},children:[{tagName:"jx-action-button",attributes:{part:"new-file"},$props:{size:"sm",icon:"plus",label:"New File",hint:"New File"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/newFile"},value:[]}]}},{tagName:"jx-action-button",attributes:{part:"refresh"},$props:{size:"sm",icon:"arrows-clockwise",label:"Refresh",hint:"Refresh"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/refresh"},value:[]}],description:"The rules go with the listings. Refresh is what an author reaches for after editing a `.gitignore` by hand, and a tree that came back still hiding by the old rules would read as the button not having worked."}},{tagName:"jx-action-button",attributes:{part:"show-ignored"},$props:{size:"sm",icon:{$ref:"#/state/ignoredIcon"},label:{$ref:"#/state/ignoredLabel"},hint:{$ref:"#/state/ignoredLabel"},selected:{$ref:"#/state/ignoredSelected"}},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/toggleIgnored"},value:[]}],description:"A repaint and nothing else: the ignored entries were never dropped from the cached listings, only from the rows built out of them."}}]},{tagName:"jx-textfield",attributes:{part:"search"},$props:{label:"Filter files",placeholder:"Filter files…",size:"sm",value:{$ref:"#/state/query"}},oninput:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/search"},value:[{$ref:"event#/target/value"}]}],description:"The query matches a file's NAME and nothing else. A directory is kept whatever it says, because hiding the folder a match sits in would leave the match with nowhere to be drawn."}}]},{$description:'The `role="tree"`, and everything that used to be spelled out under it. The element writes the role, the name, the roving tab stop and every row\'s `aria-level` / `aria-posinset` / `aria-setsize`, and it owns the whole ARIA keyboard: the arrows walk the drawn rows without wrapping, `Home` and `End` reach the ends of the MODEL by way of the pads, `ArrowRight` opens a directory and steps into an open one, `ArrowLeft` closes one and otherwise steps out to its parent, `Enter` activates and a printable character is typeahead. Every chord it does not own — cut, copy, paste, delete, rename — passes straight through to the flow, which is the WCAG 2.5.7 obligation this tree carries because dragging a file is the other way to move it. What reaches this document is five events, and each of them is a decision `files.ts` already owned.',tagName:"jx-tree",attributes:{part:"tree",label:"Project files",current:"${state.currentPath}",padtop:"${state.padTop}",padbottom:"${state.padBottom}","data-drop":"${state.rootDrop || null}"},onselect:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/select"},value:[{$ref:"event#/detail/value"}]}],description:"The reader meant that row. This tree is single-select, so the element resolves every modifier to `replace` before it gets here and the detail's `mode` and `anchor` are answers to a question this tree does not ask. There is no `change` handler beside it on purpose: the element OWNS the caret and keeps it across every repaint that does not change `current`, so a second copy of it in the flow would be a variable that only ever went stale."},onactivate:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"event#/detail"}]}],description:"`Enter` or a double click. The same verb a single click reaches, by the same name."},onexpand:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/expand"},value:[{$ref:"event#/detail/value"},{$ref:"event#/detail/expanded"}]}],description:"`ArrowRight`, `ArrowLeft` or the twisty, with ONE dispatcher between them: the detail says the state the row should be PUT INTO, so the flow never has to work out which way a toggle was going."},onmove:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/move"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/key"}]}],description:"The caret has to reach a row the window did not draw. The element knows only that the pad on that side is not zero; where the row is in the model, and how far to scroll to bring it into view, is the flow's — which is why this is an event and not a `scrollIntoView`."},ontypeahead:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/typeahead"},value:[{$ref:"event#/detail/from"},{$ref:"event#/detail/char"}]}],description:"A printable character, on a windowed tree. The same hand-off as `onmove` and for a sharper reason: a move off the end of the slice announces itself, and a letter never does — the element's own search over the drawn rows always answers, and over a `node_modules` of ten thousand entries the answer is whichever of the eleven painted rows happened to start with that letter. So the element dispatches EVERY such character and the flow answers it over the model."},children:[{$prototype:"Array",items:{$ref:"#/state/rows"},key:{$ref:"$map/item/key"},map:{tagName:"div",attributes:{part:"row-slot",role:"none"},style:{display:"contents"},$switch:{$ref:"$map/item/kind"},cases:{item:{tagName:"jx-tree-item",attributes:{part:"row",value:"${$map.item.path}",label:"${$map.item.name}",level:"${$map.item.level}",posinset:"${$map.item.posInSet}",setsize:"${$map.item.setSize}",expanded:"${$map.item.ariaExpanded}",selected:"${state.selectedPath === $map.item.path ? 'true' : 'false'}","data-type":"${$map.item.type}","data-dragging":"${state.dragPath === $map.item.path ? '' : null}","data-drop":"${state.dropPath === $map.item.path ? '' : null}"},onclick:{$prototype:"Function",body:[{operator:"call",target:{$ref:"#/state/activate"},value:[{$ref:"$map/item/path"}]}],description:"A single click OPENS the row, which is this tree's own answer and not the element's. `jx-tree` answers a click with `change` and `select`, exactly as it answers an arrow key, and a tree that opened on `select` would open every file the reader arrowed past. So the opening verb is bound here, where a click is a click; what a click MEANS — unfold this directory, take a tab for that file — stays the flow's, and Enter reaches the same verb through `activate`. It does NOT stop the event, which is the correction: the tree's delegated click is what moves the caret and the selection onto the row, so a `stopPropagation` here would leave a reader who clicked a folder with the tab stop still on whatever they had open last. The twisty stops its own click, so opening a directory from the chevron does not also activate the row."},oncontextmenu:{$prototype:"Function",body:[{preventDefault:!0},{stopPropagation:!0},{operator:"call",target:{$ref:"#/state/contextMenu"},value:[{$ref:"$map/item/path"},{$ref:"event#/clientX"},{$ref:"event#/clientY"}]}]},children:[{tagName:"jx-icon",attributes:{slot:"icon",part:"row-icon","aria-hidden":"true"},$props:{name:{$ref:"$map/item/icon"}}},{tagName:"div",attributes:{slot:"status",part:"locale-slot",role:"none"},$switch:{$ref:"$map/item/localeState"},cases:{shown:{tagName:"span",attributes:{part:"locale"},textContent:"${$map.item.locale}"}}}]},loading:{$description:"A directory whose listing has not arrived yet. Deliberately not a `jx-tree-item`: there is no file there to select, open, rename or drag, and a row the caret could land on that answers to none of the verbs the caret offers is a stop in the walk with nothing behind it.",tagName:"div",attributes:{part:"loading-row",role:"none","data-loading":"true",style:"--depth:${$map.item.depth}"},textContent:"Loading…"}}}}]}]}}}]};E("files-panel",ue);function fe(e,t){e.view=t.view,e.headerState=t.headerState,e.projectName=t.projectName,e.query=t.query,e.ignoredLabel=t.ignoredLabel,e.ignoredIcon=t.ignoredIcon,e.ignoredSelected=t.ignoredSelected,e.padTop=t.padTop,e.padBottom=t.padBottom,e.rows=t.rows,e.selectedPath=t.selectedPath,e.dragPath=t.dragPath,e.dropPath=t.dropPath,e.rootDrop=t.rootDrop,e.currentPath=t.currentPath}function A(){return{currentPath:"",dragPath:"",dropPath:"",headerState:"hidden",ignoredIcon:"eye-slash",ignoredLabel:"Show ignored files",ignoredSelected:!1,padBottom:0,padTop:0,projectName:"",query:"",rootDrop:"",rows:[],selectedPath:"",view:"none"}}function Je(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function qe(e){let t=e?.$map,o=_(t)&&"item"in t?t.item:void 0;if(!_(o)||!("path"in o)||!n(o.path)||!("type"in o)||!n(o.type))return null;return{path:o.path,type:o.type}}function me(e,t,o){let r=g({...A(),...o});fe(r,t);let a=null,i=!1,s=R("files-panel",r,e,{onNodeCreated:(l,c,d,u)=>{if(i||!(l instanceof HTMLElement))return;let x=Je(d);if(x==="tree"){o.treeHost(l);return}if(x!=="row")return;let y=qe(u);if(y)o.rowHost(l,y.path,y.type)}}).then((l)=>{if(i){l.dispose();return}a=l});return{connected:()=>!i&&(a===null||a.root.parentNode===e),dispose(){i=!0,a?.dispose(),a=null},ready:s,update:(l)=>{fe(r,l)}}}async function rl(e){if(!C)return;try{let t=p(),[o]=await Promise.all([$s(()=>t.listDirectory(e)),PO(e)]);C.dirs.set(e,o)}catch{C.dirs.set(e,[])}}var he=new Set(["pages","layouts","components","content","data","public","styles"]);async function Em(){if(!C)return;await rl(".");let e=[];for(let t of C.dirs.get(".")??[])if(t.type==="directory"&&he.has(t.name))e.push(t.name),C.expanded.add(t.path||t.name),await rl(t.path||t.name);C.projectDirs=e}async function TT(e){let t=new Set(C?.projectDirs);if(!e.some((r)=>{let a=r.replaceAll("\\","/").replace(/^\.\//,"").split("/")[0]??"";return r.includes("/")&&he.has(a)&&!t.has(a)}))return!1;return await Em(),!0}function LT(){return Eo(rt.showIgnoredFiles)==="true"}function VP(e){xr(rt.showIgnoredFiles,e?"true":"")}async function $T(){try{let e=p(),t=await e.probeRootProject();if(!t)return;let{meta:o,info:r}=t;if(Ih(),jt(),sc(e),Wp(),Um(),id({dirs:new Map,expanded:new Set,isSiteProject:r.isSiteProject,name:r.isSiteProject?r.projectConfig?.name||o.name:o.name,projectConfig:(r.isSiteProject?r.projectConfig:null)||null,projectDirs:r.directories||[],projectRoot:".",root:o.root,searchQuery:"",selectedPath:null}),r.isSiteProject)rc(o.root||".",r.projectConfig||null);if(r.isSiteProject){if(Aw(_n().name,o.root),await Rm(),await Lb())Ih(),await jt(),sc(e);await Em(),await Ea(),await Ib(),Im(o.root)}}catch{}}async function IT({renderLeftPanel:e,resetProjectCaches:t}){try{let o=p(),r=await o.openProject?.();if(!r)return!1;let{config:a,handle:i}=r;if(SI({document:{children:[],tagName:"div"},id:"initial"}),qN(),Ih(),jt(),sc(o),Wp(),Um(),id({...C,dirs:new Map,expanded:new Set,isSiteProject:!0,name:a.name||i.name,projectConfig:a,projectRoot:i.root,searchQuery:"",selectedPath:null}),rc(i.root,a),await Rm(),await Lb())Ih(),await jt(),sc(o);return await Em(),await Ea(),Fb(),Rx(),t?.(),Aw(_n().name,_n().projectRoot),e(),await Ib(),Im(_n().projectRoot),!0}catch(o){return w.error("Could not open the project.",{detail:X(o),source:"Open Project"}),!1}}async function RT(e){let t=p();if(t.createDestination!=="path")return!1;try{if(await t.activate(e),(await t.gitStatus()).isRepo)return!1;return await t.gitInit(),w.success("Initialized a git repository for this project."),!0}catch(o){return w.warn("Could not initialize a git repository — the project itself was written.",{detail:X(o),source:"Source Control"}),!1}}async function DS(){await jt();let e=[...wl("page"),".json"],t;try{t=await p().listDirectory("pages")}catch{return null}let o=new Set(t.filter((r)=>r.type==="file").map((r)=>r.name));for(let r of e)if(o.has(`index${r}`))return`pages/index${r}`;return null}async function UP(){let e=await DS();if(e)await _i(e)}async function Ib(){let e=yO(m.projectRoot),t=z$(m.projectRoot),o=await Be(e);return ge?.(t),o}var ge=null;function DT(e){ge=e}async function Be(e){if(Ix(m.projectRoot),e){if(await fO(e,{ensureSecondPane:()=>{oc(fi)},openFile:(o,r)=>_i(o,{focus:!1,paneId:r})})>0)return!0}return await UP(),!1}function Ue(e,t,o){if(t==="directory")return o?"folder-open":"folder";let r=e.split(".").pop()?.toLowerCase();switch(r){case"css":case"js":case"json":case"ts":return"file-code";case"md":return"file-text";default:return r!==void 0&&yf(r)?"image":"file"}}var qP=24,f=[],k=null,j=new Map,z=null,we=null;function oe(){for(let e of j.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return qP}function Ge(){for(let[e,t]of j)if(!t.isConnected)j.delete(e),Re(t)}function ve(e){let t=j.get(e);return t?.isConnected===!0?t:null}function B(e){return f.find((t)=>!t.loading&&t.path===e)}function be(e,t,o,r){let a=_n().dirs.get(e);if(!a){rl(e).then(()=>h()),o.push({depth:t,expanded:!1,key:`loading:${e}`,loading:!0,name:"Loading…",path:e,posInSet:1,setSize:1,type:"file"});return}let i=[...a].toSorted((d,u)=>{if(d.type==="directory"&&u.type!=="directory")return-1;if(d.type!=="directory"&&u.type==="directory")return 1;return d.name.localeCompare(u.name)}),s=LT()?i:i.filter((d)=>!FO(e,d.path,d.type==="directory")),l=_n().searchQuery.toLowerCase(),c=l?s.filter((d)=>d.type==="directory"||d.name.toLowerCase().includes(l)):s;for(let[d,u]of c.entries()){let y=u.type==="directory"&&_n().expanded.has(u.path);if(o.push({depth:t,expanded:y,key:u.path,loading:!1,name:u.name,path:u.path,locale:go(u.path,r)??void 0,posInSet:d+1,setSize:c.length,type:u.type}),y)be(u.path,t+1,o,r)}}function xe(e){return e===void 0?-1:f.findIndex((t)=>!t.loading&&t.path===e)}function H(e,t){for(let o=e+t;o>=0&&o<f.length;o+=t)if(!f[o].loading)return o;return-1}function Ke(e){let t=f[e];if(!t)return-1;for(let o=e-1;o>=0;o--){let r=f[o];if(!r.loading&&r.depth<t.depth)return o}return-1}function Ye(){if(k?.isConnected!==!0||S!=="")return;queueMicrotask(h)}function ee(){let e=k;if(e===null)return;z=Hw(z,e,{count:()=>f.length,onChange:Ye,rowHeight:oe})}function Qe(e){let t=String(e.depth+1);if(e.loading)return{ariaExpanded:"",depth:String(e.depth),icon:"",key:e.key,kind:"loading",level:t,locale:"",localeState:"hidden",name:e.name,path:e.path,posInSet:"",setSize:"",type:e.type};return{ariaExpanded:e.type==="directory"?String(e.expanded):"",depth:String(e.depth),icon:Ue(e.path,e.type,e.expanded),key:e.key,kind:"item",level:t,locale:e.locale===void 0?"":Wt(e.locale),localeState:e.locale===void 0?"hidden":"shown",name:e.name,path:e.path,posInSet:String(e.posInSet),setSize:String(e.setSize),type:e.type}}function Xe(){if(Ge(),!C){f=[];let l={...A(),view:"none"};return b=l,l}if(!C.isSiteProject&&C.projectRoot==="."){f=[];let l=cf(p())?"welcome":"address",c={...A(),view:l};return b=c,c}let e=_n();f=[];let{i18n:t}=ln(e.projectConfig??{});be(".",0,f,t);let o=Fw(k,{count:f.length,rowHeight:oe()}),r=f.slice(o.start,o.end),a=(e.selectedPath!==null&&B(e.selectedPath)?e.selectedPath:"")||r.find((l)=>!l.loading)?.path||"",i=LT(),s={currentPath:a,dragPath:S,dropPath:I,headerState:e.isSiteProject?"shown":"hidden",ignoredIcon:i?"eye":"eye-slash",ignoredLabel:i?"Hide ignored files":"Show ignored files",ignoredSelected:i,padBottom:o.padBottom,padTop:o.padTop,projectName:e.projectConfig?.name||e.name,query:e.searchQuery,rootDrop:U,rows:r.map((l)=>Qe(l)),selectedPath:e.selectedPath??"",view:"tree"};return b=s,s}function te(){if(!v||!b)return;b={...b,dragPath:S,dropPath:I,rootDrop:U},v.handle.update(b)}function h(){we?.()}async function Ze(){let e=_n();e.dirs.clear(),Wp(),await rl(".");for(let t of e.expanded)await rl(t);h()}function et(e){let t=B(e);if(!t)return;if(t.type==="directory"){je(e).then(()=>h());return}_i(e)}function tt(e,t){let o=_n();if(B(e)?.type!=="directory"||o.expanded.has(e)===t)return;if(!t){o.expanded.delete(e),h();return}je(e).then(()=>h())}function Pe(e){if(!C||_n().selectedPath===e)return;_n().selectedPath=e,h()}function ot(e,t){let o=xe(e),r;switch(t){case"Home":{r=H(-1,1);break}case"End":{r=H(f.length,-1);break}case"ArrowUp":{r=H(o,-1);break}case"ArrowLeft":{r=Ke(o);break}case"ArrowDown":case"ArrowRight":{r=H(o,1);break}default:return}Fe(r)}function at(e,t){let o=xe(e),r=f.length;for(let a=1;a<=r;a++){let i=(o+a+r)%r,s=f[i];if(s&&!s.loading&&s.name.trim().toLowerCase().startsWith(t)){Fe(i);return}}}function Fe(e){let t=f[e];if(!t)return;if(Pe(t.path),ve(t.path))return;jw(k,e,oe()),h()}async function je(e){let t=_n();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await rl(e)}var N=new Map,V=null,S="",J="",I="",q=!1,U="";function GP(e){return[...e.dataTransfer?.types??[]].includes("Files")}function Se(e,t,o){let r=(s)=>{if(!GP(s))return;if(s.preventDefault(),s.stopPropagation(),s.dataTransfer)s.dataTransfer.dropEffect="copy";o(!0)},a=()=>o(!1),i=(s)=>{o(!1);let l=s.dataTransfer?.files;if(!l?.length)return;s.preventDefault(),s.stopPropagation(),ON(l,t,h)};return e.addEventListener("dragover",r),e.addEventListener("dragleave",a),e.addEventListener("drop",i),()=>{e.removeEventListener("dragover",r),e.removeEventListener("dragleave",a),e.removeEventListener("drop",i)}}function NT(e,t){let o=e.replaceAll("\\","/"),r=t.replaceAll("\\","/");if(!o||o===r)return!1;if(o.startsWith(`${r}/`)||r.startsWith(`${o}/`))return!1;return ne(o)!==r}function Z(e,t,o){let r=e.data.path;return o==="directory"&&n(r)&&NT(r,t)}function F(e,t){let o=t?e:"";if(J===e&&I===o)return;J=e,I=o,$e()}function W(e){if(q===e)return;q=e,$e()}function $e(){U=q&&J===""?"true":"",te()}async function ON(e,t,o){if((await Ys([...e],{dir:t})).length===0)return;if(t!==".")_n().expanded.add(t);o()}function KP(e,t){let o=document.createElement("input");o.type="file",o.multiple=!0,o.accept=Jc(),o.addEventListener("change",()=>{if(o.files?.length)ON(o.files,e,t)}),o.click()}function it(e,t,o){Re(e),j.set(t,e);let r=[zr({element:e,getInitialData(){return{entryType:o,path:t,type:"file-tree"}},onDragStart(){S=t,te()},onDrop(){S="",F("",!1),te()}}),Se(e,o==="directory"?t:ne(t),(a)=>{F(a?t:"",a)}),Ks({canDrop({source:a}){return a.data.type==="file-tree"},element:e,getData({source:a}){return Z(a,t,o)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:a}){F(t,Z(a,t,o))},onDragEnter({source:a}){F(t,Z(a,t,o))},onDragLeave(){F("",!1)},onDrop(){F("",!1)}})];N.set(e,Br(...r))}function Re(e){let t=N.get(e);if(t)t(),N.delete(e)}function st(e){if(V?.element===e)return;ke(),k=e;let t=Ks({canDrop({source:r}){let a=r.data.path;return r.data.type==="file-tree"&&n(a)&&NT(a,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){W(!0)},onDragLeave(){W(!1)},onDrop(){W(!1)}}),o=Js({onDrop({source:r,location:a}){let[i]=a.current.dropTargets;if(!i)return;if(r.data.type!=="file-tree")return;if(i.data.type!=="file-tree-target")return;let s=r.data.path,l=i.data.targetDir;if(!n(s)||!n(l)||!NT(s,l))return;let c=s.split("/").pop(),d=l==="."?c:`${l}/${c}`;lt(s,d,h)}});V={cleanup:Br(t,o,Se(e,".",W)),element:e},ee()}function ke(){V?.cleanup(),V=null;for(let e of N.values())e();N.clear(),z?.window.destroy(),z=null,k=null,S="",J="",I="",q=!1,U=""}async function lt(e,t,o){let r=t.split("/").pop()??t,a=ne(t),i={path:e,source:"Files"},s;try{s=await p().listDirectory(a)}catch(d){w.error(`Could not move ${e}.`,{...i,detail:`The folder could not be read to check for ${r}: ${X(d)}`});return}let l=r.toLowerCase(),c=s.find((d)=>d.name.toLowerCase()===l);if(c!==void 0){let d=a==="."?"The project root":`${a}/`;w.error(`Could not move ${e}.`,{...i,detail:`${d} already has ${c.name}, and a move would replace it.`});return}try{let d=await Pw(e,t);if(a!==".")_n().expanded.add(a);o(),Mw(`Moved to ${t}`,d,t)}catch(d){w.error(`Could not move ${e}.`,{...i,detail:X(d)})}}function ne(e){let t=e.replaceAll("\\","/"),o=t.lastIndexOf("/");return o===-1?".":t.slice(0,o)}var D=null;function Ee(){D?.close(),D=null}function ct(e){let t={};if(e.type==="directory"){let o=Jd(e.path);if(o?.isSourceRoot===!0&&!o.fileBacked)t.name=o.name;return t}if(t.file=e.path,Fc(e.path))t.path=e.path;if(IS(e.path).length>0)t.source=e.path;return t}function P(e,t,o,r={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:o,title:t,...r}}function dt(e){let t=ae();if(!t)return[];let o=ct(e),r=[];for(let a of t.forPlacement("context/file")){let i=a.args;if(!(i?.required??[]).every((c)=>(c in o)))continue;let s={};for(let c of Object.keys(i?.properties??{}))if(c in o)s[c]=o[c];let l=t.disabledReason(a.id);r.push(l===void 0?P(a.id,a.title,()=>{Tn(t,a.id,s,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:a.id,requires:l,title:a.title})}return r}function pt(e){let t=e.type==="directory",o=[];if(t){if(o.push(P("files.newFile","New File…",()=>{Te(e.path,h)}),P("files.upload","Upload Files…",()=>{KP(e.path,h)})),e.path==="pages"||e.path.endsWith("/pages"))o.push(P("files.pagesGrid","Edit Pages in Grid",()=>{HS()}))}else o.push(P("files.open","Open",()=>{_i(e.path)}));return o.push(...dt(e),P("files.rename","Rename…",()=>{yt(e,h)},{dividerAbove:!0}),P("files.delete","Delete",()=>{bt(e,h)},{destructive:!0})),o}function ut(e,t,o){let r=B(e);if(!r)return;Ee();let a=ve(e);D=zt({label:"File actions",onClosed:(i)=>{if(D===i)D=null},opener:a,origin:{x:t,y:o},region:"files",rows:pt({name:r.name,path:r.path,type:r.type})})}var mt=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2);function ht(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${Aa(e.ext)?.name??e.ext} (${e.ext})`}]:$S(e.docKind)).map((o)=>({label:o.label,value:o.ext})),{dividerBefore:!0,label:"Other…",value:UC}]}function gt(e,t,o){let r=e.kind==="choose"?e.defaultExt:e.ext;if(r!==void 0&&t.some((i)=>i.value===r))return r;let a=q$(o);if(a!==""&&t.some((i)=>i.value===a))return a;return t[0]?.value??UC}async function JP(e){let{dir:t,format:o,source:r="Files"}=e;await jt();let a=await Ow(t),i=o!==void 0&&o.kind!=="fixed"?o:null,s=i===null?null:ht(i),l=i===null||s===null?"":gt(i,s,e.suggestedName??""),c={choice:o,dir:t,known:ie(),rows:s,taken:a},d=(G,Oe)=>iv(G,Oe,c),u=l,x={confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,select:s===null?"stem":"all",validate:d,value:e.suggestedName??"untitled.json"};if(s!==null)x.choice={initial:l,label:"Format",onChange:(G)=>{u=G},options:()=>s};if(e.suggestedName!==void 0)x.placeholder=e.suggestedName;let y=await Fn(e.title??"New File",x);if(!y)return null;let O=G$(y,u,o),De=t==="."?O:`${t}/${O}`,re=fn(O),Ne=e.content,Ce=o!==void 0&&u!==UC,Ie=Ne??re?.studio?.newFileTemplate??(re?"":O.toLowerCase().endsWith(".json")?Ce?mt:`{}
|
|
2
|
+
`:"");return NS(De,Ie,{dir:t,source:r})}async function Ow(e){try{let t=await p().listDirectory(e);return new Set(t.map((o)=>o.name.toLowerCase()))}catch{return new Set}}async function NS(e,t,o={}){let r=o.dir??(e.includes("/")?e.slice(0,e.lastIndexOf("/")):".");Ls(e);try{if(await p().writeFile(e,t),await rl(r),o.quiet!==!0)w.success(`Created ${e}`);return e}catch(a){return w.error(`Could not create ${e}.`,{detail:X(a),path:e,source:o.source??"Files"}),null}}async function Te(e,t){await jt();let o=Jd(e);if(o?.unresolvedFormat!=null)w.error(`New files in ${e}/ cannot be constrained to the collection's format.`,{detail:`The "${o.name}" content type declares format "${o.unresolvedFormat}", which no installed extension provides. Install the extension that supplies it, or correct `+"the name in Project Settings › Content Types.",path:e,source:"Files"});let r=o?.ext!=null&&o.unresolvedFormat===null,a=r&&o.isSourceRoot&&o.def.schema!==void 0,i;if(a){let{createEntry:s}=await (ce("t13dyw3c"),import("./entry-commands-t13dyw3c.js"));i=await s(o.name,{dir:e})}else i=await JP({dir:e,format:r&&o.ext!==null?{because:`${o.name} entries are ${o.ext} files, so a document of another format here would not be one.`,ext:o.ext,kind:"locked"}:{defaultExt:".json",kind:"choose"},suggestedName:"untitled"});if(i!==null)t()}async function wt(e,t,o){let r=await Ob(t),a={confirmLabel:"Rename",select:"stem",validate:(i)=>Wm(t,i,o),value:e};if(r!==void 0)a.message=r;return Fn("Rename",a)}function AS(e,t){let o=t.references,r=t.tag?`; tag → <${t.tag.to}> (${t.tag.refsUpdated})`:"";if(o&&o.refsUpdated>0)return`Renamed to ${e}; updated ${o.refsUpdated} reference(s) in ${o.filesChanged} file(s)${r}`;if(r)return`Renamed to ${e}${r}`;return`Renamed to ${e}`}function Mw(e,t,o){let r=t.errors??[];if(r.length===0){w.success(e);return}let a=r.length===1?"1 file":`${r.length} files`;w.warn(`${e} — references in ${a} could not be updated`,{detail:r.map((i)=>`${i.path}: ${i.error}`).join(`
|
|
3
|
+
`),path:o,source:"Files"})}function vt(e,t){for(let o of e.references?.files??[])if(o.path!==t&&m.tabs.has(o.path))Lm(o.path)}function Tm(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function YP(e,t,o){us();let r=Tm(e),a=Tm(t);if(await rl(r),a!==r)await rl(a);let i=_n();if(i.selectedPath===e)i.selectedPath=t;else if(i.selectedPath?.startsWith(`${e}/`))i.selectedPath=t+i.selectedPath.slice(e.length);vt(o,t)}async function Pw(e,t){Ls(e,t);let o=await p().renameFile(e,t),r=[...m.tabs.keys()];for(let a of r)if(a===e||a.startsWith(`${e}/`)){let i=t+a.slice(e.length);CI(a,i,i)}return await YP(e,t,o),o}async function OS(e,t){try{let o=await p().listDirectory(Tm(e));return new Set(o.map((r)=>r.name))}catch(o){return w.error(`Could not rename ${e.split("/").pop()??e}.`,{detail:`The folder could not be read to check the new name: ${X(o)}`,path:e,source:t}),null}}async function yt(e,t){let o=Tm(e.path),r=await OS(e.path,"Files");if(r===null)return;let a=await wt(e.name,e.path,r);if(!a||a===e.name)return;let i=o==="."?a:`${o}/${a}`;try{let s=await Pw(e.path,i);t(),Mw(AS(a,s),s,i)}catch(s){w.error(`Could not rename ${e.name}.`,{detail:X(s),path:e.path,source:"Files"})}}async function bt(e,t){if(!await Ab(e))return;try{let r=p();Ls(e.path),await r.deleteFile(e.path),us();let a=e.path.replaceAll("\\","/"),i=a.includes("/")?a.slice(0,a.lastIndexOf("/")):".";if(await rl(i),_n().selectedPath===e.path)_n().selectedPath=null;t(),w.success(`Deleted ${e.name}`)}catch(r){w.error(`Could not delete ${e.name}.`,{detail:X(r),path:e.path,source:"Files"})}}function xt(e,t){let o=t.paneId,r=Da(e);if(o!==void 0&&r){if(r.activeTabId===e&&t.focus===!1)return;kv(e,o)}Ft(e,{focus:t.focus!==!1})}async function _i(e,t={}){let o=t.focus!==!1;for(let[a,i]of m.tabs.entries())if(i.documentPath===e){if(t.canvasMode!==void 0)i.session.ui.canvasMode=t.canvasMode;if(xt(a,t),o)_n().selectedPath=e;return}if(jb(e)){if(Zu(e,t),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await HT(e,t),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot})}catch(a){w.error(`Could not open ${e}.`,{detail:X(a),path:e,source:"Open File"})}return}let r=p();try{let a=await r.readFile(e);if(!a){if(await jt(),!fn(e)&&!e.toLowerCase().endsWith(".json"))throw lf(e);return}await jt();let i,s,l=null,c=fn(e);if(c){let u=await Fr(e,a);({document:i}=u),{frontmatter:s}=u}else if(e.endsWith(".json"))({document:i,layout:l}=Es(a));else throw lf(e);if(Si({id:e,documentPath:e,document:i,...s!=null&&{frontmatter:s},layout:l,source:c?a:null,sourceFormat:c?.name??null,...t.paneId!==void 0&&{paneId:t.paneId},...t.preview===!0&&{preview:!0},...t.focus===!1&&{focus:!1},...t.canvasMode!==void 0&&{canvasMode:t.canvasMode}}),o)_n().selectedPath=e;$b({name:e.split("/").pop()||e,path:e,root:_n().projectRoot})}catch(a){w.error(`Could not open ${e}.`,{detail:X(a),path:e,source:"Open File"})}}async function MS(e,t){await _i(t,{focus:!1,paneId:e,preview:!0})}function AT(e){if(wv(e))return;Qw(e);for(let[,t]of m.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){Lm(e);return}}function OT(e){for(let t of e)Lm(t,{onlyIfChanged:!0})}async function Lm(e,t={}){for(let[,o]of m.tabs.entries())if(o.documentPath===e){let r=p(),a=o.doc.dirty,i=()=>!a&&o.doc.dirty||wv(e);try{let s=await r.readFile(e);if(!s)return;if(await jt(),i())return;if(fn(e)){let{document:l,frontmatter:c}=await Fr(e,s);if(i())return;if(t.onlyIfChanged&&Vs(l,o.doc.document)&&Vs(c,o.doc.content.frontmatter))return;o.doc.document=l,o.doc.content.frontmatter=c,o.doc.source=s}else if(e.endsWith(".json")){let l=Es(s);o.doc.layout=l.layout;let c=l.document;if(o.doc.bareRepeaters=Gm(c),t.onlyIfChanged&&Vs(c,o.doc.document))return;o.doc.document=c}o.doc.dirty=!1}catch(s){w.error(`Could not reload ${e} after it changed on disk.`,{detail:X(s),key:`reload:${e}`,path:e,source:"Files"})}return}}function MT(){ei({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",rail:"developer",render:()=>ft,afterRender:(e,t)=>{ZP(t,e.rerender)}})}var Pt={activate:et,contextMenu:ut,expand:tt,move:ot,newFile:()=>{Te(".",h)},openProject:()=>{nt("project.open",void 0,"Files")},refresh:()=>{Ze()},rowHost:it,search:(e)=>{_n().searchQuery=e,h()},select:Pe,toggleIgnored:()=>{VP(!LT()),h()},treeHost:st,typeahead:at},v=null,b=null;function ZP(e,t){let o=e.querySelector(".panel-content")??e;if(we=t,v&&(v.host!==o||!v.handle.connected()))XP();let r=Xe();if(v)v.handle.update(r);else{let a=me(o,r,Pt);v={handle:a,host:o},a.ready.then(ee)}queueMicrotask(ee)}function XP(){Ee(),v?.handle.dispose(),v=null,b=null,ke(),j.clear(),f=[]}
|
|
4
|
+
export{Lb,$S,IS,RN,DN,Nw,Aw,RS,NN,AN,$b,rl,Em,TT,LT,VP,$T,IT,RT,DS,UP,Ib,DT,qP,GP,NT,ON,KP,JP,Ow,NS,AS,Mw,Tm,YP,Pw,OS,_i,MS,AT,OT,Lm,MT,ZP,XP};
|
|
5
|
+
|
|
6
|
+
//# debugId=4B109BA3243CC5AB64756E2164756E21
|
|
7
|
+
//# sourceMappingURL=studio-a88ej93p.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
var n;function
|
|
2
|
-
export{
|
|
1
|
+
var n;function w2(e){n=new URL("./",e).href}function k0(e){if(n===void 0)throw Error(`bundleUrl(${JSON.stringify(e)}) before setBundleBase(). An entry module (src/studio.ts or src/canvas/iframe-entry.ts) must call setBundleBase(import.meta.url) first; a test needs tests/with-dom.ts, which sets one.`);return new URL(e,n).href}
|
|
2
|
+
export{w2,k0};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=8300D7D8CE386E7764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-abh9kfdh.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{p,ye}from"./studio-4fnb5648.js";import{r2,s2}from"./studio-nvcn2ykc.js";import{gh,WO,Vp}from"./studio-hh394phe.js";import{ln,xv,_v,h}from"./studio-knsjyx7n.js";import{C}from"./studio-4f7thq0p.js";function fh(){let t=ye()?p().canvasUrl:void 0;if(t)return new URL(t,location.href).origin;return location.origin}function dv(){let t=ye()?p().canvasUrl:void 0;if(!t)return null;let e=new URL(t,location.href);return e.origin===location.origin?e.searchParams.get("rpcToken"):null}function Gd(t){let e=fh(),n=ye()?p().documentBaseUrl:void 0;if(n){let o=n.endsWith("/")?n:`${n}/`;return new URL(o,`${e}/`).href}let r=t||"";return`${e}/${r?`${r}/`:""}`}function GC(t){if(t.startsWith("data:")||t.startsWith("blob:")||t.startsWith("http")||t.startsWith("views://"))return t;let e=fh();if((e.startsWith("http:")||e.startsWith("https:"))&&e!==location.origin)return`${e}/${t.replace(/^\.?\//,"")}`;return t}function rI(){return ln(C?.projectConfig??{}).i18n?.locales??[]}function uv(t,e){let n=e?.space??"site",r=xv(t,C?.projectConfig?.content,rI());if(n==="site"&&!r&&!WO())return null;let o={documentDir:s2(t??""),lanes:r2,mounts:r?[r]:[],space:n};if(e?.fileBaseUrl!==void 0)o.fileBaseUrl=e.fileBaseUrl;return o}function Xc(t){return hv(t,h.value?.documentPath)}function hv(t,e){if(!t)return t;let n=uv(e,mh()),r=n&&{...n,revisions:Vp(),versions:gh()};return GC(_v(t,r)??t)}function mh(){let t={fileBaseUrl:Gd(C?.projectRoot)};if(ye())t.space=p().assetSpace;return t}
|
|
2
|
+
export{fh,dv,Gd,GC,rI,uv,Xc,hv,mh};
|
|
3
|
+
|
|
4
|
+
//# debugId=E011107A989B159B64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-acer0g8w.js.map
|