lowcoder-comps 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/icons/icon-chart.svg +15 -0
- package/icons/icon-comp-calendar.svg +22 -0
- package/index.html +26 -0
- package/index.tsx +19 -0
- package/jest.config.js +5 -0
- package/package/012a06bb.js +34 -0
- package/package/06481cb7.js +1060 -0
- package/package/0c8b29d5.js +6 -0
- package/package/114884df.js +805 -0
- package/package/1264ddb2.js +194 -0
- package/package/1cee31ec.js +1095 -0
- package/package/269c3ba3.js +46662 -0
- package/package/2a2c2e55.js +799 -0
- package/package/2b3ab1e4.js +98763 -0
- package/package/37590a81.js +967 -0
- package/package/3cd7980e.js +184 -0
- package/package/40112498.js +424 -0
- package/package/4b6e1d6f.js +24 -0
- package/package/4bc1082b.js +86 -0
- package/package/53e49f9b.js +1600 -0
- package/package/55bd5c26.js +266 -0
- package/package/591684c8.js +2071 -0
- package/package/6c000872.js +16 -0
- package/package/756addec.js +775 -0
- package/package/7668124e.js +8 -0
- package/package/79e8eeeb.js +949 -0
- package/package/926fbfec.js +91 -0
- package/package/945eefb3.js +2665 -0
- package/package/a35f148e.js +1228 -0
- package/package/a4d12a43.js +175 -0
- package/package/a60de5d1.js +804 -0
- package/package/a8dde1ea.js +589 -0
- package/package/b4148642.js +7 -0
- package/package/b7dd22a2.js +847 -0
- package/package/d4f3a2c4.js +18046 -0
- package/package/e0f479f3.js +91 -0
- package/package/eaa160c9.js +341 -0
- package/package/f1bfd8b5.js +311 -0
- package/package/f1f9ba79.js +900 -0
- package/package/fba61f63.js +2868 -0
- package/package/icons/icon-chart.svg +15 -0
- package/package/icons/icon-comp-calendar.svg +22 -0
- package/package/index.js +5 -0
- package/package/package.json +73 -0
- package/package.json +1 -4
- package/src/__test__/allComp.test.tsx +61 -0
- package/src/app-env.d.ts +3 -0
- package/src/comps/calendarComp/calendarComp.tsx +442 -0
- package/src/comps/calendarComp/calendarConstants.tsx +897 -0
- package/src/comps/chartComp/chartComp.tsx +249 -0
- package/src/comps/chartComp/chartConfigs/barChartConfig.tsx +51 -0
- package/src/comps/chartComp/chartConfigs/cartesianAxisConfig.tsx +307 -0
- package/src/comps/chartComp/chartConfigs/chartUrls.tsx +6 -0
- package/src/comps/chartComp/chartConfigs/legendConfig.tsx +55 -0
- package/src/comps/chartComp/chartConfigs/lineChartConfig.tsx +96 -0
- package/src/comps/chartComp/chartConfigs/pieChartConfig.tsx +83 -0
- package/src/comps/chartComp/chartConfigs/scatterChartConfig.tsx +62 -0
- package/src/comps/chartComp/chartConstants.tsx +243 -0
- package/src/comps/chartComp/chartPropertyView.tsx +161 -0
- package/src/comps/chartComp/chartUtils.ts +240 -0
- package/src/comps/chartComp/reactEcharts/core.tsx +187 -0
- package/src/comps/chartComp/reactEcharts/index.ts +20 -0
- package/src/comps/chartComp/reactEcharts/types.ts +70 -0
- package/src/comps/chartComp/seriesComp.tsx +119 -0
- package/src/comps/imageEditorComp/imageEditorClass.tsx +52 -0
- package/src/comps/imageEditorComp/imageEditorConstants.tsx +109 -0
- package/src/comps/imageEditorComp/index.tsx +184 -0
- package/src/comps/mermaidComp/index.tsx +44 -0
- package/src/comps/mermaidComp/mermaid.tsx +29 -0
- package/src/global.ts +1 -0
- package/src/i18n/comps/index.tsx +29 -0
- package/src/i18n/comps/locales/en.ts +142 -0
- package/src/i18n/comps/locales/enObj.tsx +120 -0
- package/src/i18n/comps/locales/index.ts +7 -0
- package/src/i18n/comps/locales/types.tsx +9 -0
- package/src/i18n/comps/locales/zh.ts +4 -0
- package/src/i18n/comps/locales/zhObj.tsx +4 -0
- package/src/index.ts +11 -0
- package/vite.config.js +10 -0
|
@@ -0,0 +1,967 @@
|
|
|
1
|
+
import { c as Y, g as Ht, s as Xt, a as Kt, b as Wt, v as Jt, x as qt, m as Qt, l as v, k as ht, z as Zt, aB as te } from "./2b3ab1e4.js";
|
|
2
|
+
var mt = function() {
|
|
3
|
+
var t = function(D, r, a, i) {
|
|
4
|
+
for (a = a || {}, i = D.length; i--; a[D[i]] = r)
|
|
5
|
+
;
|
|
6
|
+
return a;
|
|
7
|
+
}, s = [1, 2], n = [1, 3], h = [1, 5], u = [1, 7], f = [2, 5], p = [1, 15], x = [1, 17], d = [1, 21], k = [1, 22], T = [1, 23], G = [1, 24], R = [1, 37], j = [1, 25], U = [1, 26], z = [1, 27], M = [1, 28], H = [1, 29], X = [1, 32], K = [1, 33], W = [1, 34], J = [1, 35], q = [1, 36], Q = [1, 39], Z = [1, 40], tt = [1, 41], et = [1, 42], w = [1, 38], Ct = [1, 45], o = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], st = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], ut = [1, 4, 5, 7, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], At = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], dt = {
|
|
8
|
+
trace: function() {
|
|
9
|
+
},
|
|
10
|
+
yy: {},
|
|
11
|
+
symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, directive: 6, SD: 7, document: 8, line: 9, statement: 10, classDefStatement: 11, cssClassStatement: 12, idStatement: 13, DESCR: 14, "-->": 15, HIDE_EMPTY: 16, scale: 17, WIDTH: 18, COMPOSIT_STATE: 19, STRUCT_START: 20, STRUCT_STOP: 21, STATE_DESCR: 22, AS: 23, ID: 24, FORK: 25, JOIN: 26, CHOICE: 27, CONCURRENT: 28, note: 29, notePosition: 30, NOTE_TEXT: 31, direction: 32, acc_title: 33, acc_title_value: 34, acc_descr: 35, acc_descr_value: 36, acc_descr_multiline_value: 37, classDef: 38, CLASSDEF_ID: 39, CLASSDEF_STYLEOPTS: 40, DEFAULT: 41, class: 42, CLASSENTITY_IDS: 43, STYLECLASS: 44, openDirective: 45, typeDirective: 46, closeDirective: 47, ":": 48, argDirective: 49, direction_tb: 50, direction_bt: 51, direction_rl: 52, direction_lr: 53, eol: 54, ";": 55, EDGE_STATE: 56, STYLE_SEPARATOR: 57, left_of: 58, right_of: 59, open_directive: 60, type_directive: 61, arg_directive: 62, close_directive: 63, $accept: 0, $end: 1 },
|
|
12
|
+
terminals_: { 2: "error", 4: "SPACE", 5: "NL", 7: "SD", 14: "DESCR", 15: "-->", 16: "HIDE_EMPTY", 17: "scale", 18: "WIDTH", 19: "COMPOSIT_STATE", 20: "STRUCT_START", 21: "STRUCT_STOP", 22: "STATE_DESCR", 23: "AS", 24: "ID", 25: "FORK", 26: "JOIN", 27: "CHOICE", 28: "CONCURRENT", 29: "note", 31: "NOTE_TEXT", 33: "acc_title", 34: "acc_title_value", 35: "acc_descr", 36: "acc_descr_value", 37: "acc_descr_multiline_value", 38: "classDef", 39: "CLASSDEF_ID", 40: "CLASSDEF_STYLEOPTS", 41: "DEFAULT", 42: "class", 43: "CLASSENTITY_IDS", 44: "STYLECLASS", 48: ":", 50: "direction_tb", 51: "direction_bt", 52: "direction_rl", 53: "direction_lr", 55: ";", 56: "EDGE_STATE", 57: "STYLE_SEPARATOR", 58: "left_of", 59: "right_of", 60: "open_directive", 61: "type_directive", 62: "arg_directive", 63: "close_directive" },
|
|
13
|
+
productions_: [0, [3, 2], [3, 2], [3, 2], [3, 2], [8, 0], [8, 2], [9, 2], [9, 1], [9, 1], [10, 1], [10, 1], [10, 1], [10, 2], [10, 3], [10, 4], [10, 1], [10, 2], [10, 1], [10, 4], [10, 3], [10, 6], [10, 1], [10, 1], [10, 1], [10, 1], [10, 4], [10, 4], [10, 1], [10, 1], [10, 2], [10, 2], [10, 1], [11, 3], [11, 3], [12, 3], [6, 3], [6, 5], [32, 1], [32, 1], [32, 1], [32, 1], [54, 1], [54, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1], [45, 1], [46, 1], [49, 1], [47, 1]],
|
|
14
|
+
performAction: function(r, a, i, l, y, e, B) {
|
|
15
|
+
var c = e.length - 1;
|
|
16
|
+
switch (y) {
|
|
17
|
+
case 4:
|
|
18
|
+
return l.setRootDoc(e[c]), e[c];
|
|
19
|
+
case 5:
|
|
20
|
+
this.$ = [];
|
|
21
|
+
break;
|
|
22
|
+
case 6:
|
|
23
|
+
e[c] != "nl" && (e[c - 1].push(e[c]), this.$ = e[c - 1]);
|
|
24
|
+
break;
|
|
25
|
+
case 7:
|
|
26
|
+
case 8:
|
|
27
|
+
this.$ = e[c];
|
|
28
|
+
break;
|
|
29
|
+
case 9:
|
|
30
|
+
this.$ = "nl";
|
|
31
|
+
break;
|
|
32
|
+
case 12:
|
|
33
|
+
this.$ = e[c];
|
|
34
|
+
break;
|
|
35
|
+
case 13:
|
|
36
|
+
const $ = e[c - 1];
|
|
37
|
+
$.description = l.trimColon(e[c]), this.$ = $;
|
|
38
|
+
break;
|
|
39
|
+
case 14:
|
|
40
|
+
this.$ = { stmt: "relation", state1: e[c - 2], state2: e[c] };
|
|
41
|
+
break;
|
|
42
|
+
case 15:
|
|
43
|
+
const pt = l.trimColon(e[c]);
|
|
44
|
+
this.$ = { stmt: "relation", state1: e[c - 3], state2: e[c - 1], description: pt };
|
|
45
|
+
break;
|
|
46
|
+
case 19:
|
|
47
|
+
this.$ = { stmt: "state", id: e[c - 3], type: "default", description: "", doc: e[c - 1] };
|
|
48
|
+
break;
|
|
49
|
+
case 20:
|
|
50
|
+
var C = e[c], O = e[c - 2].trim();
|
|
51
|
+
if (e[c].match(":")) {
|
|
52
|
+
var it = e[c].split(":");
|
|
53
|
+
C = it[0], O = [O, it[1]];
|
|
54
|
+
}
|
|
55
|
+
this.$ = { stmt: "state", id: C, type: "default", description: O };
|
|
56
|
+
break;
|
|
57
|
+
case 21:
|
|
58
|
+
this.$ = { stmt: "state", id: e[c - 3], type: "default", description: e[c - 5], doc: e[c - 1] };
|
|
59
|
+
break;
|
|
60
|
+
case 22:
|
|
61
|
+
this.$ = { stmt: "state", id: e[c], type: "fork" };
|
|
62
|
+
break;
|
|
63
|
+
case 23:
|
|
64
|
+
this.$ = { stmt: "state", id: e[c], type: "join" };
|
|
65
|
+
break;
|
|
66
|
+
case 24:
|
|
67
|
+
this.$ = { stmt: "state", id: e[c], type: "choice" };
|
|
68
|
+
break;
|
|
69
|
+
case 25:
|
|
70
|
+
this.$ = { stmt: "state", id: l.getDividerId(), type: "divider" };
|
|
71
|
+
break;
|
|
72
|
+
case 26:
|
|
73
|
+
this.$ = { stmt: "state", id: e[c - 1].trim(), note: { position: e[c - 2].trim(), text: e[c].trim() } };
|
|
74
|
+
break;
|
|
75
|
+
case 30:
|
|
76
|
+
this.$ = e[c].trim(), l.setAccTitle(this.$);
|
|
77
|
+
break;
|
|
78
|
+
case 31:
|
|
79
|
+
case 32:
|
|
80
|
+
this.$ = e[c].trim(), l.setAccDescription(this.$);
|
|
81
|
+
break;
|
|
82
|
+
case 33:
|
|
83
|
+
case 34:
|
|
84
|
+
this.$ = { stmt: "classDef", id: e[c - 1].trim(), classes: e[c].trim() };
|
|
85
|
+
break;
|
|
86
|
+
case 35:
|
|
87
|
+
this.$ = { stmt: "applyClass", id: e[c - 1].trim(), styleClass: e[c].trim() };
|
|
88
|
+
break;
|
|
89
|
+
case 38:
|
|
90
|
+
l.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
|
|
91
|
+
break;
|
|
92
|
+
case 39:
|
|
93
|
+
l.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
|
|
94
|
+
break;
|
|
95
|
+
case 40:
|
|
96
|
+
l.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
|
|
97
|
+
break;
|
|
98
|
+
case 41:
|
|
99
|
+
l.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
|
|
100
|
+
break;
|
|
101
|
+
case 44:
|
|
102
|
+
case 45:
|
|
103
|
+
this.$ = { stmt: "state", id: e[c].trim(), type: "default", description: "" };
|
|
104
|
+
break;
|
|
105
|
+
case 46:
|
|
106
|
+
this.$ = { stmt: "state", id: e[c - 2].trim(), classes: [e[c].trim()], type: "default", description: "" };
|
|
107
|
+
break;
|
|
108
|
+
case 47:
|
|
109
|
+
this.$ = { stmt: "state", id: e[c - 2].trim(), classes: [e[c].trim()], type: "default", description: "" };
|
|
110
|
+
break;
|
|
111
|
+
case 50:
|
|
112
|
+
l.parseDirective("%%{", "open_directive");
|
|
113
|
+
break;
|
|
114
|
+
case 51:
|
|
115
|
+
l.parseDirective(e[c], "type_directive");
|
|
116
|
+
break;
|
|
117
|
+
case 52:
|
|
118
|
+
e[c] = e[c].trim().replace(/'/g, '"'), l.parseDirective(e[c], "arg_directive");
|
|
119
|
+
break;
|
|
120
|
+
case 53:
|
|
121
|
+
l.parseDirective("}%%", "close_directive", "state");
|
|
122
|
+
break;
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
table: [{ 3: 1, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 1: [3] }, { 3: 8, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 3: 9, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, { 3: 10, 4: s, 5: n, 6: 4, 7: h, 45: 6, 60: u }, t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 42, 50, 51, 52, 53, 56, 60], f, { 8: 11 }), { 46: 12, 61: [1, 13] }, { 61: [2, 50] }, { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3] }, { 1: [2, 4], 4: p, 5: x, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, { 47: 43, 48: [1, 44], 63: Ct }, t([48, 63], [2, 51]), t(o, [2, 6]), { 6: 30, 10: 46, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 8]), t(o, [2, 9]), t(o, [2, 10]), t(o, [2, 11]), t(o, [2, 12], { 14: [1, 47], 15: [1, 48] }), t(o, [2, 16]), { 18: [1, 49] }, t(o, [2, 18], { 20: [1, 50] }), { 23: [1, 51] }, t(o, [2, 22]), t(o, [2, 23]), t(o, [2, 24]), t(o, [2, 25]), { 30: 52, 31: [1, 53], 58: [1, 54], 59: [1, 55] }, t(o, [2, 28]), t(o, [2, 29]), { 34: [1, 56] }, { 36: [1, 57] }, t(o, [2, 32]), { 39: [1, 58], 41: [1, 59] }, { 43: [1, 60] }, t(st, [2, 44], { 57: [1, 61] }), t(st, [2, 45], { 57: [1, 62] }), t(o, [2, 38]), t(o, [2, 39]), t(o, [2, 40]), t(o, [2, 41]), t(ut, [2, 36]), { 49: 63, 62: [1, 64] }, t(ut, [2, 53]), t(o, [2, 7]), t(o, [2, 13]), { 13: 65, 24: R, 56: w }, t(o, [2, 17]), t(At, f, { 8: 66 }), { 24: [1, 67] }, { 24: [1, 68] }, { 23: [1, 69] }, { 24: [2, 48] }, { 24: [2, 49] }, t(o, [2, 30]), t(o, [2, 31]), { 40: [1, 70] }, { 40: [1, 71] }, { 44: [1, 72] }, { 24: [1, 73] }, { 24: [1, 74] }, { 47: 75, 63: Ct }, { 63: [2, 52] }, t(o, [2, 14], { 14: [1, 76] }), { 4: p, 5: x, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 21: [1, 77], 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 20], { 20: [1, 78] }), { 31: [1, 79] }, { 24: [1, 80] }, t(o, [2, 33]), t(o, [2, 34]), t(o, [2, 35]), t(st, [2, 46]), t(st, [2, 47]), t(ut, [2, 37]), t(o, [2, 15]), t(o, [2, 19]), t(At, f, { 8: 81 }), t(o, [2, 26]), t(o, [2, 27]), { 4: p, 5: x, 6: 30, 9: 14, 10: 16, 11: 18, 12: 19, 13: 20, 16: d, 17: k, 19: T, 21: [1, 82], 22: G, 24: R, 25: j, 26: U, 27: z, 28: M, 29: H, 32: 31, 33: X, 35: K, 37: W, 38: J, 42: q, 45: 6, 50: Q, 51: Z, 52: tt, 53: et, 56: w, 60: u }, t(o, [2, 21])],
|
|
126
|
+
defaultActions: { 7: [2, 50], 8: [2, 1], 9: [2, 2], 10: [2, 3], 54: [2, 48], 55: [2, 49], 64: [2, 52] },
|
|
127
|
+
parseError: function(r, a) {
|
|
128
|
+
if (a.recoverable)
|
|
129
|
+
this.trace(r);
|
|
130
|
+
else {
|
|
131
|
+
var i = new Error(r);
|
|
132
|
+
throw i.hash = a, i;
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
parse: function(r) {
|
|
136
|
+
var a = this, i = [0], l = [], y = [null], e = [], B = this.table, c = "", C = 0, O = 0, it = 2, $ = 1, pt = e.slice.call(arguments, 1), S = Object.create(this.lexer), A = { yy: {} };
|
|
137
|
+
for (var yt in this.yy)
|
|
138
|
+
Object.prototype.hasOwnProperty.call(this.yy, yt) && (A.yy[yt] = this.yy[yt]);
|
|
139
|
+
S.setInput(r, A.yy), A.yy.lexer = S, A.yy.parser = this, typeof S.yylloc == "undefined" && (S.yylloc = {});
|
|
140
|
+
var St = S.yylloc;
|
|
141
|
+
e.push(St);
|
|
142
|
+
var zt = S.options && S.options.ranges;
|
|
143
|
+
typeof A.yy.parseError == "function" ? this.parseError = A.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
144
|
+
function Mt() {
|
|
145
|
+
var E;
|
|
146
|
+
return E = l.pop() || S.lex() || $, typeof E != "number" && (E instanceof Array && (l = E, E = l.pop()), E = a.symbols_[E] || E), E;
|
|
147
|
+
}
|
|
148
|
+
for (var _, L, m, gt, N = {}, rt, b, Lt, nt; ; ) {
|
|
149
|
+
if (L = i[i.length - 1], this.defaultActions[L] ? m = this.defaultActions[L] : ((_ === null || typeof _ == "undefined") && (_ = Mt()), m = B[L] && B[L][_]), typeof m == "undefined" || !m.length || !m[0]) {
|
|
150
|
+
var _t = "";
|
|
151
|
+
nt = [];
|
|
152
|
+
for (rt in B[L])
|
|
153
|
+
this.terminals_[rt] && rt > it && nt.push("'" + this.terminals_[rt] + "'");
|
|
154
|
+
S.showPosition ? _t = "Parse error on line " + (C + 1) + `:
|
|
155
|
+
` + S.showPosition() + `
|
|
156
|
+
Expecting ` + nt.join(", ") + ", got '" + (this.terminals_[_] || _) + "'" : _t = "Parse error on line " + (C + 1) + ": Unexpected " + (_ == $ ? "end of input" : "'" + (this.terminals_[_] || _) + "'"), this.parseError(_t, {
|
|
157
|
+
text: S.match,
|
|
158
|
+
token: this.terminals_[_] || _,
|
|
159
|
+
line: S.yylineno,
|
|
160
|
+
loc: St,
|
|
161
|
+
expected: nt
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
if (m[0] instanceof Array && m.length > 1)
|
|
165
|
+
throw new Error("Parse Error: multiple actions possible at state: " + L + ", token: " + _);
|
|
166
|
+
switch (m[0]) {
|
|
167
|
+
case 1:
|
|
168
|
+
i.push(_), y.push(S.yytext), e.push(S.yylloc), i.push(m[1]), _ = null, O = S.yyleng, c = S.yytext, C = S.yylineno, St = S.yylloc;
|
|
169
|
+
break;
|
|
170
|
+
case 2:
|
|
171
|
+
if (b = this.productions_[m[1]][1], N.$ = y[y.length - b], N._$ = {
|
|
172
|
+
first_line: e[e.length - (b || 1)].first_line,
|
|
173
|
+
last_line: e[e.length - 1].last_line,
|
|
174
|
+
first_column: e[e.length - (b || 1)].first_column,
|
|
175
|
+
last_column: e[e.length - 1].last_column
|
|
176
|
+
}, zt && (N._$.range = [
|
|
177
|
+
e[e.length - (b || 1)].range[0],
|
|
178
|
+
e[e.length - 1].range[1]
|
|
179
|
+
]), gt = this.performAction.apply(N, [
|
|
180
|
+
c,
|
|
181
|
+
O,
|
|
182
|
+
C,
|
|
183
|
+
A.yy,
|
|
184
|
+
m[1],
|
|
185
|
+
y,
|
|
186
|
+
e
|
|
187
|
+
].concat(pt)), typeof gt != "undefined")
|
|
188
|
+
return gt;
|
|
189
|
+
b && (i = i.slice(0, -1 * b * 2), y = y.slice(0, -1 * b), e = e.slice(0, -1 * b)), i.push(this.productions_[m[1]][0]), y.push(N.$), e.push(N._$), Lt = B[i[i.length - 2]][i[i.length - 1]], i.push(Lt);
|
|
190
|
+
break;
|
|
191
|
+
case 3:
|
|
192
|
+
return !0;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return !0;
|
|
196
|
+
}
|
|
197
|
+
}, Ut = function() {
|
|
198
|
+
var D = {
|
|
199
|
+
EOF: 1,
|
|
200
|
+
parseError: function(a, i) {
|
|
201
|
+
if (this.yy.parser)
|
|
202
|
+
this.yy.parser.parseError(a, i);
|
|
203
|
+
else
|
|
204
|
+
throw new Error(a);
|
|
205
|
+
},
|
|
206
|
+
setInput: function(r, a) {
|
|
207
|
+
return this.yy = a || this.yy || {}, this._input = r, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
208
|
+
first_line: 1,
|
|
209
|
+
first_column: 0,
|
|
210
|
+
last_line: 1,
|
|
211
|
+
last_column: 0
|
|
212
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
213
|
+
},
|
|
214
|
+
input: function() {
|
|
215
|
+
var r = this._input[0];
|
|
216
|
+
this.yytext += r, this.yyleng++, this.offset++, this.match += r, this.matched += r;
|
|
217
|
+
var a = r.match(/(?:\r\n?|\n).*/g);
|
|
218
|
+
return a ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), r;
|
|
219
|
+
},
|
|
220
|
+
unput: function(r) {
|
|
221
|
+
var a = r.length, i = r.split(/(?:\r\n?|\n)/g);
|
|
222
|
+
this._input = r + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - a), this.offset -= a;
|
|
223
|
+
var l = this.match.split(/(?:\r\n?|\n)/g);
|
|
224
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), i.length - 1 && (this.yylineno -= i.length - 1);
|
|
225
|
+
var y = this.yylloc.range;
|
|
226
|
+
return this.yylloc = {
|
|
227
|
+
first_line: this.yylloc.first_line,
|
|
228
|
+
last_line: this.yylineno + 1,
|
|
229
|
+
first_column: this.yylloc.first_column,
|
|
230
|
+
last_column: i ? (i.length === l.length ? this.yylloc.first_column : 0) + l[l.length - i.length].length - i[0].length : this.yylloc.first_column - a
|
|
231
|
+
}, this.options.ranges && (this.yylloc.range = [y[0], y[0] + this.yyleng - a]), this.yyleng = this.yytext.length, this;
|
|
232
|
+
},
|
|
233
|
+
more: function() {
|
|
234
|
+
return this._more = !0, this;
|
|
235
|
+
},
|
|
236
|
+
reject: function() {
|
|
237
|
+
if (this.options.backtrack_lexer)
|
|
238
|
+
this._backtrack = !0;
|
|
239
|
+
else
|
|
240
|
+
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).
|
|
241
|
+
` + this.showPosition(), {
|
|
242
|
+
text: "",
|
|
243
|
+
token: null,
|
|
244
|
+
line: this.yylineno
|
|
245
|
+
});
|
|
246
|
+
return this;
|
|
247
|
+
},
|
|
248
|
+
less: function(r) {
|
|
249
|
+
this.unput(this.match.slice(r));
|
|
250
|
+
},
|
|
251
|
+
pastInput: function() {
|
|
252
|
+
var r = this.matched.substr(0, this.matched.length - this.match.length);
|
|
253
|
+
return (r.length > 20 ? "..." : "") + r.substr(-20).replace(/\n/g, "");
|
|
254
|
+
},
|
|
255
|
+
upcomingInput: function() {
|
|
256
|
+
var r = this.match;
|
|
257
|
+
return r.length < 20 && (r += this._input.substr(0, 20 - r.length)), (r.substr(0, 20) + (r.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
258
|
+
},
|
|
259
|
+
showPosition: function() {
|
|
260
|
+
var r = this.pastInput(), a = new Array(r.length + 1).join("-");
|
|
261
|
+
return r + this.upcomingInput() + `
|
|
262
|
+
` + a + "^";
|
|
263
|
+
},
|
|
264
|
+
test_match: function(r, a) {
|
|
265
|
+
var i, l, y;
|
|
266
|
+
if (this.options.backtrack_lexer && (y = {
|
|
267
|
+
yylineno: this.yylineno,
|
|
268
|
+
yylloc: {
|
|
269
|
+
first_line: this.yylloc.first_line,
|
|
270
|
+
last_line: this.last_line,
|
|
271
|
+
first_column: this.yylloc.first_column,
|
|
272
|
+
last_column: this.yylloc.last_column
|
|
273
|
+
},
|
|
274
|
+
yytext: this.yytext,
|
|
275
|
+
match: this.match,
|
|
276
|
+
matches: this.matches,
|
|
277
|
+
matched: this.matched,
|
|
278
|
+
yyleng: this.yyleng,
|
|
279
|
+
offset: this.offset,
|
|
280
|
+
_more: this._more,
|
|
281
|
+
_input: this._input,
|
|
282
|
+
yy: this.yy,
|
|
283
|
+
conditionStack: this.conditionStack.slice(0),
|
|
284
|
+
done: this.done
|
|
285
|
+
}, this.options.ranges && (y.yylloc.range = this.yylloc.range.slice(0))), l = r[0].match(/(?:\r\n?|\n).*/g), l && (this.yylineno += l.length), this.yylloc = {
|
|
286
|
+
first_line: this.yylloc.last_line,
|
|
287
|
+
last_line: this.yylineno + 1,
|
|
288
|
+
first_column: this.yylloc.last_column,
|
|
289
|
+
last_column: l ? l[l.length - 1].length - l[l.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + r[0].length
|
|
290
|
+
}, this.yytext += r[0], this.match += r[0], this.matches = r, 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(r[0].length), this.matched += r[0], i = this.performAction.call(this, this.yy, this, a, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), i)
|
|
291
|
+
return i;
|
|
292
|
+
if (this._backtrack) {
|
|
293
|
+
for (var e in y)
|
|
294
|
+
this[e] = y[e];
|
|
295
|
+
return !1;
|
|
296
|
+
}
|
|
297
|
+
return !1;
|
|
298
|
+
},
|
|
299
|
+
next: function() {
|
|
300
|
+
if (this.done)
|
|
301
|
+
return this.EOF;
|
|
302
|
+
this._input || (this.done = !0);
|
|
303
|
+
var r, a, i, l;
|
|
304
|
+
this._more || (this.yytext = "", this.match = "");
|
|
305
|
+
for (var y = this._currentRules(), e = 0; e < y.length; e++)
|
|
306
|
+
if (i = this._input.match(this.rules[y[e]]), i && (!a || i[0].length > a[0].length)) {
|
|
307
|
+
if (a = i, l = e, this.options.backtrack_lexer) {
|
|
308
|
+
if (r = this.test_match(i, y[e]), r !== !1)
|
|
309
|
+
return r;
|
|
310
|
+
if (this._backtrack) {
|
|
311
|
+
a = !1;
|
|
312
|
+
continue;
|
|
313
|
+
} else
|
|
314
|
+
return !1;
|
|
315
|
+
} else if (!this.options.flex)
|
|
316
|
+
break;
|
|
317
|
+
}
|
|
318
|
+
return a ? (r = this.test_match(a, y[l]), r !== !1 ? r : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
319
|
+
` + this.showPosition(), {
|
|
320
|
+
text: "",
|
|
321
|
+
token: null,
|
|
322
|
+
line: this.yylineno
|
|
323
|
+
});
|
|
324
|
+
},
|
|
325
|
+
lex: function() {
|
|
326
|
+
var a = this.next();
|
|
327
|
+
return a || this.lex();
|
|
328
|
+
},
|
|
329
|
+
begin: function(a) {
|
|
330
|
+
this.conditionStack.push(a);
|
|
331
|
+
},
|
|
332
|
+
popState: function() {
|
|
333
|
+
var a = this.conditionStack.length - 1;
|
|
334
|
+
return a > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
335
|
+
},
|
|
336
|
+
_currentRules: function() {
|
|
337
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
338
|
+
},
|
|
339
|
+
topState: function(a) {
|
|
340
|
+
return a = this.conditionStack.length - 1 - Math.abs(a || 0), a >= 0 ? this.conditionStack[a] : "INITIAL";
|
|
341
|
+
},
|
|
342
|
+
pushState: function(a) {
|
|
343
|
+
this.begin(a);
|
|
344
|
+
},
|
|
345
|
+
stateStackSize: function() {
|
|
346
|
+
return this.conditionStack.length;
|
|
347
|
+
},
|
|
348
|
+
options: { "case-insensitive": !0 },
|
|
349
|
+
performAction: function(a, i, l, y) {
|
|
350
|
+
switch (l) {
|
|
351
|
+
case 0:
|
|
352
|
+
return 41;
|
|
353
|
+
case 1:
|
|
354
|
+
return 50;
|
|
355
|
+
case 2:
|
|
356
|
+
return 51;
|
|
357
|
+
case 3:
|
|
358
|
+
return 52;
|
|
359
|
+
case 4:
|
|
360
|
+
return 53;
|
|
361
|
+
case 5:
|
|
362
|
+
return this.begin("open_directive"), 60;
|
|
363
|
+
case 6:
|
|
364
|
+
return this.begin("type_directive"), 61;
|
|
365
|
+
case 7:
|
|
366
|
+
return this.popState(), this.begin("arg_directive"), 48;
|
|
367
|
+
case 8:
|
|
368
|
+
return this.popState(), this.popState(), 63;
|
|
369
|
+
case 9:
|
|
370
|
+
return 62;
|
|
371
|
+
case 10:
|
|
372
|
+
break;
|
|
373
|
+
case 11:
|
|
374
|
+
break;
|
|
375
|
+
case 12:
|
|
376
|
+
return 5;
|
|
377
|
+
case 13:
|
|
378
|
+
break;
|
|
379
|
+
case 14:
|
|
380
|
+
break;
|
|
381
|
+
case 15:
|
|
382
|
+
break;
|
|
383
|
+
case 16:
|
|
384
|
+
break;
|
|
385
|
+
case 17:
|
|
386
|
+
return this.pushState("SCALE"), 17;
|
|
387
|
+
case 18:
|
|
388
|
+
return 18;
|
|
389
|
+
case 19:
|
|
390
|
+
this.popState();
|
|
391
|
+
break;
|
|
392
|
+
case 20:
|
|
393
|
+
return this.begin("acc_title"), 33;
|
|
394
|
+
case 21:
|
|
395
|
+
return this.popState(), "acc_title_value";
|
|
396
|
+
case 22:
|
|
397
|
+
return this.begin("acc_descr"), 35;
|
|
398
|
+
case 23:
|
|
399
|
+
return this.popState(), "acc_descr_value";
|
|
400
|
+
case 24:
|
|
401
|
+
this.begin("acc_descr_multiline");
|
|
402
|
+
break;
|
|
403
|
+
case 25:
|
|
404
|
+
this.popState();
|
|
405
|
+
break;
|
|
406
|
+
case 26:
|
|
407
|
+
return "acc_descr_multiline_value";
|
|
408
|
+
case 27:
|
|
409
|
+
return this.pushState("CLASSDEF"), 38;
|
|
410
|
+
case 28:
|
|
411
|
+
return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
|
|
412
|
+
case 29:
|
|
413
|
+
return this.popState(), this.pushState("CLASSDEFID"), 39;
|
|
414
|
+
case 30:
|
|
415
|
+
return this.popState(), 40;
|
|
416
|
+
case 31:
|
|
417
|
+
return this.pushState("CLASS"), 42;
|
|
418
|
+
case 32:
|
|
419
|
+
return this.popState(), this.pushState("CLASS_STYLE"), 43;
|
|
420
|
+
case 33:
|
|
421
|
+
return this.popState(), 44;
|
|
422
|
+
case 34:
|
|
423
|
+
return this.pushState("SCALE"), 17;
|
|
424
|
+
case 35:
|
|
425
|
+
return 18;
|
|
426
|
+
case 36:
|
|
427
|
+
this.popState();
|
|
428
|
+
break;
|
|
429
|
+
case 37:
|
|
430
|
+
this.pushState("STATE");
|
|
431
|
+
break;
|
|
432
|
+
case 38:
|
|
433
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 25;
|
|
434
|
+
case 39:
|
|
435
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 26;
|
|
436
|
+
case 40:
|
|
437
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -10).trim(), 27;
|
|
438
|
+
case 41:
|
|
439
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 25;
|
|
440
|
+
case 42:
|
|
441
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 26;
|
|
442
|
+
case 43:
|
|
443
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -10).trim(), 27;
|
|
444
|
+
case 44:
|
|
445
|
+
return 50;
|
|
446
|
+
case 45:
|
|
447
|
+
return 51;
|
|
448
|
+
case 46:
|
|
449
|
+
return 52;
|
|
450
|
+
case 47:
|
|
451
|
+
return 53;
|
|
452
|
+
case 48:
|
|
453
|
+
this.pushState("STATE_STRING");
|
|
454
|
+
break;
|
|
455
|
+
case 49:
|
|
456
|
+
return this.pushState("STATE_ID"), "AS";
|
|
457
|
+
case 50:
|
|
458
|
+
return this.popState(), "ID";
|
|
459
|
+
case 51:
|
|
460
|
+
this.popState();
|
|
461
|
+
break;
|
|
462
|
+
case 52:
|
|
463
|
+
return "STATE_DESCR";
|
|
464
|
+
case 53:
|
|
465
|
+
return 19;
|
|
466
|
+
case 54:
|
|
467
|
+
this.popState();
|
|
468
|
+
break;
|
|
469
|
+
case 55:
|
|
470
|
+
return this.popState(), this.pushState("struct"), 20;
|
|
471
|
+
case 56:
|
|
472
|
+
break;
|
|
473
|
+
case 57:
|
|
474
|
+
return this.popState(), 21;
|
|
475
|
+
case 58:
|
|
476
|
+
break;
|
|
477
|
+
case 59:
|
|
478
|
+
return this.begin("NOTE"), 29;
|
|
479
|
+
case 60:
|
|
480
|
+
return this.popState(), this.pushState("NOTE_ID"), 58;
|
|
481
|
+
case 61:
|
|
482
|
+
return this.popState(), this.pushState("NOTE_ID"), 59;
|
|
483
|
+
case 62:
|
|
484
|
+
this.popState(), this.pushState("FLOATING_NOTE");
|
|
485
|
+
break;
|
|
486
|
+
case 63:
|
|
487
|
+
return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
|
|
488
|
+
case 64:
|
|
489
|
+
break;
|
|
490
|
+
case 65:
|
|
491
|
+
return "NOTE_TEXT";
|
|
492
|
+
case 66:
|
|
493
|
+
return this.popState(), "ID";
|
|
494
|
+
case 67:
|
|
495
|
+
return this.popState(), this.pushState("NOTE_TEXT"), 24;
|
|
496
|
+
case 68:
|
|
497
|
+
return this.popState(), i.yytext = i.yytext.substr(2).trim(), 31;
|
|
498
|
+
case 69:
|
|
499
|
+
return this.popState(), i.yytext = i.yytext.slice(0, -8).trim(), 31;
|
|
500
|
+
case 70:
|
|
501
|
+
return 7;
|
|
502
|
+
case 71:
|
|
503
|
+
return 7;
|
|
504
|
+
case 72:
|
|
505
|
+
return 16;
|
|
506
|
+
case 73:
|
|
507
|
+
return 56;
|
|
508
|
+
case 74:
|
|
509
|
+
return 24;
|
|
510
|
+
case 75:
|
|
511
|
+
return i.yytext = i.yytext.trim(), 14;
|
|
512
|
+
case 76:
|
|
513
|
+
return 15;
|
|
514
|
+
case 77:
|
|
515
|
+
return 28;
|
|
516
|
+
case 78:
|
|
517
|
+
return 57;
|
|
518
|
+
case 79:
|
|
519
|
+
return 5;
|
|
520
|
+
case 80:
|
|
521
|
+
return "INVALID";
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
rules: [/^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:%%\{)/i, /^(?:((?:(?!\}%%)[^:.])*))/i, /^(?::)/i, /^(?:\}%%)/i, /^(?:((?:(?!\}%%).|\n)*))/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:[^\}]%%[^\n]*)/i, /^(?:[\n]+)/i, /^(?:[\s]+)/i, /^(?:((?!\n)\s)+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:classDef\s+)/i, /^(?:DEFAULT\s+)/i, /^(?:\w+\s+)/i, /^(?:[^\n]*)/i, /^(?:class\s+)/i, /^(?:(\w+)+((,\s*\w+)*))/i, /^(?:[^\n]*)/i, /^(?:scale\s+)/i, /^(?:\d+)/i, /^(?:\s+width\b)/i, /^(?:state\s+)/i, /^(?:.*<<fork>>)/i, /^(?:.*<<join>>)/i, /^(?:.*<<choice>>)/i, /^(?:.*\[\[fork\]\])/i, /^(?:.*\[\[join\]\])/i, /^(?:.*\[\[choice\]\])/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\n]*)/i, /^(?:["])/i, /^(?:\s*as\s+)/i, /^(?:[^\n\{]*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/i, /^(?:%%(?!\{)[^\n]*)/i, /^(?:\})/i, /^(?:[\n])/i, /^(?:note\s+)/i, /^(?:left of\b)/i, /^(?:right of\b)/i, /^(?:")/i, /^(?:\s*as\s*)/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[^\n]*)/i, /^(?:\s*[^:\n\s\-]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:[\s\S]*?end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:[^:\n;]+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
|
|
525
|
+
conditions: { LINE: { rules: [14, 15], inclusive: !1 }, close_directive: { rules: [14, 15], inclusive: !1 }, arg_directive: { rules: [8, 9, 14, 15], inclusive: !1 }, type_directive: { rules: [7, 8, 14, 15], inclusive: !1 }, open_directive: { rules: [6, 14, 15], inclusive: !1 }, struct: { rules: [14, 15, 27, 31, 37, 44, 45, 46, 47, 56, 57, 58, 59, 73, 74, 75, 76, 77], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [66], inclusive: !1 }, FLOATING_NOTE: { rules: [63, 64, 65], inclusive: !1 }, NOTE_TEXT: { rules: [68, 69], inclusive: !1 }, NOTE_ID: { rules: [67], inclusive: !1 }, NOTE: { rules: [60, 61, 62], inclusive: !1 }, CLASS_STYLE: { rules: [33], inclusive: !1 }, CLASS: { rules: [32], inclusive: !1 }, CLASSDEFID: { rules: [30], inclusive: !1 }, CLASSDEF: { rules: [28, 29], inclusive: !1 }, acc_descr_multiline: { rules: [25, 26], inclusive: !1 }, acc_descr: { rules: [23], inclusive: !1 }, acc_title: { rules: [21], inclusive: !1 }, SCALE: { rules: [18, 19, 35, 36], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [50], inclusive: !1 }, STATE_STRING: { rules: [51, 52], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [14, 15, 38, 39, 40, 41, 42, 43, 48, 49, 53, 54, 55], inclusive: !1 }, ID: { rules: [14, 15], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 10, 11, 12, 13, 15, 16, 17, 20, 22, 24, 27, 31, 34, 37, 55, 59, 70, 71, 72, 73, 74, 75, 76, 78, 79, 80], inclusive: !0 } }
|
|
526
|
+
};
|
|
527
|
+
return D;
|
|
528
|
+
}();
|
|
529
|
+
dt.lexer = Ut;
|
|
530
|
+
function ft() {
|
|
531
|
+
this.yy = {};
|
|
532
|
+
}
|
|
533
|
+
return ft.prototype = dt, dt.Parser = ft, new ft();
|
|
534
|
+
}();
|
|
535
|
+
mt.parser = mt;
|
|
536
|
+
const Ie = mt, ee = "LR", Oe = "TB", Tt = "state", Rt = "relation", se = "classDef", ie = "applyClass", vt = "default", re = "divider", xt = "[*]", wt = "start", Bt = xt, $t = "end", It = "color", Ot = "fill", ne = "bgFill", ae = ",";
|
|
537
|
+
function Pt() {
|
|
538
|
+
return {};
|
|
539
|
+
}
|
|
540
|
+
let Vt = ee, lt = [], P = Pt();
|
|
541
|
+
const Ft = () => ({
|
|
542
|
+
relations: [],
|
|
543
|
+
states: {},
|
|
544
|
+
documents: {}
|
|
545
|
+
});
|
|
546
|
+
let ot = {
|
|
547
|
+
root: Ft()
|
|
548
|
+
}, g = ot.root, V = 0, Nt = 0;
|
|
549
|
+
const ce = {
|
|
550
|
+
LINE: 0,
|
|
551
|
+
DOTTED_LINE: 1
|
|
552
|
+
}, le = {
|
|
553
|
+
AGGREGATION: 0,
|
|
554
|
+
EXTENSION: 1,
|
|
555
|
+
COMPOSITION: 2,
|
|
556
|
+
DEPENDENCY: 3
|
|
557
|
+
}, at = (t) => JSON.parse(JSON.stringify(t)), oe = function(t, s, n) {
|
|
558
|
+
Qt.parseDirective(this, t, s, n);
|
|
559
|
+
}, he = (t) => {
|
|
560
|
+
v.info("Setting root doc", t), lt = t;
|
|
561
|
+
}, ue = () => lt, ct = (t, s, n) => {
|
|
562
|
+
if (s.stmt === Rt)
|
|
563
|
+
ct(t, s.state1, !0), ct(t, s.state2, !1);
|
|
564
|
+
else if (s.stmt === Tt && (s.id === "[*]" ? (s.id = n ? t.id + "_start" : t.id + "_end", s.start = n) : s.id = s.id.trim()), s.doc) {
|
|
565
|
+
const h = [];
|
|
566
|
+
let u = [], f;
|
|
567
|
+
for (f = 0; f < s.doc.length; f++)
|
|
568
|
+
if (s.doc[f].type === re) {
|
|
569
|
+
const p = at(s.doc[f]);
|
|
570
|
+
p.doc = at(u), h.push(p), u = [];
|
|
571
|
+
} else
|
|
572
|
+
u.push(s.doc[f]);
|
|
573
|
+
if (h.length > 0 && u.length > 0) {
|
|
574
|
+
const p = {
|
|
575
|
+
stmt: Tt,
|
|
576
|
+
id: te(),
|
|
577
|
+
type: "divider",
|
|
578
|
+
doc: at(u)
|
|
579
|
+
};
|
|
580
|
+
h.push(at(p)), s.doc = h;
|
|
581
|
+
}
|
|
582
|
+
s.doc.forEach((p) => ct(s, p, !0));
|
|
583
|
+
}
|
|
584
|
+
}, de = () => (ct({ id: "root" }, { id: "root", doc: lt }, !0), { id: "root", doc: lt }), fe = (t) => {
|
|
585
|
+
let s;
|
|
586
|
+
t.doc ? s = t.doc : s = t, v.info(s), Yt(!0), v.info("Extract", s), s.forEach((n) => {
|
|
587
|
+
switch (n.stmt) {
|
|
588
|
+
case Tt:
|
|
589
|
+
I(
|
|
590
|
+
n.id.trim(),
|
|
591
|
+
n.type,
|
|
592
|
+
n.doc,
|
|
593
|
+
n.description,
|
|
594
|
+
n.note,
|
|
595
|
+
n.classes,
|
|
596
|
+
n.styles,
|
|
597
|
+
n.textStyles
|
|
598
|
+
);
|
|
599
|
+
break;
|
|
600
|
+
case Rt:
|
|
601
|
+
Gt(n.state1, n.state2, n.description);
|
|
602
|
+
break;
|
|
603
|
+
case se:
|
|
604
|
+
jt(n.id.trim(), n.classes);
|
|
605
|
+
break;
|
|
606
|
+
case ie:
|
|
607
|
+
Dt(n.id.trim(), n.styleClass);
|
|
608
|
+
break;
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
}, I = function(t, s = vt, n = null, h = null, u = null, f = null, p = null, x = null) {
|
|
612
|
+
const d = t == null ? void 0 : t.trim();
|
|
613
|
+
g.states[d] === void 0 ? (v.info("Adding state ", d, h), g.states[d] = {
|
|
614
|
+
id: d,
|
|
615
|
+
descriptions: [],
|
|
616
|
+
type: s,
|
|
617
|
+
doc: n,
|
|
618
|
+
note: u,
|
|
619
|
+
classes: [],
|
|
620
|
+
styles: [],
|
|
621
|
+
textStyles: []
|
|
622
|
+
}) : (g.states[d].doc || (g.states[d].doc = n), g.states[d].type || (g.states[d].type = s)), h && (v.info("Setting state description", d, h), typeof h == "string" && Et(d, h.trim()), typeof h == "object" && h.forEach((k) => Et(d, k.trim()))), u && (g.states[d].note = u, g.states[d].note.text = ht.sanitizeText(
|
|
623
|
+
g.states[d].note.text,
|
|
624
|
+
Y()
|
|
625
|
+
)), f && (v.info("Setting state classes", d, f), (typeof f == "string" ? [f] : f).forEach((T) => Dt(d, T.trim()))), p && (v.info("Setting state styles", d, p), (typeof p == "string" ? [p] : p).forEach((T) => Ee(d, T.trim()))), x && (v.info("Setting state styles", d, p), (typeof x == "string" ? [x] : x).forEach((T) => ve(d, T.trim())));
|
|
626
|
+
}, Yt = function(t) {
|
|
627
|
+
ot = {
|
|
628
|
+
root: Ft()
|
|
629
|
+
}, g = ot.root, V = 0, P = Pt(), t || Zt();
|
|
630
|
+
}, F = function(t) {
|
|
631
|
+
return g.states[t];
|
|
632
|
+
}, pe = function() {
|
|
633
|
+
return g.states;
|
|
634
|
+
}, ye = function() {
|
|
635
|
+
v.info("Documents = ", ot);
|
|
636
|
+
}, Se = function() {
|
|
637
|
+
return g.relations;
|
|
638
|
+
};
|
|
639
|
+
function kt(t = "") {
|
|
640
|
+
let s = t;
|
|
641
|
+
return t === xt && (V++, s = `${wt}${V}`), s;
|
|
642
|
+
}
|
|
643
|
+
function bt(t = "", s = vt) {
|
|
644
|
+
return t === xt ? wt : s;
|
|
645
|
+
}
|
|
646
|
+
function ge(t = "") {
|
|
647
|
+
let s = t;
|
|
648
|
+
return t === Bt && (V++, s = `${$t}${V}`), s;
|
|
649
|
+
}
|
|
650
|
+
function _e(t = "", s = vt) {
|
|
651
|
+
return t === Bt ? $t : s;
|
|
652
|
+
}
|
|
653
|
+
function me(t, s, n) {
|
|
654
|
+
let h = kt(t.id.trim()), u = bt(t.id.trim(), t.type), f = kt(s.id.trim()), p = bt(s.id.trim(), s.type);
|
|
655
|
+
I(
|
|
656
|
+
h,
|
|
657
|
+
u,
|
|
658
|
+
t.doc,
|
|
659
|
+
t.description,
|
|
660
|
+
t.note,
|
|
661
|
+
t.classes,
|
|
662
|
+
t.styles,
|
|
663
|
+
t.textStyles
|
|
664
|
+
), I(
|
|
665
|
+
f,
|
|
666
|
+
p,
|
|
667
|
+
s.doc,
|
|
668
|
+
s.description,
|
|
669
|
+
s.note,
|
|
670
|
+
s.classes,
|
|
671
|
+
s.styles,
|
|
672
|
+
s.textStyles
|
|
673
|
+
), g.relations.push({
|
|
674
|
+
id1: h,
|
|
675
|
+
id2: f,
|
|
676
|
+
relationTitle: ht.sanitizeText(n, Y())
|
|
677
|
+
});
|
|
678
|
+
}
|
|
679
|
+
const Gt = function(t, s, n) {
|
|
680
|
+
if (typeof t == "object")
|
|
681
|
+
me(t, s, n);
|
|
682
|
+
else {
|
|
683
|
+
const h = kt(t.trim()), u = bt(t), f = ge(s.trim()), p = _e(s);
|
|
684
|
+
I(h, u), I(f, p), g.relations.push({
|
|
685
|
+
id1: h,
|
|
686
|
+
id2: f,
|
|
687
|
+
title: ht.sanitizeText(n, Y())
|
|
688
|
+
});
|
|
689
|
+
}
|
|
690
|
+
}, Et = function(t, s) {
|
|
691
|
+
const n = g.states[t], h = s.startsWith(":") ? s.replace(":", "").trim() : s;
|
|
692
|
+
n.descriptions.push(ht.sanitizeText(h, Y()));
|
|
693
|
+
}, Te = function(t) {
|
|
694
|
+
return t.substring(0, 1) === ":" ? t.substr(2).trim() : t.trim();
|
|
695
|
+
}, ke = () => (Nt++, "divider-id-" + Nt), jt = function(t, s = "") {
|
|
696
|
+
P[t] === void 0 && (P[t] = { id: t, styles: [], textStyles: [] });
|
|
697
|
+
const n = P[t];
|
|
698
|
+
s != null && s.split(ae).forEach((h) => {
|
|
699
|
+
const u = h.replace(/([^;]*);/, "$1").trim();
|
|
700
|
+
if (h.match(It)) {
|
|
701
|
+
const p = u.replace(Ot, ne).replace(It, Ot);
|
|
702
|
+
n.textStyles.push(p);
|
|
703
|
+
}
|
|
704
|
+
n.styles.push(u);
|
|
705
|
+
});
|
|
706
|
+
}, be = function() {
|
|
707
|
+
return P;
|
|
708
|
+
}, Dt = function(t, s) {
|
|
709
|
+
t.split(",").forEach(function(n) {
|
|
710
|
+
let h = F(n);
|
|
711
|
+
if (h === void 0) {
|
|
712
|
+
const u = n.trim();
|
|
713
|
+
I(u), h = F(u);
|
|
714
|
+
}
|
|
715
|
+
h.classes.push(s);
|
|
716
|
+
});
|
|
717
|
+
}, Ee = function(t, s) {
|
|
718
|
+
const n = F(t);
|
|
719
|
+
n !== void 0 && n.textStyles.push(s);
|
|
720
|
+
}, ve = function(t, s) {
|
|
721
|
+
const n = F(t);
|
|
722
|
+
n !== void 0 && n.textStyles.push(s);
|
|
723
|
+
}, xe = () => Vt, De = (t) => {
|
|
724
|
+
Vt = t;
|
|
725
|
+
}, Ce = (t) => t && t[0] === ":" ? t.substr(1).trim() : t.trim(), Ne = {
|
|
726
|
+
parseDirective: oe,
|
|
727
|
+
getConfig: () => Y().state,
|
|
728
|
+
addState: I,
|
|
729
|
+
clear: Yt,
|
|
730
|
+
getState: F,
|
|
731
|
+
getStates: pe,
|
|
732
|
+
getRelations: Se,
|
|
733
|
+
getClasses: be,
|
|
734
|
+
getDirection: xe,
|
|
735
|
+
addRelation: Gt,
|
|
736
|
+
getDividerId: ke,
|
|
737
|
+
setDirection: De,
|
|
738
|
+
cleanupLabel: Te,
|
|
739
|
+
lineType: ce,
|
|
740
|
+
relationType: le,
|
|
741
|
+
logDocuments: ye,
|
|
742
|
+
getRootDoc: ue,
|
|
743
|
+
setRootDoc: he,
|
|
744
|
+
getRootDocV2: de,
|
|
745
|
+
extract: fe,
|
|
746
|
+
trimColon: Ce,
|
|
747
|
+
getAccTitle: Ht,
|
|
748
|
+
setAccTitle: Xt,
|
|
749
|
+
getAccDescription: Kt,
|
|
750
|
+
setAccDescription: Wt,
|
|
751
|
+
addStyleClass: jt,
|
|
752
|
+
setCssClass: Dt,
|
|
753
|
+
addDescription: Et,
|
|
754
|
+
setDiagramTitle: Jt,
|
|
755
|
+
getDiagramTitle: qt
|
|
756
|
+
}, Ae = (t) => `
|
|
757
|
+
defs #statediagram-barbEnd {
|
|
758
|
+
fill: ${t.transitionColor};
|
|
759
|
+
stroke: ${t.transitionColor};
|
|
760
|
+
}
|
|
761
|
+
g.stateGroup text {
|
|
762
|
+
fill: ${t.nodeBorder};
|
|
763
|
+
stroke: none;
|
|
764
|
+
font-size: 10px;
|
|
765
|
+
}
|
|
766
|
+
g.stateGroup text {
|
|
767
|
+
fill: ${t.textColor};
|
|
768
|
+
stroke: none;
|
|
769
|
+
font-size: 10px;
|
|
770
|
+
|
|
771
|
+
}
|
|
772
|
+
g.stateGroup .state-title {
|
|
773
|
+
font-weight: bolder;
|
|
774
|
+
fill: ${t.stateLabelColor};
|
|
775
|
+
}
|
|
776
|
+
|
|
777
|
+
g.stateGroup rect {
|
|
778
|
+
fill: ${t.mainBkg};
|
|
779
|
+
stroke: ${t.nodeBorder};
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
g.stateGroup line {
|
|
783
|
+
stroke: ${t.lineColor};
|
|
784
|
+
stroke-width: 1;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
.transition {
|
|
788
|
+
stroke: ${t.transitionColor};
|
|
789
|
+
stroke-width: 1;
|
|
790
|
+
fill: none;
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
.stateGroup .composit {
|
|
794
|
+
fill: ${t.background};
|
|
795
|
+
border-bottom: 1px
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
.stateGroup .alt-composit {
|
|
799
|
+
fill: #e0e0e0;
|
|
800
|
+
border-bottom: 1px
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.state-note {
|
|
804
|
+
stroke: ${t.noteBorderColor};
|
|
805
|
+
fill: ${t.noteBkgColor};
|
|
806
|
+
|
|
807
|
+
text {
|
|
808
|
+
fill: ${t.noteTextColor};
|
|
809
|
+
stroke: none;
|
|
810
|
+
font-size: 10px;
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
.stateLabel .box {
|
|
815
|
+
stroke: none;
|
|
816
|
+
stroke-width: 0;
|
|
817
|
+
fill: ${t.mainBkg};
|
|
818
|
+
opacity: 0.5;
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
.edgeLabel .label rect {
|
|
822
|
+
fill: ${t.labelBackgroundColor};
|
|
823
|
+
opacity: 0.5;
|
|
824
|
+
}
|
|
825
|
+
.edgeLabel .label text {
|
|
826
|
+
fill: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
827
|
+
}
|
|
828
|
+
.label div .edgeLabel {
|
|
829
|
+
color: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
.stateLabel text {
|
|
833
|
+
fill: ${t.stateLabelColor};
|
|
834
|
+
font-size: 10px;
|
|
835
|
+
font-weight: bold;
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
.node circle.state-start {
|
|
839
|
+
fill: ${t.specialStateColor};
|
|
840
|
+
stroke: ${t.specialStateColor};
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
.node .fork-join {
|
|
844
|
+
fill: ${t.specialStateColor};
|
|
845
|
+
stroke: ${t.specialStateColor};
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
.node circle.state-end {
|
|
849
|
+
fill: ${t.innerEndBackground};
|
|
850
|
+
stroke: ${t.background};
|
|
851
|
+
stroke-width: 1.5
|
|
852
|
+
}
|
|
853
|
+
.end-state-inner {
|
|
854
|
+
fill: ${t.compositeBackground || t.background};
|
|
855
|
+
// stroke: ${t.background};
|
|
856
|
+
stroke-width: 1.5
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
.node rect {
|
|
860
|
+
fill: ${t.stateBkg || t.mainBkg};
|
|
861
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
862
|
+
stroke-width: 1px;
|
|
863
|
+
}
|
|
864
|
+
.node polygon {
|
|
865
|
+
fill: ${t.mainBkg};
|
|
866
|
+
stroke: ${t.stateBorder || t.nodeBorder};;
|
|
867
|
+
stroke-width: 1px;
|
|
868
|
+
}
|
|
869
|
+
#statediagram-barbEnd {
|
|
870
|
+
fill: ${t.lineColor};
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
.statediagram-cluster rect {
|
|
874
|
+
fill: ${t.compositeTitleBackground};
|
|
875
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
876
|
+
stroke-width: 1px;
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
.cluster-label, .nodeLabel {
|
|
880
|
+
color: ${t.stateLabelColor};
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.statediagram-cluster rect.outer {
|
|
884
|
+
rx: 5px;
|
|
885
|
+
ry: 5px;
|
|
886
|
+
}
|
|
887
|
+
.statediagram-state .divider {
|
|
888
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.statediagram-state .title-state {
|
|
892
|
+
rx: 5px;
|
|
893
|
+
ry: 5px;
|
|
894
|
+
}
|
|
895
|
+
.statediagram-cluster.statediagram-cluster .inner {
|
|
896
|
+
fill: ${t.compositeBackground || t.background};
|
|
897
|
+
}
|
|
898
|
+
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
899
|
+
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
.statediagram-cluster .inner {
|
|
903
|
+
rx:0;
|
|
904
|
+
ry:0;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.statediagram-state rect.basic {
|
|
908
|
+
rx: 5px;
|
|
909
|
+
ry: 5px;
|
|
910
|
+
}
|
|
911
|
+
.statediagram-state rect.divider {
|
|
912
|
+
stroke-dasharray: 10,10;
|
|
913
|
+
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
.note-edge {
|
|
917
|
+
stroke-dasharray: 5;
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
.statediagram-note rect {
|
|
921
|
+
fill: ${t.noteBkgColor};
|
|
922
|
+
stroke: ${t.noteBorderColor};
|
|
923
|
+
stroke-width: 1px;
|
|
924
|
+
rx: 0;
|
|
925
|
+
ry: 0;
|
|
926
|
+
}
|
|
927
|
+
.statediagram-note rect {
|
|
928
|
+
fill: ${t.noteBkgColor};
|
|
929
|
+
stroke: ${t.noteBorderColor};
|
|
930
|
+
stroke-width: 1px;
|
|
931
|
+
rx: 0;
|
|
932
|
+
ry: 0;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
.statediagram-note text {
|
|
936
|
+
fill: ${t.noteTextColor};
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
.statediagram-note .nodeLabel {
|
|
940
|
+
color: ${t.noteTextColor};
|
|
941
|
+
}
|
|
942
|
+
.statediagram .edgeLabel {
|
|
943
|
+
color: red; // ${t.noteTextColor};
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
#dependencyStart, #dependencyEnd {
|
|
947
|
+
fill: ${t.lineColor};
|
|
948
|
+
stroke: ${t.lineColor};
|
|
949
|
+
stroke-width: 1;
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
.statediagramTitleText {
|
|
953
|
+
text-anchor: middle;
|
|
954
|
+
font-size: 18px;
|
|
955
|
+
fill: ${t.textColor};
|
|
956
|
+
}
|
|
957
|
+
`, Re = Ae;
|
|
958
|
+
export {
|
|
959
|
+
vt as D,
|
|
960
|
+
Rt as S,
|
|
961
|
+
re as a,
|
|
962
|
+
Tt as b,
|
|
963
|
+
Oe as c,
|
|
964
|
+
Ne as d,
|
|
965
|
+
Ie as p,
|
|
966
|
+
Re as s
|
|
967
|
+
};
|