@layers-app/editor 0.7.47 → 0.7.48
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/README.md +840 -830
- package/dist/index.cjs +2 -2
- package/dist/index.d.ts +8 -14
- package/dist/index.js +4 -4
- package/dist/layers.-XXFcZ-Q.js +33 -0
- package/dist/layers.3jBLdifJ.js +38 -0
- package/dist/layers.48nWXuMb.js +504 -0
- package/dist/layers.4NkfZAG8.js +39 -0
- package/dist/layers.52famHy6.js +1 -0
- package/dist/layers.6JZIYhnG.js +21941 -0
- package/dist/layers.7JqFgE4-.js +15 -0
- package/dist/layers.8I_XubBt.js +1 -0
- package/dist/layers.8L97LNWM.js +116 -0
- package/dist/layers.9Ei77wJG.js +40 -0
- package/dist/layers.9pNaFvaX.js +1 -0
- package/dist/layers.9vsoRdca.js +7 -0
- package/dist/layers.B19hGmey.js +1 -0
- package/dist/layers.B2hK-O3y.js +40 -0
- package/dist/layers.B3D4g2HH.js +1 -0
- package/dist/layers.B3ebXuRR.js +22 -0
- package/dist/layers.B4eocW2U.js +1 -0
- package/dist/layers.B7K7JjK6.js +1510 -0
- package/dist/layers.B9jC1uEF.js +9 -0
- package/dist/layers.B9vco1Tm.js +42 -0
- package/dist/layers.BAdbzzKU.js +11 -0
- package/dist/layers.BAtv1CM7.js +1 -0
- package/dist/layers.BAxiKghG.js +65 -0
- package/dist/layers.BCmyFF5n.js +8 -0
- package/dist/layers.BDlIrLZ6.js +40 -0
- package/dist/layers.BE1X7OZN.js +9 -0
- package/dist/layers.BE5c8LWk.js +4 -0
- package/dist/layers.BEXIxuBF.js +10 -0
- package/dist/layers.BFRwalLF.js +39 -0
- package/dist/layers.BFl0k28S.js +6 -0
- package/dist/layers.BGNKNfpx.js +1225 -0
- package/dist/layers.BHGjfW2R.js +907 -0
- package/dist/layers.BHstW68e.js +2238 -0
- package/dist/layers.BIeVwYKL.js +1 -0
- package/dist/layers.BJDrjORS.js +244 -0
- package/dist/layers.BKqs5g_B.js +51 -0
- package/dist/layers.BKutBTDw.js +41 -0
- package/dist/layers.BLa-XNid.js +84 -0
- package/dist/layers.BLd2spTm.js +1 -0
- package/dist/layers.BLqn32Nb.js +41 -0
- package/dist/layers.BM2O77Wh.js +425 -0
- package/dist/layers.BOm3l9Y2.js +8 -0
- package/dist/layers.BPwJ27pe.js +1268 -0
- package/dist/layers.BRWktvhi.js +7 -0
- package/dist/layers.BRbQRhez.js +9 -0
- package/dist/layers.BSTBZrFn.js +1 -0
- package/dist/{layers.NW1lST7i.js → layers.BSgSDW2J.js} +1 -1
- package/dist/layers.BTYE7zXl.js +32 -0
- package/dist/layers.BW7u2_1T.js +772 -0
- package/dist/layers.BXVqLjUh.js +1126 -0
- package/dist/layers.BXwHF1c0.js +1 -0
- package/dist/layers.BYA27mAA.js +10 -0
- package/dist/layers.BZO72u-D.js +1 -0
- package/dist/layers.BZbUfGYp.js +6 -0
- package/dist/layers.BbCfEXyj.js +55 -0
- package/dist/layers.BdBmAIrs.js +76 -0
- package/dist/layers.BeIBKBJG.js +11 -0
- package/dist/layers.BjauJJl_.js +42 -0
- package/dist/layers.Bkv-oShk.js +39 -0
- package/dist/layers.Bl4j3Wpr.js +10 -0
- package/dist/layers.Bm3vF-Ge.js +10 -0
- package/dist/layers.Bp-6Ampr.js +7 -0
- package/dist/layers.Bp180gHt.js +2966 -0
- package/dist/layers.Bp2T5L9r.js +21620 -0
- package/dist/layers.BpilXLfW.js +6 -0
- package/dist/{layers.Cfvta__C.js → layers.BrFRnEbi.js} +1 -1
- package/dist/layers.BsoRVzDP.js +806 -0
- package/dist/layers.BtPwy6-y.js +10 -0
- package/dist/layers.BtYjjZLM.js +38 -0
- package/dist/layers.BvhD2Hex.js +41 -0
- package/dist/layers.By9AhVvm.js +42 -0
- package/dist/layers.Bz2bAm_o.js +32 -0
- package/dist/layers.C-9tvKsH.js +2 -0
- package/dist/layers.C239vlHa.js +1583 -0
- package/dist/layers.C4DDZaZs.js +36 -0
- package/dist/layers.C5kfbdNQ.js +796 -0
- package/dist/layers.C8_lu5UH.js +23 -0
- package/dist/layers.CAo4nRSe.js +37 -0
- package/dist/layers.CCNu5Rkf.js +1 -0
- package/dist/layers.CCqA6oPh.js +5 -0
- package/dist/layers.CFKLwcKm.js +5 -0
- package/dist/layers.CFSawE7c.js +8 -0
- package/dist/layers.CFs5s8T3.js +52 -0
- package/dist/layers.CGoSj1av.js +1286 -0
- package/dist/layers.CH7sIJoO.js +37 -0
- package/dist/layers.CHZsXQcr.js +1 -0
- package/dist/layers.CI9mIisM.js +257 -0
- package/dist/layers.CJFGEsgQ.js +40 -0
- package/dist/layers.CJb1-QAi.js +7 -0
- package/dist/layers.CKTftm3f.js +2 -0
- package/dist/layers.CM9U_WY6.js +304 -0
- package/dist/layers.CMiTJnad.js +8 -0
- package/dist/layers.CNfAcY6Y.js +1 -0
- package/dist/layers.COeBHfJh.js +1 -0
- package/dist/layers.CPkIaDFg.js +39 -0
- package/dist/layers.CRYQyJW8.js +39 -0
- package/dist/layers.CRxZsox1.js +1 -0
- package/dist/layers.CTAkgg4R.js +1619 -0
- package/dist/layers.CU6rRFWz.js +1 -0
- package/dist/layers.CUuGcjpi.js +32 -0
- package/dist/layers.CVuk5gp9.js +84 -0
- package/dist/layers.CW3RPoeB.js +1089 -0
- package/dist/layers.CX1TPIiJ.js +805 -0
- package/dist/layers.CXmM9Bvj.js +10 -0
- package/dist/layers.CYHiWIYN.js +373 -0
- package/dist/layers.CZpHZoB0.js +9 -0
- package/dist/layers.C_8cg569.js +8 -0
- package/dist/layers.C_H8CF1f.js +44 -0
- package/dist/layers.C_IvrzZ3.js +7 -0
- package/dist/layers.C_Z4dR-0.js +39 -0
- package/dist/layers.C_poBEYa.js +10 -0
- package/dist/layers.CaPMI1KH.js +139 -0
- package/dist/layers.CbWg4Qj_.js +1 -0
- package/dist/layers.CcZMrh49.js +41 -0
- package/dist/layers.CefLOoC8.js +10 -0
- package/dist/layers.CfGk77zR.js +1 -0
- package/dist/layers.CitJ-LcP.js +1 -0
- package/dist/layers.Ckdux2po.js +48149 -0
- package/dist/layers.Cl2CJFNx.js +35 -0
- package/dist/layers.ClLKdjmI.js +39 -0
- package/dist/layers.ClVfKZ9h.js +1 -0
- package/dist/layers.CmF7I89w.js +32 -0
- package/dist/layers.Cn30_EV4.js +14 -0
- package/dist/layers.CnmwOTKT.js +295 -0
- package/dist/layers.CqHFUbCh.js +122 -0
- package/dist/layers.CqVTtuYm.js +6 -0
- package/dist/layers.Ct7Z5o-U.js +7 -0
- package/dist/layers.CtAhktPZ.js +1 -0
- package/dist/layers.Ctocb96g.js +1 -0
- package/dist/layers.Cu_3bkpd.js +207 -0
- package/dist/layers.CvFNr8Uu.js +61 -0
- package/dist/layers.Cye7d0Ye.js +35 -0
- package/dist/layers.Cyzu9PKQ.js +1 -0
- package/dist/layers.CzBOl45X.js +5 -0
- package/dist/layers.CzP0RBWK.js +139 -0
- package/dist/layers.D0dYIayl.js +1 -0
- package/dist/layers.D0zn4_Mx.js +1 -0
- package/dist/layers.D4T8fTcj.js +1223 -0
- package/dist/layers.D5T2vOzx.js +223 -0
- package/dist/layers.D5n5uB-V.js +35 -0
- package/dist/layers.D6CzgZCn.js +6 -0
- package/dist/layers.D7jGxypv.js +8 -0
- package/dist/layers.D8gdqeYc.js +213 -0
- package/dist/layers.D9Q1WK3D.js +32 -0
- package/dist/layers.DBYWjvtj.js +8 -0
- package/dist/layers.DBmtL6ZZ.js +41 -0
- package/dist/layers.DEjh8HqA.js +32 -0
- package/dist/layers.DHWPE8JP.js +37 -0
- package/dist/layers.DHoGHrwb.js +437 -0
- package/dist/layers.DIa1shbs.js +9 -0
- package/dist/{layers.Hq0pIRX3.js → layers.DIhuprWj.js} +21 -21
- package/dist/layers.DJ64BwjI.js +5 -0
- package/dist/layers.DJYCnlhb.js +40 -0
- package/dist/layers.DJuBjYUv.js +1 -0
- package/dist/layers.DL2VBsfE.js +2 -0
- package/dist/layers.DL3G4Rrb.js +41 -0
- package/dist/layers.DLwuMfdd.js +84 -0
- package/dist/layers.DMQHD7SZ.js +1 -0
- package/dist/layers.DMkBISW1.js +1 -0
- package/dist/layers.DN9HoVxI.js +18 -0
- package/dist/layers.DOq-L3gG.js +40 -0
- package/dist/layers.DOrgOHBr.js +1 -0
- package/dist/layers.DQ3x1v0k.js +934 -0
- package/dist/layers.DQD1IQ6W.js +1034 -0
- package/dist/layers.DR3nuNQY.js +271 -0
- package/dist/layers.DSMzl4c7.js +160 -0
- package/dist/layers.DSXwzG0l.js +7 -0
- package/dist/layers.DUGRqDUB.js +8583 -0
- package/dist/layers.DUWcbGsB.js +2482 -0
- package/dist/layers.DXWOVogE.js +40 -0
- package/dist/layers.DbRchKwe.js +8 -0
- package/dist/layers.DbaKVP5e.js +1 -0
- package/dist/layers.DcGOrQq5.js +39 -0
- package/dist/layers.Df7-26ey.js +189 -0
- package/dist/layers.Dfl1_GY-.js +40 -0
- package/dist/layers.DhkSgCGH.js +36 -0
- package/dist/layers.DhlqqsI-.js +9 -0
- package/dist/layers.DiHUvl0o.js +423 -0
- package/dist/layers.Dj-z0EfD.js +5 -0
- package/dist/layers.DjUOC4st.js +16 -0
- package/dist/layers.DjzsPlhY.js +70 -0
- package/dist/layers.DnNdcruU.js +9 -0
- package/dist/layers.DnRoER-T.js +11 -0
- package/dist/layers.DngDRzM2.js +10 -0
- package/dist/layers.Dop4IJqp.js +7 -0
- package/dist/layers.Dpw_9ymJ.js +34 -0
- package/dist/layers.DqkMTScX.js +40 -0
- package/dist/layers.Ds-YCD3f.js +38 -0
- package/dist/layers.DsQYlSSa.js +40 -0
- package/dist/layers.DsjBnsF_.js +42 -0
- package/dist/layers.Dsyqs-lC.js +11 -0
- package/dist/layers.DtEAEu5Y.js +1 -0
- package/dist/layers.DvEpZu0k.js +794 -0
- package/dist/layers.DwKuuHvW.js +4 -0
- package/dist/layers.DwrUaEvN.js +13 -0
- package/dist/layers.DxA6ocdw.js +70 -0
- package/dist/layers.Dy1naDTQ.js +14 -0
- package/dist/layers.E-_P3Hgt.js +4 -0
- package/dist/layers.E2Pg6Xkc.js +3 -0
- package/dist/{layers.B88sQYuh.js → layers.G1XGzBxR.js} +1 -1
- package/dist/layers.JWCLFILJ.js +1 -0
- package/dist/layers.KFn2whtk.js +9 -0
- package/dist/layers.LiJvf-Xh.js +11 -0
- package/dist/layers.OxWb2lcf.js +9 -0
- package/dist/layers.QOZfLJOU.js +205 -0
- package/dist/layers.R3a4GOcm.js +39 -0
- package/dist/layers.R8OXBVYp.js +1 -0
- package/dist/layers.R8mPlCA0.js +261 -0
- package/dist/layers.RZvZoVxE.js +9 -0
- package/dist/layers.SdU27KL4.js +42 -0
- package/dist/layers.Umldr18w.js +198 -0
- package/dist/layers.Upsmcdyi.js +33 -0
- package/dist/layers._beiaL7T.js +1 -0
- package/dist/layers._d6q9aen.js +10 -0
- package/dist/layers.a_6-TFT0.js +6 -0
- package/dist/layers.b0h5ZBmD.js +61 -0
- package/dist/{layers.CsQlovyR.js → layers.b9B2NY7n.js} +1950 -2191
- package/dist/layers.bdZaUQNB.js +41 -0
- package/dist/layers.fCcqSwty.js +8 -0
- package/dist/layers.fldW-Ogr.js +30328 -0
- package/dist/layers.i2bcEL4B.js +41 -0
- package/dist/layers.iSx5HVBW.js +37 -0
- package/dist/layers.lCpg7dOn.js +21 -0
- package/dist/layers.lY3SrA49.js +6 -0
- package/dist/layers.lgAtpBQI.js +7 -0
- package/dist/layers.my0yWZmR.js +8 -0
- package/dist/layers.n5OStkpA.js +1088 -0
- package/dist/layers.orP2yP91.js +96 -0
- package/dist/layers.ovEMwqYP.js +36 -0
- package/dist/layers.q8HcJw1z.js +8 -0
- package/dist/layers.qaJdLFHI.js +118 -0
- package/dist/layers.rUzSMgAT.js +6 -0
- package/dist/layers.rddzpnjy.js +323 -0
- package/dist/layers.sHJHq9SR.js +1 -0
- package/dist/layers.tjc2yfO8.js +36 -0
- package/dist/layers.vO27jqdn.js +4 -0
- package/dist/layers.yZYCg_En.js +960 -0
- package/dist/layers.zF6RU9h5.js +1 -0
- package/package.json +13 -7
- package/dist/layers.BgMykHnn.js +0 -154
- package/dist/layers.BtvuN20E.js +0 -27618
- package/dist/layers.Ct1ojjl3.js +0 -1
- package/dist/layers.JT_kEFH5.js +0 -129
- package/dist/layers.pwc3O6Es.js +0 -261
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./layers.orP2yP91.js"),R=require("./layers.CRxZsox1.js");require("./layers.Umldr18w.js");require("lodash-es/memoize.js");require("lodash-es/merge.js");require("lodash-es/isEmpty.js");const Q=require("./layers.zF6RU9h5.js");var X=(function(){var t=function(p,n,r,a){for(r=r||{},a=p.length;a--;r[p[a]]=n);return r},e=[6,8,10,11,12,14,16,17,18],i=[1,9],l=[1,10],s=[1,11],h=[1,12],c=[1,13],f=[1,14],y={trace:function(){},yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:function(n,r,a,u,d,o,T){var _=o.length-1;switch(d){case 1:return o[_-1];case 2:this.$=[];break;case 3:o[_-1].push(o[_]),this.$=o[_-1];break;case 4:case 5:this.$=o[_];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(o[_].substr(6)),this.$=o[_].substr(6);break;case 9:this.$=o[_].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=o[_].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(o[_].substr(8)),this.$=o[_].substr(8);break;case 13:u.addTask(o[_-1],o[_]),this.$="task";break}},table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:i,12:l,14:s,16:h,17:c,18:f},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:i,12:l,14:s,16:h,17:c,18:f},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:function(n,r){if(r.recoverable)this.trace(n);else{var a=new Error(n);throw a.hash=r,a}},parse:function(n){var r=this,a=[0],u=[],d=[null],o=[],T=this.table,_="",N=0,Z=0,ot=2,J=1,lt=o.slice.call(arguments,1),x=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);x.setInput(n,C.yy),C.yy.lexer=x,C.yy.parser=this,typeof x.yylloc>"u"&&(x.yylloc={});var O=x.yylloc;o.push(O);var ct=x.options&&x.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ht(){var M;return M=u.pop()||x.lex()||J,typeof M!="number"&&(M instanceof Array&&(u=M,M=u.pop()),M=r.symbols_[M]||M),M}for(var b,E,v,Y,P={},q,$,K,B;;){if(E=a[a.length-1],this.defaultActions[E]?v=this.defaultActions[E]:((b===null||typeof b>"u")&&(b=ht()),v=T[E]&&T[E][b]),typeof v>"u"||!v.length||!v[0]){var H="";B=[];for(q in T[E])this.terminals_[q]&&q>ot&&B.push("'"+this.terminals_[q]+"'");x.showPosition?H="Parse error on line "+(N+1)+`:
|
|
2
|
+
`+x.showPosition()+`
|
|
3
|
+
Expecting `+B.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(N+1)+": Unexpected "+(b==J?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:x.match,token:this.terminals_[b]||b,line:x.yylineno,loc:O,expected:B})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+E+", token: "+b);switch(v[0]){case 1:a.push(b),d.push(x.yytext),o.push(x.yylloc),a.push(v[1]),b=null,Z=x.yyleng,_=x.yytext,N=x.yylineno,O=x.yylloc;break;case 2:if($=this.productions_[v[1]][1],P.$=d[d.length-$],P._$={first_line:o[o.length-($||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-($||1)].first_column,last_column:o[o.length-1].last_column},ct&&(P._$.range=[o[o.length-($||1)].range[0],o[o.length-1].range[1]]),Y=this.performAction.apply(P,[_,Z,N,C.yy,v[1],d,o].concat(lt)),typeof Y<"u")return Y;$&&(a=a.slice(0,-1*$*2),d=d.slice(0,-1*$),o=o.slice(0,-1*$)),a.push(this.productions_[v[1]][0]),d.push(P.$),o.push(P._$),K=T[a[a.length-2]][a[a.length-1]],a.push(K);break;case 3:return!0}}return!0}},m=(function(){var p={EOF:1,parseError:function(r,a){if(this.yy.parser)this.yy.parser.parseError(r,a);else throw new Error(r)},setInput:function(n,r){return this.yy=r||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var r=n.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var r=n.length,a=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===u.length?this.yylloc.first_column:0)+u[u.length-a.length].length-a[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),r=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
5
|
+
`+r+"^"},test_match:function(n,r){var a,u,d;if(this.options.backtrack_lexer&&(d={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(d.yylloc.range=this.yylloc.range.slice(0))),u=n[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],a=this.performAction.call(this,this.yy,this,r,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var o in d)this[o]=d[o];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var n,r,a,u;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),o=0;o<d.length;o++)if(a=this._input.match(this.rules[d[o]]),a&&(!r||a[0].length>r[0].length)){if(r=a,u=o,this.options.backtrack_lexer){if(n=this.test_match(a,d[o]),n!==!1)return n;if(this._backtrack){r=!1;continue}else return!1}else if(!this.options.flex)break}return r?(n=this.test_match(r,d[u]),n!==!1?n:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var r=this.next();return r||this.lex()},begin:function(r){this.conditionStack.push(r)},popState:function(){var r=this.conditionStack.length-1;return r>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(r){return r=this.conditionStack.length-1-Math.abs(r||0),r>=0?this.conditionStack[r]:"INITIAL"},pushState:function(r){this.begin(r)},stateStackSize:function(){return this.conditionStack.length},options:{"case-insensitive":!0},performAction:function(r,a,u,d){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return p})();y.lexer=m;function g(){this.yy={}}return g.prototype=y,y.Parser=g,new g})();X.parser=X;const ut=X;let I="";const G=[],V=[],F=[],yt=function(){G.length=0,V.length=0,I="",F.length=0,k.clear()},ft=function(t){I=t,G.push(t)},dt=function(){return G},pt=function(){let t=D();const e=100;let i=0;for(;!t&&i<e;)t=D(),i++;return V.push(...F),V},gt=function(){const t=[];return V.forEach(i=>{i.people&&t.push(...i.people)}),[...new Set(t)].sort()},mt=function(t,e){const i=e.substr(1).split(":");let l=0,s=[];i.length===1?(l=Number(i[0]),s=[]):(l=Number(i[0]),s=i[1].split(","));const h=s.map(f=>f.trim()),c={section:I,type:I,people:h,task:t,score:l};F.push(c)},xt=function(t){const e={section:I,type:I,description:t,task:t,classes:[]};V.push(e)},D=function(){const t=function(i){return F[i].processed};let e=!0;for(const[i,l]of F.entries())t(i),e=e&&l.processed;return e},kt=function(){return gt()},tt={getConfig:()=>k.getConfig().journey,clear:yt,setDiagramTitle:k.setDiagramTitle,getDiagramTitle:k.getDiagramTitle,setAccTitle:k.setAccTitle,getAccTitle:k.getAccTitle,setAccDescription:k.setAccDescription,getAccDescription:k.getAccDescription,addSection:ft,getSections:dt,getTasks:pt,addTask:mt,addTaskOrg:xt,getActors:kt},_t=t=>`.label {
|
|
7
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
8
|
+
font-family: var(--mermaid-font-family);
|
|
9
|
+
color: ${t.textColor};
|
|
10
|
+
}
|
|
11
|
+
.mouth {
|
|
12
|
+
stroke: #666;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
line {
|
|
16
|
+
stroke: ${t.textColor}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.legend {
|
|
20
|
+
fill: ${t.textColor};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.label text {
|
|
24
|
+
fill: #333;
|
|
25
|
+
}
|
|
26
|
+
.label {
|
|
27
|
+
color: ${t.textColor}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.face {
|
|
31
|
+
${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
|
|
32
|
+
stroke: #999;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.node rect,
|
|
36
|
+
.node circle,
|
|
37
|
+
.node ellipse,
|
|
38
|
+
.node polygon,
|
|
39
|
+
.node path {
|
|
40
|
+
fill: ${t.mainBkg};
|
|
41
|
+
stroke: ${t.nodeBorder};
|
|
42
|
+
stroke-width: 1px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.node .label {
|
|
46
|
+
text-align: center;
|
|
47
|
+
}
|
|
48
|
+
.node.clickable {
|
|
49
|
+
cursor: pointer;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.arrowheadPath {
|
|
53
|
+
fill: ${t.arrowheadColor};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.edgePath .path {
|
|
57
|
+
stroke: ${t.lineColor};
|
|
58
|
+
stroke-width: 1.5px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.flowchart-link {
|
|
62
|
+
stroke: ${t.lineColor};
|
|
63
|
+
fill: none;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.edgeLabel {
|
|
67
|
+
background-color: ${t.edgeLabelBackground};
|
|
68
|
+
rect {
|
|
69
|
+
opacity: 0.5;
|
|
70
|
+
}
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.cluster rect {
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.cluster text {
|
|
78
|
+
fill: ${t.titleColor};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
div.mermaidTooltip {
|
|
82
|
+
position: absolute;
|
|
83
|
+
text-align: center;
|
|
84
|
+
max-width: 200px;
|
|
85
|
+
padding: 2px;
|
|
86
|
+
font-family: 'trebuchet ms', verdana, arial, sans-serif;
|
|
87
|
+
font-family: var(--mermaid-font-family);
|
|
88
|
+
font-size: 12px;
|
|
89
|
+
background: ${t.tertiaryColor};
|
|
90
|
+
border: 1px solid ${t.border2};
|
|
91
|
+
border-radius: 2px;
|
|
92
|
+
pointer-events: none;
|
|
93
|
+
z-index: 100;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.task-type-0, .section-type-0 {
|
|
97
|
+
${t.fillType0?`fill: ${t.fillType0}`:""};
|
|
98
|
+
}
|
|
99
|
+
.task-type-1, .section-type-1 {
|
|
100
|
+
${t.fillType0?`fill: ${t.fillType1}`:""};
|
|
101
|
+
}
|
|
102
|
+
.task-type-2, .section-type-2 {
|
|
103
|
+
${t.fillType0?`fill: ${t.fillType2}`:""};
|
|
104
|
+
}
|
|
105
|
+
.task-type-3, .section-type-3 {
|
|
106
|
+
${t.fillType0?`fill: ${t.fillType3}`:""};
|
|
107
|
+
}
|
|
108
|
+
.task-type-4, .section-type-4 {
|
|
109
|
+
${t.fillType0?`fill: ${t.fillType4}`:""};
|
|
110
|
+
}
|
|
111
|
+
.task-type-5, .section-type-5 {
|
|
112
|
+
${t.fillType0?`fill: ${t.fillType5}`:""};
|
|
113
|
+
}
|
|
114
|
+
.task-type-6, .section-type-6 {
|
|
115
|
+
${t.fillType0?`fill: ${t.fillType6}`:""};
|
|
116
|
+
}
|
|
117
|
+
.task-type-7, .section-type-7 {
|
|
118
|
+
${t.fillType0?`fill: ${t.fillType7}`:""};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.actor-0 {
|
|
122
|
+
${t.actor0?`fill: ${t.actor0}`:""};
|
|
123
|
+
}
|
|
124
|
+
.actor-1 {
|
|
125
|
+
${t.actor1?`fill: ${t.actor1}`:""};
|
|
126
|
+
}
|
|
127
|
+
.actor-2 {
|
|
128
|
+
${t.actor2?`fill: ${t.actor2}`:""};
|
|
129
|
+
}
|
|
130
|
+
.actor-3 {
|
|
131
|
+
${t.actor3?`fill: ${t.actor3}`:""};
|
|
132
|
+
}
|
|
133
|
+
.actor-4 {
|
|
134
|
+
${t.actor4?`fill: ${t.actor4}`:""};
|
|
135
|
+
}
|
|
136
|
+
.actor-5 {
|
|
137
|
+
${t.actor5?`fill: ${t.actor5}`:""};
|
|
138
|
+
}
|
|
139
|
+
`,bt=_t,U=function(t,e){return R.drawRect(t,e)},vt=function(t,e){const l=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");s.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function h(y){const m=Q.arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function c(y){const m=Q.arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);y.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function f(y){y.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return e.score>3?h(s):e.score<3?c(s):f(s),l},it=function(t,e){const i=t.append("circle");return i.attr("cx",e.cx),i.attr("cy",e.cy),i.attr("class","actor-"+e.pos),i.attr("fill",e.fill),i.attr("stroke",e.stroke),i.attr("r",e.r),i.class!==void 0&&i.attr("class",i.class),e.title!==void 0&&i.append("title").text(e.title),i},rt=function(t,e){return R.drawText(t,e)},wt=function(t,e){function i(s,h,c,f,y){return s+","+h+" "+(s+c)+","+h+" "+(s+c)+","+(h+f-y)+" "+(s+c-y*1.2)+","+(h+f)+" "+s+","+(h+f)}const l=t.append("polygon");l.attr("points",i(e.x,e.y,50,20,7)),l.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,rt(t,e)},Tt=function(t,e,i){const l=t.append("g"),s=R.getNoteRect();s.x=e.x,s.y=e.y,s.fill=e.fill,s.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),s.height=i.height,s.class="journey-section section-type-"+e.num,s.rx=3,s.ry=3,U(l,s),at(i)(e.text,l,s.x,s.y,s.width,s.height,{class:"journey-section section-type-"+e.num},i,e.colour)};let et=-1;const $t=function(t,e,i){const l=e.x+i.width/2,s=t.append("g");et++,s.append("line").attr("id","task"+et).attr("x1",l).attr("y1",e.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),vt(s,{cx:l,cy:300+(5-e.score)*30,score:e.score});const c=R.getNoteRect();c.x=e.x,c.y=e.y,c.fill=e.fill,c.width=i.width,c.height=i.height,c.class="task task-type-"+e.num,c.rx=3,c.ry=3,U(s,c);let f=e.x+14;e.people.forEach(y=>{const m=e.actors[y].color,g={cx:f,cy:e.y,r:7,fill:m,stroke:"#000",title:y,pos:e.actors[y].position};it(s,g),f+=10}),at(i)(e.task,s,c.x,c.y,c.width,c.height,{class:"task"},i,e.colour)},Mt=function(t,e){R.drawBackgroundRect(t,e)},at=(function(){function t(s,h,c,f,y,m,g,p){const n=h.append("text").attr("x",c+y/2).attr("y",f+m/2+5).style("font-color",p).style("text-anchor","middle").text(s);l(n,g)}function e(s,h,c,f,y,m,g,p,n){const{taskFontSize:r,taskFontFamily:a}=p,u=s.split(/<br\s*\/?>/gi);for(let d=0;d<u.length;d++){const o=d*r-r*(u.length-1)/2,T=h.append("text").attr("x",c+y/2).attr("y",f).attr("fill",n).style("text-anchor","middle").style("font-size",r).style("font-family",a);T.append("tspan").attr("x",c+y/2).attr("dy",o).text(u[d]),T.attr("y",f+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(T,g)}}function i(s,h,c,f,y,m,g,p){const n=h.append("switch"),a=n.append("foreignObject").attr("x",c).attr("y",f).attr("width",y).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(s),e(s,n,c,f,y,m,g,p),l(a,g)}function l(s,h){for(const c in h)c in h&&s.attr(c,h[c])}return function(s){return s.textPlacement==="fo"?i:s.textPlacement==="old"?t:e}})(),St=function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},L={drawRect:U,drawCircle:it,drawSection:Tt,drawText:rt,drawLabel:wt,drawTask:$t,drawBackgroundRect:Mt,initGraphics:St},Ct=function(t){Object.keys(t).forEach(function(i){j[i]=t[i]})},S={};function Et(t){const e=k.getConfig().journey;let i=60;Object.keys(S).forEach(l=>{const s=S[l].color,h={cx:20,cy:i,r:7,fill:s,stroke:"#000",pos:S[l].position};L.drawCircle(t,h);const c={x:40,y:i+7,fill:"#666",text:l,textMargin:e.boxTextMargin|5};L.drawText(t,c),i+=20})}const j=k.getConfig().journey,A=j.leftMargin,At=function(t,e,i,l){const s=k.getConfig().journey,h=k.getConfig().securityLevel;let c;h==="sandbox"&&(c=k.select("#i"+e));const f=h==="sandbox"?k.select(c.nodes()[0].contentDocument.body):k.select("body");w.init();const y=f.select("#"+e);L.initGraphics(y);const m=l.db.getTasks(),g=l.db.getDiagramTitle(),p=l.db.getActors();for(const o in S)delete S[o];let n=0;p.forEach(o=>{S[o]={color:s.actorColours[n%s.actorColours.length],position:n},n++}),Et(y),w.insert(0,0,A,Object.keys(S).length*50),Pt(y,m,0);const r=w.getBounds();g&&y.append("text").text(g).attr("x",A).attr("font-size","4ex").attr("font-weight","bold").attr("y",25);const a=r.stopy-r.starty+2*s.diagramMarginY,u=A+r.stopx+2*s.diagramMarginX;k.configureSvgSize(y,a,u,s.useMaxWidth),y.append("line").attr("x1",A).attr("y1",s.height*4).attr("x2",u-A-4).attr("y2",s.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)");const d=g?70:0;y.attr("viewBox",`${r.startx} -25 ${u} ${a+d}`),y.attr("preserveAspectRatio","xMinYMin meet"),y.attr("height",a+d+25)},w={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},updateVal:function(t,e,i,l){t[e]===void 0?t[e]=i:t[e]=l(i,t[e])},updateBounds:function(t,e,i,l){const s=k.getConfig().journey,h=this;let c=0;function f(y){return function(g){c++;const p=h.sequenceItems.length-c+1;h.updateVal(g,"starty",e-p*s.boxMargin,Math.min),h.updateVal(g,"stopy",l+p*s.boxMargin,Math.max),h.updateVal(w.data,"startx",t-p*s.boxMargin,Math.min),h.updateVal(w.data,"stopx",i+p*s.boxMargin,Math.max),h.updateVal(g,"startx",t-p*s.boxMargin,Math.min),h.updateVal(g,"stopx",i+p*s.boxMargin,Math.max),h.updateVal(w.data,"starty",e-p*s.boxMargin,Math.min),h.updateVal(w.data,"stopy",l+p*s.boxMargin,Math.max)}}this.sequenceItems.forEach(f())},insert:function(t,e,i,l){const s=Math.min(t,i),h=Math.max(t,i),c=Math.min(e,l),f=Math.max(e,l);this.updateVal(w.data,"startx",s,Math.min),this.updateVal(w.data,"starty",c,Math.min),this.updateVal(w.data,"stopx",h,Math.max),this.updateVal(w.data,"stopy",f,Math.max),this.updateBounds(s,c,h,f)},bumpVerticalPos:function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},getVerticalPos:function(){return this.verticalPos},getBounds:function(){return this.data}},W=j.sectionFills,nt=j.sectionColours,Pt=function(t,e,i){const l=k.getConfig().journey;let s="";const h=l.height*2+l.diagramMarginY,c=i+h;let f=0,y="#CCC",m="black",g=0;for(const[p,n]of e.entries()){if(s!==n.section){y=W[f%W.length],g=f%W.length,m=nt[f%nt.length];let a=0;const u=n.section;for(let o=p;o<e.length&&e[o].section==u;o++)a=a+1;const d={x:p*l.taskMargin+p*l.width+A,y:50,text:n.section,fill:y,num:g,colour:m,taskCount:a};L.drawSection(t,d,l),s=n.section,f++}const r=n.people.reduce((a,u)=>(S[u]&&(a[u]=S[u]),a),{});n.x=p*l.taskMargin+p*l.width+A,n.y=c,n.width=l.diagramMarginX,n.height=l.diagramMarginY,n.colour=m,n.fill=y,n.num=g,n.actors=r,L.drawTask(t,n,l),w.insert(n.x,n.y,n.x+n.width+l.taskMargin,450)}},st={setConf:Ct,draw:At},It={parser:ut,db:tt,renderer:st,styles:bt,init:t=>{st.setConf(t.journey),tt.clear()}};exports.diagram=It;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("./layers.Cu_3bkpd.js"),t=require("./layers.orP2yP91.js");require("lodash-es");const z=require("./layers.Cyzu9PKQ.js"),T=require("./layers.BLd2spTm.js");require("./layers.Umldr18w.js");require("lodash-es/memoize.js");require("lodash-es/merge.js");require("lodash-es/isEmpty.js");const L=require("./layers._beiaL7T.js"),P=e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig().state.sizeUnit).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit),q=e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig().state.textHeight).attr("class","divider").attr("x2",t.getConfig().state.textHeight*2).attr("y1",0).attr("y2",0),A=(e,n)=>{const r=e.append("text").attr("x",2*t.getConfig().state.padding).attr("y",t.getConfig().state.textHeight+2*t.getConfig().state.padding).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.id),d=r.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding).attr("width",d.width+2*t.getConfig().state.padding).attr("height",d.height+2*t.getConfig().state.padding).attr("rx",t.getConfig().state.radius),r},G=(e,n)=>{const r=function(c,w,y){const S=c.append("tspan").attr("x",2*t.getConfig().state.padding).text(w);y||S.attr("dy",t.getConfig().state.textHeight)},a=e.append("text").attr("x",2*t.getConfig().state.padding).attr("y",t.getConfig().state.textHeight+1.3*t.getConfig().state.padding).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=a.height,f=e.append("text").attr("x",t.getConfig().state.padding).attr("y",l+t.getConfig().state.padding*.4+t.getConfig().state.dividerMargin+t.getConfig().state.textHeight).attr("class","state-description");let i=!0,s=!0;n.descriptions.forEach(function(c){i||(r(f,c,s),s=!1),i=!1});const C=e.append("line").attr("x1",t.getConfig().state.padding).attr("y1",t.getConfig().state.padding+l+t.getConfig().state.dividerMargin/2).attr("y2",t.getConfig().state.padding+l+t.getConfig().state.dividerMargin/2).attr("class","descr-divider"),p=f.node().getBBox(),g=Math.max(p.width,a.width);return C.attr("x2",g+3*t.getConfig().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding).attr("width",g+2*t.getConfig().state.padding).attr("height",p.height+l+2*t.getConfig().state.padding).attr("rx",t.getConfig().state.radius),e},W=(e,n,r)=>{const d=t.getConfig().state.padding,a=2*t.getConfig().state.padding,l=e.node().getBBox(),f=l.width,i=l.x,s=e.append("text").attr("x",0).attr("y",t.getConfig().state.titleShift).attr("font-size",t.getConfig().state.fontSize).attr("class","state-title").text(n.id),p=s.node().getBBox().width+a;let g=Math.max(p,f);g===f&&(g=g+a);let c;const w=e.node().getBBox();n.doc,c=i-d,p>f&&(c=(f-g)/2+d),Math.abs(i-w.x)<d&&p>f&&(c=i-(p-f)/2);const y=1-t.getConfig().state.textHeight;return e.insert("rect",":first-child").attr("x",c).attr("y",y).attr("class",r?"alt-composit":"composit").attr("width",g).attr("height",w.height+t.getConfig().state.textHeight+t.getConfig().state.titleShift+1).attr("rx","0"),s.attr("x",c+d),p<=f&&s.attr("x",i+(g-a)/2-p/2+d),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig().state.titleShift-t.getConfig().state.textHeight-t.getConfig().state.padding).attr("width",g).attr("height",t.getConfig().state.textHeight*3).attr("rx",t.getConfig().state.radius),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig().state.titleShift-t.getConfig().state.textHeight-t.getConfig().state.padding).attr("width",g).attr("height",w.height+3+2*t.getConfig().state.textHeight).attr("rx",t.getConfig().state.radius),e},v=e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit+t.getConfig().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig().state.sizeUnit).attr("cx",t.getConfig().state.padding+t.getConfig().state.sizeUnit+2).attr("cy",t.getConfig().state.padding+t.getConfig().state.sizeUnit+2)),R=(e,n)=>{let r=t.getConfig().state.forkWidth,d=t.getConfig().state.forkHeight;if(n.parentId){let a=r;r=d,d=a}return e.append("rect").style("stroke","black").style("fill","black").attr("width",r).attr("height",d).attr("x",t.getConfig().state.padding).attr("y",t.getConfig().state.padding)},U=(e,n,r,d)=>{let a=0;const l=d.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let f=e.replace(/\r\n/g,"<br/>");f=f.replace(/\n/g,"<br/>");const i=f.split(t.common$1.lineBreakRegex);let s=1.25*t.getConfig().state.noteMargin;for(const C of i){const p=C.trim();if(p.length>0){const g=l.append("tspan");if(g.text(p),s===0){const c=g.node().getBBox();s+=c.height}a+=s,g.attr("x",n+t.getConfig().state.noteMargin),g.attr("y",r+a+1.25*t.getConfig().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:a}},F=(e,n)=>{n.attr("class","state-note");const r=n.append("rect").attr("x",0).attr("y",t.getConfig().state.padding),d=n.append("g"),{textWidth:a,textHeight:l}=U(e,0,0,d);return r.attr("height",l+2*t.getConfig().state.noteMargin),r.attr("width",a+t.getConfig().state.noteMargin*2),r},M=function(e,n){const r=n.id,d={id:r,label:n.id,width:0,height:0},a=e.append("g").attr("id",r).attr("class","stateGroup");n.type==="start"&&P(a),n.type==="end"&&v(a),(n.type==="fork"||n.type==="join")&&R(a,n),n.type==="note"&&F(n.note.text,a),n.type==="divider"&&q(a),n.type==="default"&&n.descriptions.length===0&&A(a,n),n.type==="default"&&n.descriptions.length>0&&G(a,n);const l=a.node().getBBox();return d.width=l.width+2*t.getConfig().state.padding,d.height=l.height+2*t.getConfig().state.padding,d};let H=0;const O=function(e,n,r){const d=function(s){switch(s){case m.db.relationType.AGGREGATION:return"aggregation";case m.db.relationType.EXTENSION:return"extension";case m.db.relationType.COMPOSITION:return"composition";case m.db.relationType.DEPENDENCY:return"dependency"}};n.points=n.points.filter(s=>!Number.isNaN(s.y));const a=n.points,l=L.line().x(function(s){return s.x}).y(function(s){return s.y}).curve(t.curveBasis),f=e.append("path").attr("d",l(a)).attr("id","edge"+H).attr("class","transition");let i="";if(t.getConfig().state.arrowMarkerAbsolute&&(i=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,i=i.replace(/\(/g,"\\("),i=i.replace(/\)/g,"\\)")),f.attr("marker-end","url("+i+"#"+d(m.db.relationType.DEPENDENCY)+"End)"),r.title!==void 0){const s=e.append("g").attr("class","stateLabel"),{x:C,y:p}=t.utils.calcLabelPosition(n.points),g=t.common$1.getRows(r.title);let c=0;const w=[];let y=0,S=0;for(let x=0;x<=g.length;x++){const h=s.append("text").attr("text-anchor","middle").text(g[x]).attr("x",C).attr("y",p+c),u=h.node().getBBox();y=Math.max(y,u.width),S=Math.min(S,u.x),t.log$1.info(u.x,C,p+c),c===0&&(c=h.node().getBBox().height,t.log$1.info("Title height",c,p)),w.push(h)}let E=c*g.length;if(g.length>1){const x=(g.length-1)*c*.5;w.forEach((h,u)=>h.attr("y",p+u*c-x)),E=c*g.length}const o=s.node().getBBox();s.insert("rect",":first-child").attr("class","box").attr("x",C-y/2-t.getConfig().state.padding/2).attr("y",p-E/2-t.getConfig().state.padding/2-3.5).attr("width",y+t.getConfig().state.padding).attr("height",E+t.getConfig().state.padding),t.log$1.info(o)}H++};let b;const N={},X=function(){},J=function(e){e.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")},Y=function(e,n,r,d){b=t.getConfig().state;const a=t.getConfig().securityLevel;let l;a==="sandbox"&&(l=t.select("#i"+n));const f=a==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=a==="sandbox"?l.nodes()[0].contentDocument:document;t.log$1.debug("Rendering diagram "+e);const s=f.select(`[id='${n}']`);J(s);const C=d.db.getRootDoc();$(C,s,void 0,!1,f,i,d);const p=b.padding,g=s.node().getBBox(),c=g.width+p*2,w=g.height+p*2,y=c*1.75;t.configureSvgSize(s,w,y,b.useMaxWidth),s.attr("viewBox",`${g.x-b.padding} ${g.y-b.padding} `+c+" "+w)},I=e=>e?e.length*b.fontSizeFactor:1,$=(e,n,r,d,a,l,f)=>{const i=new T.Graph({compound:!0,multigraph:!0});let s,C=!0;for(s=0;s<e.length;s++)if(e[s].stmt==="relation"){C=!1;break}r?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:C?1:b.edgeLengthFactor,nodeSep:C?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:C?1:b.edgeLengthFactor,nodeSep:C?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}}),f.db.extract(e);const p=f.db.getStates(),g=f.db.getRelations(),c=Object.keys(p);for(const o of c){const x=p[o];r&&(x.parentId=r);let h;if(x.doc){let u=n.append("g").attr("id",x.id).attr("class","stateGroup");h=$(x.doc,u,x.id,!d,a,l,f);{u=W(u,x,d);let B=u.node().getBBox();h.width=B.width,h.height=B.height+b.padding/2,N[x.id]={y:b.compositTitleSize}}}else h=M(n,x);if(x.note){const u={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},B=M(n,u);x.note.position==="left of"?(i.setNode(h.id+"-note",B),i.setNode(h.id,h)):(i.setNode(h.id,h),i.setNode(h.id+"-note",B)),i.setParent(h.id,h.id+"-group"),i.setParent(h.id+"-note",h.id+"-group")}else i.setNode(h.id,h)}t.log$1.debug("Count=",i.nodeCount(),i);let w=0;g.forEach(function(o){w++,t.log$1.debug("Setting edge",o),i.setEdge(o.id1,o.id2,{relation:o,width:I(o.title),height:b.labelHeight*t.common$1.getRows(o.title).length,labelpos:"c"},"id"+w)}),z.layout(i),t.log$1.debug("Graph after layout",i.nodes());const y=n.node();i.nodes().forEach(function(o){o!==void 0&&i.node(o)!==void 0?(t.log$1.warn("Node "+o+": "+JSON.stringify(i.node(o))),a.select("#"+y.id+" #"+o).attr("transform","translate("+(i.node(o).x-i.node(o).width/2)+","+(i.node(o).y+(N[o]?N[o].y:0)-i.node(o).height/2)+" )"),a.select("#"+y.id+" #"+o).attr("data-x-shift",i.node(o).x-i.node(o).width/2),l.querySelectorAll("#"+y.id+" #"+o+" .divider").forEach(h=>{const u=h.parentElement;let B=0,k=0;u&&(u.parentElement&&(B=u.parentElement.getBBox().width),k=parseInt(u.getAttribute("data-x-shift"),10),Number.isNaN(k)&&(k=0)),h.setAttribute("x1",0-k+8),h.setAttribute("x2",B-k-8)})):t.log$1.debug("No Node "+o+": "+JSON.stringify(i.node(o)))});let S=y.getBBox();i.edges().forEach(function(o){o!==void 0&&i.edge(o)!==void 0&&(t.log$1.debug("Edge "+o.v+" -> "+o.w+": "+JSON.stringify(i.edge(o))),O(n,i.edge(o),i.edge(o).relation))}),S=y.getBBox();const E={id:r||"root",label:r||"root",width:0,height:0};return E.width=S.width+2*b.padding,E.height=S.height+2*b.padding,t.log$1.debug("Doc rendered",E,i),E},_={setConf:X,draw:Y},Z={parser:m.parser$1,db:m.db,renderer:_,styles:m.styles,init:e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute,m.db.clear()}};exports.diagram=Z;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=async e=>{const i=await e.getFile();return i.handle=e,i};var r=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const i=[];e.forEach((t,a)=>{i[a]={description:t.description||"",accept:{}},t.mimeTypes?t.mimeTypes.map(l=>{i[a].accept[l]=t.extensions||[]}):i[a].accept["*/*"]=t.extensions||[]});const s=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:i,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),c=await Promise.all(s.map(n));return e[0].multiple?c:c[0]};exports.default=r;
|