@marimo-team/frontend 0.11.8-dev9 → 0.11.9-dev0
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-S8w-Y-De.js → ConnectedDataExplorerComponent-CpwXVE5m.js} +1 -1
- package/dist/assets/{VegaLite-C9p8MadO.js → VegaLite-CkiIUR2L.js} +1 -1
- package/dist/assets/{_baseEach-CrU4DSgq.js → _baseEach-COJdzwKr.js} +1 -1
- package/dist/assets/_baseMap-CihJLTsX.js +1 -0
- package/dist/assets/{_baseUniq-BOEL1-1S.js → _baseUniq-kE24PtL6.js} +1 -1
- package/dist/assets/{any-language-editor-Sw0aNmFf.js → any-language-editor-BttIlVpv.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-BYx4C5B8.js → architectureDiagram-UYN6MBPD-D5JgvDyt.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-CQDwmpUQ.js → blockDiagram-ZHA2E4KO-cuNuRzCV.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-BX_Ql5Ih.js → c4Diagram-6F5ED5ID-CuCFJQCy.js} +1 -1
- package/dist/assets/channel-DxYC8uh0.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-B9y5McyZ.js → chunk-5HRBRIJM-DVbWY3u3.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-BQfWz-TZ.js → chunk-7U56Z5CX-BDq0m3_9.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-CoRX-AjA.js → chunk-ASOPGD6M-DYC0o5KD.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-CKriFo_g.js → chunk-KFBOBJHC-CpgryvfE.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-jBx2eSFb.js → chunk-T2TOU4HS-Dszq9eN2.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-DfdZFnqy.js → chunk-TMUBEWPD-CF6V25gp.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-NDgZMIXX.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-NDgZMIXX.js +1 -0
- package/dist/assets/clone-BaCHl7hg.js +1 -0
- package/dist/assets/{compile-DNXxbOMP.js → compile-BM5Q5YDm.js} +1 -1
- package/dist/assets/{createWsUrl-BiZ6H99C.js → createWsUrl-DIFKlE2D.js} +1 -1
- package/dist/assets/{dagre-4EVJKHTY-RGorGPbM.js → dagre-4EVJKHTY-BvdBoMc6.js} +1 -1
- package/dist/assets/{data-editor-CUxQNXlW.js → data-editor-76TnDKq_.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-DwqILD3p.js → diagram-QW4FP2JN-DMa-0BS5.js} +1 -1
- package/dist/assets/{edit-page-C07lDuWi.js → edit-page-DKrea_-G.js} +3 -3
- package/dist/assets/{erDiagram-6RL3IURR-5u4MKRgU.js → erDiagram-6RL3IURR-DUQBfNp6.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-Bz8pjgBR.js → flowDiagram-7ASYPVHJ-Ch7nBet1.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-CIpHTrcu.js → ganttDiagram-NTVNEXSI-u03qyzAB.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-Du9DMeNR.js → gitGraph-YCYPL57B-BP9FaChL.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-LU8y-Hk9.js → gitGraphDiagram-NRZ2UAAF-Dr4tr8hv.js} +1 -1
- package/dist/assets/{graph-_7T6ej5s.js → graph-6nBcNxxI.js} +1 -1
- package/dist/assets/{home-page-DPF26sT_.js → home-page-DVGoSMVI.js} +1 -1
- package/dist/assets/{index-oJqxezH4.js → index-B0FjLfL2.js} +1 -1
- package/dist/assets/{index-CgQEfoo9.js → index-B6szqA_y.js} +1 -1
- package/dist/assets/{index-C5Uw4Ofl.js → index-BF3BqCqI.js} +1 -1
- package/dist/assets/{index-BbwL6wgd.js → index-BcydokLx.js} +1 -1
- package/dist/assets/{index-DsIHWJJS.js → index-CUoFsbsw.js} +1 -1
- package/dist/assets/{index-VB94TUIx.js → index-Cg8qqMmB.js} +1 -1
- package/dist/assets/{index-ByFDS12S.js → index-CjdIjSmd.js} +1 -1
- package/dist/assets/{index-D3UA_rAF.js → index-CpMHzE17.js} +1 -1
- package/dist/assets/{index-DpwaSOG2.js → index-DDSS5JKk.js} +1 -1
- package/dist/assets/{index-55Om8bcH.js → index-DJ7D6Dl8.js} +1 -1
- package/dist/assets/{index-q2f9X625.js → index-DQqx_X5B.js} +1 -1
- package/dist/assets/{index-CungU5Kx.js → index-Dd2GcKta.js} +1 -1
- package/dist/assets/{index-Du_O4PPJ.js → index-Dd9nXb5n.js} +1 -1
- package/dist/assets/{index-Dod9HEKg.js → index-Dy2RzQpo.js} +1 -1
- package/dist/assets/{index-eOfQThxV.js → index-YEI0IWVC.js} +1 -1
- package/dist/assets/{index-DZKEyZNV.js → index-agxu1av4.js} +1 -1
- package/dist/assets/{index-v0t83U8B.js → index-mdf3hACe.js} +6 -6
- package/dist/assets/{infoDiagram-A4XQUW5V-BM0q99_Q.js → infoDiagram-A4XQUW5V-B-rVf6YK.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-D4yuz40t.js → journeyDiagram-G5WM74LC-C8WRI1sK.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-Bv7PnLoo.js → kanban-definition-QRCXZQQD-lEA7dFyJ.js} +1 -1
- package/dist/assets/{layout-wELXico8.js → layout-CMS98ASs.js} +1 -1
- package/dist/assets/{linear-CcnkyJbd.js → linear-BH4kYn3l.js} +1 -1
- package/dist/assets/{mermaid-BaSuJOzh.js → mermaid-DX6RFHdA.js} +3 -3
- package/dist/assets/{min-CeuReyLG.js → min-CwVrtO7M.js} +1 -1
- package/dist/assets/{mindmap-definition-GWI6TPTV-C5ZmByfI.js → mindmap-definition-GWI6TPTV-2lTrr2pg.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-DcpX25Z_.js → pieDiagram-YF2LJOPJ-DiZc8J6M.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-DxB545sB.js → quadrantDiagram-OS5C2QUG-n79Q2oy5.js} +1 -1
- package/dist/assets/{react-plotly-CEvdoFT-.js → react-plotly-DRMndz5W.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-C9RJNLUc.js → requirementDiagram-MIRIMTAZ-4klKoTAg.js} +1 -1
- package/dist/assets/{run-page-Cud0ALXx.js → run-page-CdDqgrad.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-CpP55P30.js → sankeyDiagram-Y46BX6SQ-Bfe9RIwy.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-CrzMrLzd.js → sequenceDiagram-G6AWOVSC-DELbc8bj.js} +1 -1
- package/dist/assets/{slides-component-CrNi-A0h.js → slides-component-CNtz1KYf.js} +1 -1
- package/dist/assets/{sortBy-CJBVfQBM.js → sortBy-DjKqlHuq.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-CRwV3BMU.js → stateDiagram-MAYHULR4-B8Xz4vvw.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-BPW02Ujz.js +1 -0
- package/dist/assets/{terminal-DMrwVyGL.js → terminal-CLENGbGI.js} +1 -1
- package/dist/assets/{time-CmRxp9Au.js → time-Ce0gq2eM.js} +1 -1
- package/dist/assets/{timeline-definition-U7ZMHBDA-D5_oOv-_.js → timeline-definition-U7ZMHBDA-BvBNgdtS.js} +1 -1
- package/dist/assets/{tree-DaLUQCkL.js → tree-BvQVBRl_.js} +1 -1
- package/dist/assets/{useMarimoWebSocket-BKJX44rE.js → useMarimoWebSocket-CpeA2m2L.js} +3 -3
- package/dist/assets/{vega-component-Bwy59anu.js → vega-component-CaTCegGK.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-Dzk53hzO.js → xychartDiagram-6QU3TZC5-BFC29aGZ.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-3J0zia04.js +0 -1
- package/dist/assets/channel--arhtInw.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-DOObYh9O.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-DOObYh9O.js +0 -1
- package/dist/assets/clone-Cl5s2ZXL.js +0 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-DSDt-YOI.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{af as r,ag as n,ah as t,ai as a,aj as e,ak as i,y as u,al as o,z as f}from"./index-
|
|
1
|
+
import{af as r,ag as n,ah as t,ai as a,aj as e,ak as i,y as u,al as o,z as f}from"./index-mdf3hACe.js";import{a as s}from"./_baseEach-COJdzwKr.js";import{b as l}from"./_baseMap-CihJLTsX.js";function c(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,l=r(t);if(!f&&!l&&!u&&n>t||u&&o&&s&&!f&&!l||e&&o&&s||!a&&s||!i)return 1;if(!e&&!u&&!l&&n<t||l&&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}(l(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=c(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 h=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{h as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as t,a as e,b as a}from"./chunk-7U56Z5CX-BQfWz-TZ.js";import{_ as i,c as r,l as n,d,j as s,u as o}from"./mermaid-BaSuJOzh.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-_7T6ej5s.js";import{l as c}from"./layout-wELXico8.js";import{l as h,k as l}from"./step-xJWGRC3d.js";import"./chunk-5HRBRIJM-B9y5McyZ.js";import"./index-v0t83U8B.js";import"./_baseUniq-BOEL1-1S.js";import"./_baseEach-CrU4DSgq.js";import"./min-CeuReyLG.js";import"./_baseMap-3J0zia04.js";import"./sortBy-CJBVfQBM.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"),S=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"),E=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(),d=n.height,s=t.append("text").attr("x",r().state.padding).attr("y",d+.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(s,t,g),g=!1),o=!1}));const p=t.append("line").attr("x1",r().state.padding).attr("y1",r().state.padding+d+r().state.dividerMargin/2).attr("y2",r().state.padding+d+r().state.dividerMargin/2).attr("class","descr-divider"),c=s.node().getBBox(),h=Math.max(c.width,n.width);return p.attr("x2",h+3*r().state.padding),t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",h+2*r().state.padding).attr("height",c.height+d+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,d=t.node().getBBox(),s=d.width,o=d.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 c,h=Math.max(p,s);h===s&&(h+=n);const l=t.node().getBBox();e.doc,c=o-i,p>s&&(c=(s-h)/2+i),Math.abs(o-l.x)<i&&p>s&&(c=o-(p-s)/2);const x=1-r().state.textHeight;return t.insert("rect",":first-child").attr("x",c).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",l.height+r().state.textHeight+r().state.titleShift+1).attr("rx","0"),g.attr("x",c+i),p<=s&&g.attr("x",o+(h-n)/2-p/2+i),t.insert("rect",":first-child").attr("x",c).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",h).attr("height",3*r().state.textHeight).attr("rx",r().state.radius),t.insert("rect",":first-child").attr("x",c).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",h).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 d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let o=t.replace(/\r\n/g,"<br/>");o=o.replace(/\n/g,"<br/>");const g=o.split(s.lineBreakRegex);let p=1.25*r().state.noteMargin;for(const s of g){const t=s.trim();if(t.length>0){const i=d.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:d.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:d}=z(t,0,0,i);return a.attr("height",d+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&&S(n,e),"default"===e.type&&e.descriptions.length>0&&E(n,e);const d=n.node().getBBox();return i.width=d.width+2*r().state.padding,i.height=d.height+2*r().state.padding,b.set(a,i),i}),"drawState"),T=0,D=i((function(t,a,d){const g=i((function(t){switch(t){case e.relationType.AGGREGATION:return"aggregation";case e.relationType.EXTENSION:return"extension";case e.relationType.COMPOSITION:return"composition";case e.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");a.points=a.points.filter((t=>!Number.isNaN(t.y)));const p=a.points,c=h().x((function(t){return t.x})).y((function(t){return t.y})).curve(l),x=t.append("path").attr("d",c(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(e.relationType.DEPENDENCY)+"End)"),void 0!==d.title){const e=t.append("g").attr("class","stateLabel"),{x:i,y:g}=o.calcLabelPosition(a.points),p=s.getRows(d.title);let c=0;const h=[];let l=0,x=0;for(let t=0;t<=p.length;t++){const a=e.append("text").attr("text-anchor","middle").text(p[t]).attr("x",i).attr("y",g+c),r=a.node().getBBox();if(l=Math.max(l,r.width),x=Math.min(x,r.x),n.info(r.x,i,g+c),0===c){const t=a.node().getBBox();c=t.height,n.info("Title height",c,g)}h.push(a)}let f=c*p.length;if(p.length>1){const t=(p.length-1)*c*.5;h.forEach(((e,a)=>e.attr("y",g+a*c-t))),f=c*p.length}const u=e.node().getBBox();e.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={},G=i((function(){}),"setConf"),R=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"),U=i((function(t,e,a,i){x=r().state;const s=r().securityLevel;let o;"sandbox"===s&&(o=g("#i"+e));const p=g("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===s?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const h=p.select(`[id='${e}']`);R(h);const l=i.db.getRootDoc();O(l,h,void 0,!1,p,c,i);const f=x.padding,u=h.node().getBBox(),y=u.width+2*f,m=u.height+2*f;d(h,m,1.75*y,x.useMaxWidth),h.attr("viewBox",`${u.x-x.padding} ${u.y-x.padding} `+y+" "+m)}),"draw"),A=i((t=>t?t.length*x.fontSizeFactor:1),"getLabelWidth"),O=i(((t,e,a,i,r,d,o)=>{const g=new p({compound:!0,multigraph:!0});let h,l=!0;for(h=0;h<t.length;h++)if("relation"===t[h].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{}})),o.db.extract(t);const f=o.db.getStates(),u=o.db.getRelations(),y=Object.keys(f);for(const n of y){const t=f[n];let s;if(a&&(t.parentId=a),t.doc){let a=e.append("g").attr("id",t.id).attr("class","stateGroup");s=O(t.doc,a,t.id,!i,r,d,o);{a=N(a,t,i);let e=a.node().getBBox();s.width=e.width,s.height=e.height+x.padding/2,L[t.id]={y:x.compositTitleSize}}}else s=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(s.id+"-note",i),g.setNode(s.id,s)):(g.setNode(s.id,s),g.setNode(s.id+"-note",i)),g.setParent(s.id,s.id+"-group"),g.setParent(s.id+"-note",s.id+"-group")}else g.setNode(s.id,s)}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:A(t.title),height:x.labelHeight*s.getRows(t.title).length,labelpos:"c"},"id"+m)})),c(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);d.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={parser:a,db:e,renderer:{setConf:G,draw:U},styles:t,init:i((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,e.clear()}),"init")};export{P as diagram};
|
|
1
|
+
import{s as t,a as e,b as a}from"./chunk-7U56Z5CX-BDq0m3_9.js";import{_ as i,c as r,l as n,d,j as s,u as o}from"./mermaid-DX6RFHdA.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-6nBcNxxI.js";import{l as c}from"./layout-CMS98ASs.js";import{l as h,k as l}from"./step-xJWGRC3d.js";import"./chunk-5HRBRIJM-DVbWY3u3.js";import"./index-mdf3hACe.js";import"./_baseUniq-kE24PtL6.js";import"./_baseEach-COJdzwKr.js";import"./min-CwVrtO7M.js";import"./_baseMap-CihJLTsX.js";import"./sortBy-DjKqlHuq.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"),S=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"),E=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(),d=n.height,s=t.append("text").attr("x",r().state.padding).attr("y",d+.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(s,t,g),g=!1),o=!1}));const p=t.append("line").attr("x1",r().state.padding).attr("y1",r().state.padding+d+r().state.dividerMargin/2).attr("y2",r().state.padding+d+r().state.dividerMargin/2).attr("class","descr-divider"),c=s.node().getBBox(),h=Math.max(c.width,n.width);return p.attr("x2",h+3*r().state.padding),t.insert("rect",":first-child").attr("x",r().state.padding).attr("y",r().state.padding).attr("width",h+2*r().state.padding).attr("height",c.height+d+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,d=t.node().getBBox(),s=d.width,o=d.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 c,h=Math.max(p,s);h===s&&(h+=n);const l=t.node().getBBox();e.doc,c=o-i,p>s&&(c=(s-h)/2+i),Math.abs(o-l.x)<i&&p>s&&(c=o-(p-s)/2);const x=1-r().state.textHeight;return t.insert("rect",":first-child").attr("x",c).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",h).attr("height",l.height+r().state.textHeight+r().state.titleShift+1).attr("rx","0"),g.attr("x",c+i),p<=s&&g.attr("x",o+(h-n)/2-p/2+i),t.insert("rect",":first-child").attr("x",c).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",h).attr("height",3*r().state.textHeight).attr("rx",r().state.radius),t.insert("rect",":first-child").attr("x",c).attr("y",r().state.titleShift-r().state.textHeight-r().state.padding).attr("width",h).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 d=i.append("text");d.style("text-anchor","start"),d.attr("class","noteText");let o=t.replace(/\r\n/g,"<br/>");o=o.replace(/\n/g,"<br/>");const g=o.split(s.lineBreakRegex);let p=1.25*r().state.noteMargin;for(const s of g){const t=s.trim();if(t.length>0){const i=d.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:d.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:d}=z(t,0,0,i);return a.attr("height",d+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&&S(n,e),"default"===e.type&&e.descriptions.length>0&&E(n,e);const d=n.node().getBBox();return i.width=d.width+2*r().state.padding,i.height=d.height+2*r().state.padding,b.set(a,i),i}),"drawState"),T=0,D=i((function(t,a,d){const g=i((function(t){switch(t){case e.relationType.AGGREGATION:return"aggregation";case e.relationType.EXTENSION:return"extension";case e.relationType.COMPOSITION:return"composition";case e.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");a.points=a.points.filter((t=>!Number.isNaN(t.y)));const p=a.points,c=h().x((function(t){return t.x})).y((function(t){return t.y})).curve(l),x=t.append("path").attr("d",c(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(e.relationType.DEPENDENCY)+"End)"),void 0!==d.title){const e=t.append("g").attr("class","stateLabel"),{x:i,y:g}=o.calcLabelPosition(a.points),p=s.getRows(d.title);let c=0;const h=[];let l=0,x=0;for(let t=0;t<=p.length;t++){const a=e.append("text").attr("text-anchor","middle").text(p[t]).attr("x",i).attr("y",g+c),r=a.node().getBBox();if(l=Math.max(l,r.width),x=Math.min(x,r.x),n.info(r.x,i,g+c),0===c){const t=a.node().getBBox();c=t.height,n.info("Title height",c,g)}h.push(a)}let f=c*p.length;if(p.length>1){const t=(p.length-1)*c*.5;h.forEach(((e,a)=>e.attr("y",g+a*c-t))),f=c*p.length}const u=e.node().getBBox();e.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={},G=i((function(){}),"setConf"),R=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"),U=i((function(t,e,a,i){x=r().state;const s=r().securityLevel;let o;"sandbox"===s&&(o=g("#i"+e));const p=g("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),c="sandbox"===s?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const h=p.select(`[id='${e}']`);R(h);const l=i.db.getRootDoc();O(l,h,void 0,!1,p,c,i);const f=x.padding,u=h.node().getBBox(),y=u.width+2*f,m=u.height+2*f;d(h,m,1.75*y,x.useMaxWidth),h.attr("viewBox",`${u.x-x.padding} ${u.y-x.padding} `+y+" "+m)}),"draw"),A=i((t=>t?t.length*x.fontSizeFactor:1),"getLabelWidth"),O=i(((t,e,a,i,r,d,o)=>{const g=new p({compound:!0,multigraph:!0});let h,l=!0;for(h=0;h<t.length;h++)if("relation"===t[h].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{}})),o.db.extract(t);const f=o.db.getStates(),u=o.db.getRelations(),y=Object.keys(f);for(const n of y){const t=f[n];let s;if(a&&(t.parentId=a),t.doc){let a=e.append("g").attr("id",t.id).attr("class","stateGroup");s=O(t.doc,a,t.id,!i,r,d,o);{a=N(a,t,i);let e=a.node().getBBox();s.width=e.width,s.height=e.height+x.padding/2,L[t.id]={y:x.compositTitleSize}}}else s=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(s.id+"-note",i),g.setNode(s.id,s)):(g.setNode(s.id,s),g.setNode(s.id+"-note",i)),g.setParent(s.id,s.id+"-group"),g.setParent(s.id+"-note",s.id+"-group")}else g.setNode(s.id,s)}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:A(t.title),height:x.labelHeight*s.getRows(t.title).length,labelpos:"c"},"id"+m)})),c(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);d.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={parser:a,db:e,renderer:{setConf:G,draw:U},styles:t,init:i((t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute,e.clear()}),"init")};export{P as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as r,c as s,a as t,b as a}from"./chunk-7U56Z5CX-BDq0m3_9.js";import{_ as e}from"./mermaid-DX6RFHdA.js";import"./transform-CdY8z5kT.js";import"./chunk-5HRBRIJM-DVbWY3u3.js";import"./index-mdf3hACe.js";import"./step-xJWGRC3d.js";var o={parser:a,db:t,renderer:s,styles:r,init:e((r=>{r.state||(r.state={}),r.state.arrowMarkerAbsolute=r.arrowMarkerAbsolute,t.clear()}),"init")};export{o as diagram};
|