@jxsuite/studio 6.0.0 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{2020-cs2sb9t1.js → 2020-nkxms0ay.js} +3 -3
- package/dist/chunks/adapter-m948ab5f.js +4 -0
- package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-n8hr38v7.js} +3 -3
- package/dist/chunks/cf-settings-356xdtne.js +4 -0
- package/dist/chunks/components-yk3t844e.js +4 -0
- package/dist/chunks/content-source-bawmyc09.js +4 -0
- package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-7wns8kf1.js} +3 -3
- package/dist/chunks/editor-6sc8nacq.js +4 -0
- package/dist/chunks/entry-commands-8ay9fh81.js +4 -0
- package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-na7rj3nr.js} +3 -3
- package/dist/chunks/file-ops-gye0qw56.js +4 -0
- package/dist/chunks/files-dmc2xvcq.js +4 -0
- package/dist/chunks/format-host-t76b53f8.js +4 -0
- package/dist/chunks/fs-events-cg4tpz06.js +4 -0
- package/dist/chunks/git-panel-yef7bshy.js +4 -0
- package/dist/chunks/{grid-view-ca10def6.js → grid-view-7tt4bxw1.js} +6 -6
- package/dist/chunks/iframe-host-tmz30gfp.js +4 -0
- package/dist/chunks/{index-9ydfe04y.js → index-gybvv7a6.js} +3 -3
- package/dist/chunks/index-nag78a9h.js +4 -0
- package/dist/chunks/{javascript-d9pqgc2p.js → javascript-rnvdp3k4.js} +2 -2
- package/dist/chunks/{jsonMode-800yvbem.js → jsonMode-zhwsprqk.js} +5 -5
- package/dist/chunks/jx-validate-3gbp5nkn.js +4 -0
- package/dist/chunks/layers-fvz99859.js +4 -0
- package/dist/chunks/layers-panel-gchmbf9p.js +4 -0
- package/dist/chunks/lit-html-9agdspkt.js +4 -0
- package/dist/chunks/media-picker-rhjvyy00.js +4 -0
- package/dist/chunks/menu-2e4y9j7b.js +4 -0
- package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-2jnhjjvr.js} +3 -3
- package/dist/chunks/monaco-buffer-rp21359g.js +4 -0
- package/dist/chunks/{monaco-setup-tj13ndtm.js → monaco-setup-vhh7gayr.js} +3 -3
- package/dist/chunks/notify-h3www560.js +4 -0
- package/dist/chunks/platform-hz34wcd7.js +4 -0
- package/dist/chunks/publish-panel-exsmjzyj.js +4 -0
- package/dist/chunks/quick-search-pgaqeh0m.js +4 -0
- package/dist/chunks/references-2cgdxnb8.js +4 -0
- package/dist/chunks/right-panel-jf856w5w.js +4 -0
- package/dist/chunks/section-registry-jnf8r5gy.js +4 -0
- package/dist/chunks/studio-0f55h9ye.js +5 -0
- package/dist/chunks/{studio-hjbg8d5y.js → studio-0sqdhnew.js} +7 -7
- package/dist/chunks/{studio-1wvfxkyy.js → studio-0x3jyb8r.js} +4 -4
- package/dist/chunks/{studio-yr04mv2j.js → studio-19x1c75w.js} +4 -4
- package/dist/chunks/{studio-evwgp1ym.js → studio-2sqcndak.js} +4 -4
- package/dist/chunks/{studio-x5g1xk77.js → studio-3aey7dd3.js} +4 -4
- package/dist/chunks/{studio-xkfs0dp2.js → studio-3bpdkq2s.js} +4 -4
- package/dist/chunks/{studio-5gs9th4b.js → studio-47y6fbpf.js} +4 -4
- package/dist/chunks/{studio-e47215hh.js → studio-4m3826v2.js} +4 -4
- package/dist/chunks/studio-4nx2dj1g.js +4 -0
- package/dist/chunks/{studio-gjknvzam.js → studio-4xv5s47r.js} +5 -5
- package/dist/chunks/{studio-sxc0zvpt.js → studio-5g0ag7c0.js} +3 -3
- package/dist/chunks/{studio-semd1s8s.js → studio-5g4t8v6w.js} +4 -4
- package/dist/chunks/studio-5py436sf.js +5 -0
- package/dist/chunks/{studio-aje966s9.js → studio-77kt594t.js} +4 -4
- package/dist/chunks/{studio-3ck2a5c4.js → studio-8f87n763.js} +6 -6
- package/dist/chunks/studio-8mb00b84.js +5 -0
- package/dist/chunks/studio-8p51gq2h.js +6 -0
- package/dist/chunks/studio-954ds834.js +5 -0
- package/dist/chunks/{studio-capk0583.js → studio-9ft45c83.js} +6 -6
- package/dist/chunks/studio-a2138x5k.js +7 -0
- package/dist/chunks/studio-a9yzstqj.js +5 -0
- package/dist/chunks/{studio-gp02nqnw.js → studio-acdksxx6.js} +4 -4
- package/dist/chunks/{studio-edbtvcd1.js → studio-anyrgzvb.js} +4 -4
- package/dist/chunks/{studio-4r0sjtx8.js → studio-ar8jcf2y.js} +4 -4
- package/dist/chunks/{studio-rmn2dz59.js → studio-bmn4mn9j.js} +5 -5
- package/dist/chunks/{studio-03wwfvyt.js → studio-cpxkgjrj.js} +4 -4
- package/dist/chunks/{studio-7qvs7v0m.js → studio-e7xxa0sj.js} +4 -4
- package/dist/chunks/{studio-01qza1n3.js → studio-ecaz25vk.js} +4 -4
- package/dist/chunks/{studio-5e9zsamh.js → studio-fzdywr6p.js} +6 -6
- package/dist/chunks/{studio-xg1942as.js → studio-g5fmf0c1.js} +4 -4
- package/dist/chunks/{studio-1q6amtph.js → studio-g7nse7zb.js} +4 -4
- package/dist/chunks/studio-geq1ea6k.js +14 -0
- package/dist/chunks/{studio-n78gjfy8.js → studio-ghkb32r8.js} +4 -4
- package/dist/chunks/{studio-bftp4n4b.js → studio-ghrhy2y7.js} +4 -4
- package/dist/chunks/{studio-5d7wfmnp.js → studio-grawhey1.js} +4 -4
- package/dist/chunks/{studio-rr4xkv81.js → studio-h0xgswew.js} +4 -4
- package/dist/chunks/{studio-cbr9czkn.js → studio-h9c4p2tx.js} +4 -4
- package/dist/chunks/studio-jyzj5cxs.js +5 -0
- package/dist/chunks/{studio-x92tgnee.js → studio-mgx8yhnz.js} +31 -31
- package/dist/chunks/{studio-g8dsj3d2.js → studio-mpb04y1d.js} +5 -5
- package/dist/chunks/{studio-zev8ssp1.js → studio-n17mty64.js} +4 -4
- package/dist/chunks/{studio-4jj9gme2.js → studio-nwh2eqsk.js} +5 -5
- package/dist/chunks/{studio-8xcwewjq.js → studio-pxg4ap1e.js} +3 -3
- package/dist/chunks/{studio-4m50vh74.js → studio-q1h883bt.js} +5 -5
- package/dist/chunks/{studio-c6zdm25z.js → studio-q4tv82h7.js} +6 -6
- package/dist/chunks/{studio-st75kn99.js → studio-qbj760tx.js} +5 -5
- package/dist/chunks/{studio-y7jehjrp.js → studio-qpqa7vk3.js} +4 -4
- package/dist/chunks/{studio-5vy2wfm5.js → studio-qqz8e5gk.js} +4 -4
- package/dist/chunks/{studio-qa73881a.js → studio-qvasen3f.js} +4 -4
- package/dist/chunks/studio-rggdb3hm.js +5 -0
- package/dist/chunks/{studio-4xppwncr.js → studio-sghy936h.js} +3 -3
- package/dist/chunks/{studio-mk00zd5d.js → studio-skprc6ef.js} +4 -4
- package/dist/chunks/{studio-cqmtbg2p.js → studio-tt2nactf.js} +4 -4
- package/dist/chunks/{studio-ge5fqjth.js → studio-txjjzrsm.js} +5 -5
- package/dist/chunks/{studio-tmeq6mjb.js → studio-tyasmc39.js} +4 -4
- package/dist/chunks/{studio-0bbxhhce.js → studio-v2bvmbjj.js} +4 -4
- package/dist/chunks/{studio-pwqfmt4p.js → studio-vk9ezads.js} +4 -4
- package/dist/chunks/{studio-fqq890ap.js → studio-vzacdfsc.js} +3 -3
- package/dist/chunks/{studio-zd4kayn2.js → studio-w4c0xmrw.js} +4 -4
- package/dist/chunks/{studio-ztvcxm3w.js → studio-wfjqhhbk.js} +4 -4
- package/dist/chunks/{studio-tp642n5g.js → studio-wgh5kxpj.js} +4 -4
- package/dist/chunks/studio-xasj0796.js +5 -0
- package/dist/chunks/{studio-tzegmy4w.js → studio-y78s8r2n.js} +4 -4
- package/dist/chunks/{studio-7pgy3xaf.js → studio-z8w183sh.js} +4 -4
- package/dist/chunks/{studio-01kbbqg3.js → studio-zscd9ty4.js} +124 -124
- package/dist/chunks/{studio-hnvnfbdv.js → studio-zxp13sss.js} +6 -6
- package/dist/chunks/{studio-r3kaka4d.js → studio-zygnmm01.js} +4 -4
- package/dist/chunks/{tsMode-k9s9fcag.js → tsMode-gr0m4dzr.js} +5 -5
- package/dist/chunks/workspace-m15qtcqp.js +4 -0
- package/dist/chunks/{ws-client-0ja08haa.js → ws-client-nf61frr1.js} +3 -3
- package/dist/manifest.json +62 -62
- package/dist/studio.js +83 -83
- package/package.json +2 -2
- package/src/new-project/add-repo-modal.ts +459 -59
- package/src/platforms/cloud.ts +95 -18
- package/src/publish/pages-service.ts +7 -0
- package/src/publish/publish-panel.ts +16 -2
- package/src/surfaces/add-repo.json +721 -224
- package/src/surfaces/add-repo.ts +196 -31
- package/src/types.ts +42 -3
- package/src/utils/project-dir.ts +24 -0
- package/dist/chunks/adapter-y5gdq19c.js +0 -4
- package/dist/chunks/cf-settings-20dznc3j.js +0 -4
- package/dist/chunks/components-q037dya7.js +0 -4
- package/dist/chunks/content-source-t0q184js.js +0 -4
- package/dist/chunks/editor-j5sq149q.js +0 -4
- package/dist/chunks/entry-commands-fxzgcc4k.js +0 -4
- package/dist/chunks/file-ops-2n77759h.js +0 -4
- package/dist/chunks/files-fjy7zpxt.js +0 -4
- package/dist/chunks/format-host-wj3mf3n8.js +0 -4
- package/dist/chunks/fs-events-7kcgn4e9.js +0 -4
- package/dist/chunks/git-panel-7z2mpt2d.js +0 -4
- package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
- package/dist/chunks/index-m0x5ztax.js +0 -4
- package/dist/chunks/jx-validate-zc9zp77s.js +0 -4
- package/dist/chunks/layers-p677nrh5.js +0 -4
- package/dist/chunks/layers-panel-y4w1dq90.js +0 -4
- package/dist/chunks/lit-html-cfn61dn7.js +0 -4
- package/dist/chunks/media-picker-xg7yjpz9.js +0 -4
- package/dist/chunks/menu-fpekzj6w.js +0 -4
- package/dist/chunks/monaco-buffer-nn4dtx27.js +0 -4
- package/dist/chunks/notify-ahs57a2z.js +0 -4
- package/dist/chunks/platform-v9xyfkbx.js +0 -4
- package/dist/chunks/publish-panel-xtbfgg2r.js +0 -4
- package/dist/chunks/quick-search-d3a6m7j3.js +0 -4
- package/dist/chunks/references-99ws0b0m.js +0 -4
- package/dist/chunks/right-panel-31vbk5xp.js +0 -4
- package/dist/chunks/section-registry-b2yzp9sw.js +0 -4
- package/dist/chunks/studio-1a99w39s.js +0 -5
- package/dist/chunks/studio-4fde4a0x.js +0 -5
- package/dist/chunks/studio-84rtc120.js +0 -5
- package/dist/chunks/studio-aekhcdzw.js +0 -7
- package/dist/chunks/studio-aqmph6k4.js +0 -5
- package/dist/chunks/studio-chdmwwzw.js +0 -5
- package/dist/chunks/studio-cp1gbff9.js +0 -14
- package/dist/chunks/studio-fbx6twps.js +0 -6
- package/dist/chunks/studio-fthwn4kf.js +0 -5
- package/dist/chunks/studio-nbxqcgvf.js +0 -5
- package/dist/chunks/studio-t1eedsyx.js +0 -4
- package/dist/chunks/studio-vavmwshr.js +0 -5
- package/dist/chunks/workspace-5vmgsagj.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{p}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{p}from"./studio-qpqa7vk3.js";import{v}from"./studio-vzacdfsc.js";import{m}from"./studio-3aey7dd3.js";import{qt,wi,Zt,Ja,Dr,Us}from"./studio-tt2nactf.js";import{Ps,gc}from"./studio-skprc6ef.js";import{ds,yb,wb,Ba,Er}from"./studio-qvasen3f.js";import{D}from"./studio-wgh5kxpj.js";import{me}from"./studio-v2bvmbjj.js";var mc="draft",gb="Marked a draft. Studio filters drafts out of its own lists; the build does not exclude them yet.";function Iu(e){return e?.[mc]===!0}function N(e){return e?.properties?.[mc]?.type==="boolean"}function Kf(e,t){return N(e)||Iu(t)}var E=v({includeDrafts:!1});function G(){return E.includeDrafts}function HE(e){E.includeDrafts=e}function K(e,t,r){return r?e:e.filter((o)=>!Iu(t(o)))}var b="__path";function bb(e){let r=(D?.projectConfig?.content??{})[e];if(!r?.source)return null;let o=r.source.replace(/^\.\//,"").replace(/\/$/,""),f=r.format==="json"?".json":wi(r.format)?.extensions[0]??Dr()?.extensions[0]??".json";return{def:r,dir:o,ext:f,name:e}}function jw(){let e=D?.projectConfig?.content??{};return Object.entries(e).filter(([,t])=>{let r=t.source?.replace(/^\.\//,"")??"";return r!==""&&!/\.[a-z0-9]+$/i.test(r)}).map(([t,r])=>({dir:r.source.replace(/^\.\//,"").replace(/\/$/,""),name:t}))}async function P(e,t){let r=p(),o=[],f=async(x)=>{let w;try{w=await r.listDirectory(x)}catch{return}for(let C of w)if(C.type==="directory")await f(C.path);else if(t.some((k)=>C.path.endsWith(k)))o.push(C.path)};return await f(e),o.toSorted()}async function R1(e){await qt().catch(()=>{});let t=bb(e);if(!t)return[];return(await P(t.dir,[t.ext])).map((o)=>{let f=o.split("/").pop()??o;return f.slice(0,f.length-t.ext.length)})}async function V(e,t,r){let o=Array.from({length:e.length}),f=0,x=Array.from({length:Math.min(t,e.length)},async()=>{while(f<e.length){let w=f;f+=1,o[w]=await r(e[w])}});return await Promise.all(x),o}function T(e){if(e===null||e===void 0)return null;if(typeof e==="string"||typeof e==="number"||typeof e==="boolean")return e;if(Array.isArray(e)&&e.every((t)=>typeof t!=="object"||t===null))return e.map(String);return JSON.stringify(e)}function I(e){for(let t of m.tabs.values())if(t.documentPath===e)return t;return null}function W(e,t){return e.every((r)=>{let o=r[t];return o===null||o===void 0||typeof o!=="string"?!0:!o.startsWith("{")&&!o.startsWith("[")})}var j=new WeakSet;async function $1(){let e=[];for(let t of m.tabs.values()){let r=Ba(t);if(r&&j.has(r.source))e.push(r.load())}await Promise.all(e)}function A(e){let t=M(e);if(e.drafts)j.add(t);return t}function M(e){let t=new Map,r=null,o=null,f=(l=!1)=>{if(!l&&r)return r;return r=(async()=>{await qt().catch(()=>{});let c=p(),a=await e.list();t.clear(),o=null;let u=await V(a,32,async(n)=>{try{let i=await c.readFile(n),s=await Er(n,i);return{document:s.document,formatName:s.format.name,frontmatter:s.frontmatter??{},rawText:i}}catch{return null}});for(let[n,i]of a.entries()){let s=u[n];if(s)t.set(i,s)}})(),r},x=()=>{if(o)return o;let l={editable:!1,field:b,insertOnly:!0,kind:"string",pk:!0,required:!0,title:"Path",widthHint:220},c=yb(e.schema()),a=new Set([b,...c.map((i)=>i.field)]),u=[...t.values()].map((i)=>{let s={};for(let[d,y]of Object.entries(i.frontmatter))if(!a.has(d)&&!d.startsWith("$"))s[d]=T(y);return s}),n=wb(u);for(let i of n)i.editable=i.kind!=="text"||W(u,i.field);if(e.priorityFields?.length){let i=(s)=>{let d=e.priorityFields.indexOf(s.field);return d===-1?e.priorityFields.length:d};n.sort((s,d)=>i(s)-i(d))}return o=C([l,...c,...n]),o},w=()=>{if(!e.drafts)return!1;let l=e.schema();return Kf(l)||[...t.values()].some((c)=>Kf(l,c.frontmatter))},C=(l)=>{let c=l.findIndex((u)=>u.field===mc);if(c<1||!w())return l;let a=l.filter((u)=>u.field!==mc);return[a[0],l[c],...a.slice(1)]},k=(l,c)=>{let a={[b]:l};for(let u of x()){if(u.field===b)continue;a[u.field]=T(c.frontmatter[u.field])}return{cells:a,fingerprint:c.rawText,key:l}},O=async(l,c,a)=>{let u=p(),n={...c.frontmatter};for(let y of a)if(y.value===null)delete n[y.field];else n[y.field]=y.value;let i=c.document,s={...n,...i,children:i.children??[]},d=await Us(c.formatName,s,{mode:"roundtrip"});Ps(l),await u.writeFile(l,d),t.set(l,{...c,frontmatter:n,rawText:d})};return{backingPaths:()=>new Map([...t.keys()].map((l)=>[l,l])),capabilities:{delete:!0,insert:!0,remotePaging:!1,remoteSort:!1},async columns(){return await f(),x()},async commit(l){await f();let c=p(),a={cells:[],deletes:[],inserts:[]},u=new Map;for(let n of l.cells){let i=u.get(n.rowKey)??[];i.push({field:n.field,value:n.value}),u.set(n.rowKey,i)}for(let[n,i]of u){let s=(g,F,R)=>{for(let S of i)a.cells.push({error:F,field:S.field,ok:g,rowKey:n,stale:R})},d=t.get(n);if(!d){s(!1,"Entry no longer loaded — refresh the grid");continue}let y=I(n);if(y?.doc.dirty){s(!1,"Open in a tab with unsaved changes — save or close it first");continue}let h=null;try{h=await c.readFile(n)}catch{h=null}if(h!==d.rawText&&!gc(n)){s(!1,"File changed on disk — refresh to reload",!0);continue}try{if(await O(n,d,i),s(!0),y){let{reloadFileInTab:g}=await (me("dmc2xvcq"),import("./files-dmc2xvcq.js"));g(n)}}catch(g){s(!1,g instanceof Error?g.message:String(g))}}for(let n of l.inserts){let i=n.cells[b];if(typeof i!=="string"||i.trim()===""){a.inserts.push({error:"Path is required",ok:!1,tempKey:n.tempKey});continue}let s=e.resolveInsertPath(i),d=t.has(s);if(!d)try{await c.readFile(s),d=!0}catch{d=!1}if(d){a.inserts.push({error:`${s} already exists`,ok:!1,tempKey:n.tempKey});continue}let y=e.insertFormatName(s);if(!y){a.inserts.push({error:`No format can serialize ${s}`,ok:!1,tempKey:n.tempKey});continue}try{let h={};for(let[R,S]of Object.entries(n.cells))if(R!==b&&S!==null)h[R]=S;let g=await Us(y,{...h,children:[]},{frontmatter:Object.keys(h).length>0,mode:"roundtrip"});Ps(s),await c.writeFile(s,g);let F=await Er(s,g);t.set(s,{document:F.document,formatName:F.format.name,frontmatter:F.frontmatter??{},rawText:g}),a.inserts.push({newKey:s,ok:!0,tempKey:n.tempKey})}catch(h){a.inserts.push({error:h instanceof Error?h.message:String(h),ok:!1,tempKey:n.tempKey})}}for(let n of l.deletes){if(I(n.rowKey)){a.deletes.push({error:"Open in a tab — close it first",ok:!1,rowKey:n.rowKey});continue}try{Ps(n.rowKey),await c.deleteFile(n.rowKey),t.delete(n.rowKey),a.deletes.push({ok:!0,rowKey:n.rowKey})}catch(i){a.deletes.push({error:i instanceof Error?i.message:String(i),ok:!1,rowKey:n.rowKey})}}return a},id:e.id,label:e.label,async refresh(){await f(!0)},async rows(){await f();let c=(e.drafts?K([...t.entries()],([,a])=>a.frontmatter,G()):[...t.entries()]).map(([a,u])=>k(a,u));return{rows:c,total:c.length}}}}function D1(e){let t=()=>{let r=bb(e);if(!r)throw Error(`No content collection named "${e}" in project.json`);return r};return A({drafts:!0,id:ds({kind:"collection",name:e}),insertFormatName:(r)=>{let o=t();return(o.def.format?wi(o.def.format)?.name:void 0)??Zt(r)?.name??Dr()?.name??null},label:e,list:()=>{let r=t();return P(r.dir,[r.ext])},resolveInsertPath:(r)=>{let o=t(),f=r.trim().replace(/^\.\//,"").replace(/^\//,"");if(!f.includes("/"))f=`${o.dir}/${f}`;if(!f.endsWith(o.ext))f=`${f}${o.ext}`;return f},schema:()=>t().def.schema})}function A1(){let e=()=>{let t=Ja("page").filter((r)=>r!==".json");return t.length>0?t:[".md"]};return A({id:ds({kind:"pages"}),insertFormatName:(t)=>Zt(t)?.name??null,label:"Pages",list:()=>P("pages",e()),priorityFields:["title","description"],resolveInsertPath:(t)=>{let r=t.trim().replace(/^\.\//,"").replace(/^\//,"");if(!r.startsWith("pages/"))r=`pages/${r}`;if(!e().some((o)=>r.endsWith(o)))r=`${r}${e()[0]}`;return r},schema:()=>null})}
|
|
2
|
+
export{mc,gb,Iu,Kf,HE,bb,jw,R1,$1,D1,A1};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=4481AD908BB09E6064756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-g5fmf0c1.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function f(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function g(t,n){return t===n||t.startsWith(`${n}/`)}function
|
|
2
|
-
export{
|
|
1
|
+
function u(t){let n=t.replaceAll("\\","/");return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function f(t){let n=u(t);return n.startsWith("/")?n:`/${n}`}function p(t,n){return[...t].toSorted((e,s)=>s[n].length-e[n].length)}function g(t,n){return t===n||t.startsWith(`${n}/`)}function TI(t,n){let e=u(n);for(let s of p(t,"dir")){let r=u(s.dir);if(!g(e,r)||e===r)continue;let i=e.slice(r.length+1),{filter:o}=s;if(o&&!o(i))return null;let l=i.split("/").map((c)=>encodeURIComponent(c)).join("/");return`${f(s.urlPrefix)}/${l}`}return null}function h(t,n){let e=n.split("#")[0].split("?")[0];if(!e.startsWith("/"))return null;let s;try{s=decodeURIComponent(e)}catch{return null}if(/%2e|%2f/i.test(s))return null;for(let r of p(t,"urlPrefix")){let i=f(r.urlPrefix);if(!s.startsWith(`${i}/`))continue;let l=s.slice(i.length+1).split("/");if(l.some((a)=>a===""||a==="."||a===".."))return null;let{filter:c}=r;if(c&&!c(l.join("/")))return null;return`${u(r.dir)}/${l.join("/")}`}return null}var A=String.raw`"'\s<>()\\`;var Op="public";var LI=["mounts","public"];function Ov(t){let n=t.search(/[#?]/);return n===-1?{path:t,suffix:""}:{path:t.slice(0,n),suffix:t.slice(n)}}function Tk(t){return t===""||t.startsWith("/")||t.startsWith("#")||t.includes("${")||/^[a-z][\w+.-]*:/i.test(t)}function di(t){return t.replaceAll("\\","/").replace(/^\.\//,"").replace(/^\/+/,"").replace(/\/+$/,"")}function II(t){let n=di(t),e=n.lastIndexOf("/");return e===-1?"":n.slice(0,e)}function Lk(t,n){let s=(t===""||t==="."?[]:di(t).split("/")).filter((r)=>r!==""&&r!==".");for(let r of n.replaceAll("\\","/").split("/")){if(r===""||r===".")continue;if(r===".."){if(s.length===0)return null;s.pop();continue}s.push(r)}return s.join("/")}function d(t,n,e){let{path:s}=Ov(t);if(!s.startsWith("/"))return[];let r;try{r=decodeURIComponent(s)}catch{return[]}if(/%2e|%2f/i.test(r))return[];let i=r.replace(/^\/+/,"");if(i===""||i.split("/").some((l)=>l==="."||l===".."))return[];let o=[];for(let l of e){if(l==="mounts"){let c=h(n,s);if(c!==null&&!c.startsWith("/")&&!/^[A-Za-z]:/.test(c))o.push(di(c));continue}o.push(l==="root"?i:`${Op}/${i}`)}return[...new Set(o)]}function RI(t,n,e,s){let{path:r}=Ov(t);if(r==="")return null;if(Tk(t))return r.startsWith("/")?d(r,e,s)[0]??null:null;if(r.endsWith("/"))return null;let i;try{i=decodeURIComponent(r)}catch{return null}let o=Lk(n,i);if(o===null||o===""||o===di(n))return null;return o}function Mv(t){return t.split("/").map((n)=>encodeURIComponent(n)).join("/")}function $I(t){let n=[],e=0;while(e<t.length){while(e<t.length&&(/\s/.test(t[e])||t[e]===","))e+=1;if(e>=t.length)break;let s=e;while(e<t.length&&!/\s/.test(t[e]))e+=1;let r=t.slice(s,e);if(r.endsWith(",")){n.push({descriptor:"",url:r.replace(/,+$/,"")});continue}while(e<t.length&&/\s/.test(t[e]))e+=1;let i=e;while(e<t.length&&t[e]!==",")e+=1;let o=t.slice(i,e).trim();if(e+=1,r=r.replace(/,+$/,""),r!=="")n.push({descriptor:o,url:r})}return n}function DI(t){return t.map(({url:n,descriptor:e})=>e?`${n} ${e}`:n).join(", ")}
|
|
2
|
+
export{TI,Op,LI,Ov,Tk,di,II,Lk,RI,Mv,$I,DI};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=59F25AE069BA374664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-g7nse7zb.js.map
|