@marimo-team/frontend 0.12.1-dev3 → 0.12.1-dev4
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-DTCRYiUB.js → ConnectedDataExplorerComponent-CJruiifD.js} +1 -1
- package/dist/assets/{VegaLite-BZ8uVF3i.js → VegaLite-BE8iaI6d.js} +1 -1
- package/dist/assets/{_baseEach-sOT4rPPR.js → _baseEach-CHGr95h3.js} +1 -1
- package/dist/assets/_baseMap-CJD4EB23.js +1 -0
- package/dist/assets/{_baseUniq-BVK8v5I2.js → _baseUniq-DBsNFMLI.js} +1 -1
- package/dist/assets/{any-language-editor-CnHUn-kR.js → any-language-editor-C44KD8Jd.js} +1 -1
- package/dist/assets/{architectureDiagram-UYN6MBPD-wOiDzjET.js → architectureDiagram-UYN6MBPD-BgbOosfX.js} +1 -1
- package/dist/assets/{blockDiagram-ZHA2E4KO-CTudKJ73.js → blockDiagram-ZHA2E4KO-9FMsNisX.js} +1 -1
- package/dist/assets/{c4Diagram-6F5ED5ID-DgzWHOEG.js → c4Diagram-6F5ED5ID-Bbqvpa8H.js} +1 -1
- package/dist/assets/channel-Cr4w4fr-.js +1 -0
- package/dist/assets/{chunk-5HRBRIJM-BSOcrKVY.js → chunk-5HRBRIJM-X4M2qmib.js} +1 -1
- package/dist/assets/{chunk-7U56Z5CX-CELbC70v.js → chunk-7U56Z5CX-C5qQ_O2_.js} +1 -1
- package/dist/assets/{chunk-ASOPGD6M-D236etlf.js → chunk-ASOPGD6M-DewGTxkr.js} +1 -1
- package/dist/assets/{chunk-KFBOBJHC-BTrn_l9d.js → chunk-KFBOBJHC-DOfnAPal.js} +1 -1
- package/dist/assets/{chunk-T2TOU4HS-CzWqhCaj.js → chunk-T2TOU4HS-DrSTkPX7.js} +1 -1
- package/dist/assets/{chunk-TMUBEWPD-BOA-ODGX.js → chunk-TMUBEWPD-D_YLueZ5.js} +1 -1
- package/dist/assets/classDiagram-LNE6IOMH-D--jW1ZB.js +1 -0
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-D--jW1ZB.js +1 -0
- package/dist/assets/clone-D6AulMZy.js +1 -0
- package/dist/assets/{compile-SU2Wm_pz.js → compile-Cb-2V0aD.js} +1 -1
- package/dist/assets/{dagre-4EVJKHTY-pUkZFwdE.js → dagre-4EVJKHTY-DiF_5n5x.js} +1 -1
- package/dist/assets/{data-editor-BiXV3idV.js → data-editor-CGJ9_7_q.js} +1 -1
- package/dist/assets/{diagram-QW4FP2JN-CewwlYSP.js → diagram-QW4FP2JN-fVKWzjDQ.js} +1 -1
- package/dist/assets/edit-page-DX4QoMwC.js +8 -0
- package/dist/assets/{erDiagram-6RL3IURR-fzcnV1Ox.js → erDiagram-6RL3IURR-tkYxbOwJ.js} +1 -1
- package/dist/assets/{flowDiagram-7ASYPVHJ-ChXzt69P.js → flowDiagram-7ASYPVHJ-wCWrRB02.js} +1 -1
- package/dist/assets/{ganttDiagram-NTVNEXSI-DQd_Dshi.js → ganttDiagram-NTVNEXSI-CipIDMvM.js} +1 -1
- package/dist/assets/{gitGraph-YCYPL57B-mv00QEx9.js → gitGraph-YCYPL57B-B2gBFbEc.js} +1 -1
- package/dist/assets/{gitGraphDiagram-NRZ2UAAF-DSVkwnqj.js → gitGraphDiagram-NRZ2UAAF-CzfIrjrb.js} +1 -1
- package/dist/assets/{graph-DYzQd3tj.js → graph-4-Vg1Aiz.js} +1 -1
- package/dist/assets/{home-page-C0szqVIh.js → home-page-DHrqvZ5M.js} +1 -1
- package/dist/assets/{index-DAiXzbrF.js → index-BEGeiwsG.js} +1 -1
- package/dist/assets/{index-C8S6Kbkh.js → index-BH9A8KuI.js} +1 -1
- package/dist/assets/{index-C2JrYTSP.js → index-BiPdUed2.js} +1 -1
- package/dist/assets/{index-CWZW6Ojl.js → index-CHAfPpeC.js} +1 -1
- package/dist/assets/{index-B2ZSHNqa.js → index-CO1xz3xH.js} +1 -1
- package/dist/assets/{index-CcEN2neV.js → index-CWohOS_e.js} +1 -1
- package/dist/assets/{index-BgDmKU58.js → index-CYjr_k0H.js} +1 -1
- package/dist/assets/{index-IiRtHN2v.js → index-CZQNf_us.js} +1 -1
- package/dist/assets/{index-C-SqnIRq.js → index-CkAdNdK9.js} +1 -1
- package/dist/assets/{index-Di395a1M.js → index-DKriXlXA.js} +1 -1
- package/dist/assets/{index-AOKJdeS6.js → index-DRtvMp6Z.js} +1 -1
- package/dist/assets/{index-_MUvU39G.js → index-Ddv63gQw.js} +1 -1
- package/dist/assets/{index-Cw4gTLBI.js → index-DoaFBt3g.js} +1 -1
- package/dist/assets/{index-C3Glh6gi.js → index-DuktNpRm.js} +1 -1
- package/dist/assets/{index-Dwv3Q59K.js → index-DwShl_Rl.js} +1 -1
- package/dist/assets/{index-C2z_VuFT.js → index-DxHC9_BU.js} +1 -1
- package/dist/assets/{index-Clae2p_n.js → index-M-fa6gqH.js} +6 -6
- package/dist/assets/{infoDiagram-A4XQUW5V-Bdi4LBAt.js → infoDiagram-A4XQUW5V-Cq17uMjs.js} +1 -1
- package/dist/assets/{journeyDiagram-G5WM74LC-fvl9H2MW.js → journeyDiagram-G5WM74LC-CTXVfGIj.js} +1 -1
- package/dist/assets/{kanban-definition-QRCXZQQD-BDqJAd0J.js → kanban-definition-QRCXZQQD-ELngktM2.js} +1 -1
- package/dist/assets/{layout-s8N5-yeL.js → layout-CGBTZO_E.js} +1 -1
- package/dist/assets/{linear-BI_-mmDA.js → linear-BbegsqX1.js} +1 -1
- package/dist/assets/{mermaid-D7FYuIZr.js → mermaid-NCa4Btby.js} +3 -3
- package/dist/assets/{min-DpxwGrrY.js → min-CABlFD1H.js} +1 -1
- package/dist/assets/{mindmap-definition-GWI6TPTV-DfbUq1Al.js → mindmap-definition-GWI6TPTV-DLlhxG7q.js} +1 -1
- package/dist/assets/{pieDiagram-YF2LJOPJ-Bul08dAs.js → pieDiagram-YF2LJOPJ-BPY4ab3U.js} +1 -1
- package/dist/assets/{quadrantDiagram-OS5C2QUG-hi5szi7J.js → quadrantDiagram-OS5C2QUG-DNcT7n4n.js} +1 -1
- package/dist/assets/{react-plotly-CEhfuE9b.js → react-plotly-D49PuaDp.js} +1 -1
- package/dist/assets/{requirementDiagram-MIRIMTAZ-DEH8JpAP.js → requirementDiagram-MIRIMTAZ-BiwgQpI6.js} +1 -1
- package/dist/assets/{run-page-JpZQ8Gca.js → run-page-_t2pqoib.js} +1 -1
- package/dist/assets/{sankeyDiagram-Y46BX6SQ-BpijzTv1.js → sankeyDiagram-Y46BX6SQ-Yek58mqV.js} +1 -1
- package/dist/assets/{sequenceDiagram-G6AWOVSC-BVIq-Nus.js → sequenceDiagram-G6AWOVSC-CS1ohKZS.js} +1 -1
- package/dist/assets/{slides-component-slVv_CsZ.js → slides-component-BhUqdm2K.js} +1 -1
- package/dist/assets/{sortBy-I4etPOyA.js → sortBy-DeAoOjrt.js} +1 -1
- package/dist/assets/{stateDiagram-MAYHULR4-DJssQMNw.js → stateDiagram-MAYHULR4-C25IIyJY.js} +1 -1
- package/dist/assets/stateDiagram-v2-4JROLMXI-Du1ne-Iw.js +1 -0
- package/dist/assets/{terminal-55df9tJI.js → terminal-B5M_jESV.js} +1 -1
- package/dist/assets/{time-DRyy8oxF.js → time-Cg9ECQUX.js} +1 -1
- package/dist/assets/{timeline-definition-U7ZMHBDA-D-qrZM1U.js → timeline-definition-U7ZMHBDA-bNrrM9Xd.js} +1 -1
- package/dist/assets/{tree-Bdk9TtlT.js → tree-DXPs25GO.js} +2 -2
- package/dist/assets/{useMarimoWebSocket-BNrzKmBj.js → useMarimoWebSocket-UUW24I6P.js} +4 -4
- package/dist/assets/{vega-component-ZaPYNspD.js → vega-component-DBMPlOJo.js} +1 -1
- package/dist/assets/{xychartDiagram-6QU3TZC5-zBtuZoU6.js → xychartDiagram-6QU3TZC5-vQAUXteB.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/_baseMap-BIPGf0z4.js +0 -1
- package/dist/assets/channel-Dbok21gZ.js +0 -1
- package/dist/assets/classDiagram-LNE6IOMH-xdpW6-0K.js +0 -1
- package/dist/assets/classDiagram-v2-MQ7JQ4JX-xdpW6-0K.js +0 -1
- package/dist/assets/clone-CDvWBQHX.js +0 -1
- package/dist/assets/edit-page-CU_C5Vuw.js +0 -8
- package/dist/assets/stateDiagram-v2-4JROLMXI-Bf92iKxV.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-M-fa6gqH.js";import{a as s}from"./_baseEach-CHGr95h3.js";import{b as c}from"./_baseMap-CJD4EB23.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,b as a}from"./chunk-7U56Z5CX-CELbC70v.js";import{_ as i,c as r,l as n,d,j as s,u as o}from"./mermaid-D7FYuIZr.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-DYzQd3tj.js";import{l as h}from"./layout-s8N5-yeL.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-5HRBRIJM-BSOcrKVY.js";import"./index-Clae2p_n.js";import"./_baseUniq-BVK8v5I2.js";import"./_baseEach-sOT4rPPR.js";import"./min-DpxwGrrY.js";import"./_baseMap-BIPGf0z4.js";import"./sortBy-I4etPOyA.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"),h=s.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+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 h,c=Math.max(p,s);c===s&&(c+=n);const l=t.node().getBBox();e.doc,h=o-i,p>s&&(h=(s-c)/2+i),Math.abs(o-l.x)<i&&p>s&&(h=o-(p-s)/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<=s&&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 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"),H=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"),j=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&&H(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,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(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 h=0;const c=[];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+h),r=a.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=a.node().getBBox();h=t.height,n.info("Title height",h,g)}c.push(a)}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=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"),h="sandbox"===s?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const c=p.select(`[id='${e}']`);R(c);const l=i.db.getRootDoc();O(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;d(c,m,1.75*y,x.useMaxWidth),c.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 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{}})),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=j(e,t,g);if(t.note){const a={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},i=j(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)})),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);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-C5qQ_O2_.js";import{_ as i,c as r,l as n,d,j as s,u as o}from"./mermaid-NCa4Btby.js";import{s as g}from"./transform-CdY8z5kT.js";import{G as p}from"./graph-4-Vg1Aiz.js";import{l as h}from"./layout-CGBTZO_E.js";import{l as c,k as l}from"./step-xJWGRC3d.js";import"./chunk-5HRBRIJM-X4M2qmib.js";import"./index-M-fa6gqH.js";import"./_baseUniq-DBsNFMLI.js";import"./_baseEach-CHGr95h3.js";import"./min-CABlFD1H.js";import"./_baseMap-CJD4EB23.js";import"./sortBy-DeAoOjrt.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"),h=s.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+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 h,c=Math.max(p,s);c===s&&(c+=n);const l=t.node().getBBox();e.doc,h=o-i,p>s&&(h=(s-c)/2+i),Math.abs(o-l.x)<i&&p>s&&(h=o-(p-s)/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<=s&&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 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"),H=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"),j=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&&H(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,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(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 h=0;const c=[];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+h),r=a.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=a.node().getBBox();h=t.height,n.info("Title height",h,g)}c.push(a)}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=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"),h="sandbox"===s?o.nodes()[0].contentDocument:document;n.debug("Rendering diagram "+t);const c=p.select(`[id='${e}']`);R(c);const l=i.db.getRootDoc();O(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;d(c,m,1.75*y,x.useMaxWidth),c.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 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{}})),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=j(e,t,g);if(t.note){const a={descriptions:[],id:t.id+"-note",note:t.note,type:"note"},i=j(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)})),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);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-C5qQ_O2_.js";import{_ as e}from"./mermaid-NCa4Btby.js";import"./transform-CdY8z5kT.js";import"./chunk-5HRBRIJM-X4M2qmib.js";import"./index-M-fa6gqH.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};
|