lowcoder-comps 0.0.29 → 0.0.31

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 (86) hide show
  1. package/README.md +120 -0
  2. package/index.html +26 -0
  3. package/index.tsx +21 -0
  4. package/jest.config.js +6 -0
  5. package/package.json +3 -4
  6. package/src/__test__/allComp.test.tsx +61 -0
  7. package/src/app-env.d.ts +3 -0
  8. package/src/comps/calendarComp/calendarComp.tsx +633 -0
  9. package/src/comps/calendarComp/calendarConstants.tsx +1048 -0
  10. package/src/comps/calendarComp/errorBoundary.tsx +30 -0
  11. package/src/comps/chartComp/chartComp.tsx +442 -0
  12. package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
  13. package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
  14. package/src/comps/chartComp/chartConfigs/chartUrls.tsx +9 -0
  15. package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
  16. package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
  17. package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
  18. package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
  19. package/src/comps/chartComp/chartConstants.tsx +299 -0
  20. package/src/comps/chartComp/chartPropertyView.tsx +235 -0
  21. package/src/comps/chartComp/chartUtils.ts +291 -0
  22. package/src/comps/chartComp/reactEcharts/core.tsx +194 -0
  23. package/src/comps/chartComp/reactEcharts/index.ts +21 -0
  24. package/src/comps/chartComp/reactEcharts/types.ts +76 -0
  25. package/src/comps/chartComp/seriesComp.tsx +119 -0
  26. package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
  27. package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
  28. package/src/comps/imageEditorComp/index.tsx +184 -0
  29. package/src/comps/mermaidComp/index.tsx +44 -0
  30. package/src/comps/mermaidComp/mermaid.tsx +29 -0
  31. package/src/global.ts +1 -0
  32. package/src/i18n/comps/index.tsx +29 -0
  33. package/src/i18n/comps/locales/en.ts +163 -0
  34. package/src/i18n/comps/locales/enObj.tsx +198 -0
  35. package/src/i18n/comps/locales/index.ts +7 -0
  36. package/src/i18n/comps/locales/types.tsx +10 -0
  37. package/src/i18n/comps/locales/zh.ts +156 -0
  38. package/src/i18n/comps/locales/zhObj.tsx +4 -0
  39. package/src/index.ts +11 -0
  40. package/tsconfig.json +22 -0
  41. package/vite.config.js +10 -0
  42. package/2085da13.js +0 -960
  43. package/250691b5.js +0 -5
  44. package/256b619e.js +0 -92
  45. package/274f545c.js +0 -881
  46. package/289305a1.js +0 -208
  47. package/2eae45c2.js +0 -34
  48. package/2ff2c7a6.js +0 -6
  49. package/2ff7471d.js +0 -9
  50. package/335b22a2.js +0 -220
  51. package/38c826fe.js +0 -1127
  52. package/44011c1d.js +0 -818
  53. package/4fc06812.js +0 -64
  54. package/56a787cf.js +0 -915
  55. package/590941ff.js +0 -86
  56. package/6341867f.js +0 -804
  57. package/657fd065.js +0 -8
  58. package/78a5e50d.js +0 -1579
  59. package/820c3641.js +0 -25
  60. package/88b4e75a.js +0 -2967
  61. package/8d999722.js +0 -1102
  62. package/92e85b65.js +0 -65
  63. package/989caea2.js +0 -505
  64. package/99b984d1.js +0 -237
  65. package/9e5f02d6.js +0 -19104
  66. package/a40faea7.js +0 -11624
  67. package/abac9104.js +0 -1536
  68. package/af2f19b3.js +0 -819
  69. package/af5ee3de.js +0 -268
  70. package/b24707c2.js +0 -48428
  71. package/b68f8b69.js +0 -1276
  72. package/ba68ba65.js +0 -391
  73. package/bafb8599.js +0 -319
  74. package/bba60c35.js +0 -2501
  75. package/bd7c2a8e.js +0 -1089
  76. package/c71dadea.js +0 -455
  77. package/d05c1762.js +0 -933
  78. package/d073ab24.js +0 -134353
  79. package/d838cd10.js +0 -769
  80. package/dc36a6eb.js +0 -796
  81. package/ed143450.js +0 -1284
  82. package/ee8ec8f2.js +0 -2284
  83. package/f6755210.js +0 -1269
  84. package/f9637058.js +0 -16
  85. package/fba4c8e4.js +0 -447
  86. package/index.js +0 -5
package/dc36a6eb.js DELETED
@@ -1,796 +0,0 @@
1
- import { ar as ft, E as gt, c as mt, l as S, h as q, t as xt, as as _t, at as bt, au as kt } from "./d073ab24.js";
2
- import { a as D } from "./590941ff.js";
3
- import "./256b619e.js";
4
- var K = function() {
5
- var n = function(g, i, r, c) {
6
- for (r = r || {}, c = g.length; c--; r[g[c]] = i)
7
- ;
8
- return r;
9
- }, t = [6, 8, 10, 11, 12, 14, 16, 17, 20, 21], e = [1, 9], a = [1, 10], s = [1, 11], h = [1, 12], l = [1, 13], p = [1, 16], y = [1, 17], f = {
10
- trace: function() {
11
- },
12
- yy: {},
13
- 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 },
14
- 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" },
15
- 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]],
16
- performAction: function(i, r, c, d, u, o, I) {
17
- var x = o.length - 1;
18
- switch (u) {
19
- case 1:
20
- return o[x - 1];
21
- case 2:
22
- this.$ = [];
23
- break;
24
- case 3:
25
- o[x - 1].push(o[x]), this.$ = o[x - 1];
26
- break;
27
- case 4:
28
- case 5:
29
- this.$ = o[x];
30
- break;
31
- case 6:
32
- case 7:
33
- this.$ = [];
34
- break;
35
- case 8:
36
- d.getCommonDb().setDiagramTitle(o[x].substr(6)), this.$ = o[x].substr(6);
37
- break;
38
- case 9:
39
- this.$ = o[x].trim(), d.getCommonDb().setAccTitle(this.$);
40
- break;
41
- case 10:
42
- case 11:
43
- this.$ = o[x].trim(), d.getCommonDb().setAccDescription(this.$);
44
- break;
45
- case 12:
46
- d.addSection(o[x].substr(8)), this.$ = o[x].substr(8);
47
- break;
48
- case 15:
49
- d.addTask(o[x], 0, ""), this.$ = o[x];
50
- break;
51
- case 16:
52
- d.addEvent(o[x].substr(2)), this.$ = o[x];
53
- break;
54
- }
55
- },
56
- table: [{ 3: 1, 4: [1, 2] }, { 1: [3] }, n(t, [2, 2], { 5: 3 }), { 6: [1, 4], 7: 5, 8: [1, 6], 9: 7, 10: [1, 8], 11: e, 12: a, 14: s, 16: h, 17: l, 18: 14, 19: 15, 20: p, 21: y }, n(t, [2, 7], { 1: [2, 1] }), n(t, [2, 3]), { 9: 18, 11: e, 12: a, 14: s, 16: h, 17: l, 18: 14, 19: 15, 20: p, 21: y }, n(t, [2, 5]), n(t, [2, 6]), n(t, [2, 8]), { 13: [1, 19] }, { 15: [1, 20] }, n(t, [2, 11]), n(t, [2, 12]), n(t, [2, 13]), n(t, [2, 14]), n(t, [2, 15]), n(t, [2, 16]), n(t, [2, 4]), n(t, [2, 9]), n(t, [2, 10])],
57
- defaultActions: {},
58
- parseError: function(i, r) {
59
- if (r.recoverable)
60
- this.trace(i);
61
- else {
62
- var c = new Error(i);
63
- throw c.hash = r, c;
64
- }
65
- },
66
- parse: function(i) {
67
- var r = this, c = [0], d = [], u = [null], o = [], I = this.table, x = "", E = 0, O = 0, z = 2, P = 1, j = o.slice.call(arguments, 1), k = Object.create(this.lexer), $ = { yy: {} };
68
- for (var R in this.yy)
69
- Object.prototype.hasOwnProperty.call(this.yy, R) && ($.yy[R] = this.yy[R]);
70
- k.setInput(i, $.yy), $.yy.lexer = k, $.yy.parser = this, typeof k.yylloc == "undefined" && (k.yylloc = {});
71
- var F = k.yylloc;
72
- o.push(F);
73
- var A = k.options && k.options.ranges;
74
- typeof $.yy.parseError == "function" ? this.parseError = $.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
75
- function w() {
76
- var L;
77
- return L = d.pop() || k.lex() || P, typeof L != "number" && (L instanceof Array && (d = L, L = d.pop()), L = r.symbols_[L] || L), L;
78
- }
79
- for (var _, T, v, N, H = {}, V, M, Y, G; ; ) {
80
- if (T = c[c.length - 1], this.defaultActions[T] ? v = this.defaultActions[T] : ((_ === null || typeof _ == "undefined") && (_ = w()), v = I[T] && I[T][_]), typeof v == "undefined" || !v.length || !v[0]) {
81
- var J = "";
82
- G = [];
83
- for (V in I[T])
84
- this.terminals_[V] && V > z && G.push("'" + this.terminals_[V] + "'");
85
- k.showPosition ? J = "Parse error on line " + (E + 1) + `:
86
- ` + k.showPosition() + `
87
- Expecting ` + G.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : J = "Parse error on line " + (E + 1) + ": Unexpected " + (_ == P ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(J, {
88
- text: k.match,
89
- token: this.terminals_[_] || _,
90
- line: k.yylineno,
91
- loc: F,
92
- expected: G
93
- });
94
- }
95
- if (v[0] instanceof Array && v.length > 1)
96
- throw new Error("Parse Error: multiple actions possible at state: " + T + ", token: " + _);
97
- switch (v[0]) {
98
- case 1:
99
- c.push(_), u.push(k.yytext), o.push(k.yylloc), c.push(v[1]), _ = null, O = k.yyleng, x = k.yytext, E = k.yylineno, F = k.yylloc;
100
- break;
101
- case 2:
102
- if (M = this.productions_[v[1]][1], H.$ = u[u.length - M], H._$ = {
103
- first_line: o[o.length - (M || 1)].first_line,
104
- last_line: o[o.length - 1].last_line,
105
- first_column: o[o.length - (M || 1)].first_column,
106
- last_column: o[o.length - 1].last_column
107
- }, A && (H._$.range = [
108
- o[o.length - (M || 1)].range[0],
109
- o[o.length - 1].range[1]
110
- ]), N = this.performAction.apply(H, [
111
- x,
112
- O,
113
- E,
114
- $.yy,
115
- v[1],
116
- u,
117
- o
118
- ].concat(j)), typeof N != "undefined")
119
- return N;
120
- M && (c = c.slice(0, -1 * M * 2), u = u.slice(0, -1 * M), o = o.slice(0, -1 * M)), c.push(this.productions_[v[1]][0]), u.push(H.$), o.push(H._$), Y = I[c[c.length - 2]][c[c.length - 1]], c.push(Y);
121
- break;
122
- case 3:
123
- return !0;
124
- }
125
- }
126
- return !0;
127
- }
128
- }, b = function() {
129
- var g = {
130
- EOF: 1,
131
- parseError: function(r, c) {
132
- if (this.yy.parser)
133
- this.yy.parser.parseError(r, c);
134
- else
135
- throw new Error(r);
136
- },
137
- // resets the lexer, sets new input
138
- setInput: function(i, r) {
139
- return this.yy = r || this.yy || {}, this._input = i, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
140
- first_line: 1,
141
- first_column: 0,
142
- last_line: 1,
143
- last_column: 0
144
- }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
145
- },
146
- // consumes and returns one char from the input
147
- input: function() {
148
- var i = this._input[0];
149
- this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
150
- var r = i.match(/(?:\r\n?|\n).*/g);
151
- return r ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), i;
152
- },
153
- // unshifts one char (or a string) into the input
154
- unput: function(i) {
155
- var r = i.length, c = i.split(/(?:\r\n?|\n)/g);
156
- this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r;
157
- var d = this.match.split(/(?:\r\n?|\n)/g);
158
- this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), c.length - 1 && (this.yylineno -= c.length - 1);
159
- var u = this.yylloc.range;
160
- return this.yylloc = {
161
- first_line: this.yylloc.first_line,
162
- last_line: this.yylineno + 1,
163
- first_column: this.yylloc.first_column,
164
- last_column: c ? (c.length === d.length ? this.yylloc.first_column : 0) + d[d.length - c.length].length - c[0].length : this.yylloc.first_column - r
165
- }, this.options.ranges && (this.yylloc.range = [u[0], u[0] + this.yyleng - r]), this.yyleng = this.yytext.length, this;
166
- },
167
- // When called from action, caches matched text and appends it on next action
168
- more: function() {
169
- return this._more = !0, this;
170
- },
171
- // 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.
172
- reject: function() {
173
- if (this.options.backtrack_lexer)
174
- this._backtrack = !0;
175
- else
176
- 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).
177
- ` + this.showPosition(), {
178
- text: "",
179
- token: null,
180
- line: this.yylineno
181
- });
182
- return this;
183
- },
184
- // retain first n characters of the match
185
- less: function(i) {
186
- this.unput(this.match.slice(i));
187
- },
188
- // displays already matched input, i.e. for error messages
189
- pastInput: function() {
190
- var i = this.matched.substr(0, this.matched.length - this.match.length);
191
- return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
192
- },
193
- // displays upcoming input, i.e. for error messages
194
- upcomingInput: function() {
195
- var i = this.match;
196
- return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
197
- },
198
- // displays the character position where the lexing error occurred, i.e. for error messages
199
- showPosition: function() {
200
- var i = this.pastInput(), r = new Array(i.length + 1).join("-");
201
- return i + this.upcomingInput() + `
202
- ` + r + "^";
203
- },
204
- // test the lexed token: return FALSE when not a match, otherwise return token
205
- test_match: function(i, r) {
206
- var c, d, u;
207
- if (this.options.backtrack_lexer && (u = {
208
- yylineno: this.yylineno,
209
- yylloc: {
210
- first_line: this.yylloc.first_line,
211
- last_line: this.last_line,
212
- first_column: this.yylloc.first_column,
213
- last_column: this.yylloc.last_column
214
- },
215
- yytext: this.yytext,
216
- match: this.match,
217
- matches: this.matches,
218
- matched: this.matched,
219
- yyleng: this.yyleng,
220
- offset: this.offset,
221
- _more: this._more,
222
- _input: this._input,
223
- yy: this.yy,
224
- conditionStack: this.conditionStack.slice(0),
225
- done: this.done
226
- }, this.options.ranges && (u.yylloc.range = this.yylloc.range.slice(0))), d = i[0].match(/(?:\r\n?|\n).*/g), d && (this.yylineno += d.length), this.yylloc = {
227
- first_line: this.yylloc.last_line,
228
- last_line: this.yylineno + 1,
229
- first_column: this.yylloc.last_column,
230
- last_column: d ? d[d.length - 1].length - d[d.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
231
- }, this.yytext += i[0], this.match += i[0], this.matches = i, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(i[0].length), this.matched += i[0], c = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), c)
232
- return c;
233
- if (this._backtrack) {
234
- for (var o in u)
235
- this[o] = u[o];
236
- return !1;
237
- }
238
- return !1;
239
- },
240
- // return next match in input
241
- next: function() {
242
- if (this.done)
243
- return this.EOF;
244
- this._input || (this.done = !0);
245
- var i, r, c, d;
246
- this._more || (this.yytext = "", this.match = "");
247
- for (var u = this._currentRules(), o = 0; o < u.length; o++)
248
- if (c = this._input.match(this.rules[u[o]]), c && (!r || c[0].length > r[0].length)) {
249
- if (r = c, d = o, this.options.backtrack_lexer) {
250
- if (i = this.test_match(c, u[o]), i !== !1)
251
- return i;
252
- if (this._backtrack) {
253
- r = !1;
254
- continue;
255
- } else
256
- return !1;
257
- } else if (!this.options.flex)
258
- break;
259
- }
260
- return r ? (i = this.test_match(r, u[d]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
261
- ` + this.showPosition(), {
262
- text: "",
263
- token: null,
264
- line: this.yylineno
265
- });
266
- },
267
- // return next match that has a token
268
- lex: function() {
269
- var r = this.next();
270
- return r || this.lex();
271
- },
272
- // activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
273
- begin: function(r) {
274
- this.conditionStack.push(r);
275
- },
276
- // pop the previously active lexer condition state off the condition stack
277
- popState: function() {
278
- var r = this.conditionStack.length - 1;
279
- return r > 0 ? this.conditionStack.pop() : this.conditionStack[0];
280
- },
281
- // produce the lexer rule set which is active for the currently active lexer condition state
282
- _currentRules: function() {
283
- return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
284
- },
285
- // return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
286
- topState: function(r) {
287
- return r = this.conditionStack.length - 1 - Math.abs(r || 0), r >= 0 ? this.conditionStack[r] : "INITIAL";
288
- },
289
- // alias for begin(condition)
290
- pushState: function(r) {
291
- this.begin(r);
292
- },
293
- // return the number of states currently on the stack
294
- stateStackSize: function() {
295
- return this.conditionStack.length;
296
- },
297
- options: { "case-insensitive": !0 },
298
- performAction: function(r, c, d, u) {
299
- switch (d) {
300
- case 0:
301
- break;
302
- case 1:
303
- break;
304
- case 2:
305
- return 10;
306
- case 3:
307
- break;
308
- case 4:
309
- break;
310
- case 5:
311
- return 4;
312
- case 6:
313
- return 11;
314
- case 7:
315
- return this.begin("acc_title"), 12;
316
- case 8:
317
- return this.popState(), "acc_title_value";
318
- case 9:
319
- return this.begin("acc_descr"), 14;
320
- case 10:
321
- return this.popState(), "acc_descr_value";
322
- case 11:
323
- this.begin("acc_descr_multiline");
324
- break;
325
- case 12:
326
- this.popState();
327
- break;
328
- case 13:
329
- return "acc_descr_multiline_value";
330
- case 14:
331
- return 17;
332
- case 15:
333
- return 21;
334
- case 16:
335
- return 20;
336
- case 17:
337
- return 6;
338
- case 18:
339
- return "INVALID";
340
- }
341
- },
342
- 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],
343
- conditions: { acc_descr_multiline: { rules: [12, 13], inclusive: !1 }, acc_descr: { rules: [10], inclusive: !1 }, acc_title: { rules: [8], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 9, 11, 14, 15, 16, 17, 18], inclusive: !0 } }
344
- };
345
- return g;
346
- }();
347
- f.lexer = b;
348
- function m() {
349
- this.yy = {};
350
- }
351
- return m.prototype = f, f.Parser = m, new m();
352
- }();
353
- K.parser = K;
354
- const vt = K;
355
- let W = "", st = 0;
356
- const Q = [], U = [], B = [], it = () => ft, rt = function() {
357
- Q.length = 0, U.length = 0, W = "", B.length = 0, gt();
358
- }, at = function(n) {
359
- W = n, Q.push(n);
360
- }, lt = function() {
361
- return Q;
362
- }, ot = function() {
363
- let n = tt();
364
- const t = 100;
365
- let e = 0;
366
- for (; !n && e < t; )
367
- n = tt(), e++;
368
- return U.push(...B), U;
369
- }, ct = function(n, t, e) {
370
- const a = {
371
- id: st++,
372
- section: W,
373
- type: W,
374
- task: n,
375
- score: t || 0,
376
- //if event is defined, then add it the events array
377
- events: e ? [e] : []
378
- };
379
- B.push(a);
380
- }, ht = function(n) {
381
- B.find((e) => e.id === st - 1).events.push(n);
382
- }, dt = function(n) {
383
- const t = {
384
- section: W,
385
- type: W,
386
- description: n,
387
- task: n,
388
- classes: []
389
- };
390
- U.push(t);
391
- }, tt = function() {
392
- const n = function(e) {
393
- return B[e].processed;
394
- };
395
- let t = !0;
396
- for (const [e, a] of B.entries())
397
- n(e), t = t && a.processed;
398
- return t;
399
- }, wt = {
400
- clear: rt,
401
- getCommonDb: it,
402
- addSection: at,
403
- getSections: lt,
404
- getTasks: ot,
405
- addTask: ct,
406
- addTaskOrg: dt,
407
- addEvent: ht
408
- }, St = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
409
- __proto__: null,
410
- addEvent: ht,
411
- addSection: at,
412
- addTask: ct,
413
- addTaskOrg: dt,
414
- clear: rt,
415
- default: wt,
416
- getCommonDb: it,
417
- getSections: lt,
418
- getTasks: ot
419
- }, Symbol.toStringTag, { value: "Module" })), Et = 12, Z = function(n, t) {
420
- const e = n.append("rect");
421
- return e.attr("x", t.x), e.attr("y", t.y), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("width", t.width), e.attr("height", t.height), e.attr("rx", t.rx), e.attr("ry", t.ry), t.class !== void 0 && e.attr("class", t.class), e;
422
- }, Tt = function(n, t) {
423
- const a = n.append("circle").attr("cx", t.cx).attr("cy", t.cy).attr("class", "face").attr("r", 15).attr("stroke-width", 2).attr("overflow", "visible"), s = n.append("g");
424
- s.append("circle").attr("cx", t.cx - 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666"), s.append("circle").attr("cx", t.cx + 15 / 3).attr("cy", t.cy - 15 / 3).attr("r", 1.5).attr("stroke-width", 2).attr("fill", "#666").attr("stroke", "#666");
425
- function h(y) {
426
- const f = D().startAngle(Math.PI / 2).endAngle(3 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
427
- y.append("path").attr("class", "mouth").attr("d", f).attr("transform", "translate(" + t.cx + "," + (t.cy + 2) + ")");
428
- }
429
- function l(y) {
430
- const f = D().startAngle(3 * Math.PI / 2).endAngle(5 * (Math.PI / 2)).innerRadius(7.5).outerRadius(6.8181818181818175);
431
- y.append("path").attr("class", "mouth").attr("d", f).attr("transform", "translate(" + t.cx + "," + (t.cy + 7) + ")");
432
- }
433
- function p(y) {
434
- y.append("line").attr("class", "mouth").attr("stroke", 2).attr("x1", t.cx - 5).attr("y1", t.cy + 7).attr("x2", t.cx + 5).attr("y2", t.cy + 7).attr("class", "mouth").attr("stroke-width", "1px").attr("stroke", "#666");
435
- }
436
- return t.score > 3 ? h(s) : t.score < 3 ? l(s) : p(s), a;
437
- }, It = function(n, t) {
438
- const e = n.append("circle");
439
- return e.attr("cx", t.cx), e.attr("cy", t.cy), e.attr("class", "actor-" + t.pos), e.attr("fill", t.fill), e.attr("stroke", t.stroke), e.attr("r", t.r), e.class !== void 0 && e.attr("class", e.class), t.title !== void 0 && e.append("title").text(t.title), e;
440
- }, ut = function(n, t) {
441
- const e = t.text.replace(/<br\s*\/?>/gi, " "), a = n.append("text");
442
- a.attr("x", t.x), a.attr("y", t.y), a.attr("class", "legend"), a.style("text-anchor", t.anchor), t.class !== void 0 && a.attr("class", t.class);
443
- const s = a.append("tspan");
444
- return s.attr("x", t.x + t.textMargin * 2), s.text(e), a;
445
- }, $t = function(n, t) {
446
- function e(s, h, l, p, y) {
447
- return s + "," + h + " " + (s + l) + "," + h + " " + (s + l) + "," + (h + p - y) + " " + (s + l - y * 1.2) + "," + (h + p) + " " + s + "," + (h + p);
448
- }
449
- const a = n.append("polygon");
450
- a.attr("points", e(t.x, t.y, 50, 20, 7)), a.attr("class", "labelBox"), t.y = t.y + t.labelMargin, t.x = t.x + 0.5 * t.labelMargin, ut(n, t);
451
- }, Nt = function(n, t, e) {
452
- const a = n.append("g"), s = X();
453
- s.x = t.x, s.y = t.y, s.fill = t.fill, s.width = e.width, s.height = e.height, s.class = "journey-section section-type-" + t.num, s.rx = 3, s.ry = 3, Z(a, s), pt(e)(
454
- t.text,
455
- a,
456
- s.x,
457
- s.y,
458
- s.width,
459
- s.height,
460
- { class: "journey-section section-type-" + t.num },
461
- e,
462
- t.colour
463
- );
464
- };
465
- let et = -1;
466
- const Mt = function(n, t, e) {
467
- const a = t.x + e.width / 2, s = n.append("g");
468
- et++;
469
- const h = 300 + 5 * 30;
470
- s.append("line").attr("id", "task" + et).attr("x1", a).attr("y1", t.y).attr("x2", a).attr("y2", h).attr("class", "task-line").attr("stroke-width", "1px").attr("stroke-dasharray", "4 2").attr("stroke", "#666"), Tt(s, {
471
- cx: a,
472
- cy: 300 + (5 - t.score) * 30,
473
- score: t.score
474
- });
475
- const l = X();
476
- l.x = t.x, l.y = t.y, l.fill = t.fill, l.width = e.width, l.height = e.height, l.class = "task task-type-" + t.num, l.rx = 3, l.ry = 3, Z(s, l), t.x + 14, pt(e)(
477
- t.task,
478
- s,
479
- l.x,
480
- l.y,
481
- l.width,
482
- l.height,
483
- { class: "task" },
484
- e,
485
- t.colour
486
- );
487
- }, Lt = function(n, t) {
488
- Z(n, {
489
- x: t.startx,
490
- y: t.starty,
491
- width: t.stopx - t.startx,
492
- height: t.stopy - t.starty,
493
- fill: t.fill,
494
- class: "rect"
495
- }).lower();
496
- }, At = function() {
497
- return {
498
- x: 0,
499
- y: 0,
500
- fill: void 0,
501
- "text-anchor": "start",
502
- width: 100,
503
- height: 100,
504
- textMargin: 0,
505
- rx: 0,
506
- ry: 0
507
- };
508
- }, X = function() {
509
- return {
510
- x: 0,
511
- y: 0,
512
- width: 100,
513
- anchor: "start",
514
- height: 100,
515
- rx: 0,
516
- ry: 0
517
- };
518
- }, pt = function() {
519
- function n(s, h, l, p, y, f, b, m) {
520
- const g = h.append("text").attr("x", l + y / 2).attr("y", p + f / 2 + 5).style("font-color", m).style("text-anchor", "middle").text(s);
521
- a(g, b);
522
- }
523
- function t(s, h, l, p, y, f, b, m, g) {
524
- const { taskFontSize: i, taskFontFamily: r } = m, c = s.split(/<br\s*\/?>/gi);
525
- for (let d = 0; d < c.length; d++) {
526
- const u = d * i - i * (c.length - 1) / 2, o = h.append("text").attr("x", l + y / 2).attr("y", p).attr("fill", g).style("text-anchor", "middle").style("font-size", i).style("font-family", r);
527
- o.append("tspan").attr("x", l + y / 2).attr("dy", u).text(c[d]), o.attr("y", p + f / 2).attr("dominant-baseline", "central").attr("alignment-baseline", "central"), a(o, b);
528
- }
529
- }
530
- function e(s, h, l, p, y, f, b, m) {
531
- const g = h.append("switch"), r = g.append("foreignObject").attr("x", l).attr("y", p).attr("width", y).attr("height", f).attr("position", "fixed").append("xhtml:div").style("display", "table").style("height", "100%").style("width", "100%");
532
- r.append("div").attr("class", "label").style("display", "table-cell").style("text-align", "center").style("vertical-align", "middle").text(s), t(s, g, l, p, y, f, b, m), a(r, b);
533
- }
534
- function a(s, h) {
535
- for (const l in h)
536
- l in h && s.attr(l, h[l]);
537
- }
538
- return function(s) {
539
- return s.textPlacement === "fo" ? e : s.textPlacement === "old" ? n : t;
540
- };
541
- }(), Pt = function(n) {
542
- n.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");
543
- };
544
- function yt(n, t) {
545
- n.each(function() {
546
- var e = q(this), a = e.text().split(/(\s+|<br>)/).reverse(), s, h = [], l = 1.1, p = e.attr("y"), y = parseFloat(e.attr("dy")), f = e.text(null).append("tspan").attr("x", 0).attr("y", p).attr("dy", y + "em");
547
- for (let b = 0; b < a.length; b++)
548
- s = a[a.length - 1 - b], h.push(s), f.text(h.join(" ").trim()), (f.node().getComputedTextLength() > t || s === "<br>") && (h.pop(), f.text(h.join(" ").trim()), s === "<br>" ? h = [""] : h = [s], f = e.append("tspan").attr("x", 0).attr("y", p).attr("dy", l + "em").text(s));
549
- });
550
- }
551
- const Ht = function(n, t, e, a) {
552
- const s = e % Et - 1, h = n.append("g");
553
- t.section = s, h.attr(
554
- "class",
555
- (t.class ? t.class + " " : "") + "timeline-node " + ("section-" + s)
556
- );
557
- const l = h.append("g"), p = h.append("g"), f = p.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(yt, t.width).node().getBBox(), b = a.fontSize && a.fontSize.replace ? a.fontSize.replace("px", "") : a.fontSize;
558
- return t.height = f.height + b * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, p.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), zt(l, t, s), t;
559
- }, Ct = function(n, t, e) {
560
- const a = n.append("g"), h = a.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(yt, t.width).node().getBBox(), l = e.fontSize && e.fontSize.replace ? e.fontSize.replace("px", "") : e.fontSize;
561
- return a.remove(), h.height + l * 1.1 * 0.5 + t.padding;
562
- }, zt = function(n, t, e) {
563
- n.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr(
564
- "d",
565
- `M0 ${t.height - 5} v${-t.height + 2 * 5} q0,-5 5,-5 h${t.width - 2 * 5} q5,0 5,5 v${t.height - 5} H0 Z`
566
- ), n.append("line").attr("class", "node-line-" + e).attr("x1", 0).attr("y1", t.height).attr("x2", t.width).attr("y2", t.height);
567
- }, C = {
568
- drawRect: Z,
569
- drawCircle: It,
570
- drawSection: Nt,
571
- drawText: ut,
572
- drawLabel: $t,
573
- drawTask: Mt,
574
- drawBackgroundRect: Lt,
575
- getTextObj: At,
576
- getNoteRect: X,
577
- initGraphics: Pt,
578
- drawNode: Ht,
579
- getVirtualNodeHeight: Ct
580
- }, Rt = function(n, t, e, a) {
581
- var $, R, F;
582
- var s, h;
583
- const l = mt(), p = ($ = l.leftMargin) != null ? $ : 50;
584
- S.debug("timeline", a.db);
585
- const y = l.securityLevel;
586
- let f;
587
- y === "sandbox" && (f = q("#i" + t));
588
- const m = (y === "sandbox" ? q(f.nodes()[0].contentDocument.body) : q("body")).select("#" + t);
589
- m.append("g");
590
- const g = a.db.getTasks(), i = a.db.getCommonDb().getDiagramTitle();
591
- S.debug("task", g), C.initGraphics(m);
592
- const r = a.db.getSections();
593
- S.debug("sections", r);
594
- let c = 0, d = 0, u = 0, o = 0, I = 50 + p, x = 50;
595
- o = 50;
596
- let E = 0, O = !0;
597
- r.forEach(function(A) {
598
- const w = {
599
- number: E,
600
- descr: A,
601
- section: E,
602
- width: 150,
603
- padding: 20,
604
- maxHeight: c
605
- }, _ = C.getVirtualNodeHeight(m, w, l);
606
- S.debug("sectionHeight before draw", _), c = Math.max(c, _ + 20);
607
- });
608
- let z = 0, P = 0;
609
- S.debug("tasks.length", g.length);
610
- for (const [A, w] of g.entries()) {
611
- const _ = {
612
- number: A,
613
- descr: w,
614
- section: w.section,
615
- width: 150,
616
- padding: 20,
617
- maxHeight: d
618
- }, T = C.getVirtualNodeHeight(m, _, l);
619
- S.debug("taskHeight before draw", T), d = Math.max(d, T + 20), z = Math.max(z, w.events.length);
620
- let v = 0;
621
- for (let N = 0; N < w.events.length; N++) {
622
- const V = {
623
- descr: w.events[N],
624
- section: w.section,
625
- number: w.section,
626
- width: 150,
627
- padding: 20,
628
- maxHeight: 50
629
- };
630
- v += C.getVirtualNodeHeight(m, V, l);
631
- }
632
- P = Math.max(P, v);
633
- }
634
- S.debug("maxSectionHeight before draw", c), S.debug("maxTaskHeight before draw", d), r && r.length > 0 ? r.forEach((A) => {
635
- const w = g.filter((N) => N.section === A), _ = {
636
- number: E,
637
- descr: A,
638
- section: E,
639
- width: 200 * Math.max(w.length, 1) - 50,
640
- padding: 20,
641
- maxHeight: c
642
- };
643
- S.debug("sectionNode", _);
644
- const T = m.append("g"), v = C.drawNode(T, _, E, l);
645
- S.debug("sectionNode output", v), T.attr("transform", `translate(${I}, ${o})`), x += c + 50, w.length > 0 && nt(
646
- m,
647
- w,
648
- E,
649
- I,
650
- x,
651
- d,
652
- l,
653
- z,
654
- P,
655
- c,
656
- !1
657
- ), I += 200 * Math.max(w.length, 1), x = o, E++;
658
- }) : (O = !1, nt(
659
- m,
660
- g,
661
- E,
662
- I,
663
- x,
664
- d,
665
- l,
666
- z,
667
- P,
668
- c,
669
- !0
670
- ));
671
- const j = m.node().getBBox();
672
- S.debug("bounds", j), i && m.append("text").text(i).attr("x", j.width / 2 - p).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), u = O ? c + d + 150 : d + 100, m.append("g").attr("class", "lineWrapper").append("line").attr("x1", p).attr("y1", u).attr("x2", j.width + 3 * p).attr("y2", u).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), xt(
673
- void 0,
674
- m,
675
- (R = (s = l.timeline) == null ? void 0 : s.padding) != null ? R : 50,
676
- (F = (h = l.timeline) == null ? void 0 : h.useMaxWidth) != null ? F : !1
677
- );
678
- }, nt = function(n, t, e, a, s, h, l, p, y, f, b) {
679
- var m;
680
- for (const g of t) {
681
- const i = {
682
- descr: g.task,
683
- section: e,
684
- number: e,
685
- width: 150,
686
- padding: 20,
687
- maxHeight: h
688
- };
689
- S.debug("taskNode", i);
690
- const r = n.append("g").attr("class", "taskWrapper"), d = C.drawNode(r, i, e, l).height;
691
- if (S.debug("taskHeight after draw", d), r.attr("transform", `translate(${a}, ${s})`), h = Math.max(h, d), g.events) {
692
- const u = n.append("g").attr("class", "lineWrapper");
693
- let o = h;
694
- s += 100, o = o + Ft(n, g.events, e, a, s, l), s -= 100, u.append("line").attr("x1", a + 190 / 2).attr("y1", s + h).attr("x2", a + 190 / 2).attr(
695
- "y2",
696
- s + h + (b ? h : f) + y + 120
697
- ).attr("stroke-width", 2).attr("stroke", "black").attr("marker-end", "url(#arrowhead)").attr("stroke-dasharray", "5,5");
698
- }
699
- a = a + 200, b && !((m = l.timeline) != null && m.disableMulticolor) && e++;
700
- }
701
- s = s - 10;
702
- }, Ft = function(n, t, e, a, s, h) {
703
- let l = 0;
704
- const p = s;
705
- s = s + 100;
706
- for (const y of t) {
707
- const f = {
708
- descr: y,
709
- section: e,
710
- number: e,
711
- width: 150,
712
- padding: 20,
713
- maxHeight: 50
714
- };
715
- S.debug("eventNode", f);
716
- const b = n.append("g").attr("class", "eventWrapper"), g = C.drawNode(b, f, e, h).height;
717
- l = l + g, b.attr("transform", `translate(${a}, ${s})`), s = s + 10 + g;
718
- }
719
- return s = p, l;
720
- }, Vt = {
721
- setConf: () => {
722
- },
723
- draw: Rt
724
- }, Wt = (n) => {
725
- let t = "";
726
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++)
727
- n["lineColor" + e] = n["lineColor" + e] || n["cScaleInv" + e], _t(n["lineColor" + e]) ? n["lineColor" + e] = bt(n["lineColor" + e], 20) : n["lineColor" + e] = kt(n["lineColor" + e], 20);
728
- for (let e = 0; e < n.THEME_COLOR_LIMIT; e++) {
729
- const a = "" + (17 - 3 * e);
730
- t += `
731
- .section-${e - 1} rect, .section-${e - 1} path, .section-${e - 1} circle, .section-${e - 1} path {
732
- fill: ${n["cScale" + e]};
733
- }
734
- .section-${e - 1} text {
735
- fill: ${n["cScaleLabel" + e]};
736
- }
737
- .node-icon-${e - 1} {
738
- font-size: 40px;
739
- color: ${n["cScaleLabel" + e]};
740
- }
741
- .section-edge-${e - 1}{
742
- stroke: ${n["cScale" + e]};
743
- }
744
- .edge-depth-${e - 1}{
745
- stroke-width: ${a};
746
- }
747
- .section-${e - 1} line {
748
- stroke: ${n["cScaleInv" + e]} ;
749
- stroke-width: 3;
750
- }
751
-
752
- .lineWrapper line{
753
- stroke: ${n["cScaleLabel" + e]} ;
754
- }
755
-
756
- .disabled, .disabled circle, .disabled text {
757
- fill: lightgray;
758
- }
759
- .disabled text {
760
- fill: #efefef;
761
- }
762
- `;
763
- }
764
- return t;
765
- }, Bt = (n) => `
766
- .edge {
767
- stroke-width: 3;
768
- }
769
- ${Wt(n)}
770
- .section-root rect, .section-root path, .section-root circle {
771
- fill: ${n.git0};
772
- }
773
- .section-root text {
774
- fill: ${n.gitBranchLabel0};
775
- }
776
- .icon-container {
777
- height:100%;
778
- display: flex;
779
- justify-content: center;
780
- align-items: center;
781
- }
782
- .edge {
783
- fill: none;
784
- }
785
- .eventWrapper {
786
- filter: brightness(120%);
787
- }
788
- `, Ot = Bt, Ut = {
789
- db: St,
790
- renderer: Vt,
791
- parser: vt,
792
- styles: Ot
793
- };
794
- export {
795
- Ut as diagram
796
- };