@oxide/design-system 1.7.7--canary.c74e439.0 → 1.7.7--canary.2a63c1e.0

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 (131) hide show
  1. package/components/dist/asciidoc.css +42 -0
  2. package/components/dist/index.d.ts +0 -3
  3. package/components/dist/index.js +145 -1807
  4. package/components/dist/index.js.map +1 -1
  5. package/package.json +5 -3
  6. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js +0 -14
  7. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js.map +0 -1
  8. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js +0 -8846
  9. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js.map +0 -1
  10. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js +0 -3721
  11. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js.map +0 -1
  12. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js +0 -2599
  13. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js.map +0 -1
  14. package/components/dist/chunk-2DDKDUUO.js +0 -439
  15. package/components/dist/chunk-2DDKDUUO.js.map +0 -1
  16. package/components/dist/chunk-2NHDMTP7.js +0 -26905
  17. package/components/dist/chunk-2NHDMTP7.js.map +0 -1
  18. package/components/dist/chunk-4IJS44L3.js +0 -22
  19. package/components/dist/chunk-4IJS44L3.js.map +0 -1
  20. package/components/dist/chunk-562WOS3Z.js +0 -1109
  21. package/components/dist/chunk-562WOS3Z.js.map +0 -1
  22. package/components/dist/chunk-6UD2HOKB.js +0 -17082
  23. package/components/dist/chunk-6UD2HOKB.js.map +0 -1
  24. package/components/dist/chunk-76BOQ7BT.js +0 -63
  25. package/components/dist/chunk-76BOQ7BT.js.map +0 -1
  26. package/components/dist/chunk-7I5DT373.js +0 -97
  27. package/components/dist/chunk-7I5DT373.js.map +0 -1
  28. package/components/dist/chunk-BPREMNVP.js +0 -1875
  29. package/components/dist/chunk-BPREMNVP.js.map +0 -1
  30. package/components/dist/chunk-BVYAEHG3.js +0 -122
  31. package/components/dist/chunk-BVYAEHG3.js.map +0 -1
  32. package/components/dist/chunk-BW7DFBOS.js +0 -152
  33. package/components/dist/chunk-BW7DFBOS.js.map +0 -1
  34. package/components/dist/chunk-EZG2MNHW.js +0 -59
  35. package/components/dist/chunk-EZG2MNHW.js.map +0 -1
  36. package/components/dist/chunk-G6QWNAHJ.js +0 -43
  37. package/components/dist/chunk-G6QWNAHJ.js.map +0 -1
  38. package/components/dist/chunk-H72D3HRR.js +0 -1244
  39. package/components/dist/chunk-H72D3HRR.js.map +0 -1
  40. package/components/dist/chunk-K532NZMW.js +0 -46
  41. package/components/dist/chunk-K532NZMW.js.map +0 -1
  42. package/components/dist/chunk-LC3BX2KL.js +0 -25
  43. package/components/dist/chunk-LC3BX2KL.js.map +0 -1
  44. package/components/dist/chunk-LQ2ABR7F.js +0 -5665
  45. package/components/dist/chunk-LQ2ABR7F.js.map +0 -1
  46. package/components/dist/chunk-M6L3MM6K.js +0 -22
  47. package/components/dist/chunk-M6L3MM6K.js.map +0 -1
  48. package/components/dist/chunk-MWA4PRRW.js +0 -122
  49. package/components/dist/chunk-MWA4PRRW.js.map +0 -1
  50. package/components/dist/chunk-ND3FLKHU.js +0 -570
  51. package/components/dist/chunk-ND3FLKHU.js.map +0 -1
  52. package/components/dist/chunk-NIVHLOPB.js +0 -2621
  53. package/components/dist/chunk-NIVHLOPB.js.map +0 -1
  54. package/components/dist/chunk-R6F6FFK7.js +0 -65
  55. package/components/dist/chunk-R6F6FFK7.js.map +0 -1
  56. package/components/dist/chunk-RN5R3L7O.js +0 -2041
  57. package/components/dist/chunk-RN5R3L7O.js.map +0 -1
  58. package/components/dist/chunk-RWDBBMDN.js +0 -10910
  59. package/components/dist/chunk-RWDBBMDN.js.map +0 -1
  60. package/components/dist/chunk-T7HPDS4Z.js +0 -573
  61. package/components/dist/chunk-T7HPDS4Z.js.map +0 -1
  62. package/components/dist/chunk-TG4YEU4Q.js +0 -23
  63. package/components/dist/chunk-TG4YEU4Q.js.map +0 -1
  64. package/components/dist/chunk-U5WCXBW2.js +0 -48
  65. package/components/dist/chunk-U5WCXBW2.js.map +0 -1
  66. package/components/dist/chunk-V6PWN6OH.js +0 -1875
  67. package/components/dist/chunk-V6PWN6OH.js.map +0 -1
  68. package/components/dist/chunk-VLTHNCSD.js +0 -48
  69. package/components/dist/chunk-VLTHNCSD.js.map +0 -1
  70. package/components/dist/chunk-WDK4G4UR.js +0 -2791
  71. package/components/dist/chunk-WDK4G4UR.js.map +0 -1
  72. package/components/dist/chunk-WLVQWTC6.js +0 -77
  73. package/components/dist/chunk-WLVQWTC6.js.map +0 -1
  74. package/components/dist/chunk-YDLS5R4M.js +0 -48
  75. package/components/dist/chunk-YDLS5R4M.js.map +0 -1
  76. package/components/dist/chunk-YGFBWU2Q.js +0 -7
  77. package/components/dist/chunk-YGFBWU2Q.js.map +0 -1
  78. package/components/dist/chunk-ZBL4CWCH.js +0 -2120
  79. package/components/dist/chunk-ZBL4CWCH.js.map +0 -1
  80. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js +0 -40
  81. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js.map +0 -1
  82. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js +0 -40
  83. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js.map +0 -1
  84. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js +0 -734
  85. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js.map +0 -1
  86. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js +0 -226
  87. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js.map +0 -1
  88. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js +0 -1381
  89. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js.map +0 -1
  90. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js +0 -2349
  91. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js.map +0 -1
  92. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js +0 -2413
  93. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js.map +0 -1
  94. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js +0 -14
  95. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js.map +0 -1
  96. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js +0 -1763
  97. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js.map +0 -1
  98. package/components/dist/info-46DW6VJ7-43TTIEYF.js +0 -14
  99. package/components/dist/info-46DW6VJ7-43TTIEYF.js.map +0 -1
  100. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js +0 -54
  101. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js.map +0 -1
  102. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js +0 -1244
  103. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js.map +0 -1
  104. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js +0 -1119
  105. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js.map +0 -1
  106. package/components/dist/katex-WNZY3CE5.js +0 -14484
  107. package/components/dist/katex-WNZY3CE5.js.map +0 -1
  108. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js +0 -6013
  109. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js.map +0 -1
  110. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js +0 -14
  111. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js.map +0 -1
  112. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js +0 -14
  113. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js.map +0 -1
  114. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js +0 -223
  115. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js.map +0 -1
  116. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js +0 -1408
  117. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js.map +0 -1
  118. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js +0 -1175
  119. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js.map +0 -1
  120. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js +0 -1278
  121. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js.map +0 -1
  122. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js +0 -3529
  123. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js.map +0 -1
  124. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js +0 -505
  125. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js.map +0 -1
  126. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js +0 -40
  127. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js.map +0 -1
  128. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js +0 -1260
  129. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js.map +0 -1
  130. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js +0 -1877
  131. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js.map +0 -1
@@ -1,1119 +0,0 @@
1
- import {
2
- selectSvgElement
3
- } from "./chunk-TG4YEU4Q.js";
4
- import {
5
- JSON_SCHEMA,
6
- load
7
- } from "./chunk-WDK4G4UR.js";
8
- import {
9
- insertCluster,
10
- insertNode,
11
- positionNode
12
- } from "./chunk-LQ2ABR7F.js";
13
- import "./chunk-M6L3MM6K.js";
14
- import "./chunk-H72D3HRR.js";
15
- import "./chunk-NIVHLOPB.js";
16
- import "./chunk-T7HPDS4Z.js";
17
- import "./chunk-7I5DT373.js";
18
- import {
19
- __name,
20
- darken_default,
21
- defaultConfig_default,
22
- getConfig2,
23
- is_dark_default,
24
- lighten_default,
25
- log,
26
- sanitizeText,
27
- setupGraphViewbox
28
- } from "./chunk-RWDBBMDN.js";
29
- import "./chunk-562WOS3Z.js";
30
- import "./chunk-K532NZMW.js";
31
-
32
- // node_modules/mermaid/dist/chunks/mermaid.core/kanban-definition-QRCXZQQD.mjs
33
- var parser = function() {
34
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
35
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
36
- ;
37
- return o2;
38
- }, "o"), $V0 = [1, 4], $V1 = [1, 13], $V2 = [1, 12], $V3 = [1, 15], $V4 = [1, 16], $V5 = [1, 20], $V6 = [1, 19], $V7 = [6, 7, 8], $V8 = [1, 26], $V9 = [1, 24], $Va = [1, 25], $Vb = [6, 7, 11], $Vc = [1, 31], $Vd = [6, 7, 11, 24], $Ve = [1, 6, 13, 16, 17, 20, 23], $Vf = [1, 35], $Vg = [1, 36], $Vh = [1, 6, 7, 11, 13, 16, 17, 20, 23], $Vi = [1, 38];
39
- var parser2 = {
40
- trace: /* @__PURE__ */ __name(function trace() {
41
- }, "trace"),
42
- yy: {},
43
- symbols_: { "error": 2, "start": 3, "mindMap": 4, "spaceLines": 5, "SPACELINE": 6, "NL": 7, "KANBAN": 8, "document": 9, "stop": 10, "EOF": 11, "statement": 12, "SPACELIST": 13, "node": 14, "shapeData": 15, "ICON": 16, "CLASS": 17, "nodeWithId": 18, "nodeWithoutId": 19, "NODE_DSTART": 20, "NODE_DESCR": 21, "NODE_DEND": 22, "NODE_ID": 23, "SHAPE_DATA": 24, "$accept": 0, "$end": 1 },
44
- terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "KANBAN", 11: "EOF", 13: "SPACELIST", 16: "ICON", 17: "CLASS", 20: "NODE_DSTART", 21: "NODE_DESCR", 22: "NODE_DEND", 23: "NODE_ID", 24: "SHAPE_DATA" },
45
- productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 3], [12, 2], [12, 2], [12, 2], [12, 1], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [19, 3], [18, 1], [18, 4], [15, 2], [15, 1]],
46
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
47
- var $0 = $$.length - 1;
48
- switch (yystate) {
49
- case 6:
50
- case 7:
51
- return yy;
52
- break;
53
- case 8:
54
- yy.getLogger().trace("Stop NL ");
55
- break;
56
- case 9:
57
- yy.getLogger().trace("Stop EOF ");
58
- break;
59
- case 11:
60
- yy.getLogger().trace("Stop NL2 ");
61
- break;
62
- case 12:
63
- yy.getLogger().trace("Stop EOF2 ");
64
- break;
65
- case 15:
66
- yy.getLogger().info("Node: ", $$[$0 - 1].id);
67
- yy.addNode($$[$0 - 2].length, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
68
- break;
69
- case 16:
70
- yy.getLogger().info("Node: ", $$[$0].id);
71
- yy.addNode($$[$0 - 1].length, $$[$0].id, $$[$0].descr, $$[$0].type);
72
- break;
73
- case 17:
74
- yy.getLogger().trace("Icon: ", $$[$0]);
75
- yy.decorateNode({ icon: $$[$0] });
76
- break;
77
- case 18:
78
- case 23:
79
- yy.decorateNode({ class: $$[$0] });
80
- break;
81
- case 19:
82
- yy.getLogger().trace("SPACELIST");
83
- break;
84
- case 20:
85
- yy.getLogger().trace("Node: ", $$[$0 - 1].id);
86
- yy.addNode(0, $$[$0 - 1].id, $$[$0 - 1].descr, $$[$0 - 1].type, $$[$0]);
87
- break;
88
- case 21:
89
- yy.getLogger().trace("Node: ", $$[$0].id);
90
- yy.addNode(0, $$[$0].id, $$[$0].descr, $$[$0].type);
91
- break;
92
- case 22:
93
- yy.decorateNode({ icon: $$[$0] });
94
- break;
95
- case 27:
96
- yy.getLogger().trace("node found ..", $$[$0 - 2]);
97
- this.$ = { id: $$[$0 - 1], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
98
- break;
99
- case 28:
100
- this.$ = { id: $$[$0], descr: $$[$0], type: 0 };
101
- break;
102
- case 29:
103
- yy.getLogger().trace("node found ..", $$[$0 - 3]);
104
- this.$ = { id: $$[$0 - 3], descr: $$[$0 - 1], type: yy.getType($$[$0 - 2], $$[$0]) };
105
- break;
106
- case 30:
107
- this.$ = $$[$0 - 1] + $$[$0];
108
- break;
109
- case 31:
110
- this.$ = $$[$0];
111
- break;
112
- }
113
- }, "anonymous"),
114
- table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: $V0 }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: $V0 }, { 6: $V1, 7: [1, 10], 9: 9, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o($V7, [2, 3]), { 1: [2, 2] }, o($V7, [2, 4]), o($V7, [2, 5]), { 1: [2, 6], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V1, 9: 22, 12: 11, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, { 6: $V8, 7: $V9, 10: 23, 11: $Va }, o($Vb, [2, 24], { 18: 17, 19: 18, 14: 27, 16: [1, 28], 17: [1, 29], 20: $V5, 23: $V6 }), o($Vb, [2, 19]), o($Vb, [2, 21], { 15: 30, 24: $Vc }), o($Vb, [2, 22]), o($Vb, [2, 23]), o($Vd, [2, 25]), o($Vd, [2, 26]), o($Vd, [2, 28], { 20: [1, 32] }), { 21: [1, 33] }, { 6: $V8, 7: $V9, 10: 34, 11: $Va }, { 1: [2, 7], 6: $V1, 12: 21, 13: $V2, 14: 14, 16: $V3, 17: $V4, 18: 17, 19: 18, 20: $V5, 23: $V6 }, o($Ve, [2, 14], { 7: $Vf, 11: $Vg }), o($Vh, [2, 8]), o($Vh, [2, 9]), o($Vh, [2, 10]), o($Vb, [2, 16], { 15: 37, 24: $Vc }), o($Vb, [2, 17]), o($Vb, [2, 18]), o($Vb, [2, 20], { 24: $Vi }), o($Vd, [2, 31]), { 21: [1, 39] }, { 22: [1, 40] }, o($Ve, [2, 13], { 7: $Vf, 11: $Vg }), o($Vh, [2, 11]), o($Vh, [2, 12]), o($Vb, [2, 15], { 24: $Vi }), o($Vd, [2, 30]), { 22: [1, 41] }, o($Vd, [2, 27]), o($Vd, [2, 29])],
115
- defaultActions: { 2: [2, 1], 6: [2, 2] },
116
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
117
- if (hash.recoverable) {
118
- this.trace(str);
119
- } else {
120
- var error = new Error(str);
121
- error.hash = hash;
122
- throw error;
123
- }
124
- }, "parseError"),
125
- parse: /* @__PURE__ */ __name(function parse(input) {
126
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
127
- var args = lstack.slice.call(arguments, 1);
128
- var lexer2 = Object.create(this.lexer);
129
- var sharedState = { yy: {} };
130
- for (var k in this.yy) {
131
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
132
- sharedState.yy[k] = this.yy[k];
133
- }
134
- }
135
- lexer2.setInput(input, sharedState.yy);
136
- sharedState.yy.lexer = lexer2;
137
- sharedState.yy.parser = this;
138
- if (typeof lexer2.yylloc == "undefined") {
139
- lexer2.yylloc = {};
140
- }
141
- var yyloc = lexer2.yylloc;
142
- lstack.push(yyloc);
143
- var ranges = lexer2.options && lexer2.options.ranges;
144
- if (typeof sharedState.yy.parseError === "function") {
145
- this.parseError = sharedState.yy.parseError;
146
- } else {
147
- this.parseError = Object.getPrototypeOf(this).parseError;
148
- }
149
- function popStack(n) {
150
- stack.length = stack.length - 2 * n;
151
- vstack.length = vstack.length - n;
152
- lstack.length = lstack.length - n;
153
- }
154
- __name(popStack, "popStack");
155
- function lex() {
156
- var token;
157
- token = tstack.pop() || lexer2.lex() || EOF;
158
- if (typeof token !== "number") {
159
- if (token instanceof Array) {
160
- tstack = token;
161
- token = tstack.pop();
162
- }
163
- token = self.symbols_[token] || token;
164
- }
165
- return token;
166
- }
167
- __name(lex, "lex");
168
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
169
- while (true) {
170
- state = stack[stack.length - 1];
171
- if (this.defaultActions[state]) {
172
- action = this.defaultActions[state];
173
- } else {
174
- if (symbol === null || typeof symbol == "undefined") {
175
- symbol = lex();
176
- }
177
- action = table[state] && table[state][symbol];
178
- }
179
- if (typeof action === "undefined" || !action.length || !action[0]) {
180
- var errStr = "";
181
- expected = [];
182
- for (p in table[state]) {
183
- if (this.terminals_[p] && p > TERROR) {
184
- expected.push("'" + this.terminals_[p] + "'");
185
- }
186
- }
187
- if (lexer2.showPosition) {
188
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
189
- } else {
190
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
191
- }
192
- this.parseError(errStr, {
193
- text: lexer2.match,
194
- token: this.terminals_[symbol] || symbol,
195
- line: lexer2.yylineno,
196
- loc: yyloc,
197
- expected
198
- });
199
- }
200
- if (action[0] instanceof Array && action.length > 1) {
201
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
202
- }
203
- switch (action[0]) {
204
- case 1:
205
- stack.push(symbol);
206
- vstack.push(lexer2.yytext);
207
- lstack.push(lexer2.yylloc);
208
- stack.push(action[1]);
209
- symbol = null;
210
- if (!preErrorSymbol) {
211
- yyleng = lexer2.yyleng;
212
- yytext = lexer2.yytext;
213
- yylineno = lexer2.yylineno;
214
- yyloc = lexer2.yylloc;
215
- if (recovering > 0) {
216
- recovering--;
217
- }
218
- } else {
219
- symbol = preErrorSymbol;
220
- preErrorSymbol = null;
221
- }
222
- break;
223
- case 2:
224
- len = this.productions_[action[1]][1];
225
- yyval.$ = vstack[vstack.length - len];
226
- yyval._$ = {
227
- first_line: lstack[lstack.length - (len || 1)].first_line,
228
- last_line: lstack[lstack.length - 1].last_line,
229
- first_column: lstack[lstack.length - (len || 1)].first_column,
230
- last_column: lstack[lstack.length - 1].last_column
231
- };
232
- if (ranges) {
233
- yyval._$.range = [
234
- lstack[lstack.length - (len || 1)].range[0],
235
- lstack[lstack.length - 1].range[1]
236
- ];
237
- }
238
- r = this.performAction.apply(yyval, [
239
- yytext,
240
- yyleng,
241
- yylineno,
242
- sharedState.yy,
243
- action[1],
244
- vstack,
245
- lstack
246
- ].concat(args));
247
- if (typeof r !== "undefined") {
248
- return r;
249
- }
250
- if (len) {
251
- stack = stack.slice(0, -1 * len * 2);
252
- vstack = vstack.slice(0, -1 * len);
253
- lstack = lstack.slice(0, -1 * len);
254
- }
255
- stack.push(this.productions_[action[1]][0]);
256
- vstack.push(yyval.$);
257
- lstack.push(yyval._$);
258
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
259
- stack.push(newState);
260
- break;
261
- case 3:
262
- return true;
263
- }
264
- }
265
- return true;
266
- }, "parse")
267
- };
268
- var lexer = /* @__PURE__ */ function() {
269
- var lexer2 = {
270
- EOF: 1,
271
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
272
- if (this.yy.parser) {
273
- this.yy.parser.parseError(str, hash);
274
- } else {
275
- throw new Error(str);
276
- }
277
- }, "parseError"),
278
- // resets the lexer, sets new input
279
- setInput: /* @__PURE__ */ __name(function(input, yy) {
280
- this.yy = yy || this.yy || {};
281
- this._input = input;
282
- this._more = this._backtrack = this.done = false;
283
- this.yylineno = this.yyleng = 0;
284
- this.yytext = this.matched = this.match = "";
285
- this.conditionStack = ["INITIAL"];
286
- this.yylloc = {
287
- first_line: 1,
288
- first_column: 0,
289
- last_line: 1,
290
- last_column: 0
291
- };
292
- if (this.options.ranges) {
293
- this.yylloc.range = [0, 0];
294
- }
295
- this.offset = 0;
296
- return this;
297
- }, "setInput"),
298
- // consumes and returns one char from the input
299
- input: /* @__PURE__ */ __name(function() {
300
- var ch = this._input[0];
301
- this.yytext += ch;
302
- this.yyleng++;
303
- this.offset++;
304
- this.match += ch;
305
- this.matched += ch;
306
- var lines = ch.match(/(?:\r\n?|\n).*/g);
307
- if (lines) {
308
- this.yylineno++;
309
- this.yylloc.last_line++;
310
- } else {
311
- this.yylloc.last_column++;
312
- }
313
- if (this.options.ranges) {
314
- this.yylloc.range[1]++;
315
- }
316
- this._input = this._input.slice(1);
317
- return ch;
318
- }, "input"),
319
- // unshifts one char (or a string) into the input
320
- unput: /* @__PURE__ */ __name(function(ch) {
321
- var len = ch.length;
322
- var lines = ch.split(/(?:\r\n?|\n)/g);
323
- this._input = ch + this._input;
324
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
325
- this.offset -= len;
326
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
327
- this.match = this.match.substr(0, this.match.length - 1);
328
- this.matched = this.matched.substr(0, this.matched.length - 1);
329
- if (lines.length - 1) {
330
- this.yylineno -= lines.length - 1;
331
- }
332
- var r = this.yylloc.range;
333
- this.yylloc = {
334
- first_line: this.yylloc.first_line,
335
- last_line: this.yylineno + 1,
336
- first_column: this.yylloc.first_column,
337
- last_column: lines ? (lines.length === oldLines.length ? this.yylloc.first_column : 0) + oldLines[oldLines.length - lines.length].length - lines[0].length : this.yylloc.first_column - len
338
- };
339
- if (this.options.ranges) {
340
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
341
- }
342
- this.yyleng = this.yytext.length;
343
- return this;
344
- }, "unput"),
345
- // When called from action, caches matched text and appends it on next action
346
- more: /* @__PURE__ */ __name(function() {
347
- this._more = true;
348
- return this;
349
- }, "more"),
350
- // When called from action, signals the lexer that this rule fails to match the input, so the next matching rule (regex) should be tested instead.
351
- reject: /* @__PURE__ */ __name(function() {
352
- if (this.options.backtrack_lexer) {
353
- this._backtrack = true;
354
- } else {
355
- 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).\n" + this.showPosition(), {
356
- text: "",
357
- token: null,
358
- line: this.yylineno
359
- });
360
- }
361
- return this;
362
- }, "reject"),
363
- // retain first n characters of the match
364
- less: /* @__PURE__ */ __name(function(n) {
365
- this.unput(this.match.slice(n));
366
- }, "less"),
367
- // displays already matched input, i.e. for error messages
368
- pastInput: /* @__PURE__ */ __name(function() {
369
- var past = this.matched.substr(0, this.matched.length - this.match.length);
370
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
371
- }, "pastInput"),
372
- // displays upcoming input, i.e. for error messages
373
- upcomingInput: /* @__PURE__ */ __name(function() {
374
- var next = this.match;
375
- if (next.length < 20) {
376
- next += this._input.substr(0, 20 - next.length);
377
- }
378
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
379
- }, "upcomingInput"),
380
- // displays the character position where the lexing error occurred, i.e. for error messages
381
- showPosition: /* @__PURE__ */ __name(function() {
382
- var pre = this.pastInput();
383
- var c = new Array(pre.length + 1).join("-");
384
- return pre + this.upcomingInput() + "\n" + c + "^";
385
- }, "showPosition"),
386
- // test the lexed token: return FALSE when not a match, otherwise return token
387
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
388
- var token, lines, backup;
389
- if (this.options.backtrack_lexer) {
390
- backup = {
391
- yylineno: this.yylineno,
392
- yylloc: {
393
- first_line: this.yylloc.first_line,
394
- last_line: this.last_line,
395
- first_column: this.yylloc.first_column,
396
- last_column: this.yylloc.last_column
397
- },
398
- yytext: this.yytext,
399
- match: this.match,
400
- matches: this.matches,
401
- matched: this.matched,
402
- yyleng: this.yyleng,
403
- offset: this.offset,
404
- _more: this._more,
405
- _input: this._input,
406
- yy: this.yy,
407
- conditionStack: this.conditionStack.slice(0),
408
- done: this.done
409
- };
410
- if (this.options.ranges) {
411
- backup.yylloc.range = this.yylloc.range.slice(0);
412
- }
413
- }
414
- lines = match[0].match(/(?:\r\n?|\n).*/g);
415
- if (lines) {
416
- this.yylineno += lines.length;
417
- }
418
- this.yylloc = {
419
- first_line: this.yylloc.last_line,
420
- last_line: this.yylineno + 1,
421
- first_column: this.yylloc.last_column,
422
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
423
- };
424
- this.yytext += match[0];
425
- this.match += match[0];
426
- this.matches = match;
427
- this.yyleng = this.yytext.length;
428
- if (this.options.ranges) {
429
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
430
- }
431
- this._more = false;
432
- this._backtrack = false;
433
- this._input = this._input.slice(match[0].length);
434
- this.matched += match[0];
435
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
436
- if (this.done && this._input) {
437
- this.done = false;
438
- }
439
- if (token) {
440
- return token;
441
- } else if (this._backtrack) {
442
- for (var k in backup) {
443
- this[k] = backup[k];
444
- }
445
- return false;
446
- }
447
- return false;
448
- }, "test_match"),
449
- // return next match in input
450
- next: /* @__PURE__ */ __name(function() {
451
- if (this.done) {
452
- return this.EOF;
453
- }
454
- if (!this._input) {
455
- this.done = true;
456
- }
457
- var token, match, tempMatch, index;
458
- if (!this._more) {
459
- this.yytext = "";
460
- this.match = "";
461
- }
462
- var rules = this._currentRules();
463
- for (var i = 0; i < rules.length; i++) {
464
- tempMatch = this._input.match(this.rules[rules[i]]);
465
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
466
- match = tempMatch;
467
- index = i;
468
- if (this.options.backtrack_lexer) {
469
- token = this.test_match(tempMatch, rules[i]);
470
- if (token !== false) {
471
- return token;
472
- } else if (this._backtrack) {
473
- match = false;
474
- continue;
475
- } else {
476
- return false;
477
- }
478
- } else if (!this.options.flex) {
479
- break;
480
- }
481
- }
482
- }
483
- if (match) {
484
- token = this.test_match(match, rules[index]);
485
- if (token !== false) {
486
- return token;
487
- }
488
- return false;
489
- }
490
- if (this._input === "") {
491
- return this.EOF;
492
- } else {
493
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
494
- text: "",
495
- token: null,
496
- line: this.yylineno
497
- });
498
- }
499
- }, "next"),
500
- // return next match that has a token
501
- lex: /* @__PURE__ */ __name(function lex() {
502
- var r = this.next();
503
- if (r) {
504
- return r;
505
- } else {
506
- return this.lex();
507
- }
508
- }, "lex"),
509
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
510
- begin: /* @__PURE__ */ __name(function begin(condition) {
511
- this.conditionStack.push(condition);
512
- }, "begin"),
513
- // pop the previously active lexer condition state off the condition stack
514
- popState: /* @__PURE__ */ __name(function popState() {
515
- var n = this.conditionStack.length - 1;
516
- if (n > 0) {
517
- return this.conditionStack.pop();
518
- } else {
519
- return this.conditionStack[0];
520
- }
521
- }, "popState"),
522
- // produce the lexer rule set which is active for the currently active lexer condition state
523
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
524
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
525
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
526
- } else {
527
- return this.conditions["INITIAL"].rules;
528
- }
529
- }, "_currentRules"),
530
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
531
- topState: /* @__PURE__ */ __name(function topState(n) {
532
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
533
- if (n >= 0) {
534
- return this.conditionStack[n];
535
- } else {
536
- return "INITIAL";
537
- }
538
- }, "topState"),
539
- // alias for begin(condition)
540
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
541
- this.begin(condition);
542
- }, "pushState"),
543
- // return the number of states currently on the stack
544
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
545
- return this.conditionStack.length;
546
- }, "stateStackSize"),
547
- options: { "case-insensitive": true },
548
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
549
- var YYSTATE = YY_START;
550
- switch ($avoiding_name_collisions) {
551
- case 0:
552
- this.pushState("shapeData");
553
- yy_.yytext = "";
554
- return 24;
555
- break;
556
- case 1:
557
- this.pushState("shapeDataStr");
558
- return 24;
559
- break;
560
- case 2:
561
- this.popState();
562
- return 24;
563
- break;
564
- case 3:
565
- const re = /\n\s*/g;
566
- yy_.yytext = yy_.yytext.replace(re, "<br/>");
567
- return 24;
568
- break;
569
- case 4:
570
- return 24;
571
- break;
572
- case 5:
573
- this.popState();
574
- break;
575
- case 6:
576
- yy.getLogger().trace("Found comment", yy_.yytext);
577
- return 6;
578
- break;
579
- case 7:
580
- return 8;
581
- break;
582
- case 8:
583
- this.begin("CLASS");
584
- break;
585
- case 9:
586
- this.popState();
587
- return 17;
588
- break;
589
- case 10:
590
- this.popState();
591
- break;
592
- case 11:
593
- yy.getLogger().trace("Begin icon");
594
- this.begin("ICON");
595
- break;
596
- case 12:
597
- yy.getLogger().trace("SPACELINE");
598
- return 6;
599
- break;
600
- case 13:
601
- return 7;
602
- break;
603
- case 14:
604
- return 16;
605
- break;
606
- case 15:
607
- yy.getLogger().trace("end icon");
608
- this.popState();
609
- break;
610
- case 16:
611
- yy.getLogger().trace("Exploding node");
612
- this.begin("NODE");
613
- return 20;
614
- break;
615
- case 17:
616
- yy.getLogger().trace("Cloud");
617
- this.begin("NODE");
618
- return 20;
619
- break;
620
- case 18:
621
- yy.getLogger().trace("Explosion Bang");
622
- this.begin("NODE");
623
- return 20;
624
- break;
625
- case 19:
626
- yy.getLogger().trace("Cloud Bang");
627
- this.begin("NODE");
628
- return 20;
629
- break;
630
- case 20:
631
- this.begin("NODE");
632
- return 20;
633
- break;
634
- case 21:
635
- this.begin("NODE");
636
- return 20;
637
- break;
638
- case 22:
639
- this.begin("NODE");
640
- return 20;
641
- break;
642
- case 23:
643
- this.begin("NODE");
644
- return 20;
645
- break;
646
- case 24:
647
- return 13;
648
- break;
649
- case 25:
650
- return 23;
651
- break;
652
- case 26:
653
- return 11;
654
- break;
655
- case 27:
656
- this.begin("NSTR2");
657
- break;
658
- case 28:
659
- return "NODE_DESCR";
660
- break;
661
- case 29:
662
- this.popState();
663
- break;
664
- case 30:
665
- yy.getLogger().trace("Starting NSTR");
666
- this.begin("NSTR");
667
- break;
668
- case 31:
669
- yy.getLogger().trace("description:", yy_.yytext);
670
- return "NODE_DESCR";
671
- break;
672
- case 32:
673
- this.popState();
674
- break;
675
- case 33:
676
- this.popState();
677
- yy.getLogger().trace("node end ))");
678
- return "NODE_DEND";
679
- break;
680
- case 34:
681
- this.popState();
682
- yy.getLogger().trace("node end )");
683
- return "NODE_DEND";
684
- break;
685
- case 35:
686
- this.popState();
687
- yy.getLogger().trace("node end ...", yy_.yytext);
688
- return "NODE_DEND";
689
- break;
690
- case 36:
691
- this.popState();
692
- yy.getLogger().trace("node end ((");
693
- return "NODE_DEND";
694
- break;
695
- case 37:
696
- this.popState();
697
- yy.getLogger().trace("node end (-");
698
- return "NODE_DEND";
699
- break;
700
- case 38:
701
- this.popState();
702
- yy.getLogger().trace("node end (-");
703
- return "NODE_DEND";
704
- break;
705
- case 39:
706
- this.popState();
707
- yy.getLogger().trace("node end ((");
708
- return "NODE_DEND";
709
- break;
710
- case 40:
711
- this.popState();
712
- yy.getLogger().trace("node end ((");
713
- return "NODE_DEND";
714
- break;
715
- case 41:
716
- yy.getLogger().trace("Long description:", yy_.yytext);
717
- return 21;
718
- break;
719
- case 42:
720
- yy.getLogger().trace("Long description:", yy_.yytext);
721
- return 21;
722
- break;
723
- }
724
- }, "anonymous"),
725
- rules: [/^(?:@\{)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^\"]+)/i, /^(?:[^}^"]+)/i, /^(?:\})/i, /^(?:\s*%%.*)/i, /^(?:kanban\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}@]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
726
- conditions: { "shapeDataEndBracket": { "rules": [], "inclusive": false }, "shapeDataStr": { "rules": [2, 3], "inclusive": false }, "shapeData": { "rules": [1, 4, 5], "inclusive": false }, "CLASS": { "rules": [9, 10], "inclusive": false }, "ICON": { "rules": [14, 15], "inclusive": false }, "NSTR2": { "rules": [28, 29], "inclusive": false }, "NSTR": { "rules": [31, 32], "inclusive": false }, "NODE": { "rules": [27, 30, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42], "inclusive": false }, "INITIAL": { "rules": [0, 6, 7, 8, 11, 12, 13, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26], "inclusive": true } }
727
- };
728
- return lexer2;
729
- }();
730
- parser2.lexer = lexer;
731
- function Parser() {
732
- this.yy = {};
733
- }
734
- __name(Parser, "Parser");
735
- Parser.prototype = parser2;
736
- parser2.Parser = Parser;
737
- return new Parser();
738
- }();
739
- parser.parser = parser;
740
- var kanban_default = parser;
741
- var nodes = [];
742
- var sections = [];
743
- var cnt = 0;
744
- var elements = {};
745
- var clear = /* @__PURE__ */ __name(() => {
746
- nodes = [];
747
- sections = [];
748
- cnt = 0;
749
- elements = {};
750
- }, "clear");
751
- var getSection = /* @__PURE__ */ __name((level) => {
752
- if (nodes.length === 0) {
753
- return null;
754
- }
755
- const sectionLevel = nodes[0].level;
756
- let lastSection = null;
757
- for (let i = nodes.length - 1; i >= 0; i--) {
758
- if (nodes[i].level === sectionLevel && !lastSection) {
759
- lastSection = nodes[i];
760
- }
761
- if (nodes[i].level < sectionLevel) {
762
- throw new Error('Items without section detected, found section ("' + nodes[i].label + '")');
763
- }
764
- }
765
- if (level === lastSection?.level) {
766
- return null;
767
- }
768
- return lastSection;
769
- }, "getSection");
770
- var getSections = /* @__PURE__ */ __name(function() {
771
- return sections;
772
- }, "getSections");
773
- var getData = /* @__PURE__ */ __name(function() {
774
- const edges = [];
775
- const _nodes = [];
776
- const sections2 = getSections();
777
- const conf = getConfig2();
778
- for (const section of sections2) {
779
- const node = {
780
- id: section.id,
781
- label: sanitizeText(section.label ?? "", conf),
782
- isGroup: true,
783
- ticket: section.ticket,
784
- shape: "kanbanSection",
785
- level: section.level,
786
- look: conf.look
787
- };
788
- _nodes.push(node);
789
- const children = nodes.filter((n) => n.parentId === section.id);
790
- for (const item of children) {
791
- const childNode = {
792
- id: item.id,
793
- parentId: section.id,
794
- label: sanitizeText(item.label ?? "", conf),
795
- isGroup: false,
796
- ticket: item?.ticket,
797
- priority: item?.priority,
798
- assigned: item?.assigned,
799
- icon: item?.icon,
800
- shape: "kanbanItem",
801
- level: item.level,
802
- rx: 5,
803
- ry: 5,
804
- cssStyles: ["text-align: left"]
805
- };
806
- _nodes.push(childNode);
807
- }
808
- }
809
- return { nodes: _nodes, edges, other: {}, config: getConfig2() };
810
- }, "getData");
811
- var addNode = /* @__PURE__ */ __name((level, id, descr, type, shapeData) => {
812
- const conf = getConfig2();
813
- let padding = conf.mindmap?.padding ?? defaultConfig_default.mindmap.padding;
814
- switch (type) {
815
- case nodeType.ROUNDED_RECT:
816
- case nodeType.RECT:
817
- case nodeType.HEXAGON:
818
- padding *= 2;
819
- }
820
- const node = {
821
- id: sanitizeText(id, conf) || "kbn" + cnt++,
822
- level,
823
- label: sanitizeText(descr, conf),
824
- width: conf.mindmap?.maxNodeWidth ?? defaultConfig_default.mindmap.maxNodeWidth,
825
- padding,
826
- isGroup: false
827
- };
828
- if (shapeData !== void 0) {
829
- let yamlData;
830
- if (!shapeData.includes("\n")) {
831
- yamlData = "{\n" + shapeData + "\n}";
832
- } else {
833
- yamlData = shapeData + "\n";
834
- }
835
- const doc = load(yamlData, { schema: JSON_SCHEMA });
836
- if (doc.shape && (doc.shape !== doc.shape.toLowerCase() || doc.shape.includes("_"))) {
837
- throw new Error(`No such shape: ${doc.shape}. Shape names should be lowercase.`);
838
- }
839
- if (doc?.shape && doc.shape === "kanbanItem") {
840
- node.shape = doc?.shape;
841
- }
842
- if (doc?.label) {
843
- node.label = doc?.label;
844
- }
845
- if (doc?.icon) {
846
- node.icon = doc?.icon.toString();
847
- }
848
- if (doc?.assigned) {
849
- node.assigned = doc?.assigned.toString();
850
- }
851
- if (doc?.ticket) {
852
- node.ticket = doc?.ticket.toString();
853
- }
854
- if (doc?.priority) {
855
- node.priority = doc?.priority;
856
- }
857
- }
858
- const section = getSection(level);
859
- if (section) {
860
- node.parentId = section.id || "kbn" + cnt++;
861
- } else {
862
- sections.push(node);
863
- }
864
- nodes.push(node);
865
- }, "addNode");
866
- var nodeType = {
867
- DEFAULT: 0,
868
- NO_BORDER: 0,
869
- ROUNDED_RECT: 1,
870
- RECT: 2,
871
- CIRCLE: 3,
872
- CLOUD: 4,
873
- BANG: 5,
874
- HEXAGON: 6
875
- };
876
- var getType = /* @__PURE__ */ __name((startStr, endStr) => {
877
- log.debug("In get type", startStr, endStr);
878
- switch (startStr) {
879
- case "[":
880
- return nodeType.RECT;
881
- case "(":
882
- return endStr === ")" ? nodeType.ROUNDED_RECT : nodeType.CLOUD;
883
- case "((":
884
- return nodeType.CIRCLE;
885
- case ")":
886
- return nodeType.CLOUD;
887
- case "))":
888
- return nodeType.BANG;
889
- case "{{":
890
- return nodeType.HEXAGON;
891
- default:
892
- return nodeType.DEFAULT;
893
- }
894
- }, "getType");
895
- var setElementForId = /* @__PURE__ */ __name((id, element) => {
896
- elements[id] = element;
897
- }, "setElementForId");
898
- var decorateNode = /* @__PURE__ */ __name((decoration) => {
899
- if (!decoration) {
900
- return;
901
- }
902
- const config = getConfig2();
903
- const node = nodes[nodes.length - 1];
904
- if (decoration.icon) {
905
- node.icon = sanitizeText(decoration.icon, config);
906
- }
907
- if (decoration.class) {
908
- node.cssClasses = sanitizeText(decoration.class, config);
909
- }
910
- }, "decorateNode");
911
- var type2Str = /* @__PURE__ */ __name((type) => {
912
- switch (type) {
913
- case nodeType.DEFAULT:
914
- return "no-border";
915
- case nodeType.RECT:
916
- return "rect";
917
- case nodeType.ROUNDED_RECT:
918
- return "rounded-rect";
919
- case nodeType.CIRCLE:
920
- return "circle";
921
- case nodeType.CLOUD:
922
- return "cloud";
923
- case nodeType.BANG:
924
- return "bang";
925
- case nodeType.HEXAGON:
926
- return "hexgon";
927
- default:
928
- return "no-border";
929
- }
930
- }, "type2Str");
931
- var getLogger = /* @__PURE__ */ __name(() => log, "getLogger");
932
- var getElementById = /* @__PURE__ */ __name((id) => elements[id], "getElementById");
933
- var db = {
934
- clear,
935
- addNode,
936
- getSections,
937
- getData,
938
- nodeType,
939
- getType,
940
- setElementForId,
941
- decorateNode,
942
- type2Str,
943
- getLogger,
944
- getElementById
945
- };
946
- var kanbanDb_default = db;
947
- var draw = /* @__PURE__ */ __name(async (text, id, _version, diagObj) => {
948
- log.debug("Rendering kanban diagram\n" + text);
949
- const db2 = diagObj.db;
950
- const data4Layout = db2.getData();
951
- const conf = getConfig2();
952
- conf.htmlLabels = false;
953
- const svg = selectSvgElement(id);
954
- const sectionsElem = svg.append("g");
955
- sectionsElem.attr("class", "sections");
956
- const nodesElem = svg.append("g");
957
- nodesElem.attr("class", "items");
958
- const sections2 = data4Layout.nodes.filter(
959
- // TODO: TypeScript 5.5 will infer this predicate automatically
960
- (node) => node.isGroup
961
- );
962
- let cnt2 = 0;
963
- const padding = 10;
964
- const sectionObjects = [];
965
- let maxLabelHeight = 25;
966
- for (const section of sections2) {
967
- const WIDTH = conf?.kanban?.sectionWidth || 200;
968
- cnt2 = cnt2 + 1;
969
- section.x = WIDTH * cnt2 + (cnt2 - 1) * padding / 2;
970
- section.width = WIDTH;
971
- section.y = 0;
972
- section.height = WIDTH * 3;
973
- section.rx = 5;
974
- section.ry = 5;
975
- section.cssClasses = section.cssClasses + " section-" + cnt2;
976
- const sectionObj = await insertCluster(sectionsElem, section);
977
- maxLabelHeight = Math.max(maxLabelHeight, sectionObj?.labelBBox?.height);
978
- sectionObjects.push(sectionObj);
979
- }
980
- let i = 0;
981
- for (const section of sections2) {
982
- const sectionObj = sectionObjects[i];
983
- i = i + 1;
984
- const WIDTH = conf?.kanban?.sectionWidth || 200;
985
- const top = -WIDTH * 3 / 2 + maxLabelHeight;
986
- let y = top;
987
- const sectionItems = data4Layout.nodes.filter((node) => node.parentId === section.id);
988
- for (const item of sectionItems) {
989
- if (item.isGroup) {
990
- throw new Error("Groups within groups are not allowed in Kanban diagrams");
991
- }
992
- item.x = section.x;
993
- item.width = WIDTH - 1.5 * padding;
994
- const nodeEl = await insertNode(nodesElem, item, { config: conf });
995
- const bbox = nodeEl.node().getBBox();
996
- item.y = y + bbox.height / 2;
997
- await positionNode(item);
998
- y = item.y + bbox.height / 2 + padding / 2;
999
- }
1000
- const rect = sectionObj.cluster.select("rect");
1001
- const height = Math.max(y - top + 3 * padding, 50) + (maxLabelHeight - 25);
1002
- rect.attr("height", height);
1003
- }
1004
- setupGraphViewbox(
1005
- void 0,
1006
- svg,
1007
- conf.mindmap?.padding ?? defaultConfig_default.kanban.padding,
1008
- conf.mindmap?.useMaxWidth ?? defaultConfig_default.kanban.useMaxWidth
1009
- );
1010
- }, "draw");
1011
- var kanbanRenderer_default = {
1012
- draw
1013
- };
1014
- var genSections = /* @__PURE__ */ __name((options) => {
1015
- let sections2 = "";
1016
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1017
- options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1018
- if (is_dark_default(options["lineColor" + i])) {
1019
- options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1020
- } else {
1021
- options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1022
- }
1023
- }
1024
- const adjuster = /* @__PURE__ */ __name((color, level) => options.darkMode ? darken_default(color, level) : lighten_default(color, level), "adjuster");
1025
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1026
- const sw = "" + (17 - 3 * i);
1027
- sections2 += `
1028
- .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} polygon, .section-${i - 1} path {
1029
- fill: ${adjuster(options["cScale" + i], 10)};
1030
- stroke: ${adjuster(options["cScale" + i], 10)};
1031
-
1032
- }
1033
- .section-${i - 1} text {
1034
- fill: ${options["cScaleLabel" + i]};
1035
- }
1036
- .node-icon-${i - 1} {
1037
- font-size: 40px;
1038
- color: ${options["cScaleLabel" + i]};
1039
- }
1040
- .section-edge-${i - 1}{
1041
- stroke: ${options["cScale" + i]};
1042
- }
1043
- .edge-depth-${i - 1}{
1044
- stroke-width: ${sw};
1045
- }
1046
- .section-${i - 1} line {
1047
- stroke: ${options["cScaleInv" + i]} ;
1048
- stroke-width: 3;
1049
- }
1050
-
1051
- .disabled, .disabled circle, .disabled text {
1052
- fill: lightgray;
1053
- }
1054
- .disabled text {
1055
- fill: #efefef;
1056
- }
1057
-
1058
- .node rect,
1059
- .node circle,
1060
- .node ellipse,
1061
- .node polygon,
1062
- .node path {
1063
- fill: ${options.background};
1064
- stroke: ${options.nodeBorder};
1065
- stroke-width: 1px;
1066
- }
1067
-
1068
- .kanban-ticket-link {
1069
- fill: ${options.background};
1070
- stroke: ${options.nodeBorder};
1071
- text-decoration: underline;
1072
- }
1073
- `;
1074
- }
1075
- return sections2;
1076
- }, "genSections");
1077
- var getStyles = /* @__PURE__ */ __name((options) => `
1078
- .edge {
1079
- stroke-width: 3;
1080
- }
1081
- ${genSections(options)}
1082
- .section-root rect, .section-root path, .section-root circle, .section-root polygon {
1083
- fill: ${options.git0};
1084
- }
1085
- .section-root text {
1086
- fill: ${options.gitBranchLabel0};
1087
- }
1088
- .icon-container {
1089
- height:100%;
1090
- display: flex;
1091
- justify-content: center;
1092
- align-items: center;
1093
- }
1094
- .edge {
1095
- fill: none;
1096
- }
1097
- .cluster-label, .label {
1098
- color: ${options.textColor};
1099
- fill: ${options.textColor};
1100
- }
1101
- .kanban-label {
1102
- dy: 1em;
1103
- alignment-baseline: middle;
1104
- text-anchor: middle;
1105
- dominant-baseline: middle;
1106
- text-align: center;
1107
- }
1108
- `, "getStyles");
1109
- var styles_default = getStyles;
1110
- var diagram = {
1111
- db: kanbanDb_default,
1112
- renderer: kanbanRenderer_default,
1113
- parser: kanban_default,
1114
- styles: styles_default
1115
- };
1116
- export {
1117
- diagram
1118
- };
1119
- //# sourceMappingURL=kanban-definition-QRCXZQQD-NWU5I3TK.js.map