@marimo-team/frontend 0.12.2-dev0 → 0.12.2
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-DH5ZbYrC.js → ConnectedDataExplorerComponent-CCjm2K8o.js} +1 -1
- package/dist/assets/{VegaLite-CqOylRLI.js → VegaLite-8vOMqsGj.js} +1 -1
- package/dist/assets/{_baseEach-BzH38Sp_.js → _baseEach-8vOU2tOE.js} +1 -1
- package/dist/assets/_baseMap-YJCrrumZ.js +1 -0
- package/dist/assets/{_baseUniq-CY3x7HaT.js → _baseUniq-D1LRb3BA.js} +1 -1
- package/dist/assets/{any-language-editor-DLIQ9my5.js → any-language-editor-BFluUBSX.js} +1 -1
- package/dist/assets/{architectureDiagram-IEHRJDOE-CB56_o2R.js → architectureDiagram-IEHRJDOE-C5lyAjBW.js} +1 -1
- package/dist/assets/{blockDiagram-JOT3LUYC-DMeY-hk_.js → blockDiagram-JOT3LUYC-GMbxxy0Z.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-hRpC0S1O.js → c4Diagram-VJAJSXHY-B9RjVW-6.js} +1 -1
- package/dist/assets/channel-Bk_frvqO.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-CVdVWGhL.js → chunk-4BMEZGHF-F4hLF6KD.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-OizHFng3.js → chunk-A2AXSNBT-B9prMA45.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-w-eOM2q4.js → chunk-AEK57VVT-COHf-7xJ.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-C73OEprJ.js → chunk-D6G4REZN-CvzsyeRh.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-DqIGT4rs.js → chunk-RZ5BOZE2-CFvhH_G4.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-CG0-CWOU.js → chunk-XZIHB7SX-CUL4yV8i.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-ILMK-uer.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-ILMK-uer.js +1 -0
- package/dist/assets/clone-C9Baft4n.js +1 -0
- package/dist/assets/{compile-nrUCUaEj.js → compile-DDmRITjq.js} +1 -1
- package/dist/assets/{dagre-OKDRZEBW-wmlnyGhA.js → dagre-OKDRZEBW-BlDckToj.js} +1 -1
- package/dist/assets/{data-editor-UuJmRWnv.js → data-editor-BQNCpnnS.js} +1 -1
- package/dist/assets/{diagram-SSKATNLV-B_7NdPs4.js → diagram-SSKATNLV-DbJdKnIn.js} +1 -1
- package/dist/assets/{diagram-VNBRO52H-DV58Md1i.js → diagram-VNBRO52H-D8ihQWOl.js} +1 -1
- package/dist/assets/edit-page-C_mPAV3p.js +8 -0
- package/dist/assets/{erDiagram-Q7BY3M3F-CCsx5S8S.js → erDiagram-Q7BY3M3F-CuNudvac.js} +1 -1
- package/dist/assets/{flowDiagram-4HSFHLVR-Cmw4InAv.js → flowDiagram-4HSFHLVR-lKCy5iAp.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-CUXoJvZi.js → ganttDiagram-APWFNJXF-Dx6FGFIu.js} +1 -1
- package/dist/assets/{gitGraphDiagram-7IBYFJ6S-bVhXoX-A.js → gitGraphDiagram-7IBYFJ6S-Cfz-TAn3.js} +1 -1
- package/dist/assets/{graph-BKTSw2wq.js → graph-BJtvQT-e.js} +1 -1
- package/dist/assets/{home-page-DpLd23-7.js → home-page-DaxOCbDj.js} +1 -1
- package/dist/assets/{index-BGdPp0Cn.js → index-B3k3SI25.js} +1 -1
- package/dist/assets/{index-C74BbPKL.js → index-B9bAC-YA.js} +1 -1
- package/dist/assets/{index-D0ZBBPL4.js → index-BC4cfiz5.js} +1 -1
- package/dist/assets/{index-DsIW4wXy.js → index-BT02h8Rn.js} +1 -1
- package/dist/assets/{index-B0UUwW95.js → index-CdH6UDvm.js} +1 -1
- package/dist/assets/{index-xexrMY4N.js → index-Cfx4GC2H.js} +1 -1
- package/dist/assets/{index-DLxTLMes.js → index-CwseAEHq.js} +1 -1
- package/dist/assets/{index-lw90K3eA.js → index-D39jV--W.js} +1 -1
- package/dist/assets/{index-BVO5Z1by.js → index-DPTme0OC.js} +1 -1
- package/dist/assets/{index-BvYl2Yh7.js → index-DWxWgHcD.js} +1 -1
- package/dist/assets/{index-xCxEAfll.js → index-DzsVHScG.js} +1 -1
- package/dist/assets/{index-COhzp1RT.js → index-NhvkQvRY.js} +1 -1
- package/dist/assets/{index-DHkQBGm2.js → index-OZZYhgLx.js} +1 -1
- package/dist/assets/{index-DBzmtCf-.js → index-cpt0lGkV.js} +1 -1
- package/dist/assets/{index-CgOL2ukR.js → index-hp2iiuvx.js} +4 -4
- package/dist/assets/{index-D8itExYe.js → index-jX5KNS0w.js} +1 -1
- package/dist/assets/{index-Da4CPBUq.js → index-xiTnu2kJ.js} +1 -1
- package/dist/assets/{infoDiagram-PH2N3AL5-D4FnotP8.js → infoDiagram-PH2N3AL5-C9P9zPMg.js} +1 -1
- package/dist/assets/{journeyDiagram-U35MCT3I-D0WSgJfQ.js → journeyDiagram-U35MCT3I-Cc29jAH3.js} +1 -1
- package/dist/assets/{kanban-definition-NDS4AKOZ-aemz4AVh.js → kanban-definition-NDS4AKOZ-BL6vRldR.js} +1 -1
- package/dist/assets/{layout-L7EZG6r9.js → layout-CupugUzL.js} +1 -1
- package/dist/assets/{linear-CZJIBoI7.js → linear-aAHRVG8w.js} +1 -1
- package/dist/assets/{mermaid-CW33B1NW.js → mermaid-kij_0uc5.js} +2 -2
- package/dist/assets/{min-DNMLpmWf.js → min-DIXND8EC.js} +1 -1
- package/dist/assets/{mindmap-definition-ALO5MXBD-MJZJ01ZR.js → mindmap-definition-ALO5MXBD-CgdsywTy.js} +1 -1
- package/dist/assets/{pieDiagram-IB7DONF6-CZggFvpv.js → pieDiagram-IB7DONF6-D3markcB.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-rC8fvq5g.js → quadrantDiagram-7GDLP6J5-3YvJC-tt.js} +1 -1
- package/dist/assets/{radar-MK3ICKWK-DpC3zQeN.js → radar-MK3ICKWK-BNalkdjK.js} +1 -1
- package/dist/assets/{react-plotly-CkRRqO-d.js → react-plotly-ChAhK7JF.js} +1 -1
- package/dist/assets/{requirementDiagram-KVF5MWMF-DRNBxk2d.js → requirementDiagram-KVF5MWMF-CsAHx6Qg.js} +1 -1
- package/dist/assets/{run-page-CAKIohPx.js → run-page-C_xrNZ3G.js} +1 -1
- package/dist/assets/{sankeyDiagram-QLVOVGJD-BAoPWYvb.js → sankeyDiagram-QLVOVGJD-B5VN4Zqe.js} +1 -1
- package/dist/assets/{sequenceDiagram-X6HHIX6F-C9p2rQOg.js → sequenceDiagram-X6HHIX6F-DQsMj7tl.js} +1 -1
- package/dist/assets/{slides-component-l11PxgwQ.js → slides-component-CUORqid5.js} +1 -1
- package/dist/assets/{sortBy-DmL0RP-s.js → sortBy-BJHnIvvp.js} +1 -1
- package/dist/assets/{stateDiagram-DGXRK772-DFE330Og.js → stateDiagram-DGXRK772-DNuuswAT.js} +1 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-CSHE0lEF.js +1 -0
- package/dist/assets/{terminal-mBVRpajm.js → terminal-C24hfi1g.js} +1 -1
- package/dist/assets/{time-RSZWRAwt.js → time-9m38KLU5.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-CFGxLo_L.js → timeline-definition-BDJGKUSR-BG0ZdxnX.js} +1 -1
- package/dist/assets/{tree-DEJQppfu.js → tree-MXnyfaba.js} +1 -1
- package/dist/assets/{useMarimoWebSocket-STdOtLS2.js → useMarimoWebSocket-Dp-LF484.js} +3 -3
- package/dist/assets/{vega-component-OFtEUb_m.js → vega-component-Dhss2-GJ.js} +1 -1
- package/dist/assets/{xychartDiagram-VJFVF3MP-iGAMdGFC.js → xychartDiagram-VJFVF3MP-CEwzsn7Q.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-DjT4lYOc.js +0 -1
- package/dist/assets/channel-DmtkKWTN.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-CfeZvByo.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-CfeZvByo.js +0 -1
- package/dist/assets/clone-DTEBEvnL.js +0 -1
- package/dist/assets/edit-page-D23cAA_b.js +0 -8
- package/dist/assets/stateDiagram-v2-YXO3MK2T-BQH2L1vE.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-hp2iiuvx.js";import{a as s}from"./_baseEach-8vOU2tOE.js";import{b as c}from"./_baseMap-YJCrrumZ.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-w-eOM2q4.js";import{_ as i,c as r,l as n,d as s,j as d,u as o}from"./mermaid-CW33B1NW.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-BKTSw2wq.js";import{l as h}from"./layout-L7EZG6r9.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-RZ5BOZE2-DqIGT4rs.js";import"./index-CgOL2ukR.js";import"./_baseUniq-CY3x7HaT.js";import"./_baseEach-BzH38Sp_.js";import"./min-DNMLpmWf.js";import"./_baseMap-DjT4lYOc.js";import"./sortBy-DmL0RP-s.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-COHf-7xJ.js";import{_ as i,c as r,l as n,d as s,j as d,u as o}from"./mermaid-kij_0uc5.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-BJtvQT-e.js";import{l as h}from"./layout-CupugUzL.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-RZ5BOZE2-CFvhH_G4.js";import"./index-hp2iiuvx.js";import"./_baseUniq-D1LRb3BA.js";import"./_baseEach-8vOU2tOE.js";import"./min-DIXND8EC.js";import"./_baseMap-YJCrrumZ.js";import"./sortBy-BJHnIvvp.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-COHf-7xJ.js";import{_ as a}from"./mermaid-kij_0uc5.js";import"./transform-CdY8z5kT.js";import"./chunk-RZ5BOZE2-CFvhH_G4.js";import"./index-hp2iiuvx.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};
|