@oxide/design-system 1.7.7--canary.fc65d31.0 → 1.7.7--canary.5c25e1b.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 (130) hide show
  1. package/components/dist/index.d.ts +2 -5
  2. package/components/dist/index.js +126 -1729
  3. package/components/dist/index.js.map +1 -1
  4. package/package.json +1 -2
  5. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js +0 -14
  6. package/components/dist/architecture-I3QFYML2-YZWO3N3B.js.map +0 -1
  7. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js +0 -8846
  8. package/components/dist/architectureDiagram-UYN6MBPD-HXPGIDN7.js.map +0 -1
  9. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js +0 -3721
  10. package/components/dist/blockDiagram-ZHA2E4KO-OAYYKCLF.js.map +0 -1
  11. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js +0 -2599
  12. package/components/dist/c4Diagram-6F5ED5ID-TBHFK2XY.js.map +0 -1
  13. package/components/dist/chunk-2DDKDUUO.js +0 -439
  14. package/components/dist/chunk-2DDKDUUO.js.map +0 -1
  15. package/components/dist/chunk-2NHDMTP7.js +0 -26905
  16. package/components/dist/chunk-2NHDMTP7.js.map +0 -1
  17. package/components/dist/chunk-4IJS44L3.js +0 -22
  18. package/components/dist/chunk-4IJS44L3.js.map +0 -1
  19. package/components/dist/chunk-562WOS3Z.js +0 -1109
  20. package/components/dist/chunk-562WOS3Z.js.map +0 -1
  21. package/components/dist/chunk-6UD2HOKB.js +0 -17082
  22. package/components/dist/chunk-6UD2HOKB.js.map +0 -1
  23. package/components/dist/chunk-76BOQ7BT.js +0 -63
  24. package/components/dist/chunk-76BOQ7BT.js.map +0 -1
  25. package/components/dist/chunk-7I5DT373.js +0 -97
  26. package/components/dist/chunk-7I5DT373.js.map +0 -1
  27. package/components/dist/chunk-BPREMNVP.js +0 -1875
  28. package/components/dist/chunk-BPREMNVP.js.map +0 -1
  29. package/components/dist/chunk-BVYAEHG3.js +0 -122
  30. package/components/dist/chunk-BVYAEHG3.js.map +0 -1
  31. package/components/dist/chunk-BW7DFBOS.js +0 -152
  32. package/components/dist/chunk-BW7DFBOS.js.map +0 -1
  33. package/components/dist/chunk-EZG2MNHW.js +0 -59
  34. package/components/dist/chunk-EZG2MNHW.js.map +0 -1
  35. package/components/dist/chunk-G6QWNAHJ.js +0 -43
  36. package/components/dist/chunk-G6QWNAHJ.js.map +0 -1
  37. package/components/dist/chunk-H72D3HRR.js +0 -1244
  38. package/components/dist/chunk-H72D3HRR.js.map +0 -1
  39. package/components/dist/chunk-K532NZMW.js +0 -46
  40. package/components/dist/chunk-K532NZMW.js.map +0 -1
  41. package/components/dist/chunk-LC3BX2KL.js +0 -25
  42. package/components/dist/chunk-LC3BX2KL.js.map +0 -1
  43. package/components/dist/chunk-LQ2ABR7F.js +0 -5665
  44. package/components/dist/chunk-LQ2ABR7F.js.map +0 -1
  45. package/components/dist/chunk-M6L3MM6K.js +0 -22
  46. package/components/dist/chunk-M6L3MM6K.js.map +0 -1
  47. package/components/dist/chunk-MWA4PRRW.js +0 -122
  48. package/components/dist/chunk-MWA4PRRW.js.map +0 -1
  49. package/components/dist/chunk-ND3FLKHU.js +0 -570
  50. package/components/dist/chunk-ND3FLKHU.js.map +0 -1
  51. package/components/dist/chunk-NIVHLOPB.js +0 -2621
  52. package/components/dist/chunk-NIVHLOPB.js.map +0 -1
  53. package/components/dist/chunk-R6F6FFK7.js +0 -65
  54. package/components/dist/chunk-R6F6FFK7.js.map +0 -1
  55. package/components/dist/chunk-RN5R3L7O.js +0 -2041
  56. package/components/dist/chunk-RN5R3L7O.js.map +0 -1
  57. package/components/dist/chunk-RWDBBMDN.js +0 -10910
  58. package/components/dist/chunk-RWDBBMDN.js.map +0 -1
  59. package/components/dist/chunk-T7HPDS4Z.js +0 -573
  60. package/components/dist/chunk-T7HPDS4Z.js.map +0 -1
  61. package/components/dist/chunk-TG4YEU4Q.js +0 -23
  62. package/components/dist/chunk-TG4YEU4Q.js.map +0 -1
  63. package/components/dist/chunk-U5WCXBW2.js +0 -48
  64. package/components/dist/chunk-U5WCXBW2.js.map +0 -1
  65. package/components/dist/chunk-V6PWN6OH.js +0 -1875
  66. package/components/dist/chunk-V6PWN6OH.js.map +0 -1
  67. package/components/dist/chunk-VLTHNCSD.js +0 -48
  68. package/components/dist/chunk-VLTHNCSD.js.map +0 -1
  69. package/components/dist/chunk-WDK4G4UR.js +0 -2791
  70. package/components/dist/chunk-WDK4G4UR.js.map +0 -1
  71. package/components/dist/chunk-WLVQWTC6.js +0 -77
  72. package/components/dist/chunk-WLVQWTC6.js.map +0 -1
  73. package/components/dist/chunk-YDLS5R4M.js +0 -48
  74. package/components/dist/chunk-YDLS5R4M.js.map +0 -1
  75. package/components/dist/chunk-YGFBWU2Q.js +0 -7
  76. package/components/dist/chunk-YGFBWU2Q.js.map +0 -1
  77. package/components/dist/chunk-ZBL4CWCH.js +0 -2120
  78. package/components/dist/chunk-ZBL4CWCH.js.map +0 -1
  79. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js +0 -40
  80. package/components/dist/classDiagram-LNE6IOMH-VRQHEQWM.js.map +0 -1
  81. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js +0 -40
  82. package/components/dist/classDiagram-v2-MQ7JQ4JX-5GB4NXXM.js.map +0 -1
  83. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js +0 -734
  84. package/components/dist/dagre-4EVJKHTY-XW45LMKR.js.map +0 -1
  85. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js +0 -226
  86. package/components/dist/diagram-QW4FP2JN-J2YMUPB5.js.map +0 -1
  87. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js +0 -1381
  88. package/components/dist/erDiagram-6RL3IURR-HQULDVJI.js.map +0 -1
  89. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js +0 -2349
  90. package/components/dist/flowDiagram-7ASYPVHJ-2542732I.js.map +0 -1
  91. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js +0 -2413
  92. package/components/dist/ganttDiagram-NTVNEXSI-V66YQQB3.js.map +0 -1
  93. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js +0 -14
  94. package/components/dist/gitGraph-YCYPL57B-AAXPWQN7.js.map +0 -1
  95. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js +0 -1763
  96. package/components/dist/gitGraphDiagram-NRZ2UAAF-5DU6QMYZ.js.map +0 -1
  97. package/components/dist/info-46DW6VJ7-43TTIEYF.js +0 -14
  98. package/components/dist/info-46DW6VJ7-43TTIEYF.js.map +0 -1
  99. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js +0 -54
  100. package/components/dist/infoDiagram-A4XQUW5V-UZERSQDI.js.map +0 -1
  101. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js +0 -1244
  102. package/components/dist/journeyDiagram-G5WM74LC-RVKMRGRW.js.map +0 -1
  103. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js +0 -1119
  104. package/components/dist/kanban-definition-QRCXZQQD-NWU5I3TK.js.map +0 -1
  105. package/components/dist/katex-WNZY3CE5.js +0 -14484
  106. package/components/dist/katex-WNZY3CE5.js.map +0 -1
  107. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js +0 -6013
  108. package/components/dist/mindmap-definition-GWI6TPTV-MISEH6LG.js.map +0 -1
  109. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js +0 -14
  110. package/components/dist/packet-W2GHVCYJ-FBZCFIPR.js.map +0 -1
  111. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js +0 -14
  112. package/components/dist/pie-BEWT4RHE-UFFBBCXM.js.map +0 -1
  113. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js +0 -223
  114. package/components/dist/pieDiagram-YF2LJOPJ-IXEVHPCM.js.map +0 -1
  115. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js +0 -1408
  116. package/components/dist/quadrantDiagram-OS5C2QUG-MW26UCZV.js.map +0 -1
  117. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js +0 -1175
  118. package/components/dist/requirementDiagram-MIRIMTAZ-BX24AAHL.js.map +0 -1
  119. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js +0 -1278
  120. package/components/dist/sankeyDiagram-Y46BX6SQ-5RKUGG63.js.map +0 -1
  121. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js +0 -3529
  122. package/components/dist/sequenceDiagram-G6AWOVSC-2T3JBUZ2.js.map +0 -1
  123. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js +0 -505
  124. package/components/dist/stateDiagram-MAYHULR4-HZ5EGLPA.js.map +0 -1
  125. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js +0 -40
  126. package/components/dist/stateDiagram-v2-4JROLMXI-DN2FEZV3.js.map +0 -1
  127. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js +0 -1260
  128. package/components/dist/timeline-definition-U7ZMHBDA-GB6AKKW4.js.map +0 -1
  129. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js +0 -1877
  130. package/components/dist/xychartDiagram-6QU3TZC5-BFFLEHUP.js.map +0 -1
@@ -1,1260 +0,0 @@
1
- import {
2
- __export,
3
- __name,
4
- arc_default,
5
- clear,
6
- commonDb_exports,
7
- darken_default,
8
- getConfig2,
9
- is_dark_default,
10
- lighten_default,
11
- log,
12
- select_default,
13
- setupGraphViewbox
14
- } from "./chunk-RWDBBMDN.js";
15
- import "./chunk-K532NZMW.js";
16
-
17
- // node_modules/mermaid/dist/chunks/mermaid.core/timeline-definition-U7ZMHBDA.mjs
18
- var parser = function() {
19
- var o = /* @__PURE__ */ __name(function(k, v, o2, l) {
20
- for (o2 = o2 || {}, l = k.length; l--; o2[k[l]] = v)
21
- ;
22
- return o2;
23
- }, "o"), $V0 = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], $V1 = [1, 9], $V2 = [1, 10], $V3 = [1, 11], $V4 = [1, 12], $V5 = [1, 13], $V6 = [1, 16], $V7 = [1, 17];
24
- var parser2 = {
25
- trace: /* @__PURE__ */ __name(function trace() {
26
- }, "trace"),
27
- yy: {},
28
- 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 },
29
- 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" },
30
- 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]],
31
- performAction: /* @__PURE__ */ __name(function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$) {
32
- var $0 = $$.length - 1;
33
- switch (yystate) {
34
- case 1:
35
- return $$[$0 - 1];
36
- break;
37
- case 2:
38
- this.$ = [];
39
- break;
40
- case 3:
41
- $$[$0 - 1].push($$[$0]);
42
- this.$ = $$[$0 - 1];
43
- break;
44
- case 4:
45
- case 5:
46
- this.$ = $$[$0];
47
- break;
48
- case 6:
49
- case 7:
50
- this.$ = [];
51
- break;
52
- case 8:
53
- yy.getCommonDb().setDiagramTitle($$[$0].substr(6));
54
- this.$ = $$[$0].substr(6);
55
- break;
56
- case 9:
57
- this.$ = $$[$0].trim();
58
- yy.getCommonDb().setAccTitle(this.$);
59
- break;
60
- case 10:
61
- case 11:
62
- this.$ = $$[$0].trim();
63
- yy.getCommonDb().setAccDescription(this.$);
64
- break;
65
- case 12:
66
- yy.addSection($$[$0].substr(8));
67
- this.$ = $$[$0].substr(8);
68
- break;
69
- case 15:
70
- yy.addTask($$[$0], 0, "");
71
- this.$ = $$[$0];
72
- break;
73
- case 16:
74
- yy.addEvent($$[$0].substr(2));
75
- this.$ = $$[$0];
76
- break;
77
- }
78
- }, "anonymous"),
79
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, o($V0, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 7], { 1: [2, 1] }), o($V0, [2, 3]), { 9: 18, 11: $V1, 12: $V2, 14: $V3, 16: $V4, 17: $V5, 18: 14, 19: 15, 20: $V6, 21: $V7 }, o($V0, [2, 5]), o($V0, [2, 6]), o($V0, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, o($V0, [2, 11]), o($V0, [2, 12]), o($V0, [2, 13]), o($V0, [2, 14]), o($V0, [2, 15]), o($V0, [2, 16]), o($V0, [2, 4]), o($V0, [2, 9]), o($V0, [2, 10])],
80
- defaultActions: {},
81
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
82
- if (hash.recoverable) {
83
- this.trace(str);
84
- } else {
85
- var error = new Error(str);
86
- error.hash = hash;
87
- throw error;
88
- }
89
- }, "parseError"),
90
- parse: /* @__PURE__ */ __name(function parse(input) {
91
- var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = "", yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
92
- var args = lstack.slice.call(arguments, 1);
93
- var lexer2 = Object.create(this.lexer);
94
- var sharedState = { yy: {} };
95
- for (var k in this.yy) {
96
- if (Object.prototype.hasOwnProperty.call(this.yy, k)) {
97
- sharedState.yy[k] = this.yy[k];
98
- }
99
- }
100
- lexer2.setInput(input, sharedState.yy);
101
- sharedState.yy.lexer = lexer2;
102
- sharedState.yy.parser = this;
103
- if (typeof lexer2.yylloc == "undefined") {
104
- lexer2.yylloc = {};
105
- }
106
- var yyloc = lexer2.yylloc;
107
- lstack.push(yyloc);
108
- var ranges = lexer2.options && lexer2.options.ranges;
109
- if (typeof sharedState.yy.parseError === "function") {
110
- this.parseError = sharedState.yy.parseError;
111
- } else {
112
- this.parseError = Object.getPrototypeOf(this).parseError;
113
- }
114
- function popStack(n) {
115
- stack.length = stack.length - 2 * n;
116
- vstack.length = vstack.length - n;
117
- lstack.length = lstack.length - n;
118
- }
119
- __name(popStack, "popStack");
120
- function lex() {
121
- var token;
122
- token = tstack.pop() || lexer2.lex() || EOF;
123
- if (typeof token !== "number") {
124
- if (token instanceof Array) {
125
- tstack = token;
126
- token = tstack.pop();
127
- }
128
- token = self.symbols_[token] || token;
129
- }
130
- return token;
131
- }
132
- __name(lex, "lex");
133
- var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
134
- while (true) {
135
- state = stack[stack.length - 1];
136
- if (this.defaultActions[state]) {
137
- action = this.defaultActions[state];
138
- } else {
139
- if (symbol === null || typeof symbol == "undefined") {
140
- symbol = lex();
141
- }
142
- action = table[state] && table[state][symbol];
143
- }
144
- if (typeof action === "undefined" || !action.length || !action[0]) {
145
- var errStr = "";
146
- expected = [];
147
- for (p in table[state]) {
148
- if (this.terminals_[p] && p > TERROR) {
149
- expected.push("'" + this.terminals_[p] + "'");
150
- }
151
- }
152
- if (lexer2.showPosition) {
153
- errStr = "Parse error on line " + (yylineno + 1) + ":\n" + lexer2.showPosition() + "\nExpecting " + expected.join(", ") + ", got '" + (this.terminals_[symbol] || symbol) + "'";
154
- } else {
155
- errStr = "Parse error on line " + (yylineno + 1) + ": Unexpected " + (symbol == EOF ? "end of input" : "'" + (this.terminals_[symbol] || symbol) + "'");
156
- }
157
- this.parseError(errStr, {
158
- text: lexer2.match,
159
- token: this.terminals_[symbol] || symbol,
160
- line: lexer2.yylineno,
161
- loc: yyloc,
162
- expected
163
- });
164
- }
165
- if (action[0] instanceof Array && action.length > 1) {
166
- throw new Error("Parse Error: multiple actions possible at state: " + state + ", token: " + symbol);
167
- }
168
- switch (action[0]) {
169
- case 1:
170
- stack.push(symbol);
171
- vstack.push(lexer2.yytext);
172
- lstack.push(lexer2.yylloc);
173
- stack.push(action[1]);
174
- symbol = null;
175
- if (!preErrorSymbol) {
176
- yyleng = lexer2.yyleng;
177
- yytext = lexer2.yytext;
178
- yylineno = lexer2.yylineno;
179
- yyloc = lexer2.yylloc;
180
- if (recovering > 0) {
181
- recovering--;
182
- }
183
- } else {
184
- symbol = preErrorSymbol;
185
- preErrorSymbol = null;
186
- }
187
- break;
188
- case 2:
189
- len = this.productions_[action[1]][1];
190
- yyval.$ = vstack[vstack.length - len];
191
- yyval._$ = {
192
- first_line: lstack[lstack.length - (len || 1)].first_line,
193
- last_line: lstack[lstack.length - 1].last_line,
194
- first_column: lstack[lstack.length - (len || 1)].first_column,
195
- last_column: lstack[lstack.length - 1].last_column
196
- };
197
- if (ranges) {
198
- yyval._$.range = [
199
- lstack[lstack.length - (len || 1)].range[0],
200
- lstack[lstack.length - 1].range[1]
201
- ];
202
- }
203
- r = this.performAction.apply(yyval, [
204
- yytext,
205
- yyleng,
206
- yylineno,
207
- sharedState.yy,
208
- action[1],
209
- vstack,
210
- lstack
211
- ].concat(args));
212
- if (typeof r !== "undefined") {
213
- return r;
214
- }
215
- if (len) {
216
- stack = stack.slice(0, -1 * len * 2);
217
- vstack = vstack.slice(0, -1 * len);
218
- lstack = lstack.slice(0, -1 * len);
219
- }
220
- stack.push(this.productions_[action[1]][0]);
221
- vstack.push(yyval.$);
222
- lstack.push(yyval._$);
223
- newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
224
- stack.push(newState);
225
- break;
226
- case 3:
227
- return true;
228
- }
229
- }
230
- return true;
231
- }, "parse")
232
- };
233
- var lexer = /* @__PURE__ */ function() {
234
- var lexer2 = {
235
- EOF: 1,
236
- parseError: /* @__PURE__ */ __name(function parseError(str, hash) {
237
- if (this.yy.parser) {
238
- this.yy.parser.parseError(str, hash);
239
- } else {
240
- throw new Error(str);
241
- }
242
- }, "parseError"),
243
- // resets the lexer, sets new input
244
- setInput: /* @__PURE__ */ __name(function(input, yy) {
245
- this.yy = yy || this.yy || {};
246
- this._input = input;
247
- this._more = this._backtrack = this.done = false;
248
- this.yylineno = this.yyleng = 0;
249
- this.yytext = this.matched = this.match = "";
250
- this.conditionStack = ["INITIAL"];
251
- this.yylloc = {
252
- first_line: 1,
253
- first_column: 0,
254
- last_line: 1,
255
- last_column: 0
256
- };
257
- if (this.options.ranges) {
258
- this.yylloc.range = [0, 0];
259
- }
260
- this.offset = 0;
261
- return this;
262
- }, "setInput"),
263
- // consumes and returns one char from the input
264
- input: /* @__PURE__ */ __name(function() {
265
- var ch = this._input[0];
266
- this.yytext += ch;
267
- this.yyleng++;
268
- this.offset++;
269
- this.match += ch;
270
- this.matched += ch;
271
- var lines = ch.match(/(?:\r\n?|\n).*/g);
272
- if (lines) {
273
- this.yylineno++;
274
- this.yylloc.last_line++;
275
- } else {
276
- this.yylloc.last_column++;
277
- }
278
- if (this.options.ranges) {
279
- this.yylloc.range[1]++;
280
- }
281
- this._input = this._input.slice(1);
282
- return ch;
283
- }, "input"),
284
- // unshifts one char (or a string) into the input
285
- unput: /* @__PURE__ */ __name(function(ch) {
286
- var len = ch.length;
287
- var lines = ch.split(/(?:\r\n?|\n)/g);
288
- this._input = ch + this._input;
289
- this.yytext = this.yytext.substr(0, this.yytext.length - len);
290
- this.offset -= len;
291
- var oldLines = this.match.split(/(?:\r\n?|\n)/g);
292
- this.match = this.match.substr(0, this.match.length - 1);
293
- this.matched = this.matched.substr(0, this.matched.length - 1);
294
- if (lines.length - 1) {
295
- this.yylineno -= lines.length - 1;
296
- }
297
- var r = this.yylloc.range;
298
- this.yylloc = {
299
- first_line: this.yylloc.first_line,
300
- last_line: this.yylineno + 1,
301
- first_column: this.yylloc.first_column,
302
- 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
303
- };
304
- if (this.options.ranges) {
305
- this.yylloc.range = [r[0], r[0] + this.yyleng - len];
306
- }
307
- this.yyleng = this.yytext.length;
308
- return this;
309
- }, "unput"),
310
- // When called from action, caches matched text and appends it on next action
311
- more: /* @__PURE__ */ __name(function() {
312
- this._more = true;
313
- return this;
314
- }, "more"),
315
- // 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.
316
- reject: /* @__PURE__ */ __name(function() {
317
- if (this.options.backtrack_lexer) {
318
- this._backtrack = true;
319
- } else {
320
- 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(), {
321
- text: "",
322
- token: null,
323
- line: this.yylineno
324
- });
325
- }
326
- return this;
327
- }, "reject"),
328
- // retain first n characters of the match
329
- less: /* @__PURE__ */ __name(function(n) {
330
- this.unput(this.match.slice(n));
331
- }, "less"),
332
- // displays already matched input, i.e. for error messages
333
- pastInput: /* @__PURE__ */ __name(function() {
334
- var past = this.matched.substr(0, this.matched.length - this.match.length);
335
- return (past.length > 20 ? "..." : "") + past.substr(-20).replace(/\n/g, "");
336
- }, "pastInput"),
337
- // displays upcoming input, i.e. for error messages
338
- upcomingInput: /* @__PURE__ */ __name(function() {
339
- var next = this.match;
340
- if (next.length < 20) {
341
- next += this._input.substr(0, 20 - next.length);
342
- }
343
- return (next.substr(0, 20) + (next.length > 20 ? "..." : "")).replace(/\n/g, "");
344
- }, "upcomingInput"),
345
- // displays the character position where the lexing error occurred, i.e. for error messages
346
- showPosition: /* @__PURE__ */ __name(function() {
347
- var pre = this.pastInput();
348
- var c = new Array(pre.length + 1).join("-");
349
- return pre + this.upcomingInput() + "\n" + c + "^";
350
- }, "showPosition"),
351
- // test the lexed token: return FALSE when not a match, otherwise return token
352
- test_match: /* @__PURE__ */ __name(function(match, indexed_rule) {
353
- var token, lines, backup;
354
- if (this.options.backtrack_lexer) {
355
- backup = {
356
- yylineno: this.yylineno,
357
- yylloc: {
358
- first_line: this.yylloc.first_line,
359
- last_line: this.last_line,
360
- first_column: this.yylloc.first_column,
361
- last_column: this.yylloc.last_column
362
- },
363
- yytext: this.yytext,
364
- match: this.match,
365
- matches: this.matches,
366
- matched: this.matched,
367
- yyleng: this.yyleng,
368
- offset: this.offset,
369
- _more: this._more,
370
- _input: this._input,
371
- yy: this.yy,
372
- conditionStack: this.conditionStack.slice(0),
373
- done: this.done
374
- };
375
- if (this.options.ranges) {
376
- backup.yylloc.range = this.yylloc.range.slice(0);
377
- }
378
- }
379
- lines = match[0].match(/(?:\r\n?|\n).*/g);
380
- if (lines) {
381
- this.yylineno += lines.length;
382
- }
383
- this.yylloc = {
384
- first_line: this.yylloc.last_line,
385
- last_line: this.yylineno + 1,
386
- first_column: this.yylloc.last_column,
387
- last_column: lines ? lines[lines.length - 1].length - lines[lines.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + match[0].length
388
- };
389
- this.yytext += match[0];
390
- this.match += match[0];
391
- this.matches = match;
392
- this.yyleng = this.yytext.length;
393
- if (this.options.ranges) {
394
- this.yylloc.range = [this.offset, this.offset += this.yyleng];
395
- }
396
- this._more = false;
397
- this._backtrack = false;
398
- this._input = this._input.slice(match[0].length);
399
- this.matched += match[0];
400
- token = this.performAction.call(this, this.yy, this, indexed_rule, this.conditionStack[this.conditionStack.length - 1]);
401
- if (this.done && this._input) {
402
- this.done = false;
403
- }
404
- if (token) {
405
- return token;
406
- } else if (this._backtrack) {
407
- for (var k in backup) {
408
- this[k] = backup[k];
409
- }
410
- return false;
411
- }
412
- return false;
413
- }, "test_match"),
414
- // return next match in input
415
- next: /* @__PURE__ */ __name(function() {
416
- if (this.done) {
417
- return this.EOF;
418
- }
419
- if (!this._input) {
420
- this.done = true;
421
- }
422
- var token, match, tempMatch, index;
423
- if (!this._more) {
424
- this.yytext = "";
425
- this.match = "";
426
- }
427
- var rules = this._currentRules();
428
- for (var i = 0; i < rules.length; i++) {
429
- tempMatch = this._input.match(this.rules[rules[i]]);
430
- if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {
431
- match = tempMatch;
432
- index = i;
433
- if (this.options.backtrack_lexer) {
434
- token = this.test_match(tempMatch, rules[i]);
435
- if (token !== false) {
436
- return token;
437
- } else if (this._backtrack) {
438
- match = false;
439
- continue;
440
- } else {
441
- return false;
442
- }
443
- } else if (!this.options.flex) {
444
- break;
445
- }
446
- }
447
- }
448
- if (match) {
449
- token = this.test_match(match, rules[index]);
450
- if (token !== false) {
451
- return token;
452
- }
453
- return false;
454
- }
455
- if (this._input === "") {
456
- return this.EOF;
457
- } else {
458
- return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
459
- text: "",
460
- token: null,
461
- line: this.yylineno
462
- });
463
- }
464
- }, "next"),
465
- // return next match that has a token
466
- lex: /* @__PURE__ */ __name(function lex() {
467
- var r = this.next();
468
- if (r) {
469
- return r;
470
- } else {
471
- return this.lex();
472
- }
473
- }, "lex"),
474
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
475
- begin: /* @__PURE__ */ __name(function begin(condition) {
476
- this.conditionStack.push(condition);
477
- }, "begin"),
478
- // pop the previously active lexer condition state off the condition stack
479
- popState: /* @__PURE__ */ __name(function popState() {
480
- var n = this.conditionStack.length - 1;
481
- if (n > 0) {
482
- return this.conditionStack.pop();
483
- } else {
484
- return this.conditionStack[0];
485
- }
486
- }, "popState"),
487
- // produce the lexer rule set which is active for the currently active lexer condition state
488
- _currentRules: /* @__PURE__ */ __name(function _currentRules() {
489
- if (this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1]) {
490
- return this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules;
491
- } else {
492
- return this.conditions["INITIAL"].rules;
493
- }
494
- }, "_currentRules"),
495
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
496
- topState: /* @__PURE__ */ __name(function topState(n) {
497
- n = this.conditionStack.length - 1 - Math.abs(n || 0);
498
- if (n >= 0) {
499
- return this.conditionStack[n];
500
- } else {
501
- return "INITIAL";
502
- }
503
- }, "topState"),
504
- // alias for begin(condition)
505
- pushState: /* @__PURE__ */ __name(function pushState(condition) {
506
- this.begin(condition);
507
- }, "pushState"),
508
- // return the number of states currently on the stack
509
- stateStackSize: /* @__PURE__ */ __name(function stateStackSize() {
510
- return this.conditionStack.length;
511
- }, "stateStackSize"),
512
- options: { "case-insensitive": true },
513
- performAction: /* @__PURE__ */ __name(function anonymous(yy, yy_, $avoiding_name_collisions, YY_START) {
514
- var YYSTATE = YY_START;
515
- switch ($avoiding_name_collisions) {
516
- case 0:
517
- break;
518
- case 1:
519
- break;
520
- case 2:
521
- return 10;
522
- break;
523
- case 3:
524
- break;
525
- case 4:
526
- break;
527
- case 5:
528
- return 4;
529
- break;
530
- case 6:
531
- return 11;
532
- break;
533
- case 7:
534
- this.begin("acc_title");
535
- return 12;
536
- break;
537
- case 8:
538
- this.popState();
539
- return "acc_title_value";
540
- break;
541
- case 9:
542
- this.begin("acc_descr");
543
- return 14;
544
- break;
545
- case 10:
546
- this.popState();
547
- return "acc_descr_value";
548
- break;
549
- case 11:
550
- this.begin("acc_descr_multiline");
551
- break;
552
- case 12:
553
- this.popState();
554
- break;
555
- case 13:
556
- return "acc_descr_multiline_value";
557
- break;
558
- case 14:
559
- return 17;
560
- break;
561
- case 15:
562
- return 21;
563
- break;
564
- case 16:
565
- return 20;
566
- break;
567
- case 17:
568
- return 6;
569
- break;
570
- case 18:
571
- return "INVALID";
572
- break;
573
- }
574
- }, "anonymous"),
575
- 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]+)/i, /^(?:[^#:\n]+)/i, /^(?:$)/i, /^(?:.)/i],
576
- conditions: { "acc_descr_multiline": { "rules": [12, 13], "inclusive": false }, "acc_descr": { "rules": [10], "inclusive": false }, "acc_title": { "rules": [8], "inclusive": false }, "INITIAL": { "rules": [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], "inclusive": true } }
577
- };
578
- return lexer2;
579
- }();
580
- parser2.lexer = lexer;
581
- function Parser() {
582
- this.yy = {};
583
- }
584
- __name(Parser, "Parser");
585
- Parser.prototype = parser2;
586
- parser2.Parser = Parser;
587
- return new Parser();
588
- }();
589
- parser.parser = parser;
590
- var timeline_default = parser;
591
- var timelineDb_exports = {};
592
- __export(timelineDb_exports, {
593
- addEvent: () => addEvent,
594
- addSection: () => addSection,
595
- addTask: () => addTask,
596
- addTaskOrg: () => addTaskOrg,
597
- clear: () => clear2,
598
- default: () => timelineDb_default,
599
- getCommonDb: () => getCommonDb,
600
- getSections: () => getSections,
601
- getTasks: () => getTasks
602
- });
603
- var currentSection = "";
604
- var currentTaskId = 0;
605
- var sections = [];
606
- var tasks = [];
607
- var rawTasks = [];
608
- var getCommonDb = /* @__PURE__ */ __name(() => commonDb_exports, "getCommonDb");
609
- var clear2 = /* @__PURE__ */ __name(function() {
610
- sections.length = 0;
611
- tasks.length = 0;
612
- currentSection = "";
613
- rawTasks.length = 0;
614
- clear();
615
- }, "clear");
616
- var addSection = /* @__PURE__ */ __name(function(txt) {
617
- currentSection = txt;
618
- sections.push(txt);
619
- }, "addSection");
620
- var getSections = /* @__PURE__ */ __name(function() {
621
- return sections;
622
- }, "getSections");
623
- var getTasks = /* @__PURE__ */ __name(function() {
624
- let allItemsProcessed = compileTasks();
625
- const maxDepth = 100;
626
- let iterationCount = 0;
627
- while (!allItemsProcessed && iterationCount < maxDepth) {
628
- allItemsProcessed = compileTasks();
629
- iterationCount++;
630
- }
631
- tasks.push(...rawTasks);
632
- return tasks;
633
- }, "getTasks");
634
- var addTask = /* @__PURE__ */ __name(function(period, length, event) {
635
- const rawTask = {
636
- id: currentTaskId++,
637
- section: currentSection,
638
- type: currentSection,
639
- task: period,
640
- score: length ? length : 0,
641
- //if event is defined, then add it the events array
642
- events: event ? [event] : []
643
- };
644
- rawTasks.push(rawTask);
645
- }, "addTask");
646
- var addEvent = /* @__PURE__ */ __name(function(event) {
647
- const currentTask = rawTasks.find((task) => task.id === currentTaskId - 1);
648
- currentTask.events.push(event);
649
- }, "addEvent");
650
- var addTaskOrg = /* @__PURE__ */ __name(function(descr) {
651
- const newTask = {
652
- section: currentSection,
653
- type: currentSection,
654
- description: descr,
655
- task: descr,
656
- classes: []
657
- };
658
- tasks.push(newTask);
659
- }, "addTaskOrg");
660
- var compileTasks = /* @__PURE__ */ __name(function() {
661
- const compileTask = /* @__PURE__ */ __name(function(pos) {
662
- return rawTasks[pos].processed;
663
- }, "compileTask");
664
- let allProcessed = true;
665
- for (const [i, rawTask] of rawTasks.entries()) {
666
- compileTask(i);
667
- allProcessed = allProcessed && rawTask.processed;
668
- }
669
- return allProcessed;
670
- }, "compileTasks");
671
- var timelineDb_default = {
672
- clear: clear2,
673
- getCommonDb,
674
- addSection,
675
- getSections,
676
- getTasks,
677
- addTask,
678
- addTaskOrg,
679
- addEvent
680
- };
681
- var MAX_SECTIONS = 12;
682
- var drawRect = /* @__PURE__ */ __name(function(elem, rectData) {
683
- const rectElem = elem.append("rect");
684
- rectElem.attr("x", rectData.x);
685
- rectElem.attr("y", rectData.y);
686
- rectElem.attr("fill", rectData.fill);
687
- rectElem.attr("stroke", rectData.stroke);
688
- rectElem.attr("width", rectData.width);
689
- rectElem.attr("height", rectData.height);
690
- rectElem.attr("rx", rectData.rx);
691
- rectElem.attr("ry", rectData.ry);
692
- if (rectData.class !== void 0) {
693
- rectElem.attr("class", rectData.class);
694
- }
695
- return rectElem;
696
- }, "drawRect");
697
- var drawFace = /* @__PURE__ */ __name(function(element, faceData) {
698
- const radius = 15;
699
- const circleElement = element.append("circle").attr("cx", faceData.cx).attr("cy", faceData.cy).attr("class", "face").attr("r", radius).attr("stroke-width", 2).attr("overflow", "visible");
700
- const face = element.append("g");
701
- face.append("circle").attr("cx", faceData.cx - radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
702
- face.append("circle").attr("cx", faceData.cx + radius / 3).attr("cy", faceData.cy - radius / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
703
- function smile(face2) {
704
- const arc = arc_default().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
705
- face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 2) + ")");
706
- }
707
- __name(smile, "smile");
708
- function sad(face2) {
709
- const arc = arc_default().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(radius / 2).outerRadius(radius / 2.2);
710
- face2.append("path").attr("class", "mouth").attr("d", arc).attr("transform", "translate(" + faceData.cx + "," + (faceData.cy + 7) + ")");
711
- }
712
- __name(sad, "sad");
713
- function ambivalent(face2) {
714
- face2.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", faceData.cx - 5).attr("y1", faceData.cy + 7).attr("x2", faceData.cx + 5).attr("y2", faceData.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
715
- }
716
- __name(ambivalent, "ambivalent");
717
- if (faceData.score > 3) {
718
- smile(face);
719
- } else if (faceData.score < 3) {
720
- sad(face);
721
- } else {
722
- ambivalent(face);
723
- }
724
- return circleElement;
725
- }, "drawFace");
726
- var drawCircle = /* @__PURE__ */ __name(function(element, circleData) {
727
- const circleElement = element.append("circle");
728
- circleElement.attr("cx", circleData.cx);
729
- circleElement.attr("cy", circleData.cy);
730
- circleElement.attr("class", "actor-" + circleData.pos);
731
- circleElement.attr("fill", circleData.fill);
732
- circleElement.attr("stroke", circleData.stroke);
733
- circleElement.attr("r", circleData.r);
734
- if (circleElement.class !== void 0) {
735
- circleElement.attr("class", circleElement.class);
736
- }
737
- if (circleData.title !== void 0) {
738
- circleElement.append("title").text(circleData.title);
739
- }
740
- return circleElement;
741
- }, "drawCircle");
742
- var drawText = /* @__PURE__ */ __name(function(elem, textData) {
743
- const nText = textData.text.replace(/<br\s*\/?>/gi, " ");
744
- const textElem = elem.append("text");
745
- textElem.attr("x", textData.x);
746
- textElem.attr("y", textData.y);
747
- textElem.attr("class", "legend");
748
- textElem.style("text-anchor", textData.anchor);
749
- if (textData.class !== void 0) {
750
- textElem.attr("class", textData.class);
751
- }
752
- const span = textElem.append("tspan");
753
- span.attr("x", textData.x + textData.textMargin * 2);
754
- span.text(nText);
755
- return textElem;
756
- }, "drawText");
757
- var drawLabel = /* @__PURE__ */ __name(function(elem, txtObject) {
758
- function genPoints(x, y, width, height, cut) {
759
- return x + "," + y + " " + (x + width) + "," + y + " " + (x + width) + "," + (y + height - cut) + " " + (x + width - cut * 1.2) + "," + (y + height) + " " + x + "," + (y + height);
760
- }
761
- __name(genPoints, "genPoints");
762
- const polygon = elem.append("polygon");
763
- polygon.attr("points", genPoints(txtObject.x, txtObject.y, 50, 20, 7));
764
- polygon.attr("class", "labelBox");
765
- txtObject.y = txtObject.y + txtObject.labelMargin;
766
- txtObject.x = txtObject.x + 0.5 * txtObject.labelMargin;
767
- drawText(elem, txtObject);
768
- }, "drawLabel");
769
- var drawSection = /* @__PURE__ */ __name(function(elem, section, conf) {
770
- const g = elem.append("g");
771
- const rect = getNoteRect();
772
- rect.x = section.x;
773
- rect.y = section.y;
774
- rect.fill = section.fill;
775
- rect.width = conf.width;
776
- rect.height = conf.height;
777
- rect.class = "journey-section section-type-" + section.num;
778
- rect.rx = 3;
779
- rect.ry = 3;
780
- drawRect(g, rect);
781
- _drawTextCandidateFunc(conf)(
782
- section.text,
783
- g,
784
- rect.x,
785
- rect.y,
786
- rect.width,
787
- rect.height,
788
- { class: "journey-section section-type-" + section.num },
789
- conf,
790
- section.colour
791
- );
792
- }, "drawSection");
793
- var taskCount = -1;
794
- var drawTask = /* @__PURE__ */ __name(function(elem, task, conf) {
795
- const center = task.x + conf.width / 2;
796
- const g = elem.append("g");
797
- taskCount++;
798
- const maxHeight = 300 + 5 * 30;
799
- g.append("line").attr("id", "task" + taskCount).attr("x1", center).attr("y1", task.y).attr("x2", center).attr("y2", maxHeight).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666");
800
- drawFace(g, {
801
- cx: center,
802
- cy: 300 + (5 - task.score) * 30,
803
- score: task.score
804
- });
805
- const rect = getNoteRect();
806
- rect.x = task.x;
807
- rect.y = task.y;
808
- rect.fill = task.fill;
809
- rect.width = conf.width;
810
- rect.height = conf.height;
811
- rect.class = "task task-type-" + task.num;
812
- rect.rx = 3;
813
- rect.ry = 3;
814
- drawRect(g, rect);
815
- _drawTextCandidateFunc(conf)(
816
- task.task,
817
- g,
818
- rect.x,
819
- rect.y,
820
- rect.width,
821
- rect.height,
822
- { class: "task" },
823
- conf,
824
- task.colour
825
- );
826
- }, "drawTask");
827
- var drawBackgroundRect = /* @__PURE__ */ __name(function(elem, bounds) {
828
- const rectElem = drawRect(elem, {
829
- x: bounds.startx,
830
- y: bounds.starty,
831
- width: bounds.stopx - bounds.startx,
832
- height: bounds.stopy - bounds.starty,
833
- fill: bounds.fill,
834
- class: "rect"
835
- });
836
- rectElem.lower();
837
- }, "drawBackgroundRect");
838
- var getTextObj = /* @__PURE__ */ __name(function() {
839
- return {
840
- x: 0,
841
- y: 0,
842
- fill: void 0,
843
- "text-anchor": "start",
844
- width: 100,
845
- height: 100,
846
- textMargin: 0,
847
- rx: 0,
848
- ry: 0
849
- };
850
- }, "getTextObj");
851
- var getNoteRect = /* @__PURE__ */ __name(function() {
852
- return {
853
- x: 0,
854
- y: 0,
855
- width: 100,
856
- anchor: "start",
857
- height: 100,
858
- rx: 0,
859
- ry: 0
860
- };
861
- }, "getNoteRect");
862
- var _drawTextCandidateFunc = /* @__PURE__ */ function() {
863
- function byText(content, g, x, y, width, height, textAttrs, colour) {
864
- const text = g.append("text").attr("x", x + width / 2).attr("y", y + height / 2 + 5).style("font-color", colour).style("text-anchor", "middle").text(content);
865
- _setTextAttrs(text, textAttrs);
866
- }
867
- __name(byText, "byText");
868
- function byTspan(content, g, x, y, width, height, textAttrs, conf, colour) {
869
- const { taskFontSize, taskFontFamily } = conf;
870
- const lines = content.split(/<br\s*\/?>/gi);
871
- for (let i = 0; i < lines.length; i++) {
872
- const dy = i * taskFontSize - taskFontSize * (lines.length - 1) / 2;
873
- const text = g.append("text").attr("x", x + width / 2).attr("y", y).attr("fill", colour).style("text-anchor", "middle").style("font-size", taskFontSize).style("font-family", taskFontFamily);
874
- text.append("tspan").attr("x", x + width / 2).attr("dy", dy).text(lines[i]);
875
- text.attr("y", y + height / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central");
876
- _setTextAttrs(text, textAttrs);
877
- }
878
- }
879
- __name(byTspan, "byTspan");
880
- function byFo(content, g, x, y, width, height, textAttrs, conf) {
881
- const body = g.append("switch");
882
- const f = body.append("foreignObject").attr("x", x).attr("y", y).attr("width", width).attr("height", height).attr("position", "fixed");
883
- const text = f.append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
884
- text.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(content);
885
- byTspan(content, body, x, y, width, height, textAttrs, conf);
886
- _setTextAttrs(text, textAttrs);
887
- }
888
- __name(byFo, "byFo");
889
- function _setTextAttrs(toText, fromTextAttrsDict) {
890
- for (const key in fromTextAttrsDict) {
891
- if (key in fromTextAttrsDict) {
892
- toText.attr(key, fromTextAttrsDict[key]);
893
- }
894
- }
895
- }
896
- __name(_setTextAttrs, "_setTextAttrs");
897
- return function(conf) {
898
- return conf.textPlacement === "fo" ? byFo : conf.textPlacement === "old" ? byText : byTspan;
899
- };
900
- }();
901
- var initGraphics = /* @__PURE__ */ __name(function(graphics) {
902
- graphics.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");
903
- }, "initGraphics");
904
- function wrap(text, width) {
905
- text.each(function() {
906
- var text2 = select_default(this), words = text2.text().split(/(\s+|<br>)/).reverse(), word, line = [], lineHeight = 1.1, y = text2.attr("y"), dy = parseFloat(text2.attr("dy")), tspan = text2.text(null).append("tspan").attr("x", 0).attr("y", y).attr("dy", dy + "em");
907
- for (let j = 0; j < words.length; j++) {
908
- word = words[words.length - 1 - j];
909
- line.push(word);
910
- tspan.text(line.join(" ").trim());
911
- if (tspan.node().getComputedTextLength() > width || word === "<br>") {
912
- line.pop();
913
- tspan.text(line.join(" ").trim());
914
- if (word === "<br>") {
915
- line = [""];
916
- } else {
917
- line = [word];
918
- }
919
- tspan = text2.append("tspan").attr("x", 0).attr("y", y).attr("dy", lineHeight + "em").text(word);
920
- }
921
- }
922
- });
923
- }
924
- __name(wrap, "wrap");
925
- var drawNode = /* @__PURE__ */ __name(function(elem, node, fullSection, conf) {
926
- const section = fullSection % MAX_SECTIONS - 1;
927
- const nodeElem = elem.append("g");
928
- node.section = section;
929
- nodeElem.attr(
930
- "class",
931
- (node.class ? node.class + " " : "") + "timeline-node " + ("section-" + section)
932
- );
933
- const bkgElem = nodeElem.append("g");
934
- const textElem = nodeElem.append("g");
935
- const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
936
- const bbox = txt.node().getBBox();
937
- const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
938
- node.height = bbox.height + fontSize * 1.1 * 0.5 + node.padding;
939
- node.height = Math.max(node.height, node.maxHeight);
940
- node.width = node.width + 2 * node.padding;
941
- textElem.attr("transform", "translate(" + node.width / 2 + ", " + node.padding / 2 + ")");
942
- defaultBkg(bkgElem, node, section, conf);
943
- return node;
944
- }, "drawNode");
945
- var getVirtualNodeHeight = /* @__PURE__ */ __name(function(elem, node, conf) {
946
- const textElem = elem.append("g");
947
- const txt = textElem.append("text").text(node.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(wrap, node.width);
948
- const bbox = txt.node().getBBox();
949
- const fontSize = conf.fontSize?.replace ? conf.fontSize.replace("px", "") : conf.fontSize;
950
- textElem.remove();
951
- return bbox.height + fontSize * 1.1 * 0.5 + node.padding;
952
- }, "getVirtualNodeHeight");
953
- var defaultBkg = /* @__PURE__ */ __name(function(elem, node, section) {
954
- const rd = 5;
955
- elem.append("path").attr("id", "node-" + node.id).attr("class", "node-bkg node-" + node.type).attr(
956
- "d",
957
- `M0 ${node.height - rd} v${-node.height + 2 * rd} q0,-5 5,-5 h${node.width - 2 * rd} q5,0 5,5 v${node.height - rd} H0 Z`
958
- );
959
- elem.append("line").attr("class", "node-line-" + section).attr("x1", 0).attr("y1", node.height).attr("x2", node.width).attr("y2", node.height);
960
- }, "defaultBkg");
961
- var svgDraw_default = {
962
- drawRect,
963
- drawCircle,
964
- drawSection,
965
- drawText,
966
- drawLabel,
967
- drawTask,
968
- drawBackgroundRect,
969
- getTextObj,
970
- getNoteRect,
971
- initGraphics,
972
- drawNode,
973
- getVirtualNodeHeight
974
- };
975
- var draw = /* @__PURE__ */ __name(function(text, id, version, diagObj) {
976
- const conf = getConfig2();
977
- const LEFT_MARGIN = conf.leftMargin ?? 50;
978
- log.debug("timeline", diagObj.db);
979
- const securityLevel = conf.securityLevel;
980
- let sandboxElement;
981
- if (securityLevel === "sandbox") {
982
- sandboxElement = select_default("#i" + id);
983
- }
984
- const root = securityLevel === "sandbox" ? select_default(sandboxElement.nodes()[0].contentDocument.body) : select_default("body");
985
- const svg = root.select("#" + id);
986
- svg.append("g");
987
- const tasks2 = diagObj.db.getTasks();
988
- const title = diagObj.db.getCommonDb().getDiagramTitle();
989
- log.debug("task", tasks2);
990
- svgDraw_default.initGraphics(svg);
991
- const sections2 = diagObj.db.getSections();
992
- log.debug("sections", sections2);
993
- let maxSectionHeight = 0;
994
- let maxTaskHeight = 0;
995
- let depthY = 0;
996
- let sectionBeginY = 0;
997
- let masterX = 50 + LEFT_MARGIN;
998
- let masterY = 50;
999
- sectionBeginY = 50;
1000
- let sectionNumber = 0;
1001
- let hasSections = true;
1002
- sections2.forEach(function(section) {
1003
- const sectionNode = {
1004
- number: sectionNumber,
1005
- descr: section,
1006
- section: sectionNumber,
1007
- width: 150,
1008
- padding: 20,
1009
- maxHeight: maxSectionHeight
1010
- };
1011
- const sectionHeight = svgDraw_default.getVirtualNodeHeight(svg, sectionNode, conf);
1012
- log.debug("sectionHeight before draw", sectionHeight);
1013
- maxSectionHeight = Math.max(maxSectionHeight, sectionHeight + 20);
1014
- });
1015
- let maxEventCount = 0;
1016
- let maxEventLineLength = 0;
1017
- log.debug("tasks.length", tasks2.length);
1018
- for (const [i, task] of tasks2.entries()) {
1019
- const taskNode = {
1020
- number: i,
1021
- descr: task,
1022
- section: task.section,
1023
- width: 150,
1024
- padding: 20,
1025
- maxHeight: maxTaskHeight
1026
- };
1027
- const taskHeight = svgDraw_default.getVirtualNodeHeight(svg, taskNode, conf);
1028
- log.debug("taskHeight before draw", taskHeight);
1029
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight + 20);
1030
- maxEventCount = Math.max(maxEventCount, task.events.length);
1031
- let maxEventLineLengthTemp = 0;
1032
- for (const event of task.events) {
1033
- const eventNode = {
1034
- descr: event,
1035
- section: task.section,
1036
- number: task.section,
1037
- width: 150,
1038
- padding: 20,
1039
- maxHeight: 50
1040
- };
1041
- maxEventLineLengthTemp += svgDraw_default.getVirtualNodeHeight(svg, eventNode, conf);
1042
- }
1043
- maxEventLineLength = Math.max(maxEventLineLength, maxEventLineLengthTemp);
1044
- }
1045
- log.debug("maxSectionHeight before draw", maxSectionHeight);
1046
- log.debug("maxTaskHeight before draw", maxTaskHeight);
1047
- if (sections2 && sections2.length > 0) {
1048
- sections2.forEach((section) => {
1049
- const tasksForSection = tasks2.filter((task) => task.section === section);
1050
- const sectionNode = {
1051
- number: sectionNumber,
1052
- descr: section,
1053
- section: sectionNumber,
1054
- width: 200 * Math.max(tasksForSection.length, 1) - 50,
1055
- padding: 20,
1056
- maxHeight: maxSectionHeight
1057
- };
1058
- log.debug("sectionNode", sectionNode);
1059
- const sectionNodeWrapper = svg.append("g");
1060
- const node = svgDraw_default.drawNode(sectionNodeWrapper, sectionNode, sectionNumber, conf);
1061
- log.debug("sectionNode output", node);
1062
- sectionNodeWrapper.attr("transform", `translate(${masterX}, ${sectionBeginY})`);
1063
- masterY += maxSectionHeight + 50;
1064
- if (tasksForSection.length > 0) {
1065
- drawTasks(
1066
- svg,
1067
- tasksForSection,
1068
- sectionNumber,
1069
- masterX,
1070
- masterY,
1071
- maxTaskHeight,
1072
- conf,
1073
- maxEventCount,
1074
- maxEventLineLength,
1075
- maxSectionHeight,
1076
- false
1077
- );
1078
- }
1079
- masterX += 200 * Math.max(tasksForSection.length, 1);
1080
- masterY = sectionBeginY;
1081
- sectionNumber++;
1082
- });
1083
- } else {
1084
- hasSections = false;
1085
- drawTasks(
1086
- svg,
1087
- tasks2,
1088
- sectionNumber,
1089
- masterX,
1090
- masterY,
1091
- maxTaskHeight,
1092
- conf,
1093
- maxEventCount,
1094
- maxEventLineLength,
1095
- maxSectionHeight,
1096
- true
1097
- );
1098
- }
1099
- const box = svg.node().getBBox();
1100
- log.debug("bounds", box);
1101
- if (title) {
1102
- svg.append("text").text(title).attr("x", box.width / 2 - LEFT_MARGIN).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20);
1103
- }
1104
- depthY = hasSections ? maxSectionHeight + maxTaskHeight + 150 : maxTaskHeight + 100;
1105
- const lineWrapper = svg.append("g").attr("class", "lineWrapper");
1106
- lineWrapper.append("line").attr("x1", LEFT_MARGIN).attr("y1", depthY).attr("x2", box.width + 3 * LEFT_MARGIN).attr("y2", depthY).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)");
1107
- setupGraphViewbox(
1108
- void 0,
1109
- svg,
1110
- conf.timeline?.padding ?? 50,
1111
- conf.timeline?.useMaxWidth ?? false
1112
- );
1113
- }, "draw");
1114
- var drawTasks = /* @__PURE__ */ __name(function(diagram2, tasks2, sectionColor, masterX, masterY, maxTaskHeight, conf, maxEventCount, maxEventLineLength, maxSectionHeight, isWithoutSections) {
1115
- for (const task of tasks2) {
1116
- const taskNode = {
1117
- descr: task.task,
1118
- section: sectionColor,
1119
- number: sectionColor,
1120
- width: 150,
1121
- padding: 20,
1122
- maxHeight: maxTaskHeight
1123
- };
1124
- log.debug("taskNode", taskNode);
1125
- const taskWrapper = diagram2.append("g").attr("class", "taskWrapper");
1126
- const node = svgDraw_default.drawNode(taskWrapper, taskNode, sectionColor, conf);
1127
- const taskHeight = node.height;
1128
- log.debug("taskHeight after draw", taskHeight);
1129
- taskWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1130
- maxTaskHeight = Math.max(maxTaskHeight, taskHeight);
1131
- if (task.events) {
1132
- const lineWrapper = diagram2.append("g").attr("class", "lineWrapper");
1133
- let lineLength = maxTaskHeight;
1134
- masterY += 100;
1135
- lineLength = lineLength + drawEvents(diagram2, task.events, sectionColor, masterX, masterY, conf);
1136
- masterY -= 100;
1137
- lineWrapper.append("line").attr("x1", masterX + 190 / 2).attr("y1", masterY + maxTaskHeight).attr("x2", masterX + 190 / 2).attr(
1138
- "y2",
1139
- masterY + maxTaskHeight + (isWithoutSections ? maxTaskHeight : maxSectionHeight) + maxEventLineLength + 120
1140
- ).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
1141
- }
1142
- masterX = masterX + 200;
1143
- if (isWithoutSections && !conf.timeline?.disableMulticolor) {
1144
- sectionColor++;
1145
- }
1146
- }
1147
- masterY = masterY - 10;
1148
- }, "drawTasks");
1149
- var drawEvents = /* @__PURE__ */ __name(function(diagram2, events, sectionColor, masterX, masterY, conf) {
1150
- let maxEventHeight = 0;
1151
- const eventBeginY = masterY;
1152
- masterY = masterY + 100;
1153
- for (const event of events) {
1154
- const eventNode = {
1155
- descr: event,
1156
- section: sectionColor,
1157
- number: sectionColor,
1158
- width: 150,
1159
- padding: 20,
1160
- maxHeight: 50
1161
- };
1162
- log.debug("eventNode", eventNode);
1163
- const eventWrapper = diagram2.append("g").attr("class", "eventWrapper");
1164
- const node = svgDraw_default.drawNode(eventWrapper, eventNode, sectionColor, conf);
1165
- const eventHeight = node.height;
1166
- maxEventHeight = maxEventHeight + eventHeight;
1167
- eventWrapper.attr("transform", `translate(${masterX}, ${masterY})`);
1168
- masterY = masterY + 10 + eventHeight;
1169
- }
1170
- masterY = eventBeginY;
1171
- return maxEventHeight;
1172
- }, "drawEvents");
1173
- var timelineRenderer_default = {
1174
- setConf: /* @__PURE__ */ __name(() => {
1175
- }, "setConf"),
1176
- draw
1177
- };
1178
- var genSections = /* @__PURE__ */ __name((options) => {
1179
- let sections2 = "";
1180
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1181
- options["lineColor" + i] = options["lineColor" + i] || options["cScaleInv" + i];
1182
- if (is_dark_default(options["lineColor" + i])) {
1183
- options["lineColor" + i] = lighten_default(options["lineColor" + i], 20);
1184
- } else {
1185
- options["lineColor" + i] = darken_default(options["lineColor" + i], 20);
1186
- }
1187
- }
1188
- for (let i = 0; i < options.THEME_COLOR_LIMIT; i++) {
1189
- const sw = "" + (17 - 3 * i);
1190
- sections2 += `
1191
- .section-${i - 1} rect, .section-${i - 1} path, .section-${i - 1} circle, .section-${i - 1} path {
1192
- fill: ${options["cScale" + i]};
1193
- }
1194
- .section-${i - 1} text {
1195
- fill: ${options["cScaleLabel" + i]};
1196
- }
1197
- .node-icon-${i - 1} {
1198
- font-size: 40px;
1199
- color: ${options["cScaleLabel" + i]};
1200
- }
1201
- .section-edge-${i - 1}{
1202
- stroke: ${options["cScale" + i]};
1203
- }
1204
- .edge-depth-${i - 1}{
1205
- stroke-width: ${sw};
1206
- }
1207
- .section-${i - 1} line {
1208
- stroke: ${options["cScaleInv" + i]} ;
1209
- stroke-width: 3;
1210
- }
1211
-
1212
- .lineWrapper line{
1213
- stroke: ${options["cScaleLabel" + i]} ;
1214
- }
1215
-
1216
- .disabled, .disabled circle, .disabled text {
1217
- fill: lightgray;
1218
- }
1219
- .disabled text {
1220
- fill: #efefef;
1221
- }
1222
- `;
1223
- }
1224
- return sections2;
1225
- }, "genSections");
1226
- var getStyles = /* @__PURE__ */ __name((options) => `
1227
- .edge {
1228
- stroke-width: 3;
1229
- }
1230
- ${genSections(options)}
1231
- .section-root rect, .section-root path, .section-root circle {
1232
- fill: ${options.git0};
1233
- }
1234
- .section-root text {
1235
- fill: ${options.gitBranchLabel0};
1236
- }
1237
- .icon-container {
1238
- height:100%;
1239
- display: flex;
1240
- justify-content: center;
1241
- align-items: center;
1242
- }
1243
- .edge {
1244
- fill: none;
1245
- }
1246
- .eventWrapper {
1247
- filter: brightness(120%);
1248
- }
1249
- `, "getStyles");
1250
- var styles_default = getStyles;
1251
- var diagram = {
1252
- db: timelineDb_exports,
1253
- renderer: timelineRenderer_default,
1254
- parser: timeline_default,
1255
- styles: styles_default
1256
- };
1257
- export {
1258
- diagram
1259
- };
1260
- //# sourceMappingURL=timeline-definition-U7ZMHBDA-GB6AKKW4.js.map