@zjlab-frontier/markdown 1.0.4
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/README.md +148 -0
- package/dist/Tableau10-D7jGxypv.mjs +8 -0
- package/dist/arc-BkFOiLi7.mjs +84 -0
- package/dist/array-CqVTtuYm.mjs +6 -0
- package/dist/blockDiagram-c4efeb88-CngVNufX.mjs +1221 -0
- package/dist/c4Diagram-c83219d4-CvSWXhSV.mjs +1579 -0
- package/dist/channel-BCTzeqLo.mjs +5 -0
- package/dist/classDiagram-beda092f-8UkpWDgI.mjs +218 -0
- package/dist/classDiagram-v2-2358418a-D3LsBhTm.mjs +200 -0
- package/dist/clone-DZgGXtyK.mjs +8 -0
- package/dist/createText-1719965b-DMv-Bu7A.mjs +155 -0
- package/dist/edges-96097737-BeVwLt3S.mjs +1088 -0
- package/dist/erDiagram-0228fc6a-GXXkRZ8r.mjs +929 -0
- package/dist/flowDb-c6c81e3f-CrOg5i55.mjs +1126 -0
- package/dist/flowDiagram-50d868cf-sXe_oFAW.mjs +788 -0
- package/dist/flowDiagram-v2-4f6560a1-CoKYvZkH.mjs +17 -0
- package/dist/flowchart-elk-definition-6af322e1-SuvGsuBl.mjs +48146 -0
- package/dist/ganttDiagram-a2739b55-BbWq9bqY.mjs +2477 -0
- package/dist/gitGraphDiagram-82fe8481-C6-e4UmK.mjs +1264 -0
- package/dist/graph-CoIGCRFf.mjs +847 -0
- package/dist/index-5325376f-BENBY8aO.mjs +373 -0
- package/dist/index-5_ujiRGo.mjs +46276 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +8 -0
- package/dist/index.umd.js +2421 -0
- package/dist/infoDiagram-8eee0895-BEAb2pCD.mjs +319 -0
- package/dist/init-DjUOC4st.mjs +16 -0
- package/dist/journeyDiagram-c64418c1-CERjyYnA.mjs +801 -0
- package/dist/layout-aCAVHR2T.mjs +1472 -0
- package/dist/line-BGunMwE-.mjs +33 -0
- package/dist/linear-DciWi0hE.mjs +423 -0
- package/dist/markdown.d.ts +25 -0
- package/dist/mindmap-definition-8da855dc-Cc8_U7zD.mjs +21936 -0
- package/dist/ordinal-C0oynhte.mjs +61 -0
- package/dist/path-DLwuMfdd.mjs +84 -0
- package/dist/pieDiagram-a8764435-B00hy7Ez.mjs +500 -0
- package/dist/quadrantDiagram-1e28029f-DR7IGAoM.mjs +903 -0
- package/dist/requirementDiagram-08caed73-o6N3X3-m.mjs +767 -0
- package/dist/sankeyDiagram-a04cb91d-CYF9Ro1W.mjs +802 -0
- package/dist/sequenceDiagram-c5b8d532-vz_R7xBU.mjs +2234 -0
- package/dist/stateDiagram-1ecb1508-B0YUHnuE.mjs +266 -0
- package/dist/stateDiagram-v2-c2b004d7-CDTm1Jfb.mjs +184 -0
- package/dist/styles/highlight.scss +115 -0
- package/dist/styles/markdown.scss +1163 -0
- package/dist/styles-b4e223ce-C_-huVuQ.mjs +1089 -0
- package/dist/styles-ca3715f6-soe07Bnw.mjs +960 -0
- package/dist/styles-d45a18b0-0ZXwJp5P.mjs +436 -0
- package/dist/svgDrawCommon-b86b1483-UCLksviB.mjs +64 -0
- package/dist/timeline-definition-faaaa080-Dt5unv7p.mjs +792 -0
- package/dist/vite.config.d.ts +2 -0
- package/dist/xychartDiagram-f5964ef8-BZWS0E_9.mjs +1282 -0
- package/package.json +66 -0
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
import { a as Ce, s as Fe, b as Me, c as De, g as Te, d as oe, e as Pe, E as Ye, l as Ne, k as ke } from "./index-5_ujiRGo.mjs";
|
|
2
|
+
import { G as Ue } from "./graph-CoIGCRFf.mjs";
|
|
3
|
+
import { l as Be } from "./layout-aCAVHR2T.mjs";
|
|
4
|
+
import { l as Qe } from "./line-BGunMwE-.mjs";
|
|
5
|
+
var ce = (function() {
|
|
6
|
+
var e = function(V, i, r, a) {
|
|
7
|
+
for (r = r || {}, a = V.length; a--; r[V[a]] = i)
|
|
8
|
+
;
|
|
9
|
+
return r;
|
|
10
|
+
}, t = [1, 3], l = [1, 4], c = [1, 5], u = [1, 6], d = [5, 6, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], p = [1, 18], h = [2, 7], o = [1, 22], E = [1, 23], R = [1, 24], A = [1, 25], T = [1, 26], N = [1, 27], v = [1, 20], k = [1, 28], x = [1, 29], F = [62, 63], de = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 51, 53, 62, 63], pe = [1, 47], fe = [1, 48], ye = [1, 49], _e = [1, 50], Ee = [1, 51], ge = [1, 52], Re = [1, 53], O = [53, 54], M = [1, 64], D = [1, 60], P = [1, 61], Y = [1, 62], U = [1, 63], B = [1, 65], z = [1, 69], j = [1, 70], X = [1, 67], J = [1, 68], m = [5, 8, 9, 11, 13, 31, 32, 33, 34, 35, 36, 44, 62, 63], ie = {
|
|
11
|
+
trace: function() {
|
|
12
|
+
},
|
|
13
|
+
yy: {},
|
|
14
|
+
symbols_: { error: 2, start: 3, directive: 4, NEWLINE: 5, RD: 6, diagram: 7, EOF: 8, acc_title: 9, acc_title_value: 10, acc_descr: 11, acc_descr_value: 12, acc_descr_multiline_value: 13, requirementDef: 14, elementDef: 15, relationshipDef: 16, requirementType: 17, requirementName: 18, STRUCT_START: 19, requirementBody: 20, ID: 21, COLONSEP: 22, id: 23, TEXT: 24, text: 25, RISK: 26, riskLevel: 27, VERIFYMTHD: 28, verifyType: 29, STRUCT_STOP: 30, REQUIREMENT: 31, FUNCTIONAL_REQUIREMENT: 32, INTERFACE_REQUIREMENT: 33, PERFORMANCE_REQUIREMENT: 34, PHYSICAL_REQUIREMENT: 35, DESIGN_CONSTRAINT: 36, LOW_RISK: 37, MED_RISK: 38, HIGH_RISK: 39, VERIFY_ANALYSIS: 40, VERIFY_DEMONSTRATION: 41, VERIFY_INSPECTION: 42, VERIFY_TEST: 43, ELEMENT: 44, elementName: 45, elementBody: 46, TYPE: 47, type: 48, DOCREF: 49, ref: 50, END_ARROW_L: 51, relationship: 52, LINE: 53, END_ARROW_R: 54, CONTAINS: 55, COPIES: 56, DERIVES: 57, SATISFIES: 58, VERIFIES: 59, REFINES: 60, TRACES: 61, unqString: 62, qString: 63, $accept: 0, $end: 1 },
|
|
15
|
+
terminals_: { 2: "error", 5: "NEWLINE", 6: "RD", 8: "EOF", 9: "acc_title", 10: "acc_title_value", 11: "acc_descr", 12: "acc_descr_value", 13: "acc_descr_multiline_value", 19: "STRUCT_START", 21: "ID", 22: "COLONSEP", 24: "TEXT", 26: "RISK", 28: "VERIFYMTHD", 30: "STRUCT_STOP", 31: "REQUIREMENT", 32: "FUNCTIONAL_REQUIREMENT", 33: "INTERFACE_REQUIREMENT", 34: "PERFORMANCE_REQUIREMENT", 35: "PHYSICAL_REQUIREMENT", 36: "DESIGN_CONSTRAINT", 37: "LOW_RISK", 38: "MED_RISK", 39: "HIGH_RISK", 40: "VERIFY_ANALYSIS", 41: "VERIFY_DEMONSTRATION", 42: "VERIFY_INSPECTION", 43: "VERIFY_TEST", 44: "ELEMENT", 47: "TYPE", 49: "DOCREF", 51: "END_ARROW_L", 53: "LINE", 54: "END_ARROW_R", 55: "CONTAINS", 56: "COPIES", 57: "DERIVES", 58: "SATISFIES", 59: "VERIFIES", 60: "REFINES", 61: "TRACES", 62: "unqString", 63: "qString" },
|
|
16
|
+
productions_: [0, [3, 3], [3, 2], [3, 4], [4, 2], [4, 2], [4, 1], [7, 0], [7, 2], [7, 2], [7, 2], [7, 2], [7, 2], [14, 5], [20, 5], [20, 5], [20, 5], [20, 5], [20, 2], [20, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [17, 1], [27, 1], [27, 1], [27, 1], [29, 1], [29, 1], [29, 1], [29, 1], [15, 5], [46, 5], [46, 5], [46, 2], [46, 1], [16, 5], [16, 5], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [52, 1], [18, 1], [18, 1], [23, 1], [23, 1], [25, 1], [25, 1], [45, 1], [45, 1], [48, 1], [48, 1], [50, 1], [50, 1]],
|
|
17
|
+
performAction: function(i, r, a, n, f, s, W) {
|
|
18
|
+
var _ = s.length - 1;
|
|
19
|
+
switch (f) {
|
|
20
|
+
case 4:
|
|
21
|
+
this.$ = s[_].trim(), n.setAccTitle(this.$);
|
|
22
|
+
break;
|
|
23
|
+
case 5:
|
|
24
|
+
case 6:
|
|
25
|
+
this.$ = s[_].trim(), n.setAccDescription(this.$);
|
|
26
|
+
break;
|
|
27
|
+
case 7:
|
|
28
|
+
this.$ = [];
|
|
29
|
+
break;
|
|
30
|
+
case 13:
|
|
31
|
+
n.addRequirement(s[_ - 3], s[_ - 4]);
|
|
32
|
+
break;
|
|
33
|
+
case 14:
|
|
34
|
+
n.setNewReqId(s[_ - 2]);
|
|
35
|
+
break;
|
|
36
|
+
case 15:
|
|
37
|
+
n.setNewReqText(s[_ - 2]);
|
|
38
|
+
break;
|
|
39
|
+
case 16:
|
|
40
|
+
n.setNewReqRisk(s[_ - 2]);
|
|
41
|
+
break;
|
|
42
|
+
case 17:
|
|
43
|
+
n.setNewReqVerifyMethod(s[_ - 2]);
|
|
44
|
+
break;
|
|
45
|
+
case 20:
|
|
46
|
+
this.$ = n.RequirementType.REQUIREMENT;
|
|
47
|
+
break;
|
|
48
|
+
case 21:
|
|
49
|
+
this.$ = n.RequirementType.FUNCTIONAL_REQUIREMENT;
|
|
50
|
+
break;
|
|
51
|
+
case 22:
|
|
52
|
+
this.$ = n.RequirementType.INTERFACE_REQUIREMENT;
|
|
53
|
+
break;
|
|
54
|
+
case 23:
|
|
55
|
+
this.$ = n.RequirementType.PERFORMANCE_REQUIREMENT;
|
|
56
|
+
break;
|
|
57
|
+
case 24:
|
|
58
|
+
this.$ = n.RequirementType.PHYSICAL_REQUIREMENT;
|
|
59
|
+
break;
|
|
60
|
+
case 25:
|
|
61
|
+
this.$ = n.RequirementType.DESIGN_CONSTRAINT;
|
|
62
|
+
break;
|
|
63
|
+
case 26:
|
|
64
|
+
this.$ = n.RiskLevel.LOW_RISK;
|
|
65
|
+
break;
|
|
66
|
+
case 27:
|
|
67
|
+
this.$ = n.RiskLevel.MED_RISK;
|
|
68
|
+
break;
|
|
69
|
+
case 28:
|
|
70
|
+
this.$ = n.RiskLevel.HIGH_RISK;
|
|
71
|
+
break;
|
|
72
|
+
case 29:
|
|
73
|
+
this.$ = n.VerifyType.VERIFY_ANALYSIS;
|
|
74
|
+
break;
|
|
75
|
+
case 30:
|
|
76
|
+
this.$ = n.VerifyType.VERIFY_DEMONSTRATION;
|
|
77
|
+
break;
|
|
78
|
+
case 31:
|
|
79
|
+
this.$ = n.VerifyType.VERIFY_INSPECTION;
|
|
80
|
+
break;
|
|
81
|
+
case 32:
|
|
82
|
+
this.$ = n.VerifyType.VERIFY_TEST;
|
|
83
|
+
break;
|
|
84
|
+
case 33:
|
|
85
|
+
n.addElement(s[_ - 3]);
|
|
86
|
+
break;
|
|
87
|
+
case 34:
|
|
88
|
+
n.setNewElementType(s[_ - 2]);
|
|
89
|
+
break;
|
|
90
|
+
case 35:
|
|
91
|
+
n.setNewElementDocRef(s[_ - 2]);
|
|
92
|
+
break;
|
|
93
|
+
case 38:
|
|
94
|
+
n.addRelationship(s[_ - 2], s[_], s[_ - 4]);
|
|
95
|
+
break;
|
|
96
|
+
case 39:
|
|
97
|
+
n.addRelationship(s[_ - 2], s[_ - 4], s[_]);
|
|
98
|
+
break;
|
|
99
|
+
case 40:
|
|
100
|
+
this.$ = n.Relationships.CONTAINS;
|
|
101
|
+
break;
|
|
102
|
+
case 41:
|
|
103
|
+
this.$ = n.Relationships.COPIES;
|
|
104
|
+
break;
|
|
105
|
+
case 42:
|
|
106
|
+
this.$ = n.Relationships.DERIVES;
|
|
107
|
+
break;
|
|
108
|
+
case 43:
|
|
109
|
+
this.$ = n.Relationships.SATISFIES;
|
|
110
|
+
break;
|
|
111
|
+
case 44:
|
|
112
|
+
this.$ = n.Relationships.VERIFIES;
|
|
113
|
+
break;
|
|
114
|
+
case 45:
|
|
115
|
+
this.$ = n.Relationships.REFINES;
|
|
116
|
+
break;
|
|
117
|
+
case 46:
|
|
118
|
+
this.$ = n.Relationships.TRACES;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
table: [{ 3: 1, 4: 2, 6: t, 9: l, 11: c, 13: u }, { 1: [3] }, { 3: 8, 4: 2, 5: [1, 7], 6: t, 9: l, 11: c, 13: u }, { 5: [1, 9] }, { 10: [1, 10] }, { 12: [1, 11] }, e(d, [2, 6]), { 3: 12, 4: 2, 6: t, 9: l, 11: c, 13: u }, { 1: [2, 2] }, { 4: 17, 5: p, 7: 13, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, e(d, [2, 4]), e(d, [2, 5]), { 1: [2, 1] }, { 8: [1, 30] }, { 4: 17, 5: p, 7: 31, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, { 4: 17, 5: p, 7: 32, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, { 4: 17, 5: p, 7: 33, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, { 4: 17, 5: p, 7: 34, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, { 4: 17, 5: p, 7: 35, 8: h, 9: l, 11: c, 13: u, 14: 14, 15: 15, 16: 16, 17: 19, 23: 21, 31: o, 32: E, 33: R, 34: A, 35: T, 36: N, 44: v, 62: k, 63: x }, { 18: 36, 62: [1, 37], 63: [1, 38] }, { 45: 39, 62: [1, 40], 63: [1, 41] }, { 51: [1, 42], 53: [1, 43] }, e(F, [2, 20]), e(F, [2, 21]), e(F, [2, 22]), e(F, [2, 23]), e(F, [2, 24]), e(F, [2, 25]), e(de, [2, 49]), e(de, [2, 50]), { 1: [2, 3] }, { 8: [2, 8] }, { 8: [2, 9] }, { 8: [2, 10] }, { 8: [2, 11] }, { 8: [2, 12] }, { 19: [1, 44] }, { 19: [2, 47] }, { 19: [2, 48] }, { 19: [1, 45] }, { 19: [2, 53] }, { 19: [2, 54] }, { 52: 46, 55: pe, 56: fe, 57: ye, 58: _e, 59: Ee, 60: ge, 61: Re }, { 52: 54, 55: pe, 56: fe, 57: ye, 58: _e, 59: Ee, 60: ge, 61: Re }, { 5: [1, 55] }, { 5: [1, 56] }, { 53: [1, 57] }, e(O, [2, 40]), e(O, [2, 41]), e(O, [2, 42]), e(O, [2, 43]), e(O, [2, 44]), e(O, [2, 45]), e(O, [2, 46]), { 54: [1, 58] }, { 5: M, 20: 59, 21: D, 24: P, 26: Y, 28: U, 30: B }, { 5: z, 30: j, 46: 66, 47: X, 49: J }, { 23: 71, 62: k, 63: x }, { 23: 72, 62: k, 63: x }, e(m, [2, 13]), { 22: [1, 73] }, { 22: [1, 74] }, { 22: [1, 75] }, { 22: [1, 76] }, { 5: M, 20: 77, 21: D, 24: P, 26: Y, 28: U, 30: B }, e(m, [2, 19]), e(m, [2, 33]), { 22: [1, 78] }, { 22: [1, 79] }, { 5: z, 30: j, 46: 80, 47: X, 49: J }, e(m, [2, 37]), e(m, [2, 38]), e(m, [2, 39]), { 23: 81, 62: k, 63: x }, { 25: 82, 62: [1, 83], 63: [1, 84] }, { 27: 85, 37: [1, 86], 38: [1, 87], 39: [1, 88] }, { 29: 89, 40: [1, 90], 41: [1, 91], 42: [1, 92], 43: [1, 93] }, e(m, [2, 18]), { 48: 94, 62: [1, 95], 63: [1, 96] }, { 50: 97, 62: [1, 98], 63: [1, 99] }, e(m, [2, 36]), { 5: [1, 100] }, { 5: [1, 101] }, { 5: [2, 51] }, { 5: [2, 52] }, { 5: [1, 102] }, { 5: [2, 26] }, { 5: [2, 27] }, { 5: [2, 28] }, { 5: [1, 103] }, { 5: [2, 29] }, { 5: [2, 30] }, { 5: [2, 31] }, { 5: [2, 32] }, { 5: [1, 104] }, { 5: [2, 55] }, { 5: [2, 56] }, { 5: [1, 105] }, { 5: [2, 57] }, { 5: [2, 58] }, { 5: M, 20: 106, 21: D, 24: P, 26: Y, 28: U, 30: B }, { 5: M, 20: 107, 21: D, 24: P, 26: Y, 28: U, 30: B }, { 5: M, 20: 108, 21: D, 24: P, 26: Y, 28: U, 30: B }, { 5: M, 20: 109, 21: D, 24: P, 26: Y, 28: U, 30: B }, { 5: z, 30: j, 46: 110, 47: X, 49: J }, { 5: z, 30: j, 46: 111, 47: X, 49: J }, e(m, [2, 14]), e(m, [2, 15]), e(m, [2, 16]), e(m, [2, 17]), e(m, [2, 34]), e(m, [2, 35])],
|
|
123
|
+
defaultActions: { 8: [2, 2], 12: [2, 1], 30: [2, 3], 31: [2, 8], 32: [2, 9], 33: [2, 10], 34: [2, 11], 35: [2, 12], 37: [2, 47], 38: [2, 48], 40: [2, 53], 41: [2, 54], 83: [2, 51], 84: [2, 52], 86: [2, 26], 87: [2, 27], 88: [2, 28], 90: [2, 29], 91: [2, 30], 92: [2, 31], 93: [2, 32], 95: [2, 55], 96: [2, 56], 98: [2, 57], 99: [2, 58] },
|
|
124
|
+
parseError: function(i, r) {
|
|
125
|
+
if (r.recoverable)
|
|
126
|
+
this.trace(i);
|
|
127
|
+
else {
|
|
128
|
+
var a = new Error(i);
|
|
129
|
+
throw a.hash = r, a;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
parse: function(i) {
|
|
133
|
+
var r = this, a = [0], n = [], f = [null], s = [], W = this.table, _ = "", Z = 0, me = 0, Ve = 2, Ie = 1, qe = s.slice.call(arguments, 1), g = Object.create(this.lexer), L = { yy: {} };
|
|
134
|
+
for (var re in this.yy)
|
|
135
|
+
Object.prototype.hasOwnProperty.call(this.yy, re) && (L.yy[re] = this.yy[re]);
|
|
136
|
+
g.setInput(i, L.yy), L.yy.lexer = g, L.yy.parser = this, typeof g.yylloc > "u" && (g.yylloc = {});
|
|
137
|
+
var se = g.yylloc;
|
|
138
|
+
s.push(se);
|
|
139
|
+
var Oe = g.options && g.options.ranges;
|
|
140
|
+
typeof L.yy.parseError == "function" ? this.parseError = L.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
141
|
+
function Le() {
|
|
142
|
+
var $;
|
|
143
|
+
return $ = n.pop() || g.lex() || Ie, typeof $ != "number" && ($ instanceof Array && (n = $, $ = n.pop()), $ = r.symbols_[$] || $), $;
|
|
144
|
+
}
|
|
145
|
+
for (var I, C, S, ae, Q = {}, ee, w, be, te; ; ) {
|
|
146
|
+
if (C = a[a.length - 1], this.defaultActions[C] ? S = this.defaultActions[C] : ((I === null || typeof I > "u") && (I = Le()), S = W[C] && W[C][I]), typeof S > "u" || !S.length || !S[0]) {
|
|
147
|
+
var le = "";
|
|
148
|
+
te = [];
|
|
149
|
+
for (ee in W[C])
|
|
150
|
+
this.terminals_[ee] && ee > Ve && te.push("'" + this.terminals_[ee] + "'");
|
|
151
|
+
g.showPosition ? le = "Parse error on line " + (Z + 1) + `:
|
|
152
|
+
` + g.showPosition() + `
|
|
153
|
+
Expecting ` + te.join(", ") + ", got '" + (this.terminals_[I] || I) + "'" : le = "Parse error on line " + (Z + 1) + ": Unexpected " + (I == Ie ? "end of input" : "'" + (this.terminals_[I] || I) + "'"), this.parseError(le, {
|
|
154
|
+
text: g.match,
|
|
155
|
+
token: this.terminals_[I] || I,
|
|
156
|
+
line: g.yylineno,
|
|
157
|
+
loc: se,
|
|
158
|
+
expected: te
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
if (S[0] instanceof Array && S.length > 1)
|
|
162
|
+
throw new Error("Parse Error: multiple actions possible at state: " + C + ", token: " + I);
|
|
163
|
+
switch (S[0]) {
|
|
164
|
+
case 1:
|
|
165
|
+
a.push(I), f.push(g.yytext), s.push(g.yylloc), a.push(S[1]), I = null, me = g.yyleng, _ = g.yytext, Z = g.yylineno, se = g.yylloc;
|
|
166
|
+
break;
|
|
167
|
+
case 2:
|
|
168
|
+
if (w = this.productions_[S[1]][1], Q.$ = f[f.length - w], Q._$ = {
|
|
169
|
+
first_line: s[s.length - (w || 1)].first_line,
|
|
170
|
+
last_line: s[s.length - 1].last_line,
|
|
171
|
+
first_column: s[s.length - (w || 1)].first_column,
|
|
172
|
+
last_column: s[s.length - 1].last_column
|
|
173
|
+
}, Oe && (Q._$.range = [
|
|
174
|
+
s[s.length - (w || 1)].range[0],
|
|
175
|
+
s[s.length - 1].range[1]
|
|
176
|
+
]), ae = this.performAction.apply(Q, [
|
|
177
|
+
_,
|
|
178
|
+
me,
|
|
179
|
+
Z,
|
|
180
|
+
L.yy,
|
|
181
|
+
S[1],
|
|
182
|
+
f,
|
|
183
|
+
s
|
|
184
|
+
].concat(qe)), typeof ae < "u")
|
|
185
|
+
return ae;
|
|
186
|
+
w && (a = a.slice(0, -1 * w * 2), f = f.slice(0, -1 * w), s = s.slice(0, -1 * w)), a.push(this.productions_[S[1]][0]), f.push(Q.$), s.push(Q._$), be = W[a[a.length - 2]][a[a.length - 1]], a.push(be);
|
|
187
|
+
break;
|
|
188
|
+
case 3:
|
|
189
|
+
return !0;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return !0;
|
|
193
|
+
}
|
|
194
|
+
}, $e = /* @__PURE__ */ (function() {
|
|
195
|
+
var V = {
|
|
196
|
+
EOF: 1,
|
|
197
|
+
parseError: function(r, a) {
|
|
198
|
+
if (this.yy.parser)
|
|
199
|
+
this.yy.parser.parseError(r, a);
|
|
200
|
+
else
|
|
201
|
+
throw new Error(r);
|
|
202
|
+
},
|
|
203
|
+
// resets the lexer, sets new input
|
|
204
|
+
setInput: function(i, r) {
|
|
205
|
+
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 = {
|
|
206
|
+
first_line: 1,
|
|
207
|
+
first_column: 0,
|
|
208
|
+
last_line: 1,
|
|
209
|
+
last_column: 0
|
|
210
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
211
|
+
},
|
|
212
|
+
// consumes and returns one char from the input
|
|
213
|
+
input: function() {
|
|
214
|
+
var i = this._input[0];
|
|
215
|
+
this.yytext += i, this.yyleng++, this.offset++, this.match += i, this.matched += i;
|
|
216
|
+
var r = i.match(/(?:\r\n?|\n).*/g);
|
|
217
|
+
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;
|
|
218
|
+
},
|
|
219
|
+
// unshifts one char (or a string) into the input
|
|
220
|
+
unput: function(i) {
|
|
221
|
+
var r = i.length, a = i.split(/(?:\r\n?|\n)/g);
|
|
222
|
+
this._input = i + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - r), this.offset -= r;
|
|
223
|
+
var n = 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), a.length - 1 && (this.yylineno -= a.length - 1);
|
|
225
|
+
var f = 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: a ? (a.length === n.length ? this.yylloc.first_column : 0) + n[n.length - a.length].length - a[0].length : this.yylloc.first_column - r
|
|
231
|
+
}, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - r]), this.yyleng = this.yytext.length, this;
|
|
232
|
+
},
|
|
233
|
+
// When called from action, caches matched text and appends it on next action
|
|
234
|
+
more: function() {
|
|
235
|
+
return this._more = !0, this;
|
|
236
|
+
},
|
|
237
|
+
// 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.
|
|
238
|
+
reject: function() {
|
|
239
|
+
if (this.options.backtrack_lexer)
|
|
240
|
+
this._backtrack = !0;
|
|
241
|
+
else
|
|
242
|
+
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).
|
|
243
|
+
` + this.showPosition(), {
|
|
244
|
+
text: "",
|
|
245
|
+
token: null,
|
|
246
|
+
line: this.yylineno
|
|
247
|
+
});
|
|
248
|
+
return this;
|
|
249
|
+
},
|
|
250
|
+
// retain first n characters of the match
|
|
251
|
+
less: function(i) {
|
|
252
|
+
this.unput(this.match.slice(i));
|
|
253
|
+
},
|
|
254
|
+
// displays already matched input, i.e. for error messages
|
|
255
|
+
pastInput: function() {
|
|
256
|
+
var i = this.matched.substr(0, this.matched.length - this.match.length);
|
|
257
|
+
return (i.length > 20 ? "..." : "") + i.substr(-20).replace(/\n/g, "");
|
|
258
|
+
},
|
|
259
|
+
// displays upcoming input, i.e. for error messages
|
|
260
|
+
upcomingInput: function() {
|
|
261
|
+
var i = this.match;
|
|
262
|
+
return i.length < 20 && (i += this._input.substr(0, 20 - i.length)), (i.substr(0, 20) + (i.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
263
|
+
},
|
|
264
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
265
|
+
showPosition: function() {
|
|
266
|
+
var i = this.pastInput(), r = new Array(i.length + 1).join("-");
|
|
267
|
+
return i + this.upcomingInput() + `
|
|
268
|
+
` + r + "^";
|
|
269
|
+
},
|
|
270
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
271
|
+
test_match: function(i, r) {
|
|
272
|
+
var a, n, f;
|
|
273
|
+
if (this.options.backtrack_lexer && (f = {
|
|
274
|
+
yylineno: this.yylineno,
|
|
275
|
+
yylloc: {
|
|
276
|
+
first_line: this.yylloc.first_line,
|
|
277
|
+
last_line: this.last_line,
|
|
278
|
+
first_column: this.yylloc.first_column,
|
|
279
|
+
last_column: this.yylloc.last_column
|
|
280
|
+
},
|
|
281
|
+
yytext: this.yytext,
|
|
282
|
+
match: this.match,
|
|
283
|
+
matches: this.matches,
|
|
284
|
+
matched: this.matched,
|
|
285
|
+
yyleng: this.yyleng,
|
|
286
|
+
offset: this.offset,
|
|
287
|
+
_more: this._more,
|
|
288
|
+
_input: this._input,
|
|
289
|
+
yy: this.yy,
|
|
290
|
+
conditionStack: this.conditionStack.slice(0),
|
|
291
|
+
done: this.done
|
|
292
|
+
}, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), n = i[0].match(/(?:\r\n?|\n).*/g), n && (this.yylineno += n.length), this.yylloc = {
|
|
293
|
+
first_line: this.yylloc.last_line,
|
|
294
|
+
last_line: this.yylineno + 1,
|
|
295
|
+
first_column: this.yylloc.last_column,
|
|
296
|
+
last_column: n ? n[n.length - 1].length - n[n.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + i[0].length
|
|
297
|
+
}, 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], a = this.performAction.call(this, this.yy, this, r, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), a)
|
|
298
|
+
return a;
|
|
299
|
+
if (this._backtrack) {
|
|
300
|
+
for (var s in f)
|
|
301
|
+
this[s] = f[s];
|
|
302
|
+
return !1;
|
|
303
|
+
}
|
|
304
|
+
return !1;
|
|
305
|
+
},
|
|
306
|
+
// return next match in input
|
|
307
|
+
next: function() {
|
|
308
|
+
if (this.done)
|
|
309
|
+
return this.EOF;
|
|
310
|
+
this._input || (this.done = !0);
|
|
311
|
+
var i, r, a, n;
|
|
312
|
+
this._more || (this.yytext = "", this.match = "");
|
|
313
|
+
for (var f = this._currentRules(), s = 0; s < f.length; s++)
|
|
314
|
+
if (a = this._input.match(this.rules[f[s]]), a && (!r || a[0].length > r[0].length)) {
|
|
315
|
+
if (r = a, n = s, this.options.backtrack_lexer) {
|
|
316
|
+
if (i = this.test_match(a, f[s]), i !== !1)
|
|
317
|
+
return i;
|
|
318
|
+
if (this._backtrack) {
|
|
319
|
+
r = !1;
|
|
320
|
+
continue;
|
|
321
|
+
} else
|
|
322
|
+
return !1;
|
|
323
|
+
} else if (!this.options.flex)
|
|
324
|
+
break;
|
|
325
|
+
}
|
|
326
|
+
return r ? (i = this.test_match(r, f[n]), i !== !1 ? i : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
327
|
+
` + this.showPosition(), {
|
|
328
|
+
text: "",
|
|
329
|
+
token: null,
|
|
330
|
+
line: this.yylineno
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
// return next match that has a token
|
|
334
|
+
lex: function() {
|
|
335
|
+
var r = this.next();
|
|
336
|
+
return r || this.lex();
|
|
337
|
+
},
|
|
338
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
339
|
+
begin: function(r) {
|
|
340
|
+
this.conditionStack.push(r);
|
|
341
|
+
},
|
|
342
|
+
// pop the previously active lexer condition state off the condition stack
|
|
343
|
+
popState: function() {
|
|
344
|
+
var r = this.conditionStack.length - 1;
|
|
345
|
+
return r > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
346
|
+
},
|
|
347
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
348
|
+
_currentRules: function() {
|
|
349
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
350
|
+
},
|
|
351
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
352
|
+
topState: function(r) {
|
|
353
|
+
return r = this.conditionStack.length - 1 - Math.abs(r || 0), r >= 0 ? this.conditionStack[r] : "INITIAL";
|
|
354
|
+
},
|
|
355
|
+
// alias for begin(condition)
|
|
356
|
+
pushState: function(r) {
|
|
357
|
+
this.begin(r);
|
|
358
|
+
},
|
|
359
|
+
// return the number of states currently on the stack
|
|
360
|
+
stateStackSize: function() {
|
|
361
|
+
return this.conditionStack.length;
|
|
362
|
+
},
|
|
363
|
+
options: { "case-insensitive": !0 },
|
|
364
|
+
performAction: function(r, a, n, f) {
|
|
365
|
+
switch (n) {
|
|
366
|
+
case 0:
|
|
367
|
+
return "title";
|
|
368
|
+
case 1:
|
|
369
|
+
return this.begin("acc_title"), 9;
|
|
370
|
+
case 2:
|
|
371
|
+
return this.popState(), "acc_title_value";
|
|
372
|
+
case 3:
|
|
373
|
+
return this.begin("acc_descr"), 11;
|
|
374
|
+
case 4:
|
|
375
|
+
return this.popState(), "acc_descr_value";
|
|
376
|
+
case 5:
|
|
377
|
+
this.begin("acc_descr_multiline");
|
|
378
|
+
break;
|
|
379
|
+
case 6:
|
|
380
|
+
this.popState();
|
|
381
|
+
break;
|
|
382
|
+
case 7:
|
|
383
|
+
return "acc_descr_multiline_value";
|
|
384
|
+
case 8:
|
|
385
|
+
return 5;
|
|
386
|
+
case 9:
|
|
387
|
+
break;
|
|
388
|
+
case 10:
|
|
389
|
+
break;
|
|
390
|
+
case 11:
|
|
391
|
+
break;
|
|
392
|
+
case 12:
|
|
393
|
+
return 8;
|
|
394
|
+
case 13:
|
|
395
|
+
return 6;
|
|
396
|
+
case 14:
|
|
397
|
+
return 19;
|
|
398
|
+
case 15:
|
|
399
|
+
return 30;
|
|
400
|
+
case 16:
|
|
401
|
+
return 22;
|
|
402
|
+
case 17:
|
|
403
|
+
return 21;
|
|
404
|
+
case 18:
|
|
405
|
+
return 24;
|
|
406
|
+
case 19:
|
|
407
|
+
return 26;
|
|
408
|
+
case 20:
|
|
409
|
+
return 28;
|
|
410
|
+
case 21:
|
|
411
|
+
return 31;
|
|
412
|
+
case 22:
|
|
413
|
+
return 32;
|
|
414
|
+
case 23:
|
|
415
|
+
return 33;
|
|
416
|
+
case 24:
|
|
417
|
+
return 34;
|
|
418
|
+
case 25:
|
|
419
|
+
return 35;
|
|
420
|
+
case 26:
|
|
421
|
+
return 36;
|
|
422
|
+
case 27:
|
|
423
|
+
return 37;
|
|
424
|
+
case 28:
|
|
425
|
+
return 38;
|
|
426
|
+
case 29:
|
|
427
|
+
return 39;
|
|
428
|
+
case 30:
|
|
429
|
+
return 40;
|
|
430
|
+
case 31:
|
|
431
|
+
return 41;
|
|
432
|
+
case 32:
|
|
433
|
+
return 42;
|
|
434
|
+
case 33:
|
|
435
|
+
return 43;
|
|
436
|
+
case 34:
|
|
437
|
+
return 44;
|
|
438
|
+
case 35:
|
|
439
|
+
return 55;
|
|
440
|
+
case 36:
|
|
441
|
+
return 56;
|
|
442
|
+
case 37:
|
|
443
|
+
return 57;
|
|
444
|
+
case 38:
|
|
445
|
+
return 58;
|
|
446
|
+
case 39:
|
|
447
|
+
return 59;
|
|
448
|
+
case 40:
|
|
449
|
+
return 60;
|
|
450
|
+
case 41:
|
|
451
|
+
return 61;
|
|
452
|
+
case 42:
|
|
453
|
+
return 47;
|
|
454
|
+
case 43:
|
|
455
|
+
return 49;
|
|
456
|
+
case 44:
|
|
457
|
+
return 51;
|
|
458
|
+
case 45:
|
|
459
|
+
return 54;
|
|
460
|
+
case 46:
|
|
461
|
+
return 53;
|
|
462
|
+
case 47:
|
|
463
|
+
this.begin("string");
|
|
464
|
+
break;
|
|
465
|
+
case 48:
|
|
466
|
+
this.popState();
|
|
467
|
+
break;
|
|
468
|
+
case 49:
|
|
469
|
+
return "qString";
|
|
470
|
+
case 50:
|
|
471
|
+
return a.yytext = a.yytext.trim(), 62;
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
rules: [/^(?:title\s[^#\n;]+)/i, /^(?:accTitle\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*:\s*)/i, /^(?:(?!\n||)*[^\n]*)/i, /^(?:accDescr\s*\{\s*)/i, /^(?:[\}])/i, /^(?:[^\}]*)/i, /^(?:(\r?\n)+)/i, /^(?:\s+)/i, /^(?:#[^\n]*)/i, /^(?:%[^\n]*)/i, /^(?:$)/i, /^(?:requirementDiagram\b)/i, /^(?:\{)/i, /^(?:\})/i, /^(?::)/i, /^(?:id\b)/i, /^(?:text\b)/i, /^(?:risk\b)/i, /^(?:verifyMethod\b)/i, /^(?:requirement\b)/i, /^(?:functionalRequirement\b)/i, /^(?:interfaceRequirement\b)/i, /^(?:performanceRequirement\b)/i, /^(?:physicalRequirement\b)/i, /^(?:designConstraint\b)/i, /^(?:low\b)/i, /^(?:medium\b)/i, /^(?:high\b)/i, /^(?:analysis\b)/i, /^(?:demonstration\b)/i, /^(?:inspection\b)/i, /^(?:test\b)/i, /^(?:element\b)/i, /^(?:contains\b)/i, /^(?:copies\b)/i, /^(?:derives\b)/i, /^(?:satisfies\b)/i, /^(?:verifies\b)/i, /^(?:refines\b)/i, /^(?:traces\b)/i, /^(?:type\b)/i, /^(?:docref\b)/i, /^(?:<-)/i, /^(?:->)/i, /^(?:-)/i, /^(?:["])/i, /^(?:["])/i, /^(?:[^"]*)/i, /^(?:[\w][^\r\n\{\<\>\-\=]*)/i],
|
|
475
|
+
conditions: { acc_descr_multiline: { rules: [6, 7], inclusive: !1 }, acc_descr: { rules: [4], inclusive: !1 }, acc_title: { rules: [2], inclusive: !1 }, unqString: { rules: [], inclusive: !1 }, token: { rules: [], inclusive: !1 }, string: { rules: [48, 49], inclusive: !1 }, INITIAL: { rules: [0, 1, 3, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 50], inclusive: !0 } }
|
|
476
|
+
};
|
|
477
|
+
return V;
|
|
478
|
+
})();
|
|
479
|
+
ie.lexer = $e;
|
|
480
|
+
function ne() {
|
|
481
|
+
this.yy = {};
|
|
482
|
+
}
|
|
483
|
+
return ne.prototype = ie, ie.Parser = ne, new ne();
|
|
484
|
+
})();
|
|
485
|
+
ce.parser = ce;
|
|
486
|
+
const He = ce;
|
|
487
|
+
let ue = [], b = {}, K = {}, q = {}, G = {};
|
|
488
|
+
const We = {
|
|
489
|
+
REQUIREMENT: "Requirement",
|
|
490
|
+
FUNCTIONAL_REQUIREMENT: "Functional Requirement",
|
|
491
|
+
INTERFACE_REQUIREMENT: "Interface Requirement",
|
|
492
|
+
PERFORMANCE_REQUIREMENT: "Performance Requirement",
|
|
493
|
+
PHYSICAL_REQUIREMENT: "Physical Requirement",
|
|
494
|
+
DESIGN_CONSTRAINT: "Design Constraint"
|
|
495
|
+
}, Ke = {
|
|
496
|
+
LOW_RISK: "Low",
|
|
497
|
+
MED_RISK: "Medium",
|
|
498
|
+
HIGH_RISK: "High"
|
|
499
|
+
}, Ge = {
|
|
500
|
+
VERIFY_ANALYSIS: "Analysis",
|
|
501
|
+
VERIFY_DEMONSTRATION: "Demonstration",
|
|
502
|
+
VERIFY_INSPECTION: "Inspection",
|
|
503
|
+
VERIFY_TEST: "Test"
|
|
504
|
+
}, ze = {
|
|
505
|
+
CONTAINS: "contains",
|
|
506
|
+
COPIES: "copies",
|
|
507
|
+
DERIVES: "derives",
|
|
508
|
+
SATISFIES: "satisfies",
|
|
509
|
+
VERIFIES: "verifies",
|
|
510
|
+
REFINES: "refines",
|
|
511
|
+
TRACES: "traces"
|
|
512
|
+
}, je = (e, t) => (K[e] === void 0 && (K[e] = {
|
|
513
|
+
name: e,
|
|
514
|
+
type: t,
|
|
515
|
+
id: b.id,
|
|
516
|
+
text: b.text,
|
|
517
|
+
risk: b.risk,
|
|
518
|
+
verifyMethod: b.verifyMethod
|
|
519
|
+
}), b = {}, K[e]), Xe = () => K, Je = (e) => {
|
|
520
|
+
b !== void 0 && (b.id = e);
|
|
521
|
+
}, Ze = (e) => {
|
|
522
|
+
b !== void 0 && (b.text = e);
|
|
523
|
+
}, et = (e) => {
|
|
524
|
+
b !== void 0 && (b.risk = e);
|
|
525
|
+
}, tt = (e) => {
|
|
526
|
+
b !== void 0 && (b.verifyMethod = e);
|
|
527
|
+
}, it = (e) => (G[e] === void 0 && (G[e] = {
|
|
528
|
+
name: e,
|
|
529
|
+
type: q.type,
|
|
530
|
+
docRef: q.docRef
|
|
531
|
+
}, Ne.info("Added new requirement: ", e)), q = {}, G[e]), nt = () => G, rt = (e) => {
|
|
532
|
+
q !== void 0 && (q.type = e);
|
|
533
|
+
}, st = (e) => {
|
|
534
|
+
q !== void 0 && (q.docRef = e);
|
|
535
|
+
}, at = (e, t, l) => {
|
|
536
|
+
ue.push({
|
|
537
|
+
type: e,
|
|
538
|
+
src: t,
|
|
539
|
+
dst: l
|
|
540
|
+
});
|
|
541
|
+
}, lt = () => ue, ot = () => {
|
|
542
|
+
ue = [], b = {}, K = {}, q = {}, G = {}, Ye();
|
|
543
|
+
}, ct = {
|
|
544
|
+
RequirementType: We,
|
|
545
|
+
RiskLevel: Ke,
|
|
546
|
+
VerifyType: Ge,
|
|
547
|
+
Relationships: ze,
|
|
548
|
+
getConfig: () => Te().req,
|
|
549
|
+
addRequirement: je,
|
|
550
|
+
getRequirements: Xe,
|
|
551
|
+
setNewReqId: Je,
|
|
552
|
+
setNewReqText: Ze,
|
|
553
|
+
setNewReqRisk: et,
|
|
554
|
+
setNewReqVerifyMethod: tt,
|
|
555
|
+
setAccTitle: De,
|
|
556
|
+
getAccTitle: Me,
|
|
557
|
+
setAccDescription: Fe,
|
|
558
|
+
getAccDescription: Ce,
|
|
559
|
+
addElement: it,
|
|
560
|
+
getElements: nt,
|
|
561
|
+
setNewElementType: rt,
|
|
562
|
+
setNewElementDocRef: st,
|
|
563
|
+
addRelationship: at,
|
|
564
|
+
getRelationships: lt,
|
|
565
|
+
clear: ot
|
|
566
|
+
}, ht = (e) => `
|
|
567
|
+
|
|
568
|
+
marker {
|
|
569
|
+
fill: ${e.relationColor};
|
|
570
|
+
stroke: ${e.relationColor};
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
marker.cross {
|
|
574
|
+
stroke: ${e.lineColor};
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
svg {
|
|
578
|
+
font-family: ${e.fontFamily};
|
|
579
|
+
font-size: ${e.fontSize};
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
.reqBox {
|
|
583
|
+
fill: ${e.requirementBackground};
|
|
584
|
+
fill-opacity: 1.0;
|
|
585
|
+
stroke: ${e.requirementBorderColor};
|
|
586
|
+
stroke-width: ${e.requirementBorderSize};
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
.reqTitle, .reqLabel{
|
|
590
|
+
fill: ${e.requirementTextColor};
|
|
591
|
+
}
|
|
592
|
+
.reqLabelBox {
|
|
593
|
+
fill: ${e.relationLabelBackground};
|
|
594
|
+
fill-opacity: 1.0;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
.req-title-line {
|
|
598
|
+
stroke: ${e.requirementBorderColor};
|
|
599
|
+
stroke-width: ${e.requirementBorderSize};
|
|
600
|
+
}
|
|
601
|
+
.relationshipLine {
|
|
602
|
+
stroke: ${e.relationColor};
|
|
603
|
+
stroke-width: 1;
|
|
604
|
+
}
|
|
605
|
+
.relationshipLabel {
|
|
606
|
+
fill: ${e.relationLabelColor};
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
`, ut = ht, he = {
|
|
610
|
+
CONTAINS: "contains",
|
|
611
|
+
ARROW: "arrow"
|
|
612
|
+
}, dt = (e, t) => {
|
|
613
|
+
let l = e.append("defs").append("marker").attr("id", he.CONTAINS + "_line_ending").attr("refX", 0).attr("refY", t.line_height / 2).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("g");
|
|
614
|
+
l.append("circle").attr("cx", t.line_height / 2).attr("cy", t.line_height / 2).attr("r", t.line_height / 2).attr("fill", "none"), l.append("line").attr("x1", 0).attr("x2", t.line_height).attr("y1", t.line_height / 2).attr("y2", t.line_height / 2).attr("stroke-width", 1), l.append("line").attr("y1", 0).attr("y2", t.line_height).attr("x1", t.line_height / 2).attr("x2", t.line_height / 2).attr("stroke-width", 1), e.append("defs").append("marker").attr("id", he.ARROW + "_line_ending").attr("refX", t.line_height).attr("refY", 0.5 * t.line_height).attr("markerWidth", t.line_height).attr("markerHeight", t.line_height).attr("orient", "auto").append("path").attr(
|
|
615
|
+
"d",
|
|
616
|
+
`M0,0
|
|
617
|
+
L${t.line_height},${t.line_height / 2}
|
|
618
|
+
M${t.line_height},${t.line_height / 2}
|
|
619
|
+
L0,${t.line_height}`
|
|
620
|
+
).attr("stroke-width", 1);
|
|
621
|
+
}, xe = {
|
|
622
|
+
ReqMarkers: he,
|
|
623
|
+
insertLineEndings: dt
|
|
624
|
+
};
|
|
625
|
+
let y = {}, Se = 0;
|
|
626
|
+
const Ae = (e, t) => e.insert("rect", "#" + t).attr("class", "req reqBox").attr("x", 0).attr("y", 0).attr("width", y.rect_min_width + "px").attr("height", y.rect_min_height + "px"), ve = (e, t, l) => {
|
|
627
|
+
let c = y.rect_min_width / 2, u = e.append("text").attr("class", "req reqLabel reqTitle").attr("id", t).attr("x", c).attr("y", y.rect_padding).attr("dominant-baseline", "hanging"), d = 0;
|
|
628
|
+
l.forEach((E) => {
|
|
629
|
+
d == 0 ? u.append("tspan").attr("text-anchor", "middle").attr("x", y.rect_min_width / 2).attr("dy", 0).text(E) : u.append("tspan").attr("text-anchor", "middle").attr("x", y.rect_min_width / 2).attr("dy", y.line_height * 0.75).text(E), d++;
|
|
630
|
+
});
|
|
631
|
+
let p = 1.5 * y.rect_padding, h = d * y.line_height * 0.75, o = p + h;
|
|
632
|
+
return e.append("line").attr("class", "req-title-line").attr("x1", "0").attr("x2", y.rect_min_width).attr("y1", o).attr("y2", o), {
|
|
633
|
+
titleNode: u,
|
|
634
|
+
y: o
|
|
635
|
+
};
|
|
636
|
+
}, we = (e, t, l, c) => {
|
|
637
|
+
let u = e.append("text").attr("class", "req reqLabel").attr("id", t).attr("x", y.rect_padding).attr("y", c).attr("dominant-baseline", "hanging"), d = 0;
|
|
638
|
+
const p = 30;
|
|
639
|
+
let h = [];
|
|
640
|
+
return l.forEach((o) => {
|
|
641
|
+
let E = o.length;
|
|
642
|
+
for (; E > p && d < 3; ) {
|
|
643
|
+
let R = o.substring(0, p);
|
|
644
|
+
o = o.substring(p, o.length), E = o.length, h[h.length] = R, d++;
|
|
645
|
+
}
|
|
646
|
+
if (d == 3) {
|
|
647
|
+
let R = h[h.length - 1];
|
|
648
|
+
h[h.length - 1] = R.substring(0, R.length - 4) + "...";
|
|
649
|
+
} else
|
|
650
|
+
h[h.length] = o;
|
|
651
|
+
d = 0;
|
|
652
|
+
}), h.forEach((o) => {
|
|
653
|
+
u.append("tspan").attr("x", y.rect_padding).attr("dy", y.line_height).text(o);
|
|
654
|
+
}), u;
|
|
655
|
+
}, pt = (e, t, l, c) => {
|
|
656
|
+
const u = t.node().getTotalLength(), d = t.node().getPointAtLength(u * 0.5), p = "rel" + Se;
|
|
657
|
+
Se++;
|
|
658
|
+
const o = e.append("text").attr("class", "req relationshipLabel").attr("id", p).attr("x", d.x).attr("y", d.y).attr("text-anchor", "middle").attr("dominant-baseline", "middle").text(c).node().getBBox();
|
|
659
|
+
e.insert("rect", "#" + p).attr("class", "req reqLabelBox").attr("x", d.x - o.width / 2).attr("y", d.y - o.height / 2).attr("width", o.width).attr("height", o.height).attr("fill", "white").attr("fill-opacity", "85%");
|
|
660
|
+
}, ft = function(e, t, l, c, u) {
|
|
661
|
+
const d = l.edge(H(t.src), H(t.dst)), p = Qe().x(function(o) {
|
|
662
|
+
return o.x;
|
|
663
|
+
}).y(function(o) {
|
|
664
|
+
return o.y;
|
|
665
|
+
}), h = e.insert("path", "#" + c).attr("class", "er relationshipLine").attr("d", p(d.points)).attr("fill", "none");
|
|
666
|
+
t.type == u.db.Relationships.CONTAINS ? h.attr(
|
|
667
|
+
"marker-start",
|
|
668
|
+
"url(" + ke.getUrl(y.arrowMarkerAbsolute) + "#" + t.type + "_line_ending)"
|
|
669
|
+
) : (h.attr("stroke-dasharray", "10,7"), h.attr(
|
|
670
|
+
"marker-end",
|
|
671
|
+
"url(" + ke.getUrl(y.arrowMarkerAbsolute) + "#" + xe.ReqMarkers.ARROW + "_line_ending)"
|
|
672
|
+
)), pt(e, h, y, `<<${t.type}>>`);
|
|
673
|
+
}, yt = (e, t, l) => {
|
|
674
|
+
Object.keys(e).forEach((c) => {
|
|
675
|
+
let u = e[c];
|
|
676
|
+
c = H(c), Ne.info("Added new requirement: ", c);
|
|
677
|
+
const d = l.append("g").attr("id", c), p = "req-" + c, h = Ae(d, p);
|
|
678
|
+
let o = ve(d, c + "_title", [
|
|
679
|
+
`<<${u.type}>>`,
|
|
680
|
+
`${u.name}`
|
|
681
|
+
]);
|
|
682
|
+
we(
|
|
683
|
+
d,
|
|
684
|
+
c + "_body",
|
|
685
|
+
[
|
|
686
|
+
`Id: ${u.id}`,
|
|
687
|
+
`Text: ${u.text}`,
|
|
688
|
+
`Risk: ${u.risk}`,
|
|
689
|
+
`Verification: ${u.verifyMethod}`
|
|
690
|
+
],
|
|
691
|
+
o.y
|
|
692
|
+
);
|
|
693
|
+
const E = h.node().getBBox();
|
|
694
|
+
t.setNode(c, {
|
|
695
|
+
width: E.width,
|
|
696
|
+
height: E.height,
|
|
697
|
+
shape: "rect",
|
|
698
|
+
id: c
|
|
699
|
+
});
|
|
700
|
+
});
|
|
701
|
+
}, _t = (e, t, l) => {
|
|
702
|
+
Object.keys(e).forEach((c) => {
|
|
703
|
+
let u = e[c];
|
|
704
|
+
const d = H(c), p = l.append("g").attr("id", d), h = "element-" + d, o = Ae(p, h);
|
|
705
|
+
let E = ve(p, h + "_title", ["<<Element>>", `${c}`]);
|
|
706
|
+
we(
|
|
707
|
+
p,
|
|
708
|
+
h + "_body",
|
|
709
|
+
[`Type: ${u.type || "Not Specified"}`, `Doc Ref: ${u.docRef || "None"}`],
|
|
710
|
+
E.y
|
|
711
|
+
);
|
|
712
|
+
const R = o.node().getBBox();
|
|
713
|
+
t.setNode(d, {
|
|
714
|
+
width: R.width,
|
|
715
|
+
height: R.height,
|
|
716
|
+
shape: "rect",
|
|
717
|
+
id: d
|
|
718
|
+
});
|
|
719
|
+
});
|
|
720
|
+
}, Et = (e, t) => (e.forEach(function(l) {
|
|
721
|
+
let c = H(l.src), u = H(l.dst);
|
|
722
|
+
t.setEdge(c, u, { relationship: l });
|
|
723
|
+
}), e), gt = function(e, t) {
|
|
724
|
+
t.nodes().forEach(function(l) {
|
|
725
|
+
l !== void 0 && t.node(l) !== void 0 && (e.select("#" + l), e.select("#" + l).attr(
|
|
726
|
+
"transform",
|
|
727
|
+
"translate(" + (t.node(l).x - t.node(l).width / 2) + "," + (t.node(l).y - t.node(l).height / 2) + " )"
|
|
728
|
+
));
|
|
729
|
+
});
|
|
730
|
+
}, H = (e) => e.replace(/\s/g, "").replace(/\./g, "_"), Rt = (e, t, l, c) => {
|
|
731
|
+
y = Te().requirement;
|
|
732
|
+
const u = y.securityLevel;
|
|
733
|
+
let d;
|
|
734
|
+
u === "sandbox" && (d = oe("#i" + t));
|
|
735
|
+
const h = (u === "sandbox" ? oe(d.nodes()[0].contentDocument.body) : oe("body")).select(`[id='${t}']`);
|
|
736
|
+
xe.insertLineEndings(h, y);
|
|
737
|
+
const o = new Ue({
|
|
738
|
+
multigraph: !1,
|
|
739
|
+
compound: !1,
|
|
740
|
+
directed: !0
|
|
741
|
+
}).setGraph({
|
|
742
|
+
rankdir: y.layoutDirection,
|
|
743
|
+
marginx: 20,
|
|
744
|
+
marginy: 20,
|
|
745
|
+
nodesep: 100,
|
|
746
|
+
edgesep: 100,
|
|
747
|
+
ranksep: 100
|
|
748
|
+
}).setDefaultEdgeLabel(function() {
|
|
749
|
+
return {};
|
|
750
|
+
});
|
|
751
|
+
let E = c.db.getRequirements(), R = c.db.getElements(), A = c.db.getRelationships();
|
|
752
|
+
yt(E, o, h), _t(R, o, h), Et(A, o), Be(o), gt(h, o), A.forEach(function(x) {
|
|
753
|
+
ft(h, x, o, t, c);
|
|
754
|
+
});
|
|
755
|
+
const T = y.rect_padding, N = h.node().getBBox(), v = N.width + T * 2, k = N.height + T * 2;
|
|
756
|
+
Pe(h, k, v, y.useMaxWidth), h.attr("viewBox", `${N.x - T} ${N.y - T} ${v} ${k}`);
|
|
757
|
+
}, mt = {
|
|
758
|
+
draw: Rt
|
|
759
|
+
}, Tt = {
|
|
760
|
+
parser: He,
|
|
761
|
+
db: ct,
|
|
762
|
+
renderer: mt,
|
|
763
|
+
styles: ut
|
|
764
|
+
};
|
|
765
|
+
export {
|
|
766
|
+
Tt as diagram
|
|
767
|
+
};
|