frayui 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/README.md +52 -174
  2. package/dist/dev-child.js +24 -5
  3. package/dist/frayui.js +8 -8
  4. package/package.json +27 -8
  5. package/runtime/cc-worker/DECISIONS.md +14 -14
  6. package/runtime/cc-worker/bin/fray +4 -4
  7. package/runtime/cc-worker/bin/fray-update +4 -4
  8. package/runtime/cc-worker/hooks/session-seed.mjs +1 -1
  9. package/runtime/cc-worker/scripts/fray/agent-bindings.mjs +3 -3
  10. package/runtime/cc-worker/scripts/fray/config.mjs +8 -8
  11. package/runtime/cc-worker/skills/gh/SKILL.md +22 -0
  12. package/web-dist/assets/{TerminalPane-fMGrgB-a.js → TerminalPane-DyK0ncN8.js} +1 -1
  13. package/web-dist/assets/{abnfDiagram-VRR7QNED-BtlrDuYX.js → abnfDiagram-VRR7QNED-DtotTgyK.js} +1 -1
  14. package/web-dist/assets/architecture-TIHT7OUA-B23bEjC4.js +1 -0
  15. package/web-dist/assets/{architectureDiagram-ZJ3FMSHR-CdLQ71be.js → architectureDiagram-ZJ3FMSHR-CVl8mUt0.js} +1 -1
  16. package/web-dist/assets/{blockDiagram-677ZJIJ3-CBk2FHEj.js → blockDiagram-677ZJIJ3-VUZEsYBW.js} +1 -1
  17. package/web-dist/assets/{c4Diagram-LMCZKHZV-mZ3HQ6WX.js → c4Diagram-LMCZKHZV-Dlg18lBF.js} +1 -1
  18. package/web-dist/assets/channel-BMFwXMMq.js +1 -0
  19. package/web-dist/assets/{chunk-32BRIVSS-Daxvi7f5.js → chunk-32BRIVSS-DG8gd151.js} +1 -1
  20. package/web-dist/assets/{chunk-52WLFC77-BGJoZvry.js → chunk-52WLFC77-DKlahFJ2.js} +1 -1
  21. package/web-dist/assets/{chunk-C7G6YPKG-Ycd1yheh.js → chunk-C7G6YPKG-Bk-BFDsQ.js} +1 -1
  22. package/web-dist/assets/{chunk-EX3LRPZG-BPFhlsHp.js → chunk-EX3LRPZG-DnXqd-jJ.js} +1 -1
  23. package/web-dist/assets/{chunk-FWX5IMBZ--xy8DTon.js → chunk-FWX5IMBZ-ujYyBebT.js} +2 -2
  24. package/web-dist/assets/{chunk-HOUHSVGY-Dq3zoygp.js → chunk-HOUHSVGY-Dk2XhPWQ.js} +1 -1
  25. package/web-dist/assets/{chunk-ICXQ74PX-FfKP-7yM.js → chunk-ICXQ74PX-DoseDoV4.js} +1 -1
  26. package/web-dist/assets/{chunk-MOJQB5TN-BeiHnsLF.js → chunk-MOJQB5TN-B8dog4zz.js} +1 -1
  27. package/web-dist/assets/{chunk-OGEWGWER-CjDU_9fC.js → chunk-OGEWGWER-D4GkHktS.js} +1 -1
  28. package/web-dist/assets/{chunk-PUDLZKDR-BO7tm5QX.js → chunk-PUDLZKDR-ChEIayRe.js} +1 -1
  29. package/web-dist/assets/{chunk-Q4XR5HBZ-BPefovOg.js → chunk-Q4XR5HBZ-BtzMOr97.js} +1 -1
  30. package/web-dist/assets/{chunk-V7JOEXUC-DWnebFHh.js → chunk-V7JOEXUC-DQ7c8QAd.js} +1 -1
  31. package/web-dist/assets/{chunk-VAUOI2AC-BL6qWFhW.js → chunk-VAUOI2AC-6jWzOU_J.js} +1 -1
  32. package/web-dist/assets/{chunk-VR4S4FIN-Mfs__7L9.js → chunk-VR4S4FIN-TB0TNuya.js} +1 -1
  33. package/web-dist/assets/{chunk-WYO6CB5R-Bf2IYbEU.js → chunk-WYO6CB5R-CY7fL6F5.js} +1 -1
  34. package/web-dist/assets/{chunk-ZGVPDNZ5-CJ9ZHZgU.js → chunk-ZGVPDNZ5-vZO6zPtA.js} +1 -1
  35. package/web-dist/assets/classDiagram-OUVF2IWQ-DiWatUgG.js +1 -0
  36. package/web-dist/assets/classDiagram-v2-EOCWNBFH-DiWatUgG.js +1 -0
  37. package/web-dist/assets/{cynefin-VYW2F7L2-COSC0oNL.js → cynefin-VYW2F7L2-D4NcAp7V.js} +1 -1
  38. package/web-dist/assets/{cynefinDiagram-TSTJHNR4-mInhJdg1.js → cynefinDiagram-TSTJHNR4-hLO8f53U.js} +1 -1
  39. package/web-dist/assets/{dagre-VKFMJZFB-D-T5z05M.js → dagre-VKFMJZFB-86z9AWRw.js} +1 -1
  40. package/web-dist/assets/{diagram-FQU43EPY-HbMkSb3j.js → diagram-FQU43EPY-DXw3bj8G.js} +1 -1
  41. package/web-dist/assets/{diagram-G47NLZAW-DBwZLcZh.js → diagram-G47NLZAW-BtH3_eiQ.js} +1 -1
  42. package/web-dist/assets/{diagram-NH7WQ7WH-DG_Mhays.js → diagram-NH7WQ7WH-BxWq2H6D.js} +1 -1
  43. package/web-dist/assets/{diagram-OA4YK3LP-hH39gqpu.js → diagram-OA4YK3LP-BoU3I6Xx.js} +1 -1
  44. package/web-dist/assets/{diagram-WEI45ONY-DhKZuwxW.js → diagram-WEI45ONY-CkPD-vrA.js} +1 -1
  45. package/web-dist/assets/{ebnfDiagram-CCIWWBDH-B7BiO-NR.js → ebnfDiagram-CCIWWBDH-BudQTnvf.js} +1 -1
  46. package/web-dist/assets/{erDiagram-Q63AITRT-DHjG5RDQ.js → erDiagram-Q63AITRT-CRFLgkaW.js} +1 -1
  47. package/web-dist/assets/eventmodeling-45OFAUF4-C7ZRnE7-.js +1 -0
  48. package/web-dist/assets/flowDiagram-23GEKE2U-DKS-kFcF.js +1 -0
  49. package/web-dist/assets/{ganttDiagram-NO4QXBWP-BZ-98wTa.js → ganttDiagram-NO4QXBWP-DFmOc45y.js} +1 -1
  50. package/web-dist/assets/{gitGraph-TEB2WS4Q-nF22R2jO.js → gitGraph-TEB2WS4Q-CMW6meDa.js} +1 -1
  51. package/web-dist/assets/{gitGraphDiagram-IHSO6WYX-CoYQQ22V.js → gitGraphDiagram-IHSO6WYX-CHelbJfg.js} +1 -1
  52. package/web-dist/assets/{index-BHzIN-tQ.js → index-C2Tf3Ihs.js} +65 -65
  53. package/web-dist/assets/index-CeAC3wUW.css +1 -0
  54. package/web-dist/assets/{info-DKCQHKI2-Cy2BCbBW.js → info-DKCQHKI2-DZT4W61r.js} +1 -1
  55. package/web-dist/assets/{infoDiagram-FWYZ7A6U-CmhR2R1x.js → infoDiagram-FWYZ7A6U-Dj0tLhVO.js} +1 -1
  56. package/web-dist/assets/{ishikawaDiagram-FXEZZL3T-CfG59afl.js → ishikawaDiagram-FXEZZL3T-D825ES0c.js} +1 -1
  57. package/web-dist/assets/{journeyDiagram-5HDEW3XC-BvFmG20q.js → journeyDiagram-5HDEW3XC-D53Igq5c.js} +1 -1
  58. package/web-dist/assets/{kanban-definition-HUTT4EX6-BHGEecsY.js → kanban-definition-HUTT4EX6-CJ-F0vAo.js} +1 -1
  59. package/web-dist/assets/{line-Ds4xvN3d.js → line-CuiC27jO.js} +1 -1
  60. package/web-dist/assets/{mermaid-parser.core-Gow4kgYJ.js → mermaid-parser.core-rG6qAIn0.js} +3 -3
  61. package/web-dist/assets/{mermaid.core-B7Qc_kbm.js → mermaid.core-DzNUOuDq.js} +3 -3
  62. package/web-dist/assets/{mindmap-definition-LN4V7U3C-ayXKGcy_.js → mindmap-definition-LN4V7U3C-DHfhQue9.js} +1 -1
  63. package/web-dist/assets/{packet-7NZHBO7P-oLBdtkD8.js → packet-7NZHBO7P-BiUlKhVG.js} +1 -1
  64. package/web-dist/assets/{pegDiagram-2B236MQR-DwJyc_1B.js → pegDiagram-2B236MQR-MQdiKZx3.js} +1 -1
  65. package/web-dist/assets/{pie-RZYD4A2V-CXzad3fT.js → pie-RZYD4A2V-dNHUvvE3.js} +1 -1
  66. package/web-dist/assets/{pieDiagram-ENE6RG2P-CZzgSGtM.js → pieDiagram-ENE6RG2P-BwFxe1x1.js} +1 -1
  67. package/web-dist/assets/{quadrantDiagram-ABIIQ3AL--IPIp8yo.js → quadrantDiagram-ABIIQ3AL-9dic-8vv.js} +1 -1
  68. package/web-dist/assets/{radar-I7S5WNFK-DldySvtZ.js → radar-I7S5WNFK-CK3dl20X.js} +1 -1
  69. package/web-dist/assets/{railroad-3IZDKUUU-CiWFZfXM.js → railroad-3IZDKUUU-BuB2LkFj.js} +1 -1
  70. package/web-dist/assets/railroad-abnf-AHOZXSZD-C1-MJAeY.js +1 -0
  71. package/web-dist/assets/railroad-ebnf-EBAXGLYW-crQCD9rJ.js +1 -0
  72. package/web-dist/assets/railroad-peg-LSFZ7HO6-Ba-_QGKi.js +1 -0
  73. package/web-dist/assets/{railroadDiagram-RFXS5EU6-DcCMNGGb.js → railroadDiagram-RFXS5EU6-CuuspS_3.js} +1 -1
  74. package/web-dist/assets/{requirementDiagram-TGXJPOKE-C-6j8urk.js → requirementDiagram-TGXJPOKE-DHAILLdh.js} +1 -1
  75. package/web-dist/assets/{sankeyDiagram-HTMAVEWB-CPtiOpdz.js → sankeyDiagram-HTMAVEWB-CztQ2t1b.js} +1 -1
  76. package/web-dist/assets/{sequenceDiagram-DBY2YBRQ-B8FnQTdn.js → sequenceDiagram-DBY2YBRQ-jk56eo0l.js} +1 -1
  77. package/web-dist/assets/{stateDiagram-2N3HPSRC-CxG9nX2P.js → stateDiagram-2N3HPSRC-uwqBWnrI.js} +1 -1
  78. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-DOPbAEV3.js +1 -0
  79. package/web-dist/assets/{swimlanes-5IMT3BWC-D49-t0hV.js → swimlanes-5IMT3BWC-BzuJ77j6.js} +1 -1
  80. package/web-dist/assets/swimlanesDiagram-G3AALYLV-BRh1ca21.js +8 -0
  81. package/web-dist/assets/{timeline-definition-FHXFAJF6-C9OEd9SE.js → timeline-definition-FHXFAJF6-CVDNkzi9.js} +1 -1
  82. package/web-dist/assets/{treeView-QDETBFTQ-D1AKqVPa.js → treeView-QDETBFTQ-CdkPxaDl.js} +1 -1
  83. package/web-dist/assets/{treemap-6X3UGDF4-BRssB7hM.js → treemap-6X3UGDF4-lnksCHdn.js} +1 -1
  84. package/web-dist/assets/{vennDiagram-L72KCM5P-CftkAbY0.js → vennDiagram-L72KCM5P-B533fRM0.js} +1 -1
  85. package/web-dist/assets/{wardley-OPB4EBWU-RLMgzRq4.js → wardley-OPB4EBWU-DwKf-2YJ.js} +1 -1
  86. package/web-dist/assets/{wardleyDiagram-EHGQE667-BLytgXPS.js → wardleyDiagram-EHGQE667-BDDN72B1.js} +1 -1
  87. package/web-dist/assets/{xychartDiagram-FW5EYKEG-BYgK1Y3H.js → xychartDiagram-FW5EYKEG-CkvHmNVt.js} +1 -1
  88. package/web-dist/index.html +2 -2
  89. package/web-dist/assets/architecture-TIHT7OUA-CuD8jpr-.js +0 -1
  90. package/web-dist/assets/channel-C2eUWc74.js +0 -1
  91. package/web-dist/assets/classDiagram-OUVF2IWQ-GaOJNgfE.js +0 -1
  92. package/web-dist/assets/classDiagram-v2-EOCWNBFH-GaOJNgfE.js +0 -1
  93. package/web-dist/assets/eventmodeling-45OFAUF4-C0eV8RBx.js +0 -1
  94. package/web-dist/assets/flowDiagram-23GEKE2U-BbldRZUK.js +0 -1
  95. package/web-dist/assets/index-Duiy4w7C.css +0 -1
  96. package/web-dist/assets/railroad-abnf-AHOZXSZD-bXMYUOCD.js +0 -1
  97. package/web-dist/assets/railroad-ebnf-EBAXGLYW-D11ZwZby.js +0 -1
  98. package/web-dist/assets/railroad-peg-LSFZ7HO6-DD1AC5X-.js +0 -1
  99. package/web-dist/assets/stateDiagram-v2-6OUMAXLB-SGarOFIy.js +0 -1
  100. package/web-dist/assets/swimlanesDiagram-G3AALYLV-krF0bh4b.js +0 -8
  101. /package/runtime/{cc/scripts/fray → board}/agent-bindings.mjs +0 -0
  102. /package/runtime/{cc/scripts/fray → board}/agent-liveness.mjs +0 -0
  103. /package/runtime/{cc/scripts/fray → board}/agent-status.mjs +0 -0
  104. /package/runtime/{cc/scripts/fray → board}/config.mjs +0 -0
  105. /package/runtime/{cc/scripts/fray → board}/decisions.mjs +0 -0
  106. /package/runtime/{cc/scripts/fray → board}/index.mjs +0 -0
  107. /package/runtime/{cc/scripts/fray → board}/notify-shared.mjs +0 -0
  108. /package/runtime/{cc/scripts/fray → board}/notify.mjs +0 -0
  109. /package/runtime/{cc/scripts/fray → board}/ownership.mjs +0 -0
  110. /package/runtime/{cc/scripts/fray → board}/rest-detect.mjs +0 -0
  111. /package/runtime/{cc/scripts/fray → board}/thread-excerpt.mjs +0 -0
  112. /package/runtime/{cc/scripts/fray → board}/thread-update.mjs +0 -0
@@ -1 +1 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-C4XfhTaE.js";import{O as r,c as i,s as a,x as o}from"./chunk-WYO6CB5R-Bf2IYbEU.js";import{et as s,g as c}from"./chunk-ICXQ74PX-FfKP-7yM.js";import{t as l}from"./line-Ds4xvN3d.js";import"./chunk-HOUHSVGY-Dq3zoygp.js";import"./chunk-Q4XR5HBZ-BPefovOg.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-CjDU_9fC.js";import{t as u}from"./graphlib-B8gBHxth.js";import{t as d}from"./dagre-CXRCoUWR.js";import"./chunk-32BRIVSS-Daxvi7f5.js";import"./chunk-XXDRQBXY-DYlTP5J-.js";import"./chunk-VR4S4FIN-Mfs__7L9.js";import"./chunk-C7G6YPKG-Ycd1yheh.js";import"./chunk-ZGVPDNZ5-CJ9ZHZgU.js";import"./chunk-52WLFC77-BGJoZvry.js";import"./chunk-FWX5IMBZ--xy8DTon.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-BPFhlsHp.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit).attr(`cy`,o().state.padding+o().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,o().state.textHeight).attr(`class`,`divider`).attr(`x2`,o().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+2*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,r.width+2*o().state.padding).attr(`height`,r.height+2*o().state.padding).attr(`rx`,o().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*o().state.padding).text(t);n||r.attr(`dy`,o().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+1.3*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),a=i.height,s=t.append(`text`).attr(`x`,o().state.padding).attr(`y`,a+o().state.padding*.4+o().state.dividerMargin+o().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,o().state.padding).attr(`y1`,o().state.padding+a+o().state.dividerMargin/2).attr(`y2`,o().state.padding+a+o().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*o().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,f+2*o().state.padding).attr(`height`,d.height+a+2*o().state.padding).attr(`rx`,o().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=o().state.padding,i=2*o().state.padding,a=e.node().getBBox(),s=a.width,c=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,o().state.titleShift).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-o().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+o().state.textHeight+o().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,o().state.textHeight*3).attr(`rx`,o().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*o().state.textHeight).attr(`rx`,o().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,o().state.sizeUnit+o().state.miniPadding).attr(`cx`,o().state.padding+o().state.sizeUnit+o().state.miniPadding).attr(`cy`,o().state.padding+o().state.sizeUnit+o().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit+2).attr(`cy`,o().state.padding+o().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=o().state.forkWidth,r=o().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,o().state.padding).attr(`y`,o().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let i=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(a.lineBreakRegex),u=1.25*o().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}i+=u,e.attr(`x`,t+o().state.noteMargin),e.attr(`y`,n+i+1.25*o().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,o().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*o().state.noteMargin),n.attr(`width`,r+o().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*o().state.padding,r.height=a.height+2*o().state.padding,r},`drawState`),T=0,E=e(function(n,i,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);i.points=i.points.filter(e=>!Number.isNaN(e.y));let f=i.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(o().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(i.points),l=a.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-o().state.padding/2).attr(`y`,s-h/2-o().state.padding/2-3.5).attr(`width`,p+o().state.padding).attr(`height`,h+o().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(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=e(function(e,r,a,s){D=o().state;let c=o().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;i(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,i,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let a;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);a=N(t.doc,e,t.id,!i,o,s,c);{e=y(e,t,i);let n=e.node().getBBox();a.width=n.width,a.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else a=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(a.id+`-note`,e),l.setNode(a.id,a)):(l.setNode(a.id,a),l.setNode(a.id+`-note`,e)),l.setParent(a.id,a.id+`-group`),l.setParent(a.id+`-note`,a.id+`-group`)}else l.setNode(a.id,a)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*a.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import{m as t,p as n}from"./src-C4XfhTaE.js";import{O as r,c as i,s as a,x as o}from"./chunk-WYO6CB5R-CY7fL6F5.js";import{et as s,g as c}from"./chunk-ICXQ74PX-DoseDoV4.js";import{t as l}from"./line-CuiC27jO.js";import"./chunk-HOUHSVGY-Dk2XhPWQ.js";import"./chunk-Q4XR5HBZ-BtzMOr97.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-D4GkHktS.js";import{t as u}from"./graphlib-B8gBHxth.js";import{t as d}from"./dagre-CXRCoUWR.js";import"./chunk-32BRIVSS-DG8gd151.js";import"./chunk-XXDRQBXY-DYlTP5J-.js";import"./chunk-VR4S4FIN-TB0TNuya.js";import"./chunk-C7G6YPKG-Bk-BFDsQ.js";import"./chunk-ZGVPDNZ5-vZO6zPtA.js";import"./chunk-52WLFC77-DKlahFJ2.js";import"./chunk-FWX5IMBZ-ujYyBebT.js";import{i as f,n as p,t as m}from"./chunk-EX3LRPZG-DnXqd-jJ.js";var h=e(e=>e.append(`circle`).attr(`class`,`start-state`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit).attr(`cy`,o().state.padding+o().state.sizeUnit),`drawStartState`),g=e(e=>e.append(`line`).style(`stroke`,`grey`).style(`stroke-dasharray`,`3`).attr(`x1`,o().state.textHeight).attr(`class`,`divider`).attr(`x2`,o().state.textHeight*2).attr(`y1`,0).attr(`y2`,0),`drawDivider`),_=e((e,t)=>{let n=e.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+2*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),r=n.node().getBBox();return e.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,r.width+2*o().state.padding).attr(`height`,r.height+2*o().state.padding).attr(`rx`,o().state.radius),n},`drawSimpleState`),v=e((t,n)=>{let r=e(function(e,t,n){let r=e.append(`tspan`).attr(`x`,2*o().state.padding).text(t);n||r.attr(`dy`,o().state.textHeight)},`addTspan`),i=t.append(`text`).attr(`x`,2*o().state.padding).attr(`y`,o().state.textHeight+1.3*o().state.padding).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(n.descriptions[0]).node().getBBox(),a=i.height,s=t.append(`text`).attr(`x`,o().state.padding).attr(`y`,a+o().state.padding*.4+o().state.dividerMargin+o().state.textHeight).attr(`class`,`state-description`),c=!0,l=!0;n.descriptions.forEach(function(e){c||(r(s,e,l),l=!1),c=!1});let u=t.append(`line`).attr(`x1`,o().state.padding).attr(`y1`,o().state.padding+a+o().state.dividerMargin/2).attr(`y2`,o().state.padding+a+o().state.dividerMargin/2).attr(`class`,`descr-divider`),d=s.node().getBBox(),f=Math.max(d.width,i.width);return u.attr(`x2`,f+3*o().state.padding),t.insert(`rect`,`:first-child`).attr(`x`,o().state.padding).attr(`y`,o().state.padding).attr(`width`,f+2*o().state.padding).attr(`height`,d.height+a+2*o().state.padding).attr(`rx`,o().state.radius),t},`drawDescrState`),y=e((e,t,n)=>{let r=o().state.padding,i=2*o().state.padding,a=e.node().getBBox(),s=a.width,c=a.x,l=e.append(`text`).attr(`x`,0).attr(`y`,o().state.titleShift).attr(`font-size`,o().state.fontSize).attr(`class`,`state-title`).text(t.id),u=l.node().getBBox().width+i,d=Math.max(u,s);d===s&&(d+=i);let f,p=e.node().getBBox();t.doc,f=c-r,u>s&&(f=(s-d)/2+r),Math.abs(c-p.x)<r&&u>s&&(f=c-(u-s)/2);let m=1-o().state.textHeight;return e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,m).attr(`class`,n?`alt-composit`:`composit`).attr(`width`,d).attr(`height`,p.height+o().state.textHeight+o().state.titleShift+1).attr(`rx`,`0`),l.attr(`x`,f+r),u<=s&&l.attr(`x`,c+(d-i)/2-u/2+r),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,o().state.textHeight*3).attr(`rx`,o().state.radius),e.insert(`rect`,`:first-child`).attr(`x`,f).attr(`y`,o().state.titleShift-o().state.textHeight-o().state.padding).attr(`width`,d).attr(`height`,p.height+3+2*o().state.textHeight).attr(`rx`,o().state.radius),e},`addTitleAndBox`),b=e(e=>(e.append(`circle`).attr(`class`,`end-state-outer`).attr(`r`,o().state.sizeUnit+o().state.miniPadding).attr(`cx`,o().state.padding+o().state.sizeUnit+o().state.miniPadding).attr(`cy`,o().state.padding+o().state.sizeUnit+o().state.miniPadding),e.append(`circle`).attr(`class`,`end-state-inner`).attr(`r`,o().state.sizeUnit).attr(`cx`,o().state.padding+o().state.sizeUnit+2).attr(`cy`,o().state.padding+o().state.sizeUnit+2)),`drawEndState`),x=e((e,t)=>{let n=o().state.forkWidth,r=o().state.forkHeight;if(t.parentId){let e=n;n=r,r=e}return e.append(`rect`).style(`stroke`,`black`).style(`fill`,`black`).attr(`width`,n).attr(`height`,r).attr(`x`,o().state.padding).attr(`y`,o().state.padding)},`drawForkJoinState`),S=e((e,t,n,r)=>{let i=0,s=r.append(`text`);s.style(`text-anchor`,`start`),s.attr(`class`,`noteText`);let c=e.replace(/\r\n/g,`<br/>`);c=c.replace(/\n/g,`<br/>`);let l=c.split(a.lineBreakRegex),u=1.25*o().state.noteMargin;for(let e of l){let r=e.trim();if(r.length>0){let e=s.append(`tspan`);if(e.text(r),u===0){let t=e.node().getBBox();u+=t.height}i+=u,e.attr(`x`,t+o().state.noteMargin),e.attr(`y`,n+i+1.25*o().state.noteMargin)}}return{textWidth:s.node().getBBox().width,textHeight:i}},`_drawLongText`),C=e((e,t)=>{t.attr(`class`,`state-note`);let n=t.append(`rect`).attr(`x`,0).attr(`y`,o().state.padding),{textWidth:r,textHeight:i}=S(e,0,0,t.append(`g`));return n.attr(`height`,i+2*o().state.noteMargin),n.attr(`width`,r+o().state.noteMargin*2),n},`drawNote`),w=e(function(e,t){let n=t.id,r={id:n,label:t.id,width:0,height:0},i=e.append(`g`).attr(`id`,n).attr(`class`,`stateGroup`);t.type===`start`&&h(i),t.type===`end`&&b(i),(t.type===`fork`||t.type===`join`)&&x(i,t),t.type===`note`&&C(t.note.text,i),t.type===`divider`&&g(i),t.type==="default"&&t.descriptions.length===0&&_(i,t),t.type==="default"&&t.descriptions.length>0&&v(i,t);let a=i.node().getBBox();return r.width=a.width+2*o().state.padding,r.height=a.height+2*o().state.padding,r},`drawState`),T=0,E=e(function(n,i,u){let d=e(function(e){switch(e){case m.relationType.AGGREGATION:return`aggregation`;case m.relationType.EXTENSION:return`extension`;case m.relationType.COMPOSITION:return`composition`;case m.relationType.DEPENDENCY:return`dependency`}},`getRelationType`);i.points=i.points.filter(e=>!Number.isNaN(e.y));let f=i.points,p=l().x(function(e){return e.x}).y(function(e){return e.y}).curve(s),h=n.append(`path`).attr(`d`,p(f)).attr(`id`,`edge`+T).attr(`class`,`transition`),g=``;if(o().state.arrowMarkerAbsolute&&(g=r(!0)),h.attr(`marker-end`,`url(`+g+`#`+d(m.relationType.DEPENDENCY)+`End)`),u.title!==void 0){let e=n.append(`g`).attr(`class`,`stateLabel`),{x:r,y:s}=c.calcLabelPosition(i.points),l=a.getRows(u.title),d=0,f=[],p=0,m=0;for(let n=0;n<=l.length;n++){let i=e.append(`text`).attr(`text-anchor`,`middle`).text(l[n]).attr(`x`,r).attr(`y`,s+d),a=i.node().getBBox();p=Math.max(p,a.width),m=Math.min(m,a.x),t.info(a.x,r,s+d),d===0&&(d=i.node().getBBox().height,t.info(`Title height`,d,s)),f.push(i)}let h=d*l.length;if(l.length>1){let e=(l.length-1)*d*.5;f.forEach((t,n)=>t.attr(`y`,s+n*d-e)),h=d*l.length}let g=e.node().getBBox();e.insert(`rect`,`:first-child`).attr(`class`,`box`).attr(`x`,r-p/2-o().state.padding/2).attr(`y`,s-h/2-o().state.padding/2-3.5).attr(`width`,p+o().state.padding).attr(`height`,h+o().state.padding),t.info(g)}T++},`drawEdge`),D,O={},k=e(function(){},`setConf`),A=e(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=e(function(e,r,a,s){D=o().state;let c=o().securityLevel,l;c===`sandbox`&&(l=n(`#i`+r));let u=n(c===`sandbox`?l.nodes()[0].contentDocument.body:`body`),d=c===`sandbox`?l.nodes()[0].contentDocument:document;t.debug(`Rendering diagram `+e);let f=u.select(`[id='${r}']`);A(f),N(s.db.getRootDoc(),f.append(`g`).attr(`id`,r+`-root`),void 0,!1,u,d,s);let p=D.padding,m=f.node().getBBox(),h=m.width+p*2,g=m.height+p*2;i(f,g,h*1.75,D.useMaxWidth),f.attr(`viewBox`,`${m.x-D.padding} ${m.y-D.padding} `+h+` `+g)},`draw`),M=e(e=>e?e.length*D.fontSizeFactor:1,`getLabelWidth`),N=e((e,n,r,i,o,s,c)=>{let l=new u({compound:!0,multigraph:!0}),f,p=!0;for(f=0;f<e.length;f++)if(e[f].stmt===`relation`){p=!1;break}r?l.setGraph({rankdir:`LR`,multigraph:!0,compound:!0,ranker:`tight-tree`,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,isMultiGraph:!0}):l.setGraph({rankdir:`TB`,multigraph:!0,compound:!0,ranksep:p?1:D.edgeLengthFactor,nodeSep:p?1:50,ranker:`tight-tree`,isMultiGraph:!0}),l.setDefaultEdgeLabel(function(){return{}});let m=c.db.getStates(),h=c.db.getRelations(),g=Object.keys(m);for(let e of g){let t=m[e];r&&(t.parentId=r);let a;if(t.doc){let e=n.append(`g`).attr(`id`,t.id).attr(`class`,`stateGroup`);a=N(t.doc,e,t.id,!i,o,s,c);{e=y(e,t,i);let n=e.node().getBBox();a.width=n.width,a.height=n.height+D.padding/2,O[t.id]={y:D.compositTitleSize}}}else a=w(n,t,l);if(t.note){let e=w(n,{descriptions:[],id:t.id+`-note`,note:t.note,type:`note`},l);t.note.position===`left of`?(l.setNode(a.id+`-note`,e),l.setNode(a.id,a)):(l.setNode(a.id,a),l.setNode(a.id+`-note`,e)),l.setParent(a.id,a.id+`-group`),l.setParent(a.id+`-note`,a.id+`-group`)}else l.setNode(a.id,a)}t.debug(`Count=`,l.nodeCount(),l);let _=0;h.forEach(function(e){_++,t.debug(`Setting edge`,e),l.setEdge(e.id1,e.id2,{relation:e,width:M(e.title),height:D.labelHeight*a.getRows(e.title).length,labelpos:`c`},`id`+_)}),d(l),t.debug(`Graph after layout`,l.nodes());let v=n.node();l.nodes().forEach(function(e){e!==void 0&&l.node(e)!==void 0?(t.warn(`Node `+e+`: `+JSON.stringify(l.node(e))),o.select(`#`+v.id+` #`+e).attr(`transform`,`translate(`+(l.node(e).x-l.node(e).width/2)+`,`+(l.node(e).y+(O[e]?O[e].y:0)-l.node(e).height/2)+` )`),o.select(`#`+v.id+` #`+e).attr(`data-x-shift`,l.node(e).x-l.node(e).width/2),s.querySelectorAll(`#`+v.id+` #`+e+` .divider`).forEach(e=>{let t=e.parentElement,n=0,r=0;t&&(t.parentElement&&(n=t.parentElement.getBBox().width),r=parseInt(t.getAttribute(`data-x-shift`),10),Number.isNaN(r)&&(r=0)),e.setAttribute(`x1`,0-r+8),e.setAttribute(`x2`,n-r-8)})):t.debug(`No Node `+e+`: `+JSON.stringify(l.node(e)))});let b=v.getBBox();l.edges().forEach(function(e){e!==void 0&&l.edge(e)!==void 0&&(t.debug(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(l.edge(e))),E(n,l.edge(e),l.edge(e).relation))}),b=v.getBBox();let x={id:r||`root`,label:r||`root`,width:0,height:0};return x.width=b.width+2*D.padding,x.height=b.height+2*D.padding,t.debug(`Doc rendered`,x,l),x},`renderDoc`),P={parser:p,get db(){return new m(1)},renderer:{setConf:k,draw:j},styles:f,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{P as diagram};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-Y2CYZVJY-DsF7k-Jl.js";import"./src-C4XfhTaE.js";import"./chunk-WYO6CB5R-CY7fL6F5.js";import"./chunk-ICXQ74PX-DoseDoV4.js";import"./chunk-HOUHSVGY-Dk2XhPWQ.js";import"./chunk-Q4XR5HBZ-BtzMOr97.js";import"./chunk-7BUUIJ7U-Bb538aSH.js";import"./chunk-OGEWGWER-D4GkHktS.js";import"./chunk-32BRIVSS-DG8gd151.js";import"./chunk-XXDRQBXY-DYlTP5J-.js";import"./chunk-VR4S4FIN-TB0TNuya.js";import"./chunk-C7G6YPKG-Bk-BFDsQ.js";import"./chunk-ZGVPDNZ5-vZO6zPtA.js";import"./chunk-52WLFC77-DKlahFJ2.js";import"./chunk-FWX5IMBZ-ujYyBebT.js";import{i as t,n,r,t as i}from"./chunk-EX3LRPZG-DnXqd-jJ.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};