Skip to content

Commit c562ccb

Browse files
committed
4.0.0
1 parent 9baee1b commit c562ccb

1,244 files changed

Lines changed: 216354 additions & 206106 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

_app/immutable/assets/0.vgO-Uy72.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.editor-container.svelte-w3xzsj .cm-editor{background:var(--color-editor-bg)}

_app/immutable/assets/ContentRenderer.CMpMcMIU.css

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.editor-container.svelte-1swpx59 .cm-editor{height:100%}

_app/immutable/chunks/BVhwz5iQ.js

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_app/immutable/chunks/BY_RssUb.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_app/immutable/chunks/BjDsAonG.js

Lines changed: 535 additions & 0 deletions
Large diffs are not rendered by default.

_app/immutable/chunks/CAt-Lb07.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import{nt as e}from"./BY_RssUb.js";e();

_app/immutable/chunks/CVMOr__I.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_app/immutable/chunks/CmgMociJ.js

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import{$ as e,B as t,C as n,D as r,G as i,I as a,J as o,K as s,N as c,S as l,T as u,U as d,W as f,X as p,Y as m,_ as h,b as g,c as _,d as v,et as y,i as b,it as x,l as S,n as C,o as w,q as T,rt as E,u as D,v as O,w as k,x as A,y as j,z as M}from"./BY_RssUb.js";import{l as N}from"./DTR9fq_7.js";import"./xihTtKlq.js";import{n as P,t as F}from"./CxMCXhHm.js";import{a as I,i as L,n as R,r as z,t as B}from"./BVhwz5iQ.js";var V=u(`<div class="overflow-hidden flex flex-col gap-1 svelte-yayuls"><div><div class="svelte-yayuls"></div></div> <!></div>`);function H(u,f){y(f,!0);let m=b(f,`code`,15),h=b(f,`editable`,3,!1),g,_=o(null),C=o(!1);t(()=>{m()&&T(C,!0)});let O=o(s(f.initialExpanded??!1)),k=o(!1),j=p(()=>f.minHeight||450);t(()=>{if(g&&c(C)){let e=a(()=>m()),t=a(()=>f.highlight),n=h()?R(f.language,e=>{m(e)},t):z(f.language,t);return T(_,new L({state:I.create({doc:e,extensions:n}),parent:g}),!0),()=>{c(_)?.destroy(),T(_,null)}}}),t(()=>{if(g){let e=new ResizeObserver(()=>{T(k,g.scrollHeight>c(j))});return e.observe(g),()=>e.disconnect()}});let N=o(!1);t(()=>{if(c(N)||!c(_)||!f.highlight?.length||!c(k)||c(O))return;let e=c(_),t=g.parentElement,n=Math.min(...f.highlight);if(t&&n>=1&&n<=e.state.doc.lines){let r=e.lineBlockAt(e.state.doc.line(n).from);t.scrollTop=r.top+r.height/2-t.clientHeight/2,T(N,!0)}});function P(e){c(_)&&c(_).dispatch({changes:{from:0,to:c(_).state.doc.length,insert:e}})}var B={updateContent:P},H=V(),U=d(H);w(d(U),e=>g=e,()=>g),x(U);var W=i(U,2),G=e=>{F(e,{variant:`outline`,size:`sm`,onclick:()=>T(O,!c(O)),children:(e,t)=>{E();var i=r();M(()=>l(i,c(O)?`Show Less`:`Show More`)),n(e,i)},$$slots:{default:!0}})};return A(W,e=>{c(k)&&e(G)}),x(H),M(()=>{D(U,1,v(!c(O)&&c(k)?`overflow-auto`:`overflow-hidden`),`svelte-yayuls`),S(U,!c(O)&&c(k)?`max-height: ${c(j)}px`:void 0)}),n(u,H),e(B)}var U=u(`<iframe sandbox="allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox" title="Diagram Preview" class="w-full h-full min-h-75 lg:min-h-100"></iframe>`);function W(r,i){y(i,!0);let a=b(i,`animation`,3,!1),s=b(i,`noScaffolding`,3,!1),l=b(i,`extraScripts`,19,()=>[]),u=o(``),d=null;t(()=>{let e=p();return d&&clearTimeout(d),d=setTimeout(()=>{T(u,e,!0)},300),()=>{d&&clearTimeout(d)}});function f(e){return e.replace(/\\/g,`\\\\`).replace(/`/g,"\\`").replace(/\$/g,`\\$`)}function p(){let e=f(i.code),t=l().map(e=>` <script src="${e}"><\/script>`).join(`
2+
`),n=s()?`// goCode2: user code creates its own diagram
3+
const userCode = \`${e}\`;
4+
const fn = new Function('go', userCode);
5+
fn(go);`:`const div = document.createElement('div');
6+
div.className = 'diagramStyling';
7+
8+
${i.parentElementId?`const parentEl = document.getElementById('${i.parentElementId}');
9+
if (parentEl) {
10+
parentEl.appendChild(div);
11+
} else {
12+
document.body.appendChild(div);
13+
}`:`document.body.appendChild(div);`}
14+
15+
// Create diagram and provide goCode scaffolding variables
16+
const diagram = new go.Diagram(div);
17+
diagram.animationManager.isInitial = ${a()};
18+
const $ = go.GraphObject.make;
19+
20+
// Execute user code with diagram and $ in scope
21+
const userCode = \`${e}\`;
22+
const fn = new Function('diagram', '$', userCode);
23+
fn(diagram, $);`;return`<!DOCTYPE html>
24+
<html>
25+
<head>
26+
<meta charset="UTF-8">
27+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
28+
<script src="${N(`/release/go.js`)}"><\/script>
29+
${t}
30+
<style>
31+
body, html {
32+
color-scheme: dark;
33+
margin: 0;
34+
padding: 0;
35+
font-family: sans-serif;
36+
height: 100%;
37+
overflow: hidden;
38+
}
39+
.diagramStyling {
40+
background: whitesmoke;
41+
width: 100%;
42+
height: 100%;
43+
margin: -1px;
44+
max-height: 700px;
45+
}
46+
body.has-html {
47+
display: flex;
48+
flex-direction: column;
49+
height: 100%;
50+
}
51+
body.has-html .diagramStyling {
52+
flex: 1;
53+
height: auto;
54+
}
55+
.extra-html {
56+
padding: 8px;
57+
flex-shrink: 0;
58+
}
59+
button, input[type="button"] {
60+
border: 1px solid rgba(255, 255, 255, 0.15);
61+
padding: 6px 12px; border-radius: 6px; font: 12px sans-serif; margin: 4px;
62+
}
63+
</style>
64+
</head>
65+
<body${i.html?` class="has-html"`:``}>
66+
${s()?`<div id="myDiagramDiv" class="diagramStyling"></div>`:i.parentElementId?`<div id="${i.parentElementId}"></div>`:``}
67+
<script>
68+
requestAnimationFrame(function() {
69+
try {
70+
${n}
71+
} catch (error) {
72+
console.error('Error executing diagram code:', error);
73+
document.body.innerHTML = '<div style="color: red; padding: 10px;">Error: ' + error.message + '</div>';
74+
}
75+
});
76+
<\/script>
77+
${i.html?`<div class="extra-html">${i.html}</div>`:``}
78+
</body>
79+
</html>`}var m=U();M(()=>{_(m,`srcdoc`,c(u)),S(m,typeof i.minHeight==`number`?`min-height: ${i.minHeight}px`:``)}),n(r,m),e()}var G=u(`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"></path><path d="M3 3v5h5"></path></svg> <span>Reset</span>`,1),K=u(`<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><polyline points="7 10 12 15 17 10"></polyline><line x1="12" y1="15" x2="12" y2="3"></line></svg> <span>Download</span>`,1),q=u(`<div class="flex items-center gap-2 bg-editor-bg"><!> <!></div>`);function J(e,t){var r=q(),a=d(r);F(a,{variant:`ghost`,size:`sm`,get onclick(){return t.onReset},title:`Reset to original code`,children:(e,t)=>{var r=G();E(2),n(e,r)},$$slots:{default:!0}}),F(i(a,2),{variant:`ghost`,size:`sm`,get onclick(){return t.onDownload},title:`Download as HTML file`,children:(e,t)=>{var r=K();E(2),n(e,r)},$$slots:{default:!0}}),x(r),n(e,r)}function Y(e){let t=e.match(/\/extensions\/(.+)$/);return t?`https://cdn.jsdelivr.net/npm/create-gojs-kit@latest/dist/extensions/${t[1]}`:e}function X({code:e,noScaffolding:t=!1,parentElementId:n,animation:r=!1,html:i,extraScripts:a=[]}){let o=a.map(e=>` <script src="${Y(e)}"><\/script>`).join(`
80+
`),s=t?` // User code creates its own diagram
81+
${e}`:` const div = document.createElement('div');
82+
div.className = 'diagramStyling';
83+
84+
${n?`const parentEl = document.getElementById('${n}');
85+
if (parentEl) {
86+
parentEl.appendChild(div);
87+
} else {
88+
document.body.appendChild(div);
89+
}`:`document.body.appendChild(div);`}
90+
91+
// Create diagram and provide GoJS scaffolding
92+
const diagram = new go.Diagram(div);
93+
${r?`diagram.animationManager.isInitial = true;`:``};
94+
95+
// User code
96+
${e}`,c=`${t?`<div id="myDiagramDiv" class="diagramStyling"></div>`:n?`<div id="${n}"></div>`:``}
97+
<script>
98+
function init() {
99+
${s}
100+
}
101+
102+
// Wait until the DOM is ready before creating the diagram
103+
document.addEventListener('DOMContentLoaded', init);
104+
<\/script>`;return`<!DOCTYPE html>
105+
<html>
106+
<head>
107+
<meta charset="UTF-8">
108+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
109+
<title>GoJS Diagram</title>
110+
<script src="https://cdn.jsdelivr.net/npm/gojs@latest"><\/script>${o?`\n${o}`:``}
111+
<style>
112+
body, html {
113+
margin: 0;
114+
padding: 0;
115+
font-family: sans-serif;
116+
height: 100%;
117+
}
118+
.diagramStyling {
119+
background: white;
120+
width: 100%;
121+
height: 100%;
122+
}${i?`
123+
body.has-html {
124+
display: flex;
125+
flex-direction: column;
126+
height: 100%;
127+
}
128+
body.has-html .diagramStyling {
129+
flex: 1;
130+
height: auto;
131+
}
132+
.extra-html {
133+
padding: 8px;
134+
flex-shrink: 0;
135+
}`:``}
136+
</style>
137+
</head>
138+
<body${i?` class="has-html"`:``}>
139+
${c}
140+
${i?`<div class="extra-html">${i}</div>`:``}
141+
</body>
142+
</html>`}var Z=u(`<div><!> <!></div>`),Q=u(`<div><!> <div><!></div></div>`);function $(r,a){y(a,!0);let s=b(a,`animation`,3,!1),l=b(a,`split`,3,60),u=b(a,`wide`,3,!1),f=b(a,`noScaffolding`,3,!1),p=b(a,`stacked`,3,!1),h=b(a,`hideCode`,3,!1);b(a,`initiallyVisible`,3,!0);let _=b(a,`extraScripts`,19,()=>[]),C=o(``),w=o(``),E=o(0);t(()=>{c(C)||(T(C,a.code,!0),T(w,a.code,!0))});function O(){T(w,c(C),!0),m(E)}function k(){let e=X({code:c(w),noScaffolding:f(),parentElementId:a.parentElementId,animation:s(),html:a.html,extraScripts:_()}),t=new Blob([e],{type:`text/html`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`diagram.html`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(n)}var j=Q();let N;var F=d(j),I=e=>{var t=Z(),r=d(t);J(r,{onReset:O,onDownload:k}),g(i(r,2),()=>c(E),e=>{H(e,{language:`javascript`,editable:!0,get highlight(){return a.highlight},get minHeight(){return a.minHeight},get initialExpanded(){return a.expanded},get code(){return c(w)},set code(e){T(w,e,!0)}})}),x(t),M(e=>{D(t,1,e,`svelte-1x7kvj4`),S(t,p()?void 0:`flex: ${l()}`)},[()=>v(P(!p()&&`flex-[${l()}] lg:min-w-0 lg:flex lg:flex-col lg:gap-1`))]),n(e,t)};A(F,e=>{h()||e(I)});var L=i(F,2);W(d(L),{get code(){return c(w)},get parentElementId(){return a.parentElementId},get animation(){return s()},get noScaffolding(){return f()},get html(){return a.html},get minHeight(){return a.minHeight},get extraScripts(){return _()}}),x(L),x(j),M((e,t)=>{N=D(j,1,e,`svelte-1x7kvj4`,N,{wide:u()}),D(L,1,t,`svelte-1x7kvj4`),S(L,p()||h()?void 0:`flex: ${100-l()}`)},[()=>v(P(`code-example dark scheme-dark my-4 p-2 rounded-lg bg-editor-bg flex flex-col gap-1`,!(p()||h())&&`lg:flex-row lg:items-stretch`)),()=>v(P(`flex justify-center items-start`,!(p()||h())&&`lg:min-w-0`))]),n(r,j),e()}var ee=u(`<div class="max-w-5xl ms-0 2xl:mx-auto"></div>`),te=u(`<div class="max-w-7xl mx-auto"></div>`);function ne(t,r){y(r,!0);let i=b(r,`extraScripts`,19,()=>[]),a=b(r,`pageScript`,3,null),o=p(()=>r.htmlContent.split(/<!-- CODE_BLOCK_(\d+) -->/));C(()=>{let e=decodeURIComponent(location.hash.slice(1));e&&(document.fonts?.ready??Promise.resolve()).then(()=>{requestAnimationFrame(()=>requestAnimationFrame(()=>{document.getElementById(e)?.scrollIntoView()}))})}),C(()=>{if(!a())return;let e=N(`/release/go.js`),t=document.createElement(`script`);t.src=e,t.onload=()=>{let e=document.createElement(`script`);e.textContent=a(),document.body.appendChild(e)},document.head.appendChild(t)});var s=te();O(s,21,()=>c(o),j,(e,t,a)=>{var o=k(),s=f(o),l=e=>{var r=ee();h(r,()=>c(t),!0),x(r),n(e,r)},u=e=>{let a=p(()=>parseInt(c(t))),o=p(()=>r.codeBlocks[c(a)]);var s=k(),l=f(s),u=e=>{var t=k(),r=f(t),a=e=>{{let t=p(()=>c(o).initiallyVisible??!0);$(e,{get code(){return c(o).code},get parentElementId(){return c(o).parentElementId},get animation(){return c(o).animation},get split(){return c(o).split},get expanded(){return c(o).expanded},get wide(){return c(o).wide},get noScaffolding(){return c(o).noScaffolding},get stacked(){return c(o).stacked},get html(){return c(o).html},get hideCode(){return c(o).hideCode},get minHeight(){return c(o).minHeight},get highlight(){return c(o).highlight},get initiallyVisible(){return c(t)},get extraScripts(){return i()}})}},s=e=>{B(e,{get code(){return c(o).code},get language(){return c(o).language}})};A(r,e=>{c(o).isExecutable?e(a):e(s,-1)}),n(e,t)};A(l,e=>{c(o)&&e(u)}),n(e,s)};A(s,e=>{a%2==0?e(l):e(u,-1)}),n(e,o)}),x(s),n(t,s),e()}export{ne as t};

0 commit comments

Comments
 (0)