@marimo-team/frontend 0.12.1-dev17 → 0.12.1-dev18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-CIdBdqTH.js → ConnectedDataExplorerComponent-C8AMeWD_.js} +1 -1
- package/dist/assets/{VegaLite-Cmmaj1h0.js → VegaLite-Bg4VxZEe.js} +1 -1
- package/dist/assets/{_baseEach-DZ2-Wvj9.js → _baseEach-CwQ5kwoY.js} +1 -1
- package/dist/assets/_baseMap-lz3_fYgf.js +1 -0
- package/dist/assets/{_baseUniq-BhUbbBF5.js → _baseUniq-CL1KGcfC.js} +1 -1
- package/dist/assets/{any-language-editor-CIPQu7h1.js → any-language-editor-DH3f0Pgv.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-D-nVISbh.js → architectureDiagram-IEHRJDOE-D1byLKGo.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-CJxapnZA.js → blockDiagram-JOT3LUYC-JFZe8daP.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-DYlDggUC.js → c4Diagram-VJAJSXHY-BvhXxJ57.js} +1 -1
- package/dist/assets/channel-vUyDYEMQ.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-W9hQeVNH.js → chunk-4BMEZGHF-B87J-Yh7.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-BScB81IB.js → chunk-A2AXSNBT-DgaQcXKE.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-9H7RwcMs.js → chunk-AEK57VVT-DG4orfNV.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-cJLPyVUs.js → chunk-D6G4REZN-B7ScLJGG.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-iMRQ5DNj.js → chunk-RZ5BOZE2-DnI79CL-.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-CAxcN06h.js → chunk-XZIHB7SX-qrkWTd-p.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-DhRCIrCF.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-DhRCIrCF.js +1 -0
- package/dist/assets/clone-pkmJ0o9b.js +1 -0
- package/dist/assets/{compile-Dw8l0qJ8.js → compile-DNRoE2CW.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-OevFR_we.js → dagre-OKDRZEBW-BbRDQ0V1.js} +1 -1
- package/dist/assets/{data-editor-Bi7rUa-e.js → data-editor-KDEms4yk.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-vpHLw_ry.js → diagram-SSKATNLV-X95q2U0r.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-BD-c7b3W.js → diagram-VNBRO52H-RpZzfTPT.js} +1 -1
- package/dist/assets/{edit-page-DQ7ka_M2.js → edit-page-CMXxJ9Nw.js} +3 -3
- package/dist/assets/{erDiagram-Q7BY3M3F-CRpMqrG4.js → erDiagram-Q7BY3M3F-BymV3H2w.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-BfCQQvoV.js → flowDiagram-4HSFHLVR-CkCZS7_u.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-BZ_EZaCJ.js → ganttDiagram-APWFNJXF-CDqpGHRe.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-B6BeGqYJ.js → gitGraphDiagram-7IBYFJ6S-unTQQsMH.js} +1 -1
- package/dist/assets/{graph-BclYBU2O.js → graph-Dv7xXdEG.js} +1 -1
- package/dist/assets/{home-page-d7YSoNqw.js → home-page-BFkJ7-B_.js} +1 -1
- package/dist/assets/{index-CD-frxy0.js → index-1eirSJau.js} +1 -1
- package/dist/assets/{index-CQhWbXy_.js → index-5tGPDwWa.js} +1 -1
- package/dist/assets/{index-CRoyzR7W.js → index-BLMdly9w.js} +1 -1
- package/dist/assets/{index-DI2XKEC8.js → index-BMAdnoWo.js} +1 -1
- package/dist/assets/{index-D8Hhv8Np.js → index-BMlS6uYT.js} +1 -1
- package/dist/assets/{index-CAl7lwM9.js → index-BcqhqN5p.js} +1 -1
- package/dist/assets/{index-vUBkaahw.js → index-C0-8E-3A.js} +1 -1
- package/dist/assets/{index-CxB2HADw.js → index-C4EckaUc.js} +1 -1
- package/dist/assets/index-CO0_ST9I.css +1 -0
- package/dist/assets/{index-CKnWX7ZK.js → index-CdXYuNSZ.js} +1 -1
- package/dist/assets/{index-CvG_edER.js → index-Cofgw496.js} +1 -1
- package/dist/assets/{index-DppJOfWu.js → index-D121NFiR.js} +1 -1
- package/dist/assets/{index-DeHbsICO.js → index-D49HdiOx.js} +1 -1
- package/dist/assets/{index-BuM_XUJ5.js → index-DvoYSdP5.js} +1 -1
- package/dist/assets/{index-BdLNPvbI.js → index-GNxzMQ8N.js} +1 -1
- package/dist/assets/{index-D-935-rG.js → index-HWP9cok6.js} +1 -1
- package/dist/assets/{index-VOVqHCWS.js → index-Nn9B6zgQ.js} +1 -1
- package/dist/assets/{index-C7Z3Tn_p.js → index-_UjCLpCJ.js} +6 -6
- package/dist/assets/{infoDiagram-PH2N3AL5-DoBzkaSq.js → infoDiagram-PH2N3AL5-CA16TKZ9.js} +1 -1
- package/dist/assets/{journeyDiagram-U35MCT3I-CHp5QHlK.js → journeyDiagram-U35MCT3I-DTgQ9H3o.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-D_WAHhn6.js → kanban-definition-NDS4AKOZ-CFPUr2Lz.js} +1 -1
- package/dist/assets/{layout-DX7qun7I.js → layout-BsvPTK3e.js} +1 -1
- package/dist/assets/{linear-koyOEwgo.js → linear-BKtQqQMl.js} +1 -1
- package/dist/assets/{mermaid-iTVWBQYm.js → mermaid-Ca6wa6bI.js} +2 -2
- package/dist/assets/{min-CFAuCZ4x.js → min-BB070bMw.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-C3QvPYhx.js → mindmap-definition-ALO5MXBD-CooVvMJZ.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-CUYLTKvt.js → pieDiagram-IB7DONF6-DvzBnhBC.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-Db6mfiUU.js → quadrantDiagram-7GDLP6J5-DMIBQyu-.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-D-ojmnKz.js → radar-MK3ICKWK-BiITaoMS.js} +1 -1
- package/dist/assets/{react-plotly-Bt8glUti.js → react-plotly-DY878FV_.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-HS-nL_Fe.js → requirementDiagram-KVF5MWMF-Dubp2g4b.js} +1 -1
- package/dist/assets/{run-page-DiitcFme.js → run-page-DKddN7--.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-XBmFlqg2.js → sankeyDiagram-QLVOVGJD-r1_Kckn8.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-MUcXAIlW.js → sequenceDiagram-X6HHIX6F-G3HWcShb.js} +1 -1
- package/dist/assets/{slides-component-C4_c6iNO.js → slides-component-yd1hLBrb.js} +1 -1
- package/dist/assets/{sortBy-Dqd41Bi2.js → sortBy-CZLdWjjp.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-hClM8Tfr.js → stateDiagram-DGXRK772-DypjKrdS.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-C16a2g24.js +1 -0
- package/dist/assets/{terminal-D5zyE9w2.js → terminal-BWM7PZvQ.js} +1 -1
- package/dist/assets/{time-Do5JQNI-.js → time-nINFQ1le.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-CZlTe6lZ.js → timeline-definition-BDJGKUSR-XeT79dp2.js} +1 -1
- package/dist/assets/{tree-B3KGfPFI.js → tree-5hbIvcMt.js} +2 -2
- package/dist/assets/{useMarimoWebSocket-D4gZn5ie.js → useMarimoWebSocket-CNRbbY5Y.js} +3 -3
- package/dist/assets/{vega-component-Dc3wBuVa.js → vega-component-CeXRXp3e.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-DQSnnRGC.js → xychartDiagram-VJFVF3MP-B260jTs9.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/_baseMap-PsBlbLrd.js +0 -1
- package/dist/assets/channel-BF-zXXHH.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-Dqd2OCo1.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-Dqd2OCo1.js +0 -1
- package/dist/assets/clone-B_2czC9X.js +0 -1
- package/dist/assets/index-CuNK5XUR.css +0 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-ElKL9DsG.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ad as r,ae as n,af as t,ag as a,ah as e,ai as i,y as u,aj as o,z as f}from"./index-
|
|
1
|
+
import{ad as r,ae as n,af as t,ag as a,ah as e,ai as i,y as u,aj as o,z as f}from"./index-_UjCLpCJ.js";import{a as s}from"./_baseEach-CwQ5kwoY.js";import{b as c}from"./_baseMap-lz3_fYgf.js";function l(n,t){if(n!==t){var a=void 0!==n,e=null===n,i=n==n,u=r(n),o=void 0!==t,f=null===t,s=t==t,c=r(t);if(!f&&!c&&!u&&n>t||u&&o&&s&&!f&&!c||e&&o&&s||!a&&s||!i)return 1;if(!e&&!u&&!c&&n<t||c&&a&&i&&!e&&!u||f&&a&&i||!o&&i||!s)return-1}return 0}function v(r,u,o){u=u.length?n(u,(function(r){return t(r)?function(n){return a(n,1===r.length?r[0]:r)}:r})):[e];var f=-1;return u=n(u,i(s)),function(r,n){var t=r.length;for(r.sort(n);t--;)r[t]=r[t].value;return r}(c(r,(function(r,t,a){return{criteria:n(u,(function(n){return n(r)})),index:++f,value:r}})),(function(r,n){return function(r,n,t){for(var a=-1,e=r.criteria,i=n.criteria,u=e.length,o=t.length;++a<u;){var f=l(e[a],i[a]);if(f)return a>=o?f:f*("desc"==t[a]?-1:1)}return r.index-n.index}(r,n,o)}))}var d=u((function(r,n){if(null==r)return[];var t=n.length;return t>1&&o(r,n[0],n[1])?n=[]:t>2&&o(n[0],n[1],n[2])&&(n=[n[0]]),v(r,f(n),[])}));export{d as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t,a as e,S as a}from"./chunk-AEK57VVT-9H7RwcMs.js";import{_ as i,c as r,l as n,d as s,j as d,u as o}from"./mermaid-iTVWBQYm.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-BclYBU2O.js";import{l as h}from"./layout-DX7qun7I.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-RZ5BOZE2-iMRQ5DNj.js";import"./index-C7Z3Tn_p.js";import"./_baseUniq-BhUbbBF5.js";import"./_baseEach-DZ2-Wvj9.js";import"./min-CFAuCZ4x.js";import"./_baseMap-PsBlbLrd.js";import"./sortBy-Dqd41Bi2.js";var x,f={},u=i(((t,e)=>{f[t]=e}),"set"),y=i((t=>f[t]),"get"),m=i((()=>Object.keys(f)),"keys"),w=i((()=>m().length),"size"),b={get:y,set:u,keys:m,size:w},B=i((t=>t.append("circle").attr("class","start-state").attr("r",r().state.sizeUnit).attr("cx",r().state.padding+r().state.sizeUnit).attr("cy",r().state.padding+r().state.sizeUnit)),"drawStartState"),k=i((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",r().state.textHeight).attr("class","divider").attr("x2",2*r().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),E=i(((t,e)=>{const a=t.append("text").attr("x",2*r().state.padding).attr("y",r().state.textHeight+2*r().state.padding).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",i.width+2*r().state.padding).attr("height",i.height+2*r().state.padding).attr("rx",r().state.radius),a}),"drawSimpleState"),S=i(((t,e)=>{const a=i((function(t,e,a){const i=t.append("tspan").attr("x",2*r().state.padding).text(e);a||i.attr("dy",r().state.textHeight)}),"addTspan"),n=t.append("text").attr("x",2*r().state.padding).attr("y",r().state.textHeight+1.3*r().state.padding).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=n.height,d=t.append("text").attr("x",r().state.padding).attr("y",s+.4*r().state.padding+r().state.dividerMargin+r().state.textHeight).attr("class","state-description");let o=!0,g=!0;e.descriptions.forEach((function(t){o||(a(d,t,g),g=!1),o=!1}));const p=t.append("line").attr("x1",r().state.padding).attr("y1",r().state.padding+s+r().state.dividerMargin/2).attr("y2",r().state.padding+s+r().state.dividerMargin/2).attr("class","descr-divider"),h=d.node().getBBox(),c=Math.max(h.width,n.width);return p.attr("x2",c+3*r().state.padding),t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",c+2*r().state.padding).attr("height",h.height+s+2*r().state.padding).attr("rx",r().state.radius),t}),"drawDescrState"),N=i(((t,e,a)=>{const i=r().state.padding,n=2*r().state.padding,s=t.node().getBBox(),d=s.width,o=s.x,g=t.append("text").attr("x",0).attr("y",r().state.titleShift).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.id),p=g.node().getBBox().width+n;let h,c=Math.max(p,d);c===d&&(c+=n);const l=t.node().getBBox();e.doc,h=o-i,p>d&&(h=(d-c)/2+i),Math.abs(o-l.x)<i&&p>d&&(h=o-(p-d)/2);const x=1-r().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",c).attr("height",l.height+r().state.textHeight+r().state.titleShift+1).attr("rx","0"),g.attr("x",h+i),p<=d&&g.attr("x",o+(c-n)/2-p/2+i),t.insert("rect",":first-child").attr("x",h).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",c).attr("height",3*r().state.textHeight).attr("rx",r().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",c).attr("height",l.height+3+2*r().state.textHeight).attr("rx",r().state.radius),t}),"addTitleAndBox"),M=i((t=>(t.append("circle").attr("class","end-state-outer").attr("r",r().state.sizeUnit+r().state.miniPadding).attr("cx",r().state.padding+r().state.sizeUnit+r().state.miniPadding).attr("cy",r().state.padding+r().state.sizeUnit+r().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",r().state.sizeUnit).attr("cx",r().state.padding+r().state.sizeUnit+2).attr("cy",r().state.padding+r().state.sizeUnit+2))),"drawEndState"),v=i(((t,e)=>{let a=r().state.forkWidth,i=r().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",r().state.padding).attr("y",r().state.padding)}),"drawForkJoinState"),z=i(((t,e,a,i)=>{let n=0;const s=i.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let o=t.replace(/\r\n/g,"<br/>");o=o.replace(/\n/g,"<br/>");const g=o.split(d.lineBreakRegex);let p=1.25*r().state.noteMargin;for(const d of g){const t=d.trim();if(t.length>0){const i=s.append("tspan");if(i.text(t),0===p){p+=i.node().getBBox().height}n+=p,i.attr("x",e+r().state.noteMargin),i.attr("y",a+n+1.25*r().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:n}}),"_drawLongText"),j=i(((t,e)=>{e.attr("class","state-note");const a=e.append("rect").attr("x",0).attr("y",r().state.padding),i=e.append("g"),{textWidth:n,textHeight:s}=z(t,0,0,i);return a.attr("height",s+2*r().state.noteMargin),a.attr("width",n+2*r().state.noteMargin),a}),"drawNote"),H=i((function(t,e){const a=e.id,i={id:a,label:e.id,width:0,height:0},n=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&B(n),"end"===e.type&&M(n),"fork"!==e.type&&"join"!==e.type||v(n,e),"note"===e.type&&j(e.note.text,n),"divider"===e.type&&k(n),"default"===e.type&&0===e.descriptions.length&&E(n,e),"default"===e.type&&e.descriptions.length>0&&S(n,e);const s=n.node().getBBox();return i.width=s.width+2*r().state.padding,i.height=s.height+2*r().state.padding,b.set(a,i),i}),"drawState"),T=0,D=i((function(t,e,s){const g=i((function(t){switch(t){case a.relationType.AGGREGATION:return"aggregation";case a.relationType.EXTENSION:return"extension";case a.relationType.COMPOSITION:return"composition";case a.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const p=e.points,h=c().x((function(t){return t.x})).y((function(t){return t.y})).curve(l),x=t.append("path").attr("d",h(p)).attr("id","edge"+T).attr("class","transition");let f="";if(r().state.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),x.attr("marker-end","url("+f+"#"+g(a.relationType.DEPENDENCY)+"End)"),void 0!==s.title){const a=t.append("g").attr("class","stateLabel"),{x:i,y:g}=o.calcLabelPosition(e.points),p=d.getRows(s.title);let h=0;const c=[];let l=0,x=0;for(let t=0;t<=p.length;t++){const e=a.append("text").attr("text-anchor","middle").text(p[t]).attr("x",i).attr("y",g+h),r=e.node().getBBox();if(l=Math.max(l,r.width),x=Math.min(x,r.x),n.info(r.x,i,g+h),0===h){const t=e.node().getBBox();h=t.height,n.info("Title height",h,g)}c.push(e)}let f=h*p.length;if(p.length>1){const t=(p.length-1)*h*.5;c.forEach(((e,a)=>e.attr("y",g+a*h-t))),f=h*p.length}const u=a.node().getBBox();a.insert("rect",":first-child").attr("class","box").attr("x",i-l/2-r().state.padding/2).attr("y",g-f/2-r().state.padding/2-3.5).attr("width",l+r().state.padding).attr("height",f+r().state.padding),n.info(u)}T++}),"drawEdge"),L={},A=i((function(){}),"setConf"),G=i((function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"insertMarkers"),O=i((function(t,e,a,i){x=r().state;const d=r().securityLevel;let o;"sandbox"===d&&(o=g("#i"+e));const p=g("sandbox"===d?o.nodes()[0].contentDocument.body:"body"),h="sandbox"===d?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const c=p.select(`[id='${e}']`);G(c);const l=i.db.getRootDoc();U(l,c,void 0,!1,p,h,i);const f=x.padding,u=c.node().getBBox(),y=u.width+2*f,m=u.height+2*f;s(c,m,1.75*y,x.useMaxWidth),c.attr("viewBox",`${u.x-x.padding} ${u.y-x.padding} `+y+" "+m)}),"draw"),R=i((t=>t?t.length*x.fontSizeFactor:1),"getLabelWidth"),U=i(((t,e,a,i,r,s,o)=>{const g=new p({compound:!0,multigraph:!0});let c,l=!0;for(c=0;c<t.length;c++)if("relation"===t[c].stmt){l=!1;break}a?g.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:l?1:x.edgeLengthFactor,nodeSep:l?1:50,isMultiGraph:!0}):g.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:l?1:x.edgeLengthFactor,nodeSep:l?1:50,ranker:"tight-tree",isMultiGraph:!0}),g.setDefaultEdgeLabel((function(){return{}}));const f=o.db.getStates(),u=o.db.getRelations(),y=Object.keys(f);for(const n of y){const t=f[n];let d;if(a&&(t.parentId=a),t.doc){let a=e.append("g").attr("id",t.id).attr("class","stateGroup");d=U(t.doc,a,t.id,!i,r,s,o);{a=N(a,t,i);let e=a.node().getBBox();d.width=e.width,d.height=e.height+x.padding/2,L[t.id]={y:x.compositTitleSize}}}else d=H(e,t,g);if(t.note){const a={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},i=H(e,a,g);"left of"===t.note.position?(g.setNode(d.id+"-note",i),g.setNode(d.id,d)):(g.setNode(d.id,d),g.setNode(d.id+"-note",i)),g.setParent(d.id,d.id+"-group"),g.setParent(d.id+"-note",d.id+"-group")}else g.setNode(d.id,d)}n.debug("Count=",g.nodeCount(),g);let m=0;u.forEach((function(t){m++,n.debug("Setting edge",t),g.setEdge(t.id1,t.id2,{relation:t,width:R(t.title),height:x.labelHeight*d.getRows(t.title).length,labelpos:"c"},"id"+m)})),h(g),n.debug("Graph after layout",g.nodes());const w=e.node();g.nodes().forEach((function(t){if(void 0!==t&&void 0!==g.node(t)){n.warn("Node "+t+": "+JSON.stringify(g.node(t))),r.select("#"+w.id+" #"+t).attr("transform","translate("+(g.node(t).x-g.node(t).width/2)+","+(g.node(t).y+(L[t]?L[t].y:0)-g.node(t).height/2)+" )"),r.select("#"+w.id+" #"+t).attr("data-x-shift",g.node(t).x-g.node(t).width/2);s.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach((t=>{const e=t.parentElement;let a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),i=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(i)&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)}))}else n.debug("No Node "+t+": "+JSON.stringify(g.node(t)))}));let b=w.getBBox();g.edges().forEach((function(t){void 0!==t&&void 0!==g.edge(t)&&(n.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(g.edge(t))),D(e,g.edge(t),g.edge(t).relation))})),b=w.getBBox();const B={id:a||"root",label:a||"root",width:0,height:0};return B.width=b.width+2*x.padding,B.height=b.height+2*x.padding,n.debug("Doc rendered",B,g),B}),"renderDoc"),P={setConf:A,draw:O},C={parser:e,get db(){return new a(1)},renderer:P,styles:t,init:i((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};export{C as diagram};
|
|
1
|
+
import{s as t,a as e,S as a}from"./chunk-AEK57VVT-DG4orfNV.js";import{_ as i,c as r,l as n,d as s,j as d,u as o}from"./mermaid-Ca6wa6bI.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-Dv7xXdEG.js";import{l as h}from"./layout-BsvPTK3e.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-RZ5BOZE2-DnI79CL-.js";import"./index-_UjCLpCJ.js";import"./_baseUniq-CL1KGcfC.js";import"./_baseEach-CwQ5kwoY.js";import"./min-BB070bMw.js";import"./_baseMap-lz3_fYgf.js";import"./sortBy-CZLdWjjp.js";var x,f={},u=i(((t,e)=>{f[t]=e}),"set"),y=i((t=>f[t]),"get"),m=i((()=>Object.keys(f)),"keys"),w=i((()=>m().length),"size"),b={get:y,set:u,keys:m,size:w},B=i((t=>t.append("circle").attr("class","start-state").attr("r",r().state.sizeUnit).attr("cx",r().state.padding+r().state.sizeUnit).attr("cy",r().state.padding+r().state.sizeUnit)),"drawStartState"),k=i((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",r().state.textHeight).attr("class","divider").attr("x2",2*r().state.textHeight).attr("y1",0).attr("y2",0)),"drawDivider"),E=i(((t,e)=>{const a=t.append("text").attr("x",2*r().state.padding).attr("y",r().state.textHeight+2*r().state.padding).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.id),i=a.node().getBBox();return t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",i.width+2*r().state.padding).attr("height",i.height+2*r().state.padding).attr("rx",r().state.radius),a}),"drawSimpleState"),S=i(((t,e)=>{const a=i((function(t,e,a){const i=t.append("tspan").attr("x",2*r().state.padding).text(e);a||i.attr("dy",r().state.textHeight)}),"addTspan"),n=t.append("text").attr("x",2*r().state.padding).attr("y",r().state.textHeight+1.3*r().state.padding).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.descriptions[0]).node().getBBox(),s=n.height,d=t.append("text").attr("x",r().state.padding).attr("y",s+.4*r().state.padding+r().state.dividerMargin+r().state.textHeight).attr("class","state-description");let o=!0,g=!0;e.descriptions.forEach((function(t){o||(a(d,t,g),g=!1),o=!1}));const p=t.append("line").attr("x1",r().state.padding).attr("y1",r().state.padding+s+r().state.dividerMargin/2).attr("y2",r().state.padding+s+r().state.dividerMargin/2).attr("class","descr-divider"),h=d.node().getBBox(),c=Math.max(h.width,n.width);return p.attr("x2",c+3*r().state.padding),t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",c+2*r().state.padding).attr("height",h.height+s+2*r().state.padding).attr("rx",r().state.radius),t}),"drawDescrState"),N=i(((t,e,a)=>{const i=r().state.padding,n=2*r().state.padding,s=t.node().getBBox(),d=s.width,o=s.x,g=t.append("text").attr("x",0).attr("y",r().state.titleShift).attr("font-size",r().state.fontSize).attr("class","state-title").text(e.id),p=g.node().getBBox().width+n;let h,c=Math.max(p,d);c===d&&(c+=n);const l=t.node().getBBox();e.doc,h=o-i,p>d&&(h=(d-c)/2+i),Math.abs(o-l.x)<i&&p>d&&(h=o-(p-d)/2);const x=1-r().state.textHeight;return t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",c).attr("height",l.height+r().state.textHeight+r().state.titleShift+1).attr("rx","0"),g.attr("x",h+i),p<=d&&g.attr("x",o+(c-n)/2-p/2+i),t.insert("rect",":first-child").attr("x",h).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",c).attr("height",3*r().state.textHeight).attr("rx",r().state.radius),t.insert("rect",":first-child").attr("x",h).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",c).attr("height",l.height+3+2*r().state.textHeight).attr("rx",r().state.radius),t}),"addTitleAndBox"),M=i((t=>(t.append("circle").attr("class","end-state-outer").attr("r",r().state.sizeUnit+r().state.miniPadding).attr("cx",r().state.padding+r().state.sizeUnit+r().state.miniPadding).attr("cy",r().state.padding+r().state.sizeUnit+r().state.miniPadding),t.append("circle").attr("class","end-state-inner").attr("r",r().state.sizeUnit).attr("cx",r().state.padding+r().state.sizeUnit+2).attr("cy",r().state.padding+r().state.sizeUnit+2))),"drawEndState"),v=i(((t,e)=>{let a=r().state.forkWidth,i=r().state.forkHeight;if(e.parentId){let t=a;a=i,i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",r().state.padding).attr("y",r().state.padding)}),"drawForkJoinState"),z=i(((t,e,a,i)=>{let n=0;const s=i.append("text");s.style("text-anchor","start"),s.attr("class","noteText");let o=t.replace(/\r\n/g,"<br/>");o=o.replace(/\n/g,"<br/>");const g=o.split(d.lineBreakRegex);let p=1.25*r().state.noteMargin;for(const d of g){const t=d.trim();if(t.length>0){const i=s.append("tspan");if(i.text(t),0===p){p+=i.node().getBBox().height}n+=p,i.attr("x",e+r().state.noteMargin),i.attr("y",a+n+1.25*r().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:n}}),"_drawLongText"),j=i(((t,e)=>{e.attr("class","state-note");const a=e.append("rect").attr("x",0).attr("y",r().state.padding),i=e.append("g"),{textWidth:n,textHeight:s}=z(t,0,0,i);return a.attr("height",s+2*r().state.noteMargin),a.attr("width",n+2*r().state.noteMargin),a}),"drawNote"),H=i((function(t,e){const a=e.id,i={id:a,label:e.id,width:0,height:0},n=t.append("g").attr("id",a).attr("class","stateGroup");"start"===e.type&&B(n),"end"===e.type&&M(n),"fork"!==e.type&&"join"!==e.type||v(n,e),"note"===e.type&&j(e.note.text,n),"divider"===e.type&&k(n),"default"===e.type&&0===e.descriptions.length&&E(n,e),"default"===e.type&&e.descriptions.length>0&&S(n,e);const s=n.node().getBBox();return i.width=s.width+2*r().state.padding,i.height=s.height+2*r().state.padding,b.set(a,i),i}),"drawState"),T=0,D=i((function(t,e,s){const g=i((function(t){switch(t){case a.relationType.AGGREGATION:return"aggregation";case a.relationType.EXTENSION:return"extension";case a.relationType.COMPOSITION:return"composition";case a.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const p=e.points,h=c().x((function(t){return t.x})).y((function(t){return t.y})).curve(l),x=t.append("path").attr("d",h(p)).attr("id","edge"+T).attr("class","transition");let f="";if(r().state.arrowMarkerAbsolute&&(f=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,f=f.replace(/\(/g,"\\("),f=f.replace(/\)/g,"\\)")),x.attr("marker-end","url("+f+"#"+g(a.relationType.DEPENDENCY)+"End)"),void 0!==s.title){const a=t.append("g").attr("class","stateLabel"),{x:i,y:g}=o.calcLabelPosition(e.points),p=d.getRows(s.title);let h=0;const c=[];let l=0,x=0;for(let t=0;t<=p.length;t++){const e=a.append("text").attr("text-anchor","middle").text(p[t]).attr("x",i).attr("y",g+h),r=e.node().getBBox();if(l=Math.max(l,r.width),x=Math.min(x,r.x),n.info(r.x,i,g+h),0===h){const t=e.node().getBBox();h=t.height,n.info("Title height",h,g)}c.push(e)}let f=h*p.length;if(p.length>1){const t=(p.length-1)*h*.5;c.forEach(((e,a)=>e.attr("y",g+a*h-t))),f=h*p.length}const u=a.node().getBBox();a.insert("rect",":first-child").attr("class","box").attr("x",i-l/2-r().state.padding/2).attr("y",g-f/2-r().state.padding/2-3.5).attr("width",l+r().state.padding).attr("height",f+r().state.padding),n.info(u)}T++}),"drawEdge"),L={},A=i((function(){}),"setConf"),G=i((function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"insertMarkers"),O=i((function(t,e,a,i){x=r().state;const d=r().securityLevel;let o;"sandbox"===d&&(o=g("#i"+e));const p=g("sandbox"===d?o.nodes()[0].contentDocument.body:"body"),h="sandbox"===d?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const c=p.select(`[id='${e}']`);G(c);const l=i.db.getRootDoc();U(l,c,void 0,!1,p,h,i);const f=x.padding,u=c.node().getBBox(),y=u.width+2*f,m=u.height+2*f;s(c,m,1.75*y,x.useMaxWidth),c.attr("viewBox",`${u.x-x.padding} ${u.y-x.padding} `+y+" "+m)}),"draw"),R=i((t=>t?t.length*x.fontSizeFactor:1),"getLabelWidth"),U=i(((t,e,a,i,r,s,o)=>{const g=new p({compound:!0,multigraph:!0});let c,l=!0;for(c=0;c<t.length;c++)if("relation"===t[c].stmt){l=!1;break}a?g.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:l?1:x.edgeLengthFactor,nodeSep:l?1:50,isMultiGraph:!0}):g.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:l?1:x.edgeLengthFactor,nodeSep:l?1:50,ranker:"tight-tree",isMultiGraph:!0}),g.setDefaultEdgeLabel((function(){return{}}));const f=o.db.getStates(),u=o.db.getRelations(),y=Object.keys(f);for(const n of y){const t=f[n];let d;if(a&&(t.parentId=a),t.doc){let a=e.append("g").attr("id",t.id).attr("class","stateGroup");d=U(t.doc,a,t.id,!i,r,s,o);{a=N(a,t,i);let e=a.node().getBBox();d.width=e.width,d.height=e.height+x.padding/2,L[t.id]={y:x.compositTitleSize}}}else d=H(e,t,g);if(t.note){const a={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},i=H(e,a,g);"left of"===t.note.position?(g.setNode(d.id+"-note",i),g.setNode(d.id,d)):(g.setNode(d.id,d),g.setNode(d.id+"-note",i)),g.setParent(d.id,d.id+"-group"),g.setParent(d.id+"-note",d.id+"-group")}else g.setNode(d.id,d)}n.debug("Count=",g.nodeCount(),g);let m=0;u.forEach((function(t){m++,n.debug("Setting edge",t),g.setEdge(t.id1,t.id2,{relation:t,width:R(t.title),height:x.labelHeight*d.getRows(t.title).length,labelpos:"c"},"id"+m)})),h(g),n.debug("Graph after layout",g.nodes());const w=e.node();g.nodes().forEach((function(t){if(void 0!==t&&void 0!==g.node(t)){n.warn("Node "+t+": "+JSON.stringify(g.node(t))),r.select("#"+w.id+" #"+t).attr("transform","translate("+(g.node(t).x-g.node(t).width/2)+","+(g.node(t).y+(L[t]?L[t].y:0)-g.node(t).height/2)+" )"),r.select("#"+w.id+" #"+t).attr("data-x-shift",g.node(t).x-g.node(t).width/2);s.querySelectorAll("#"+w.id+" #"+t+" .divider").forEach((t=>{const e=t.parentElement;let a=0,i=0;e&&(e.parentElement&&(a=e.parentElement.getBBox().width),i=parseInt(e.getAttribute("data-x-shift"),10),Number.isNaN(i)&&(i=0)),t.setAttribute("x1",0-i+8),t.setAttribute("x2",a-i-8)}))}else n.debug("No Node "+t+": "+JSON.stringify(g.node(t)))}));let b=w.getBBox();g.edges().forEach((function(t){void 0!==t&&void 0!==g.edge(t)&&(n.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(g.edge(t))),D(e,g.edge(t),g.edge(t).relation))})),b=w.getBBox();const B={id:a||"root",label:a||"root",width:0,height:0};return B.width=b.width+2*x.padding,B.height=b.height+2*x.padding,n.debug("Doc rendered",B,g),B}),"renderDoc"),P={setConf:A,draw:O},C={parser:e,get db(){return new a(1)},renderer:P,styles:t,init:i((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")};export{C as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,b as s,a as t,S as e}from"./chunk-AEK57VVT-DG4orfNV.js";import{_ as a}from"./mermaid-Ca6wa6bI.js";import"./transform-CdY8z5kT.js";import"./chunk-RZ5BOZE2-DnI79CL-.js";import"./index-_UjCLpCJ.js";import"./step-xJWGRC3d.js";var o={parser:t,get db(){return new e(2)},renderer:s,styles:r,init:a((r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute}),"init")};export{o as diagram};
|