@jxsuite/studio 6.0.0 → 6.1.1
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-va2wwra4.js +4 -0
- package/dist/chunks/adapter-f93pafd7.js +4 -0
- package/dist/chunks/{cf-account-picker-bb2yq946.js → cf-account-picker-af1h381v.js} +3 -3
- package/dist/chunks/cf-settings-125tdm0w.js +4 -0
- package/dist/chunks/components-ax2f1fnn.js +4 -0
- package/dist/chunks/content-source-108aqtk1.js +4 -0
- package/dist/chunks/{convert-to-repeater-vqkt7s3s.js → convert-to-repeater-ry5rmppr.js} +3 -3
- package/dist/chunks/editor-pfgdmkb0.js +4 -0
- package/dist/chunks/entry-commands-t0k1q0kx.js +4 -0
- package/dist/chunks/{extension-sections-8beq9ac3.js → extension-sections-6mwh2hf8.js} +3 -3
- package/dist/chunks/file-ops-meej5mqf.js +4 -0
- package/dist/chunks/files-44vp8a2s.js +4 -0
- package/dist/chunks/format-host-7q1petb9.js +4 -0
- package/dist/chunks/fs-events-h2mwnxaz.js +4 -0
- package/dist/chunks/git-panel-zngbymvd.js +4 -0
- package/dist/chunks/{grid-view-ca10def6.js → grid-view-sx9vynsp.js} +15 -15
- package/dist/chunks/icons-p44xhjf0.js +4 -0
- package/dist/chunks/iframe-host-qk3ycq87.js +4 -0
- package/dist/chunks/{index-9ydfe04y.js → index-2veqmnhr.js} +3 -3
- package/dist/chunks/index-wkyfjeqz.js +4 -0
- package/dist/chunks/{javascript-d9pqgc2p.js → javascript-8nbvs12s.js} +3 -3
- package/dist/chunks/jsonMode-s8kt9dsj.js +13 -0
- package/dist/chunks/jx-validate-psgd7vsx.js +4 -0
- package/dist/chunks/layers-panel-1kq2jyfk.js +4 -0
- package/dist/chunks/layers-xd92fg8d.js +4 -0
- package/dist/chunks/lit-html-ac4cwwr4.js +4 -0
- package/dist/chunks/media-picker-0svzkdyb.js +4 -0
- package/dist/chunks/menu-5c55ea3d.js +4 -0
- package/dist/chunks/{monaco-binding-62dtmgbf.js → monaco-binding-z6r70pdt.js} +3 -3
- package/dist/chunks/monaco-buffer-fz6gq5y7.js +4 -0
- package/dist/chunks/monaco-setup-q4axkgj7.js +4 -0
- package/dist/chunks/notify-0xgtn8q1.js +4 -0
- package/dist/chunks/platform-v1qctbe6.js +4 -0
- package/dist/chunks/publish-panel-ym1fmgq5.js +4 -0
- package/dist/chunks/quick-search-a54e6t5n.js +4 -0
- package/dist/chunks/references-gmqp82fs.js +4 -0
- package/dist/chunks/right-panel-v7t9awbk.js +4 -0
- package/dist/chunks/section-registry-vhyf3zsr.js +4 -0
- package/dist/chunks/studio-0bhx5hz6.js +5 -0
- package/dist/chunks/studio-0k1ddnyy.js +6 -0
- package/dist/chunks/studio-1b04pd0j.js +64 -0
- package/dist/chunks/{studio-sxc0zvpt.js → studio-1q1sh2ax.js} +3 -3
- package/dist/chunks/studio-4dwbj6gb.js +5 -0
- package/dist/chunks/studio-4tanh828.js +5 -0
- package/dist/chunks/{studio-fqq890ap.js → studio-55h4mstj.js} +3 -3
- package/dist/chunks/studio-5tnvjkz4.js +5 -0
- package/dist/chunks/studio-60dqgb0c.js +5 -0
- package/dist/chunks/studio-61dp09qg.js +9 -0
- package/dist/chunks/studio-63epcrj2.js +5 -0
- package/dist/chunks/studio-74k29dy9.js +5 -0
- package/dist/chunks/{studio-qa73881a.js → studio-7vg6jcd3.js} +4 -4
- package/dist/chunks/studio-7zx31knw.js +9 -0
- package/dist/chunks/studio-8bxk97km.js +5 -0
- package/dist/chunks/{studio-edbtvcd1.js → studio-8grwxtqk.js} +4 -4
- package/dist/chunks/studio-933e30n4.js +5 -0
- package/dist/chunks/{studio-rr4xkv81.js → studio-98wnwhbg.js} +4 -4
- package/dist/chunks/studio-9mccjwjh.js +14 -0
- package/dist/chunks/studio-a2ke1e4t.js +5 -0
- package/dist/chunks/studio-e3a2a6v3.js +4 -0
- package/dist/chunks/{studio-pwqfmt4p.js → studio-e81q1vb9.js} +4 -4
- package/dist/chunks/{studio-7pgy3xaf.js → studio-epgrmqqm.js} +4 -4
- package/dist/chunks/studio-g1shz58g.js +5 -0
- package/dist/chunks/studio-gf0fz03c.js +5 -0
- package/dist/chunks/studio-gjtpe62q.js +6 -0
- package/dist/chunks/{studio-tzegmy4w.js → studio-gkskhg7m.js} +4 -4
- package/dist/chunks/studio-gx4dnjzd.js +5 -0
- package/dist/chunks/{studio-8xcwewjq.js → studio-h46vtzk8.js} +4 -4
- package/dist/chunks/studio-j03zga3y.js +9 -0
- package/dist/chunks/{studio-4r0sjtx8.js → studio-jhpxeckz.js} +4 -4
- package/dist/chunks/{studio-zd4kayn2.js → studio-k01r7ykp.js} +4 -4
- package/dist/chunks/{studio-03wwfvyt.js → studio-kggey1jt.js} +4 -4
- package/dist/chunks/{studio-hnvnfbdv.js → studio-kk7h30ne.js} +6 -6
- package/dist/chunks/{studio-01qza1n3.js → studio-kt1zqney.js} +4 -4
- package/dist/chunks/{studio-r3kaka4d.js → studio-m3cwhvye.js} +4 -4
- package/dist/chunks/{studio-evwgp1ym.js → studio-mcayt6hz.js} +4 -4
- package/dist/chunks/{studio-5vy2wfm5.js → studio-myjcghv3.js} +4 -4
- package/dist/chunks/studio-n8bxwc3y.js +4 -0
- package/dist/chunks/{studio-ztvcxm3w.js → studio-ngm8gvpb.js} +4 -4
- package/dist/chunks/{studio-01kbbqg3.js → studio-nj5a01jy.js} +196 -196
- package/dist/chunks/{studio-xkfs0dp2.js → studio-pcgz8heb.js} +4 -4
- package/dist/chunks/{studio-0bbxhhce.js → studio-pre0skq6.js} +4 -4
- package/dist/chunks/{studio-n78gjfy8.js → studio-qcsq0t15.js} +4 -4
- package/dist/chunks/studio-qkstvve9.js +5 -0
- package/dist/chunks/studio-qv1pwd3c.js +5 -0
- package/dist/chunks/{studio-rmn2dz59.js → studio-rc6dvxjb.js} +5 -5
- package/dist/chunks/{studio-st75kn99.js → studio-rv11kfwa.js} +7 -7
- package/dist/chunks/studio-s8dmmz66.js +5 -0
- package/dist/chunks/studio-sp5xzbj4.js +6 -0
- package/dist/chunks/{studio-tmeq6mjb.js → studio-szsjbj0g.js} +4 -4
- package/dist/chunks/studio-t1xzawhr.js +16 -0
- package/dist/chunks/{studio-mk00zd5d.js → studio-t6b6qe31.js} +4 -4
- package/dist/chunks/{studio-bftp4n4b.js → studio-tdcprbqb.js} +4 -4
- package/dist/chunks/{studio-ge5fqjth.js → studio-vrmcjf9g.js} +5 -5
- package/dist/chunks/studio-vyc0b4he.js +10 -0
- package/dist/chunks/{studio-semd1s8s.js → studio-w0cgf6jg.js} +4 -4
- package/dist/chunks/{studio-gp02nqnw.js → studio-w3hskzqk.js} +4 -4
- package/dist/chunks/{studio-1wvfxkyy.js → studio-wszjyh0j.js} +4 -4
- package/dist/chunks/studio-xgrgcdyh.js +9 -0
- package/dist/chunks/{studio-y7jehjrp.js → studio-xz2yxfcb.js} +4 -4
- package/dist/chunks/{studio-aje966s9.js → studio-y6n42tgs.js} +4 -4
- package/dist/chunks/{studio-yr04mv2j.js → studio-yb560vxr.js} +4 -4
- package/dist/chunks/{studio-tp642n5g.js → studio-yn9f8vtx.js} +4 -4
- package/dist/chunks/studio-yw05w8f0.js +7 -0
- package/dist/chunks/{studio-cbr9czkn.js → studio-z16sgavc.js} +4 -4
- package/dist/chunks/studio-zey7zsdw.js +12 -0
- package/dist/chunks/{studio-1q6amtph.js → studio-zyqn40w4.js} +4 -4
- package/dist/chunks/tsMode-2frah6h1.js +14 -0
- package/dist/chunks/workspace-zt81g1ms.js +4 -0
- package/dist/chunks/ws-client-n2bh4hkf.js +4 -0
- package/dist/iframe-entry.js +13 -13
- package/dist/manifest.json +62 -62
- package/dist/studio.js +87 -87
- package/dist/workers/ts.worker.js +3 -3
- package/package.json +10 -10
- package/src/canvas/canvas-render.ts +4 -1
- package/src/canvas/canvas-utils.ts +73 -15
- package/src/canvas/iframe-host.ts +67 -21
- package/src/canvas/iframe-inline-edit.ts +22 -4
- package/src/canvas/iframe-interaction.ts +7 -1
- package/src/canvas/iframe-protocol.ts +3 -0
- package/src/canvas/iframe-render.ts +5 -2
- package/src/commands/defaults.ts +4 -1
- package/src/commands/live-context.ts +3 -1
- package/src/editor/shortcuts.ts +55 -27
- package/src/files/media-paths.ts +3 -1
- package/src/new-project/add-repo-modal.ts +459 -59
- package/src/panels/editors.ts +3 -1
- package/src/panels/style-panel.ts +36 -11
- package/src/platforms/cloud.ts +95 -18
- package/src/platforms/devserver.ts +47 -12
- package/src/publish/pages-service.ts +7 -0
- package/src/publish/publish-panel.ts +16 -2
- package/src/studio.ts +14 -2
- package/src/surfaces/add-repo.json +721 -224
- package/src/surfaces/add-repo.ts +196 -31
- package/src/surfaces/library-pane.ts +6 -0
- package/src/surfaces/rail.json +126 -73
- package/src/surfaces/rail.ts +31 -5
- package/src/tabs/typing.ts +31 -0
- package/src/types.ts +42 -3
- package/src/utils/edit-display.ts +30 -1
- package/src/utils/project-dir.ts +24 -0
- package/src/workspace/workspace.ts +7 -0
- package/dist/chunks/2020-cs2sb9t1.js +0 -4
- 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/icons-qbh8akb1.js +0 -4
- package/dist/chunks/iframe-host-a0zjd6xp.js +0 -4
- package/dist/chunks/index-m0x5ztax.js +0 -4
- package/dist/chunks/jsonMode-800yvbem.js +0 -13
- 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/monaco-setup-tj13ndtm.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-3ck2a5c4.js +0 -10
- package/dist/chunks/studio-4fde4a0x.js +0 -5
- package/dist/chunks/studio-4jj9gme2.js +0 -6
- package/dist/chunks/studio-4m50vh74.js +0 -16
- package/dist/chunks/studio-4xppwncr.js +0 -4
- package/dist/chunks/studio-5d7wfmnp.js +0 -5
- package/dist/chunks/studio-5e9zsamh.js +0 -9
- package/dist/chunks/studio-5gs9th4b.js +0 -5
- package/dist/chunks/studio-7qvs7v0m.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-c6zdm25z.js +0 -9
- package/dist/chunks/studio-capk0583.js +0 -9
- package/dist/chunks/studio-chdmwwzw.js +0 -5
- package/dist/chunks/studio-cp1gbff9.js +0 -14
- package/dist/chunks/studio-cqmtbg2p.js +0 -5
- package/dist/chunks/studio-e47215hh.js +0 -5
- package/dist/chunks/studio-fbx6twps.js +0 -6
- package/dist/chunks/studio-fthwn4kf.js +0 -5
- package/dist/chunks/studio-g8dsj3d2.js +0 -6
- package/dist/chunks/studio-gjknvzam.js +0 -9
- package/dist/chunks/studio-hjbg8d5y.js +0 -12
- 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/studio-x5g1xk77.js +0 -5
- package/dist/chunks/studio-x92tgnee.js +0 -64
- package/dist/chunks/studio-xg1942as.js +0 -5
- package/dist/chunks/studio-zev8ssp1.js +0 -5
- package/dist/chunks/tsMode-k9s9fcag.js +0 -14
- package/dist/chunks/workspace-5vmgsagj.js +0 -4
- package/dist/chunks/ws-client-0ja08haa.js +0 -4
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{me}from"./studio-0bbxhhce.js";var s=null,y=null,h=null,g=!1;function E(n){return h=n,g=!0,s?P():Promise.resolve()}async function P(){if(!g)return;g=!1;try{let{applyProjectSchemas:n}=await (me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"));n(h)}catch{}}function Ep(){if(s)return Promise.resolve(s);return y??=(async()=>{let[n]=await Promise.all([(me("j5sq149q"),import("./editor-j5sq149q.js")),(me("tj13ndtm"),import("./monaco-setup-tj13ndtm.js"))]);return s=n,await P(),s})(),y}function th(){return s}function Rm(n,t,o){if(!n?.isConnected||t)return!1;return o()}var r=[],l=null;function qt(){if(!l)l=(async()=>{try{r=await p().listFormats?.()??[]}catch{r=[]}return r})();return l}function Md(){l=null,r=[],m=null,a=[],d=null,c=[]}var a=[],m=null;function Pd(){if(!m)m=(async()=>{try{a=await p().listExtensions?.()??[]}catch{a=[]}return a})();return m}function $m(){return a}var c=[],d=null;function F(){if(!d)d=(async()=>{try{c=await p().listExtensionCatalog?.()??[]}catch{c=[]}return c})();return d}function Lv(){return c}async function M(n){let t=null;try{t=await n.fetchProjectSchemas?.()??null}catch{}E(t),await (me("zc9zp77s"),import("./jx-validate-zc9zp77s.js")).then(({applyProjectSchemas:o})=>o(t)).catch(()=>!1)}function Ga(n){M(n),F(),(me("8beq9ac3"),import("./extension-sections-8beq9ac3.js")).then(({syncExtensionSettingsSections:t})=>t()).catch(()=>{})}function Tp(){return r}function Vs(n,t){let o=n.startsWith(".")?n.toLowerCase():`.${n.toLowerCase()}`;return r.find((e)=>e.extensions.includes(o)&&(!t||e.capabilities[t]))}function wi(n){if(!n)return;return r.find((t)=>t.name===n)}function Lp(n){return Error(`No format class imported for "${n}" — add one to project.json imports `+`(e.g. "Markdown": "@jxsuite/parser/Markdown.class.json") and make sure the project's dependencies are installed`)}function Zt(n){if(!n)return;let t=n.lastIndexOf(".");if(t===-1)return;return Vs(n.slice(t))}function Ka(n){let t=new Set;for(let o of r){if(n&&!o.documentKinds.includes(n))continue;for(let e of o.extensions)t.add(e)}return t.delete(".json"),[...t]}function Dr(){return r.find((n)=>n.capabilities.serialize&&n.documentKinds.includes("content"))}async function k(n){let t=p();if(!t.formatAction)throw Error("Platform does not support format actions");return t.formatAction(n)}async function ck(n,t,o){return await k({action:"parse",format:n,options:o,source:t})}async function Us(n,t,o){return await k({action:"serialize",doc:t,format:n,options:o})}function dk(n,t){let o=n?.studio?.documentMode,e=o?.componentWhen;if(e?.frontmatterKey){let i=t[e.frontmatterKey],u=e.matches?new RegExp(e.matches):/./;if(typeof i==="string"&&u.test(i))return{document:t,frontmatter:{},mode:"component"}}if(o?.default==="component")return{document:t,frontmatter:{},mode:"component"};let f=t.children??[];if(f.length===0)f.push({children:[],tagName:"p"});let S=new Set(["state","imports"]),x={children:f},w={};for(let[i,u]of Object.entries(t)){if(i==="children")continue;if(S.has(i))x[i]=u;else w[i]=u}return{document:x,frontmatter:w,mode:"content"}}
|
|
2
|
-
export{Ep,th,Rm,qt,Md,Pd,$m,Lv,Ga,Tp,Vs,wi,Lp,Zt,Ka,Dr,ck,Us,dk};
|
|
3
|
-
|
|
4
|
-
//# debugId=AFD18F3445E6650C64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-cqmtbg2p.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{te}from"./studio-ery42sqr.js";import{p,We}from"./studio-y7jehjrp.js";import{k}from"./studio-fqq890ap.js";import{u}from"./studio-x5g1xk77.js";import{Np,di,Ov}from"./studio-1q6amtph.js";import{Ir,gm,mL}from"./studio-xkfs0dp2.js";import{PC,tv,kx,FC,mm}from"./studio-5d7wfmnp.js";import{D}from"./studio-tp642n5g.js";var Al=new Set([".jpg",".jpeg",".png",".gif",".svg",".webp",".avif",".ico"]),Ld=new Set([...Al,".mp4",".webm",".mp3",".wav",".ogg",".pdf",".woff",".woff2",".ttf",".otf"]);function m(e){let t=["B","KB","MB","GB"],n=e,r=0;while(n>=1024&&r<t.length-1)n/=1024,r+=1;return`${r===0?n:Number(n.toFixed(1))} ${t[r]}`}var h=["image/*","video/*","audio/*",".pdf",".svg",".woff",".woff2",".ttf",".otf"].join(",");function _c(){return(We()?p().assetCapabilities?.accept:void 0)??h}function Gi(e){let t=e.lastIndexOf(".");return t>0?e.slice(t).toLowerCase():""}function ev(e){return Al.has(e.startsWith(".")?e.toLowerCase():`.${e.toLowerCase()}`)}function hm(e){return Ld.has(Gi(e))}var x=new Set([".mp4",".webm",".mov",".m4v"]),w=new Set([".mp3",".wav",".ogg",".m4a",".flac"]);function up(e){let t=e.type??"";if(t.startsWith("image/"))return"image";if(t.startsWith("video/"))return"video";if(t.startsWith("audio/"))return"audio";let n=Gi(e.name);if(Al.has(n))return"image";if(x.has(n))return"video";if(w.has(n))return"audio";return"file"}var S=/^content\/([^/]+)\//;function v(e){let t=e?S.exec(e.replaceAll("\\","/")):null;return t?`content/${t[1]}/images`:"public"}function A(e){let t=e.replaceAll("\\","/");if(t.startsWith("public/"))return t.slice(6);let n=/^content\/[^/]+\/(.+)$/.exec(t);if(n)return`./${n[1]}`;return`./${t}`}function b(e,t){if(!t.has(e))return e;let n=Gi(e),r=n?e.slice(0,-n.length):e;for(let i=1;;i++){let s=`${r}-${i}${n}`;if(!t.has(s))return s}}function y(e,t){let n=e.replaceAll("\\","/").replace(/\/+$/,"");return n==="."||n===""?t:`${n}/${t}`}var g=null;function hL(e){g=e}async function Va(e,t={}){let n=[...e];if(n.length===0)return[];let r=p(),i=t.dir??v(u.value?.documentPath??null),s;try{let o=await Ir(()=>r.listDirectory(i));s=new Set(o.map((c)=>c.name))}catch{s=new Set}let f=We()?p().assetCapabilities?.maxUploadBytes:void 0,a=[];for(let o of n){if(f!==void 0&&o.size>f){k.error(`${o.name} is too large.`,{detail:`This backend accepts at most ${m(f)}; that file is ${m(o.size)}.`,source:"Media"});continue}let c=b(o.name,s);s.add(c);let d=y(i,c);try{let{path:l}=await r.uploadFile(d,o);gm([l]),a.push({kind:up(o),name:c,path:l,ref:A(l)})}catch(l){k.error(`Could not upload ${o.name}.`,{detail:te(l),path:d,source:"Media"})}}if(a.length>0)k.success(a.length===1?`Uploaded ${a[0].name} to ${i}/`:`Uploaded ${a.length} files to ${i}/`),await g?.(i);return a}function pL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?t:t.slice(n+1)}function fL(e){let t=di(e),n=t.lastIndexOf("/");return n===-1?".":t.slice(0,n)}function E(){return D?.projectConfig?.content??null}function C(e){return tv(e,E(),FC())}function I(e,t){return`${di(t.urlPrefix)}/${e.slice(t.dir.length+1)}`}function Id(e){let t=di(e);if(t.startsWith(`${Np}/`))return`/${t.slice(Np.length+1)}`;let n=C(t);return n?`/${I(t,n)}`:`/${t}`}function Bu(e){let t=di(e);if(t==="")return e;let{space:n,fileBaseUrl:r}=mm();if(n==="repo")return PC(`${r}${Ov(t)}`,mL(t));return kx(Id(t))}
|
|
2
|
-
export{Al,Ld,_c,Gi,ev,hm,up,hL,Va,pL,fL,Id,Bu};
|
|
3
|
-
|
|
4
|
-
//# debugId=2310F1E15B711CFB64756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-e47215hh.js.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{K,D}from"./studio-tp642n5g.js";import{th}from"./studio-cqmtbg2p.js";import{nt,Pv}from"./studio-nbxqcgvf.js";async function xb(e,s){let o=p();if(!o.codeService)return null;return o.codeService(e,s)}var gc=new Map;async function _b(e,s){let o=e.$prototype?D?.projectConfig?.imports?.[e.$prototype]:null,t=e.$src||o;if(!t||!e.$prototype)return null;let r=`${t}::${e.$prototype}`;if(gc.has(r))return gc.get(r);try{let n=p();if(!n.fetchPluginSchema)return gc.set(r,null),null;let i=!o&&s.documentPath?`${location.origin}/${s.documentPath}`:void 0,a=await n.fetchPluginSchema(t,e.$prototype,i);return gc.set(r,a),a}catch{return gc.set(r,null),null}}function M1(e,s){let o=e.getModel();if(!o)return;let t=th();if(!t)return;let r=s.map((n)=>{let i=n.labels?.[0];if(!i)return null;let{line:a,column:l,length:c}=i.span;return{code:n.url?{target:t.Uri.parse(n.url),value:n.code}:n.code,endColumn:l+(c||1),endLineNumber:a,message:n.message+(n.help?`
|
|
2
|
-
${n.help}`:""),severity:n.severity==="error"?t.MarkerSeverity.Error:t.MarkerSeverity.Warning,source:"oxlint",startColumn:l,startLineNumber:a}}).filter(Boolean);t.editor.setModelMarkers(o,"oxlint",r)}function UE(e,s){let o=(t)=>{if(!nt(t))return null;let r=t.parameters;if(!Array.isArray(r)||r.length===0)return null;return Pv(r)};if(e.type==="def"){let t=e.defName?o(s?.state?.[e.defName]):null;if(t)return t}else if(e.type==="event"){if(!s||!e.path)return["state","event"];let t=K(s,e.path),r=t&&e.eventKey?o(t[e.eventKey]):null;if(r)return r}return["state","event"]}
|
|
3
|
-
export{xb,gc,_b,M1,UE};
|
|
4
|
-
|
|
5
|
-
//# debugId=602B7A9B1AEF7FB564756E2164756E21
|
|
6
|
-
//# sourceMappingURL=studio-fbx6twps.js.map
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{p}from"./studio-y7jehjrp.js";import{di}from"./studio-1q6amtph.js";import{Ir}from"./studio-xkfs0dp2.js";import{Gi,up,pL,fL}from"./studio-e47215hh.js";var r=new Map,d=new Map,a=new Map;function l(e,t){let n=pL(e),i=a.get(e);return{bytes:typeof t?.size==="number"?t.size:null,ext:Gi(n),height:i?.height??null,kind:up({name:n}),modified:t?.modified??null,name:n,path:e,width:i?.width??null}}function sb(e){return r.get(di(e))??null}function bE(e){for(let t of e){if(t.type!=="file")continue;let n=di(t.path);if(!r.has(n))r.set(n,l(n,t))}}async function vE(e){let t=di(e),n=r.get(t);if(n)return n;let i=d.get(t);if(i)return i;let o=(async()=>{let u;try{u=(await Ir(()=>p().listDirectory(fL(t)))).find((f)=>di(f.path)===t)}catch{u=void 0}return l(t,u)})();d.set(t,o);let s=await o;return d.delete(t),r.set(t,s),s}function ab(e,t,n){if(!(t>0&&n>0))return!1;let i=di(e),o=a.get(i);if(o&&o.width===t&&o.height===n)return!1;a.set(i,{height:n,width:t});let s=r.get(i);if(s)r.set(i,{...s,height:n,width:t});return!0}function yE(){r.clear(),a.clear()}function m1(e){if(e<1024)return`${e} B`;if(e<1048576)return`${Math.round(e/1024)} KB`;return`${(e/1048576).toFixed(1)} MB`}function wE(e){if(!e)return"";let t=[];if(e.width!==null&&e.height!==null)t.push(`${e.width} × ${e.height}`);if(e.bytes!==null)t.push(m1(e.bytes));return t.join(" · ")}
|
|
2
|
-
export{sb,bE,vE,ab,yE,m1,wE};
|
|
3
|
-
|
|
4
|
-
//# debugId=4F04E6D76DE7569064756E2164756E21
|
|
5
|
-
//# sourceMappingURL=studio-fthwn4kf.js.map
|