sparkdesign 0.4.6 → 0.4.8
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/AI_README.md +60 -0
- package/README.md +1 -1
- package/cli/dist/commands/add.js +1 -1
- package/cli/dist/commands/init.js +1 -1
- package/cli/registry/AGENTS.md +9 -2
- package/cli/registry/agent-manifest.json +794 -0
- package/cli/registry/basic/alert-dialog.tsx +3 -6
- package/cli/registry/basic/alert.tsx +76 -0
- package/cli/registry/basic/aspect-ratio.tsx +8 -0
- package/cli/registry/basic/breadcrumb.tsx +117 -0
- package/cli/registry/basic/button-group.tsx +79 -0
- package/cli/registry/basic/button.tsx +19 -6
- package/cli/registry/basic/calendar.tsx +221 -0
- package/cli/registry/basic/card.tsx +115 -0
- package/cli/registry/basic/carousel.tsx +241 -0
- package/cli/registry/basic/chart.tsx +372 -0
- package/cli/registry/basic/checkbox.tsx +42 -0
- package/cli/registry/basic/collapsible-card.tsx +4 -6
- package/cli/registry/basic/combobox.tsx +133 -0
- package/cli/registry/basic/command.tsx +184 -0
- package/cli/registry/basic/context-menu.tsx +238 -0
- package/cli/registry/basic/data-table.tsx +73 -0
- package/cli/registry/basic/date-picker.tsx +84 -0
- package/cli/registry/basic/dialog.tsx +164 -0
- package/cli/registry/basic/direction.tsx +25 -0
- package/cli/registry/basic/drawer.tsx +162 -0
- package/cli/registry/basic/dropdown-menu.tsx +2 -7
- package/cli/registry/basic/empty.tsx +104 -0
- package/cli/registry/basic/field.tsx +248 -0
- package/cli/registry/basic/hover-card.tsx +57 -0
- package/cli/registry/basic/icon-button.tsx +18 -11
- package/cli/registry/basic/input-group.tsx +168 -0
- package/cli/registry/basic/input-otp.tsx +75 -0
- package/cli/registry/basic/input.tsx +43 -0
- package/cli/registry/basic/item.tsx +204 -0
- package/cli/registry/basic/label.tsx +24 -0
- package/cli/registry/basic/menubar.tsx +274 -0
- package/cli/registry/basic/native-select.tsx +62 -0
- package/cli/registry/basic/navigation-menu.tsx +168 -0
- package/cli/registry/basic/popover.tsx +58 -0
- package/cli/registry/basic/scroll-area.tsx +58 -0
- package/cli/registry/basic/select.tsx +24 -3
- package/cli/registry/basic/separator.tsx +26 -0
- package/cli/registry/basic/sheet.tsx +18 -0
- package/cli/registry/basic/spinner.tsx +20 -5
- package/cli/registry/basic/textarea.tsx +43 -0
- package/cli/registry/basic/toggle.tsx +1 -1
- package/cli/registry/basic/tooltip.tsx +2 -1
- package/cli/registry/basic/typography.tsx +1 -1
- package/cli/registry/chat/chat-input/chat-input-textarea.tsx +1 -1
- package/cli/registry/chat/chat-input/compound.tsx +4 -3
- package/cli/registry/chat/chat-input/context.tsx +4 -1
- package/cli/registry/chat/code-block-part.tsx +1 -1
- package/cli/registry/chat/conversation-anchor-nav.tsx +349 -0
- package/cli/registry/chat/file-attachment.tsx +2 -1
- package/cli/registry/chat/file-review-part.tsx +21 -21
- package/cli/registry/chat/markdown.tsx +2 -2
- package/cli/registry/chat/queue-indicator.tsx +1 -0
- package/cli/registry/chat/streaming-markdown-block.tsx +12 -8
- package/cli/registry/chat/tool-invocation-card.tsx +4 -1
- package/cli/registry/lib/file-icon-maps.ts +22 -22
- package/cli/registry/meta.json +600 -15
- package/cli/registry/tokens/ontology.json +404 -0
- package/cli/registry/tokens/scale/presets/compact.css +16 -5
- package/cli/registry/tokens/scale/presets/dense.css +13 -2
- package/cli/registry/tokens/scale/presets/sharp.css +18 -6
- package/cli/registry/tokens/scale/presets/soft.css +23 -1
- package/dist/registry/basic/alert-dialog.d.ts +1 -1
- package/dist/registry/basic/alert.d.ts +24 -0
- package/dist/registry/basic/aspect-ratio.d.ts +16 -0
- package/dist/registry/basic/avatar.d.ts +1 -1
- package/dist/registry/basic/breadcrumb.d.ts +24 -0
- package/dist/registry/basic/button-group.d.ts +26 -0
- package/dist/registry/basic/button.d.ts +3 -1
- package/dist/registry/basic/calendar.d.ts +22 -0
- package/dist/registry/basic/card.d.ts +32 -0
- package/dist/registry/basic/carousel.d.ts +19 -0
- package/dist/registry/basic/chart.d.ts +55 -0
- package/dist/registry/basic/checkbox.d.ts +21 -0
- package/dist/registry/basic/combobox.d.ts +37 -0
- package/dist/registry/basic/command.d.ts +18 -0
- package/dist/registry/basic/context-menu.d.ts +44 -0
- package/dist/registry/basic/data-table.d.ts +26 -0
- package/dist/registry/basic/date-picker.d.ts +27 -0
- package/dist/registry/basic/dialog.d.ts +39 -0
- package/dist/registry/basic/direction.d.ts +19 -0
- package/dist/registry/basic/drawer.d.ts +37 -0
- package/dist/registry/basic/empty.d.ts +22 -0
- package/dist/registry/basic/field.d.ts +24 -0
- package/dist/registry/basic/hover-card.d.ts +22 -0
- package/dist/registry/basic/icon-button.d.ts +2 -1
- package/dist/registry/basic/input-group.d.ts +29 -0
- package/dist/registry/basic/input-otp.d.ts +22 -0
- package/dist/registry/basic/input.d.ts +20 -0
- package/dist/registry/basic/item.d.ts +34 -0
- package/dist/registry/basic/label.d.ts +16 -0
- package/dist/registry/basic/menubar.d.ts +37 -0
- package/dist/registry/basic/native-select.d.ts +18 -0
- package/dist/registry/basic/navigation-menu.d.ts +25 -0
- package/dist/registry/basic/popover.d.ts +23 -0
- package/dist/registry/basic/resizable.d.ts +48 -48
- package/dist/registry/basic/scroll-area.d.ts +5 -0
- package/dist/registry/basic/select.d.ts +7 -2
- package/dist/registry/basic/separator.d.ts +16 -0
- package/dist/registry/basic/sheet.d.ts +13 -0
- package/dist/registry/basic/spinner.d.ts +6 -2
- package/dist/registry/basic/tag.d.ts +1 -1
- package/dist/registry/basic/textarea.d.ts +21 -0
- package/dist/registry/chat/chat-input/context.d.ts +3 -1
- package/dist/registry/chat/conversation-anchor-nav.d.ts +72 -0
- package/dist/registry/chat/tool-invocation-card.d.ts +2 -0
- package/dist/scale/computed.css +11 -0
- package/dist/scale/config.css +11 -0
- package/dist/scale/presets/compact.css +23 -5
- package/dist/scale/presets/dense.css +20 -2
- package/dist/scale/presets/sharp.css +25 -6
- package/dist/scale/presets/soft.css +30 -1
- package/dist/spark-design.cjs.js +37 -33
- package/dist/spark-design.es.js +10324 -8950
- package/dist/sparkdesign.css +1 -1
- package/dist/src/components/basic/Alert/index.d.ts +13 -0
- package/dist/src/components/basic/AspectRatio/index.d.ts +13 -0
- package/dist/src/components/basic/Breadcrumb/index.d.ts +12 -0
- package/dist/src/components/basic/ButtonGroup/index.d.ts +13 -0
- package/dist/src/components/basic/Calendar/index.d.ts +13 -0
- package/dist/src/components/basic/Card/index.d.ts +13 -0
- package/dist/src/components/basic/Carousel/index.d.ts +12 -0
- package/dist/src/components/basic/Chart/index.d.ts +13 -0
- package/dist/src/components/basic/Checkbox/index.d.ts +13 -0
- package/dist/src/components/basic/Combobox/index.d.ts +13 -0
- package/dist/src/components/basic/Command/index.d.ts +12 -0
- package/dist/src/components/basic/ContextMenu/index.d.ts +19 -0
- package/dist/src/components/basic/DataTable/index.d.ts +13 -0
- package/dist/src/components/basic/DatePicker/index.d.ts +13 -0
- package/dist/src/components/basic/Dialog/index.d.ts +16 -0
- package/dist/src/components/basic/Direction/index.d.ts +13 -0
- package/dist/src/components/basic/Drawer/index.d.ts +16 -0
- package/dist/src/components/basic/Empty/index.d.ts +12 -0
- package/dist/src/components/basic/Field/index.d.ts +12 -0
- package/dist/src/components/basic/HoverCard/index.d.ts +16 -0
- package/dist/src/components/basic/Input/index.d.ts +13 -0
- package/dist/src/components/basic/InputGroup/index.d.ts +12 -0
- package/dist/src/components/basic/InputOTP/index.d.ts +12 -0
- package/dist/src/components/basic/Item/index.d.ts +12 -0
- package/dist/src/components/basic/Label/index.d.ts +13 -0
- package/dist/src/components/basic/Menubar/index.d.ts +12 -0
- package/dist/src/components/basic/NativeSelect/index.d.ts +12 -0
- package/dist/src/components/basic/NavigationMenu/index.d.ts +12 -0
- package/dist/src/components/basic/Popover/index.d.ts +16 -0
- package/dist/src/components/basic/ScrollArea/index.d.ts +12 -0
- package/dist/src/components/basic/Separator/index.d.ts +13 -0
- package/dist/src/components/basic/Sheet/index.d.ts +13 -0
- package/dist/src/components/basic/Textarea/index.d.ts +13 -0
- package/dist/src/components/chat/ConversationAnchorNav/index.d.ts +13 -0
- package/dist/src/components/chat/StreamingMarkdownBlock/index.d.ts +13 -0
- package/dist/src/components/index.d.ts +58 -1
- package/dist/src/lib/index.d.ts +1 -1
- package/dist/src/lib/motion.d.ts +79 -0
- package/dist/theme-base.css +22 -0
- package/dist/themes/dark-mint.css +6 -0
- package/dist/themes/dark-parchment.css +6 -0
- package/dist/themes/light-parchment.css +6 -0
- package/dist/tokens/AGENTS.md +1 -0
- package/dist/tokens/scale/computed.css +11 -0
- package/dist/tokens/scale/config.css +11 -0
- package/dist/tokens/scale/presets/compact.css +23 -5
- package/dist/tokens/scale/presets/dense.css +20 -2
- package/dist/tokens/scale/presets/sharp.css +25 -6
- package/dist/tokens/scale/presets/soft.css +30 -1
- package/dist/tokens/theme-base.css +22 -0
- package/dist/tokens/themes/dark-mint.css +6 -0
- package/dist/tokens/themes/dark-parchment.css +6 -0
- package/dist/tokens/themes/light-parchment.css +6 -0
- package/docs/agent/component-selection.md +60 -0
- package/docs/agent/token-ontology.md +37 -0
- package/package.json +31 -5
- package/registry/agent-manifest.json +794 -0
- package/registry/tokens/ontology.json +404 -0
- package/dist/_basePickBy-DnQN8w3y.js +0 -151
- package/dist/_basePickBy-a-kPMlkg.cjs +0 -1
- package/dist/_baseUniq-B-N2NQ50.js +0 -614
- package/dist/_baseUniq-Cc_zbSif.cjs +0 -1
- package/dist/arc-BQBhijZ6.js +0 -83
- package/dist/arc-mWQt0Yph.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-BMZEucno.cjs +0 -36
- package/dist/architectureDiagram-VXUJARFQ-DTdjD3Bp.js +0 -4661
- package/dist/blockDiagram-VD42YOAC-CzHn0yob.js +0 -2256
- package/dist/blockDiagram-VD42YOAC-DDxdHAlz.cjs +0 -122
- package/dist/c4Diagram-YG6GDRKO-4Gz0I4gj.cjs +0 -10
- package/dist/c4Diagram-YG6GDRKO-BIy--yVN.js +0 -1580
- package/dist/channel-BQn0o8bs.js +0 -5
- package/dist/channel-DaN7XniJ.cjs +0 -1
- package/dist/chunk-4BX2VUAB-BlQFTQqz.cjs +0 -1
- package/dist/chunk-4BX2VUAB-Czitj3Kc.js +0 -8
- package/dist/chunk-55IACEB6-DXacNZbO.js +0 -8
- package/dist/chunk-55IACEB6-DnDxpye9.cjs +0 -1
- package/dist/chunk-B4BG7PRW-CBdN0q_V.js +0 -1375
- package/dist/chunk-B4BG7PRW-DbGvUkGO.cjs +0 -165
- package/dist/chunk-DI55MBZ5-D1YJMs6x.cjs +0 -220
- package/dist/chunk-DI55MBZ5-NCQTvayw.js +0 -1370
- package/dist/chunk-FMBD7UC4-CsGMbrtr.js +0 -19
- package/dist/chunk-FMBD7UC4-Di7cUUh5.cjs +0 -15
- package/dist/chunk-QN33PNHL-0j5LC8Lm.cjs +0 -1
- package/dist/chunk-QN33PNHL-3GERZBRm.js +0 -19
- package/dist/chunk-QZHKN3VN-AVEY9ImQ.js +0 -15
- package/dist/chunk-QZHKN3VN-s8Z0a8mc.cjs +0 -1
- package/dist/chunk-TZMSLE5B-CAf87HPt.cjs +0 -1
- package/dist/chunk-TZMSLE5B-sbiflal0.js +0 -64
- package/dist/classDiagram-2ON5EDUG-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-Dzfrft3a.js +0 -16
- package/dist/classDiagram-v2-WZHVMYZB-Ct9JLIN2.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-Dzfrft3a.js +0 -16
- package/dist/clone-Cde_NQ8V.js +0 -8
- package/dist/clone-DCNjWuM2.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-0uLijMro.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-Bb08N431.js +0 -2608
- package/dist/cytoscape.esm-CNUX3VTg.cjs +0 -321
- package/dist/cytoscape.esm-Cvf3sx9F.js +0 -18704
- package/dist/dagre-6UL2VRFP-CY_Wz5Zd.js +0 -444
- package/dist/dagre-6UL2VRFP-Dxe7_qZc.cjs +0 -4
- package/dist/defaultLocale-BgPVtth8.js +0 -171
- package/dist/defaultLocale-C4wbwF1n.cjs +0 -1
- package/dist/diagram-PSM6KHXK-D2bdb7MT.js +0 -531
- package/dist/diagram-PSM6KHXK-YF69SUjY.cjs +0 -24
- package/dist/diagram-QEK2KX5R-BpUSoh0-.js +0 -217
- package/dist/diagram-QEK2KX5R-DZPGteon.cjs +0 -43
- package/dist/diagram-S2PKOQOG-ht-zdvFG.cjs +0 -24
- package/dist/diagram-S2PKOQOG-zFeLJ50Z.js +0 -142
- package/dist/erDiagram-Q2GNP2WA-B38iJ6ts.js +0 -841
- package/dist/erDiagram-Q2GNP2WA-RgS80DDU.cjs +0 -60
- package/dist/flowDiagram-NV44I4VS-BHilOs2p.cjs +0 -162
- package/dist/flowDiagram-NV44I4VS-BrBJcoce.js +0 -1620
- package/dist/ganttDiagram-JELNMOA3-pZiJeFio.cjs +0 -267
- package/dist/ganttDiagram-JELNMOA3-tw6FhkWJ.js +0 -2670
- package/dist/gitGraphDiagram-V2S2FVAM-BWn5uIK5.js +0 -699
- package/dist/gitGraphDiagram-V2S2FVAM-DKKeG-9R.cjs +0 -65
- package/dist/graph-DIbblrZP.cjs +0 -1
- package/dist/graph-DPcK91G3.js +0 -247
- package/dist/infoDiagram-HS3SLOUP-B8gwwhct.cjs +0 -2
- package/dist/infoDiagram-HS3SLOUP-D47PNcP_.js +0 -24
- package/dist/init-CHZsXQcr.cjs +0 -1
- package/dist/init-DjUOC4st.js +0 -16
- package/dist/journeyDiagram-XKPGCS4Q-BG3cfhyU.js +0 -834
- package/dist/journeyDiagram-XKPGCS4Q-D8DVLJof.cjs +0 -139
- package/dist/kanban-definition-3W4ZIXB7-4OCnEouP.cjs +0 -89
- package/dist/kanban-definition-3W4ZIXB7-CWi_ssF9.js +0 -719
- package/dist/layout-Byuh8f-J.cjs +0 -1
- package/dist/layout-CdLdvj1j.js +0 -1335
- package/dist/linear-C2Q_PI9B.js +0 -259
- package/dist/linear-C69aPBW1.cjs +0 -1
- package/dist/mermaid.core-DBwAx_jp.cjs +0 -249
- package/dist/mermaid.core-gFR0XUlD.js +0 -15300
- package/dist/mindmap-definition-VGOIOE7T-8P7obVV4.cjs +0 -68
- package/dist/mindmap-definition-VGOIOE7T-DnOa7WJ9.js +0 -784
- package/dist/ordinal-B6-f3MAq.js +0 -61
- package/dist/ordinal-CagbB1m8.cjs +0 -1
- package/dist/pieDiagram-ADFJNKIX-5NAlvhMo.js +0 -161
- package/dist/pieDiagram-ADFJNKIX-CQBG4yR9.cjs +0 -30
- package/dist/quadrantDiagram-AYHSOK5B-Oe4y7RZ0.cjs +0 -7
- package/dist/quadrantDiagram-AYHSOK5B-rh2DPEP1.js +0 -1022
- package/dist/requirementDiagram-UZGBJVZJ-DcWaCuXr.js +0 -850
- package/dist/requirementDiagram-UZGBJVZJ-gfdlrFiq.cjs +0 -64
- package/dist/sankeyDiagram-TZEHDZUN-CQIKFwD0.js +0 -810
- package/dist/sankeyDiagram-TZEHDZUN-DvPtzQvC.cjs +0 -10
- package/dist/sequenceDiagram-WL72ISMW-BNrsMagL.cjs +0 -145
- package/dist/sequenceDiagram-WL72ISMW-iCX3ckKx.js +0 -2511
- package/dist/stateDiagram-FKZM4ZOC-DBvJ_eeL.cjs +0 -1
- package/dist/stateDiagram-FKZM4ZOC-ZVsJlaHJ.js +0 -263
- package/dist/stateDiagram-v2-4FDKWEC3-CB_nTHcE.js +0 -16
- package/dist/stateDiagram-v2-4FDKWEC3-Xkx17v6T.cjs +0 -1
- package/dist/timeline-definition-IT6M3QCI-BmGkYQiz.cjs +0 -61
- package/dist/timeline-definition-IT6M3QCI-Ck8zTt6w.js +0 -795
- package/dist/treemap-GDKQZRPO-B9sfERx8.js +0 -17922
- package/dist/treemap-GDKQZRPO-BVfJRs0Z.cjs +0 -160
- package/dist/xychartDiagram-PRI3JC2R-By_S8NzN.js +0 -1340
- package/dist/xychartDiagram-PRI3JC2R-CNfDrGxM.cjs +0 -7
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./chunk-DI55MBZ5-D1YJMs6x.cjs"),t=require("./mermaid.core-DBwAx_jp.cjs"),T=require("./graph-DIbblrZP.cjs"),H=require("./layout-Byuh8f-J.cjs");var z=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),L=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),P=t.__name((e,n)=>{const d=t.__name(function(c,m,y){const b=c.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);y||b.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,p=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(c){i||(d(p,c,r),r=!1),i=!1});const C=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),h=p.node().getBBox(),s=Math.max(h.width,o.width);return C.attr("x2",s+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",s+2*t.getConfig2().state.padding).attr("height",h.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),R=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),p=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),h=r.node().getBBox().width+o;let s=Math.max(h,p);s===p&&(s=s+o);let c;const m=e.node().getBBox();n.doc,c=i-g,h>p&&(c=(p-s)/2+g),Math.abs(i-m.x)<g&&h>p&&(c=i-(h-p)/2);const y=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",c).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",s).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",c+g),h<=p&&r.attr("x",i+(s-o)/2-h/2+g),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),W=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),G=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const i=p.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const C of i){const h=C.trim();if(h.length>0){const s=l.append("tspan");if(s.text(h),r===0){const c=s.node().getBBox();r+=c.height}o+=r,s.attr("x",n+t.getConfig2().state.noteMargin),s.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),U=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),k=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&z(o),n.type==="end"&&W(o),(n.type==="fork"||n.type==="join")&&G(o,n),n.type==="note"&&U(n.note.text,o),n.type==="divider"&&L(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&P(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),N=0,F=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case S.StateDB.relationType.AGGREGATION:return"aggregation";case S.StateDB.relationType.EXTENSION:return"extension";case S.StateDB.relationType.COMPOSITION:return"composition";case S.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=t.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(t.curveBasis),p=e.append("path").attr("d",l(o)).attr("id","edge"+N).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),p.attr("marker-end","url("+i+"#"+g(S.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:C,y:h}=t.utils_default.calcLabelPosition(n.points),s=t.common_default.getRows(d.title);let c=0;const m=[];let y=0,b=0;for(let x=0;x<=s.length;x++){const f=r.append("text").attr("text-anchor","middle").text(s[x]).attr("x",C).attr("y",h+c),u=f.node().getBBox();y=Math.max(y,u.width),b=Math.min(b,u.x),t.log.info(u.x,C,h+c),c===0&&(c=f.node().getBBox().height,t.log.info("Title height",c,h)),m.push(f)}let _=c*s.length;if(s.length>1){const x=(s.length-1)*c*.5;m.forEach((f,u)=>f.attr("y",h+u*c-x)),_=c*s.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",C-y/2-t.getConfig2().state.padding/2).attr("y",h-_/2-t.getConfig2().state.padding/2-3.5).attr("width",y+t.getConfig2().state.padding).attr("height",_+t.getConfig2().state.padding),t.log.info(a)}N++},"drawEdge"),w,E={},O=t.__name(function(){},"setConf"),q=t.__name(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")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const p=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=p.select(`[id='${n}']`);q(r);const C=g.db.getRootDoc();M(C,r,void 0,!1,p,i,g);const h=w.padding,s=r.node().getBBox(),c=s.width+h*2,m=s.height+h*2,y=c*1.75;t.configureSvgSize(r,m,y,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+c+" "+m)},"draw"),X=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),M=t.__name((e,n,d,g,o,l,p)=>{const i=new T.Graph({compound:!0,multigraph:!0});let r,C=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){C=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const h=p.db.getStates(),s=p.db.getRelations(),c=Object.keys(h);for(const a of c){const x=h[a];d&&(x.parentId=d);let f;if(x.doc){let u=n.append("g").attr("id",x.id).attr("class","stateGroup");f=M(x.doc,u,x.id,!g,o,l,p);{u=R(u,x,g);let B=u.node().getBBox();f.width=B.width,f.height=B.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=k(n,x,i);if(x.note){const u={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},B=k(n,u,i);x.note.position==="left of"?(i.setNode(f.id+"-note",B),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",B)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;s.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:X(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),H.layout(i),t.log.debug("Graph after layout",i.nodes());const y=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+y.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+y.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+y.id+" #"+a+" .divider").forEach(f=>{const u=f.parentElement;let B=0,v=0;u&&(u.parentElement&&(B=u.parentElement.getBBox().width),v=parseInt(u.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",B-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let b=y.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),F(n,i.edge(a),i.edge(a).relation))}),b=y.getBBox();const _={id:d||"root",label:d||"root",width:0,height:0};return _.width=b.width+2*w.padding,_.height=b.height+2*w.padding,t.log.debug("Doc rendered",_,i),_},"renderDoc"),I={setConf:O,draw:J},Y={parser:S.stateDiagram_default,get db(){return new S.StateDB(1)},renderer:I,styles:S.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=Y;
|
|
@@ -1,263 +0,0 @@
|
|
|
1
|
-
import { s as G, a as W, S as N } from "./chunk-DI55MBZ5-NCQTvayw.js";
|
|
2
|
-
import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./mermaid.core-gFR0XUlD.js";
|
|
3
|
-
import { G as O } from "./graph-DPcK91G3.js";
|
|
4
|
-
import { l as J } from "./layout-CdLdvj1j.js";
|
|
5
|
-
var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => {
|
|
6
|
-
const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
|
|
7
|
-
return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
|
|
8
|
-
}, "drawSimpleState"), I = /* @__PURE__ */ f((e, i) => {
|
|
9
|
-
const d = /* @__PURE__ */ f(function(g, m, B) {
|
|
10
|
-
const E = g.append("tspan").attr("x", 2 * t().state.padding).text(m);
|
|
11
|
-
B || E.attr("dy", t().state.textHeight);
|
|
12
|
-
}, "addTspan"), n = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 1.3 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.descriptions[0]).node().getBBox(), l = n.height, x = e.append("text").attr("x", t().state.padding).attr(
|
|
13
|
-
"y",
|
|
14
|
-
l + t().state.padding * 0.4 + t().state.dividerMargin + t().state.textHeight
|
|
15
|
-
).attr("class", "state-description");
|
|
16
|
-
let a = !0, s = !0;
|
|
17
|
-
i.descriptions.forEach(function(g) {
|
|
18
|
-
a || (d(x, g, s), s = !1), a = !1;
|
|
19
|
-
});
|
|
20
|
-
const w = e.append("line").attr("x1", t().state.padding).attr("y1", t().state.padding + l + t().state.dividerMargin / 2).attr("y2", t().state.padding + l + t().state.dividerMargin / 2).attr("class", "descr-divider"), p = x.node().getBBox(), o = Math.max(p.width, n.width);
|
|
21
|
-
return w.attr("x2", o + 3 * t().state.padding), e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", o + 2 * t().state.padding).attr("height", p.height + l + 2 * t().state.padding).attr("rx", t().state.radius), e;
|
|
22
|
-
}, "drawDescrState"), $ = /* @__PURE__ */ f((e, i, d) => {
|
|
23
|
-
const c = t().state.padding, n = 2 * t().state.padding, l = e.node().getBBox(), x = l.width, a = l.x, s = e.append("text").attr("x", 0).attr("y", t().state.titleShift).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), p = s.node().getBBox().width + n;
|
|
24
|
-
let o = Math.max(p, x);
|
|
25
|
-
o === x && (o = o + n);
|
|
26
|
-
let g;
|
|
27
|
-
const m = e.node().getBBox();
|
|
28
|
-
i.doc, g = a - c, p > x && (g = (x - o) / 2 + c), Math.abs(a - m.x) < c && p > x && (g = a - (p - x) / 2);
|
|
29
|
-
const B = 1 - t().state.textHeight;
|
|
30
|
-
return e.insert("rect", ":first-child").attr("x", g).attr("y", B).attr("class", d ? "alt-composit" : "composit").attr("width", o).attr(
|
|
31
|
-
"height",
|
|
32
|
-
m.height + t().state.textHeight + t().state.titleShift + 1
|
|
33
|
-
).attr("rx", "0"), s.attr("x", g + c), p <= x && s.attr("x", a + (o - n) / 2 - p / 2 + c), e.insert("rect", ":first-child").attr("x", g).attr(
|
|
34
|
-
"y",
|
|
35
|
-
t().state.titleShift - t().state.textHeight - t().state.padding
|
|
36
|
-
).attr("width", o).attr("height", t().state.textHeight * 3).attr("rx", t().state.radius), e.insert("rect", ":first-child").attr("x", g).attr(
|
|
37
|
-
"y",
|
|
38
|
-
t().state.titleShift - t().state.textHeight - t().state.padding
|
|
39
|
-
).attr("width", o).attr("height", m.height + 3 + 2 * t().state.textHeight).attr("rx", t().state.radius), e;
|
|
40
|
-
}, "addTitleAndBox"), q = /* @__PURE__ */ f((e) => (e.append("circle").attr("class", "end-state-outer").attr("r", t().state.sizeUnit + t().state.miniPadding).attr(
|
|
41
|
-
"cx",
|
|
42
|
-
t().state.padding + t().state.sizeUnit + t().state.miniPadding
|
|
43
|
-
).attr(
|
|
44
|
-
"cy",
|
|
45
|
-
t().state.padding + t().state.sizeUnit + t().state.miniPadding
|
|
46
|
-
), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), Z = /* @__PURE__ */ f((e, i) => {
|
|
47
|
-
let d = t().state.forkWidth, c = t().state.forkHeight;
|
|
48
|
-
if (i.parentId) {
|
|
49
|
-
let n = d;
|
|
50
|
-
d = c, c = n;
|
|
51
|
-
}
|
|
52
|
-
return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
|
|
53
|
-
}, "drawForkJoinState"), j = /* @__PURE__ */ f((e, i, d, c) => {
|
|
54
|
-
let n = 0;
|
|
55
|
-
const l = c.append("text");
|
|
56
|
-
l.style("text-anchor", "start"), l.attr("class", "noteText");
|
|
57
|
-
let x = e.replace(/\r\n/g, "<br/>");
|
|
58
|
-
x = x.replace(/\n/g, "<br/>");
|
|
59
|
-
const a = x.split(z.lineBreakRegex);
|
|
60
|
-
let s = 1.25 * t().state.noteMargin;
|
|
61
|
-
for (const w of a) {
|
|
62
|
-
const p = w.trim();
|
|
63
|
-
if (p.length > 0) {
|
|
64
|
-
const o = l.append("tspan");
|
|
65
|
-
if (o.text(p), s === 0) {
|
|
66
|
-
const g = o.node().getBBox();
|
|
67
|
-
s += g.height;
|
|
68
|
-
}
|
|
69
|
-
n += s, o.attr("x", i + t().state.noteMargin), o.attr("y", d + n + 1.25 * t().state.noteMargin);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return { textWidth: l.node().getBBox().width, textHeight: n };
|
|
73
|
-
}, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => {
|
|
74
|
-
i.attr("class", "state-note");
|
|
75
|
-
const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = j(e, 0, 0, c);
|
|
76
|
-
return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
|
|
77
|
-
}, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
|
|
78
|
-
const d = i.id, c = {
|
|
79
|
-
id: d,
|
|
80
|
-
label: i.id,
|
|
81
|
-
width: 0,
|
|
82
|
-
height: 0
|
|
83
|
-
}, n = e.append("g").attr("id", d).attr("class", "stateGroup");
|
|
84
|
-
i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") && Z(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && D(n), i.type === "default" && i.descriptions.length === 0 && Y(n, i), i.type === "default" && i.descriptions.length > 0 && I(n, i);
|
|
85
|
-
const l = n.node().getBBox();
|
|
86
|
-
return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
|
|
87
|
-
}, "drawState"), R = 0, Q = /* @__PURE__ */ f(function(e, i, d) {
|
|
88
|
-
const c = /* @__PURE__ */ f(function(s) {
|
|
89
|
-
switch (s) {
|
|
90
|
-
case N.relationType.AGGREGATION:
|
|
91
|
-
return "aggregation";
|
|
92
|
-
case N.relationType.EXTENSION:
|
|
93
|
-
return "extension";
|
|
94
|
-
case N.relationType.COMPOSITION:
|
|
95
|
-
return "composition";
|
|
96
|
-
case N.relationType.DEPENDENCY:
|
|
97
|
-
return "dependency";
|
|
98
|
-
}
|
|
99
|
-
}, "getRelationType");
|
|
100
|
-
i.points = i.points.filter((s) => !Number.isNaN(s.y));
|
|
101
|
-
const n = i.points, l = _().x(function(s) {
|
|
102
|
-
return s.x;
|
|
103
|
-
}).y(function(s) {
|
|
104
|
-
return s.y;
|
|
105
|
-
}).curve(U), x = e.append("path").attr("d", l(n)).attr("id", "edge" + R).attr("class", "transition");
|
|
106
|
-
let a = "";
|
|
107
|
-
if (t().state.arrowMarkerAbsolute && (a = C(!0)), x.attr(
|
|
108
|
-
"marker-end",
|
|
109
|
-
"url(" + a + "#" + c(N.relationType.DEPENDENCY) + "End)"
|
|
110
|
-
), d.title !== void 0) {
|
|
111
|
-
const s = e.append("g").attr("class", "stateLabel"), { x: w, y: p } = F.calcLabelPosition(i.points), o = z.getRows(d.title);
|
|
112
|
-
let g = 0;
|
|
113
|
-
const m = [];
|
|
114
|
-
let B = 0, E = 0;
|
|
115
|
-
for (let u = 0; u <= o.length; u++) {
|
|
116
|
-
const h = s.append("text").attr("text-anchor", "middle").text(o[u]).attr("x", w).attr("y", p + g), y = h.node().getBBox();
|
|
117
|
-
B = Math.max(B, y.width), E = Math.min(E, y.x), S.info(y.x, w, p + g), g === 0 && (g = h.node().getBBox().height, S.info("Title height", g, p)), m.push(h);
|
|
118
|
-
}
|
|
119
|
-
let k = g * o.length;
|
|
120
|
-
if (o.length > 1) {
|
|
121
|
-
const u = (o.length - 1) * g * 0.5;
|
|
122
|
-
m.forEach((h, y) => h.attr("y", p + y * g - u)), k = g * o.length;
|
|
123
|
-
}
|
|
124
|
-
const r = s.node().getBBox();
|
|
125
|
-
s.insert("rect", ":first-child").attr("class", "box").attr("x", w - B / 2 - t().state.padding / 2).attr("y", p - k / 2 - t().state.padding / 2 - 3.5).attr("width", B + t().state.padding).attr("height", k + t().state.padding), S.info(r);
|
|
126
|
-
}
|
|
127
|
-
R++;
|
|
128
|
-
}, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {
|
|
129
|
-
}, "setConf"), tt = /* @__PURE__ */ f(function(e) {
|
|
130
|
-
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");
|
|
131
|
-
}, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
|
|
132
|
-
b = t().state;
|
|
133
|
-
const n = t().securityLevel;
|
|
134
|
-
let l;
|
|
135
|
-
n === "sandbox" && (l = H("#i" + i));
|
|
136
|
-
const x = n === "sandbox" ? H(l.nodes()[0].contentDocument.body) : H("body"), a = n === "sandbox" ? l.nodes()[0].contentDocument : document;
|
|
137
|
-
S.debug("Rendering diagram " + e);
|
|
138
|
-
const s = x.select(`[id='${i}']`);
|
|
139
|
-
tt(s);
|
|
140
|
-
const w = c.db.getRootDoc();
|
|
141
|
-
A(w, s, void 0, !1, x, a, c);
|
|
142
|
-
const p = b.padding, o = s.node().getBBox(), g = o.width + p * 2, m = o.height + p * 2, B = g * 1.75;
|
|
143
|
-
P(s, m, B, b.useMaxWidth), s.attr(
|
|
144
|
-
"viewBox",
|
|
145
|
-
`${o.x - b.padding} ${o.y - b.padding} ` + g + " " + m
|
|
146
|
-
);
|
|
147
|
-
}, "draw"), at = /* @__PURE__ */ f((e) => e ? e.length * b.fontSizeFactor : 1, "getLabelWidth"), A = /* @__PURE__ */ f((e, i, d, c, n, l, x) => {
|
|
148
|
-
const a = new O({
|
|
149
|
-
compound: !0,
|
|
150
|
-
multigraph: !0
|
|
151
|
-
});
|
|
152
|
-
let s, w = !0;
|
|
153
|
-
for (s = 0; s < e.length; s++)
|
|
154
|
-
if (e[s].stmt === "relation") {
|
|
155
|
-
w = !1;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
d ? a.setGraph({
|
|
159
|
-
rankdir: "LR",
|
|
160
|
-
multigraph: !0,
|
|
161
|
-
compound: !0,
|
|
162
|
-
// acyclicer: 'greedy',
|
|
163
|
-
ranker: "tight-tree",
|
|
164
|
-
ranksep: w ? 1 : b.edgeLengthFactor,
|
|
165
|
-
nodeSep: w ? 1 : 50,
|
|
166
|
-
isMultiGraph: !0
|
|
167
|
-
// ranksep: 5,
|
|
168
|
-
// nodesep: 1
|
|
169
|
-
}) : a.setGraph({
|
|
170
|
-
rankdir: "TB",
|
|
171
|
-
multigraph: !0,
|
|
172
|
-
compound: !0,
|
|
173
|
-
// isCompound: true,
|
|
174
|
-
// acyclicer: 'greedy',
|
|
175
|
-
// ranker: 'longest-path'
|
|
176
|
-
ranksep: w ? 1 : b.edgeLengthFactor,
|
|
177
|
-
nodeSep: w ? 1 : 50,
|
|
178
|
-
ranker: "tight-tree",
|
|
179
|
-
// ranker: 'network-simplex'
|
|
180
|
-
isMultiGraph: !0
|
|
181
|
-
}), a.setDefaultEdgeLabel(function() {
|
|
182
|
-
return {};
|
|
183
|
-
});
|
|
184
|
-
const p = x.db.getStates(), o = x.db.getRelations(), g = Object.keys(p);
|
|
185
|
-
for (const r of g) {
|
|
186
|
-
const u = p[r];
|
|
187
|
-
d && (u.parentId = d);
|
|
188
|
-
let h;
|
|
189
|
-
if (u.doc) {
|
|
190
|
-
let y = i.append("g").attr("id", u.id).attr("class", "stateGroup");
|
|
191
|
-
h = A(u.doc, y, u.id, !c, n, l, x);
|
|
192
|
-
{
|
|
193
|
-
y = $(y, u, c);
|
|
194
|
-
let v = y.node().getBBox();
|
|
195
|
-
h.width = v.width, h.height = v.height + b.padding / 2, T[u.id] = { y: b.compositTitleSize };
|
|
196
|
-
}
|
|
197
|
-
} else
|
|
198
|
-
h = L(i, u, a);
|
|
199
|
-
if (u.note) {
|
|
200
|
-
const y = {
|
|
201
|
-
descriptions: [],
|
|
202
|
-
id: u.id + "-note",
|
|
203
|
-
note: u.note,
|
|
204
|
-
type: "note"
|
|
205
|
-
}, v = L(i, y, a);
|
|
206
|
-
u.note.position === "left of" ? (a.setNode(h.id + "-note", v), a.setNode(h.id, h)) : (a.setNode(h.id, h), a.setNode(h.id + "-note", v)), a.setParent(h.id, h.id + "-group"), a.setParent(h.id + "-note", h.id + "-group");
|
|
207
|
-
} else
|
|
208
|
-
a.setNode(h.id, h);
|
|
209
|
-
}
|
|
210
|
-
S.debug("Count=", a.nodeCount(), a);
|
|
211
|
-
let m = 0;
|
|
212
|
-
o.forEach(function(r) {
|
|
213
|
-
m++, S.debug("Setting edge", r), a.setEdge(
|
|
214
|
-
r.id1,
|
|
215
|
-
r.id2,
|
|
216
|
-
{
|
|
217
|
-
relation: r,
|
|
218
|
-
width: at(r.title),
|
|
219
|
-
height: b.labelHeight * z.getRows(r.title).length,
|
|
220
|
-
labelpos: "c"
|
|
221
|
-
},
|
|
222
|
-
"id" + m
|
|
223
|
-
);
|
|
224
|
-
}), J(a), S.debug("Graph after layout", a.nodes());
|
|
225
|
-
const B = i.node();
|
|
226
|
-
a.nodes().forEach(function(r) {
|
|
227
|
-
r !== void 0 && a.node(r) !== void 0 ? (S.warn("Node " + r + ": " + JSON.stringify(a.node(r))), n.select("#" + B.id + " #" + r).attr(
|
|
228
|
-
"transform",
|
|
229
|
-
"translate(" + (a.node(r).x - a.node(r).width / 2) + "," + (a.node(r).y + (T[r] ? T[r].y : 0) - a.node(r).height / 2) + " )"
|
|
230
|
-
), n.select("#" + B.id + " #" + r).attr("data-x-shift", a.node(r).x - a.node(r).width / 2), l.querySelectorAll("#" + B.id + " #" + r + " .divider").forEach((h) => {
|
|
231
|
-
const y = h.parentElement;
|
|
232
|
-
let v = 0, M = 0;
|
|
233
|
-
y && (y.parentElement && (v = y.parentElement.getBBox().width), M = parseInt(y.getAttribute("data-x-shift"), 10), Number.isNaN(M) && (M = 0)), h.setAttribute("x1", 0 - M + 8), h.setAttribute("x2", v - M - 8);
|
|
234
|
-
})) : S.debug("No Node " + r + ": " + JSON.stringify(a.node(r)));
|
|
235
|
-
});
|
|
236
|
-
let E = B.getBBox();
|
|
237
|
-
a.edges().forEach(function(r) {
|
|
238
|
-
r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation));
|
|
239
|
-
}), E = B.getBBox();
|
|
240
|
-
const k = {
|
|
241
|
-
id: d || "root",
|
|
242
|
-
label: d || "root",
|
|
243
|
-
width: 0,
|
|
244
|
-
height: 0
|
|
245
|
-
};
|
|
246
|
-
return k.width = E.width + 2 * b.padding, k.height = E.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
|
|
247
|
-
}, "renderDoc"), it = {
|
|
248
|
-
setConf: V,
|
|
249
|
-
draw: et
|
|
250
|
-
}, ot = {
|
|
251
|
-
parser: W,
|
|
252
|
-
get db() {
|
|
253
|
-
return new N(1);
|
|
254
|
-
},
|
|
255
|
-
renderer: it,
|
|
256
|
-
styles: G,
|
|
257
|
-
init: /* @__PURE__ */ f((e) => {
|
|
258
|
-
e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
259
|
-
}, "init")
|
|
260
|
-
};
|
|
261
|
-
export {
|
|
262
|
-
ot as diagram
|
|
263
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { s as a, b as t, a as r, S as s } from "./chunk-DI55MBZ5-NCQTvayw.js";
|
|
2
|
-
import { _ as i } from "./mermaid.core-gFR0XUlD.js";
|
|
3
|
-
var _ = {
|
|
4
|
-
parser: r,
|
|
5
|
-
get db() {
|
|
6
|
-
return new s(2);
|
|
7
|
-
},
|
|
8
|
-
renderer: t,
|
|
9
|
-
styles: a,
|
|
10
|
-
init: /* @__PURE__ */ i((e) => {
|
|
11
|
-
e.state || (e.state = {}), e.state.arrowMarkerAbsolute = e.arrowMarkerAbsolute;
|
|
12
|
-
}, "init")
|
|
13
|
-
};
|
|
14
|
-
export {
|
|
15
|
-
_ as diagram
|
|
16
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./chunk-DI55MBZ5-D1YJMs6x.cjs"),t=require("./mermaid.core-DBwAx_jp.cjs");var a={parser:r.stateDiagram_default,get db(){return new r.StateDB(2)},renderer:r.stateRenderer_v3_unified_default,styles:r.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=a;
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./mermaid.core-DBwAx_jp.cjs"),tt=require("./arc-mWQt0Yph.cjs");var J=(function(){var r=n.__name(function(m,s,a,c){for(a=a||{},c=m.length;c--;a[m[c]]=s);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],i=[1,11],d=[1,12],h=[1,13],_=[1,16],f=[1,17],p={trace:n.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline: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,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",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",20:"period",21:"event"},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,1],[9,1],[18,1],[19,1]],performAction:n.__name(function(s,a,c,u,g,o,w){var k=o.length-1;switch(g){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.getCommonDb().setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.getCommonDb().setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 15:u.addTask(o[k],0,""),this.$=o[k];break;case 16:u.addEvent(o[k].substr(2)),this.$=o[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},r(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:_,21:f},r(t,[2,7],{1:[2,1]}),r(t,[2,3]),{9:18,11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:_,21:f},r(t,[2,5]),r(t,[2,6]),r(t,[2,8]),{13:[1,19]},{15:[1,20]},r(t,[2,11]),r(t,[2,12]),r(t,[2,13]),r(t,[2,14]),r(t,[2,15]),r(t,[2,16]),r(t,[2,4]),r(t,[2,9]),r(t,[2,10])],defaultActions:{},parseError:n.__name(function(s,a){if(a.recoverable)this.trace(s);else{var c=new Error(s);throw c.hash=a,c}},"parseError"),parse:n.__name(function(s){var a=this,c=[0],u=[],g=[null],o=[],w=this.table,k="",I=0,H=0,z=2,G=1,M=o.slice.call(arguments,1),y=Object.create(this.lexer),b={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(b.yy[N]=this.yy[N]);y.setInput(s,b.yy),b.yy.lexer=y,b.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var $=y.yylloc;o.push($);var V=y.options&&y.options.ranges;typeof b.yy.parseError=="function"?this.parseError=b.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function q(E){c.length=c.length-2*E,g.length=g.length-E,o.length=o.length-E}n.__name(q,"popStack");function Y(){var E;return E=u.pop()||y.lex()||G,typeof E!="number"&&(E instanceof Array&&(u=E,E=u.pop()),E=a.symbols_[E]||E),E}n.__name(Y,"lex");for(var S,P,T,U,C={},W,L,D,B;;){if(P=c[c.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((S===null||typeof S>"u")&&(S=Y()),T=w[P]&&w[P][S]),typeof T>"u"||!T.length||!T[0]){var Z="";B=[];for(W in w[P])this.terminals_[W]&&W>z&&B.push("'"+this.terminals_[W]+"'");y.showPosition?Z="Parse error on line "+(I+1)+`:
|
|
2
|
-
`+y.showPosition()+`
|
|
3
|
-
Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on line "+(I+1)+": Unexpected "+(S==G?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Z,{text:y.match,token:this.terminals_[S]||S,line:y.yylineno,loc:$,expected:B})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+S);switch(T[0]){case 1:c.push(S),g.push(y.yytext),o.push(y.yylloc),c.push(T[1]),S=null,H=y.yyleng,k=y.yytext,I=y.yylineno,$=y.yylloc;break;case 2:if(L=this.productions_[T[1]][1],C.$=g[g.length-L],C._$={first_line:o[o.length-(L||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(L||1)].first_column,last_column:o[o.length-1].last_column},V&&(C._$.range=[o[o.length-(L||1)].range[0],o[o.length-1].range[1]]),U=this.performAction.apply(C,[k,H,I,b.yy,T[1],g,o].concat(M)),typeof U<"u")return U;L&&(c=c.slice(0,-1*L*2),g=g.slice(0,-1*L),o=o.slice(0,-1*L)),c.push(this.productions_[T[1]][0]),g.push(C.$),o.push(C._$),D=w[c[c.length-2]][c[c.length-1]],c.push(D);break;case 3:return!0}}return!0},"parse")},x=(function(){var m={EOF:1,parseError:n.__name(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:n.__name(function(s,a){return this.yy=a||this.yy||{},this._input=s,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},"setInput"),input:n.__name(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:n.__name(function(s){var a=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;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),c.length-1&&(this.yylineno-=c.length-1);var g=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:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(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},"reject"),less:n.__name(function(s){this.unput(this.match.slice(s))},"less"),pastInput:n.__name(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n.__name(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
|
-
`+a+"^"},"showPosition"),test_match:n.__name(function(s,a){var c,u,g;if(this.options.backtrack_lexer&&(g={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&&(g.yylloc.range=this.yylloc.range.slice(0))),u=s[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+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var o in g)this[o]=g[o];return!1}return!1},"test_match"),next:n.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,c,u;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),o=0;o<g.length;o++)if(c=this._input.match(this.rules[g[o]]),c&&(!a||c[0].length>a[0].length)){if(a=c,u=o,this.options.backtrack_lexer){if(s=this.test_match(c,g[o]),s!==!1)return s;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(s=this.test_match(a,g[u]),s!==!1?s:!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})},"next"),lex:n.__name(function(){var a=this.next();return a||this.lex()},"lex"),begin:n.__name(function(a){this.conditionStack.push(a)},"begin"),popState:n.__name(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n.__name(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:n.__name(function(a){this.begin(a)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n.__name(function(a,c,u,g){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 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\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,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/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],inclusive:!0}}};return m})();p.lexer=x;function v(){this.yy={}}return n.__name(v,"Parser"),v.prototype=p,p.Parser=v,new v})();J.parser=J;var _t=J,it={};n.__export(it,{addEvent:()=>ut,addSection:()=>ot,addTask:()=>dt,addTaskOrg:()=>pt,clear:()=>lt,default:()=>ft,getCommonDb:()=>at,getSections:()=>ct,getTasks:()=>ht});var R="",st=0,K=[],O=[],F=[],at=n.__name(()=>n.commonDb_exports,"getCommonDb"),lt=n.__name(function(){K.length=0,O.length=0,R="",F.length=0,n.clear()},"clear"),ot=n.__name(function(r){R=r,K.push(r)},"addSection"),ct=n.__name(function(){return K},"getSections"),ht=n.__name(function(){let r=et();const t=100;let e=0;for(;!r&&e<t;)r=et(),e++;return O.push(...F),O},"getTasks"),dt=n.__name(function(r,t,e){const l={id:st++,section:R,type:R,task:r,score:t||0,events:e?[e]:[]};F.push(l)},"addTask"),ut=n.__name(function(r){F.find(e=>e.id===st-1).events.push(r)},"addEvent"),pt=n.__name(function(r){const t={section:R,type:R,description:r,task:r,classes:[]};O.push(t)},"addTaskOrg"),et=n.__name(function(){const r=n.__name(function(e){return F[e].processed},"compileTask");let t=!0;for(const[e,l]of F.entries())r(e),t=t&&l.processed;return t},"compileTasks"),ft={clear:lt,getCommonDb:at,addSection:ot,getSections:ct,getTasks:ht,addTask:dt,addTaskOrg:pt,addEvent:ut},mt=12,j=n.__name(function(r,t){const e=r.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),xt=n.__name(function(r,t){const l=r.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=r.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function d(f){const p=tt.d3arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}n.__name(d,"smile");function h(f){const p=tt.d3arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}n.__name(h,"sad");function _(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return n.__name(_,"ambivalent"),t.score>3?d(i):t.score<3?h(i):_(i),l},"drawFace"),kt=n.__name(function(r,t){const e=r.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),gt=n.__name(function(r,t){const e=t.text.replace(/<br\s*\/?>/gi," "),l=r.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);const i=l.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(e),l},"drawText"),vt=n.__name(function(r,t){function e(i,d,h,_,f){return i+","+d+" "+(i+h)+","+d+" "+(i+h)+","+(d+_-f)+" "+(i+h-f*1.2)+","+(d+_)+" "+i+","+(d+_)}n.__name(e,"genPoints");const l=r.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,gt(r,t)},"drawLabel"),bt=n.__name(function(r,t,e){const l=r.append("g"),i=Q();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=e.width,i.height=e.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,j(l,i),yt(e)(t.text,l,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),nt=-1,wt=n.__name(function(r,t,e){const l=t.x+e.width/2,i=r.append("g");nt++,i.append("line").attr("id","task"+nt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),xt(i,{cx:l,cy:300+(5-t.score)*30,score:t.score});const h=Q();h.x=t.x,h.y=t.y,h.fill=t.fill,h.width=e.width,h.height=e.height,h.class="task task-type-"+t.num,h.rx=3,h.ry=3,j(i,h),yt(e)(t.task,i,h.x,h.y,h.width,h.height,{class:"task"},e,t.colour)},"drawTask"),St=n.__name(function(r,t){j(r,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Et=n.__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Q=n.__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),yt=(function(){function r(i,d,h,_,f,p,x,v){const m=d.append("text").attr("x",h+f/2).attr("y",_+p/2+5).style("font-color",v).style("text-anchor","middle").text(i);l(m,x)}n.__name(r,"byText");function t(i,d,h,_,f,p,x,v,m){const{taskFontSize:s,taskFontFamily:a}=v,c=i.split(/<br\s*\/?>/gi);for(let u=0;u<c.length;u++){const g=u*s-s*(c.length-1)/2,o=d.append("text").attr("x",h+f/2).attr("y",_).attr("fill",m).style("text-anchor","middle").style("font-size",s).style("font-family",a);o.append("tspan").attr("x",h+f/2).attr("dy",g).text(c[u]),o.attr("y",_+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(o,x)}}n.__name(t,"byTspan");function e(i,d,h,_,f,p,x,v){const m=d.append("switch"),a=m.append("foreignObject").attr("x",h).attr("y",_).attr("width",f).attr("height",p).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(i),t(i,m,h,_,f,p,x,v),l(a,x)}n.__name(e,"byFo");function l(i,d){for(const h in d)h in d&&i.attr(h,d[h])}return n.__name(l,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?e:i.textPlacement==="old"?r:t}})(),Tt=n.__name(function(r){r.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")},"initGraphics");function X(r,t){r.each(function(){var e=n.select(this),l=e.text().split(/(\s+|<br>)/).reverse(),i,d=[],h=1.1,_=e.attr("y"),f=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",_).attr("dy",f+"em");for(let x=0;x<l.length;x++)i=l[l.length-1-x],d.push(i),p.text(d.join(" ").trim()),(p.node().getComputedTextLength()>t||i==="<br>")&&(d.pop(),p.text(d.join(" ").trim()),i==="<br>"?d=[""]:d=[i],p=e.append("tspan").attr("x",0).attr("y",_).attr("dy",h+"em").text(i))})}n.__name(X,"wrap");var It=n.__name(function(r,t,e,l){const i=e%mt-1,d=r.append("g");t.section=i,d.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+i));const h=d.append("g"),_=d.append("g"),p=_.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),x=l.fontSize?.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+x*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,_.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),$t(h,t,i,l),t},"drawNode"),Nt=n.__name(function(r,t,e){const l=r.append("g"),d=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),h=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),d.height+h*1.1*.5+t.padding},"getVirtualNodeHeight"),$t=n.__name(function(r,t,e){r.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),r.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),A={drawRect:j,drawCircle:kt,drawSection:bt,drawText:gt,drawLabel:vt,drawTask:wt,drawBackgroundRect:St,getTextObj:Et,getNoteRect:Q,initGraphics:Tt,drawNode:It,getVirtualNodeHeight:Nt},Lt=n.__name(function(r,t,e,l){const i=n.getConfig2(),d=i.timeline?.leftMargin??50;n.log.debug("timeline",l.db);const h=i.securityLevel;let _;h==="sandbox"&&(_=n.select("#i"+t));const p=(h==="sandbox"?n.select(_.nodes()[0].contentDocument.body):n.select("body")).select("#"+t);p.append("g");const x=l.db.getTasks(),v=l.db.getCommonDb().getDiagramTitle();n.log.debug("task",x),A.initGraphics(p);const m=l.db.getSections();n.log.debug("sections",m);let s=0,a=0,c=0,u=0,g=50+d,o=50;u=50;let w=0,k=!0;m.forEach(function(M){const y={number:w,descr:M,section:w,width:150,padding:20,maxHeight:s},b=A.getVirtualNodeHeight(p,y,i);n.log.debug("sectionHeight before draw",b),s=Math.max(s,b+20)});let I=0,H=0;n.log.debug("tasks.length",x.length);for(const[M,y]of x.entries()){const b={number:M,descr:y,section:y.section,width:150,padding:20,maxHeight:a},N=A.getVirtualNodeHeight(p,b,i);n.log.debug("taskHeight before draw",N),a=Math.max(a,N+20),I=Math.max(I,y.events.length);let $=0;for(const V of y.events){const q={descr:V,section:y.section,number:y.section,width:150,padding:20,maxHeight:50};$+=A.getVirtualNodeHeight(p,q,i)}y.events.length>0&&($+=(y.events.length-1)*10),H=Math.max(H,$)}n.log.debug("maxSectionHeight before draw",s),n.log.debug("maxTaskHeight before draw",a),m&&m.length>0?m.forEach(M=>{const y=x.filter(V=>V.section===M),b={number:w,descr:M,section:w,width:200*Math.max(y.length,1)-50,padding:20,maxHeight:s};n.log.debug("sectionNode",b);const N=p.append("g"),$=A.drawNode(N,b,w,i);n.log.debug("sectionNode output",$),N.attr("transform",`translate(${g}, ${u})`),o+=s+50,y.length>0&&rt(p,y,w,g,o,a,i,I,H,s,!1),g+=200*Math.max(y.length,1),o=u,w++}):(k=!1,rt(p,x,w,g,o,a,i,I,H,s,!0));const z=p.node().getBBox();n.log.debug("bounds",z),v&&p.append("text").text(v).attr("x",z.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=k?s+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",c).attr("x2",z.width+3*d).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n.setupGraphViewbox(void 0,p,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),rt=n.__name(function(r,t,e,l,i,d,h,_,f,p,x){for(const v of t){const m={descr:v.task,section:e,number:e,width:150,padding:20,maxHeight:d};n.log.debug("taskNode",m);const s=r.append("g").attr("class","taskWrapper"),c=A.drawNode(s,m,e,h).height;if(n.log.debug("taskHeight after draw",c),s.attr("transform",`translate(${l}, ${i})`),d=Math.max(d,c),v.events){const u=r.append("g").attr("class","lineWrapper");let g=d;i+=100,g=g+Mt(r,v.events,e,l,i,h),i-=100,u.append("line").attr("x1",l+190/2).attr("y1",i+d).attr("x2",l+190/2).attr("y2",i+d+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,x&&!h.timeline?.disableMulticolor&&e++}i=i-10},"drawTasks"),Mt=n.__name(function(r,t,e,l,i,d){let h=0;const _=i;i=i+100;for(const f of t){const p={descr:f,section:e,number:e,width:150,padding:20,maxHeight:50};n.log.debug("eventNode",p);const x=r.append("g").attr("class","eventWrapper"),m=A.drawNode(x,p,e,d).height;h=h+m,x.attr("transform",`translate(${l}, ${i})`),i=i+10+m}return i=_,h},"drawEvents"),Ht={setConf:n.__name(()=>{},"setConf"),draw:Lt},Pt=n.__name(r=>{let t="";for(let e=0;e<r.THEME_COLOR_LIMIT;e++)r["lineColor"+e]=r["lineColor"+e]||r["cScaleInv"+e],n.isDark(r["lineColor"+e])?r["lineColor"+e]=n.lighten(r["lineColor"+e],20):r["lineColor"+e]=n.darken(r["lineColor"+e],20);for(let e=0;e<r.THEME_COLOR_LIMIT;e++){const l=""+(17-3*e);t+=`
|
|
7
|
-
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
8
|
-
fill: ${r["cScale"+e]};
|
|
9
|
-
}
|
|
10
|
-
.section-${e-1} text {
|
|
11
|
-
fill: ${r["cScaleLabel"+e]};
|
|
12
|
-
}
|
|
13
|
-
.node-icon-${e-1} {
|
|
14
|
-
font-size: 40px;
|
|
15
|
-
color: ${r["cScaleLabel"+e]};
|
|
16
|
-
}
|
|
17
|
-
.section-edge-${e-1}{
|
|
18
|
-
stroke: ${r["cScale"+e]};
|
|
19
|
-
}
|
|
20
|
-
.edge-depth-${e-1}{
|
|
21
|
-
stroke-width: ${l};
|
|
22
|
-
}
|
|
23
|
-
.section-${e-1} line {
|
|
24
|
-
stroke: ${r["cScaleInv"+e]} ;
|
|
25
|
-
stroke-width: 3;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.lineWrapper line{
|
|
29
|
-
stroke: ${r["cScaleLabel"+e]} ;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.disabled, .disabled circle, .disabled text {
|
|
33
|
-
fill: lightgray;
|
|
34
|
-
}
|
|
35
|
-
.disabled text {
|
|
36
|
-
fill: #efefef;
|
|
37
|
-
}
|
|
38
|
-
`}return t},"genSections"),At=n.__name(r=>`
|
|
39
|
-
.edge {
|
|
40
|
-
stroke-width: 3;
|
|
41
|
-
}
|
|
42
|
-
${Pt(r)}
|
|
43
|
-
.section-root rect, .section-root path, .section-root circle {
|
|
44
|
-
fill: ${r.git0};
|
|
45
|
-
}
|
|
46
|
-
.section-root text {
|
|
47
|
-
fill: ${r.gitBranchLabel0};
|
|
48
|
-
}
|
|
49
|
-
.icon-container {
|
|
50
|
-
height:100%;
|
|
51
|
-
display: flex;
|
|
52
|
-
justify-content: center;
|
|
53
|
-
align-items: center;
|
|
54
|
-
}
|
|
55
|
-
.edge {
|
|
56
|
-
fill: none;
|
|
57
|
-
}
|
|
58
|
-
.eventWrapper {
|
|
59
|
-
filter: brightness(120%);
|
|
60
|
-
}
|
|
61
|
-
`,"getStyles"),Ct=At,Rt={db:it,renderer:Ht,parser:_t,styles:Ct};exports.diagram=Rt;
|