@jxsuite/studio 10.2.0 → 10.3.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-3tkn72ey.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-1vzxq1ba.js +4 -0
- package/dist/chunks/convert-to-repeater-gwzh9gar.js +4 -0
- package/dist/chunks/editor-wvf5e6j9.js +4 -0
- package/dist/chunks/entry-commands-mx2whrjx.js +4 -0
- package/dist/chunks/extension-sections-338ee35t.js +4 -0
- package/dist/chunks/file-ops-9bxvk59j.js +4 -0
- package/dist/chunks/files-t07yqqej.js +4 -0
- package/dist/chunks/format-host-5ja5gxyk.js +4 -0
- package/dist/chunks/fs-events-3424ezp3.js +4 -0
- package/dist/chunks/grid-open-1mpq9mzb.js +4 -0
- package/dist/chunks/{grid-view-tghcwrrt.js → grid-view-w9nfy203.js} +16 -16
- package/dist/chunks/icons-gb967qc8.js +4 -0
- package/dist/chunks/iframe-host-wsg0bn73.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-ttr5ewf0.js +4 -0
- package/dist/chunks/layers-m49nmwvx.js +4 -0
- package/dist/chunks/layers-panel-hvy2e549.js +4 -0
- package/dist/chunks/lit-html-k2mb9k0r.js +4 -0
- package/dist/chunks/media-library-ae67q4at.js +4 -0
- package/dist/chunks/media-open-yp9jm834.js +4 -0
- package/dist/chunks/media-picker-s41ngdfr.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-g9kterhx.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-gzfxcm0t.js +4 -0
- package/dist/chunks/publish-quick-w3nxd7q4.js +4 -0
- package/dist/chunks/publish-workspace-dppd82tc.js +4 -0
- package/dist/chunks/quick-search-tdxaam55.js +4 -0
- package/dist/chunks/references-vqyr5s9x.js +4 -0
- package/dist/chunks/right-panel-0yrw4cgz.js +4 -0
- package/dist/chunks/source-control-6fk72me2.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-0w3541dg.js +7 -0
- package/dist/chunks/{studio-9b7177jq.js → studio-0x6f3nk9.js} +4 -4
- package/dist/chunks/studio-1410q5dw.js +5 -0
- package/dist/chunks/{studio-awxwjawq.js → studio-15hwqgd8.js} +4 -4
- package/dist/chunks/studio-1ks5d9y4.js +5 -0
- package/dist/chunks/{studio-881z1xrx.js → studio-2ggfzrrd.js} +4 -4
- package/dist/chunks/{studio-4jhw38b2.js → studio-321ym1tt.js} +4 -4
- package/dist/chunks/studio-3c10v2q1.js +5 -0
- package/dist/chunks/{studio-bvs9kpst.js → studio-3na1r48j.js} +8 -8
- package/dist/chunks/{studio-86r8hp7r.js → studio-3q7mhbgx.js} +5 -5
- package/dist/chunks/studio-3qr08sxq.js +4 -0
- package/dist/chunks/studio-3xk9zdgb.js +5 -0
- package/dist/chunks/{studio-qh8berdz.js → studio-423tfdte.js} +4 -4
- package/dist/chunks/{studio-75kcdbsk.js → studio-45mj4jqe.js} +4 -4
- 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-53wy9ek3.js +5 -0
- package/dist/chunks/studio-5n193zqd.js +5 -0
- package/dist/chunks/{studio-9rbe2xpw.js → studio-5tet77de.js} +3 -3
- package/dist/chunks/{studio-ybnwymxw.js → studio-7rrdbvex.js} +4 -4
- package/dist/chunks/studio-8kx6m0rg.js +5 -0
- 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-cg1bfyhf.js → studio-9qx1ywbv.js} +8 -8
- package/dist/chunks/studio-a65kbs2e.js +9 -0
- package/dist/chunks/studio-aam8zt8z.js +5 -0
- package/dist/chunks/{studio-er5f383a.js → studio-abh9kfdh.js} +4 -4
- package/dist/chunks/studio-b4e0ftkt.js +5 -0
- package/dist/chunks/studio-b68k0z00.js +5 -0
- package/dist/chunks/{studio-399a25za.js → studio-bct64zmj.js} +4 -4
- package/dist/chunks/studio-bz0b5brj.js +6 -0
- package/dist/chunks/studio-cfnn70h1.js +5 -0
- package/dist/chunks/studio-daksw8kh.js +5 -0
- package/dist/chunks/{studio-r7pf0rkv.js → studio-e7vjyp04.js} +7 -7
- package/dist/chunks/studio-ea6r1zyr.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-f8tyeyzt.js +5 -0
- package/dist/chunks/studio-fj6c905s.js +5 -0
- package/dist/chunks/{studio-646nn2ys.js → studio-fkrr7kgg.js} +5 -5
- package/dist/chunks/studio-fspe7m9t.js +5 -0
- package/dist/chunks/studio-g0hxtcga.js +5 -0
- package/dist/chunks/{studio-th7z3fg7.js → studio-g9brbewz.js} +4 -4
- package/dist/chunks/studio-ggx3j7nd.js +5 -0
- package/dist/chunks/{studio-43y04qck.js → studio-hfxttkyr.js} +4 -4
- package/dist/chunks/studio-hh394phe.js +5 -0
- package/dist/chunks/{studio-pjtntksy.js → studio-j0zf5x2x.js} +4 -4
- package/dist/chunks/studio-jeb7hth3.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-sevbc3xv.js → studio-n9qba0gx.js} +4 -4
- package/dist/chunks/{studio-6hzdjfv0.js → studio-nf8esxxc.js} +4 -4
- package/dist/chunks/studio-nn4f9m9c.js +5 -0
- package/dist/chunks/studio-nskxe9q1.js +6 -0
- package/dist/chunks/{studio-ea74s8c1.js → studio-nvcn2ykc.js} +4 -4
- package/dist/chunks/studio-nwynxqtb.js +5 -0
- package/dist/chunks/studio-nzemfbkk.js +14 -0
- package/dist/chunks/studio-p2a03pgm.js +5 -0
- package/dist/chunks/{studio-4g8yb6jn.js → studio-pm17wdc4.js} +4 -4
- package/dist/chunks/{studio-71m92v9s.js → studio-q80fg1d6.js} +7 -7
- package/dist/chunks/studio-r050sez0.js +6 -0
- package/dist/chunks/studio-s7t4vp1d.js +6 -0
- package/dist/chunks/studio-s9fng7m8.js +7 -0
- package/dist/chunks/studio-sce30r7b.js +4 -0
- package/dist/chunks/studio-stahswgb.js +7 -0
- package/dist/chunks/studio-swedpd82.js +5 -0
- package/dist/chunks/studio-thz5t120.js +5 -0
- package/dist/chunks/studio-tpxcryf2.js +5 -0
- package/dist/chunks/{studio-wc6za3zs.js → studio-v5wktj6f.js} +4 -4
- package/dist/chunks/{studio-kg1abnz0.js → studio-vpevkfxw.js} +4 -4
- package/dist/chunks/studio-waekn290.js +5 -0
- package/dist/chunks/studio-wfct4h6n.js +5 -0
- package/dist/chunks/studio-wgc54sxf.js +5 -0
- package/dist/chunks/studio-wqfaqw4m.js +5 -0
- package/dist/chunks/studio-wse1rs8t.js +7 -0
- package/dist/chunks/studio-x0gsfr1d.js +16 -0
- package/dist/chunks/{studio-hhp4x8xf.js → studio-xpx91fby.js} +5 -5
- package/dist/chunks/studio-y1b86ast.js +5 -0
- package/dist/chunks/studio-yrcrncev.js +5 -0
- package/dist/chunks/{studio-rzqaz21g.js → studio-yzpskb0j.js} +4 -4
- package/dist/chunks/studio-zfdbmhp3.js +5 -0
- package/dist/chunks/{tsMode-f54j66ym.js → tsMode-jg1dtphj.js} +7 -7
- package/dist/chunks/workspace-9btkc8tk.js +4 -0
- package/dist/chunks/workspace-home-qcc4z5ag.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 +2 -2
- 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/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
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{ft}from"./studio-9rbe2xpw.js";import{Q}from"./studio-nqxqf8p2.js";import{ae}from"./studio-b2qpt0xy.js";import{L,R,En,nt,ei}from"./studio-0w2dr0q8.js";import{g,ar,C}from"./studio-y60sts62.js";import{af,p,_e}from"./studio-jws1a87n.js";import{Ft,$h,tc,Qd,Ma,sf,fn,fl}from"./studio-hz5n7x27.js";import{Sr}from"./studio-mx6wzh25.js";import{us,Pm}from"./studio-t98vq4r6.js";import{Wt,ln,go,jm,cv,Vd,Un,fi,m,Na,Ql,ec,_i,J$,Pt,mv,Hx}from"./studio-k2sz13zg.js";import{zp,aO,lO,La}from"./studio-399a25za.js";import{rt,Eo,xr}from"./studio-th7z3fg7.js";import{Es,rA,YL,dA,ax,lx}from"./studio-2r90cts3.js";import{il}from"./studio-0q5jwddh.js";import{Xn}from"./studio-86r8hp7r.js";import{xa}from"./studio-sevbc3xv.js";import{Dp}from"./studio-8wnvtr4z.js";import{zr,Gs,Ks,Wr}from"./studio-sxdb9h3q.js";import{yw,bm,vm,xb}from"./studio-zwaxn5s2.js";import{Vc,Sa}from"./studio-f746039f.js";import{eT,oS}from"./studio-05jfwbmf.js";import{oN,jr,Cb,kb}from"./studio-qyed0ah6.js";import{Nw,xm}from"./studio-wxq6v5sv.js";import{Bt}from"./studio-r4bcdwhq.js";import{mw,gw,bw}from"./studio-mxs3ar9t.js";import{Dc}from"./studio-2ejhqns4.js";import{tS,ZE,XE,gb}from"./studio-kg5ya5r2.js";import{Ws}from"./studio-pjtntksy.js";import{S,ed,wn}from"./studio-cg710sk9.js";import{n,_}from"./studio-8z66jk4z.js";import{le}from"./studio-j3d2fjqz.js";async function pb(){if(yw(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=il({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 O(e){return e.replaceAll("\\","/").replace(/^\.\//,"")}function Ae(e){let t=O(e).toLowerCase();for(let[o,r]of Object.entries(Me))if(t.startsWith(`${o}/`))return r;return null}function Y(e){return Le.some((t)=>e.includes(t))}function He(e){let t=S?.projectConfig?.layout;if(!n(t))return!1;return O(t).toLowerCase()===O(e).toLowerCase()}function K_(e){let t=[{ext:".json",label:"JSON (.json)"}];for(let o of fl(e)){let r=Ma(o,"parse");if(r&&Ma(o,"serialize"))t.push({ext:o,label:`${r.name} (${o})`})}return t}function ie(){return new Set([".json",...Qd().flatMap((e)=>e.extensions)])}function J_(e){if(e===null||e===void 0||e==="")return[];let t=Ae(e);if(t===null||He(e)||Un(e))return[];let o=fn(e);if(!(o?Boolean(o.capabilities.parse)&&Y(o.documentKinds):O(e).toLowerCase().endsWith(".json")))return[];let a=[];if(o)a.push({ext:".json",label:"JSON (.json)"});for(let i of fl()){let s=Ma(i,"serialize");if(!s||s.name===o?.name||!Y(s.documentKinds)||!s.documentKinds.includes(t))continue;a.push({ext:i,label:`${s.name} (${i})`})}return a}function MD(){let e=new Set([".json"]);for(let t of Qd()){if(!t.capabilities.serialize||!Y(t.documentKinds))continue;for(let o of t.extensions)e.add(o)}return[...e].toSorted()}var X="jx-studio-recent-projects",ce="jx-studio-recent-files",se=8,We=10,E=[];function M(){if(!_e())return null;let e=p();return ze(e)?e:null}function ze(e){return Boolean(e.getRecentProjects&&e.saveRecentProjects)}function Ve(){try{let e=localStorage.getItem(X);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function Z(){return M()?E:Ve()}function de(e){E=e;let t=M();if(t)t.saveRecentProjects(e);else try{localStorage.setItem(X,JSON.stringify(e))}catch{}}async function PD(){let e=M();if(!e)return;try{E=await e.getRecentProjects()}catch{E=[]}}function hw(){return Z().toSorted((e,t)=>t.timestamp-e.timestamp)}function pw(e,t){let o=Z().filter((r)=>r.root!==t);if(o.unshift({name:e,root:t,timestamp:ar()}),o.length>se)o.length=se;de(o)}function Y_(e){de(Z().filter((t)=>t.root!==e))}function FD(){E=[];let e=M();if(e)e.saveRecentProjects([]);else localStorage.removeItem(X)}function pe(){try{let e=localStorage.getItem(ce);if(!e)return[];let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function jD(e){let t=pe().toSorted((o,r)=>r.timestamp-o.timestamp);return e==null?t:t.filter((o)=>o.root===e)}function fb(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(ce,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…"}}}}]}]}}}]};L("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 qe(e){let t=n(e)?void 0:e.attributes?.part;return n(t)?t:""}function Be(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,u,d)=>{if(i||!(l instanceof HTMLElement))return;let b=qe(u);if(b==="tree"){o.treeHost(l);return}if(b!=="row")return;let v=Be(d);if(v)o.rowHost(l,v.path,v.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 zs(e){if(!S)return;try{let t=p(),[o]=await Promise.all([us(()=>t.listDirectory(e)),aO(e)]);S.dirs.set(e,o)}catch{S.dirs.set(e,[])}}var he=new Set(["pages","layouts","components","content","data","public","styles"]);async function mm(){if(!S)return;await zs(".");let e=[];for(let t of S.dirs.get(".")??[])if(t.type==="directory"&&he.has(t.name))e.push(t.name),S.expanded.add(t.path||t.name),await zs(t.path||t.name);S.projectDirs=e}async function FE(e){let t=new Set(S?.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 mm(),!0}function jE(){return Eo(rt.showIgnoredFiles)==="true"}function M2(e){xr(rt.showIgnoredFiles,e?"true":"")}async function HE(){try{let e=p(),t=await e.probeRootProject();if(!t)return;let{meta:o,info:r}=t;if($h(),Ft(),tc(e),zp(),Pm(),ed({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)ec(o.root||".",r.projectConfig||null);if(r.isSiteProject){if(pw(wn().name,o.root),await vm(),await pb())$h(),await Ft(),tc(e);await mm(),await xa(),await mb(),bm(o.root)}}catch{}}async function BE({renderLeftPanel:e,resetProjectCaches:t}){try{let o=p(),r=await o.openProject?.();if(!r)return!1;let{config:a,handle:i}=r;if(J$({document:{children:[],tagName:"div"},id:"initial"}),oN(),$h(),Ft(),tc(o),zp(),Pm(),ed({...S,dirs:new Map,expanded:new Set,isSiteProject:!0,name:a.name||i.name,projectConfig:a,projectRoot:i.root,searchQuery:"",selectedPath:null}),ec(i.root,a),await vm(),await pb())$h(),await Ft(),tc(o);return await mm(),await xa(),xb(),lx(),t?.(),pw(wn().name,wn().projectRoot),e(),await mb(),bm(wn().projectRoot),!0}catch(o){return C.error("Could not open the project.",{detail:Q(o),source:"Open Project"}),!1}}async function zE(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(),C.success("Initialized a git repository for this project."),!0}catch(o){return C.warn("Could not initialize a git repository — the project itself was written.",{detail:Q(o),source:"Source Control"}),!1}}async function Z_(){await Ft();let e=[...fl("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 P2(){let e=await Z_();if(e)await xi(e)}async function mb(){let e=dA(m.projectRoot),t=YL(m.projectRoot),o=await Ue(e);return ge?.(t),o}var ge=null;function WE(e){ge=e}async function Ue(e){if(ax(m.projectRoot),e){if(await rA(e,{ensureSecondPane:()=>{Ql(fi)},openFile:(o,r)=>xi(o,{focus:!1,paneId:r})})>0)return!0}return await P2(),!1}function Ge(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&&Dp(r)?"image":"file"}}var F2=24,f=[],k=null,F=new Map,z=null,we=null;function ne(){for(let e of F.values())if(e.isConnected&&e.offsetHeight>0)return e.offsetHeight;return F2}function Ke(){for(let[e,t]of F)if(!t.isConnected)F.delete(e),$e(t)}function ve(e){let t=F.get(e);return t?.isConnected===!0?t:null}function U(e){return f.find((t)=>!t.loading&&t.path===e)}function ye(e,t,o,r){let a=wn().dirs.get(e);if(!a){zs(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((u,d)=>{if(u.type==="directory"&&d.type!=="directory")return-1;if(u.type!=="directory"&&d.type==="directory")return 1;return u.name.localeCompare(d.name)}),s=jE()?i:i.filter((u)=>!lO(e,u.path,u.type==="directory")),l=wn().searchQuery.toLowerCase(),c=l?s.filter((u)=>u.type==="directory"||u.name.toLowerCase().includes(l)):s;for(let[u,d]of c.entries()){let v=d.type==="directory"&&wn().expanded.has(d.path);if(o.push({depth:t,expanded:v,key:d.path,loading:!1,name:d.name,path:d.path,locale:go(d.path,r)??void 0,posInSet:u+1,setSize:c.length,type:d.type}),v)ye(d.path,t+1,o,r)}}function be(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 Ye(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 Qe(){if(k?.isConnected!==!0||j!=="")return;queueMicrotask(h)}function te(){let e=k;if(e===null)return;z=bw(z,e,{count:()=>f.length,onChange:Qe,rowHeight:ne})}function Xe(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:Ge(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 Ze(){if(Ke(),!S){f=[];let l={...A(),view:"none"};return y=l,l}if(!S.isSiteProject&&S.projectRoot==="."){f=[];let l=af(p())?"welcome":"address",c={...A(),view:l};return y=c,c}let e=wn();f=[];let{i18n:t}=ln(e.projectConfig??{});ye(".",0,f,t);let o=mw(k,{count:f.length,rowHeight:ne()}),r=f.slice(o.start,o.end),a=(e.selectedPath!==null&&U(e.selectedPath)?e.selectedPath:"")||r.find((l)=>!l.loading)?.path||"",i=jE(),s={currentPath:a,dragPath:j,dropPath:D,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:G,rows:r.map((l)=>Xe(l)),selectedPath:e.selectedPath??"",view:"tree"};return y=s,s}function oe(){if(!w||!y)return;y={...y,dragPath:j,dropPath:D,rootDrop:G},w.handle.update(y)}function h(){we?.()}async function et(){let e=wn();e.dirs.clear(),zp(),await zs(".");for(let t of e.expanded)await zs(t);h()}function tt(e){let t=U(e);if(!t)return;if(t.type==="directory"){Fe(e).then(()=>h());return}xi(e)}function ot(e,t){let o=wn();if(U(e)?.type!=="directory"||o.expanded.has(e)===t)return;if(!t){o.expanded.delete(e),h();return}Fe(e).then(()=>h())}function xe(e){if(!S||wn().selectedPath===e)return;wn().selectedPath=e,h()}function at(e,t){let o=be(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=Ye(o);break}case"ArrowDown":case"ArrowRight":{r=H(o,1);break}default:return}Pe(r)}function it(e,t){let o=be(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)){Pe(i);return}}}function Pe(e){let t=f[e];if(!t)return;if(xe(t.path),ve(t.path))return;gw(k,e,ne()),h()}async function Fe(e){let t=wn();if(t.expanded.has(e)){t.expanded.delete(e);return}if(t.expanded.add(e),!t.dirs.has(e))await zs(e)}var N=new Map,V=null,j="",J="",D="",q=!1,G="";function j2(e){return[...e.dataTransfer?.types??[]].includes("Files")}function je(e,t,o){let r=(s)=>{if(!j2(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(),HD(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 VE(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 B(o)!==r}function ee(e,t,o){let r=e.data.path;return o==="directory"&&n(r)&&VE(r,t)}function P(e,t){let o=t?e:"";if(J===e&&D===o)return;J=e,D=o,Se()}function W(e){if(q===e)return;q=e,Se()}function Se(){G=q&&J===""?"true":"",oe()}async function HD(e,t,o){if((await Sa([...e],{dir:t})).length===0)return;if(t!==".")wn().expanded.add(t);o()}function H2(e,t){let o=document.createElement("input");o.type="file",o.multiple=!0,o.accept=Vc(),o.addEventListener("change",()=>{if(o.files?.length)HD(o.files,e,t)}),o.click()}function st(e,t,o){$e(e),F.set(t,e);let r=[Wr({element:e,getInitialData(){return{entryType:o,path:t,type:"file-tree"}},onDragStart(){j=t,oe()},onDrop(){j="",P("",!1),oe()}}),je(e,o==="directory"?t:B(t),(a)=>{P(a?t:"",a)}),Gs({canDrop({source:a}){return a.data.type==="file-tree"},element:e,getData({source:a}){return ee(a,t,o)?{targetDir:t,type:"file-tree-target"}:{type:"file-tree-refused"}},onDrag({source:a}){P(t,ee(a,t,o))},onDragEnter({source:a}){P(t,ee(a,t,o))},onDragLeave(){P("",!1)},onDrop(){P("",!1)}})];N.set(e,zr(...r))}function $e(e){let t=N.get(e);if(t)t(),N.delete(e)}function lt(e){if(V?.element===e)return;Re(),k=e;let t=Gs({canDrop({source:r}){let a=r.data.path;return r.data.type==="file-tree"&&n(a)&&VE(a,".")},element:e,getData(){return{targetDir:".",type:"file-tree-target"}},onDragEnter(){W(!0)},onDragLeave(){W(!1)},onDrop(){W(!1)}}),o=Ks({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)||!VE(s,l))return;let c=s.split("/").pop(),u=l==="."?c:`${l}/${c}`;ct(s,u,h)}});V={cleanup:zr(t,o,je(e,".",W)),element:e},te()}function Re(){V?.cleanup(),V=null;for(let e of N.values())e();N.clear(),z?.window.destroy(),z=null,k=null,j="",J="",D="",q=!1,G=""}async function ct(e,t,o){let r=p();La(e,t);try{let a=await r.renameFile(e,t);Sr();for(let[l]of m.tabs.entries())if(l===e)Hx(e,t,t);else if(l.startsWith(`${e}/`)){let c=t+l.slice(e.length);Hx(l,c,c)}let i=B(e),s=B(t);if(await zs(i),s!==i)await zs(s);if(s!==".")wn().expanded.add(s);Te(a,t),o(),BD(`Moved to ${t}`,a,t)}catch(a){C.error(`Could not move ${e}.`,{detail:Q(a),path:e,source:"Files"})}}function B(e){let t=e.replaceAll("\\","/"),o=t.lastIndexOf("/");return o===-1?".":t.slice(0,o)}var T=null;function ke(){T?.close(),T=null}function dt(e){let t={};if(e.type==="directory"){let o=Vd(e.path);if(o?.isSourceRoot===!0&&!o.fileBacked)t.name=o.name;return t}if(t.file=e.path,Dc(e.path))t.path=e.path;if(J_(e.path).length>0)t.source=e.path;return t}function x(e,t,o,r={}){return{destructive:!1,disabled:!1,dividerAbove:!1,id:e,run:o,title:t,...r}}function pt(e){let t=ae();if(!t)return[];let o=dt(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?x(a.id,a.title,()=>{En(t,a.id,s,"Files")}):{destructive:!1,disabled:!0,dividerAbove:!1,id:a.id,requires:l,title:a.title})}return r}function ut(e){let t=e.type==="directory",o=[];if(t){if(o.push(x("files.newFile","New File…",()=>{Ee(e.path,h)}),x("files.upload","Upload Files…",()=>{H2(e.path,h)})),e.path==="pages"||e.path.endsWith("/pages"))o.push(x("files.pagesGrid","Edit Pages in Grid",()=>{oS()}))}else o.push(x("files.open","Open",()=>{xi(e.path)}));return o.push(...pt(e),x("files.rename","Rename…",()=>{bt(e,h)},{dividerAbove:!0}),x("files.delete","Delete",()=>{xt(e,h)},{destructive:!0})),o}function mt(e,t,o){let r=U(e);if(!r)return;ke();let a=ve(e);T=Bt({label:"File actions",onClosed:(i)=>{if(T===i)T=null},opener:a,origin:{x:t,y:o},region:"files",rows:ut({name:r.name,path:r.path,type:r.type})})}var ht=JSON.stringify({children:[{children:[],tagName:"p"}],tagName:"div"},null,2);function gt(e){return[...(e.kind==="locked"?[{ext:e.ext,label:`${Ma(e.ext)?.name??e.ext} (${e.ext})`}]:K_(e.docKind)).map((o)=>({label:o.label,value:o.ext})),{dividerBefore:!0,label:"Other…",value:tS}]}function wt(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=ZE(o);if(a!==""&&t.some((i)=>i.value===a))return a;return t[0]?.value??tS}async function B2(e){let{dir:t,format:o,source:r="Files"}=e;await Ft();let a=await fw(t),i=o!==void 0&&o.kind!=="fixed"?o:null,s=i===null?null:gt(i),l=i===null||s===null?"":wt(i,s,e.suggestedName??""),c={choice:o,dir:t,known:ie(),rows:s,taken:a},u=(K,Oe)=>gb(K,Oe,c),d=l,b={confirmLabel:"Create",message:t==="."?"Creating in the project root.":`Creating in ${t}/`,select:s===null?"stem":"all",validate:u,value:e.suggestedName??"untitled.json"};if(s!==null)b.choice={initial:l,label:"Format",onChange:(K)=>{d=K},options:()=>s};if(e.suggestedName!==void 0)b.placeholder=e.suggestedName;let v=await ei(e.title??"New File",b);if(!v)return null;let I=XE(v,d,o),Ne=t==="."?I:`${t}/${I}`,re=fn(I),De=e.content,Ie=o!==void 0&&d!==tS,Ce=De??re?.studio?.newFileTemplate??(re?"":I.toLowerCase().endsWith(".json")?Ie?ht:`{}
|
|
2
|
-
`:"");return X_(Ne,Ce,{dir:t,source:r})}async function fw(e){try{let t=await p().listDirectory(e);return new Set(t.map((o)=>o.name.toLowerCase()))}catch{return new Set}}async function X_(e,t,o={}){let r=o.dir??(e.includes("/")?e.slice(0,e.lastIndexOf("/")):".");La(e);try{if(await p().writeFile(e,t),await zs(r),o.quiet!==!0)C.success(`Created ${e}`);return e}catch(a){return C.error(`Could not create ${e}.`,{detail:Q(a),path:e,source:o.source??"Files"}),null}}async function Ee(e,t){await Ft();let o=Vd(e);if(o?.unresolvedFormat!=null)C.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 (le("kmt02crp"),import("./entry-commands-kmt02crp.js"));i=await s(o.name,{dir:e})}else i=await B2({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 vt(e,t){let o=await kb(t),r={confirmLabel:"Rename",select:"stem",validate:(a)=>a.trim()?"":"Enter a file name.",value:e};if(o!==void 0)r.message=o;return ei("Rename",r)}function yt(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 BD(e,t,o){let r=t.errors??[];if(r.length===0){C.success(e);return}let a=r.length===1?"1 file":`${r.length} files`;C.warn(`${e} — references in ${a} could not be updated`,{detail:r.map((i)=>`${i.path}: ${i.error}`).join(`
|
|
3
|
-
`),path:o,source:"Files"})}function Te(e,t){for(let o of e.references?.files??[])if(o.path!==t&&m.tabs.has(o.path))gm(o.path)}function UE(e){let t=e.replaceAll("\\","/");return t.includes("/")?t.slice(0,t.lastIndexOf("/")):"."}async function z2(e,t,o){Sr();let r=UE(e),a=UE(t);if(await zs(r),a!==r)await zs(a);if(wn().selectedPath===e)wn().selectedPath=t;Te(o,t)}async function bt(e,t){let o=await vt(e.name,e.path);if(!o||o===e.name)return;let r=UE(e.path),a=r==="."?o:`${r}/${o}`;La(e.path,a);try{let s=await p().renameFile(e.path,a);if(m.tabs.has(e.path))Hx(e.path,a,a);await z2(e.path,a,s),t(),BD(yt(o,s),s,a)}catch(i){C.error(`Could not rename ${e.name}.`,{detail:Q(i),path:e.path,source:"Files"})}}async function xt(e,t){if(!await Cb(e))return;try{let r=p();La(e.path),await r.deleteFile(e.path),Sr();let a=e.path.replaceAll("\\","/"),i=a.includes("/")?a.slice(0,a.lastIndexOf("/")):".";if(await zs(i),wn().selectedPath===e.path)wn().selectedPath=null;t(),C.success(`Deleted ${e.name}`)}catch(r){C.error(`Could not delete ${e.name}.`,{detail:Q(r),path:e.path,source:"Files"})}}function jt(e,t){let o=t.paneId,r=Na(e);if(o!==void 0&&r){if(r.activeTabId===e&&t.focus===!1)return;mv(e,o)}Pt(e,{focus:t.focus!==!1})}async function xi(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(jt(a,t),o)wn().selectedPath=e;return}if(Nw(e)){if(xm(e,t),o)wn().selectedPath=e;fb({name:e.split("/").pop()||e,path:e,root:wn().projectRoot});return}if(e.toLowerCase().endsWith(".csv")){try{if(await eT(e,t),o)wn().selectedPath=e;fb({name:e.split("/").pop()||e,path:e,root:wn().projectRoot})}catch(a){C.error(`Could not open ${e}.`,{detail:Q(a),path:e,source:"Open File"})}return}let r=p();try{let a=await r.readFile(e);if(!a){if(await Ft(),!fn(e)&&!e.toLowerCase().endsWith(".json"))throw sf(e);return}await Ft();let i,s,l=null,c=fn(e);if(c){let d=await jr(e,a);({document:i}=d),{frontmatter:s}=d}else if(e.endsWith(".json"))({document:i,layout:l}=Es(a));else throw sf(e);if(_i({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)wn().selectedPath=e;fb({name:e.split("/").pop()||e,path:e,root:wn().projectRoot})}catch(a){C.error(`Could not open ${e}.`,{detail:Q(a),path:e,source:"Open File"})}}async function Q_(e,t){await xi(t,{focus:!1,paneId:e,preview:!0})}function qE(e){if(cv(e))return;for(let[,t]of m.tabs.entries())if(t.documentPath===e&&!t.doc.dirty){gm(e);return}}function GE(e){for(let t of e)gm(t,{onlyIfChanged:!0})}async function gm(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||cv(e);try{let s=await r.readFile(e);if(!s)return;if(await Ft(),i())return;if(fn(e)){let{document:l,frontmatter:c}=await jr(e,s);if(i())return;if(t.onlyIfChanged&&Ws(l,o.doc.document)&&Ws(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=jm(c),t.onlyIfChanged&&Ws(c,o.doc.document))return;o.doc.document=c}o.doc.dirty=!1}catch(s){C.error(`Could not reload ${e} after it changed on disk.`,{detail:Q(s),key:`reload:${e}`,path:e,source:"Files"})}return}}function KE(){Xn({id:"files",title:"Files",level:"project",dock:"navigator",icon:"folder",rail:"developer",render:()=>ft,afterRender:(e,t)=>{W2(t,e.rerender)}})}var St={activate:tt,contextMenu:mt,expand:ot,move:at,newFile:()=>{Ee(".",h)},openProject:()=>{nt("project.open",void 0,"Files")},refresh:()=>{et()},rowHost:st,search:(e)=>{wn().searchQuery=e,h()},select:xe,toggleIgnored:()=>{M2(!jE()),h()},treeHost:lt,typeahead:it},w=null,y=null;function W2(e,t){let o=e.querySelector(".panel-content")??e;if(we=t,w&&(w.host!==o||!w.handle.connected()))V2();let r=Ze();if(w)w.handle.update(r);else{let a=me(o,r,St);w={handle:a,host:o},a.ready.then(te)}queueMicrotask(te)}function V2(){ke(),w?.handle.dispose(),w=null,y=null,Re(),F.clear(),f=[]}
|
|
4
|
-
export{pb,K_,J_,MD,PD,hw,pw,Y_,FD,jD,fb,zs,mm,FE,jE,M2,HE,BE,zE,Z_,P2,mb,WE,F2,j2,VE,HD,H2,B2,fw,X_,BD,UE,z2,xi,Q_,qE,GE,gm,KE,W2,V2};
|
|
5
|
-
|
|
6
|
-
//# debugId=4E7E7D34CE9A8F6C64756E2164756E21
|
|
7
|
-
//# sourceMappingURL=studio-c71806xz.js.map
|