@field/cascade 0.8.0 → 0.10.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/AGENTS.md +17 -1
- package/CHANGELOG.md +214 -0
- package/DESIGN.md +14 -0
- package/README.md +41 -25
- package/dist/assets/CodeEditor-DSZBpzdy.js +623 -0
- package/dist/assets/CodePanel-sY6sZa7B.js +2 -0
- package/dist/assets/{CustomNodeDialog-BQbEhIwL.js → CustomNodeDialog-BRKnqZhp.js} +1 -1
- package/dist/assets/{ExportDialog-CjTbbTZJ.js → ExportDialog-C7dVGua4.js} +2 -2
- package/dist/assets/OpenGraphDialog-ZsgL-iwr.js +1 -0
- package/dist/assets/ProjectSettings-Cw17nNe3.js +2 -0
- package/dist/assets/SettingsDialog-p25h3tj0.js +1 -0
- package/dist/assets/{VersionHistoryDialog-D6VBzSQ0.js → VersionHistoryDialog-DzFLUotB.js} +2 -2
- package/dist/assets/{core-BInLG4gw.js → core-BICrEt0y.js} +8 -8
- package/dist/assets/{cssMode-DfR2qmYG.js → cssMode-D7TXw57I.js} +1 -1
- package/dist/assets/definitions-DUww2Rt-.js +1 -0
- package/dist/assets/{editor.api-Ck8_vgQV.js → editor.api-DvkCO3ko.js} +1 -1
- package/dist/assets/{freemarker2-fVn10Wn3.js → freemarker2-BA2lxsF1.js} +1 -1
- package/dist/assets/geo-C2RHOVHC.js +1 -0
- package/dist/assets/{handlebars-BCSchLT2.js → handlebars-BcDiyPd8.js} +1 -1
- package/dist/assets/{html-CVpSv_k9.js → html-C7O4TyhX.js} +1 -1
- package/dist/assets/{htmlMode-Da4ESTv0.js → htmlMode-WaDGF3Mj.js} +1 -1
- package/dist/assets/{image-BLn--oSF.js → image-DR4oeyJB.js} +3 -3
- package/dist/assets/index-7vae6YFC.css +1 -0
- package/dist/assets/index-DyvDC6pS.js +219 -0
- package/dist/assets/index-client-DqYmKstU.js +1 -0
- package/dist/assets/{javascript-BpX0Gvcf.js → javascript-CpIEK7tz.js} +1 -1
- package/dist/assets/{jsonMode-CsLqaou7.js → jsonMode-B2FltW0f.js} +1 -1
- package/dist/assets/legacy-CTEeXeqF.js +2 -0
- package/dist/assets/{liquid-efUz51Wf.js → liquid-CN6FFHZE.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-DCi5-K0n.js → lspLanguageFeatures-QhV9XtLp.js} +1 -1
- package/dist/assets/math-DaDEgWKt.js +1 -0
- package/dist/assets/{mdx-DP_sjGVy.js → mdx-DE89pafV.js} +1 -1
- package/dist/assets/pop-pLH7L0PW.js +1 -0
- package/dist/assets/{python-aAuP3LUi.js → python-ByTllTB9.js} +1 -1
- package/dist/assets/{razor-7M6sMmC5.js → razor-USYlRRCE.js} +1 -1
- package/dist/assets/studioScenes-8sq9FfFg.js +1 -0
- package/dist/assets/{tsMode-Bf4CnoYK.js → tsMode-BXpN8iUz.js} +1 -1
- package/dist/assets/{typescript-ddhYBGyT.js → typescript-DInBjGQQ.js} +1 -1
- package/dist/assets/{workers-X5la8DDT.js → workers-C7Ye5B7D.js} +1 -1
- package/dist/assets/{xml-BzbXa3Ps.js → xml-U0Uocqyo.js} +1 -1
- package/dist/assets/{yaml-CXs-VzxL.js → yaml-CBw_PVYf.js} +1 -1
- package/dist/cli/index.js +19978 -3423
- package/dist/cli/runtime/stage.ts +70 -10
- package/dist/contracts/bundle.d.ts +75 -0
- package/dist/contracts/bundle.js +112 -0
- package/dist/contracts/definition.d.ts +67 -4
- package/dist/contracts/document.d.ts +29 -0
- package/dist/contracts/editor.d.ts +172 -0
- package/dist/contracts/editor.js +2 -0
- package/dist/contracts/index.d.ts +2 -0
- package/dist/contracts/index.js +2 -0
- package/dist/contracts/validate.js +59 -3
- package/dist/contracts/values.d.ts +3 -3
- package/dist/contracts/values.js +1 -0
- package/dist/index.html +4 -4
- package/dist/player/app.js +17 -5
- package/dist/player/editor.js +1894 -0
- package/dist/player/editorEngine.js +477 -0
- package/dist/runtime/builtins/core/bundle.d.ts +70 -0
- package/dist/runtime/builtins/core/bundle.js +81 -0
- package/dist/runtime/builtins/core/index.d.ts +3 -2
- package/dist/runtime/builtins/core/index.js +6 -2
- package/dist/runtime/builtins/core/routing.d.ts +27 -0
- package/dist/runtime/builtins/core/routing.js +28 -0
- package/dist/runtime/edit/document.d.ts +94 -0
- package/dist/runtime/edit/document.js +194 -0
- package/dist/runtime/edit/graphEditor.d.ts +223 -0
- package/dist/runtime/edit/graphEditor.js +893 -0
- package/dist/runtime/edit/index.d.ts +12 -0
- package/dist/runtime/edit/index.js +6 -0
- package/dist/runtime/edit/layout.d.ts +50 -0
- package/dist/runtime/edit/layout.js +126 -0
- package/dist/runtime/edit/operations.d.ts +65 -0
- package/dist/runtime/edit/operations.js +57 -0
- package/dist/runtime/edit/parameters.d.ts +75 -0
- package/dist/runtime/edit/parameters.js +284 -0
- package/dist/runtime/edit/read.d.ts +35 -0
- package/dist/runtime/edit/read.js +65 -0
- package/dist/runtime/editor/index.d.ts +104 -0
- package/dist/runtime/editor/index.js +439 -0
- package/dist/runtime/expressions/bundlePaths.d.ts +37 -0
- package/dist/runtime/expressions/bundlePaths.js +55 -0
- package/dist/runtime/expressions/index.d.ts +2 -0
- package/dist/runtime/expressions/index.js +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.js +2 -0
- package/dist/runtime/params/animator.d.ts +5 -0
- package/dist/runtime/params/animator.js +16 -0
- package/dist/runtime/runtime.js +238 -12
- package/dist/runtime/seed.d.ts +29 -0
- package/dist/runtime/seed.js +52 -0
- package/dist/runtime/types.d.ts +12 -0
- package/dist/stage.js +40 -9
- package/dist/studio/panel.d.ts +2 -0
- package/doc/CLI_REFERENCE.md +100 -0
- package/doc/EDITOR_EXPORT.md +226 -0
- package/doc/HEADLESS_GPU.md +27 -0
- package/doc/MCP.md +53 -0
- package/doc/NODE_REFERENCE.md +66 -0
- package/doc/PROJECT_AUTHORING.md +137 -0
- package/package.json +15 -6
- package/dist/assets/CodeEditor-BEk-kIBd.js +0 -623
- package/dist/assets/CodePanel-CeSdjXkg.js +0 -2
- package/dist/assets/OpenGraphDialog-DCwH9itM.js +0 -1
- package/dist/assets/ProjectSettings-Dg7M5xt9.js +0 -2
- package/dist/assets/SettingsDialog-e7GgsjB9.js +0 -1
- package/dist/assets/definitions-DZpOjWKR.js +0 -1
- package/dist/assets/geo-D2VPjAdt.js +0 -1
- package/dist/assets/index-CMiBdEuT.js +0 -212
- package/dist/assets/index-DMIuml9a.css +0 -1
- package/dist/assets/index-client-BI2H82FJ.js +0 -1
- package/dist/assets/legacy-ZA7textG.js +0 -2
- package/dist/assets/math-B6hpxPJO.js +0 -1
- package/dist/assets/pop-CYUIjT6x.js +0 -1
- package/dist/assets/projectSettingsApi-C1WvIwfP.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeEditor-DSZBpzdy.js","assets/legacy-CTEeXeqF.js","assets/nodeTypeUtils-BDJsc2Ks.js","assets/index-DyvDC6pS.js","assets/index-client-DqYmKstU.js","assets/index-7vae6YFC.css","assets/editor.api-DvkCO3ko.js","assets/editor-1FQrmyyI.css","assets/CodeEditor-DR7u0q7p.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Dt as e,G as t,M as n,Ot as r,Q as i,U as a,V as o,W as s,Z as c,ct as l,dt as u,et as d,ht as f,i as p,it as m,jt as h,l as g,nt as _,ot as v,pt as y,r as b,rt as x,st as S,vt as C,yt as w,z as T}from"./legacy-CTEeXeqF.js";import{P as E,et as D}from"./index-DyvDC6pS.js";var O=t(`<div class="loading svelte-1pkj8m">Loading editor...</div>`),k=t(`<div class="error svelte-1pkj8m">Loading...</div>`),A=t(`<div class="error svelte-1pkj8m"> </div>`),j=t(`<div class="panel-wrapper svelte-1pkj8m"><!></div>`);function M(t,M){r(M,!1);let N=()=>w(D,`$sharedContextStore`,P),[P,F]=C(),I=u(null);b(async()=>{let e=await E(()=>import(`./CodeEditor-DSZBpzdy.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8]));y(I,e.default)});let L=p(M,`panelParams`,8),R=p(M,`panelApi`,8),z=p(M,`graph`,12,void 0),B=p(M,`onRecordHistory`,12,void 0),V=u(null),H=L()?.nodeId;function U(){R()?.close&&R().close()}_(()=>N(),()=>{N()&&(z(N().graph),B(N().onRecordHistory))}),_(()=>c(z()),()=>{z()&&H?y(V,z().getNode(H)||null):y(V,null)}),_(()=>(c(R()),i(V)),()=>{R()?.setTitle&&i(V)&&R().setTitle(`Code: ${i(V).id}`)}),x(),g();var W=j(),G=v(W),K=e=>{var t=s(),r=S(t);{let e=f(()=>(c(z()),d(()=>z().packageManager||null)));n(r,()=>i(I),(t,n)=>{n(t,{get node(){return i(V)},get graph(){return z()},get packageManager(){return i(e)},onClose:U,showCloseButton:!1,get onRecordHistory(){return B()}})})}a(e,t)},q=e=>{var t=O();a(e,t)},J=e=>{var t=k();a(e,t)},Y=e=>{var t=A(),n=l(t);m(()=>o(n,`Node not found: ${H??``}`)),a(e,t)};T(G,e=>{i(V)&&z()&&i(I)?e(K):i(I)?z()?e(Y,-1):e(J,2):e(q,1)}),h(W),a(t,W),e(),F()}export{M as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{At as e,Dt as t,G as n,I as r,L as i,O as ee,Ot as a,Q as o,U as s,V as c,W as l,X as u,Z as d,_ as te,at as f,b as p,ct as m,d as h,dt as g,et as _,f as ne,i as v,it as y,jt as b,l as x,lt as S,nt as C,ot as w,p as re,pt as T,rt as E,s as ie,st as D,t as O,u as ae,v as k,z as A}from"./legacy-CTEeXeqF.js";import{H as j,U as M}from"./index-DyvDC6pS.js";var N=n(`<span class="auto-badge svelte-1c1mvak">auto</span>`),P=n(`<span class="radio-path svelte-1c1mvak"> </span>`),F=n(`<input type="text" class="custom-base-input svelte-1c1mvak" placeholder="e.g., cascade.mylib.MyBaseNode" autocomplete="off"/>`),I=n(`<label><input type="radio" name="baseClass" class="svelte-1c1mvak"/> <div class="radio-content svelte-1c1mvak"><div class="radio-header svelte-1c1mvak"><span class="radio-label svelte-1c1mvak"> </span> <!></div> <!></div></label>`),oe=n(`<div class="dialog-overlay svelte-1c1mvak"><div class="dialog svelte-1c1mvak" role="dialog" aria-modal="true" aria-labelledby="custom-node-title"><div class="dialog-header svelte-1c1mvak"><h2 id="custom-node-title" class="svelte-1c1mvak">Create Custom Node</h2> <button class="close-button svelte-1c1mvak" aria-label="Close"><!></button></div> <form class="svelte-1c1mvak"><div class="form-group svelte-1c1mvak"><label for="node-name" class="svelte-1c1mvak">Node Name</label> <input id="node-name" type="text" placeholder="e.g., ParticleField" autocomplete="off" class="svelte-1c1mvak"/> <span class="hint svelte-1c1mvak">The display name for your node</span></div> <div class="form-group svelte-1c1mvak"><label for="module-path" class="svelte-1c1mvak">Module Path</label> <input id="module-path" type="text" placeholder="e.g., project.particle-field" autocomplete="off" class="svelte-1c1mvak"/> <span class="hint svelte-1c1mvak">Unique identifier for the node module <!></span></div> <div class="form-group svelte-1c1mvak"><span class="field-label svelte-1c1mvak">Base Class</span> <div class="base-class-options svelte-1c1mvak"></div></div> <div class="dialog-footer svelte-1c1mvak"><button type="button" class="cancel-button svelte-1c1mvak">Cancel</button> <button type="submit" class="create-button svelte-1c1mvak"><!> Create Node</button></div></form></div></div>`);function L(n,L){a(L,!1);let R=g(),se=[],z=v(L,`open`,12,!1),B=O(),V=g(``),H=g(``),U=g(`cascade.Node`),W=g(``),G=g(!0),K=[{id:`cascade.Node`,label:`Node`,description:`Base class for all nodes - use for general purpose computation`,template:`node`},{id:`cascade.image.ImageNodeBase`,label:`ImageNodeBase`,description:`Image processing base class with canvas/image utilities`,template:`image`},{id:`custom`,label:`Other`,description:`Specify a custom base class path`,template:`node`}];function ce(){T(G,!1)}function le(){let e=`local.${o(V).toLowerCase().replace(/[^a-z0-9]/g,``)}`;(o(H)===e||o(H)===``)&&T(G,!0)}function q(){if(!o(V).trim()||o(U)===`custom`&&!o(W).trim())return;let e=K.find(e=>e.id===o(U));B(`create`,{name:o(V).trim(),modulePath:o(H)||`local.${o(V).toLowerCase().replace(/[^a-z0-9]/g,``)}`,baseClass:o(R),template:e?.template||`node`}),Y()}function J(){Y(),B(`close`)}function Y(){T(V,``),T(H,``),T(U,`cascade.Node`),T(W,``),T(G,!0),z(!1)}function X(e){e.key===`Escape`?J():e.key===`Enter`&&!e.shiftKey&&(e.preventDefault(),q())}let Z=g();C(()=>(o(U),o(W)),()=>{T(R,o(U)===`custom`?o(W):o(U))}),C(()=>(o(G),o(V)),()=>{if(o(G)&&o(V)){let e=o(V).toLowerCase().replace(/[^a-z0-9]/g,``);T(H,`local.${e}`)}}),C(()=>(d(z()),o(Z)),()=>{z()&&o(Z)&&setTimeout(()=>o(Z)?.focus(),50)}),E(),x();var Q=l();u(`keydown`,f,X);var $=D(Q),ue=t=>{var n=oe(),a=w(n),l=w(a),d=S(w(l),2),f=w(d);M(f,{size:18}),b(d),b(l);var g=S(l,2),v=w(g),x=S(w(v),2);p(x),re(x,e=>T(Z,e),()=>o(Z)),e(2),b(v);var C=S(v,2),E=S(w(C),2);p(E);var D=S(E,2),O=S(w(D)),R=e=>{var t=N();s(e,t)};A(O,e=>{o(G)&&e(R)}),b(D),b(C);var z=S(C,2),B=S(w(z),2);r(B,5,()=>K,i,(e,t)=>{var n=I();let r;var i=w(n);p(i);var a,l=S(i,2),d=w(l),f=w(d),h=m(f,!0),g=S(f,2),v=e=>{var n=P(),r=m(n,!0);y(()=>c(r,(o(t),_(()=>o(t).id)))),s(e,n)};A(g,e=>{o(t),_(()=>o(t).id!==`custom`)&&e(v)}),b(d);var x=S(d,2),C=e=>{var t=F();p(t),k(t,()=>o(W),e=>T(W,e)),u(`click`,t,ne(function(e){ie.call(this,L,e)})),s(e,t)};A(x,e=>{o(t),o(U),_(()=>o(t).id===`custom`&&o(U)===`custom`)&&e(C)}),b(l),b(n),y(()=>{r=ee(n,1,`radio-option svelte-1c1mvak`,null,r,{selected:o(U)===o(t).id}),a!==(a=(o(t),_(()=>o(t).id)))&&(i.value=(i.__value=a)??``),c(h,(o(t),_(()=>o(t).label)))}),te(se,[],i,()=>(o(t),_(()=>o(t).id),o(U)),e=>T(U,e)),s(e,n)}),b(B),b(z);var Y=S(z,2),X=w(Y),Q=S(X,2),$=w(Q);j($,{name:`Zap`,size:14}),e(),b(Q),b(Y),b(g),b(a),b(n),y(e=>Q.disabled=e,[()=>(o(V),o(U),o(W),_(()=>!o(V).trim()||o(U)===`custom`&&!o(W).trim()))]),u(`click`,d,J),k(x,()=>o(V),e=>T(V,e)),u(`input`,x,le),k(E,()=>o(H),e=>T(H,e)),u(`input`,E,ce),u(`click`,X,J),u(`submit`,g,ae(q)),u(`click`,n,h(J)),s(t,n)};A($,e=>{z()&&e(ue)}),s(n,Q),t()}export{L as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{At as e,Dt as t,G as n,Ot as r,Q as i,T as a,U as o,V as s,W as c,X as l,at as u,b as d,ct as f,d as p,dt as m,i as h,it as g,jt as _,l as v,lt as y,ot as b,pt as x,q as S,st as C,t as w,v as T,w as E,z as D}from"./legacy-CTEeXeqF.js";function O(e){let t=e.elements.filter(e=>!e.isAnnotation).map(e=>{let t=e;return{id:t.id,type:t.type,code:t.code,position:t.position,inputs:t.inputs.map(e=>({id:e.id,name:e.name,portType:e.portType,dataType:e.dataType,value:e.value,defaultValue:e.defaultValue})),outputs:t.outputs.map(e=>({id:e.id,name:e.name,portType:e.portType,dataType:e.dataType,value:e.value}))}}),n=e.connections.map(e=>({id:e.id,from:e.from,to:e.to,type:e.type})),r=e.elements.filter(e=>!e.isAnnotation).map(e=>e).filter(e=>e.inputs.every(e=>e.connections.length===0)).map(e=>e.id);return`
|
|
2
2
|
const graphData = {
|
|
3
3
|
version: '1.0.0',
|
|
4
4
|
nodes: ${JSON.stringify(t,null,2)},
|
|
@@ -355,4 +355,4 @@ const graphData = {
|
|
|
355
355
|
</body>
|
|
356
356
|
</html>`,o=`// Minimal Cascade Runtime
|
|
357
357
|
${i}`,s=`// Compiled graph
|
|
358
|
-
${r}`,c=JSON.stringify(n.map(e=>({id:e.id,path:e.path,type:e.type,size:e.size})),null,2);N(a,`index.html`,`text/html`),setTimeout(()=>{N(o,`runtime.js`,`application/javascript`)},100),setTimeout(()=>{N(s,`graph.js`,`application/javascript`)},200),setTimeout(()=>{N(c,`assets.json`,`application/json`)},300),console.log(`Folder export initiated. Download the files and organize them in a folder structure:`),console.log(`- index.html`),console.log(`- runtime.js`),console.log(`- graph.js`),console.log(`- assets.json`),console.log(`- assets/ (create this folder and add your asset files)`)}var F=n(`<p class="svelte-12jesfv">This will export your project as a standalone HTML file with all assets embedded.</p> <ul class="svelte-12jesfv"><li class="svelte-12jesfv">✅ All nodes and connections</li> <li class="svelte-12jesfv">✅ All node code</li> <li class="svelte-12jesfv">✅ All assets (embedded as base64)</li> <li class="svelte-12jesfv">✅ Minimal runtime (~50KB)</li> <li class="svelte-12jesfv">✅ Single file - easy to share</li></ul>`,1),I=n(`<p class="svelte-12jesfv">This will export your project as a folder structure with separate files.</p> <ul class="svelte-12jesfv"><li class="svelte-12jesfv">✅ index.html - Main HTML file</li> <li class="svelte-12jesfv">✅ runtime.js - Cascade runtime</li> <li class="svelte-12jesfv">✅ graph.js - Compiled graph</li> <li class="svelte-12jesfv">✅ assets.json - Asset manifest</li> <li class="svelte-12jesfv">✅ assets/ - Asset files folder</li> <li class="svelte-12jesfv">⚠️ You'll need to manually organize asset files</li></ul>`,1),L=n(`<div class="error svelte-12jesfv"> </div>`),R=n(`<div class="overlay svelte-12jesfv"><div class="dialog svelte-12jesfv" role="dialog" aria-modal="true" aria-labelledby="export-title"><div class="header svelte-12jesfv"><h2 id="export-title" class="svelte-12jesfv">Export Project</h2> <button class="close-button svelte-12jesfv" aria-label="Close">×</button></div> <div class="content svelte-12jesfv"><div class="form-group svelte-12jesfv"><label for="project-name" class="svelte-12jesfv">Project Name</label> <input id="project-name" type="text" placeholder="My Project" class="svelte-12jesfv"/></div> <div class="form-group svelte-12jesfv"><label for="export-format" class="svelte-12jesfv">Export Format</label> <select id="export-format" class="svelte-12jesfv"><option>Single HTML File (all assets embedded)</option><option>Folder Structure (separate files)</option></select></div> <div class="info svelte-12jesfv"><!></div> <!></div> <div class="footer svelte-12jesfv"><button class="cancel-button svelte-12jesfv">Cancel</button> <button class="export-button svelte-12jesfv"><!></button></div></div></div>`);function z(n,O){
|
|
358
|
+
${r}`,c=JSON.stringify(n.map(e=>({id:e.id,path:e.path,type:e.type,size:e.size})),null,2);N(a,`index.html`,`text/html`),setTimeout(()=>{N(o,`runtime.js`,`application/javascript`)},100),setTimeout(()=>{N(s,`graph.js`,`application/javascript`)},200),setTimeout(()=>{N(c,`assets.json`,`application/json`)},300),console.log(`Folder export initiated. Download the files and organize them in a folder structure:`),console.log(`- index.html`),console.log(`- runtime.js`),console.log(`- graph.js`),console.log(`- assets.json`),console.log(`- assets/ (create this folder and add your asset files)`)}var F=n(`<p class="svelte-12jesfv">This will export your project as a standalone HTML file with all assets embedded.</p> <ul class="svelte-12jesfv"><li class="svelte-12jesfv">✅ All nodes and connections</li> <li class="svelte-12jesfv">✅ All node code</li> <li class="svelte-12jesfv">✅ All assets (embedded as base64)</li> <li class="svelte-12jesfv">✅ Minimal runtime (~50KB)</li> <li class="svelte-12jesfv">✅ Single file - easy to share</li></ul>`,1),I=n(`<p class="svelte-12jesfv">This will export your project as a folder structure with separate files.</p> <ul class="svelte-12jesfv"><li class="svelte-12jesfv">✅ index.html - Main HTML file</li> <li class="svelte-12jesfv">✅ runtime.js - Cascade runtime</li> <li class="svelte-12jesfv">✅ graph.js - Compiled graph</li> <li class="svelte-12jesfv">✅ assets.json - Asset manifest</li> <li class="svelte-12jesfv">✅ assets/ - Asset files folder</li> <li class="svelte-12jesfv">⚠️ You'll need to manually organize asset files</li></ul>`,1),L=n(`<div class="error svelte-12jesfv"> </div>`),R=n(`<div class="overlay svelte-12jesfv"><div class="dialog svelte-12jesfv" role="dialog" aria-modal="true" aria-labelledby="export-title"><div class="header svelte-12jesfv"><h2 id="export-title" class="svelte-12jesfv">Export Project</h2> <button class="close-button svelte-12jesfv" aria-label="Close">×</button></div> <div class="content svelte-12jesfv"><div class="form-group svelte-12jesfv"><label for="project-name" class="svelte-12jesfv">Project Name</label> <input id="project-name" type="text" placeholder="My Project" class="svelte-12jesfv"/></div> <div class="form-group svelte-12jesfv"><label for="export-format" class="svelte-12jesfv">Export Format</label> <select id="export-format" class="svelte-12jesfv"><option>Single HTML File (all assets embedded)</option><option>Folder Structure (separate files)</option></select></div> <div class="info svelte-12jesfv"><!></div> <!></div> <div class="footer svelte-12jesfv"><button class="cancel-button svelte-12jesfv">Cancel</button> <button class="export-button svelte-12jesfv"><!></button></div></div></div>`);function z(n,O){r(O,!1);let k=h(O,`graph`,8),A=h(O,`open`,12,!1),M=w(),z=m(`Cascade Project`),B=m(!1),V=m(null),H=m(`html`);async function U(){if(!(!k()||i(B))){x(B,!0),x(V,null);try{i(H)===`html`?N(await j(k(),i(z)),`${i(z).replace(/[^a-z0-9]/gi,`_`).toLowerCase()}.html`,`text/html`):await P(k(),i(z)),setTimeout(()=>{A(!1),M(`close`)},500)}catch(e){x(V,e.message||`Failed to export project`),console.error(`Export error:`,e)}finally{x(B,!1)}}}function W(){A(!1),M(`close`)}function G(e){e.key===`Escape`&&W()}v();var K=c();l(`keydown`,u,G);var q=C(K),J=t=>{var n=R(),r=b(n),c=b(r),u=y(b(c),2);_(c);var m=y(c,2),h=b(m),v=y(b(h),2);d(v),_(h);var C=y(h,2),w=y(b(C),2),O=b(w);O.value=O.__value=`html`;var k=y(O);k.value=k.__value=`folder`,_(w),a(w),_(C);var A=y(C,2),j=b(A),M=t=>{var n=F();e(2),o(t,n)},N=t=>{var n=I();e(2),o(t,n)};D(j,e=>{i(H)===`html`?e(M):e(N,-1)}),_(A);var P=y(A,2),G=e=>{var t=L(),n=f(t,!0);g(()=>s(n,i(V))),o(e,t)};D(P,e=>{i(V)&&e(G)}),_(m);var K=y(m,2),q=b(K),J=y(q,2),Y=b(J),X=e=>{var t=S(`Exporting...`);o(e,t)},Z=e=>{var t=S();g(()=>s(t,`Export ${i(H)===`html`?`HTML`:`Folder`}`)),o(e,t)};D(Y,e=>{i(B)?e(X):e(Z,-1)}),_(J),_(K),_(r),_(n),g(()=>{v.disabled=i(B),w.disabled=i(B),q.disabled=i(B),J.disabled=i(B)}),l(`click`,u,W),T(v,()=>i(z),e=>x(z,e)),E(w,()=>i(H),e=>x(H,e)),l(`click`,q,W),l(`click`,J,U),l(`click`,n,p(W)),o(t,n)};D(q,e=>{A()&&e(J)}),o(n,K),t()}export{z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dt as e,G as t,I as n,O as r,Ot as i,Q as a,U as o,V as s,W as c,X as l,Z as u,at as d,ct as f,d as p,dt as m,et as h,i as g,it as _,jt as v,l as y,lt as b,nt as x,ot as S,pt as C,rt as w,st as T,t as E,x as D,z as O}from"./legacy-CTEeXeqF.js";import{U as k}from"./index-DyvDC6pS.js";var A=t(`<p class="root svelte-1j8ra8p"> </p>`),j=t(`<p class="note svelte-1j8ra8p">Loading…</p>`),M=t(`<p class="note error svelte-1j8ra8p"> </p>`),N=t(`<p class="note svelte-1j8ra8p">No <code>.cascade</code> files at the project root.</p>`),P=t(`<span class="tag svelte-1j8ra8p">open</span>`),F=t(`<li><button><span class="name"> </span> <!></button></li>`),I=t(`<ul class="graphs svelte-1j8ra8p"></ul>`),L=t(`<div class="dialog-overlay svelte-1j8ra8p"><div class="dialog svelte-1j8ra8p" role="dialog" aria-modal="true" aria-labelledby="open-graph-title"><div class="dialog-header svelte-1j8ra8p"><h2 id="open-graph-title" class="svelte-1j8ra8p">Open graph</h2> <button class="close-button svelte-1j8ra8p" aria-label="Close"><!></button></div> <!> <div class="body svelte-1j8ra8p"><!></div> <div class="dialog-footer svelte-1j8ra8p"><button class="secondary svelte-1j8ra8p">Open from this computer…</button></div></div></div>`);function R(t,R){i(R,!1);let z=g(R,`open`,8,!1),B=g(R,`current`,8,null),V=E(),H=m([]),U=m(``),W=m(!1),G=m(null);async function K(){C(W,!0),C(G,null);try{let e=await fetch(`/api/graph`);if(!e.ok)throw Error(await e.text());let t=await e.json();C(H,Array.isArray(t.graphs)?t.graphs:[]),C(U,typeof t.root==`string`?t.root:``)}catch(e){C(G,e instanceof Error?e.message:String(e)),C(H,[])}finally{C(W,!1)}}function q(e){V(`choose`,{filename:e})}function J(){V(`close`)}function Y(e){e.key===`Escape`&&J()}x(()=>u(z()),()=>{z()&&K()}),w(),y();var X=c();l(`keydown`,d,Y);var Z=T(X),Q=e=>{var t=L(),i=S(t),c=S(i),u=b(S(c),2),d=S(u);k(d,{size:16}),v(u),v(c);var m=b(c,2),g=e=>{var t=A(),n=f(t,!0);_(()=>{D(t,`title`,a(U)),s(n,a(U))}),o(e,t)};O(m,e=>{a(U)&&e(g)});var y=b(m,2),x=S(y),C=e=>{var t=j();o(e,t)},w=e=>{var t=M(),n=f(t);_(()=>s(n,`No project on this server — ${a(G)??``}`)),o(e,t)},T=e=>{var t=N();o(e,t)},E=e=>{var t=I();n(t,5,()=>a(H),e=>e,(e,t)=>{var n=F(),i=S(n);let c;var u=S(i),d=f(u,!0),p=b(u,2),m=e=>{var t=P();o(e,t)};O(p,e=>{a(t)===B()&&e(m)}),v(i),v(n),_(()=>{c=r(i,1,`graph svelte-1j8ra8p`,null,c,{current:a(t)===B()}),s(d,a(t))}),l(`click`,i,()=>q(a(t))),o(e,n)}),v(t),o(e,t)};O(x,e=>{a(W)?e(C):a(G)?e(w,1):(a(H),h(()=>a(H).length===0)?e(T,2):e(E,-1))}),v(y);var R=b(y,2),z=f(R);v(i),v(t),l(`click`,u,J),l(`click`,z,()=>V(`local`)),l(`click`,t,p(J)),o(e,t)};O(Z,e=>{z()&&e(Q)}),o(t,X),e()}export{R as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{At as e,C as t,Dt as n,G as r,I as i,L as a,O as o,Ot as s,Q as c,U as l,V as u,W as d,X as f,Z as p,_t as m,a as h,at as g,b as _,ct as v,d as ee,dt as y,et as b,i as te,it as x,jt as S,l as C,lt as w,nt as T,o as E,ot as D,pt as O,rt as ne,st as re,t as k,v as A,z as j}from"./legacy-CTEeXeqF.js";import{$ as M,G as ie,K as ae,U as oe,W as se,Z as ce,b as N,x as P}from"./index-DyvDC6pS.js";var F=new Set([`$$slots`,`$$events`,`$$legacy`]);function le(e,t){let n=h(t,F),r=[[`path`,{d:`M10 11v6`}],[`path`,{d:`M14 11v6`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`}],[`path`,{d:`M3 6h18`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`}]];M(e,E({name:`trash-2`},()=>n,{get iconNode(){return r}}))}var ue=r(`<span> </span>`),de=r(`<div class="credentials-status svelte-9d4ggp"><!> <small class="svelte-9d4ggp">Add missing values to <code>~/.cascade/credentials.yaml</code> or the file named by <code>CASCADE_CREDENTIALS</code>. Values are never shown here.</small></div>`),fe=r(`<div class="empty-state svelte-9d4ggp"><!> <p class="svelte-9d4ggp">No project packages configured</p> <button class="add-button svelte-9d4ggp"><!> Add Package</button></div>`),pe=r(`<div class="package-item svelte-9d4ggp"><div class="package-info svelte-9d4ggp"><span class="package-alias svelte-9d4ggp"> </span> <span class="package-path svelte-9d4ggp"> </span></div> <button class="remove-button svelte-9d4ggp" aria-label="Remove package"><!></button></div>`),me=r(`<button class="add-button secondary svelte-9d4ggp"><!> Add Package</button>`),he=r(`<div class="packages-list svelte-9d4ggp"></div> <!>`,1),ge=r(`<div class="error-message svelte-9d4ggp"><!> </div>`),_e=r(`<div class="add-form svelte-9d4ggp"><div class="form-row svelte-9d4ggp"><label for="package-path" class="svelte-9d4ggp">Path</label> <div class="input-with-button svelte-9d4ggp"><input id="package-path" type="text" placeholder="./src or ../shared-lib" class="svelte-9d4ggp"/> <button class="browse-button svelte-9d4ggp" title="Browse folder"><!></button></div></div> <div class="form-row svelte-9d4ggp"><label for="package-alias" class="svelte-9d4ggp">Alias</label> <input id="package-alias" type="text" placeholder="myproject" class="svelte-9d4ggp"/></div> <!> <div class="form-actions svelte-9d4ggp"><button class="cancel-button svelte-9d4ggp">Cancel</button> <button class="confirm-button svelte-9d4ggp">Add Package</button></div></div>`),ve=r(`<div class="modal-overlay svelte-9d4ggp"><div class="modal svelte-9d4ggp" role="dialog" aria-modal="true" aria-labelledby="modal-title"><div class="modal-header svelte-9d4ggp"><h2 id="modal-title" class="svelte-9d4ggp"><!> Project Settings</h2> <button class="close-button svelte-9d4ggp" aria-label="Close"><!></button></div> <div class="modal-body svelte-9d4ggp"><section class="section svelte-9d4ggp"><h3 class="svelte-9d4ggp">Graph Metadata <small class="svelte-9d4ggp">(current .cascade file)</small></h3> <div class="form-row svelte-9d4ggp"><label for="graph-name" class="svelte-9d4ggp">Name</label><input id="graph-name" class="svelte-9d4ggp"/></div> <div class="form-row svelte-9d4ggp"><label for="graph-description" class="svelte-9d4ggp">Description</label><input id="graph-description" class="svelte-9d4ggp"/></div> <div class="form-row svelte-9d4ggp"><label for="graph-author" class="svelte-9d4ggp">Author</label><input id="graph-author" class="svelte-9d4ggp"/></div> <div class="form-row svelte-9d4ggp"><label for="graph-created" class="svelte-9d4ggp">Created</label><input id="graph-created" readonly="" class="svelte-9d4ggp"/></div></section> <section class="section svelte-9d4ggp"><h3 class="svelte-9d4ggp">Project Manifest <small class="svelte-9d4ggp">(cascade.json, shared by every graph)</small></h3> <div class="form-row svelte-9d4ggp"><label for="project-name" class="svelte-9d4ggp">Project name</label><input id="project-name" class="svelte-9d4ggp"/></div> <div class="form-row svelte-9d4ggp"><label for="commands-json" class="svelte-9d4ggp">Allowed commands</label><textarea id="commands-json" rows="4" class="svelte-9d4ggp"></textarea></div> <div class="form-row svelte-9d4ggp"><label for="settings-json" class="svelte-9d4ggp">Node settings</label><textarea id="settings-json" rows="5" class="svelte-9d4ggp"></textarea></div> <div class="form-row svelte-9d4ggp"><label for="credentials-list" class="svelte-9d4ggp">Required credentials</label><textarea id="credentials-list" rows="3" placeholder="one credential name per line" class="svelte-9d4ggp"></textarea></div> <!></section> <section class="section svelte-9d4ggp"><h3 class="svelte-9d4ggp">Project Packages</h3> <p class="section-description svelte-9d4ggp">Add local folders as packages. Each package gets an alias that you can use to import modules. <br/> Example: <code class="svelte-9d4ggp">myproject.filters.Blur</code> for file <code class="svelte-9d4ggp">./src/filters/Blur.ts</code></p> <!> <!></section> <section class="section svelte-9d4ggp"><h3 class="svelte-9d4ggp">Project Info</h3> <div class="info-grid svelte-9d4ggp"><div class="info-item svelte-9d4ggp"><span class="info-label svelte-9d4ggp">Embedded Modules</span> <span class="info-value svelte-9d4ggp"> </span></div> <div class="info-item svelte-9d4ggp"><span class="info-label svelte-9d4ggp">External Modules</span> <span class="info-value svelte-9d4ggp"> </span></div></div></section></div> <div class="modal-footer svelte-9d4ggp"><button class="cancel-button svelte-9d4ggp">Cancel</button> <button class="save-button svelte-9d4ggp">Save Changes</button></div></div></div>`);function I(r,h){s(h,!1);let E=te(h,`open`,12,!1),M=te(h,`graph`,12,void 0),F=k(),I=y([]),L=y(``),R=y(``),z=y(!1),B=y(``),V=y(``),H=y(``),U=y(``),W=y(``),G=y(`{}`),K=y(`{}`),q=y(``),J=y([]),Y=y(!1),X=y(!1);function Z(){E(!1),F(`close`)}async function ye(){O(B,``);let e,t;try{if(e=JSON.parse(c(G)||`{}`),t=JSON.parse(c(K)||`{}`),c(X)){let n=await P({name:c(W).trim(),commands:e,settings:t,credentials:c(q).split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)});O(J,n.requiredCredentials)}}catch(e){O(B,e instanceof Error?e.message:String(e));return}M()&&(M(M().project.name=c(V).trim(),!0),M(M().project.description=c(H).trim(),!0),M(M().project.author=c(U).trim(),!0),M(M().project.packages=[...c(I)],!0),c(I).forEach(e=>{M().moduleResolver.addProjectPackage(e)})),F(`save`,{packages:[...c(I)],graphName:c(V).trim(),projectName:c(W).trim(),missingCredentials:c(J).filter(e=>!e.set).map(e=>e.name)}),Z()}function be(){if(O(B,``),!c(L).trim()){O(B,`Path is required`);return}if(!c(R).trim()){O(B,`Alias is required`);return}if(!/^[a-zA-Z][a-zA-Z0-9_]*$/.test(c(R))){O(B,`Alias must start with a letter and contain only letters, numbers, and underscores`);return}if(c(I).some(e=>e.alias===c(R))){O(B,`Alias "${c(R)}" already exists`);return}O(I,[...c(I),{path:c(L).trim(),alias:c(R).trim()}]),O(L,``),O(R,``),O(z,!1)}function xe(e){O(I,c(I).filter((t,n)=>n!==e))}function Q(e){e.key===`Escape`&&(c(z)?O(z,!1):Z())}function $(e){let t=e.replace(/\\/g,`/`).split(`/`).filter(Boolean);return(t[t.length-1]||`mypackage`).replace(/[^a-zA-Z0-9]/g,``).toLowerCase()||`mypackage`}T(()=>(p(E()),p(M())),()=>{E()&&M()&&(O(I,[...M().project.packages]),O(z,!1),O(B,``),O(L,``),O(R,``))}),T(()=>p(E()),()=>{E()||O(Y,!1)}),T(()=>(p(E()),p(M()),c(Y),N),()=>{E()&&M()&&!c(Y)&&(O(Y,!0),O(V,M().project.name??``),O(H,M().project.description??``),O(U,M().project.author??``),N().then(e=>{O(X,!0),O(W,e.manifest.name),O(G,JSON.stringify(e.manifest.commands,null,2)),O(K,JSON.stringify(e.manifest.settings,null,2)),O(q,e.manifest.credentials.join(`
|
|
2
|
+
`)),O(J,e.requiredCredentials)}).catch(()=>{O(X,!1)}))}),T(()=>(c(L),c(R)),()=>{c(L)&&!c(R)&&O(R,$(c(L)))}),ne(),C();var Se=d();f(`keydown`,g,Q);var Ce=re(Se),we=n=>{var r=ve(),s=D(r),d=D(s),h=D(d),g=D(h);ie(g,{size:20}),e(),S(h);var y=w(h,2),te=D(y);oe(te,{size:20}),S(y),S(d);var C=w(d,2),T=D(C),E=w(D(T),2),ne=w(D(E));_(ne),S(E);var k=w(E,2),N=w(D(k));_(N),S(k);var P=w(k,2),F=w(D(P));_(F),S(P);var Y=w(P,2),X=w(D(Y));_(X),S(Y),S(T);var Q=w(T,2),$=w(D(Q),2),Se=w(D($));_(Se),S($);var Ce=w($,2),we=w(D(Ce));m(we),S(Ce);var Te=w(Ce,2),Ee=w(D(Te));m(Ee),S(Te);var De=w(Te,2),Oe=w(D(De));m(Oe),S(De);var ke=w(De,2),Ae=t=>{var n=de(),r=D(n);i(r,1,()=>c(J),a,(e,t)=>{var n=ue();let r;var i=v(n);x(()=>{r=o(n,1,`svelte-9d4ggp`,null,r,{set:c(t).set}),u(i,`${c(t),b(()=>c(t).name)??``}: ${c(t),b(()=>c(t).set?`set`:`not set`)??``}`)}),l(e,n)}),e(2),S(n),l(t,n)};j(ke,e=>{c(J),b(()=>c(J).length)&&e(Ae)}),S(Q);var je=w(Q,2),Me=w(D(je),4),Ne=t=>{var n=fe(),r=D(n);ae(r,{size:32});var i=w(r,4),a=D(i);se(a,{size:16}),e(),S(i),S(n),f(`click`,i,()=>O(z,!0)),l(t,n)},Pe=t=>{var n=he(),r=re(n);i(r,5,()=>c(I),a,(e,t,n)=>{var r=pe(),i=D(r),a=D(i),o=v(a,!0),s=w(a,2),d=v(s,!0);S(i);var p=w(i,2);le(D(p),{size:16}),S(p),S(r),x(()=>{u(o,(c(t),b(()=>c(t).alias))),u(d,(c(t),b(()=>c(t).path)))}),f(`click`,p,()=>xe(n)),l(e,r)}),S(r);var o=w(r,2),s=t=>{var n=me(),r=D(n);se(r,{size:16}),e(),S(n),f(`click`,n,()=>O(z,!0)),l(t,n)};j(o,e=>{c(z)||e(s)}),l(t,n)};j(Me,e=>{c(I),c(z),b(()=>c(I).length===0&&!c(z))?e(Ne):e(Pe,-1)});var Fe=w(Me,2),Ie=e=>{var t=_e(),n=D(t),r=w(D(n),2),i=D(r);_(i);var a=w(i,2),o=D(a);ae(o,{size:16}),S(a),S(r),S(n);var s=w(n,2),d=w(D(s),2);_(d),S(s);var p=w(s,2),m=e=>{var t=ge(),n=D(t);ce(n,{size:14});var r=w(n);S(t),x(()=>u(r,` ${c(B)??``}`)),l(e,t)};j(p,e=>{c(B)&&e(m)});var h=w(p,2),g=D(h),v=w(g,2);S(h),S(t),A(i,()=>c(L),e=>O(L,e)),A(d,()=>c(R),e=>O(R,e)),f(`click`,g,()=>O(z,!1)),f(`click`,v,be),l(e,t)};j(Fe,e=>{c(z)&&e(Ie)}),S(je);var Le=w(je,2),Re=w(D(Le),2),ze=D(Re),Be=w(D(ze),2),Ve=v(Be,!0);S(ze);var He=w(ze,2),Ue=w(D(He),2),We=v(Ue,!0);S(He),S(Re),S(Le),S(C);var Ge=w(C,2),Ke=D(Ge),qe=w(Ke,2);S(Ge),S(s),S(r),x((e,n)=>{t(X,(p(M()),b(()=>M()?.created??``))),u(Ve,e),u(We,n)},[()=>(p(M()),b(()=>M()?Object.keys(M().moduleResolver.exportConfig().embeddedModules).length:0)),()=>(p(M()),b(()=>M()?Object.keys(M().moduleResolver.exportConfig().externalModules).length:0))]),f(`click`,y,Z),A(ne,()=>c(V),e=>O(V,e)),A(N,()=>c(H),e=>O(H,e)),A(F,()=>c(U),e=>O(U,e)),A(Se,()=>c(W),e=>O(W,e)),A(we,()=>c(G),e=>O(G,e)),A(Ee,()=>c(K),e=>O(K,e)),A(Oe,()=>c(q),e=>O(q,e)),f(`click`,Ke,Z),f(`click`,qe,ye),f(`click`,r,ee(Z)),l(n,r)};j(Ce,e=>{E()&&e(we)}),l(r,Se),n()}export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Dt as e,G as t,I as n,L as r,O as i,Ot as a,Q as o,U as s,V as c,W as l,X as u,Z as d,at as f,b as p,ct as m,dt as h,et as g,ft as _,i as v,it as y,jt as b,l as x,lt as S,nt as C,ot as w,p as T,pt as E,rt as D,st as O,t as k,v as A,vt as j,x as M,yt as N,z as P}from"./legacy-CTEeXeqF.js";import{i as F,n as I,r as L}from"./index-DyvDC6pS.js";var R=t(`<button type="button" role="radio"> </button>`),z=t(`<div class="overlay svelte-4828wi"><div class="dialog svelte-4828wi"><header class="svelte-4828wi"><h2 class="svelte-4828wi">Settings</h2> <button class="icon-button svelte-4828wi" aria-label="Close settings">×</button></header> <main class="svelte-4828wi"><h3 class="svelte-4828wi">Appearance</h3> <div class="setting-row svelte-4828wi"><span class="setting-label svelte-4828wi" id="theme-label">Theme</span> <div class="segmented svelte-4828wi" role="radiogroup" aria-labelledby="theme-label"></div></div> <h3 class="section svelte-4828wi">Editor</h3> <div class="setting-row svelte-4828wi"><label for="font-size">Font size</label> <input id="font-size" type="range" min="10" max="24" step="1"/> <output class="svelte-4828wi"> </output></div></main> <footer class="svelte-4828wi"><button class="svelte-4828wi">Cancel</button> <button class="primary svelte-4828wi">Save</button></footer></div></div>`);function B(t,B){a(B,!1);let V=()=>N(L,`$settingsStore`,H),[H,U]=j(),W={auto:`Auto`,dark:`Dark`,light:`Light`},G=v(B,`open`,12,!1),K=k(),q=h(),J=h(),Y=h(!1);function X(){G(!1),K(`close`)}function Z(){I(o(q)),X()}C(()=>(d(G()),o(Y),V()),()=>{G()&&!o(Y)?(E(Y,!0),E(q,structuredClone(V()))):!G()&&o(Y)&&E(Y,!1)}),D(),x();var Q=l();u(`keydown`,f,e=>e.key===`Escape`&&X()),u(`mousedown`,f,e=>G()&&e.target===o(J)&&X());var $=O(Q),ee=e=>{var t=z(),a=w(t),l=w(a),d=S(w(l),2);b(l);var f=S(l,2),h=S(w(f),2),v=S(w(h),2);n(v,5,()=>F,r,(e,t)=>{var n=R();let r;var a=m(n,!0);y(()=>{M(n,`aria-checked`,(o(q),o(t),g(()=>o(q).appearance.theme===o(t)))),r=i(n,1,`svelte-4828wi`,null,r,{selected:o(q).appearance.theme===o(t)}),c(a,(o(t),g(()=>W[o(t)])))}),u(`click`,n,()=>_(q,o(q).appearance.theme=o(t))),s(e,n)}),b(v),b(h);var x=S(h,4),C=S(w(x),2);p(C);var D=S(C,2),O=m(D);b(x),b(f);var k=S(f,2),j=w(k),N=S(j,2);b(k),b(a),b(t),T(t,e=>E(J,e),()=>o(J)),y(()=>c(O,`${o(q),g(()=>o(q).editor.fontSize)??``}px`)),u(`click`,d,X),A(C,()=>o(q).editor.fontSize,e=>_(q,o(q).editor.fontSize=e)),u(`click`,j,X),u(`click`,N,Z),s(e,t)};P($,e=>{G()&&e(ee)}),s(t,Q),e(),U()}export{B as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{At as e,Dt as t,G as n,I as r,L as i,Ot as a,Q as o,U as s,V as c,W as l,X as u,Z as d,at as f,ct as p,d as m,dt as h,et as g,i as _,it as v,jt as y,l as b,lt as x,nt as S,ot as C,pt as w,rt as T,st as E,t as D,z as O}from"./legacy-CTEeXeqF.js";import{U as k}from"./index-DyvDC6pS.js";var A=n(`<p class="note svelte-19fwuux">Reading history…</p>`),j=n(`<p class="note error svelte-19fwuux"> </p>`),M=n(`<p class="note svelte-19fwuux">This project isn't a git repository yet, so there's nothing to go back to. The next
|
|
2
2
|
save starts a history.</p>`),N=n(`<p class="note svelte-19fwuux">No versions yet. The next save becomes the first one.</p>`),P=n(`<p class="note dirty svelte-19fwuux">Unsaved changes on disk aren't in any version yet.</p>`),F=n(`<span class="tag svelte-19fwuux">current</span>`),I=n(`<li class="svelte-19fwuux"><div class="meta svelte-19fwuux"><span class="date svelte-19fwuux"> </span> <span class="sha svelte-19fwuux"> </span> <!></div> <div class="message svelte-19fwuux"> </div> <button class="restore svelte-19fwuux"> </button></li>`),L=n(`<!> <ul class="versions svelte-19fwuux"></ul> <p class="note footnote svelte-19fwuux">Restoring loads that version into the editor as unsaved work. Nothing is overwritten
|
|
3
|
-
until you save, and saving it becomes the next version — so this is always reversible.</p>`,1),R=n(`<div class="dialog-overlay svelte-19fwuux"><div class="dialog svelte-19fwuux" role="dialog" aria-modal="true" aria-labelledby="version-history-title"><div class="dialog-header svelte-19fwuux"><h2 id="version-history-title" class="svelte-19fwuux">Version History</h2> <button class="close-button svelte-19fwuux" aria-label="Close"><!></button></div> <div class="dialog-body svelte-19fwuux"><p class="subject svelte-19fwuux"> </p> <!></div></div></div>`);function z(n,z){
|
|
3
|
+
until you save, and saving it becomes the next version — so this is always reversible.</p>`,1),R=n(`<div class="dialog-overlay svelte-19fwuux"><div class="dialog svelte-19fwuux" role="dialog" aria-modal="true" aria-labelledby="version-history-title"><div class="dialog-header svelte-19fwuux"><h2 id="version-history-title" class="svelte-19fwuux">Version History</h2> <button class="close-button svelte-19fwuux" aria-label="Close"><!></button></div> <div class="dialog-body svelte-19fwuux"><p class="subject svelte-19fwuux"> </p> <!></div></div></div>`);function z(n,z){a(z,!1);let B=_(z,`filename`,8,null),V=_(z,`open`,8,!1),H=D(),U=h([]),W=h(!1),G=h(!0),K=h(!1),q=h(null),J=h(null);async function Y(e){w(K,!0),w(q,null);try{let t=await fetch(`/api/graph/${encodeURIComponent(e)}/versions`);if(!t.ok)throw Error(await t.text());let n=await t.json();w(U,n.versions??[]),w(W,!!n.dirty),w(G,n.isGitRepo!==!1)}catch(e){w(q,e instanceof Error?e.message:String(e)),w(U,[])}finally{w(K,!1)}}async function X(e){if(B()){w(J,e.sha),w(q,null);try{let t=await fetch(`/api/graph/${encodeURIComponent(B())}/versions/${e.sha}`);if(!t.ok)throw Error(await t.text());H(`restore`,{json:await t.json(),version:e})}catch(e){w(q,e instanceof Error?e.message:String(e))}finally{w(J,null)}}}function Z(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function Q(){H(`close`)}function ee(e){e.key===`Escape`&&Q()}S(()=>(d(V()),d(B())),()=>{V()&&B()&&Y(B())}),T(),b();var $=l();u(`keydown`,f,ee);var te=E($),ne=t=>{var n=R(),a=C(n),l=C(a),d=x(C(l),2),f=C(d);k(f,{size:18}),y(d),y(l);var h=x(l,2),_=C(h),b=p(_,!0),S=x(_,2),w=e=>{var t=A();s(e,t)},T=e=>{var t=j(),n=p(t,!0);v(()=>c(n,o(q))),s(e,t)},D=e=>{var t=M();s(e,t)},z=e=>{var t=N();s(e,t)},V=t=>{var n=L(),a=E(n),l=e=>{var t=P();s(e,t)};O(a,e=>{o(W)&&e(l)});var d=x(a,2);r(d,5,()=>o(U),i,(e,t,n)=>{var r=I(),i=C(r),a=C(i),l=p(a,!0),d=x(a,2),f=p(d,!0),m=x(d,2),h=e=>{var t=F();s(e,t)};O(m,e=>{n===0&&e(h)}),y(i);var _=x(i,2),b=p(_,!0),S=x(_,2),w=p(S,!0);y(r),v(e=>{c(l,e),c(f,(o(t),g(()=>o(t).shortSha))),c(b,(o(t),g(()=>o(t).message))),S.disabled=o(J)!==null,c(w,(o(J),o(t),g(()=>o(J)===o(t).sha?`Opening…`:`Restore`)))},[()=>(o(t),g(()=>Z(o(t).date)))]),u(`click`,S,()=>X(o(t))),s(e,r)}),y(d),e(2),s(t,n)};O(S,e=>{o(K)?e(w):o(q)?e(T,1):o(G)?(o(U),g(()=>o(U).length===0)?e(z,3):e(V,-1)):e(D,2)}),y(h),y(a),y(n),v(()=>c(b,B()??`No project file`)),u(`click`,d,Q),u(`click`,n,m(Q)),s(t,n)};O(te,e=>{V()&&e(ne)}),s(n,$),t()}export{z as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as e,u as t}from"./nodeTypeUtils-BDJsc2Ks.js";import{A as n,C as r,E as i,M as a,N as o,P as s,b as c,f as l,g as u,h as d,j as f,p,w as m}from"./index-CMiBdEuT.js";var h={type:`Switch`,name:`Switch`,icon:`GitBranch`,description:`Switch between multiple inputs by index`,category:`routing`},g=class extends n{constructor(e,t){super(e,`Switch`,t)}get activeInputIndex(){let e=this.getVariadicInputs();return Math.min(this.props.index?.value??0,e.length-1)}isInputActive(e){let t=this.getVariadicInputs(),n=this.activeInputIndex;return t.findIndex(t=>t.id===e)===n}setup(){this.setVariadic(),this.output=this.out(`output`),this.addParm(`index`,{value:0,type:`int`,params:{min:0,max:0,step:1},displayName:`Index`}),this.watchProp(`index`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}update(){let e=this.getVariadicInputs(),t=e.filter(e=>e.connections.length>0).length;this.updatePropParams(`index`,{max:Math.max(0,t-1)});let n=e[Math.min(this.props.index.value,e.length-1)];n?(this.output.setValue(n.value),this.preview=this.isPreviewValue(n.value)?n.value:null):(this.output.setValue(null),this.preview=null)}},_={type:`Merge`,name:`Merge`,icon:`GitMerge`,description:`Combine multiple inputs into an array`,category:`routing`},v=class extends n{constructor(e,t){super(e,`Merge`,t)}setup(){this.setVariadic(),this.output=this.out(`output`),this.addParm(`append`,{value:!1,type:`boolean`,displayName:`Append Mode`,hidden:()=>{let e=this.getVariadicInputs();return!Array.isArray(e[0]?.value)}}),this.watchProp(`append`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}update(){let e=this.getVariadicInputs().filter(e=>e.value!==null).map(e=>e.value);if(this.props.append.value&&e.length>0&&Array.isArray(e[0])){let t=[...e[0],...e.slice(1)];this.output.setValue(t)}else this.output.setValue(e);this.preview=null;for(let t of e)if(t instanceof HTMLCanvasElement||t instanceof HTMLImageElement){this.preview=t;break}}},y={type:`Subnet`,name:`Subnet`,icon:`Folder`,description:`Network container for organizing nodes`,category:`network`},b=class extends n{constructor(e,t){super(e,`Subnet`,t)}setup(){this.onUpdate=()=>this.update(),this.onReady=()=>{this.syncPorts(),this.update()}}isNetwork(){return!0}addChild(e){e.parent=this,this._children.push(e),(e.type===`Input`||e.type===`Output`)&&this.syncPorts()}removeChild(e){let t=this._children.indexOf(e);if(t!==-1){let n=e.type===`Input`||e.type===`Output`;this._children.splice(t,1),e.parent=null,n&&this.syncPorts()}}syncPorts(){let e=this._children.filter(e=>e.type===`Input`),t=e.reduce((e,t)=>{let n=t.inputIndex??0;return Math.max(e,n)},-1),n=this._children.filter(e=>e.type===`Output`),r=n.reduce((e,t)=>{let n=t.outputIndex??0;return Math.max(e,n)},-1),i=t+1,a=this.inputs.length;for(let t=a;t<i;t++){let n=e.find(e=>e.inputIndex===t),r=this.in(n?.inputName||`input_${t}`,null,{type:n?.dataType||`any`});r.onChange=e=>{this._children.filter(e=>e.type===`Input`&&e.inputIndex===t).forEach(e=>e.markDirty())}}for(let e=i;e<a;e++)this.inputs[e]&&(this.inputs[e].options={...this.inputs[e].options,hidden:!0});for(let t=0;t<i;t++)if(this.inputs[t]){let n=e.find(e=>e.inputIndex===t);this.inputs[t].name=n?.inputName||`input_${t}`,this.inputs[t].dataType=n?.dataType||`any`,this.inputs[t].options={...this.inputs[t].options,hidden:!1}}let o=r+1,s=this.outputs.length;for(let e=s;e<o;e++){let t=n.find(t=>t.outputIndex===e);this.out(t?.outputName||`output_${e}`,`param`,{type:t?.dataType||`any`})}for(let e=o;e<s;e++)this.outputs[e]&&(this.outputs[e].options={...this.outputs[e].options,hidden:!0});for(let e=0;e<o;e++)if(this.outputs[e]){let t=n.find(t=>t.outputIndex===e);this.outputs[e].name=t?.outputName||`output_${e}`,this.outputs[e].dataType=t?.dataType||`any`,this.outputs[e].options={...this.outputs[e].options,hidden:!1}}this.inputs=[...this.inputs],this.outputs=[...this.outputs]}outputNode(){return this._children.find(e=>e.type===`Output`)||this._children.find(e=>e.cook)||(this._children.length>0?this._children[this._children.length-1]:null)}displayNode(){return this._children.find(e=>e.cook)??null}indirectInputs(){return this._children.filter(e=>e.type===`Input`)}update(){let e=this._children.filter(e=>e.type===`Output`),t=new Map;for(let n of e){let e=n.outputIndex??0;t.set(e,n)}for(let e=0;e<this.outputs.length;e++){let n=t.get(e);if(n&&n.inputs.length>0){let t=n.inputs[0].value;this.outputs[e].setValue(t),e===0&&(t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)&&(this.preview=t)}else if(e===0){let t=this._children.find(e=>e.cook);t&&t.outputs.length>0?(this.outputs[e].setValue(t.outputs[0].value),t.preview&&(this.preview=t.preview)):this.outputs[e].setValue(null)}else this.outputs[e].setValue(null)}(this.outputs.length===0||!t.has(0))&&(this._children.find(e=>e.cook)?.preview||(this.preview=null))}},x=o.map(e=>({value:e,label:e})),S={type:`Input`,name:`Input`,icon:`LogIn`,description:`Represents an external input to a subnet`,category:`network`},C=class extends n{constructor(e,t){super(e,`Input`,t)}setup(){this.output=this.out(`output`),this.addParm(`inputIndex`,{value:0,type:`int`,params:{min:0,step:1},displayName:`Input Index`}),this.addParm(`inputName`,{value:``,type:`text`,displayName:`Input Name`}),this.addParm(`dataType`,{value:`any`,type:`select`,params:{options:x},displayName:`Data Type`});let e=()=>{this.parent&&this.parent.syncPorts&&this.parent.syncPorts(),this.update()};this.watchProp(`inputIndex`,e),this.watchProp(`inputName`,e),this.watchProp(`dataType`,()=>{this.output.dataType=this.dataType,e()}),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}get inputIndex(){return this.props.inputIndex?.value??0}get inputName(){return this.props.inputName?.value??``}get dataType(){let e=this.props.dataType?.value;return typeof e==`string`&&s(e)?e:`any`}update(){if(this.parent&&this.parent.inputs.length>0){let e=this.inputIndex,t=this.parent.inputs[e];if(t){this.output.setValue(t.value),this.preview=this.isPreviewValue(t.value)?t.value:null;return}}this.output.setValue(null),this.preview=null}},w=o.map(e=>({value:e,label:e})),T={type:`Output`,name:`Output`,icon:`LogOut`,description:`Defines the output of a subnet`,category:`network`},E=class extends n{constructor(e,t){super(e,`Output`,t)}setup(){this.in(`input`,null),this.addParm(`outputIndex`,{value:0,type:`int`,params:{min:0,step:1},displayName:`Output Index`}),this.addParm(`outputName`,{value:``,type:`text`,displayName:`Output Name`}),this.addParm(`dataType`,{value:`any`,type:`select`,params:{options:w},displayName:`Data Type`});let e=()=>{this.parent&&this.parent.syncPorts&&this.parent.syncPorts(),this.update()};this.watchProp(`outputIndex`,e),this.watchProp(`outputName`,e),this.watchProp(`dataType`,()=>{this.inputs[0]&&(this.inputs[0].dataType=this.dataType),e()}),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}get outputIndex(){return this.props.outputIndex?.value??0}get outputName(){return this.props.outputName?.value??``}get dataType(){let e=this.props.dataType?.value;return typeof e==`string`&&s(e)?e:`any`}update(){let e=this.inputs[0];e&&(this.preview=this.isPreviewValue(e.value)?e.value:null)}},D={type:`Random`,name:`Random`,icon:`Dice5`,description:`Generate a deterministic value from an explicit seed`,category:`utility`},O=class extends n{constructor(e,t){super(e,`Random`,t)}setup(){let e=this.in(`seed`,0,{type:`int`}),t=this.in(`sample`,0,{type:`int`}),n=this.out(`value`),r=()=>n.setValue(p(e.value,t.value));e.onChange=r,t.onChange=r,this.onUpdate=r,this.onReady=r}},k={type:`Remap`,name:`Remap`,icon:`ArrowRightLeft`,description:`Map a number from one range into another`,category:`utility`},A=class extends n{constructor(e,t){super(e,`Remap`,t)}setup(){let e=this.in(`value`,0,{type:`float`}),t=this.in(`inMin`,0,{type:`float`}),n=this.in(`inMax`,1,{type:`float`}),r=this.in(`outMin`,0,{type:`float`}),i=this.in(`outMax`,1,{type:`float`}),a=this.out(`result`);this.addParm(`clamp`,{value:!1,type:`boolean`,displayName:`Clamp`});let o=()=>a.setValue(l(e.value,t.value,n.value,r.value,i.value,this.props.clamp.value));for(let a of[e,t,n,r,i])a.onChange=o;this.watchProp(`clamp`,o),this.onUpdate=o,this.onReady=o}},j={type:`Select`,name:`Select`,icon:`ListFilter`,description:`Pick an item from an array by index`,category:`utility`},M=class extends n{constructor(e,t){super(e,`Select`,t)}setup(){this.arrayInput=this.in(`array`,[],{type:`array`}),this.itemOutput=this.out(`item`,`param`),this.countOutput=this.out(`count`,`param`),this.addParm(`index`,{value:0,type:`int`,params:{min:0,max:0,step:1},displayName:`Index`}),this.addParm(`wrap`,{value:!0,type:`boolean`,displayName:`Wrap Index`}),this.watchProp(`index`,()=>this.update()),this.watchProp(`wrap`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}update(){let e=this.arrayInput.value;if(!Array.isArray(e)||e.length===0){this.itemOutput.setValue(null),this.countOutput.setValue(0),this.updatePropParams(`index`,{max:0});return}this.updatePropParams(`index`,{max:e.length-1});let t=this.props.index?.value??0;t=(this.props.wrap?.value??!0)&&e.length>0?(t%e.length+e.length)%e.length:Math.max(0,Math.min(t,e.length-1));let n=e[t];this.itemOutput.setValue(n),this.countOutput.setValue(e.length),this.preview=n instanceof HTMLCanvasElement||n instanceof HTMLImageElement?n:null}},N={type:`Null`,name:`Null`,icon:`Circle`,description:`Pass its input through unchanged`,category:`routing`},P=class extends n{constructor(e,t){super(e,`Null`,t)}setup(){let e=this.in(`input`,null,{type:`any`}),t=this.out(`output`),n=()=>t.setValue(e.value);e.onChange=n,this.onUpdate=n,this.onReady=n}};function F(){return typeof document<`u`}var I={type:`Freeze`,name:`Freeze`,icon:`Snowflake`,description:`Capture and lock a value`,category:`utility`},L=class extends n{constructor(e,t){super(e,`Freeze`,t),this.frozenValue=null,this.hasCaptured=!1}setup(){this.input=this.in(`input`,null,{type:`any`}),this.output=this.out(`output`,`param`),this.addParm(`frozen`,{value:!1,type:`boolean`,displayName:`Frozen`}),this.addAction(`capture`,{label:`Capture`,icon:`Camera`,callback:()=>this.capture()}),this.addAction(`clear`,{label:`Clear`,icon:`Trash2`,callback:()=>this.clear()}),this.watchProp(`frozen`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}capture(){this.frozenValue=this.deepClone(this.input.value),this.hasCaptured=!0,this.setParm(`frozen`,!0),this.update()}clear(){this.frozenValue=null,this.hasCaptured=!1,this.setParm(`frozen`,!1),this.update()}deepClone(e){if(e==null)return e;if(r(e)){let t=e,n=t.naturalWidth||t.width,r=t.naturalHeight||t.height,i=m(n,r);return i.getContext(`2d`)?.drawImage(e,0,0),i}if(Array.isArray(e))return e.map(e=>this.deepClone(e));if(typeof e==`object`)try{return JSON.parse(JSON.stringify(e))}catch{return e}return e}update(){(this.props.frozen?.value??!1)&&this.hasCaptured?(this.output.setValue(this.frozenValue),F()&&r(this.frozenValue)&&(this.preview=this.frozenValue)):(this.output.setValue(this.input.value),this.preview=F()&&r(this.input.value)?this.input.value:null)}serialize(){return{hasCaptured:this.hasCaptured}}deserialize(e){this.hasCaptured=e.hasCaptured===!0}},R=[h,_,y,S,T,D,k,j,N,I],z={Switch:g,Merge:v,Subnet:b,Input:C,Output:E,Random:O,Remap:A,Select:M,Null:P,Freeze:L};e(`core`,z),t(`Switch`,`/**
|
|
1
|
+
import{c as e,u as t}from"./nodeTypeUtils-BDJsc2Ks.js";import{F as n,I as r,L as i,O as a,R as o,T as s,j as c,k as l,m as u,p as d,v as f,y as p,z as m}from"./index-DyvDC6pS.js";var h={type:`Switch`,name:`Switch`,icon:`GitBranch`,description:`Switch between multiple inputs by index`,category:`routing`},g=class extends n{constructor(e,t){super(e,`Switch`,t)}get activeInputIndex(){let e=this.getVariadicInputs();return Math.min(this.props.index?.value??0,e.length-1)}isInputActive(e){let t=this.getVariadicInputs(),n=this.activeInputIndex;return t.findIndex(t=>t.id===e)===n}setup(){this.setVariadic(),this.output=this.out(`output`);let e=this.param(`index`,0,{type:`int`,min:0,max:0,step:1});e.documentField=`props`,this.watchProp(`index`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}onCook(){this.update()}update(){let e=this.getVariadicInputs(),t=e.filter(e=>e.connections.length>0).length;this.updatePropParams(`index`,{max:Math.max(0,t-1)});let n=e[Math.min(this.props.index.value,e.length-1)];n?(this.output.setValue(n.value),this.preview=this.isPreviewValue(n.value)?n.value:null):(this.output.setValue(null),this.preview=null)}},_={type:`Merge`,name:`Merge`,icon:`GitMerge`,description:`Combine multiple inputs into an array`,category:`routing`},v=class extends n{constructor(e,t){super(e,`Merge`,t)}setup(){this.setVariadic(),this.output=this.out(`output`),this.addParm(`append`,{value:!1,type:`boolean`,displayName:`Append Mode`,hidden:()=>{let e=this.getVariadicInputs();return!Array.isArray(e[0]?.value)}}),this.watchProp(`append`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}update(){let e=this.getVariadicInputs().filter(e=>e.value!==null).map(e=>e.value);if(this.props.append.value&&e.length>0&&Array.isArray(e[0])){let t=[...e[0],...e.slice(1)];this.output.setValue(t)}else this.output.setValue(e);this.preview=null;for(let t of e)if(t instanceof HTMLCanvasElement||t instanceof HTMLImageElement){this.preview=t;break}}},y={type:`Subnet`,name:`Subnet`,icon:`Folder`,description:`Network container for organizing nodes`,category:`network`},b=class extends n{constructor(e,t){super(e,`Subnet`,t)}setup(){this.onUpdate=()=>this.update(),this.onReady=()=>{this.syncPorts(),this.update()}}isNetwork(){return!0}addChild(e){e.parent=this,this._children.push(e),(e.type===`Input`||e.type===`Output`)&&this.syncPorts()}removeChild(e){let t=this._children.indexOf(e);if(t!==-1){let n=e.type===`Input`||e.type===`Output`;this._children.splice(t,1),e.parent=null,n&&this.syncPorts()}}syncPorts(){let e=this._children.filter(e=>e.type===`Input`),t=e.reduce((e,t)=>{let n=t.inputIndex??0;return Math.max(e,n)},-1),n=this._children.filter(e=>e.type===`Output`),r=n.reduce((e,t)=>{let n=t.outputIndex??0;return Math.max(e,n)},-1),i=t+1,a=this.inputs.length;for(let t=a;t<i;t++){let n=e.find(e=>e.inputIndex===t),r=this.in(n?.inputName||`input_${t}`,null,{type:n?.dataType||`any`});r.onChange=e=>{this._children.filter(e=>e.type===`Input`&&e.inputIndex===t).forEach(e=>e.markDirty())}}for(let e=i;e<a;e++)this.inputs[e]&&(this.inputs[e].options={...this.inputs[e].options,hidden:!0});for(let t=0;t<i;t++)if(this.inputs[t]){let n=e.find(e=>e.inputIndex===t);this.inputs[t].name=n?.inputName||`input_${t}`,this.inputs[t].dataType=n?.dataType||`any`,this.inputs[t].options={...this.inputs[t].options,hidden:!1}}let o=r+1,s=this.outputs.length;for(let e=s;e<o;e++){let t=n.find(t=>t.outputIndex===e);this.out(t?.outputName||`output_${e}`,`param`,{type:t?.dataType||`any`})}for(let e=o;e<s;e++)this.outputs[e]&&(this.outputs[e].options={...this.outputs[e].options,hidden:!0});for(let e=0;e<o;e++)if(this.outputs[e]){let t=n.find(t=>t.outputIndex===e);this.outputs[e].name=t?.outputName||`output_${e}`,this.outputs[e].dataType=t?.dataType||`any`,this.outputs[e].options={...this.outputs[e].options,hidden:!1}}this.inputs=[...this.inputs],this.outputs=[...this.outputs]}outputNode(){return this._children.find(e=>e.type===`Output`)||this._children.find(e=>e.cook)||(this._children.length>0?this._children[this._children.length-1]:null)}displayNode(){return this._children.find(e=>e.cook)??null}indirectInputs(){return this._children.filter(e=>e.type===`Input`)}update(){let e=this._children.filter(e=>e.type===`Output`),t=new Map;for(let n of e){let e=n.outputIndex??0;t.set(e,n)}for(let e=0;e<this.outputs.length;e++){let n=t.get(e);if(n&&n.inputs.length>0){let t=n.inputs[0].value;this.outputs[e].setValue(t),e===0&&(t instanceof HTMLCanvasElement||t instanceof HTMLImageElement)&&(this.preview=t)}else if(e===0){let t=this._children.find(e=>e.cook);t&&t.outputs.length>0?(this.outputs[e].setValue(t.outputs[0].value),t.preview&&(this.preview=t.preview)):this.outputs[e].setValue(null)}else this.outputs[e].setValue(null)}(this.outputs.length===0||!t.has(0))&&(this._children.find(e=>e.cook)?.preview||(this.preview=null))}},x=o.map(e=>({value:e,label:e})),S={type:`Input`,name:`Input`,icon:`LogIn`,description:`Represents an external input to a subnet`,category:`network`},C=class extends n{constructor(e,t){super(e,`Input`,t)}setup(){this.output=this.out(`output`),this.addParm(`inputIndex`,{value:0,type:`int`,params:{min:0,step:1},displayName:`Input Index`}),this.addParm(`inputName`,{value:``,type:`text`,displayName:`Input Name`}),this.addParm(`dataType`,{value:`any`,type:`select`,params:{options:x},displayName:`Data Type`});let e=()=>{this.parent&&this.parent.syncPorts&&this.parent.syncPorts(),this.update()};this.watchProp(`inputIndex`,e),this.watchProp(`inputName`,e),this.watchProp(`dataType`,()=>{this.output.dataType=this.dataType,e()}),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}get inputIndex(){return this.props.inputIndex?.value??0}get inputName(){return this.props.inputName?.value??``}get dataType(){let e=this.props.dataType?.value;return typeof e==`string`&&m(e)?e:`any`}update(){if(this.parent&&this.parent.inputs.length>0){let e=this.inputIndex,t=this.parent.inputs[e];if(t){this.output.setValue(t.value),this.preview=this.isPreviewValue(t.value)?t.value:null;return}}this.output.setValue(null),this.preview=null}},w=o.map(e=>({value:e,label:e})),T={type:`Output`,name:`Output`,icon:`LogOut`,description:`Defines the output of a subnet`,category:`network`},E=class extends n{constructor(e,t){super(e,`Output`,t)}setup(){this.in(`input`,null),this.addParm(`outputIndex`,{value:0,type:`int`,params:{min:0,step:1},displayName:`Output Index`}),this.addParm(`outputName`,{value:``,type:`text`,displayName:`Output Name`}),this.addParm(`dataType`,{value:`any`,type:`select`,params:{options:w},displayName:`Data Type`});let e=()=>{this.parent&&this.parent.syncPorts&&this.parent.syncPorts(),this.update()};this.watchProp(`outputIndex`,e),this.watchProp(`outputName`,e),this.watchProp(`dataType`,()=>{this.inputs[0]&&(this.inputs[0].dataType=this.dataType),e()}),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}get outputIndex(){return this.props.outputIndex?.value??0}get outputName(){return this.props.outputName?.value??``}get dataType(){let e=this.props.dataType?.value;return typeof e==`string`&&m(e)?e:`any`}update(){let e=this.inputs[0];e&&(this.preview=this.isPreviewValue(e.value)?e.value:null)}},D={type:`Random`,name:`Random`,icon:`Dice5`,description:`Generate a deterministic value from an explicit seed`,category:`utility`},O=class extends n{constructor(e,t){super(e,`Random`,t)}setup(){let e=this.in(`seed`,0,{type:`int`}),t=this.in(`sample`,0,{type:`int`}),n=this.out(`value`),r=()=>n.setValue(u(e.value,t.value));e.onChange=r,t.onChange=r,this.onUpdate=r,this.onReady=r}},k={type:`Remap`,name:`Remap`,icon:`ArrowRightLeft`,description:`Map a number from one range into another`,category:`utility`},A=class extends n{constructor(e,t){super(e,`Remap`,t)}setup(){let e=this.in(`value`,0,{type:`float`}),t=this.in(`inMin`,0,{type:`float`}),n=this.in(`inMax`,1,{type:`float`}),r=this.in(`outMin`,0,{type:`float`}),i=this.in(`outMax`,1,{type:`float`}),a=this.out(`result`);this.addParm(`clamp`,{value:!1,type:`boolean`,displayName:`Clamp`});let o=()=>a.setValue(d(e.value,t.value,n.value,r.value,i.value,this.props.clamp.value));for(let a of[e,t,n,r,i])a.onChange=o;this.watchProp(`clamp`,o),this.onUpdate=o,this.onReady=o}},j={type:`Select`,name:`Select`,icon:`ListFilter`,description:`Pick an item from an array by index`,category:`utility`},M=class extends n{constructor(e,t){super(e,`Select`,t)}setup(){this.arrayInput=this.in(`array`,[],{type:`array`}),this.itemOutput=this.out(`item`,`param`),this.countOutput=this.out(`count`,`param`),this.addParm(`index`,{value:0,type:`int`,params:{min:0,max:0,step:1},displayName:`Index`}),this.addParm(`wrap`,{value:!0,type:`boolean`,displayName:`Wrap Index`}),this.watchProp(`index`,()=>this.update()),this.watchProp(`wrap`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}update(){let e=this.arrayInput.value;if(!Array.isArray(e)||e.length===0){this.itemOutput.setValue(null),this.countOutput.setValue(0),this.updatePropParams(`index`,{max:0});return}this.updatePropParams(`index`,{max:e.length-1});let t=this.props.index?.value??0;t=(this.props.wrap?.value??!0)&&e.length>0?(t%e.length+e.length)%e.length:Math.max(0,Math.min(t,e.length-1));let n=e[t];this.itemOutput.setValue(n),this.countOutput.setValue(e.length),this.preview=n instanceof HTMLCanvasElement||n instanceof HTMLImageElement?n:null}},N={type:`Null`,name:`Null`,icon:`Circle`,description:`Pass its input through unchanged`,category:`routing`},P=class extends n{constructor(e,t){super(e,`Null`,t)}setup(){let e=this.in(`input`,null,{type:`any`}),t=this.out(`output`),n=()=>t.setValue(e.value);e.onChange=n,this.onUpdate=n,this.onReady=n}};function F(){return typeof document<`u`}var I={type:`Freeze`,name:`Freeze`,icon:`Snowflake`,description:`Capture and lock a value`,category:`utility`},L=class extends n{constructor(e,t){super(e,`Freeze`,t),this.frozenValue=null,this.hasCaptured=!1}setup(){this.input=this.in(`input`,null,{type:`any`}),this.output=this.out(`output`,`param`),this.addParm(`frozen`,{value:!1,type:`boolean`,displayName:`Frozen`}),this.addAction(`capture`,{label:`Capture`,icon:`Camera`,callback:()=>this.capture()}),this.addAction(`clear`,{label:`Clear`,icon:`Trash2`,callback:()=>this.clear()}),this.watchProp(`frozen`,()=>this.update()),this.onUpdate=()=>this.update(),this.onReady=()=>this.update()}capture(){this.frozenValue=this.deepClone(this.input.value),this.hasCaptured=!0,this.setParm(`frozen`,!0),this.update()}clear(){this.frozenValue=null,this.hasCaptured=!1,this.setParm(`frozen`,!1),this.update()}deepClone(e){if(e==null)return e;if(a(e)){let t=e,n=t.naturalWidth||t.width,r=t.naturalHeight||t.height,i=l(n,r);return i.getContext(`2d`)?.drawImage(e,0,0),i}if(Array.isArray(e))return e.map(e=>this.deepClone(e));if(typeof e==`object`)try{return JSON.parse(JSON.stringify(e))}catch{return e}return e}update(){(this.props.frozen?.value??!1)&&this.hasCaptured?(this.output.setValue(this.frozenValue),F()&&a(this.frozenValue)&&(this.preview=this.frozenValue)):(this.output.setValue(this.input.value),this.preview=F()&&a(this.input.value)?this.input.value:null)}serialize(){return{hasCaptured:this.hasCaptured}}deserialize(e){this.hasCaptured=e.hasCaptured===!0}},R=[h,_,y,S,T,D,k,j,N,I],z={Switch:g,Merge:v,Subnet:b,Input:C,Output:E,Random:O,Remap:A,Select:M,Null:P,Freeze:L};e(`core`,z),t(`Switch`,`/**
|
|
2
2
|
* SwitchNode - routes one of multiple inputs to output based on index
|
|
3
3
|
* Connect multiple inputs and use the index parameter to select which one passes through
|
|
4
4
|
*/
|
|
@@ -45,12 +45,8 @@ export class SwitchNode extends Node {
|
|
|
45
45
|
this.setVariadic();
|
|
46
46
|
this.output = this.out('output');
|
|
47
47
|
|
|
48
|
-
this.
|
|
49
|
-
|
|
50
|
-
type: 'int',
|
|
51
|
-
params: { min: 0, max: 0, step: 1 },
|
|
52
|
-
displayName: 'Index'
|
|
53
|
-
});
|
|
48
|
+
const index = this.param('index', 0, { type: 'int', min: 0, max: 0, step: 1 });
|
|
49
|
+
index.documentField = 'props';
|
|
54
50
|
|
|
55
51
|
this.watchProp('index', () => this.update());
|
|
56
52
|
|
|
@@ -58,6 +54,10 @@ export class SwitchNode extends Node {
|
|
|
58
54
|
this.onReady = () => this.update();
|
|
59
55
|
}
|
|
60
56
|
|
|
57
|
+
protected onCook(): void {
|
|
58
|
+
this.update();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
61
|
private update(): void {
|
|
62
62
|
const inputs = this.getVariadicInputs();
|
|
63
63
|
|
|
@@ -953,4 +953,4 @@ export class FreezeNode extends Node {
|
|
|
953
953
|
this.hasCaptured = data.hasCaptured === true;
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
-
`);export{
|
|
956
|
+
`);export{f as CascadeContext,r as ExpressionEngine,L as FreezeNode,c as Graph,C as InputNode,v as MergeNode,n as Node,P as NullNode,E as OutputNode,O as RandomNode,A as RemapNode,M as SelectNode,b as SubnetNode,g as SwitchNode,p as cascade,s as coreLibrary,z as coreNodeClasses,i as expressionEngine,R as nodeMetadataList};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./editor.api-
|
|
1
|
+
import{l as e}from"./editor.api-DvkCO3ko.js";import{t}from"./workers-C7Ye5B7D.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-QhV9XtLp.js";var b=12e4,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/css/cssWorker`,createWorker:()=>new Worker(new URL(`/assets/css.worker-B3ciXF_0.js`,``+import.meta.url),{type:`module`}),label:this._defaults.languageId,createData:{options:this._defaults.options,languageId:this._defaults.languageId}}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}};function S(t){let n=[],s=[],c=new x(t);n.push(c);let g=(...e)=>c.getLanguageServiceWorker(...e);function y(){let{languageId:n,modeConfiguration:c}=t;w(s),c.completionItems&&s.push(e.registerCompletionItemProvider(n,new _(g,[`/`,`-`,`:`]))),c.hovers&&s.push(e.registerHoverProvider(n,new a(g))),c.documentHighlights&&s.push(e.registerDocumentHighlightProvider(n,new p(g))),c.definitions&&s.push(e.registerDefinitionProvider(n,new f(g))),c.references&&s.push(e.registerReferenceProvider(n,new o(g))),c.documentSymbols&&s.push(e.registerDocumentSymbolProvider(n,new u(g))),c.rename&&s.push(e.registerRenameProvider(n,new m(g))),c.colors&&s.push(e.registerColorProvider(n,new l(g))),c.foldingRanges&&s.push(e.registerFoldingRangeProvider(n,new v(g))),c.diagnostics&&s.push(new h(n,g,t.onDidChange)),c.selectionRanges&&s.push(e.registerSelectionRangeProvider(n,new d(g))),c.documentFormattingEdits&&s.push(e.registerDocumentFormattingEditProvider(n,new r(g))),c.documentRangeFormattingEdits&&s.push(e.registerDocumentRangeFormattingEditProvider(n,new i(g)))}return y(),n.push(C(s)),C(n)}function C(e){return{dispose:()=>w(e)}}function w(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,S as setupMode,n as toRange,y as toTextEdit};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as e,_ as t,d as n,f as r,g as i,h as a,l as o,u as s}from"./index-DyvDC6pS.js";e([a,o,s,n,t,i,r]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{P as e}from"./index-DyvDC6pS.js";function t(e){if(e.length===0)throw Error(`Invalid tail call`);return[e.slice(0,e.length-1),e[e.length-1]]}function n(e,t,n=(e,t)=>e===t){if(e===t)return!0;if(!e||!t||e.length!==t.length)return!1;for(let r=0,i=e.length;r<i;r++)if(!n(e[r],t[r]))return!1;return!0}function r(e,t){let n=e.length-1;t<n&&(e[t]=e[n]),e.pop()}function i(e,t,n){return a(e.length,r=>n(e[r],t))}function a(e,t){let n=0,r=e-1;for(;n<=r;){let e=(n+r)/2|0,i=t(e);if(i<0)n=e+1;else if(i>0)r=e-1;else return e}return-(n+1)}function o(e,t,n){if(e|=0,e>=t.length)throw TypeError(`invalid index`);let r=t[Math.floor(t.length*Math.random())],i=[],a=[],s=[];for(let e of t){let t=n(e,r);t<0?i.push(e):t>0?a.push(e):s.push(e)}return e<i.length?o(e,i,n):e<i.length+s.length?s[0]:o(e-(i.length+s.length),a,n)}function s(e,t){let n=[],r;for(let i of e.slice(0).sort(t))!r||t(r[0],i)!==0?(r=[i],n.push(r)):r.push(i);return n}function*c(e,t){let n,r;for(let i of e)r!==void 0&&t(r,i)?n.push(i):(n&&(yield n),n=[i]),r=i;n&&(yield n)}function l(e,t){for(let n=0;n<=e.length;n++)t(n===0?void 0:e[n-1],n===e.length?void 0:e[n])}function u(e,t){for(let n=0;n<e.length;n++)t(n===0?void 0:e[n-1],e[n],n+1===e.length?void 0:e[n+1])}function d(e){return e.filter(e=>!!e)}function f(e){let t=0;for(let n=0;n<e.length;n++)e[n]&&(e[t]=e[n],t+=1);e.length=t}function p(e){return!Array.isArray(e)||e.length===0}function m(e){return Array.isArray(e)&&e.length>0}function h(e,t=e=>e){let n=new Set;return e.filter(e=>{let r=t(e);return!n.has(r)&&(n.add(r),!0)})}function g(e,t){let n=typeof t==`number`?e:0;typeof t==`number`?n=e:(n=0,t=e);let r=[];if(n<=t)for(let e=n;e<t;e++)r.push(e);else for(let e=n;e>t;e--)r.push(e);return r}function _(e,t,n){let r=e.slice(0,t),i=e.slice(t);return r.concat(n,i)}function v(e,t){let n=e.indexOf(t);n>-1&&(e.splice(n,1),e.unshift(t))}function y(e,t){let n=e.indexOf(t);n>-1&&(e.splice(n,1),e.push(t))}function b(e,t){for(let n of t)e.push(n)}function x(e,t){let n=[];for(let r of e){let e=t(r);e!==void 0&&n.push(e)}return n}function S(e){return Array.isArray(e)?e:[e]}function C(e,t,n){let r=ee(e,t),i=e.length,a=n.length;e.length=i+a;for(let t=i-1;t>=r;t--)e[t+a]=e[t];for(let t=0;t<a;t++)e[t+r]=n[t]}function w(e,t,n,r){let i=ee(e,t),a=e.splice(i,n);return a===void 0&&(a=[]),C(e,i,r),a}function ee(e,t){return t<0?Math.max(t+e.length,0):Math.min(t,e.length)}var te;(function(e){function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(te||={});function ne(e,t){return(n,r)=>t(e(n),e(r))}function re(...e){return(t,n)=>{for(let r of e){let e=r(t,n);if(!te.isNeitherLessOrGreaterThan(e))return e}return te.neitherLessOrGreaterThan}}var ie=(e,t)=>e-t,ae=(e,t)=>ie(+!!e,+!!t);function oe(e){return(t,n)=>-e(t,n)}function se(e){return(t,n)=>t===void 0?n===void 0?te.neitherLessOrGreaterThan:te.lessThan:n===void 0?te.greaterThan:e(t,n)}var ce=class{constructor(e){this.firstIdx=0,this.items=e,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t<this.items.length&&e(this.items[t]);)t++;let n=t===this.firstIdx?null:this.items.slice(this.firstIdx,t);return this.firstIdx=t,n}peek(){if(this.length!==0)return this.items[this.firstIdx]}dequeue(){let e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){let t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}},le=class e{static{this.empty=new e(e=>{})}constructor(e){this.iterate=e}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||te.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}},ue=class e{constructor(e){this._indexMap=e}static createSortPermutation(t,n){let r=Array.from(t.keys()).sort((e,r)=>n(t[e],t[r]));return new e(r)}apply(e){return e.map((t,n)=>e[this._indexMap[n]])}inverse(){let t=this._indexMap.slice();for(let e=0;e<this._indexMap.length;e++)t[this._indexMap[e]]=e;return new e(t)}};function de(e){return e.reduce((e,t)=>e+t,0)}var fe=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?we.isErrorNoTelemetry(e)?new we(e.message+`
|
|
2
2
|
|
|
3
3
|
`+e.stack):Error(e.message+`
|
|
4
4
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{l as e}from"./editor.api-
|
|
1
|
+
import{l as e}from"./editor.api-DvkCO3ko.js";var t=[`assign`,`flush`,`ftl`,`return`,`global`,`import`,`include`,`break`,`continue`,`local`,`nested`,`nt`,`setting`,`stop`,`t`,`lt`,`rt`,`fallback`],n=[`attempt`,`autoesc`,`autoEsc`,`compress`,`comment`,`escape`,`noescape`,`function`,`if`,`list`,`items`,`sep`,`macro`,`noparse`,`noParse`,`noautoesc`,`noAutoEsc`,`outputformat`,`switch`,`visit`,`recurse`],r={close:`>`,id:`angle`,open:`<`},i={close:`\\]`,id:`bracket`,open:`\\[`},a={close:`[>\\]]`,id:`auto`,open:`[<\\[]`},o={close:`\\}`,id:`dollar`,open1:`\\$`,open2:`\\{`},s={close:`\\]`,id:`bracket`,open1:`\\[`,open2:`=`};function c(r){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],comments:{blockComment:[`${r.open}--`,`--${r.close}`]},autoCloseBefore:`
|
|
2
2
|
\r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`${r.open}#(?:${n.join(`|`)})([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),end:RegExp(`${r.open}/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),afterText:RegExp(`^${r.open}/#([a-zA-Z_]+)[\\r\\n\\t ]*${r.close}$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`${r.open}#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/${r.close}]*(?!/)${r.close})[^${r.open}]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function l(){return{brackets:[[`<`,`>`],[`[`,`]`],[`(`,`)`],[`{`,`}`]],autoCloseBefore:`
|
|
3
3
|
\r }]),.:;=`,autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`,notIn:[`string`]},{open:`'`,close:`'`,notIn:[`string`]}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],folding:{markers:{start:RegExp(`[<\\[]#(?:${n.join(`|`)})([^/>\\]]*(?!/)[>\\]])[^<\\[]*$`),end:RegExp(`[<\\[]/#(?:${n.join(`|`)})[\\r\\n\\t ]*>`)}},onEnterRules:[{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),afterText:RegExp(`^[<\\[]/#([a-zA-Z_]+)[\\r\\n\\t ]*[>\\]]$`),action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`[<\\[]#(?!(?:${t.join(`|`)}))([a-zA-Z_]+)([^/>\\]]*(?!/)[>\\]])[^[<\\[]]*$`),action:{indentAction:e.IndentAction.Indent}}]}}function u(e,t){let n=`_${e.id}_${t.id}`,r=e=>e.replace(/__id__/g,n),i=e=>{let t=e.source.replace(/__id__/g,n);return new RegExp(t,e.flags)};return{unicode:!0,includeLF:!1,start:r(`default__id__`),ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],[r(`open__id__`)]:new RegExp(e.open),[r(`close__id__`)]:new RegExp(e.close),[r(`iOpen1__id__`)]:new RegExp(t.open1),[r(`iOpen2__id__`)]:new RegExp(t.open2),[r(`iClose__id__`)]:new RegExp(t.close),[r(`startTag__id__`)]:i(/(@open__id__)(#)/),[r(`endTag__id__`)]:i(/(@open__id__)(\/#)/),[r(`startOrEndTag__id__`)]:i(/(@open__id__)(\/?#)/),[r(`closeTag1__id__`)]:i(/((?:@blank)*)(@close__id__)/),[r(`closeTag2__id__`)]:i(/((?:@blank)*\/?)(@close__id__)/),blank:/[ \t\n\r]/,keywords:[`false`,`true`,`in`,`as`,`using`],directiveStartCloseTag1:/attempt|recover|sep|auto[eE]sc|no(?:autoe|AutoE)sc|compress|default|no[eE]scape|comment|no[pP]arse/,directiveStartCloseTag2:/else|break|continue|return|stop|flush|t|lt|rt|nt|nested|recurse|fallback|ftl/,directiveStartBlank:/if|else[iI]f|list|for[eE]ach|switch|case|assign|global|local|include|import|function|macro|transform|visit|stop|return|call|setting|output[fF]ormat|nested|recurse|escape|ftl|items/,directiveEndCloseTag1:/if|list|items|sep|recover|attempt|for[eE]ach|local|global|assign|function|macro|output[fF]ormat|auto[eE]sc|no(?:autoe|AutoE)sc|compress|transform|switch|escape|no[eE]scape/,escapedChar:/\\(?:[ntrfbgla\\'"\{=]|(?:x[0-9A-Fa-f]{1,4}))/,asciiDigit:/[0-9]/,integer:/[0-9]+/,nonEscapedIdStartChar:/[\$@-Z_a-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u1FFF\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183-\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3006\u3031-\u3035\u303B-\u303C\u3040-\u318F\u31A0-\u31BA\u31F0-\u31FF\u3300-\u337F\u3400-\u4DB5\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5-\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uABC0-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/,escapedIdChar:/\\[\-\.:#]/,idStartChar:/(?:@nonEscapedIdStartChar)|(?:@escapedIdChar)/,id:/(?:@idStartChar)(?:(?:@idStartChar)|(?:@asciiDigit))*/,specialHashKeys:/\*\*|\*|false|true|in|as|using/,namedSymbols:/<=|>=|\\lte|\\lt|<|\\gte|\\gt|>|&&|\\and|->|->|==|!=|\+=|-=|\*=|\/=|%=|\+\+|--|<=|&&|\|\||:|\.\.\.|\.\.\*|\.\.<|\.\.!|\?\?|=|<|\+|-|\*|\/|%|\||\.\.|\?|!|&|\.|,|;/,arrows:[`->`,`->`],delimiters:[`;`,`:`,`,`,`.`],stringOperators:[`lte`,`lt`,`gte`,`gt`],noParseTags:[`noparse`,`noParse`,`comment`],tokenizer:{[r(`default__id__`)]:[{include:r(`@directive_token__id__`)},{include:r(`@interpolation_and_text_token__id__`)}],[r(`fmExpression__id__.directive`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`fmExpression__id__.interpolation`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`inParen__id__.plain`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`inParen__id__.gt`)]:[{include:r(`@blank_and_expression_comment_token__id__`)},{include:r(`@expression_token__id__`)},{include:r(`@greater_operators_token__id__`)}],[r(`noSpaceExpression__id__`)]:[{include:r(`@no_space_expression_end_token__id__`)},{include:r(`@directive_end_token__id__`)},{include:r(`@expression_token__id__`)}],[r(`unifiedCall__id__`)]:[{include:r(`@unified_call_token__id__`)}],[r(`singleString__id__`)]:[{include:r(`@string_single_token__id__`)}],[r(`doubleString__id__`)]:[{include:r(`@string_double_token__id__`)}],[r(`rawSingleString__id__`)]:[{include:r(`@string_single_raw_token__id__`)}],[r(`rawDoubleString__id__`)]:[{include:r(`@string_double_raw_token__id__`)}],[r(`expressionComment__id__`)]:[{include:r(`@expression_comment_token__id__`)}],[r(`noParse__id__`)]:[{include:r(`@no_parse_token__id__`)}],[r(`terseComment__id__`)]:[{include:r(`@terse_comment_token__id__`)}],[r(`directive_token__id__`)]:[[i(/(?:@startTag__id__)(@directiveStartCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{cases:{"@noParseTags":{token:`tag`,next:r(`@noParse__id__.$3`)},"@default":{token:`tag`}}},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartCloseTag2)(?:@closeTag2__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(?:@startTag__id__)(@directiveStartBlank)(@blank)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(?:@endTag__id__)(@directiveEndCloseTag1)(?:@closeTag1__id__)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)(@)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`,next:r(`@unifiedCall__id__`)}]],[i(/(@open__id__)(\/@)((?:(?:@id)(?:\.(?:@id))*)?)(?:@closeTag1__id__)/),[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`}]],[i(/(@open__id__)#--/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:{token:`comment`,next:r(`@terseComment__id__`)}],[i(/(?:@startOrEndTag__id__)([a-zA-Z_]+)/),e.id===`auto`?{cases:{"$1==<":{token:`@rematch`,switchTo:`@default_angle_${t.id}`},"$1==[":{token:`@rematch`,switchTo:`@default_bracket_${t.id}`}}}:[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag.invalid`,next:r(`@fmExpression__id__.directive`)}]]],[r(`interpolation_and_text_token__id__`)]:[[i(/(@iOpen1__id__)(@iOpen2__id__)/),[{token:t.id===`bracket`?`@brackets.interpolation`:`delimiter.interpolation`},{token:t.id===`bracket`?`delimiter.interpolation`:`@brackets.interpolation`,next:r(`@fmExpression__id__.interpolation`)}]],[/[\$#<\[\{]|(?:@blank)+|[^\$<#\[\{\n\r\t ]+/,{token:`source`}]],[r(`string_single_token__id__`)]:[[/[^'\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/'/,{token:`string`,next:`@pop`}]],[r(`string_double_token__id__`)]:[[/[^"\\]/,{token:`string`}],[/@escapedChar/,{token:`string.escape`}],[/"/,{token:`string`,next:`@pop`}]],[r(`string_single_raw_token__id__`)]:[[/[^']+/,{token:`string.raw`}],[/'/,{token:`string.raw`,next:`@pop`}]],[r(`string_double_raw_token__id__`)]:[[/[^"]+/,{token:`string.raw`}],[/"/,{token:`string.raw`,next:`@pop`}]],[r(`expression_token__id__`)]:[[/(r?)(['"])/,{cases:{"r'":[{token:`keyword`},{token:`string.raw`,next:r(`@rawSingleString__id__`)}],'r"':[{token:`keyword`},{token:`string.raw`,next:r(`@rawDoubleString__id__`)}],"'":[{token:`source`},{token:`string`,next:r(`@singleString__id__`)}],'"':[{token:`source`},{token:`string`,next:r(`@doubleString__id__`)}]}}],[/(?:@integer)(?:\.(?:@integer))?/,{cases:{"(?:@integer)":{token:`number`},"@default":{token:`number.float`}}}],[/(\.)(@blank*)(@specialHashKeys)/,[{token:`delimiter`},{token:``},{token:`identifier`}]],[/(?:@namedSymbols)/,{cases:{"@arrows":{token:`meta.arrow`},"@delimiters":{token:`delimiter`},"@default":{token:`operators`}}}],[/@id/,{cases:{"@keywords":{token:`keyword.$0`},"@stringOperators":{token:`operators`},"@default":{token:`identifier`}}}],[/[\[\]\(\)\{\}]/,{cases:{"\\[":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\]":{cases:{...t.id===`bracket`?{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}}:{},...e.id===`bracket`?{"$S2==directive":{token:`@brackets.directive`,next:`@popall`}}:{},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\(":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"\\)":{cases:{[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}},"\\{":{cases:{"$S2==gt":{token:`@brackets`,next:r(`@inParen__id__.gt`)},"@default":{token:`@brackets`,next:r(`@inParen__id__.plain`)}}},"\\}":{cases:{...t.id===`bracket`?{}:{"$S2==interpolation":{token:`@brackets.interpolation`,next:`@popall`}},[r(`$S1==inParen__id__`)]:{token:`@brackets`,next:`@pop`},"@default":{token:`@brackets`}}}}}],[/\$\{/,{token:`delimiter.invalid`}]],[r(`blank_and_expression_comment_token__id__`)]:[[/(?:@blank)+/,{token:``}],[/[<\[][#!]--/,{token:`comment`,next:r(`@expressionComment__id__`)}]],[r(`directive_end_token__id__`)]:[[/>/,e.id===`bracket`?{token:`operators`}:{token:`@brackets.directive`,next:`@popall`}],[i(/(\/)(@close__id__)/),[{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]]],[r(`greater_operators_token__id__`)]:[[/>/,{token:`operators`}],[/>=/,{token:`operators`}]],[r(`no_space_expression_end_token__id__`)]:[[/(?:@blank)+/,{token:``,switchTo:r(`@fmExpression__id__.directive`)}]],[r(`unified_call_token__id__`)]:[[/(@id)((?:@blank)+)/,[{token:`tag`},{token:``,next:r(`@fmExpression__id__.directive`)}]],[i(/(@id)(\/?)(@close__id__)/),[{token:`tag`},{token:`delimiter.directive`},{token:`@brackets.directive`,next:`@popall`}]],[/./,{token:`@rematch`,next:r(`@noSpaceExpression__id__`)}]],[r(`no_parse_token__id__`)]:[[i(/(@open__id__)(\/#?)([a-zA-Z]+)((?:@blank)*)(@close__id__)/),{cases:{"$S2==$3":[{token:`@brackets.directive`},{token:`delimiter.directive`},{token:`tag`},{token:``},{token:`@brackets.directive`,next:`@popall`}],"$S2==comment":[{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`},{token:`comment`}],"@default":[{token:`source`},{token:`source`},{token:`source`},{token:`source`},{token:`source`}]}}],[/[^<\[\-]+|[<\[\-]/,{cases:{"$S2==comment":{token:`comment`},"@default":{token:`source`}}}]],[r(`expression_comment_token__id__`)]:[[/--[>\]]/,{token:`comment`,next:`@pop`}],[/[^\->\]]+|[>\]\-]/,{token:`comment`}]],[r(`terse_comment_token__id__`)]:[[i(/--(?:@close__id__)/),{token:`comment`,next:`@popall`}],[/[^<\[\-]+|[<\[\-]/,{token:`comment`}]]}}}function d(e){let t=u(r,e),n=u(i,e),o=u(a,e);return{...t,...n,...o,unicode:!0,includeLF:!1,start:`default_auto_${e.id}`,ignoreCase:!1,defaultToken:`invalid`,tokenPostfix:`.freemarker2`,brackets:[{open:`{`,close:`}`,token:`delimiter.curly`},{open:`[`,close:`]`,token:`delimiter.square`},{open:`(`,close:`)`,token:`delimiter.parenthesis`},{open:`<`,close:`>`,token:`delimiter.angle`}],tokenizer:{...t.tokenizer,...n.tokenizer,...o.tokenizer}}}var f={conf:c(r),language:u(r,o)},p={conf:c(i),language:u(i,o)},m={conf:c(r),language:u(r,s)},h={conf:c(i),language:u(i,s)},g={conf:l(),language:d(o)},_={conf:l(),language:d(s)};export{m as TagAngleInterpolationBracket,f as TagAngleInterpolationDollar,_ as TagAutoInterpolationBracket,g as TagAutoInterpolationDollar,h as TagBracketInterpolationBracket,p as TagBracketInterpolationDollar};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{M as e,N as t,c as n,w as r}from"./index-DyvDC6pS.js";t(n,{assets:e});export{r as geoLibrary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./editor.api-
|
|
1
|
+
import{l as e}from"./editor.api-DvkCO3ko.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`{{!--`,`--}}`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{{`,`}}`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`<`,close:`>`},{open:`"`,close:`"`},{open:`'`,close:`'`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/(\w[\w\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}]},r={defaultToken:``,tokenPostfix:``,tokenizer:{root:[[/\{\{!--/,`comment.block.start.handlebars`,`@commentBlock`],[/\{\{!/,`comment.start.handlebars`,`@comment`],[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.root`}],[/<!DOCTYPE/,`metatag.html`,`@doctype`],[/<!--/,`comment.html`,`@commentHtml`],[/(<)(\w+)(\/>)/,[`delimiter.html`,`tag.html`,`delimiter.html`]],[/(<)(script)/,[`delimiter.html`,{token:`tag.html`,next:`@script`}]],[/(<)(style)/,[`delimiter.html`,{token:`tag.html`,next:`@style`}]],[/(<)([:\w]+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/(<\/)(\w+)/,[`delimiter.html`,{token:`tag.html`,next:`@otherTag`}]],[/</,`delimiter.html`],[/\{/,`delimiter.html`],[/[^<{]+/]],doctype:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/[^>]+/,`metatag.content.html`],[/>/,`metatag.html`,`@pop`]],comment:[[/\}\}/,`comment.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentBlock:[[/--\}\}/,`comment.block.end.handlebars`,`@pop`],[/./,`comment.content.handlebars`]],commentHtml:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.comment`}],[/-->/,`comment.html`,`@pop`],[/[^-]+/,`comment.content.html`],[/./,`comment.content.html`]],otherTag:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.otherTag`}],[/\/?>/,`delimiter.html`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.script`}],[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],scriptAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterType`}],[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.text/javascript`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.scriptWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.scriptEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],style:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.style`}],[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter.html`,`tag.html`,{token:`delimiter.html`,next:`@pop`}]]],styleAfterType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterType`}],[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleAfterTypeEquals`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.text/css`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInSimpleState.styleWithCustomType.$S2`}],[/>/,{token:`delimiter.html`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/\{\{/,{token:`@rematch`,switchTo:`@handlebarsInEmbeddedState.styleEmbedded.$S2`,nextEmbedded:`@pop`}],[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}]],handlebarsInSimpleState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`}],{include:`handlebarsRoot`}],handlebarsInEmbeddedState:[[/\{\{\{?/,`delimiter.handlebars`],[/\}\}\}?/,{token:`delimiter.handlebars`,switchTo:`@$S2.$S3`,nextEmbedded:`$S3`}],{include:`handlebarsRoot`}],handlebarsRoot:[[/"[^"]*"/,`string.handlebars`],[/[#/][^\s}]+/,`keyword.helper.handlebars`],[/else\b/,`keyword.helper.handlebars`],[/[\s]+/],[/[^}]/,`variable.parameter.handlebars`]]}};export{n as conf,r as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./editor.api-
|
|
1
|
+
import{l as e}from"./editor.api-DvkCO3ko.js";var t=[`area`,`base`,`br`,`col`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`menuitem`,`meta`,`param`,`source`,`track`,`wbr`],n={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\@\$\^\&\*\(\)\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\s]+)/g,comments:{blockComment:[`<!--`,`-->`]},brackets:[[`<!--`,`-->`],[`<`,`>`],[`{`,`}`],[`(`,`)`]],autoClosingPairs:[{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`"`,close:`"`},{open:`'`,close:`'`}],surroundingPairs:[{open:`"`,close:`"`},{open:`'`,close:`'`},{open:`{`,close:`}`},{open:`[`,close:`]`},{open:`(`,close:`)`},{open:`<`,close:`>`}],onEnterRules:[{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))([_:\\w][_:\\w-.\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),afterText:/^<\/([_:\w][_:\w-.\d]*)\s*>$/i,action:{indentAction:e.IndentAction.IndentOutdent}},{beforeText:RegExp(`<(?!(?:${t.join(`|`)}))(\\w[\\w\\d]*)([^/>]*(?!/)>)[^<]*$`,`i`),action:{indentAction:e.IndentAction.Indent}}],folding:{markers:{start:RegExp(`^\\s*<!--\\s*#region\\b.*-->`),end:RegExp(`^\\s*<!--\\s*#endregion\\b.*-->`)}}},r={defaultToken:``,tokenPostfix:`.html`,ignoreCase:!0,tokenizer:{root:[[/<!DOCTYPE/,`metatag`,`@doctype`],[/<!--/,`comment`,`@comment`],[/(<)((?:[\w\-]+:)?[\w\-]+)(\s*)(\/>)/,[`delimiter`,`tag`,``,`delimiter`]],[/(<)(script)/,[`delimiter`,{token:`tag`,next:`@script`}]],[/(<)(style)/,[`delimiter`,{token:`tag`,next:`@style`}]],[/(<)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/(<\/)((?:[\w\-]+:)?[\w\-]+)/,[`delimiter`,{token:`tag`,next:`@otherTag`}]],[/</,`delimiter`],[/[^<]+/]],doctype:[[/[^>]+/,`metatag.content`],[/>/,`metatag`,`@pop`]],comment:[[/-->/,`comment`,`@pop`],[/[^-]+/,`comment.content`],[/./,`comment.content`]],otherTag:[[/\/?>/,`delimiter`,`@pop`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/]],script:[[/type/,`attribute.name`,`@scriptAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/(<\/)(script\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],scriptAfterType:[[/=/,`delimiter`,`@scriptAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptAfterTypeEquals:[[/"module"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/'module'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.text/javascript`}],[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@scriptWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@scriptEmbedded`,nextEmbedded:`text/javascript`}],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptWithCustomType:[[/>/,{token:`delimiter`,next:`@scriptEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/script\s*>/,{token:`@rematch`,next:`@pop`}]],scriptEmbedded:[[/<\/script/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]],style:[[/type/,`attribute.name`,`@styleAfterType`],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/(<\/)(style\s*)(>)/,[`delimiter`,`tag`,{token:`delimiter`,next:`@pop`}]]],styleAfterType:[[/=/,`delimiter`,`@styleAfterTypeEquals`],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleAfterTypeEquals:[[/"([^"]*)"/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/'([^']*)'/,{token:`attribute.value`,switchTo:`@styleWithCustomType.$1`}],[/>/,{token:`delimiter`,next:`@styleEmbedded`,nextEmbedded:`text/css`}],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleWithCustomType:[[/>/,{token:`delimiter`,next:`@styleEmbedded.$S2`,nextEmbedded:`$S2`}],[/"([^"]*)"/,`attribute.value`],[/'([^']*)'/,`attribute.value`],[/[\w\-]+/,`attribute.name`],[/=/,`delimiter`],[/[ \t\r\n]+/],[/<\/style\s*>/,{token:`@rematch`,next:`@pop`}]],styleEmbedded:[[/<\/style/,{token:`@rematch`,next:`@pop`,nextEmbedded:`@pop`}],[/[^<]+/,``]]}};export{n as conf,r as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e}from"./editor.api-
|
|
1
|
+
import{l as e}from"./editor.api-DvkCO3ko.js";import{t}from"./workers-C7Ye5B7D.js";import{_ as n,a as r,c as i,d as a,f as o,g as s,h as c,i as l,l as u,m as d,n as f,o as p,p as m,r as h,s as g,t as _,u as v,v as y}from"./lspLanguageFeatures-QhV9XtLp.js";var b=12e4,x=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._idleCheckInterval=window.setInterval(()=>this._checkIfIdle(),3e4),this._lastUsedTime=0,this._configChangeListener=this._defaults.onDidChange(()=>this._stopWorker())}_stopWorker(){this._worker&&=(this._worker.dispose(),null),this._client=null}dispose(){clearInterval(this._idleCheckInterval),this._configChangeListener.dispose(),this._stopWorker()}_checkIfIdle(){this._worker&&Date.now()-this._lastUsedTime>b&&this._stopWorker()}_getClient(){return this._lastUsedTime=Date.now(),this._client||=(this._worker=t({moduleId:`vs/language/html/htmlWorker`,createWorker:()=>new Worker(new URL(`/assets/html.worker-C93Ht9o9.js`,``+import.meta.url),{type:`module`}),createData:{languageSettings:this._defaults.options,languageId:this._defaults.languageId},label:this._defaults.languageId}),this._worker.getProxy()),this._client}getLanguageServiceWorker(...e){let t;return this._getClient().then(e=>{t=e}).then(t=>{if(this._worker)return this._worker.withSyncedResources(e)}).then(e=>t)}},S=class extends _{constructor(e){super(e,[`.`,`:`,`<`,`"`,`=`,`/`])}};function C(t){let n=new x(t),o=(...e)=>n.getLanguageServiceWorker(...e),s=t.languageId;e.registerCompletionItemProvider(s,new S(o)),e.registerHoverProvider(s,new a(o)),e.registerDocumentHighlightProvider(s,new p(o)),e.registerLinkProvider(s,new g(o)),e.registerFoldingRangeProvider(s,new v(o)),e.registerDocumentSymbolProvider(s,new u(o)),e.registerSelectionRangeProvider(s,new d(o)),e.registerRenameProvider(s,new m(o)),s===`html`&&(e.registerDocumentFormattingEditProvider(s,new r(o)),e.registerDocumentRangeFormattingEditProvider(s,new i(o)))}function w(t){let n=[],o=[],s=new x(t);n.push(s);let c=(...e)=>s.getLanguageServiceWorker(...e);function l(){let{languageId:n,modeConfiguration:s}=t;E(o),s.completionItems&&o.push(e.registerCompletionItemProvider(n,new S(c))),s.hovers&&o.push(e.registerHoverProvider(n,new a(c))),s.documentHighlights&&o.push(e.registerDocumentHighlightProvider(n,new p(c))),s.links&&o.push(e.registerLinkProvider(n,new g(c))),s.documentSymbols&&o.push(e.registerDocumentSymbolProvider(n,new u(c))),s.rename&&o.push(e.registerRenameProvider(n,new m(c))),s.foldingRanges&&o.push(e.registerFoldingRangeProvider(n,new v(c))),s.selectionRanges&&o.push(e.registerSelectionRangeProvider(n,new d(c))),s.documentFormattingEdits&&o.push(e.registerDocumentFormattingEditProvider(n,new r(c))),s.documentRangeFormattingEdits&&o.push(e.registerDocumentRangeFormattingEditProvider(n,new i(c)))}return l(),n.push(T(o)),T(n)}function T(e){return{dispose:()=>E(e)}}function E(e){for(;e.length;)e.pop().dispose()}export{_ as CompletionAdapter,f as DefinitionAdapter,h as DiagnosticsAdapter,l as DocumentColorAdapter,r as DocumentFormattingEditProvider,p as DocumentHighlightAdapter,g as DocumentLinkAdapter,i as DocumentRangeFormattingEditProvider,u as DocumentSymbolAdapter,v as FoldingRangeAdapter,a as HoverAdapter,o as ReferenceAdapter,m as RenameAdapter,d as SelectionRangeAdapter,x as WorkerManager,c as fromPosition,s as fromRange,w as setupMode,C as setupMode1,n as toRange,y as toTextEdit};
|