@jxsuite/studio 8.0.0 → 8.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-5wtzce5g.js → 2020-dg097k3e.js} +3 -3
- package/dist/chunks/adapter-tck81zft.js +4 -0
- package/dist/chunks/{add-new-flow-psym14sn.js → add-new-flow-a1w0bnm6.js} +3 -3
- package/dist/chunks/{cf-account-picker-haqazq5r.js → cf-account-picker-ce3kp3x1.js} +3 -3
- package/dist/chunks/cf-settings-7ye6x7g2.js +4 -0
- package/dist/chunks/color-4gj49xq6.js +4 -0
- package/dist/chunks/{color-area-6rbra5dy.js → color-area-vh9cew51.js} +2 -2
- package/dist/chunks/{color-field-gy56c94g.js → color-field-e78f16bs.js} +3 -3
- package/dist/chunks/{color-slider-sqqdyf6c.js → color-slider-fg4yhvk6.js} +2 -2
- package/dist/chunks/{combobox-72h32ejk.js → combobox-6hs00996.js} +2 -2
- package/dist/chunks/components-qce0v93f.js +4 -0
- package/dist/chunks/content-source-jjx8kgzr.js +4 -0
- package/dist/chunks/{convert-to-repeater-he70fc2b.js → convert-to-repeater-grnmea6c.js} +3 -3
- package/dist/chunks/editor-bkja5dbv.js +4 -0
- package/dist/chunks/entry-commands-1wh0btvg.js +4 -0
- package/dist/chunks/{extension-sections-0egb88dm.js → extension-sections-rp7fkega.js} +3 -3
- package/dist/chunks/file-ops-6pe4z7an.js +4 -0
- package/dist/chunks/files-ybpp3j38.js +4 -0
- package/dist/chunks/format-host-3mtbhxk1.js +4 -0
- package/dist/chunks/fs-events-xfanfxds.js +4 -0
- package/dist/chunks/grid-open-dg5qmnaj.js +4 -0
- package/dist/chunks/{grid-view-qg1b5eqx.js → grid-view-x26rfpz1.js} +16 -15
- package/dist/chunks/{icons-63bjtbs7.js → icons-853n6qt3.js} +2 -2
- package/dist/chunks/{iframe-entry-2zggzajv.js → iframe-entry-02wzcyvy.js} +4 -4
- package/dist/chunks/{iframe-entry-99nr5zfb.js → iframe-entry-42hpmwz5.js} +4 -4
- package/dist/chunks/{iframe-entry-76j8vwwx.js → iframe-entry-b5qgggyp.js} +2 -2
- package/dist/chunks/iframe-host-j2bk2xkc.js +4 -0
- package/dist/chunks/{index-32eqzv1k.js → index-203h71wy.js} +3 -3
- package/dist/chunks/index-fkrm7pdk.js +4 -0
- package/dist/chunks/{javascript-pjp734q4.js → javascript-ww5pv5ae.js} +2 -2
- package/dist/chunks/{jsonMode-njkvsa02.js → jsonMode-vwbdwwq3.js} +6 -6
- package/dist/chunks/jx-validate-w7v32f6a.js +4 -0
- package/dist/chunks/layers-g7j732cm.js +4 -0
- package/dist/chunks/layers-panel-gjrsxcck.js +4 -0
- package/dist/chunks/{listbox-c421cf8c.js → listbox-7gka1h86.js} +2 -2
- package/dist/chunks/lit-html-jdfz9rhc.js +4 -0
- package/dist/chunks/media-library-9j0v4wmk.js +4 -0
- package/dist/chunks/media-picker-cpyyt2m0.js +4 -0
- package/dist/chunks/{menu-bdpzbfvs.js → menu-d2jxpgma.js} +2 -2
- package/dist/chunks/{monaco-binding-vq1hgnn0.js → monaco-binding-63tqze27.js} +3 -3
- package/dist/chunks/monaco-buffer-9wcme176.js +4 -0
- package/dist/chunks/{monaco-setup-xrd2cbkp.js → monaco-setup-zyyynnj8.js} +3 -3
- package/dist/chunks/notify-rahnnnv4.js +4 -0
- package/dist/chunks/platform-b2aqv7v5.js +4 -0
- package/dist/chunks/{popover-b89sfej7.js → popover-9tf4cjrk.js} +2 -2
- package/dist/chunks/publish-panel-4yk2461b.js +4 -0
- package/dist/chunks/{publish-quick-qx2455cj.js → publish-quick-ajzdhhs6.js} +3 -3
- package/dist/chunks/publish-workspace-mxestzcf.js +4 -0
- package/dist/chunks/quick-search-9g6z65b0.js +4 -0
- package/dist/chunks/references-c26enpxs.js +4 -0
- package/dist/chunks/right-panel-9d0e0yg7.js +4 -0
- package/dist/chunks/source-control-xyn3a8ds.js +4 -0
- package/dist/chunks/{split-c9zfdgxf.js → split-m5rwn31z.js} +2 -2
- package/dist/chunks/{studio-x9hsze61.js → studio-02phtmqn.js} +4 -4
- package/dist/chunks/{studio-4hp8pkyt.js → studio-0khd0xdw.js} +4 -4
- package/dist/chunks/studio-1fvzq9vs.js +5 -0
- package/dist/chunks/studio-1gdfsr49.js +12 -0
- package/dist/chunks/{studio-3q40e3rj.js → studio-1meqbxns.js} +4 -4
- package/dist/chunks/{studio-q0tccd43.js → studio-1yhz0s8p.js} +4 -4
- package/dist/chunks/studio-25a5by3h.js +5 -0
- package/dist/chunks/{studio-k3xxbagr.js → studio-2b8443ms.js} +3 -3
- package/dist/chunks/{studio-3qqjeep5.js → studio-2c2mjyzj.js} +5 -5
- package/dist/chunks/studio-2dtc90zs.js +10 -0
- package/dist/chunks/{studio-9tmebf0s.js → studio-332hesdk.js} +4 -4
- package/dist/chunks/{studio-03ct6yfv.js → studio-3pndhat0.js} +8 -8
- package/dist/chunks/{studio-s32578pn.js → studio-3q6n9qvq.js} +4 -4
- package/dist/chunks/studio-4dsdnan2.js +9 -0
- package/dist/chunks/{studio-ed1hp6zf.js → studio-4fjqdzrb.js} +5 -5
- package/dist/chunks/{studio-jcnsdaep.js → studio-533py3yy.js} +4 -4
- package/dist/chunks/studio-5abge3wy.js +5 -0
- package/dist/chunks/{studio-8tr6cfrc.js → studio-6vrxzkba.js} +4 -4
- package/dist/chunks/{studio-jaaz8ce9.js → studio-73wz63nn.js} +4 -4
- package/dist/chunks/{studio-bavb31r0.js → studio-74nzv280.js} +4 -4
- package/dist/chunks/{studio-q7rtx6zq.js → studio-7cg75gtj.js} +7 -7
- package/dist/chunks/studio-89cwmnae.js +5 -0
- package/dist/chunks/studio-8m1t83kn.js +7 -0
- package/dist/chunks/{studio-q0mvbaq6.js → studio-8nyw10dp.js} +4 -4
- package/dist/chunks/{studio-83mk4bgg.js → studio-94ppxeqy.js} +8 -8
- package/dist/chunks/{studio-qmn1xc24.js → studio-957jg8g3.js} +4 -4
- package/dist/chunks/{studio-r5qy30vx.js → studio-9wyqyfqy.js} +4 -4
- package/dist/chunks/studio-a3evp7f6.js +6 -0
- package/dist/chunks/{studio-n0c5h6mf.js → studio-a6x058ew.js} +4 -4
- package/dist/chunks/studio-ana67wax.js +5 -0
- package/dist/chunks/studio-b4xhpcwy.js +4 -0
- package/dist/chunks/studio-bf0rgyf7.js +5 -0
- package/dist/chunks/{studio-x1x167jh.js → studio-bqgs90r8.js} +4 -4
- package/dist/chunks/{studio-qwdqwkj0.js → studio-c4rcaftm.js} +4 -4
- package/dist/chunks/{studio-mn0476ag.js → studio-c5dj3dzk.js} +4 -4
- package/dist/chunks/studio-cgjt1zce.js +5 -0
- package/dist/chunks/{studio-bbe4c90a.js → studio-cpdzrdgp.js} +4 -4
- package/dist/chunks/studio-cq87hree.js +5 -0
- package/dist/chunks/studio-d140sy8e.js +5 -0
- package/dist/chunks/{studio-jsgf2q5k.js → studio-dmn7gpba.js} +5 -5
- package/dist/chunks/studio-e8pzjjhf.js +5 -0
- package/dist/chunks/{studio-dgk4dqtx.js → studio-f8kz3krj.js} +5 -5
- package/dist/chunks/{studio-qgh13jtz.js → studio-fqs1a22a.js} +4 -4
- package/dist/chunks/{studio-syreb644.js → studio-fw3jp9m7.js} +4 -4
- package/dist/chunks/{studio-ed3xx40h.js → studio-g6ysm05p.js} +6 -6
- package/dist/chunks/studio-gmhd0j3f.js +5 -0
- package/dist/chunks/{studio-p4nrkvqr.js → studio-gqpty626.js} +4 -4
- package/dist/chunks/{studio-kt3pjkwd.js → studio-grp684wx.js} +4 -4
- package/dist/chunks/{studio-df0baea9.js → studio-h98520qr.js} +4 -4
- package/dist/chunks/{studio-8m0y2qe7.js → studio-hnx1h1pr.js} +4 -4
- package/dist/chunks/studio-hvxt8z79.js +5 -0
- package/dist/chunks/{studio-43sd2mam.js → studio-hw60n5dh.js} +3 -3
- package/dist/chunks/{studio-wbcjbhy1.js → studio-hxq1ebp0.js} +6 -6
- package/dist/chunks/{studio-wys23mxz.js → studio-j4e627w1.js} +4 -4
- package/dist/chunks/{studio-ccv2svc6.js → studio-j5jqvyn3.js} +4 -4
- package/dist/chunks/{studio-881z1xrx.js → studio-jqrg9xxg.js} +4 -4
- package/dist/chunks/{studio-b7y5mr30.js → studio-kdseew9m.js} +4 -4
- package/dist/chunks/studio-kt2j51sa.js +5 -0
- package/dist/chunks/{studio-d5grtb9e.js → studio-m4w6sygj.js} +9 -9
- package/dist/chunks/{studio-zz9qe3rw.js → studio-mmqr9awv.js} +37 -37
- package/dist/chunks/{studio-5g0rprdt.js → studio-nm9qev4p.js} +5 -5
- package/dist/chunks/{studio-tft6r105.js → studio-nsv7g1qn.js} +4 -4
- package/dist/chunks/{studio-3e54qh39.js → studio-p89w12s2.js} +5 -5
- package/dist/chunks/{studio-y3ahhdpx.js → studio-pbagym4j.js} +4 -4
- package/dist/chunks/{studio-w4rz9hdk.js → studio-pr23qhrw.js} +4 -4
- package/dist/chunks/{studio-6m380wp7.js → studio-r4ya3sb2.js} +4 -4
- package/dist/chunks/studio-rdnezzkd.js +6 -0
- package/dist/chunks/{studio-f14e1zdj.js → studio-rm9m3z60.js} +4 -4
- package/dist/chunks/studio-tpmnbgmt.js +5 -0
- package/dist/chunks/studio-ttxhq5yt.js +5 -0
- package/dist/chunks/{studio-nh6d342n.js → studio-txkx6586.js} +6 -6
- package/dist/chunks/{studio-a2bvaptz.js → studio-v0gsjav0.js} +4 -4
- package/dist/chunks/{studio-fbhxxc5f.js → studio-v2ek69cb.js} +4 -4
- package/dist/chunks/{studio-y0n7yxea.js → studio-wcakp5bt.js} +7 -7
- package/dist/chunks/{studio-k7evxqh4.js → studio-x3ge4rts.js} +4 -4
- package/dist/chunks/{studio-pbxa5fpc.js → studio-xddgbwhe.js} +3 -3
- package/dist/chunks/{studio-c05wdnt3.js → studio-y1x65h5r.js} +4 -4
- package/dist/chunks/{studio-rthyg42z.js → studio-z42kysg7.js} +169 -169
- package/dist/chunks/studio-zf188hnd.js +5 -0
- package/dist/chunks/{studio-tfkznv39.js → studio-zht0x0v3.js} +4 -4
- package/dist/chunks/{studio-svb7yyve.js → studio-zm7dnr9g.js} +4 -4
- package/dist/chunks/{tooltip-yypz28gq.js → tooltip-dj1pvgz7.js} +2 -2
- package/dist/chunks/{tree-9xa4hm7n.js → tree-j0ebwr5s.js} +2 -2
- package/dist/chunks/{tsMode-epyfz1hv.js → tsMode-vra2hh7y.js} +5 -5
- package/dist/chunks/workspace-3nt93k48.js +4 -0
- package/dist/chunks/workspace-home-zbgyqqws.js +4 -0
- package/dist/chunks/{ws-client-bv552sfx.js → ws-client-72x5n99j.js} +3 -3
- package/dist/iframe-entry.js +14 -14
- package/dist/manifest.json +75 -75
- package/dist/studio.js +80 -80
- package/package.json +11 -11
- package/src/browse/component-examples.ts +15 -224
- package/src/browse/library-preview.ts +6 -13
- package/src/browse/preview-root.ts +7 -4
- package/src/canvas/canvas-utils.ts +18 -4
- package/src/canvas/iframe-editable-root.ts +13 -4
- package/src/canvas/iframe-entry.ts +3 -1
- package/src/canvas/iframe-interaction.ts +11 -2
- package/src/canvas/iframe-render.ts +25 -3
- package/src/canvas/preview-placeholder.ts +120 -0
- package/src/editor/shortcuts.ts +3 -0
- package/src/panels/component-preview.ts +5 -0
- package/src/panels/pane-context.ts +43 -18
- package/src/panels/site-model.ts +7 -19
- package/src/panels/site-panel.ts +2 -25
- package/src/panels/stylebook-doc.ts +2 -53
- package/src/services/references.ts +0 -0
- package/src/style/stylebook-specimens.ts +11 -15
- package/src/surfaces/pane-context.json +286 -265
- package/src/surfaces/pane-context.ts +17 -8
- package/src/tabs/tab.ts +5 -6
- package/src/utils/geometry.ts +49 -2
- package/dist/chunks/adapter-5tphg7xe.js +0 -4
- package/dist/chunks/cf-settings-h2wrh6hq.js +0 -4
- package/dist/chunks/color-m7r1vk54.js +0 -4
- package/dist/chunks/components-r22xca09.js +0 -4
- package/dist/chunks/content-source-mmppmcyg.js +0 -4
- package/dist/chunks/editor-ccd9jwsa.js +0 -4
- package/dist/chunks/entry-commands-6qxz9e8p.js +0 -4
- package/dist/chunks/file-ops-qnab36ek.js +0 -4
- package/dist/chunks/files-rcn56qvm.js +0 -4
- package/dist/chunks/format-host-yxz0kjjs.js +0 -4
- package/dist/chunks/fs-events-d1qxq4z4.js +0 -4
- package/dist/chunks/grid-open-4z1g062t.js +0 -4
- package/dist/chunks/iframe-host-ssv7kyj0.js +0 -4
- package/dist/chunks/index-f0jn7nnp.js +0 -4
- package/dist/chunks/jx-validate-ttasrbh7.js +0 -4
- package/dist/chunks/layers-bgyr11tr.js +0 -4
- package/dist/chunks/layers-panel-7ez66zeq.js +0 -4
- package/dist/chunks/lit-html-v9gh687x.js +0 -4
- package/dist/chunks/media-library-sq468wts.js +0 -4
- package/dist/chunks/media-picker-shfe59pt.js +0 -4
- package/dist/chunks/monaco-buffer-3afgwvbp.js +0 -4
- package/dist/chunks/notify-kzrjr3fv.js +0 -4
- package/dist/chunks/platform-7v4rtd7m.js +0 -4
- package/dist/chunks/publish-panel-2z9gw8ee.js +0 -4
- package/dist/chunks/publish-workspace-wrc1dgwx.js +0 -4
- package/dist/chunks/quick-search-n0t0eqxb.js +0 -4
- package/dist/chunks/references-9547rg5s.js +0 -4
- package/dist/chunks/right-panel-wsgnr9pn.js +0 -4
- package/dist/chunks/source-control-kwktr9y6.js +0 -4
- package/dist/chunks/studio-07rcfje3.js +0 -5
- package/dist/chunks/studio-3exxhz5g.js +0 -5
- package/dist/chunks/studio-3qeh9t0h.js +0 -6
- package/dist/chunks/studio-58xg6j2q.js +0 -9
- package/dist/chunks/studio-80jyh1xh.js +0 -4
- package/dist/chunks/studio-8vcvfs7r.js +0 -6
- package/dist/chunks/studio-fyh0jc96.js +0 -5
- package/dist/chunks/studio-gcxk20n7.js +0 -5
- package/dist/chunks/studio-m8g16bgz.js +0 -5
- package/dist/chunks/studio-mx1smyq0.js +0 -5
- package/dist/chunks/studio-pgmvdv7z.js +0 -7
- package/dist/chunks/studio-ph84avkf.js +0 -5
- package/dist/chunks/studio-rj9eamf8.js +0 -5
- package/dist/chunks/studio-rptgsk96.js +0 -5
- package/dist/chunks/studio-s19tp1xr.js +0 -5
- package/dist/chunks/studio-tf9jryb1.js +0 -10
- package/dist/chunks/studio-txf2kysx.js +0 -5
- package/dist/chunks/studio-v8867ddv.js +0 -12
- package/dist/chunks/studio-vxq7fcvv.js +0 -5
- package/dist/chunks/studio-wc649wss.js +0 -5
- package/dist/chunks/studio-z97c48fk.js +0 -5
- package/dist/chunks/studio-zat62m0c.js +0 -5
- package/dist/chunks/studio-zcd2e7yz.js +0 -5
- package/dist/chunks/workspace-dz7nxfhv.js +0 -4
- package/dist/chunks/workspace-home-xsd7hkjw.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n,v}from"./studio-
|
|
2
|
-
export{
|
|
1
|
+
import{n,v}from"./studio-kt2j51sa.js";var S=500;class h extends Error{constructor(){super();this.name="MaxOpsExceededError"}}function zs(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((i,r)=>zs(i,t[r]));if(v(e)&&v(t)){let i=Object.keys(e),r=Object.keys(t);return i.length===r.length&&i.every((a)=>(a in t)&&zs(e[a],t[a]))}return!1}function A(e){let t=5381;for(let i=0;i<e.length;i++)t=Math.imul(t,33)+(e.codePointAt(i)??0);return t.toString(36)}function m(e){return n(e)?`s:${e}`:`n:${A(JSON.stringify(e))}`}function g(e){if(n(e))return"s";let{attributes:t,$props:i}=e,r=(v(t)?t.id:void 0)??(v(i)?i.key:void 0)??"";return`w:${String(e.tagName??"")}:${String(r)}`}function y(e,t,i=Number.POSITIVE_INFINITY){let r=e.length,a=t.length;if(r===0||a===0||r*a>i)return[];let l=Array.from({length:r+1},()=>Array.from({length:a+1},()=>0));for(let s=r-1;s>=0;s--)for(let c=a-1;c>=0;c--)l[s][c]=e[s]===t[c]?l[s+1][c+1]+1:Math.max(l[s+1][c],l[s][c+1]);let f=[],o=0,u=0;while(o<r&&u<a)if(e[o]===t[u])f.push([o,u]),o+=1,u+=1;else if(l[o+1][u]>=l[o][u+1])o+=1;else u+=1;return f}function XE(e,t,i={}){let r=i.maxCells??Number.POSITIVE_INFINITY,a=y(e.map((s)=>m(s)),t.map((s)=>m(s)),r),l=[],f=-1,o=-1,u=[];for(let[s,c]of a)u.push([f+1,s,o+1,c]),l.push({aIndex:s,bIndex:c,identical:!0}),f=s,o=c;u.push([f+1,e.length,o+1,t.length]);for(let[s,c,x,I]of u){let J=e.slice(s,c),O=t.slice(x,I);for(let[M,N]of y(J.map((p)=>g(p)),O.map((p)=>g(p)),r))l.push({aIndex:s+M,bIndex:x+N,identical:!1})}return l.toSorted((s,c)=>s.aIndex-c.aIndex)}function d(e,t){if(e.ops.length>=e.maxOps)throw new h;e.ops.push(t)}function b(e,t,i,r){for(let f of new Set([...Object.keys(i),...Object.keys(r)])){if(f==="children")continue;if(!(f in r))d(e,{key:f,op:"set-key",path:t});else if(!zs(i[f],r[f]))d(e,{key:f,op:"set-key",path:t,value:r[f]})}let a=i.children,l=r.children;if(Array.isArray(a)&&Array.isArray(l))D(e,t,a,l);else if(!zs(a,l))d(e,{key:"children",op:"set-key",path:t,value:l})}function D(e,t,i,r){let a=XE(i,r),l=new Set(a.map((o)=>o.aIndex)),f=new Map(a.map((o)=>[o.bIndex,o]));for(let o=i.length-1;o>=0;o--)if(!l.has(o))d(e,{index:o,op:"remove-child",parentPath:t});for(let[o,u]of r.entries()){let s=f.get(o);if(!s){d(e,{index:o,node:u,op:"insert-child",parentPath:t});continue}if(s.identical)continue;let c=i[s.aIndex];if(v(c)&&v(u))b(e,[...t,"children",o],c,u);else if(!zs(c,u))d(e,{index:o,node:u,op:"set-child",parentPath:t})}}function G2(e,t,i={}){let r={maxOps:i.maxOps??S,ops:[]};try{b(r,[],e,t)}catch(a){if(a instanceof h)return null;throw a}return r.ops}
|
|
2
|
+
export{zs,XE,G2};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=EEEA7915DD6D8EDD64756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-zht0x0v3.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{n,
|
|
2
|
-
export{
|
|
1
|
+
import{n,_}from"./studio-kt2j51sa.js";var w=["order","widths","hidden","sort","groupBy","filter"],g="jx-grid-layout:";function c(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}function u(e){let t=c()?.getItem(g+e);if(!t)return null;try{let r=JSON.parse(t);return _(r)?r:null}catch{return null}}function f(e,t){c()?.setItem(g+e,JSON.stringify(t))}function a(e){let t={};for(let r of w)if(e[r]!==void 0)Object.assign(t,{[r]:e[r]});return t}function v(e){return JSON.stringify(w.map((t)=>e[t]??null))}function Cd(e){let t=u(e);return t?a(t):null}function em(e,t){if(!c())return;let o=u(e)??{},s={...o,widths:{...o.widths,...t.widths}};for(let i of w)if(i!=="widths"&&t[i]!==void 0)Object.assign(s,{[i]:t[i]});f(e,s)}function zk(e){let t=u(e);if(!t)return;let r={active:null};if(t.views)r.views=t.views;f(e,r)}function Du(e){let t=u(e)?.views;return Array.isArray(t)?t.filter((r)=>G(r)):[]}function G(e){return _(e)&&"name"in e&&n(e.name)}function E_(e){return u(e)?.active??null}function FR(e){let t=u(e),r=t?.active;if(!t||!r)return!1;let o=Du(e).find((s)=>s.name===r);return o?v(a(o))!==v(a(t)):!1}function jR(e,t){let r=t.trim(),o=c();if(r===""||!o)return null;let s=u(e)??{},i={name:r,...a(s)},d=Du(e).filter((l)=>l.name!==r);return d.push(i),f(e,{...s,active:r,views:d}),i}function Fy(e,t){let r=Du(e).find((i)=>i.name===t);if(!r||!c())return null;let o=u(e)??{},s=a(r);return f(e,{active:r.name,views:o.views??[],...s}),s}function Wk(e,t){let r=u(e);if(!r||!c())return!1;let o=Du(e),s=o.filter((i)=>i.name!==t);if(s.length===o.length)return!1;return f(e,{...r,active:r.active===t?null:r.active??null,views:s}),!0}function HR(e,t){if(!t)return e;let r=new Set(t.hidden),o=[];for(let i of e){if(i.field!==void 0&&r.has(i.field))continue;let d=i.field?t.widths?.[i.field]:void 0;o.push(d?{...i,width:d}:i)}if(!t.order?.length)return o;let s=new Map(t.order.map((i,d)=>[i,d]));return o.map((i,d)=>({def:i,index:d})).toSorted((i,d)=>{let l=s.get(i.def.field??"")??t.order.length+i.index,p=s.get(d.def.field??"")??t.order.length+d.index;return l-p}).map(({def:i})=>i)}
|
|
2
|
+
export{Cd,em,zk,Du,E_,FR,jR,Fy,Wk,HR};
|
|
3
3
|
|
|
4
|
-
//# debugId=
|
|
5
|
-
//# sourceMappingURL=studio-
|
|
4
|
+
//# debugId=FE514F84F46649C464756E2164756E21
|
|
5
|
+
//# sourceMappingURL=studio-zm7dnr9g.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p,a,f}from"./iframe-entry-
|
|
1
|
+
import{p,a,f}from"./iframe-entry-b5qgggyp.js";import{t}from"./iframe-entry-42hpmwz5.js";var j=150,R=6,h=4,w=new WeakMap,g=new WeakMap;function D(e,n){let o=g.get(e);if(!o){let l=new Set,s=(u)=>{if(!(u instanceof KeyboardEvent)||u.key!=="Escape")return;for(let c of l)c()};e.addEventListener("keydown",s,!0),o={dismiss:l,listener:s},g.set(e,o)}let{dismiss:i,listener:r}=o;return i.add(n),()=>{if(i.delete(n),i.size===0&&g.get(e)?.listener===r)e.removeEventListener("keydown",r,!0),g.delete(e)}}function G(e){try{return e.matches(":popover-open")}catch{return!1}}function U(e,n){if(n)return!1;if(!(e instanceof Element))return!0;try{return e.matches(":focus-visible")}catch{return!0}}var v=new WeakMap;function K(){return t(globalThis.HTMLButtonElement)&&"interestForElement"in HTMLButtonElement.prototype}function J(e,n){return K()&&e.id!==""&&n.getAttribute("interestfor")===e.id}function Q(e,n){a(e,n)}function V(e){f(e)}function X(e,n){if(J(e,n))return()=>{};let o=e.getRootNode(),i=null,r=null,l=!1,s=!1,u=!1,c=!1,m=!1,d=()=>{if(i!==null)clearTimeout(i),i=null;if(r!==null)clearTimeout(r),r=null},M=()=>{d(),m=!0,Q(e,n)},y=()=>{m=!1,V(e)},H=()=>{if(d(),l||s||u)return;y()},I=()=>{d();let T="delay"in e?Number(e.delay)||0:0;i=setTimeout(M,T)},S=()=>{d(),r=setTimeout(H,j)},O=()=>{l=!0,I()},A=()=>{l=!1,c=!1,S()},B=()=>{c=!0},N=()=>{c=!1},P=(T)=>{let E=U(T.target,c);if(c=!1,!E)return;u=!0,M()},q=()=>{u=!1,H()},C=()=>{s=!0,d()},z=()=>{s=!1,S()},W=()=>{if(!m&&!G(e))return;d(),y()},x=[[n,"pointerenter",O],[n,"pointerleave",A],[n,"pointerdown",B],[n,"pointerup",N],[n,"focusin",P],[n,"focusout",q],[e,"pointerenter",C],[e,"pointerleave",z]];for(let[T,E,b]of x)T.addEventListener(E,b,!0);let _=D(o,W);return()=>{d(),_();for(let[T,E,b]of x)T.removeEventListener(E,b,!0)}}function k(e,n){let o=n.getRootNode(),i=e.for??"",r=i===""?null:o.getElementById?.(i)??null;if(r)return r;let l=n.id;if(!/^[\w-]+$/.test(l))return null;return o.querySelector(`[interestfor="${l}"]`)}function L(e,n){let o=k(e,n);if(o)return o;let i=n.getRootNode(),r=n.id;if(!/^[\w-]+$/.test(r))return null;return i.querySelector(`[aria-describedby~="${r}"]`)}function Y(e,n){let o=L(e,n);if(!o)return;let i=o.getBoundingClientRect();if(i.width===0&&i.height===0)return;e.x=Math.round(i.left),e.y=Math.round(i.bottom+R),e.flipped=!1;let r=()=>{let l=n.getBoundingClientRect();if(l.width===0&&l.height===0)return;if(l.right>window.innerWidth-h)e.x=Math.max(h,Math.round(window.innerWidth-l.width-h));if(l.bottom>window.innerHeight-h)e.y=Math.max(h,Math.round(i.top-l.height-R)),e.flipped=!0};if(t(globalThis.requestAnimationFrame))requestAnimationFrame(r);else r()}function Z(e,n){v.get(e)?.();let o=L(e,n),i=()=>{if(!o||e.anchored!==!0)return;let m=n.getBoundingClientRect(),d=o.getBoundingClientRect();if(m.width===0&&m.height===0)return;e.flipped=m.bottom<=d.top};if(!o||!t(globalThis.requestAnimationFrame))return i(),()=>{};let r=null,l=()=>{r=null,i()},s=()=>{if(r===null)r=requestAnimationFrame(l)};window.addEventListener("scroll",s,{capture:!0,passive:!0}),window.addEventListener("resize",s);let u=t(globalThis.ResizeObserver)?new ResizeObserver(s):null;if(u)u.observe(n),u.observe(o);let c=()=>{if(r!==null)cancelAnimationFrame(r),r=null;if(window.removeEventListener("scroll",s,{capture:!0}),window.removeEventListener("resize",s),u?.disconnect(),v.get(e)===c)v.delete(e)};return v.set(e,c),s(),c}function te(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open",r="source"in n?n.source:null,l=r instanceof Element?r:L(e,o);if(e.anchored=i&&l!==null,!i)e.flipped=!1}function oe(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i="newState"in n&&n.newState==="open";if(e.open=i,!i){v.get(e)?.();return}if(e.anchored===!0&&p())Z(e,o);else Y(e,o)}function ie(e,n){let o=n.currentTarget;if(!(o instanceof HTMLElement))return;let i=k(e,o);if(!i)return;w.get(e)?.dispose(),w.set(e,{dispose:X(o,i),tip:o})}function re(e){v.get(e)?.();let n=w.get(e);if(!n)return;queueMicrotask(()=>{if(w.get(e)!==n)return;if(n.tip.isConnected)return;n.dispose(),w.delete(e)})}var F=0;function le(e,n){F+=1,e.uid=`${n.localName}-${F}`}export{j as TOOLTIP_HIDE_GRACE_MS,X as bindTooltip,Z as measureAnchoredFlip,le as mintHintId,te as onTooltipBeforeToggle,ie as onTooltipReady,oe as onTooltipToggle,re as onTooltipUnmount,Y as placeTooltip,K as supportsInterestInvokers};
|
|
2
2
|
|
|
3
3
|
//# debugId=F94B5FFCE20D7B3B64756E2164756E21
|
|
4
|
-
//# sourceMappingURL=tooltip-
|
|
4
|
+
//# sourceMappingURL=tooltip-dj1pvgz7.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t}from"./iframe-entry-
|
|
1
|
+
import{t}from"./iframe-entry-42hpmwz5.js";var p="jx-tree",y="jx-tree-item",L=new WeakMap,H=new WeakMap,T=new WeakMap;function b(n){let e=n.currentTarget;return e instanceof HTMLElement&&e.localName===p?e:null}function v(n,e){return e instanceof Element&&e.closest(p)===n}function h(n,e,r){let o=n[e];return o===void 0?n.getAttribute(r)??"":String(o)}function u(n){return h(n,"value","value")}function g(n){let e=Number(h(n,"level","aria-level"));return Number.isFinite(e)&&e>=1?Math.trunc(e):1}function M(n){let e=h(n,"expanded","aria-expanded");return e==="true"||e==="false"?e:""}function E(n){return n.disabled===void 0?n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true":n.disabled===!0}function N(n){let e=h(n,"label","label");return e===""?n.textContent:e}function K(n,e={}){let r=[...n.querySelectorAll(y)].filter((o)=>o.closest(p)===n);return e.includeDisabled?r:r.filter((o)=>!E(o))}function x(n){let e=K(n,{includeDisabled:!0});if(e.length===0)return;let r=String(n.current??""),o=e.filter((l)=>!E(l)),a=o.find((l)=>u(l)===r)??o[0]??null;for(let l of e)l.caret=l===a;F(n,r,a)}function P(n,e){let r=n.ownerDocument,o=r.activeElement;if(o instanceof Node&&n.contains(o))return!0;return(o===null||o===r.body)&&e.held!==null&&!e.held.isConnected}function F(n,e,r){let o=T.get(n);if(!o)return;if(!P(n,o)){T.delete(n);return}if(e===o.from||r===null||u(r)!==e)return;if(r.focus(),n.ownerDocument.activeElement===r)T.delete(n)}function W(n){if(H.has(n))return;let e=new MutationObserver(()=>{x(n)});e.observe(n,{attributeFilter:["tabindex"],attributes:!0,childList:!0,subtree:!0}),H.set(n,e)}function z(n){let e=String(n.current??""),r=L.get(n);if(r)x(r);return e}function G(n,e){let r=b(e);if(!r)return;L.set(n,r),x(r),W(r)}function j(n,e){return n.findIndex((r)=>r===e||e instanceof Node&&r.contains(e))}function f(n,e,r){n.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:r}))}function O(n,e,r){if(e.current=u(r),x(n),r.focus(),t(r.scrollIntoView))r.scrollIntoView({block:"nearest"});f(n,"change",u(r))}function S(n){return Number(n.padtop??0)>0}function D(n){return Number(n.padbottom??0)>0}function A(n,e){T.set(n,{from:String(e.current??""),held:n.ownerDocument.activeElement})}function I(n,e,r){A(n,e),f(n,"move",{from:String(e.current??""),key:r})}function R(n){return S(n)||D(n)}function V(n,e,r){A(n,e),f(n,"typeahead",{char:r,from:String(e.current??"")})}function w(n,e,r,o,a){let l=e.multiple===!0?o:"replace",d=String(e.anchor??""),i=l==="range"?d===""?a||r:d:r;e.anchor=i,f(n,"select",{anchor:i,mode:l,value:r})}function C(n){if(n.shiftKey)return"range";return n.ctrlKey||n.metaKey?"toggle":"replace"}function _(n){return n.key.length===1&&!n.ctrlKey&&!n.metaKey&&!n.altKey?n.key.toLowerCase():null}function q(n,e,r){let o=n.map((a)=>N(a).trim().toLowerCase());for(let a=1;a<=o.length;a++){let l=(e+a)%o.length;if(o[l].startsWith(r))return l}return-1}function B(n,e){let r=g(n[e]);for(let o=e-1;o>=0;o--)if(g(n[o])<r)return o;return-1}function J(n,e){let r=b(e);if(!r||!v(r,e.target))return;let o=K(r);if(o.length===0)return;let a=j(o,e.target),l=String(n.current??""),d=e.ctrlKey||e.metaKey,i=o[a],s=null;switch(e.key){case"ArrowDown":{s={key:e.key,select:!d,to:a===-1?0:a+1};break}case"ArrowUp":{s={key:e.key,select:!d,to:a===-1?o.length-1:a-1};break}case"Home":case"End":{if(e.key==="Home"?S(n):D(n)){e.preventDefault(),e.stopPropagation(),I(r,n,e.key);return}s={key:e.key,select:!0,to:e.key==="Home"?0:o.length-1};break}case"ArrowRight":{if(!i)return;let c=M(i);if(c==="")return;if(c==="false"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!0,value:u(i)});return}let m=o[a+1];if(m&&g(m)<=g(i))return;s={key:e.key,select:!0,to:a+1};break}case"ArrowLeft":{if(!i)return;if(M(i)==="true"){e.preventDefault(),e.stopPropagation(),f(r,"expand",{expanded:!1,value:u(i)});return}let c=B(o,a);if(c===-1&&g(i)===1)return;s={key:e.key,select:!0,to:c};break}case"Enter":{if(!i)return;e.preventDefault(),e.stopPropagation(),f(r,"activate",u(i));return}case" ":{if(!i)return;e.preventDefault(),e.stopPropagation(),w(r,n,u(i),n.multiple===!0?"toggle":"replace",l);return}default:{let c=_(e);if(c===null)return;if(R(n)){e.preventDefault(),e.stopPropagation(),V(r,n,c);return}let m=q(o,a,c);if(m===-1)return;s={key:e.key,select:!0,to:m}}}e.preventDefault(),e.stopPropagation();let k=o[s.to];if(!k){if(s.to<0?S(n):D(n))I(r,n,s.key);return}if(O(r,n,k),s.select)w(r,n,u(k),C(e),l)}function Q(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;let a=String(n.current??"");O(r,n,o),w(r,n,u(o),C(e),a)}function X(n,e){let r=b(e);if(!r||!(e.target instanceof Element))return;let o=e.target.closest(y);if(!o||o.closest(p)!==r||E(o))return;f(r,"activate",u(o))}function Y(n,e){let r=b(e);if(!r||!v(r,e.target)||!(e.target instanceof Element))return;e.stopPropagation();let o=e.target.closest(y);if(!o||E(o))return;f(r,"expand",{expanded:M(o)!=="true",value:u(o)})}export{z as applyCurrent,K as itemsOf,Q as onTreeClick,X as onTreeDblClick,J as onTreeKeydown,G as onTreeMount,Y as onTreeToggle,x as syncTree};
|
|
2
2
|
|
|
3
3
|
//# debugId=3A07049B25E0DD9964756E2164756E21
|
|
4
|
-
//# sourceMappingURL=tree-
|
|
4
|
+
//# sourceMappingURL=tree-j0ebwr5s.js.map
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import{ip,
|
|
1
|
+
import{ip,ga,G0,wd,zn,we}from"./studio-z42kysg7.js";import{Ux}from"./studio-hxq1ebp0.js";import{mI}from"./studio-mmqr9awv.js";class z{constructor(o,e){this._modeId=o,this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker()),this._updateExtraLibsToken=0,this._extraLibsChangeListener=this._defaults.onDidExtraLibsChange(()=>this._updateExtraLibs())}dispose(){this._configChangeListener.dispose(),this._extraLibsChangeListener.dispose(),this._stopWorker()}_stopWorker(){if(this._worker)this._worker.dispose(),this._worker=null;this._client=null}async _updateExtraLibs(){if(!this._worker)return;let o=++this._updateExtraLibsToken,e=await this._worker.getProxy();if(this._updateExtraLibsToken!==o)return;e.updateExtraLibs(this._defaults.getExtraLibs())}_getClient(){if(!this._client)this._client=(async()=>{if(this._worker=Ux({moduleId:"vs/language/typescript/tsWorker",createWorker:()=>new Worker(new URL("ts.worker.js",import.meta.url),{type:"module"}),label:this._modeId,keepIdleModels:!0,createData:{compilerOptions:this._defaults.getCompilerOptions(),extraLibs:this._defaults.getExtraLibs(),customWorkerPath:this._defaults.workerOptions.customWorkerPath,inlayHintsOptions:this._defaults.inlayHintsOptions}}),this._defaults.getEagerModelSync())return await this._worker.withSyncedResources(zn.getModels().filter((o)=>o.getLanguageId()===this._modeId).map((o)=>o.uri));return await this._worker.getProxy()})();return this._client}async getLanguageServiceWorker(...o){let e=await this._getClient();if(this._worker)await this._worker.withSyncedResources(o);return e}}var i={};i["lib.d.ts"]=!0;i["lib.decorators.d.ts"]=!0;i["lib.decorators.legacy.d.ts"]=!0;i["lib.dom.asynciterable.d.ts"]=!0;i["lib.dom.d.ts"]=!0;i["lib.dom.iterable.d.ts"]=!0;i["lib.es2015.collection.d.ts"]=!0;i["lib.es2015.core.d.ts"]=!0;i["lib.es2015.d.ts"]=!0;i["lib.es2015.generator.d.ts"]=!0;i["lib.es2015.iterable.d.ts"]=!0;i["lib.es2015.promise.d.ts"]=!0;i["lib.es2015.proxy.d.ts"]=!0;i["lib.es2015.reflect.d.ts"]=!0;i["lib.es2015.symbol.d.ts"]=!0;i["lib.es2015.symbol.wellknown.d.ts"]=!0;i["lib.es2016.array.include.d.ts"]=!0;i["lib.es2016.d.ts"]=!0;i["lib.es2016.full.d.ts"]=!0;i["lib.es2016.intl.d.ts"]=!0;i["lib.es2017.arraybuffer.d.ts"]=!0;i["lib.es2017.d.ts"]=!0;i["lib.es2017.date.d.ts"]=!0;i["lib.es2017.full.d.ts"]=!0;i["lib.es2017.intl.d.ts"]=!0;i["lib.es2017.object.d.ts"]=!0;i["lib.es2017.sharedmemory.d.ts"]=!0;i["lib.es2017.string.d.ts"]=!0;i["lib.es2017.typedarrays.d.ts"]=!0;i["lib.es2018.asyncgenerator.d.ts"]=!0;i["lib.es2018.asynciterable.d.ts"]=!0;i["lib.es2018.d.ts"]=!0;i["lib.es2018.full.d.ts"]=!0;i["lib.es2018.intl.d.ts"]=!0;i["lib.es2018.promise.d.ts"]=!0;i["lib.es2018.regexp.d.ts"]=!0;i["lib.es2019.array.d.ts"]=!0;i["lib.es2019.d.ts"]=!0;i["lib.es2019.full.d.ts"]=!0;i["lib.es2019.intl.d.ts"]=!0;i["lib.es2019.object.d.ts"]=!0;i["lib.es2019.string.d.ts"]=!0;i["lib.es2019.symbol.d.ts"]=!0;i["lib.es2020.bigint.d.ts"]=!0;i["lib.es2020.d.ts"]=!0;i["lib.es2020.date.d.ts"]=!0;i["lib.es2020.full.d.ts"]=!0;i["lib.es2020.intl.d.ts"]=!0;i["lib.es2020.number.d.ts"]=!0;i["lib.es2020.promise.d.ts"]=!0;i["lib.es2020.sharedmemory.d.ts"]=!0;i["lib.es2020.string.d.ts"]=!0;i["lib.es2020.symbol.wellknown.d.ts"]=!0;i["lib.es2021.d.ts"]=!0;i["lib.es2021.full.d.ts"]=!0;i["lib.es2021.intl.d.ts"]=!0;i["lib.es2021.promise.d.ts"]=!0;i["lib.es2021.string.d.ts"]=!0;i["lib.es2021.weakref.d.ts"]=!0;i["lib.es2022.array.d.ts"]=!0;i["lib.es2022.d.ts"]=!0;i["lib.es2022.error.d.ts"]=!0;i["lib.es2022.full.d.ts"]=!0;i["lib.es2022.intl.d.ts"]=!0;i["lib.es2022.object.d.ts"]=!0;i["lib.es2022.regexp.d.ts"]=!0;i["lib.es2022.string.d.ts"]=!0;i["lib.es2023.array.d.ts"]=!0;i["lib.es2023.collection.d.ts"]=!0;i["lib.es2023.d.ts"]=!0;i["lib.es2023.full.d.ts"]=!0;i["lib.es2023.intl.d.ts"]=!0;i["lib.es2024.arraybuffer.d.ts"]=!0;i["lib.es2024.collection.d.ts"]=!0;i["lib.es2024.d.ts"]=!0;i["lib.es2024.full.d.ts"]=!0;i["lib.es2024.object.d.ts"]=!0;i["lib.es2024.promise.d.ts"]=!0;i["lib.es2024.regexp.d.ts"]=!0;i["lib.es2024.sharedmemory.d.ts"]=!0;i["lib.es2024.string.d.ts"]=!0;i["lib.es5.d.ts"]=!0;i["lib.es6.d.ts"]=!0;i["lib.esnext.array.d.ts"]=!0;i["lib.esnext.collection.d.ts"]=!0;i["lib.esnext.d.ts"]=!0;i["lib.esnext.decorators.d.ts"]=!0;i["lib.esnext.disposable.d.ts"]=!0;i["lib.esnext.error.d.ts"]=!0;i["lib.esnext.float16.d.ts"]=!0;i["lib.esnext.full.d.ts"]=!0;i["lib.esnext.intl.d.ts"]=!0;i["lib.esnext.iterator.d.ts"]=!0;i["lib.esnext.promise.d.ts"]=!0;i["lib.esnext.sharedmemory.d.ts"]=!0;i["lib.scripthost.d.ts"]=!0;i["lib.webworker.asynciterable.d.ts"]=!0;i["lib.webworker.d.ts"]=!0;i["lib.webworker.importscripts.d.ts"]=!0;i["lib.webworker.iterable.d.ts"]=!0;function M(o,e,n=0){if(typeof o==="string")return o;else if(o===void 0)return"";let c="";if(n){c+=e;for(let r=0;r<n;r++)c+=" "}if(c+=o.messageText,n++,o.next)for(let r of o.next)c+=M(r,e,n);return c}function v(o){if(o)return o.map((e)=>e.text).join("");return""}class b{constructor(o){this._worker=o}_textSpanToRange(o,e){let n=o.getPositionAt(e.start),c=o.getPositionAt(e.start+e.length),{lineNumber:r,column:s}=n,{lineNumber:d,column:t}=c;return{startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t}}}class A{constructor(o){this._worker=o,this._libFiles={},this._hasFetchedLibFiles=!1,this._fetchLibFilesPromise=null}isLibFile(o){if(!o)return!1;if(o.path.indexOf("/lib.")===0)return!!i[o.path.slice(1)];return!1}getOrCreateModel(o){let e=wd.parse(o),n=zn.getModel(e);if(n)return n;if(this.isLibFile(e)&&this._hasFetchedLibFiles)return zn.createModel(this._libFiles[e.path.slice(1)],"typescript",e);let c=mI.getExtraLibs()[o];if(c)return zn.createModel(c.content,"typescript",e);return null}_containsLibFile(o){for(let e of o)if(this.isLibFile(e))return!0;return!1}async fetchLibFilesIfNecessary(o){if(!this._containsLibFile(o))return;await this._fetchLibFiles()}_fetchLibFiles(){if(!this._fetchLibFilesPromise)this._fetchLibFilesPromise=this._worker().then((o)=>o.getLibFiles()).then((o)=>{this._hasFetchedLibFiles=!0,this._libFiles=o});return this._fetchLibFilesPromise}}class C extends b{constructor(o,e,n,c){super(c);this._libFiles=o,this._defaults=e,this._selector=n,this._disposables=[],this._listener=Object.create(null);let r=(t)=>{if(t.getLanguageId()!==n)return;let l=()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u){if(t.isAttachedToEditor())this._doValidate(t)}else this._doValidate(t)},p,g=t.onDidChangeContent(()=>{clearTimeout(p),p=window.setTimeout(l,500)}),m=t.onDidChangeAttached(()=>{let{onlyVisible:u}=this._defaults.getDiagnosticsOptions();if(u)if(t.isAttachedToEditor())l();else zn.setModelMarkers(t,this._selector,[])});this._listener[t.uri.toString()]={dispose(){g.dispose(),m.dispose(),clearTimeout(p)}},l()},s=(t)=>{zn.setModelMarkers(t,this._selector,[]);let l=t.uri.toString();if(this._listener[l])this._listener[l].dispose(),delete this._listener[l]};this._disposables.push(zn.onDidCreateModel((t)=>r(t))),this._disposables.push(zn.onWillDisposeModel(s)),this._disposables.push(zn.onDidChangeModelLanguage((t)=>{s(t.model),r(t.model)})),this._disposables.push({dispose(){for(let t of zn.getModels())s(t)}});let d=()=>{for(let t of zn.getModels())s(t),r(t)};this._disposables.push(this._defaults.onDidChange(d)),this._disposables.push(this._defaults.onDidExtraLibsChange(d)),zn.getModels().forEach((t)=>r(t))}dispose(){this._disposables.forEach((o)=>o&&o.dispose()),this._disposables=[]}async _doValidate(o){let e=await this._worker(o.uri);if(o.isDisposed())return;let n=[],{noSyntaxValidation:c,noSemanticValidation:r,noSuggestionDiagnostics:s}=this._defaults.getDiagnosticsOptions();if(!c)n.push(e.getSyntacticDiagnostics(o.uri.toString()));if(!r)n.push(e.getSemanticDiagnostics(o.uri.toString()));if(!s)n.push(e.getSuggestionDiagnostics(o.uri.toString()));let d=await Promise.all(n);if(!d||o.isDisposed())return;let t=d.reduce((p,g)=>g.concat(p),[]).filter((p)=>(this._defaults.getDiagnosticsOptions().diagnosticCodesToIgnore||[]).indexOf(p.code)===-1),l=t.map((p)=>p.relatedInformation||[]).reduce((p,g)=>g.concat(p),[]).map((p)=>p.file?wd.parse(p.file.fileName):null);if(await this._libFiles.fetchLibFilesIfNecessary(l),o.isDisposed())return;zn.setModelMarkers(o,this._selector,t.map((p)=>this._convertDiagnostics(o,p)))}_convertDiagnostics(o,e){let n=e.start||0,c=e.length||1,{lineNumber:r,column:s}=o.getPositionAt(n),{lineNumber:d,column:t}=o.getPositionAt(n+c),l=[];if(e.reportsUnnecessary)l.push(G0.Unnecessary);if(e.reportsDeprecated)l.push(G0.Deprecated);return{severity:this._tsDiagnosticCategoryToMarkerSeverity(e.category),startLineNumber:r,startColumn:s,endLineNumber:d,endColumn:t,message:M(e.messageText,`
|
|
2
2
|
`),code:e.code.toString(),tags:l,relatedInformation:this._convertRelatedInformation(o,e.relatedInformation)}}_convertRelatedInformation(o,e){if(!e)return[];let n=[];return e.forEach((c)=>{let r=o;if(c.file)r=this._libFiles.getOrCreateModel(c.file.fileName);if(!r)return;let s=c.start||0,d=c.length||1,{lineNumber:t,column:l}=r.getPositionAt(s),{lineNumber:p,column:g}=r.getPositionAt(s+d);n.push({resource:r.uri,startLineNumber:t,startColumn:l,endLineNumber:p,endColumn:g,message:M(c.messageText,`
|
|
3
|
-
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(o){switch(o){case 1:return
|
|
3
|
+
`)})}),n}_tsDiagnosticCategoryToMarkerSeverity(o){switch(o){case 1:return ga.Error;case 3:return ga.Info;case 0:return ga.Warning;case 2:return ga.Hint}return ga.Info}}class x extends b{get triggerCharacters(){return["."]}async provideCompletionItems(o,e,n,c){let r=o.getWordUntilPosition(e),s=new ip(e.lineNumber,r.startColumn,e.lineNumber,r.endColumn),d=o.uri,t=o.getOffsetAt(e),l=await this._worker(d);if(o.isDisposed())return;let p=await l.getCompletionsAtPosition(d.toString(),t);if(!p||o.isDisposed())return;return{suggestions:p.entries.map((m)=>{let u=s;if(m.replacementSpan){let k=o.getPositionAt(m.replacementSpan.start),y=o.getPositionAt(m.replacementSpan.start+m.replacementSpan.length);u=new ip(k.lineNumber,k.column,y.lineNumber,y.column)}let w=[];if(m.kindModifiers!==void 0&&m.kindModifiers.indexOf("deprecated")!==-1)w.push(we.CompletionItemTag.Deprecated);return{uri:d,position:e,offset:t,range:u,label:m.name,insertText:m.name,sortText:m.sortText,kind:x.convertKind(m.kind),tags:w}})}}async resolveCompletionItem(o,e){let n=o,{uri:c,position:r,offset:s}=n,t=await(await this._worker(c)).getCompletionEntryDetails(c.toString(),s,n.label);if(!t)return n;return{uri:c,position:r,label:t.name,kind:x.convertKind(t.kind),detail:v(t.displayParts),documentation:{value:x.createDocumentationString(t)}}}static convertKind(o){switch(o){case a.primitiveType:case a.keyword:return we.CompletionItemKind.Keyword;case a.variable:case a.localVariable:return we.CompletionItemKind.Variable;case a.memberVariable:case a.memberGetAccessor:case a.memberSetAccessor:return we.CompletionItemKind.Field;case a.function:case a.memberFunction:case a.constructSignature:case a.callSignature:case a.indexSignature:return we.CompletionItemKind.Function;case a.enum:return we.CompletionItemKind.Enum;case a.module:return we.CompletionItemKind.Module;case a.class:return we.CompletionItemKind.Class;case a.interface:return we.CompletionItemKind.Interface;case a.warning:return we.CompletionItemKind.File}return we.CompletionItemKind.Property}static createDocumentationString(o){let e=v(o.documentation);if(o.tags)for(let n of o.tags)e+=`
|
|
4
4
|
|
|
5
5
|
${R(n)}`;return e}}function R(o){let e=`*@${o.name}*`;if(o.name==="param"&&o.text){let[n,...c]=o.text;if(e+=`\`${n.text}\``,c.length>0)e+=` — ${c.map((r)=>r.text).join(" ")}`}else if(Array.isArray(o.text))e+=` — ${o.text.map((n)=>n.text).join(" ")}`;else if(o.text)e+=` — ${o.text}`;return e}class L extends b{constructor(){super(...arguments);this.signatureHelpTriggerCharacters=["(",","]}static _toSignatureHelpTriggerReason(o){switch(o.triggerKind){case we.SignatureHelpTriggerKind.TriggerCharacter:if(o.triggerCharacter)if(o.isRetrigger)return{kind:"retrigger",triggerCharacter:o.triggerCharacter};else return{kind:"characterTyped",triggerCharacter:o.triggerCharacter};else return{kind:"invoked"};case we.SignatureHelpTriggerKind.ContentChange:return o.isRetrigger?{kind:"retrigger"}:{kind:"invoked"};case we.SignatureHelpTriggerKind.Invoke:default:return{kind:"invoked"}}}async provideSignatureHelp(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getSignatureHelpItems(r.toString(),s,{triggerReason:L._toSignatureHelpTriggerReason(c)});if(!t||o.isDisposed())return;let l={activeSignature:t.selectedItemIndex,activeParameter:t.argumentIndex,signatures:[]};return t.items.forEach((p)=>{let g={label:"",parameters:[]};g.documentation={value:v(p.documentation)},g.label+=v(p.prefixDisplayParts),p.parameters.forEach((m,u,w)=>{let k=v(m.displayParts),y={label:k,documentation:{value:v(m.documentation)}};if(g.label+=k,g.parameters.push(y),u<w.length-1)g.label+=v(p.separatorDisplayParts)}),g.label+=v(p.suffixDisplayParts),l.signatures.push(g)}),{value:l,dispose(){}}}}class S extends b{async provideHover(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getQuickInfoAtPosition(c.toString(),r);if(!d||o.isDisposed())return;let t=v(d.documentation),l=d.tags?d.tags.map((g)=>R(g)).join(`
|
|
6
6
|
|
|
7
7
|
`):"",p=v(d.displayParts);return{range:this._textSpanToRange(o,d.textSpan),contents:[{value:"```typescript\n"+p+"\n```\n"},{value:t+(l?`
|
|
8
8
|
|
|
9
|
-
`+l:"")}]}}}class I extends b{async provideDocumentHighlights(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDocumentHighlights(c.toString(),r,[c.toString()]);if(!d||o.isDisposed())return;return d.flatMap((t)=>t.highlightSpans.map((l)=>({range:this._textSpanToRange(o,l.textSpan),kind:l.kind==="writtenReference"?we.DocumentHighlightKind.Write:we.DocumentHighlightKind.Text})))}}class T extends b{constructor(o,e){super(e);this._libFiles=o}async provideDefinition(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDefinitionAtPosition(c.toString(),r);if(!d||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(d.map((l)=>
|
|
9
|
+
`+l:"")}]}}}class I extends b{async provideDocumentHighlights(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDocumentHighlights(c.toString(),r,[c.toString()]);if(!d||o.isDisposed())return;return d.flatMap((t)=>t.highlightSpans.map((l)=>({range:this._textSpanToRange(o,l.textSpan),kind:l.kind==="writtenReference"?we.DocumentHighlightKind.Write:we.DocumentHighlightKind.Text})))}}class T extends b{constructor(o,e){super(e);this._libFiles=o}async provideDefinition(o,e,n){let c=o.uri,r=o.getOffsetAt(e),s=await this._worker(c);if(o.isDisposed())return;let d=await s.getDefinitionAtPosition(c.toString(),r);if(!d||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(d.map((l)=>wd.parse(l.fileName))),o.isDisposed())return;let t=[];for(let l of d){let p=this._libFiles.getOrCreateModel(l.fileName);if(p)t.push({uri:p.uri,range:this._textSpanToRange(p,l.textSpan)})}return t}}class D extends b{constructor(o,e){super(e);this._libFiles=o}async provideReferences(o,e,n,c){let r=o.uri,s=o.getOffsetAt(e),d=await this._worker(r);if(o.isDisposed())return;let t=await d.getReferencesAtPosition(r.toString(),s);if(!t||o.isDisposed())return;if(await this._libFiles.fetchLibFilesIfNecessary(t.map((p)=>wd.parse(p.fileName))),o.isDisposed())return;let l=[];for(let p of t){let g=this._libFiles.getOrCreateModel(p.fileName);if(g)l.push({uri:g.uri,range:this._textSpanToRange(g,p.textSpan)})}return l}}class j extends b{async provideDocumentSymbols(o,e){let n=o.uri,c=await this._worker(n);if(o.isDisposed())return;let r=await c.getNavigationTree(n.toString());if(!r||o.isDisposed())return;let s=(t,l)=>({name:t.text,detail:"",kind:h[t.kind]||we.SymbolKind.Variable,range:this._textSpanToRange(o,t.spans[0]),selectionRange:this._textSpanToRange(o,t.spans[0]),tags:[],children:t.childItems?.map((g)=>s(g,t.text)),containerName:l});return r.childItems?r.childItems.map((t)=>s(t)):[]}}class a{}a.unknown="";a.keyword="keyword";a.script="script";a.module="module";a.class="class";a.interface="interface";a.type="type";a.enum="enum";a.variable="var";a.localVariable="local var";a.function="function";a.localFunction="local function";a.memberFunction="method";a.memberGetAccessor="getter";a.memberSetAccessor="setter";a.memberVariable="property";a.constructorImplementation="constructor";a.callSignature="call";a.indexSignature="index";a.constructSignature="construct";a.parameter="parameter";a.typeParameter="type parameter";a.primitiveType="primitive type";a.label="label";a.alias="alias";a.const="const";a.let="let";a.warning="warning";var h=Object.create(null);h[a.module]=we.SymbolKind.Module;h[a.class]=we.SymbolKind.Class;h[a.enum]=we.SymbolKind.Enum;h[a.interface]=we.SymbolKind.Interface;h[a.memberFunction]=we.SymbolKind.Method;h[a.memberVariable]=we.SymbolKind.Property;h[a.memberGetAccessor]=we.SymbolKind.Property;h[a.memberSetAccessor]=we.SymbolKind.Property;h[a.variable]=we.SymbolKind.Variable;h[a.const]=we.SymbolKind.Variable;h[a.localVariable]=we.SymbolKind.Variable;h[a.variable]=we.SymbolKind.Variable;h[a.function]=we.SymbolKind.Function;h[a.localFunction]=we.SymbolKind.Function;class f extends b{static _convertOptions(o){return{ConvertTabsToSpaces:o.insertSpaces,TabSize:o.tabSize,IndentSize:o.tabSize,IndentStyle:2,NewLineCharacter:`
|
|
10
10
|
`,InsertSpaceAfterCommaDelimiter:!0,InsertSpaceAfterSemicolonInForStatements:!0,InsertSpaceBeforeAndAfterBinaryOperators:!0,InsertSpaceAfterKeywordsInControlFlowStatements:!0,InsertSpaceAfterFunctionKeywordForAnonymousFunctions:!0,InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis:!1,InsertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets:!1,InsertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces:!1,PlaceOpenBraceOnNewLineForControlBlocks:!1,PlaceOpenBraceOnNewLineForFunctions:!1}}_convertTextChanges(o,e){return{text:e.newText,range:this._textSpanToRange(o,e.span)}}}class q extends f{constructor(){super(...arguments);this.canFormatMultipleRanges=!1}async provideDocumentRangeFormattingEdits(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getFormattingEditsForRange(r.toString(),s,d,f._convertOptions(n));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class B extends f{get autoFormatTriggerCharacters(){return[";","}",`
|
|
11
11
|
`]}async provideOnTypeFormattingEdits(o,e,n,c,r){let s=o.uri,d=o.getOffsetAt(e),t=await this._worker(s);if(o.isDisposed())return;let l=await t.getFormattingEditsAfterKeystroke(s.toString(),d,n,f._convertOptions(c));if(!l||o.isDisposed())return;return l.map((p)=>this._convertTextChanges(o,p))}}class F extends f{async provideCodeActions(o,e,n,c){let r=o.uri,s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=f._convertOptions(o.getOptions()),l=n.markers.filter((u)=>u.code).map((u)=>u.code).map(Number),p=await this._worker(r);if(o.isDisposed())return;let g=await p.getCodeFixesAtPosition(r.toString(),s,d,l,t);if(!g||o.isDisposed())return{actions:[],dispose:()=>{}};return{actions:g.filter((u)=>u.changes.filter((w)=>w.isNewFile).length===0).map((u)=>this._tsCodeFixActionToMonacoCodeAction(o,n,u)),dispose:()=>{}}}_tsCodeFixActionToMonacoCodeAction(o,e,n){let c=[];for(let s of n.changes)for(let d of s.textChanges)c.push({resource:o.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(o,d.span),text:d.newText}});return{title:n.description,edit:{edits:c},diagnostics:e.markers,kind:"quickfix"}}}class E extends b{constructor(o,e){super(e);this._libFiles=o}async provideRenameEdits(o,e,n,c){let r=o.uri,s=r.toString(),d=o.getOffsetAt(e),t=await this._worker(r);if(o.isDisposed())return;let l=await t.getRenameInfo(s,d,{allowRenameOfImportPath:!1});if(l.canRename===!1)return{edits:[],rejectReason:l.localizedErrorMessage};if(l.fileToRename!==void 0)throw Error("Renaming files is not supported.");let p=await t.findRenameLocations(s,d,!1,!1,!1);if(!p||o.isDisposed())return;let g=[];for(let m of p){let u=this._libFiles.getOrCreateModel(m.fileName);if(u)g.push({resource:u.uri,versionId:void 0,textEdit:{range:this._textSpanToRange(u,m.textSpan),text:n}});else throw Error(`Unknown file ${m.fileName}.`)}return{edits:g}}}class N extends b{async provideInlayHints(o,e,n){let c=o.uri,r=c.toString(),s=o.getOffsetAt({lineNumber:e.startLineNumber,column:e.startColumn}),d=o.getOffsetAt({lineNumber:e.endLineNumber,column:e.endColumn}),t=await this._worker(c);if(o.isDisposed())return null;return{hints:(await t.provideInlayHints(r,s,d)).map((g)=>({...g,label:g.text,position:o.getPositionAt(g.position),kind:this._convertHintKind(g.kind)})),dispose:()=>{}}}_convertHintKind(o){switch(o){case"Parameter":return we.InlayHintKind.Parameter;case"Type":return we.InlayHintKind.Type;default:return we.InlayHintKind.Type}}}var W,H;function Ot(o){H=O(o,"typescript")}function _t(o){W=O(o,"javascript")}function Pt(){return new Promise((o,e)=>{if(!W)return e("JavaScript not registered!");o(W)})}function Vt(){return new Promise((o,e)=>{if(!H)return e("TypeScript not registered!");o(H)})}function O(o,e){let n=[],c=new z(e,o),r=(...t)=>c.getLanguageServiceWorker(...t),s=new A(r);function d(){let{modeConfiguration:t}=o;if(_(n),t.completionItems)n.push(we.registerCompletionItemProvider(e,new x(r)));if(t.signatureHelp)n.push(we.registerSignatureHelpProvider(e,new L(r)));if(t.hovers)n.push(we.registerHoverProvider(e,new S(r)));if(t.documentHighlights)n.push(we.registerDocumentHighlightProvider(e,new I(r)));if(t.definitions)n.push(we.registerDefinitionProvider(e,new T(s,r)));if(t.references)n.push(we.registerReferenceProvider(e,new D(s,r)));if(t.documentSymbols)n.push(we.registerDocumentSymbolProvider(e,new j(r)));if(t.rename)n.push(we.registerRenameProvider(e,new E(s,r)));if(t.documentRangeFormattingEdits)n.push(we.registerDocumentRangeFormattingEditProvider(e,new q(r)));if(t.onTypeFormattingEdits)n.push(we.registerOnTypeFormattingEditProvider(e,new B(r)));if(t.codeActions)n.push(we.registerCodeActionProvider(e,new F(r)));if(t.inlayHints)n.push(we.registerInlayHintsProvider(e,new N(r)));if(t.diagnostics)n.push(new C(s,o,e,r))}return d(),r}function _(o){while(o.length)o.pop().dispose()}export{b as Adapter,F as CodeActionAdaptor,T as DefinitionAdapter,C as DiagnosticsAdapter,I as DocumentHighlightAdapter,q as FormatAdapter,f as FormatHelper,B as FormatOnTypeAdapter,N as InlayHintsAdapter,a as Kind,A as LibFiles,j as OutlineAdapter,S as QuickInfoAdapter,D as ReferenceAdapter,E as RenameAdapter,L as SignatureHelpAdapter,x as SuggestAdapter,z as WorkerManager,M as flattenDiagnosticMessageText,Pt as getJavaScriptWorker,Vt as getTypeScriptWorker,_t as setupJavaScript,Ot as setupTypeScript};
|
|
12
12
|
|
|
13
|
-
//# debugId=
|
|
14
|
-
//# sourceMappingURL=tsMode-
|
|
13
|
+
//# debugId=43F48FD4ABD8C69A64756E2164756E21
|
|
14
|
+
//# sourceMappingURL=tsMode-vra2hh7y.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{ui,Fm,F$,m,u,Gr,pn,Zl,Er,jm,EC,TC,Xl,Hm,Bm,LC,$C,IC,zm,wh,Ql,qp,Jd,RC,_i,Xc,DC,Fx,j$,Yd,H$,B$,Ht,dv,jx,z$}from"./studio-y1x65h5r.js";import"./studio-grp684wx.js";import"./studio-6vrxzkba.js";import"./studio-hw60n5dh.js";import"./studio-tpmnbgmt.js";import"./studio-pr23qhrw.js";export{F$ as MAX_PANES,ui as PRIMARY_PANE,Fm as SECONDARY_PANE,Ht as activateTab,Gr as activePane,u as activeTab,RC as clearPaneActiveTab,H$ as closeAllTabs,Hm as closePane,Yd as closeTab,zm as detachTab,Er as focusPane,wh as insertIntoPane,jm as isPaneFocused,qp as isTabActive,j$ as moveTab,dv as moveTabToPane,_i as openTab,TC as paneBeside,pn as paneById,Bm as paneIsEmpty,Zl as paneOfTab,DC as promoteDirtyPreviewTabs,Xc as promoteTab,Xl as receivingPane,z$ as registerTabCommands,jx as renameTab,B$ as replaceAllTabs,IC as setCloseLanding,$C as setEmptyPaneFallback,Fx as setTabPinned,LC as setTabScope,Ql as setWorkspaceProject,EC as splitRight,Jd as tabIsLive,m as workspace};
|
|
2
|
+
|
|
3
|
+
//# debugId=45ACB254DB7F46E164756E2164756E21
|
|
4
|
+
//# sourceMappingURL=workspace-3nt93k48.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b2,Q0,mk,gk,e_,Ag,bk}from"./studio-1fvzq9vs.js";import"./studio-v0gsjav0.js";import"./studio-pbagym4j.js";import"./studio-8m1t83kn.js";import"./studio-89cwmnae.js";import"./studio-3pndhat0.js";import"./studio-bf0rgyf7.js";import"./studio-g6ysm05p.js";import"./studio-j4e627w1.js";import"./studio-d140sy8e.js";import"./studio-74nzv280.js";import"./studio-xddgbwhe.js";import"./studio-fw3jp9m7.js";import"./studio-f8kz3krj.js";import"./studio-c4rcaftm.js";import"./studio-a3evp7f6.js";import"./studio-a6x058ew.js";import"./studio-bqgs90r8.js";import"./studio-332hesdk.js";import"./studio-2dtc90zs.js";import"./studio-1yhz0s8p.js";import"./studio-rdnezzkd.js";import"./studio-wcakp5bt.js";import"./studio-p89w12s2.js";import"./studio-nm9qev4p.js";import"./studio-5abge3wy.js";import"./studio-v2ek69cb.js";import"./studio-m4w6sygj.js";import"./studio-txkx6586.js";import"./studio-hvxt8z79.js";import"./studio-gmhd0j3f.js";import"./studio-0khd0xdw.js";import"./studio-3q6n9qvq.js";import"./studio-02phtmqn.js";import"./studio-2b8443ms.js";import"./studio-7cg75gtj.js";import"./studio-9wyqyfqy.js";import"./studio-cq87hree.js";import"./studio-hnx1h1pr.js";import"./studio-y1x65h5r.js";import"./studio-grp684wx.js";import"./studio-6vrxzkba.js";import"./studio-hw60n5dh.js";import"./studio-nqxqf8p2.js";import"./studio-tpmnbgmt.js";import"./studio-pr23qhrw.js";import"./studio-k1wvtp03.js";export{b2 as WORKSPACE_HOME_MODE_SET,Ag as detachWorkspaceHome,Q0 as isWorkspaceHomeMode,mk as openWorkspaceHome,gk as placeWorkspaceHome,bk as renderWorkspaceHome,e_ as workspaceHomeMounted};
|
|
2
|
+
|
|
3
|
+
//# debugId=9DAC49D9E47DF08064756E2164756E21
|
|
4
|
+
//# sourceMappingURL=workspace-home-zbgyqqws.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{uk,os,Ja,hk,vr,_t,Ya,Wo,Za,tr,Dt,Xa,Su,rp,xd,UI,qI,GI,pk,fk}from"./studio-94ppxeqy.js";import{xy}from"./studio-8nyw10dp.js";var x=30000;class I extends uk{constructor(e){super();this.doc=e,this.clientID=e.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{let r=Su();if(this.getLocalState()!==null&&x/2<=r-this.meta.get(this.clientID).lastUpdated)this.setLocalState(this.getLocalState());let s=[];if(this.meta.forEach((o,c)=>{if(c!==this.clientID&&x<=r-o.lastUpdated&&this.states.has(c))s.push(c)}),s.length>0)L(this,s,"timeout")},os(x/10)),e.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(e){let r=this.clientID,s=this.meta.get(r),o=s===void 0?0:s.clock+1,c=this.states.get(r);if(e===null)this.states.delete(r);else this.states.set(r,e);this.meta.set(r,{clock:o,lastUpdated:Su()});let a=[],d=[],y=[],f=[];if(e===null)f.push(r);else if(c==null){if(e!=null)a.push(r)}else if(d.push(r),!rp(c,e))y.push(r);if(a.length>0||y.length>0||f.length>0)this.emit("change",[{added:a,updated:y,removed:f},"local"]);this.emit("update",[{added:a,updated:d,removed:f},"local"])}setLocalStateField(e,r){let s=this.getLocalState();if(s!==null)this.setLocalState({...s,[e]:r})}getStates(){return this.states}}var L=(e,r,s)=>{let o=[];for(let c=0;c<r.length;c++){let a=r[c];if(e.states.has(a)){if(e.states.delete(a),a===e.clientID){let d=e.meta.get(a);e.meta.set(a,{clock:d.clock+1,lastUpdated:Su()})}o.push(a)}}if(o.length>0)e.emit("change",[{added:[],updated:[],removed:o},s]),e.emit("update",[{added:[],updated:[],removed:o},s])},M=(e,r,s=e.states)=>{let o=r.length,c=Ja();_t(c,o);for(let a=0;a<o;a++){let d=r[a],y=s.get(d)||null,f=e.meta.get(d).clock;_t(c,d),_t(c,f),Ya(c,JSON.stringify(y))}return vr(c)};var F=(e,r,s)=>{let o=Za(r),c=Su(),a=[],d=[],y=[],f=[],U=Dt(o);for(let b=0;b<U;b++){let h=Dt(o),g=Dt(o),S=JSON.parse(Xa(o)),v=e.meta.get(h),k=e.states.get(h),w=v===void 0?0:v.clock;if(w<g||w===g&&S===null&&e.states.has(h)){if(S===null)if(h===e.clientID&&e.getLocalState()!=null)g++;else e.states.delete(h);else e.states.set(h,S);if(e.meta.set(h,{clock:g,lastUpdated:c}),v===void 0&&S!==null)a.push(h);else if(v!==void 0&&S===null)f.push(h);else if(S!==null){if(!rp(S,k))y.push(h);d.push(h)}}}if(a.length>0||y.length>0||f.length>0)e.emit("change",[{added:a,updated:y,removed:f},s]);if(a.length>0||d.length>0||f.length>0)e.emit("update",[{added:a,updated:d,removed:f},s])};var W=0,D=1,R=2,j=(e,r)=>{_t(e,W);let s=GI(r);Wo(e,s)},H=(e,r,s)=>{_t(e,D),Wo(e,qI(r,s))},B=(e,r,s)=>H(r,s,tr(e)),N=(e,r,s,o)=>{try{UI(r,tr(e),s)}catch(c){if(o!=null)o(c);console.error("Caught error while handling a Yjs update",c)}},J=(e,r)=>{_t(e,R),Wo(e,r)},z=N,_=(e,r,s,o,c)=>{let a=Dt(e);switch(a){case W:B(e,r,s);break;case D:N(e,s,o,c);break;case R:z(e,s,o,c);break;default:throw Error("Unknown message type")}return a};var K=1;function se(e){let r=e.webSocketImpl??globalThis.WebSocket,s=e.openTimeoutMs??1e4,o=new Map,c=new Set,a=new xd,d=new I(a);d.setLocalState(null);let y=null,f=null,U="connecting",b=!1,h=(n)=>{if(U===n)return;U=n;for(let t of c)t(n)},g=(n)=>{if(y&&y.readyState===K)try{y.send(pk(n))}catch{}},S=(n)=>{g({message:{path:n,type:"open"},type:"control"})};d.on("update",(n,t)=>{if(t==="remote")return;let l=[...n.added,...n.updated,...n.removed];g({body:M(d,l),type:"awareness"})});let v=(n)=>{switch(n.type){case"hello":{let t={color:n.color,login:n.login,permission:n.permission};if(n.name!==void 0)t.name=n.name;if(n.avatarUrl!==void 0)t.avatarUrl=n.avatarUrl;f=t;return}case"opened":{let t=o.get(n.path);if(!t)return;if(t.opened&&t.epoch!==n.epoch){w(n.path,t);return}t.epoch=n.epoch,t.opened=!0,t.resolveOpen?.(!0),t.resolveOpen=null;let l=Ja();j(l,t.doc),g({body:vr(l),epoch:t.epoch,path:n.path,type:"doc-sync"});return}case"doc-reset":{let t=o.get(n.path);if(t)w(n.path,t);return}case"flush-ack":{let t=o.get(n.path);if(t){for(let l of t.pendingFlush)l();t.pendingFlush.clear()}return}case"doc-dirty":{let t=o.get(n.path);if(t){t.dirty=n.dirty;for(let l of t.dirtyCbs)l(n.dirty)}return}case"error":{if(!n.path)return;let t=o.get(n.path);if(!t)return;if(n.code==="content-not-loaded"&&e.hydratePath&&!t.hydrated){t.hydrated=!0,e.hydratePath(n.path).then(()=>S(n.path),()=>{t.resolveOpen?.(!1),t.resolveOpen=null});return}if(!t.opened)t.resolveOpen?.(!1),t.resolveOpen=null;break}default:break}},k=(n,t,l)=>{let u=o.get(n);if(!u||!u.opened||u.epoch!==t)return;let i=Za(l),m=Ja(),T=_(i,m,u.doc,"remote");if(hk(m)>0)g({body:vr(m),epoch:t,path:n,type:"doc-sync"});if(T===D&&!u.synced)u.synced=!0,u.resolveSynced()},w=(n,t)=>{o.delete(n),t.resolveOpen?.(!1),t.resolveOpen=null;for(let l of t.resetCbs)l();t.doc.destroy()},P=()=>{h("connecting");let n=e.protocols,t=n===void 0||n.length===0?new r(e.url):new r(e.url,n);y=t,t.binaryType="arraybuffer",t.onopen=()=>{O.opened(),h("connected");for(let u of o.keys())S(u);if(d.getLocalState()!==null)g({body:M(d,[d.clientID]),type:"awareness"})},t.onmessage=(l)=>{let u=l.data,i=u instanceof ArrayBuffer?new Uint8Array(u):u instanceof Uint8Array?u:null;if(!i)return;let m;try{m=fk(i)}catch{return}switch(m.type){case"control":{v(m.message);return}case"doc-sync":{k(m.path,m.epoch,m.body);return}case"awareness":{F(d,m.body,"remote");break}default:break}},t.onclose=()=>{if(b)return;h("offline");for(let l of o.values())l.opened=!1;O.scheduleRetry()},t.onerror=()=>{}},A={};if(e.reconnectDelayMs!==void 0)A.baseMs=e.reconnectDelayMs;if(e.reconnectRandom!==void 0)A.random=e.reconnectRandom;let O=xy(P,A);return P(),{destroy(){if(b)return;b=!0,O.dispose(),L(d,[d.clientID],"destroy"),d.destroy(),a.destroy();for(let[n,t]of o)t.resolveOpen?.(!1),t.doc.destroy(),o.delete(n);y?.close()},async openDoc(n){if(b)return null;let t=o.get(n);if(t&&!t.handleDestroyed)return null;let l=()=>{},u=new Promise((p)=>{l=p}),i={dirty:!1,dirtyCbs:new Set,doc:new xd,epoch:0,handleDestroyed:!1,hydrated:!1,opened:!1,pendingFlush:new Set,resetCbs:new Set,resolveOpen:null,resolveSynced:l,synced:!1,whenSynced:u};if(o.set(n,i),i.doc.on("update",(p,V)=>{if(V==="remote"||!i.opened)return;let C=Ja();J(C,p),g({body:vr(C),epoch:i.epoch,path:n,type:"doc-sync"})}),!await new Promise((p)=>{i.resolveOpen=p;let V=setTimeout(()=>{i.resolveOpen=null,p(!1)},s);i.resolveOpen=(C)=>{clearTimeout(V),p(C)},S(n)})){if(o.get(n)===i)o.delete(n);return i.doc.destroy(),null}return{awareness:d,destroy:()=>{if(i.handleDestroyed)return;if(i.handleDestroyed=!0,o.get(n)===i)o.delete(n),g({path:n,type:"doc-close"});i.doc.destroy()},doc:i.doc,flush:()=>new Promise((p)=>{i.pendingFlush.add(p),g({message:{path:n,type:"flush"},type:"control"})}),identity:()=>f,onDirty:(p)=>(i.dirtyCbs.add(p),p(i.dirty),()=>i.dirtyCbs.delete(p)),onReset:(p)=>(i.resetCbs.add(p),()=>i.resetCbs.delete(p)),onStatus:(p)=>(c.add(p),()=>c.delete(p)),whenSynced:i.whenSynced}},status:()=>U}}export{se as createWsCollabConnection};
|
|
2
2
|
|
|
3
|
-
//# debugId=
|
|
4
|
-
//# sourceMappingURL=ws-client-
|
|
3
|
+
//# debugId=5B005AF330173F5D64756E2164756E21
|
|
4
|
+
//# sourceMappingURL=ws-client-72x5n99j.js.map
|