@draftably/editor 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -2
- package/dist/LICENSE +21 -0
- package/dist/assets/engine.worker-DmHew5f6.js +6813 -0
- package/dist/assets/import-d2.worker-CnXfFXoa.js +5395 -0
- package/dist/chunks/abnfDiagram-WEYOIA3C-llcpthp5.js +87 -0
- package/dist/chunks/arc-rJj0TtXf.js +83 -0
- package/dist/chunks/architectureDiagram-ZHVYKT53-CfiXg0Lk.js +4781 -0
- package/dist/chunks/blockDiagram-RJAE7QA3-CO-14jWz.js +1440 -0
- package/dist/chunks/browser-iNhbPsGc.js +40 -0
- package/dist/chunks/c4Diagram-XDPPPE54-DYKuxA4n.js +1524 -0
- package/dist/chunks/channel-qMvPU6eH.js +5 -0
- package/dist/chunks/chunk-2E7WHVMD-BEZwsFS3.js +670 -0
- package/dist/chunks/chunk-2Q5K7J3B-gqtzQ8ux.js +18 -0
- package/dist/chunks/chunk-4EMNKR2T-MC54CXVe.js +262 -0
- package/dist/chunks/chunk-55XCU76K-DkZUAaqC.js +68 -0
- package/dist/chunks/chunk-5VM5RSS4-CaKe4sjM.js +19 -0
- package/dist/chunks/chunk-JWPE2WC7-CnAFS2xF.js +8 -0
- package/dist/chunks/chunk-VQ5W62QI-CXRv7FiX.js +19 -0
- package/dist/chunks/chunk-XXDRQBXY-B-AMQgD2.js +8 -0
- package/dist/chunks/chunk-ZCHMQSOR-BALpdc3g.js +451 -0
- package/dist/chunks/classDiagram-v2-4MYWR3UA-wPjgJTg4.js +1570 -0
- package/dist/chunks/cose-bilkent-JH36ORCC-Bbh5ggBc.js +2608 -0
- package/dist/chunks/cynefin-EF2NZ3EQ-Bt6b88hY.js +22361 -0
- package/dist/chunks/cynefinDiagram-WF24UDRP-BHWZvxoF.js +299 -0
- package/dist/chunks/cytoscape.esm-CRsF_JA3.js +18791 -0
- package/dist/chunks/dagre-NK4GIZVX-Cz37yPrT.js +2157 -0
- package/dist/chunks/defaultLocale-BgPVtth8.js +171 -0
- package/dist/chunks/diagram-CBK3MWTC-Q2R6FJ0B.js +531 -0
- package/dist/chunks/diagram-I5XIIV2D-a2Kdu_wA.js +153 -0
- package/dist/chunks/diagram-ODIL2UCW-DTWXxcOn.js +346 -0
- package/dist/chunks/diagram-PFBEJUXE-DIAQQ5KX.js +480 -0
- package/dist/chunks/diagram-RJA3I4VV-BPD0GghS.js +219 -0
- package/dist/chunks/diagram-TYUNFSNR-BmdkONfG.js +2586 -0
- package/dist/chunks/dot-importer-B23jwEkx.js +1547 -0
- package/dist/chunks/ebnfDiagram-V4P3TTPT-C5IKvYlb.js +109 -0
- package/dist/chunks/elk-QONTBCTQ-CtdQFvh2.js +49229 -0
- package/dist/chunks/erDiagram-KYQIGQAA-5wguK9Dx.js +1064 -0
- package/dist/chunks/flowDiagram-IUGLLWBU-BijvFPku.js +1771 -0
- package/dist/chunks/ganttDiagram-R7GPNTJY-BaqGPz-O.js +2729 -0
- package/dist/chunks/gitGraphDiagram-PDYL7XHY-DZfMGyHE.js +815 -0
- package/dist/chunks/graph-CKJmgLki.js +1541 -0
- package/dist/chunks/import-core-C-I1wGfw.js +145 -0
- package/dist/chunks/infoDiagram-MVDRKAX5-C2vH_59e.js +24 -0
- package/dist/chunks/init-DjUOC4st.js +16 -0
- package/dist/chunks/ishikawaDiagram-HPEHV2GE-q149MFlV.js +624 -0
- package/dist/chunks/journeyDiagram-BOSHW7O7-D-2Z3VtR.js +834 -0
- package/dist/chunks/kanban-definition-FNSA4HC5-wvAjV5ub.js +724 -0
- package/dist/chunks/katex-BsrBVQKd.js +11314 -0
- package/dist/chunks/linear-4t7D_ros.js +259 -0
- package/dist/chunks/mermaid-facade-BoLWBerE.js +289 -0
- package/dist/chunks/mermaid-importer-Cgx1IhmR.js +478 -0
- package/dist/chunks/mermaid.core-DXv6D2Sm.js +19244 -0
- package/dist/chunks/mindmap-definition-6OY57UG3-r9wTKul_.js +837 -0
- package/dist/chunks/mount-C1Xk_GQz.js +22131 -0
- package/dist/chunks/ordinal-DfAQgscy.js +61 -0
- package/dist/chunks/pegDiagram-ECIUJNBX-CmKlFWiP.js +95 -0
- package/dist/chunks/pieDiagram-GNMPY74T-DNTw_qan.js +208 -0
- package/dist/chunks/quadrantDiagram-D57K4MC3-CT_tvVub.js +1029 -0
- package/dist/chunks/railroadDiagram-Y72NRBL7-C5TUvZBe.js +77 -0
- package/dist/chunks/requirementDiagram-EQYSW5RA-C_c65aCa.js +889 -0
- package/dist/chunks/sankeyDiagram-SY24JHO5-CKcbizM1.js +859 -0
- package/dist/chunks/sequenceDiagram-BLEHNHQU-GpVnHOjf.js +2972 -0
- package/dist/chunks/sizeCapture-INFHLROL-CToN3JSu.js +46 -0
- package/dist/chunks/stateDiagram-v2-A6IESKWZ-rJYd2FfM.js +1520 -0
- package/dist/chunks/swimlanes-B3ENRKFQ-C7w5pfxG.js +4991 -0
- package/dist/chunks/swimlanesDiagram-AYQRV4AK-BpGY_bvE.js +13 -0
- package/dist/chunks/timeline-definition-JXYKGLGB-ChKFPBKc.js +1058 -0
- package/dist/chunks/usecaseDiagram-WPOLBNNX-skXH8Dcu.js +7945 -0
- package/dist/chunks/vennDiagram-Q3Y3IDCW-C5KknmJf.js +1578 -0
- package/dist/chunks/wardleyDiagram-IVAIDKWA-DY4Lkfpu.js +678 -0
- package/dist/chunks/xychartDiagram-4URNHDU4-BHScsL7h.js +1536 -0
- package/dist/element.js +36 -0
- package/dist/index.js +4 -0
- package/dist/types/src/cli/links.d.ts +4 -0
- package/dist/types/src/cli/pdf.d.ts +29 -0
- package/dist/types/src/cli/png.d.ts +23 -0
- package/dist/types/src/cli/svg.d.ts +4 -0
- package/dist/types/src/components/Icon.d.ts +14 -0
- package/dist/types/src/components/LayoutPreviewBar.d.ts +2 -0
- package/dist/types/src/components/canvas/Canvas.d.ts +15 -0
- package/dist/types/src/components/canvas/Frame.d.ts +22 -0
- package/dist/types/src/components/canvas/InlineEditor.d.ts +2 -0
- package/dist/types/src/components/canvas/Notes.d.ts +5 -0
- package/dist/types/src/components/canvas/Overlay.d.ts +2 -0
- package/dist/types/src/components/canvas/StateBar.d.ts +5 -0
- package/dist/types/src/components/canvas/TextHits.d.ts +6 -0
- package/dist/types/src/components/canvas/ZoomControls.d.ts +1 -0
- package/dist/types/src/components/canvas/text-boxes.d.ts +24 -0
- package/dist/types/src/components/controls.d.ts +88 -0
- package/dist/types/src/components/scene/EdgeView.d.ts +22 -0
- package/dist/types/src/components/scene/GroupView.d.ts +22 -0
- package/dist/types/src/components/scene/Lifelines.d.ts +15 -0
- package/dist/types/src/components/scene/LinkMark.d.ts +11 -0
- package/dist/types/src/components/scene/NodeView.d.ts +18 -0
- package/dist/types/src/components/scene/parts.d.ts +50 -0
- package/dist/types/src/components/sculpt/BrushDock.d.ts +2 -0
- package/dist/types/src/components/sculpt/TimelineDeck.d.ts +2 -0
- package/dist/types/src/components/session-context.d.ts +486 -0
- package/dist/types/src/dsl/cells.d.ts +91 -0
- package/dist/types/src/dsl/channels.d.ts +53 -0
- package/dist/types/src/dsl/compile.d.ts +162 -0
- package/dist/types/src/dsl/frame.d.ts +38 -0
- package/dist/types/src/dsl/lanes.d.ts +23 -0
- package/dist/types/src/dsl/layout-edits.d.ts +58 -0
- package/dist/types/src/dsl/legend-notes.d.ts +3 -0
- package/dist/types/src/dsl/project.d.ts +39 -0
- package/dist/types/src/dsl/source-edits.d.ts +37 -0
- package/dist/types/src/dsl/syntax.d.ts +317 -0
- package/dist/types/src/dsl/translate.d.ts +69 -0
- package/dist/types/src/editor/Editor.d.ts +6 -0
- package/dist/types/src/editor/element.d.ts +15 -0
- package/dist/types/src/editor/mount.d.ts +23 -0
- package/dist/types/src/import/browser.d.ts +3 -0
- package/dist/types/src/import/detect.d.ts +31 -0
- package/dist/types/src/import/dot-importer.d.ts +3 -0
- package/dist/types/src/import/import-core.d.ts +105 -0
- package/dist/types/src/import/mermaid-facade.d.ts +120 -0
- package/dist/types/src/import/mermaid-importer.d.ts +4 -0
- package/dist/types/src/import/mermaid-sequence.d.ts +8 -0
- package/dist/types/src/import/scratch.d.ts +3 -0
- package/dist/types/src/lib/engine-tasks.d.ts +88 -0
- package/dist/types/src/lib/font-data.d.ts +9 -0
- package/dist/types/src/lib/saved-diagram.d.ts +4 -0
- package/dist/types/src/lib/scene-cache.d.ts +4 -0
- package/dist/types/src/lib/source-hash.d.ts +7 -0
- package/dist/types/src/lib/svg-export.d.ts +15 -0
- package/dist/types/src/model/appearance.d.ts +209 -0
- package/dist/types/src/model/bounds.d.ts +19 -0
- package/dist/types/src/model/camera.d.ts +21 -0
- package/dist/types/src/model/candidates.d.ts +53 -0
- package/dist/types/src/model/colors.d.ts +22 -0
- package/dist/types/src/model/document.d.ts +24 -0
- package/dist/types/src/model/edits.d.ts +133 -0
- package/dist/types/src/model/embed.d.ts +17 -0
- package/dist/types/src/model/examples.d.ts +15 -0
- package/dist/types/src/model/font-faces.d.ts +24 -0
- package/dist/types/src/model/fonts.d.ts +47 -0
- package/dist/types/src/model/footnote.d.ts +34 -0
- package/dist/types/src/model/frame.d.ts +71 -0
- package/dist/types/src/model/geometry.d.ts +29 -0
- package/dist/types/src/model/graph.d.ts +53 -0
- package/dist/types/src/model/heading.d.ts +38 -0
- package/dist/types/src/model/icons.d.ts +2 -0
- package/dist/types/src/model/label-hits.d.ts +27 -0
- package/dist/types/src/model/labels.d.ts +88 -0
- package/dist/types/src/model/legend.d.ts +25 -0
- package/dist/types/src/model/link.d.ts +63 -0
- package/dist/types/src/model/markers.d.ts +47 -0
- package/dist/types/src/model/note.d.ts +75 -0
- package/dist/types/src/model/panels.d.ts +11 -0
- package/dist/types/src/model/rich-text.d.ts +24 -0
- package/dist/types/src/model/routes.d.ts +170 -0
- package/dist/types/src/model/samples.d.ts +11 -0
- package/dist/types/src/model/stack.d.ts +8 -0
- package/dist/types/src/model/static-scene.d.ts +15 -0
- package/dist/types/src/model/status.d.ts +84 -0
- package/dist/types/src/model/styles.d.ts +13 -0
- package/dist/types/src/model/surface.d.ts +31 -0
- package/dist/types/src/model/types.d.ts +277 -0
- package/dist/types/src/runtime/svg-renderer.d.ts +38 -0
- package/dist/types/src/server/file-session.d.ts +19 -0
- package/dist/types/src/server/workspace.d.ts +21 -0
- package/dist/types/src/state/active-session.d.ts +479 -0
- package/dist/types/src/state/commands.d.ts +529 -0
- package/dist/types/src/state/comparison.d.ts +151 -0
- package/dist/types/src/state/files.d.ts +61 -0
- package/dist/types/src/state/keyboard.d.ts +6 -0
- package/dist/types/src/state/keys.d.ts +5 -0
- package/dist/types/src/state/launch.d.ts +61 -0
- package/dist/types/src/state/links.d.ts +11 -0
- package/dist/types/src/state/session/actions.d.ts +77 -0
- package/dist/types/src/state/session/canvas-text.d.ts +24 -0
- package/dist/types/src/state/session/document.d.ts +84 -0
- package/dist/types/src/state/session/editor.d.ts +81 -0
- package/dist/types/src/state/session/emphasis.d.ts +11 -0
- package/dist/types/src/state/session/file-session.d.ts +98 -0
- package/dist/types/src/state/session/index.d.ts +496 -0
- package/dist/types/src/state/session/layout.d.ts +79 -0
- package/dist/types/src/state/session/pointer.d.ts +19 -0
- package/dist/types/src/state/session/routing.d.ts +20 -0
- package/dist/types/src/state/session/scene.d.ts +144 -0
- package/dist/types/src/state/session/sculpt.d.ts +70 -0
- package/dist/types/src/state/toast.d.ts +14 -0
- package/dist/types/src/state/ui.d.ts +39 -0
- package/package.json +41 -3
|
@@ -0,0 +1,1520 @@
|
|
|
1
|
+
import { g as se } from "./chunk-XXDRQBXY-B-AMQgD2.js";
|
|
2
|
+
import { s as ie } from "./chunk-VQ5W62QI-CXRv7FiX.js";
|
|
3
|
+
import { _ as u, l as _, c as $, p as re, r as ae, u as ne, a as oe, b as le, g as ce, s as he, q as de, t as ue, $ as fe, m as U, A as pe, k as kt, z as Se, C as ge, D as ye, E as me, I as Te } from "./mermaid.core-DXv6D2Sm.js";
|
|
4
|
+
import { c as Ee } from "./chunk-55XCU76K-DkZUAaqC.js";
|
|
5
|
+
var Ct = (function() {
|
|
6
|
+
var t = /* @__PURE__ */ u(function(V, o, d, r) {
|
|
7
|
+
for (d = d || {}, r = V.length; r--; d[V[r]] = o) ;
|
|
8
|
+
return d;
|
|
9
|
+
}, "o"), e = [1, 2], n = [1, 3], s = [1, 4], l = [2, 4], c = [1, 9], p = [1, 11], S = [1, 16], a = [1, 17], m = [1, 18], T = [1, 19], x = [1, 33], L = [1, 20], R = [1, 21], v = [1, 22], f = [1, 23], w = [1, 24], D = [1, 26], F = [1, 27], I = [1, 28], P = [1, 29], k = [1, 30], H = [1, 31], rt = [1, 32], at = [1, 35], nt = [1, 36], ot = [1, 37], lt = [1, 38], z = [1, 34], g = [1, 4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], ct = [1, 4, 5, 14, 15, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 39, 40, 41, 45, 48, 51, 52, 53, 54, 57], wt = [4, 5, 16, 17, 19, 21, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], yt = {
|
|
10
|
+
trace: /* @__PURE__ */ u(function() {
|
|
11
|
+
}, "trace"),
|
|
12
|
+
yy: {},
|
|
13
|
+
symbols_: { error: 2, start: 3, SPACE: 4, NL: 5, SD: 6, document: 7, line: 8, statement: 9, classDefStatement: 10, styleStatement: 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, CLICK: 38, STRING: 39, HREF: 40, classDef: 41, CLASSDEF_ID: 42, CLASSDEF_STYLEOPTS: 43, DEFAULT: 44, style: 45, STYLE_IDS: 46, STYLEDEF_STYLEOPTS: 47, class: 48, CLASSENTITY_IDS: 49, STYLECLASS: 50, direction_tb: 51, direction_bt: 52, direction_rl: 53, direction_lr: 54, eol: 55, ";": 56, EDGE_STATE: 57, STYLE_SEPARATOR: 58, left_of: 59, right_of: 60, $accept: 0, $end: 1 },
|
|
14
|
+
terminals_: { 2: "error", 4: "SPACE", 5: "NL", 6: "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: "CLICK", 39: "STRING", 40: "HREF", 41: "classDef", 42: "CLASSDEF_ID", 43: "CLASSDEF_STYLEOPTS", 44: "DEFAULT", 45: "style", 46: "STYLE_IDS", 47: "STYLEDEF_STYLEOPTS", 48: "class", 49: "CLASSENTITY_IDS", 50: "STYLECLASS", 51: "direction_tb", 52: "direction_bt", 53: "direction_rl", 54: "direction_lr", 56: ";", 57: "EDGE_STATE", 58: "STYLE_SEPARATOR", 59: "left_of", 60: "right_of" },
|
|
15
|
+
productions_: [0, [3, 2], [3, 2], [3, 2], [7, 0], [7, 2], [8, 2], [8, 1], [8, 1], [9, 1], [9, 1], [9, 1], [9, 1], [9, 2], [9, 3], [9, 4], [9, 1], [9, 2], [9, 1], [9, 4], [9, 3], [9, 6], [9, 1], [9, 1], [9, 1], [9, 1], [9, 4], [9, 4], [9, 1], [9, 2], [9, 2], [9, 1], [9, 5], [9, 5], [10, 3], [10, 3], [11, 3], [12, 3], [32, 1], [32, 1], [32, 1], [32, 1], [55, 1], [55, 1], [13, 1], [13, 1], [13, 3], [13, 3], [30, 1], [30, 1]],
|
|
16
|
+
performAction: /* @__PURE__ */ u(function(o, d, r, y, E, i, B) {
|
|
17
|
+
var h = i.length - 1;
|
|
18
|
+
switch (E) {
|
|
19
|
+
case 3:
|
|
20
|
+
return y.setRootDoc(i[h]), i[h];
|
|
21
|
+
case 4:
|
|
22
|
+
this.$ = [];
|
|
23
|
+
break;
|
|
24
|
+
case 5:
|
|
25
|
+
i[h] != "nl" && (i[h - 1].push(i[h]), this.$ = i[h - 1]);
|
|
26
|
+
break;
|
|
27
|
+
case 6:
|
|
28
|
+
case 7:
|
|
29
|
+
this.$ = i[h];
|
|
30
|
+
break;
|
|
31
|
+
case 8:
|
|
32
|
+
this.$ = "nl";
|
|
33
|
+
break;
|
|
34
|
+
case 12:
|
|
35
|
+
this.$ = i[h];
|
|
36
|
+
break;
|
|
37
|
+
case 13:
|
|
38
|
+
const Q = i[h - 1];
|
|
39
|
+
Q.description = y.trimColon(i[h]), this.$ = Q;
|
|
40
|
+
break;
|
|
41
|
+
case 14:
|
|
42
|
+
this.$ = { stmt: "relation", state1: i[h - 2], state2: i[h] };
|
|
43
|
+
break;
|
|
44
|
+
case 15:
|
|
45
|
+
const mt = y.trimColon(i[h]);
|
|
46
|
+
this.$ = { stmt: "relation", state1: i[h - 3], state2: i[h - 1], description: mt };
|
|
47
|
+
break;
|
|
48
|
+
case 19:
|
|
49
|
+
this.$ = { stmt: "state", id: i[h - 3], type: "default", description: "", doc: i[h - 1] };
|
|
50
|
+
break;
|
|
51
|
+
case 20:
|
|
52
|
+
var G = i[h], K = i[h - 2].trim();
|
|
53
|
+
if (i[h].match(":")) {
|
|
54
|
+
var dt = i[h].split(":");
|
|
55
|
+
G = dt[0], K = [K, dt[1]];
|
|
56
|
+
}
|
|
57
|
+
this.$ = { stmt: "state", id: G, type: "default", description: K };
|
|
58
|
+
break;
|
|
59
|
+
case 21:
|
|
60
|
+
this.$ = { stmt: "state", id: i[h - 3], type: "default", description: i[h - 5], doc: i[h - 1] };
|
|
61
|
+
break;
|
|
62
|
+
case 22:
|
|
63
|
+
this.$ = { stmt: "state", id: i[h], type: "fork" };
|
|
64
|
+
break;
|
|
65
|
+
case 23:
|
|
66
|
+
this.$ = { stmt: "state", id: i[h], type: "join" };
|
|
67
|
+
break;
|
|
68
|
+
case 24:
|
|
69
|
+
this.$ = { stmt: "state", id: i[h], type: "choice" };
|
|
70
|
+
break;
|
|
71
|
+
case 25:
|
|
72
|
+
this.$ = { stmt: "state", id: y.getDividerId(), type: "divider" };
|
|
73
|
+
break;
|
|
74
|
+
case 26:
|
|
75
|
+
this.$ = { stmt: "state", id: i[h - 1].trim(), note: { position: i[h - 2].trim(), text: i[h].trim() } };
|
|
76
|
+
break;
|
|
77
|
+
case 29:
|
|
78
|
+
this.$ = i[h].trim(), y.setAccTitle(this.$);
|
|
79
|
+
break;
|
|
80
|
+
case 30:
|
|
81
|
+
case 31:
|
|
82
|
+
this.$ = i[h].trim(), y.setAccDescription(this.$);
|
|
83
|
+
break;
|
|
84
|
+
case 32:
|
|
85
|
+
this.$ = {
|
|
86
|
+
stmt: "click",
|
|
87
|
+
id: i[h - 3],
|
|
88
|
+
url: i[h - 2],
|
|
89
|
+
tooltip: i[h - 1]
|
|
90
|
+
};
|
|
91
|
+
break;
|
|
92
|
+
case 33:
|
|
93
|
+
this.$ = {
|
|
94
|
+
stmt: "click",
|
|
95
|
+
id: i[h - 3],
|
|
96
|
+
url: i[h - 1],
|
|
97
|
+
tooltip: ""
|
|
98
|
+
};
|
|
99
|
+
break;
|
|
100
|
+
case 34:
|
|
101
|
+
case 35:
|
|
102
|
+
this.$ = { stmt: "classDef", id: i[h - 1].trim(), classes: i[h].trim() };
|
|
103
|
+
break;
|
|
104
|
+
case 36:
|
|
105
|
+
this.$ = { stmt: "style", id: i[h - 1].trim(), styleClass: i[h].trim() };
|
|
106
|
+
break;
|
|
107
|
+
case 37:
|
|
108
|
+
this.$ = { stmt: "applyClass", id: i[h - 1].trim(), styleClass: i[h].trim() };
|
|
109
|
+
break;
|
|
110
|
+
case 38:
|
|
111
|
+
y.setDirection("TB"), this.$ = { stmt: "dir", value: "TB" };
|
|
112
|
+
break;
|
|
113
|
+
case 39:
|
|
114
|
+
y.setDirection("BT"), this.$ = { stmt: "dir", value: "BT" };
|
|
115
|
+
break;
|
|
116
|
+
case 40:
|
|
117
|
+
y.setDirection("RL"), this.$ = { stmt: "dir", value: "RL" };
|
|
118
|
+
break;
|
|
119
|
+
case 41:
|
|
120
|
+
y.setDirection("LR"), this.$ = { stmt: "dir", value: "LR" };
|
|
121
|
+
break;
|
|
122
|
+
case 44:
|
|
123
|
+
case 45:
|
|
124
|
+
this.$ = { stmt: "state", id: i[h].trim(), type: "default", description: "" };
|
|
125
|
+
break;
|
|
126
|
+
case 46:
|
|
127
|
+
this.$ = { stmt: "state", id: i[h - 2].trim(), classes: [i[h].trim()], type: "default", description: "" };
|
|
128
|
+
break;
|
|
129
|
+
case 47:
|
|
130
|
+
this.$ = { stmt: "state", id: i[h - 2].trim(), classes: [i[h].trim()], type: "default", description: "" };
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}, "anonymous"),
|
|
134
|
+
table: [{ 3: 1, 4: e, 5: n, 6: s }, { 1: [3] }, { 3: 5, 4: e, 5: n, 6: s }, { 3: 6, 4: e, 5: n, 6: s }, t([1, 4, 5, 16, 17, 19, 22, 24, 25, 26, 27, 28, 29, 33, 35, 37, 38, 41, 45, 48, 51, 52, 53, 54, 57], l, { 7: 7 }), { 1: [2, 1] }, { 1: [2, 2] }, { 1: [2, 3], 4: c, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: a, 19: m, 22: T, 24: x, 25: L, 26: R, 27: v, 28: f, 29: w, 32: 25, 33: D, 35: F, 37: I, 38: P, 41: k, 45: H, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: z }, t(g, [2, 5]), { 9: 39, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: a, 19: m, 22: T, 24: x, 25: L, 26: R, 27: v, 28: f, 29: w, 32: 25, 33: D, 35: F, 37: I, 38: P, 41: k, 45: H, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: z }, t(g, [2, 7]), t(g, [2, 8]), t(g, [2, 9]), t(g, [2, 10]), t(g, [2, 11]), t(g, [2, 12], { 14: [1, 40], 15: [1, 41] }), t(g, [2, 16]), { 18: [1, 42] }, t(g, [2, 18], { 20: [1, 43] }), { 23: [1, 44] }, t(g, [2, 22]), t(g, [2, 23]), t(g, [2, 24]), t(g, [2, 25]), { 30: 45, 31: [1, 46], 59: [1, 47], 60: [1, 48] }, t(g, [2, 28]), { 34: [1, 49] }, { 36: [1, 50] }, t(g, [2, 31]), { 13: 51, 24: x, 57: z }, { 42: [1, 52], 44: [1, 53] }, { 46: [1, 54] }, { 49: [1, 55] }, t(ct, [2, 44], { 58: [1, 56] }), t(ct, [2, 45], { 58: [1, 57] }), t(g, [2, 38]), t(g, [2, 39]), t(g, [2, 40]), t(g, [2, 41]), t(g, [2, 6]), t(g, [2, 13]), { 13: 58, 24: x, 57: z }, t(g, [2, 17]), t(wt, l, { 7: 59 }), { 24: [1, 60] }, { 24: [1, 61] }, { 23: [1, 62] }, { 24: [2, 48] }, { 24: [2, 49] }, t(g, [2, 29]), t(g, [2, 30]), { 39: [1, 63], 40: [1, 64] }, { 43: [1, 65] }, { 43: [1, 66] }, { 47: [1, 67] }, { 50: [1, 68] }, { 24: [1, 69] }, { 24: [1, 70] }, t(g, [2, 14], { 14: [1, 71] }), { 4: c, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: a, 19: m, 21: [1, 72], 22: T, 24: x, 25: L, 26: R, 27: v, 28: f, 29: w, 32: 25, 33: D, 35: F, 37: I, 38: P, 41: k, 45: H, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: z }, t(g, [2, 20], { 20: [1, 73] }), { 31: [1, 74] }, { 24: [1, 75] }, { 39: [1, 76] }, { 39: [1, 77] }, t(g, [2, 34]), t(g, [2, 35]), t(g, [2, 36]), t(g, [2, 37]), t(ct, [2, 46]), t(ct, [2, 47]), t(g, [2, 15]), t(g, [2, 19]), t(wt, l, { 7: 78 }), t(g, [2, 26]), t(g, [2, 27]), { 5: [1, 79] }, { 5: [1, 80] }, { 4: c, 5: p, 8: 8, 9: 10, 10: 12, 11: 13, 12: 14, 13: 15, 16: S, 17: a, 19: m, 21: [1, 81], 22: T, 24: x, 25: L, 26: R, 27: v, 28: f, 29: w, 32: 25, 33: D, 35: F, 37: I, 38: P, 41: k, 45: H, 48: rt, 51: at, 52: nt, 53: ot, 54: lt, 57: z }, t(g, [2, 32]), t(g, [2, 33]), t(g, [2, 21])],
|
|
135
|
+
defaultActions: { 5: [2, 1], 6: [2, 2], 47: [2, 48], 48: [2, 49] },
|
|
136
|
+
parseError: /* @__PURE__ */ u(function(o, d) {
|
|
137
|
+
if (d.recoverable)
|
|
138
|
+
this.trace(o);
|
|
139
|
+
else {
|
|
140
|
+
var r = new Error(o);
|
|
141
|
+
throw r.hash = d, r;
|
|
142
|
+
}
|
|
143
|
+
}, "parseError"),
|
|
144
|
+
parse: /* @__PURE__ */ u(function(o) {
|
|
145
|
+
var d = this, r = [0], y = [], E = [null], i = [], B = this.table, h = "", G = 0, K = 0, dt = 2, Q = 1, mt = i.slice.call(arguments, 1), b = Object.create(this.lexer), W = { yy: {} };
|
|
146
|
+
for (var Tt in this.yy)
|
|
147
|
+
Object.prototype.hasOwnProperty.call(this.yy, Tt) && (W.yy[Tt] = this.yy[Tt]);
|
|
148
|
+
b.setInput(o, W.yy), W.yy.lexer = b, W.yy.parser = this, typeof b.yylloc > "u" && (b.yylloc = {});
|
|
149
|
+
var Et = b.yylloc;
|
|
150
|
+
i.push(Et);
|
|
151
|
+
var te = b.options && b.options.ranges;
|
|
152
|
+
typeof W.yy.parseError == "function" ? this.parseError = W.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
153
|
+
function ee(N) {
|
|
154
|
+
r.length = r.length - 2 * N, E.length = E.length - N, i.length = i.length - N;
|
|
155
|
+
}
|
|
156
|
+
u(ee, "popStack");
|
|
157
|
+
function It() {
|
|
158
|
+
var N;
|
|
159
|
+
return N = y.pop() || b.lex() || Q, typeof N != "number" && (N instanceof Array && (y = N, N = y.pop()), N = d.symbols_[N] || N), N;
|
|
160
|
+
}
|
|
161
|
+
u(It, "lex");
|
|
162
|
+
for (var A, j, O, _t, X = {}, ut, Y, Nt, ft; ; ) {
|
|
163
|
+
if (j = r[r.length - 1], this.defaultActions[j] ? O = this.defaultActions[j] : ((A === null || typeof A > "u") && (A = It()), O = B[j] && B[j][A]), typeof O > "u" || !O.length || !O[0]) {
|
|
164
|
+
var bt = "";
|
|
165
|
+
ft = [];
|
|
166
|
+
for (ut in B[j])
|
|
167
|
+
this.terminals_[ut] && ut > dt && ft.push("'" + this.terminals_[ut] + "'");
|
|
168
|
+
b.showPosition ? bt = "Parse error on line " + (G + 1) + `:
|
|
169
|
+
` + b.showPosition() + `
|
|
170
|
+
Expecting ` + ft.join(", ") + ", got '" + (this.terminals_[A] || A) + "'" : bt = "Parse error on line " + (G + 1) + ": Unexpected " + (A == Q ? "end of input" : "'" + (this.terminals_[A] || A) + "'"), this.parseError(bt, {
|
|
171
|
+
text: b.match,
|
|
172
|
+
token: this.terminals_[A] || A,
|
|
173
|
+
line: b.yylineno,
|
|
174
|
+
loc: Et,
|
|
175
|
+
expected: ft
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (O[0] instanceof Array && O.length > 1)
|
|
179
|
+
throw new Error("Parse Error: multiple actions possible at state: " + j + ", token: " + A);
|
|
180
|
+
switch (O[0]) {
|
|
181
|
+
case 1:
|
|
182
|
+
r.push(A), E.push(b.yytext), i.push(b.yylloc), r.push(O[1]), A = null, K = b.yyleng, h = b.yytext, G = b.yylineno, Et = b.yylloc;
|
|
183
|
+
break;
|
|
184
|
+
case 2:
|
|
185
|
+
if (Y = this.productions_[O[1]][1], X.$ = E[E.length - Y], X._$ = {
|
|
186
|
+
first_line: i[i.length - (Y || 1)].first_line,
|
|
187
|
+
last_line: i[i.length - 1].last_line,
|
|
188
|
+
first_column: i[i.length - (Y || 1)].first_column,
|
|
189
|
+
last_column: i[i.length - 1].last_column
|
|
190
|
+
}, te && (X._$.range = [
|
|
191
|
+
i[i.length - (Y || 1)].range[0],
|
|
192
|
+
i[i.length - 1].range[1]
|
|
193
|
+
]), _t = this.performAction.apply(X, [
|
|
194
|
+
h,
|
|
195
|
+
K,
|
|
196
|
+
G,
|
|
197
|
+
W.yy,
|
|
198
|
+
O[1],
|
|
199
|
+
E,
|
|
200
|
+
i
|
|
201
|
+
].concat(mt)), typeof _t < "u")
|
|
202
|
+
return _t;
|
|
203
|
+
Y && (r = r.slice(0, -1 * Y * 2), E = E.slice(0, -1 * Y), i = i.slice(0, -1 * Y)), r.push(this.productions_[O[1]][0]), E.push(X.$), i.push(X._$), Nt = B[r[r.length - 2]][r[r.length - 1]], r.push(Nt);
|
|
204
|
+
break;
|
|
205
|
+
case 3:
|
|
206
|
+
return !0;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return !0;
|
|
210
|
+
}, "parse")
|
|
211
|
+
}, Zt = /* @__PURE__ */ (function() {
|
|
212
|
+
var V = {
|
|
213
|
+
EOF: 1,
|
|
214
|
+
parseError: /* @__PURE__ */ u(function(d, r) {
|
|
215
|
+
if (this.yy.parser)
|
|
216
|
+
this.yy.parser.parseError(d, r);
|
|
217
|
+
else
|
|
218
|
+
throw new Error(d);
|
|
219
|
+
}, "parseError"),
|
|
220
|
+
// resets the lexer, sets new input
|
|
221
|
+
setInput: /* @__PURE__ */ u(function(o, d) {
|
|
222
|
+
return this.yy = d || this.yy || {}, this._input = o, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
223
|
+
first_line: 1,
|
|
224
|
+
first_column: 0,
|
|
225
|
+
last_line: 1,
|
|
226
|
+
last_column: 0
|
|
227
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
228
|
+
}, "setInput"),
|
|
229
|
+
// consumes and returns one char from the input
|
|
230
|
+
input: /* @__PURE__ */ u(function() {
|
|
231
|
+
var o = this._input[0];
|
|
232
|
+
this.yytext += o, this.yyleng++, this.offset++, this.match += o, this.matched += o;
|
|
233
|
+
var d = o.match(/(?:\r\n?|\n).*/g);
|
|
234
|
+
return d ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), o;
|
|
235
|
+
}, "input"),
|
|
236
|
+
// unshifts one char (or a string) into the input
|
|
237
|
+
unput: /* @__PURE__ */ u(function(o) {
|
|
238
|
+
var d = o.length, r = o.split(/(?:\r\n?|\n)/g);
|
|
239
|
+
this._input = o + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - d), this.offset -= d;
|
|
240
|
+
var y = this.match.split(/(?:\r\n?|\n)/g);
|
|
241
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), r.length - 1 && (this.yylineno -= r.length - 1);
|
|
242
|
+
var E = this.yylloc.range;
|
|
243
|
+
return this.yylloc = {
|
|
244
|
+
first_line: this.yylloc.first_line,
|
|
245
|
+
last_line: this.yylineno + 1,
|
|
246
|
+
first_column: this.yylloc.first_column,
|
|
247
|
+
last_column: r ? (r.length === y.length ? this.yylloc.first_column : 0) + y[y.length - r.length].length - r[0].length : this.yylloc.first_column - d
|
|
248
|
+
}, this.options.ranges && (this.yylloc.range = [E[0], E[0] + this.yyleng - d]), this.yyleng = this.yytext.length, this;
|
|
249
|
+
}, "unput"),
|
|
250
|
+
// When called from action, caches matched text and appends it on next action
|
|
251
|
+
more: /* @__PURE__ */ u(function() {
|
|
252
|
+
return this._more = !0, this;
|
|
253
|
+
}, "more"),
|
|
254
|
+
// 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.
|
|
255
|
+
reject: /* @__PURE__ */ u(function() {
|
|
256
|
+
if (this.options.backtrack_lexer)
|
|
257
|
+
this._backtrack = !0;
|
|
258
|
+
else
|
|
259
|
+
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).
|
|
260
|
+
` + this.showPosition(), {
|
|
261
|
+
text: "",
|
|
262
|
+
token: null,
|
|
263
|
+
line: this.yylineno
|
|
264
|
+
});
|
|
265
|
+
return this;
|
|
266
|
+
}, "reject"),
|
|
267
|
+
// retain first n characters of the match
|
|
268
|
+
less: /* @__PURE__ */ u(function(o) {
|
|
269
|
+
this.unput(this.match.slice(o));
|
|
270
|
+
}, "less"),
|
|
271
|
+
// displays already matched input, i.e. for error messages
|
|
272
|
+
pastInput: /* @__PURE__ */ u(function() {
|
|
273
|
+
var o = this.matched.substr(0, this.matched.length - this.match.length);
|
|
274
|
+
return (o.length > 20 ? "..." : "") + o.substr(-20).replace(/\n/g, "");
|
|
275
|
+
}, "pastInput"),
|
|
276
|
+
// displays upcoming input, i.e. for error messages
|
|
277
|
+
upcomingInput: /* @__PURE__ */ u(function() {
|
|
278
|
+
var o = this.match;
|
|
279
|
+
return o.length < 20 && (o += this._input.substr(0, 20 - o.length)), (o.substr(0, 20) + (o.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
280
|
+
}, "upcomingInput"),
|
|
281
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
282
|
+
showPosition: /* @__PURE__ */ u(function() {
|
|
283
|
+
var o = this.pastInput(), d = new Array(o.length + 1).join("-");
|
|
284
|
+
return o + this.upcomingInput() + `
|
|
285
|
+
` + d + "^";
|
|
286
|
+
}, "showPosition"),
|
|
287
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
288
|
+
test_match: /* @__PURE__ */ u(function(o, d) {
|
|
289
|
+
var r, y, E;
|
|
290
|
+
if (this.options.backtrack_lexer && (E = {
|
|
291
|
+
yylineno: this.yylineno,
|
|
292
|
+
yylloc: {
|
|
293
|
+
first_line: this.yylloc.first_line,
|
|
294
|
+
last_line: this.last_line,
|
|
295
|
+
first_column: this.yylloc.first_column,
|
|
296
|
+
last_column: this.yylloc.last_column
|
|
297
|
+
},
|
|
298
|
+
yytext: this.yytext,
|
|
299
|
+
match: this.match,
|
|
300
|
+
matches: this.matches,
|
|
301
|
+
matched: this.matched,
|
|
302
|
+
yyleng: this.yyleng,
|
|
303
|
+
offset: this.offset,
|
|
304
|
+
_more: this._more,
|
|
305
|
+
_input: this._input,
|
|
306
|
+
yy: this.yy,
|
|
307
|
+
conditionStack: this.conditionStack.slice(0),
|
|
308
|
+
done: this.done
|
|
309
|
+
}, this.options.ranges && (E.yylloc.range = this.yylloc.range.slice(0))), y = o[0].match(/(?:\r\n?|\n).*/g), y && (this.yylineno += y.length), this.yylloc = {
|
|
310
|
+
first_line: this.yylloc.last_line,
|
|
311
|
+
last_line: this.yylineno + 1,
|
|
312
|
+
first_column: this.yylloc.last_column,
|
|
313
|
+
last_column: y ? y[y.length - 1].length - y[y.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + o[0].length
|
|
314
|
+
}, this.yytext += o[0], this.match += o[0], this.matches = o, 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(o[0].length), this.matched += o[0], r = this.performAction.call(this, this.yy, this, d, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), r)
|
|
315
|
+
return r;
|
|
316
|
+
if (this._backtrack) {
|
|
317
|
+
for (var i in E)
|
|
318
|
+
this[i] = E[i];
|
|
319
|
+
return !1;
|
|
320
|
+
}
|
|
321
|
+
return !1;
|
|
322
|
+
}, "test_match"),
|
|
323
|
+
// return next match in input
|
|
324
|
+
next: /* @__PURE__ */ u(function() {
|
|
325
|
+
if (this.done)
|
|
326
|
+
return this.EOF;
|
|
327
|
+
this._input || (this.done = !0);
|
|
328
|
+
var o, d, r, y;
|
|
329
|
+
this._more || (this.yytext = "", this.match = "");
|
|
330
|
+
for (var E = this._currentRules(), i = 0; i < E.length; i++)
|
|
331
|
+
if (r = this._input.match(this.rules[E[i]]), r && (!d || r[0].length > d[0].length)) {
|
|
332
|
+
if (d = r, y = i, this.options.backtrack_lexer) {
|
|
333
|
+
if (o = this.test_match(r, E[i]), o !== !1)
|
|
334
|
+
return o;
|
|
335
|
+
if (this._backtrack) {
|
|
336
|
+
d = !1;
|
|
337
|
+
continue;
|
|
338
|
+
} else
|
|
339
|
+
return !1;
|
|
340
|
+
} else if (!this.options.flex)
|
|
341
|
+
break;
|
|
342
|
+
}
|
|
343
|
+
return d ? (o = this.test_match(d, E[y]), o !== !1 ? o : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
344
|
+
` + this.showPosition(), {
|
|
345
|
+
text: "",
|
|
346
|
+
token: null,
|
|
347
|
+
line: this.yylineno
|
|
348
|
+
});
|
|
349
|
+
}, "next"),
|
|
350
|
+
// return next match that has a token
|
|
351
|
+
lex: /* @__PURE__ */ u(function() {
|
|
352
|
+
var d = this.next();
|
|
353
|
+
return d || this.lex();
|
|
354
|
+
}, "lex"),
|
|
355
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
356
|
+
begin: /* @__PURE__ */ u(function(d) {
|
|
357
|
+
this.conditionStack.push(d);
|
|
358
|
+
}, "begin"),
|
|
359
|
+
// pop the previously active lexer condition state off the condition stack
|
|
360
|
+
popState: /* @__PURE__ */ u(function() {
|
|
361
|
+
var d = this.conditionStack.length - 1;
|
|
362
|
+
return d > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
363
|
+
}, "popState"),
|
|
364
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
365
|
+
_currentRules: /* @__PURE__ */ u(function() {
|
|
366
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
367
|
+
}, "_currentRules"),
|
|
368
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
369
|
+
topState: /* @__PURE__ */ u(function(d) {
|
|
370
|
+
return d = this.conditionStack.length - 1 - Math.abs(d || 0), d >= 0 ? this.conditionStack[d] : "INITIAL";
|
|
371
|
+
}, "topState"),
|
|
372
|
+
// alias for begin(condition)
|
|
373
|
+
pushState: /* @__PURE__ */ u(function(d) {
|
|
374
|
+
this.begin(d);
|
|
375
|
+
}, "pushState"),
|
|
376
|
+
// return the number of states currently on the stack
|
|
377
|
+
stateStackSize: /* @__PURE__ */ u(function() {
|
|
378
|
+
return this.conditionStack.length;
|
|
379
|
+
}, "stateStackSize"),
|
|
380
|
+
options: { "case-insensitive": !0 },
|
|
381
|
+
performAction: /* @__PURE__ */ u(function(d, r, y, E) {
|
|
382
|
+
function i() {
|
|
383
|
+
const B = r.yytext.indexOf("%%");
|
|
384
|
+
if (B === 0)
|
|
385
|
+
return !1;
|
|
386
|
+
if (B > 0) {
|
|
387
|
+
const h = r.yytext.slice(0, B), G = r.yytext.slice(B);
|
|
388
|
+
G && d.lexer.unput(G), r.yytext = h;
|
|
389
|
+
}
|
|
390
|
+
return !0;
|
|
391
|
+
}
|
|
392
|
+
switch (u(i, "processId"), y) {
|
|
393
|
+
case 0:
|
|
394
|
+
return 38;
|
|
395
|
+
case 1:
|
|
396
|
+
return 40;
|
|
397
|
+
case 2:
|
|
398
|
+
return 39;
|
|
399
|
+
case 3:
|
|
400
|
+
return 44;
|
|
401
|
+
case 4:
|
|
402
|
+
return 51;
|
|
403
|
+
case 5:
|
|
404
|
+
return 52;
|
|
405
|
+
case 6:
|
|
406
|
+
return 53;
|
|
407
|
+
case 7:
|
|
408
|
+
return 54;
|
|
409
|
+
case 8:
|
|
410
|
+
return 5;
|
|
411
|
+
case 9:
|
|
412
|
+
break;
|
|
413
|
+
case 10:
|
|
414
|
+
break;
|
|
415
|
+
case 11:
|
|
416
|
+
break;
|
|
417
|
+
case 12:
|
|
418
|
+
break;
|
|
419
|
+
case 13:
|
|
420
|
+
return this.pushState("SCALE"), 17;
|
|
421
|
+
case 14:
|
|
422
|
+
return 18;
|
|
423
|
+
case 15:
|
|
424
|
+
this.popState();
|
|
425
|
+
break;
|
|
426
|
+
case 16:
|
|
427
|
+
return this.begin("acc_title"), 33;
|
|
428
|
+
case 17:
|
|
429
|
+
return this.popState(), "acc_title_value";
|
|
430
|
+
case 18:
|
|
431
|
+
return this.begin("acc_descr"), 35;
|
|
432
|
+
case 19:
|
|
433
|
+
return this.popState(), "acc_descr_value";
|
|
434
|
+
case 20:
|
|
435
|
+
this.begin("acc_descr_multiline");
|
|
436
|
+
break;
|
|
437
|
+
case 21:
|
|
438
|
+
this.popState();
|
|
439
|
+
break;
|
|
440
|
+
case 22:
|
|
441
|
+
return "acc_descr_multiline_value";
|
|
442
|
+
case 23:
|
|
443
|
+
return this.pushState("CLASSDEF"), 41;
|
|
444
|
+
case 24:
|
|
445
|
+
return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
|
|
446
|
+
case 25:
|
|
447
|
+
return this.popState(), this.pushState("CLASSDEFID"), 42;
|
|
448
|
+
case 26:
|
|
449
|
+
return this.popState(), 43;
|
|
450
|
+
case 27:
|
|
451
|
+
return this.pushState("CLASS"), 48;
|
|
452
|
+
case 28:
|
|
453
|
+
return this.popState(), this.pushState("CLASS_STYLE"), 49;
|
|
454
|
+
case 29:
|
|
455
|
+
return this.popState(), 50;
|
|
456
|
+
case 30:
|
|
457
|
+
return this.pushState("STYLE"), 45;
|
|
458
|
+
case 31:
|
|
459
|
+
return this.popState(), this.pushState("STYLEDEF_STYLES"), 46;
|
|
460
|
+
case 32:
|
|
461
|
+
return this.popState(), 47;
|
|
462
|
+
case 33:
|
|
463
|
+
return this.pushState("SCALE"), 17;
|
|
464
|
+
case 34:
|
|
465
|
+
return 18;
|
|
466
|
+
case 35:
|
|
467
|
+
this.popState();
|
|
468
|
+
break;
|
|
469
|
+
case 36:
|
|
470
|
+
this.pushState("STATE");
|
|
471
|
+
break;
|
|
472
|
+
case 37:
|
|
473
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 25;
|
|
474
|
+
case 38:
|
|
475
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 26;
|
|
476
|
+
case 39:
|
|
477
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -10).trim(), 27;
|
|
478
|
+
case 40:
|
|
479
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 25;
|
|
480
|
+
case 41:
|
|
481
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 26;
|
|
482
|
+
case 42:
|
|
483
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -10).trim(), 27;
|
|
484
|
+
case 43:
|
|
485
|
+
return 51;
|
|
486
|
+
case 44:
|
|
487
|
+
return 52;
|
|
488
|
+
case 45:
|
|
489
|
+
return 53;
|
|
490
|
+
case 46:
|
|
491
|
+
return 54;
|
|
492
|
+
case 47:
|
|
493
|
+
this.pushState("STATE_STRING");
|
|
494
|
+
break;
|
|
495
|
+
case 48:
|
|
496
|
+
return this.pushState("STATE_ID"), "AS";
|
|
497
|
+
case 49:
|
|
498
|
+
return i() ? (this.popState(), "ID") : void 0;
|
|
499
|
+
case 50:
|
|
500
|
+
this.popState();
|
|
501
|
+
break;
|
|
502
|
+
case 51:
|
|
503
|
+
return "STATE_DESCR";
|
|
504
|
+
case 52:
|
|
505
|
+
throw new Error('Error: State name must be a single word. Found: "' + r.yytext.trim() + '"');
|
|
506
|
+
case 53:
|
|
507
|
+
return 19;
|
|
508
|
+
case 54:
|
|
509
|
+
this.popState();
|
|
510
|
+
break;
|
|
511
|
+
case 55:
|
|
512
|
+
return this.popState(), this.pushState("struct"), 20;
|
|
513
|
+
case 56:
|
|
514
|
+
return this.popState(), 21;
|
|
515
|
+
case 57:
|
|
516
|
+
break;
|
|
517
|
+
case 58:
|
|
518
|
+
return this.begin("NOTE"), 29;
|
|
519
|
+
case 59:
|
|
520
|
+
return this.popState(), this.pushState("NOTE_ID"), 59;
|
|
521
|
+
case 60:
|
|
522
|
+
return this.popState(), this.pushState("NOTE_ID"), 60;
|
|
523
|
+
case 61:
|
|
524
|
+
this.popState(), this.pushState("FLOATING_NOTE");
|
|
525
|
+
break;
|
|
526
|
+
case 62:
|
|
527
|
+
return this.popState(), this.pushState("FLOATING_NOTE_ID"), "AS";
|
|
528
|
+
case 63:
|
|
529
|
+
break;
|
|
530
|
+
case 64:
|
|
531
|
+
return "NOTE_TEXT";
|
|
532
|
+
case 65:
|
|
533
|
+
return i() ? (this.popState(), "ID") : void 0;
|
|
534
|
+
case 66:
|
|
535
|
+
return i() ? (this.popState(), this.pushState("NOTE_TEXT"), 24) : void 0;
|
|
536
|
+
case 67:
|
|
537
|
+
return this.popState(), r.yytext = r.yytext.substr(2).trim(), 31;
|
|
538
|
+
case 68:
|
|
539
|
+
return this.popState(), r.yytext = r.yytext.slice(0, -8).trim(), 31;
|
|
540
|
+
case 69:
|
|
541
|
+
return 6;
|
|
542
|
+
case 70:
|
|
543
|
+
return 6;
|
|
544
|
+
case 71:
|
|
545
|
+
return 16;
|
|
546
|
+
case 72:
|
|
547
|
+
return 57;
|
|
548
|
+
case 73:
|
|
549
|
+
return i() ? 24 : void 0;
|
|
550
|
+
case 74:
|
|
551
|
+
return r.yytext = r.yytext.trim(), 14;
|
|
552
|
+
case 75:
|
|
553
|
+
return 15;
|
|
554
|
+
case 76:
|
|
555
|
+
return 28;
|
|
556
|
+
case 77:
|
|
557
|
+
return 58;
|
|
558
|
+
case 78:
|
|
559
|
+
return 5;
|
|
560
|
+
case 79:
|
|
561
|
+
return "INVALID";
|
|
562
|
+
}
|
|
563
|
+
}, "anonymous"),
|
|
564
|
+
rules: [/^(?:click\b)/i, /^(?:href\b)/i, /^(?:"[^"]*")/i, /^(?:default\b)/i, /^(?:.*direction\s+TB[^\n]*)/i, /^(?:.*direction\s+BT[^\n]*)/i, /^(?:.*direction\s+RL[^\n]*)/i, /^(?:.*direction\s+LR[^\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, /^(?:style\s+)/i, /^(?:[\w,]+\s+)/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, /^(?:\w+\s+\w+.*?\{)/i, /^(?:[^\n\s\{]+)/i, /^(?:\n)/i, /^(?:\{)/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]*?\n\s*end note\b)/i, /^(?:stateDiagram\s+)/i, /^(?:stateDiagram-v2\s+)/i, /^(?:hide empty description\b)/i, /^(?:\[\*\])/i, /^(?:[^:\n\s\-\{]+)/i, /^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i, /^(?:-->)/i, /^(?:--)/i, /^(?::::)/i, /^(?:$)/i, /^(?:.)/i],
|
|
565
|
+
conditions: { LINE: { rules: [10, 11, 12], inclusive: !1 }, struct: { rules: [10, 11, 12, 23, 27, 30, 36, 43, 44, 45, 46, 56, 57, 58, 72, 73, 74, 75, 76, 77], inclusive: !1 }, FLOATING_NOTE_ID: { rules: [65], inclusive: !1 }, FLOATING_NOTE: { rules: [62, 63, 64], inclusive: !1 }, NOTE_TEXT: { rules: [67, 68], inclusive: !1 }, NOTE_ID: { rules: [66], inclusive: !1 }, NOTE: { rules: [59, 60, 61], inclusive: !1 }, STYLEDEF_STYLEOPTS: { rules: [], inclusive: !1 }, STYLEDEF_STYLES: { rules: [32], inclusive: !1 }, STYLE_IDS: { rules: [], inclusive: !1 }, STYLE: { rules: [31], inclusive: !1 }, CLASS_STYLE: { rules: [29], inclusive: !1 }, CLASS: { rules: [28], inclusive: !1 }, CLASSDEFID: { rules: [26], inclusive: !1 }, CLASSDEF: { rules: [24, 25], inclusive: !1 }, acc_descr_multiline: { rules: [21, 22], inclusive: !1 }, acc_descr: { rules: [19], inclusive: !1 }, acc_title: { rules: [17], inclusive: !1 }, SCALE: { rules: [14, 15, 34, 35], inclusive: !1 }, ALIAS: { rules: [], inclusive: !1 }, STATE_ID: { rules: [49], inclusive: !1 }, STATE_STRING: { rules: [50, 51], inclusive: !1 }, FORK_STATE: { rules: [], inclusive: !1 }, STATE: { rules: [10, 11, 12, 37, 38, 39, 40, 41, 42, 47, 48, 52, 53, 54, 55], inclusive: !1 }, ID: { rules: [10, 11, 12], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 16, 18, 20, 23, 27, 30, 33, 36, 55, 58, 69, 70, 71, 72, 73, 74, 75, 77, 78, 79], inclusive: !0 } }
|
|
566
|
+
};
|
|
567
|
+
return V;
|
|
568
|
+
})();
|
|
569
|
+
yt.lexer = Zt;
|
|
570
|
+
function ht() {
|
|
571
|
+
this.yy = {};
|
|
572
|
+
}
|
|
573
|
+
return u(ht, "Parser"), ht.prototype = yt, yt.Parser = ht, new ht();
|
|
574
|
+
})();
|
|
575
|
+
Ct.parser = Ct;
|
|
576
|
+
var _e = Ct, be = "TB", Gt = "TB", Rt = "dir", q = "state", J = "root", At = "relation", ke = "classDef", ve = "style", De = "applyClass", st = "default", Yt = "divider", Vt = "fill:none", Mt = "fill: #333", Wt = "c", jt = "markdown", Ut = "normal", vt = "rect", Dt = "rectWithTitle", Ce = "stateStart", Ae = "stateEnd", xt = "divider", Ot = "roundedWithTitle", xe = "note", Le = "noteGroup", it = "statediagram", we = "state", Ie = `${it}-${we}`, Ht = "transition", Ne = "note", Re = "note-edge", Oe = `${Ht} ${Re}`, $e = `${it}-${Ne}`, Fe = "cluster", Pe = `${it}-${Fe}`, Be = "cluster-alt", Ge = `${it}-${Be}`, zt = "parent", Kt = "note", Ye = "state", Lt = "----", Ve = `${Lt}${Kt}`, $t = `${Lt}${zt}`, St = /* @__PURE__ */ new Map(), M = 0, Xt = 0, Z = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ u((t, e, n, s) => {
|
|
577
|
+
if (t === xt && n?.id !== void 0 && Z.has(n.id)) {
|
|
578
|
+
const p = Z.get(n.id);
|
|
579
|
+
return Z.set(e, p), p;
|
|
580
|
+
}
|
|
581
|
+
const l = Xt++, c = s ? void 0 : l;
|
|
582
|
+
return Z.set(e, c), c;
|
|
583
|
+
}, "colorSlotFor");
|
|
584
|
+
function gt(t = "", e = 0, n = "", s = Lt) {
|
|
585
|
+
const l = n !== null && n.length > 0 ? `${s}${n}` : "";
|
|
586
|
+
return `${Ye}-${t}${l}-${e}`;
|
|
587
|
+
}
|
|
588
|
+
u(gt, "stateDomId");
|
|
589
|
+
var We = /* @__PURE__ */ u((t, e, n, s, l, c, p, S) => {
|
|
590
|
+
_.trace("items", e), e.forEach((a) => {
|
|
591
|
+
switch (a.stmt) {
|
|
592
|
+
case q:
|
|
593
|
+
et(t, a, n, s, l, c, p, S);
|
|
594
|
+
break;
|
|
595
|
+
case st:
|
|
596
|
+
et(t, a, n, s, l, c, p, S);
|
|
597
|
+
break;
|
|
598
|
+
case At:
|
|
599
|
+
{
|
|
600
|
+
et(
|
|
601
|
+
t,
|
|
602
|
+
a.state1,
|
|
603
|
+
n,
|
|
604
|
+
s,
|
|
605
|
+
l,
|
|
606
|
+
c,
|
|
607
|
+
p,
|
|
608
|
+
S
|
|
609
|
+
), et(
|
|
610
|
+
t,
|
|
611
|
+
a.state2,
|
|
612
|
+
n,
|
|
613
|
+
s,
|
|
614
|
+
l,
|
|
615
|
+
c,
|
|
616
|
+
p,
|
|
617
|
+
S
|
|
618
|
+
);
|
|
619
|
+
const m = p === "neo", T = {
|
|
620
|
+
id: "edge" + M,
|
|
621
|
+
start: a.state1.id,
|
|
622
|
+
end: a.state2.id,
|
|
623
|
+
arrowhead: "normal",
|
|
624
|
+
arrowTypeEnd: m ? "arrow_barb_neo" : "arrow_barb",
|
|
625
|
+
style: Vt,
|
|
626
|
+
labelStyle: "",
|
|
627
|
+
label: U.sanitizeText(a.description ?? "", $()),
|
|
628
|
+
arrowheadStyle: Mt,
|
|
629
|
+
labelpos: Wt,
|
|
630
|
+
labelType: jt,
|
|
631
|
+
thickness: Ut,
|
|
632
|
+
classes: Ht,
|
|
633
|
+
look: p
|
|
634
|
+
};
|
|
635
|
+
l.push(T), M++;
|
|
636
|
+
}
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
});
|
|
640
|
+
}, "setupDoc"), Ft = /* @__PURE__ */ u((t, e = Gt) => {
|
|
641
|
+
let n = e;
|
|
642
|
+
if (t.doc)
|
|
643
|
+
for (const s of t.doc)
|
|
644
|
+
s.stmt === "dir" && (n = s.value);
|
|
645
|
+
return n;
|
|
646
|
+
}, "getDir");
|
|
647
|
+
function tt(t, e, n) {
|
|
648
|
+
if (!e.id || e.id === "</join></fork>" || e.id === "</choice>")
|
|
649
|
+
return;
|
|
650
|
+
e.cssClasses && (Array.isArray(e.cssCompiledStyles) || (e.cssCompiledStyles = []), e.cssClasses.split(" ").forEach((l) => {
|
|
651
|
+
const c = n.get(l);
|
|
652
|
+
c && (e.cssCompiledStyles = [...e.cssCompiledStyles ?? [], ...c.styles]);
|
|
653
|
+
}));
|
|
654
|
+
const s = t.find((l) => l.id === e.id);
|
|
655
|
+
s ? Object.assign(s, e) : t.push(e);
|
|
656
|
+
}
|
|
657
|
+
u(tt, "insertOrUpdateNode");
|
|
658
|
+
function Jt(t) {
|
|
659
|
+
return t?.classes?.join(" ") ?? "";
|
|
660
|
+
}
|
|
661
|
+
u(Jt, "getClassesFromDbInfo");
|
|
662
|
+
function qt(t) {
|
|
663
|
+
return t?.styles ?? [];
|
|
664
|
+
}
|
|
665
|
+
u(qt, "getStylesFromDbInfo");
|
|
666
|
+
var et = /* @__PURE__ */ u((t, e, n, s, l, c, p, S) => {
|
|
667
|
+
const a = e.id, m = n.get(a), T = Jt(m), x = qt(m), L = $(), R = T.trim() !== "" || x.length > 0;
|
|
668
|
+
if (_.info("dataFetcher parsedItem", e, m, x), a !== "root") {
|
|
669
|
+
let v = vt;
|
|
670
|
+
e.start === !0 ? v = Ce : e.start === !1 && (v = Ae), e.type !== st && (v = e.type), St.get(a) || St.set(a, {
|
|
671
|
+
id: a,
|
|
672
|
+
shape: v,
|
|
673
|
+
description: U.sanitizeText(a, L),
|
|
674
|
+
cssClasses: `${T} ${Ie}`,
|
|
675
|
+
cssStyles: x
|
|
676
|
+
});
|
|
677
|
+
const f = St.get(a);
|
|
678
|
+
e.description && (Array.isArray(f.description) ? (f.shape = Dt, f.description.push(e.description)) : f.description?.length && f.description.length > 0 ? (f.shape = Dt, f.description === a ? f.description = [e.description] : f.description = [f.description, e.description]) : (f.shape = vt, f.description = e.description), f.description = U.sanitizeTextOrArray(f.description, L)), f.description?.length === 1 && f.shape === Dt && (f.type === "group" ? f.shape = Ot : f.shape = vt), !f.type && e.doc && (_.info("Setting cluster for XCX", a, Ft(e)), f.type = "group", f.isGroup = !0, f.dir = Ft(e), f.shape = e.type === Yt ? xt : Ot, f.colorIndex = Me(f.shape, a, t, R), f.cssClasses = `${f.cssClasses} ${Pe} ${c ? Ge : ""}`);
|
|
679
|
+
const w = {
|
|
680
|
+
labelStyle: "",
|
|
681
|
+
shape: f.shape,
|
|
682
|
+
label: f.description,
|
|
683
|
+
cssClasses: f.cssClasses,
|
|
684
|
+
cssCompiledStyles: [],
|
|
685
|
+
cssStyles: f.cssStyles,
|
|
686
|
+
id: a,
|
|
687
|
+
dir: f.dir,
|
|
688
|
+
domId: gt(a, M),
|
|
689
|
+
type: f.type,
|
|
690
|
+
isGroup: f.type === "group",
|
|
691
|
+
colorIndex: f.colorIndex,
|
|
692
|
+
padding: 8,
|
|
693
|
+
rx: 10,
|
|
694
|
+
ry: 10,
|
|
695
|
+
look: p,
|
|
696
|
+
labelType: "markdown"
|
|
697
|
+
};
|
|
698
|
+
if (w.shape === xt && (w.label = ""), t && t.id !== "root" && (_.trace("Setting node ", a, " to be child of its parent ", t.id), w.parentId = t.id), w.centerLabel = !0, e.note) {
|
|
699
|
+
const D = {
|
|
700
|
+
labelStyle: "",
|
|
701
|
+
shape: xe,
|
|
702
|
+
label: e.note.text,
|
|
703
|
+
labelType: "markdown",
|
|
704
|
+
cssClasses: $e,
|
|
705
|
+
// useHtmlLabels: false,
|
|
706
|
+
cssStyles: [],
|
|
707
|
+
cssCompiledStyles: [],
|
|
708
|
+
id: a + Ve + "-" + M,
|
|
709
|
+
domId: gt(a, M, Kt),
|
|
710
|
+
// A note is a leaf: it is placed inside the note group below, alongside
|
|
711
|
+
// the state it annotates. Inheriting `type`/`isGroup` from that state
|
|
712
|
+
// marked the note as a container when annotating a composite state,
|
|
713
|
+
// and the renderer then looked for a `note` *cluster* shape, which does
|
|
714
|
+
// not exist. dagre only reads `isGroup` for edge hints so it survived;
|
|
715
|
+
// the shared paint path uses it to decide cluster-ness and threw.
|
|
716
|
+
type: "node",
|
|
717
|
+
isGroup: !1,
|
|
718
|
+
padding: L.flowchart?.padding,
|
|
719
|
+
look: p,
|
|
720
|
+
position: e.note.position
|
|
721
|
+
}, F = a + $t, I = {
|
|
722
|
+
labelStyle: "",
|
|
723
|
+
shape: Le,
|
|
724
|
+
label: e.note.text,
|
|
725
|
+
cssClasses: f.cssClasses,
|
|
726
|
+
cssStyles: [],
|
|
727
|
+
id: a + $t,
|
|
728
|
+
domId: gt(a, M, zt),
|
|
729
|
+
type: "group",
|
|
730
|
+
isGroup: !0,
|
|
731
|
+
padding: 16,
|
|
732
|
+
//getConfig().flowchart.padding
|
|
733
|
+
look: p,
|
|
734
|
+
position: e.note.position
|
|
735
|
+
};
|
|
736
|
+
M++, I.id = F, D.parentId = F, tt(s, I, S), tt(s, D, S), tt(s, w, S);
|
|
737
|
+
let P = a, k = D.id;
|
|
738
|
+
e.note.position === "left of" && (P = D.id, k = a), l.push({
|
|
739
|
+
id: P + "-" + k,
|
|
740
|
+
start: P,
|
|
741
|
+
end: k,
|
|
742
|
+
arrowhead: "none",
|
|
743
|
+
arrowTypeEnd: "",
|
|
744
|
+
style: Vt,
|
|
745
|
+
labelStyle: "",
|
|
746
|
+
classes: Oe,
|
|
747
|
+
// The dashes have to be declared on the edge, not only through the `note-edge`
|
|
748
|
+
// class. Under `look: neo`, `insertEdge` writes an *inline* `stroke-dasharray`
|
|
749
|
+
// computed from the path length -- a solid run trimmed at both ends so the arrow
|
|
750
|
+
// markers get their gaps -- and it picks that pattern from `edge.pattern`. An
|
|
751
|
+
// inline style outranks the stylesheet, so a note edge that only carried the class
|
|
752
|
+
// was drawn solid: the `.note-edge` rule was still there and simply lost.
|
|
753
|
+
//
|
|
754
|
+
// Naming the pattern here routes it through the same dash generator every other
|
|
755
|
+
// dashed edge uses, so the marker gaps survive. `classic` is untouched: it writes
|
|
756
|
+
// no inline dasharray, and `.note-edge` still wins over `edge-pattern-dashed`
|
|
757
|
+
// because it is emitted later in the sheet at equal specificity.
|
|
758
|
+
pattern: "dashed",
|
|
759
|
+
arrowheadStyle: Mt,
|
|
760
|
+
labelpos: Wt,
|
|
761
|
+
labelType: jt,
|
|
762
|
+
thickness: Ut,
|
|
763
|
+
look: p
|
|
764
|
+
});
|
|
765
|
+
} else
|
|
766
|
+
tt(s, w, S);
|
|
767
|
+
}
|
|
768
|
+
e.doc && (_.trace("Adding nodes children "), We(e, e.doc, n, s, l, !c, p, S));
|
|
769
|
+
}, "dataFetcher"), je = /* @__PURE__ */ u(() => {
|
|
770
|
+
St.clear(), M = 0, Xt = 0, Z.clear();
|
|
771
|
+
}, "reset"), Qt = /* @__PURE__ */ u((t, e = Gt) => {
|
|
772
|
+
if (!t.doc)
|
|
773
|
+
return e;
|
|
774
|
+
let n = e;
|
|
775
|
+
for (const s of t.doc)
|
|
776
|
+
s.stmt === "dir" && (n = s.value);
|
|
777
|
+
return n;
|
|
778
|
+
}, "getDir"), Ue = /* @__PURE__ */ u(function(t, e) {
|
|
779
|
+
return e.db.getClasses();
|
|
780
|
+
}, "getClasses"), He = /* @__PURE__ */ u(async function(t, e, n, s) {
|
|
781
|
+
_.info("REF0:"), _.info("Drawing state diagram (v2)", e);
|
|
782
|
+
const { securityLevel: l, state: c, layout: p } = $();
|
|
783
|
+
s.db.extract(s.db.getRootDocV2());
|
|
784
|
+
const S = s.db.getData(), a = se(e, l);
|
|
785
|
+
S.type = s.type, S.layoutAlgorithm = re(p), S.nodeSpacing = c?.nodeSpacing || 50, S.rankSpacing = c?.rankSpacing || 50, $().look === "neo" ? S.markers = ["barbNeo"] : S.markers = ["barb"], S.diagramId = e, await ae(S, a);
|
|
786
|
+
const T = 8;
|
|
787
|
+
try {
|
|
788
|
+
(typeof s.db.getLinks == "function" ? s.db.getLinks() : /* @__PURE__ */ new Map()).forEach((L, R) => {
|
|
789
|
+
const v = typeof R == "string" ? R : typeof R?.id == "string" ? R.id : "", f = S.nodes.find((k) => k.id === v);
|
|
790
|
+
if (!v) {
|
|
791
|
+
_.warn("⚠️ Invalid or missing stateId from key:", JSON.stringify(R));
|
|
792
|
+
return;
|
|
793
|
+
}
|
|
794
|
+
const w = a.node()?.querySelectorAll("g.node, g.rough-node");
|
|
795
|
+
let D;
|
|
796
|
+
if (w?.forEach((k) => {
|
|
797
|
+
const H = k.textContent?.trim();
|
|
798
|
+
(k.id === f?.domId || H === v) && (D = k);
|
|
799
|
+
}), !D) {
|
|
800
|
+
_.warn("⚠️ Could not find node matching text:", v);
|
|
801
|
+
return;
|
|
802
|
+
}
|
|
803
|
+
const F = D.parentNode;
|
|
804
|
+
if (!F) {
|
|
805
|
+
_.warn("⚠️ Node has no parent, cannot wrap:", v);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
const I = document.createElementNS("http://www.w3.org/2000/svg", "a"), P = L.url.replace(/^"+|"+$/g, "");
|
|
809
|
+
if (I.setAttributeNS("http://www.w3.org/1999/xlink", "xlink:href", P), I.setAttribute("target", "_blank"), L.tooltip) {
|
|
810
|
+
const k = L.tooltip.replace(/^"+|"+$/g, "");
|
|
811
|
+
I.setAttribute("title", k), D.setAttribute("title", k);
|
|
812
|
+
}
|
|
813
|
+
F.replaceChild(I, D), I.appendChild(D), _.info("🔗 Wrapped node in <a> tag for:", v, L.url);
|
|
814
|
+
});
|
|
815
|
+
} catch (x) {
|
|
816
|
+
_.error("❌ Error injecting clickable links:", x);
|
|
817
|
+
}
|
|
818
|
+
ne.insertTitle(
|
|
819
|
+
a,
|
|
820
|
+
"statediagramTitleText",
|
|
821
|
+
c?.titleTopMargin ?? 25,
|
|
822
|
+
s.db.getDiagramTitle()
|
|
823
|
+
), ie(a, T, it, c?.useMaxWidth ?? !0);
|
|
824
|
+
}, "draw"), ze = {
|
|
825
|
+
getClasses: Ue,
|
|
826
|
+
draw: He,
|
|
827
|
+
getDir: Qt
|
|
828
|
+
}, C = {
|
|
829
|
+
START_NODE: "[*]",
|
|
830
|
+
START_TYPE: "start",
|
|
831
|
+
END_NODE: "[*]",
|
|
832
|
+
END_TYPE: "end",
|
|
833
|
+
COLOR_KEYWORD: "color",
|
|
834
|
+
FILL_KEYWORD: "fill",
|
|
835
|
+
BG_FILL: "bgFill",
|
|
836
|
+
STYLECLASS_SEP: ","
|
|
837
|
+
}, Pt = /* @__PURE__ */ u(() => /* @__PURE__ */ new Map(), "newClassesList"), Bt = /* @__PURE__ */ u(() => ({
|
|
838
|
+
relations: [],
|
|
839
|
+
states: /* @__PURE__ */ new Map(),
|
|
840
|
+
documents: {}
|
|
841
|
+
}), "newDoc"), pt = /* @__PURE__ */ u((t) => JSON.parse(JSON.stringify(t)), "clone"), Ke = class {
|
|
842
|
+
constructor(t) {
|
|
843
|
+
this.version = t, this.nodes = [], this.edges = [], this.rootDoc = [], this.classes = Pt(), this.documents = { root: Bt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.dividerCnt = 0, this.links = /* @__PURE__ */ new Map(), this.funs = [], this.getAccTitle = oe, this.setAccTitle = le, this.getAccDescription = ce, this.setAccDescription = he, this.setDiagramTitle = de, this.getDiagramTitle = ue, this.clear(), this.setRootDoc = this.setRootDoc.bind(this), this.getDividerId = this.getDividerId.bind(this), this.setDirection = this.setDirection.bind(this), this.trimColon = this.trimColon.bind(this), this.bindFunctions = this.bindFunctions.bind(this);
|
|
844
|
+
}
|
|
845
|
+
static {
|
|
846
|
+
u(this, "StateDB");
|
|
847
|
+
}
|
|
848
|
+
static {
|
|
849
|
+
this.relationType = {
|
|
850
|
+
AGGREGATION: 0,
|
|
851
|
+
EXTENSION: 1,
|
|
852
|
+
COMPOSITION: 2,
|
|
853
|
+
DEPENDENCY: 3
|
|
854
|
+
};
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Convert all of the statements (stmts) that were parsed into states and relationships.
|
|
858
|
+
* This is done because a state diagram may have nested sections,
|
|
859
|
+
* where each section is a 'document' and has its own set of statements.
|
|
860
|
+
* Ex: the section within a fork has its own statements, and incoming and outgoing statements
|
|
861
|
+
* refer to the fork as a whole (document).
|
|
862
|
+
* See the parser grammar: the definition of a document is a document then a 'line', where a line can be a statement.
|
|
863
|
+
* This will push the statement into the list of statements for the current document.
|
|
864
|
+
*/
|
|
865
|
+
extract(t) {
|
|
866
|
+
this.clear(!0);
|
|
867
|
+
for (const s of Array.isArray(t) ? t : t.doc)
|
|
868
|
+
switch (s.stmt) {
|
|
869
|
+
case q:
|
|
870
|
+
this.addState(s.id.trim(), s.type, s.doc, s.description, s.note);
|
|
871
|
+
break;
|
|
872
|
+
case At:
|
|
873
|
+
this.addRelation(s.state1, s.state2, s.description);
|
|
874
|
+
break;
|
|
875
|
+
case ke:
|
|
876
|
+
this.addStyleClass(s.id.trim(), s.classes);
|
|
877
|
+
break;
|
|
878
|
+
case ve:
|
|
879
|
+
this.handleStyleDef(s);
|
|
880
|
+
break;
|
|
881
|
+
case De:
|
|
882
|
+
this.setCssClass(s.id.trim(), s.styleClass);
|
|
883
|
+
break;
|
|
884
|
+
case "click":
|
|
885
|
+
this.addLink(s.id, s.url, s.tooltip);
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
const e = this.getStates(), n = $();
|
|
889
|
+
je(), et(
|
|
890
|
+
void 0,
|
|
891
|
+
this.getRootDocV2(),
|
|
892
|
+
e,
|
|
893
|
+
this.nodes,
|
|
894
|
+
this.edges,
|
|
895
|
+
!0,
|
|
896
|
+
n.look,
|
|
897
|
+
this.classes
|
|
898
|
+
);
|
|
899
|
+
for (const s of this.nodes)
|
|
900
|
+
if (Array.isArray(s.label)) {
|
|
901
|
+
if (s.description = s.label.slice(1), s.isGroup && s.description.length > 0)
|
|
902
|
+
throw new Error(
|
|
903
|
+
`Group nodes can only have label. Remove the additional description for node [${s.id}]`
|
|
904
|
+
);
|
|
905
|
+
s.label = s.label[0];
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
handleStyleDef(t) {
|
|
909
|
+
const e = t.id.trim().split(","), n = t.styleClass.split(",");
|
|
910
|
+
for (const s of e) {
|
|
911
|
+
let l = this.getState(s);
|
|
912
|
+
if (!l) {
|
|
913
|
+
const c = s.trim();
|
|
914
|
+
this.addState(c), l = this.getState(c);
|
|
915
|
+
}
|
|
916
|
+
l && (l.styles = n.map((c) => c.replace(/;/g, "")?.trim()));
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
setRootDoc(t) {
|
|
920
|
+
_.info("Setting root doc", t), this.rootDoc = t, this.version === 1 ? this.extract(t) : this.extract(this.getRootDocV2());
|
|
921
|
+
}
|
|
922
|
+
docTranslator(t, e, n) {
|
|
923
|
+
if (e.stmt === At) {
|
|
924
|
+
this.docTranslator(t, e.state1, !0), this.docTranslator(t, e.state2, !1);
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
if (e.stmt === q && (e.id === C.START_NODE ? (e.id = t.id + (n ? "_start" : "_end"), e.start = n) : e.id = e.id.trim()), e.stmt !== J && e.stmt !== q || !e.doc)
|
|
928
|
+
return;
|
|
929
|
+
const s = [];
|
|
930
|
+
let l = [];
|
|
931
|
+
for (const c of e.doc)
|
|
932
|
+
if (c.type === Yt) {
|
|
933
|
+
const p = pt(c);
|
|
934
|
+
p.doc = pt(l), s.push(p), l = [];
|
|
935
|
+
} else
|
|
936
|
+
l.push(c);
|
|
937
|
+
if (s.length > 0 && l.length > 0) {
|
|
938
|
+
const c = {
|
|
939
|
+
stmt: q,
|
|
940
|
+
id: fe(),
|
|
941
|
+
type: "divider",
|
|
942
|
+
doc: pt(l)
|
|
943
|
+
};
|
|
944
|
+
s.push(pt(c)), e.doc = s;
|
|
945
|
+
}
|
|
946
|
+
e.doc.forEach((c) => this.docTranslator(e, c, !0));
|
|
947
|
+
}
|
|
948
|
+
getRootDocV2() {
|
|
949
|
+
return this.docTranslator(
|
|
950
|
+
{ id: J, stmt: J },
|
|
951
|
+
{ id: J, stmt: J, doc: this.rootDoc },
|
|
952
|
+
!0
|
|
953
|
+
), { id: J, doc: this.rootDoc };
|
|
954
|
+
}
|
|
955
|
+
/**
|
|
956
|
+
* Function called by parser when a node definition has been found.
|
|
957
|
+
*
|
|
958
|
+
* @param descr - description for the state. Can be a string or a list or strings
|
|
959
|
+
* @param classes - class styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 class, convert it to an array of that 1 class.
|
|
960
|
+
* @param styles - styles to apply to this state. Can be a string (1 style) or an array of styles. If it's just 1 style, convert it to an array of that 1 style.
|
|
961
|
+
* @param textStyles - text styles to apply to this state. Can be a string (1 text test) or an array of text styles. If it's just 1 text style, convert it to an array of that 1 text style.
|
|
962
|
+
*/
|
|
963
|
+
addState(t, e = st, n = void 0, s = void 0, l = void 0, c = void 0, p = void 0, S = void 0) {
|
|
964
|
+
const a = t?.trim();
|
|
965
|
+
if (!this.currentDocument.states.has(a))
|
|
966
|
+
_.info("Adding state ", a, s), this.currentDocument.states.set(a, {
|
|
967
|
+
stmt: q,
|
|
968
|
+
id: a,
|
|
969
|
+
descriptions: [],
|
|
970
|
+
type: e,
|
|
971
|
+
doc: n,
|
|
972
|
+
note: l,
|
|
973
|
+
classes: [],
|
|
974
|
+
styles: [],
|
|
975
|
+
textStyles: []
|
|
976
|
+
});
|
|
977
|
+
else {
|
|
978
|
+
const m = this.currentDocument.states.get(a);
|
|
979
|
+
if (!m)
|
|
980
|
+
throw new Error(`State not found: ${a}`);
|
|
981
|
+
m.doc || (m.doc = n), m.type || (m.type = e);
|
|
982
|
+
}
|
|
983
|
+
if (s && (_.info("Setting state description", a, s), (Array.isArray(s) ? s : [s]).forEach((T) => this.addDescription(a, T.trim()))), l) {
|
|
984
|
+
const m = this.currentDocument.states.get(a);
|
|
985
|
+
if (!m)
|
|
986
|
+
throw new Error(`State not found: ${a}`);
|
|
987
|
+
m.note = l, m.note.text = U.sanitizeText(m.note.text, $());
|
|
988
|
+
}
|
|
989
|
+
c && (_.info("Setting state classes", a, c), (Array.isArray(c) ? c : [c]).forEach((T) => this.setCssClass(a, T.trim()))), p && (_.info("Setting state styles", a, p), (Array.isArray(p) ? p : [p]).forEach((T) => this.setStyle(a, T.trim()))), S && (_.info("Setting state styles", a, p), (Array.isArray(S) ? S : [S]).forEach((T) => this.setTextStyle(a, T.trim())));
|
|
990
|
+
}
|
|
991
|
+
clear(t) {
|
|
992
|
+
this.nodes = [], this.edges = [], this.funs = [this.setupToolTips.bind(this)], this.documents = { root: Bt() }, this.currentDocument = this.documents.root, this.startEndCount = 0, this.classes = Pt(), t || (this.links = /* @__PURE__ */ new Map(), pe());
|
|
993
|
+
}
|
|
994
|
+
getState(t) {
|
|
995
|
+
return this.currentDocument.states.get(t);
|
|
996
|
+
}
|
|
997
|
+
getStates() {
|
|
998
|
+
return this.currentDocument.states;
|
|
999
|
+
}
|
|
1000
|
+
logDocuments() {
|
|
1001
|
+
_.info("Documents = ", this.documents);
|
|
1002
|
+
}
|
|
1003
|
+
getRelations() {
|
|
1004
|
+
return this.currentDocument.relations;
|
|
1005
|
+
}
|
|
1006
|
+
/**
|
|
1007
|
+
* Adds a clickable link to a state.
|
|
1008
|
+
*/
|
|
1009
|
+
addLink(t, e, n) {
|
|
1010
|
+
this.links.set(t, { url: e, tooltip: n }), _.warn("Adding link", t, e, n);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Get all registered links.
|
|
1014
|
+
*/
|
|
1015
|
+
getLinks() {
|
|
1016
|
+
return this.links;
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* If the id is a start node ( [*] ), then return a new id constructed from
|
|
1020
|
+
* the start node name and the current start node count.
|
|
1021
|
+
* else return the given id
|
|
1022
|
+
*/
|
|
1023
|
+
startIdIfNeeded(t = "") {
|
|
1024
|
+
return t === C.START_NODE ? (this.startEndCount++, `${C.START_TYPE}${this.startEndCount}`) : t;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* If the id is a start node ( [*] ), then return the start type ('start')
|
|
1028
|
+
* else return the given type
|
|
1029
|
+
*/
|
|
1030
|
+
startTypeIfNeeded(t = "", e = st) {
|
|
1031
|
+
return t === C.START_NODE ? C.START_TYPE : e;
|
|
1032
|
+
}
|
|
1033
|
+
/**
|
|
1034
|
+
* If the id is an end node ( [*] ), then return a new id constructed from
|
|
1035
|
+
* the end node name and the current start_end node count.
|
|
1036
|
+
* else return the given id
|
|
1037
|
+
*/
|
|
1038
|
+
endIdIfNeeded(t = "") {
|
|
1039
|
+
return t === C.END_NODE ? (this.startEndCount++, `${C.END_TYPE}${this.startEndCount}`) : t;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* If the id is an end node ( [*] ), then return the end type
|
|
1043
|
+
* else return the given type
|
|
1044
|
+
*
|
|
1045
|
+
*/
|
|
1046
|
+
endTypeIfNeeded(t = "", e = st) {
|
|
1047
|
+
return t === C.END_NODE ? C.END_TYPE : e;
|
|
1048
|
+
}
|
|
1049
|
+
addRelationObjs(t, e, n = "") {
|
|
1050
|
+
const s = this.startIdIfNeeded(t.id.trim()), l = this.startTypeIfNeeded(t.id.trim(), t.type), c = this.startIdIfNeeded(e.id.trim()), p = this.startTypeIfNeeded(e.id.trim(), e.type);
|
|
1051
|
+
this.addState(
|
|
1052
|
+
s,
|
|
1053
|
+
l,
|
|
1054
|
+
t.doc,
|
|
1055
|
+
t.description,
|
|
1056
|
+
t.note,
|
|
1057
|
+
t.classes,
|
|
1058
|
+
t.styles,
|
|
1059
|
+
t.textStyles
|
|
1060
|
+
), this.addState(
|
|
1061
|
+
c,
|
|
1062
|
+
p,
|
|
1063
|
+
e.doc,
|
|
1064
|
+
e.description,
|
|
1065
|
+
e.note,
|
|
1066
|
+
e.classes,
|
|
1067
|
+
e.styles,
|
|
1068
|
+
e.textStyles
|
|
1069
|
+
), this.currentDocument.relations.push({
|
|
1070
|
+
id1: s,
|
|
1071
|
+
id2: c,
|
|
1072
|
+
relationTitle: U.sanitizeText(n, $())
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
/**
|
|
1076
|
+
* Add a relation between two items. The items may be full objects or just the string id of a state.
|
|
1077
|
+
*/
|
|
1078
|
+
addRelation(t, e, n) {
|
|
1079
|
+
if (typeof t == "object" && typeof e == "object")
|
|
1080
|
+
this.addRelationObjs(t, e, n);
|
|
1081
|
+
else if (typeof t == "string" && typeof e == "string") {
|
|
1082
|
+
const s = this.startIdIfNeeded(t.trim()), l = this.startTypeIfNeeded(t), c = this.endIdIfNeeded(e.trim()), p = this.endTypeIfNeeded(e);
|
|
1083
|
+
this.addState(s, l), this.addState(c, p), this.currentDocument.relations.push({
|
|
1084
|
+
id1: s,
|
|
1085
|
+
id2: c,
|
|
1086
|
+
relationTitle: n ? U.sanitizeText(n, $()) : void 0
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
addDescription(t, e) {
|
|
1091
|
+
const n = this.currentDocument.states.get(t), s = e.startsWith(":") ? e.replace(":", "").trim() : e;
|
|
1092
|
+
n?.descriptions?.push(U.sanitizeText(s, $()));
|
|
1093
|
+
}
|
|
1094
|
+
cleanupLabel(t) {
|
|
1095
|
+
return t.startsWith(":") ? t.slice(2).trim() : t.trim();
|
|
1096
|
+
}
|
|
1097
|
+
getDividerId() {
|
|
1098
|
+
return this.dividerCnt++, `divider-id-${this.dividerCnt}`;
|
|
1099
|
+
}
|
|
1100
|
+
/**
|
|
1101
|
+
* Called when the parser comes across a (style) class definition
|
|
1102
|
+
* @example classDef my-style fill:#f96;
|
|
1103
|
+
*
|
|
1104
|
+
* @param id - the id of this (style) class
|
|
1105
|
+
* @param styleAttributes - the string with 1 or more style attributes (each separated by a comma)
|
|
1106
|
+
*/
|
|
1107
|
+
addStyleClass(t, e = "") {
|
|
1108
|
+
this.classes.has(t) || this.classes.set(t, { id: t, styles: [], textStyles: [] });
|
|
1109
|
+
const n = this.classes.get(t);
|
|
1110
|
+
e && n && e.split(C.STYLECLASS_SEP).forEach((s) => {
|
|
1111
|
+
const l = s.replace(/([^;]*);/, "$1").trim();
|
|
1112
|
+
if (RegExp(C.COLOR_KEYWORD).exec(s)) {
|
|
1113
|
+
const p = l.replace(C.FILL_KEYWORD, C.BG_FILL).replace(C.COLOR_KEYWORD, C.FILL_KEYWORD);
|
|
1114
|
+
n.textStyles.push(p);
|
|
1115
|
+
}
|
|
1116
|
+
n.styles.push(l);
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
getClasses() {
|
|
1120
|
+
return this.classes;
|
|
1121
|
+
}
|
|
1122
|
+
setupToolTips(t) {
|
|
1123
|
+
const e = Ee();
|
|
1124
|
+
kt(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover", (l) => {
|
|
1125
|
+
const c = kt(l.currentTarget), p = c.attr("title");
|
|
1126
|
+
if (p === null)
|
|
1127
|
+
return;
|
|
1128
|
+
const S = l.currentTarget?.getBoundingClientRect();
|
|
1129
|
+
e.transition().duration(200).style("opacity", ".9"), e.style("left", window.scrollX + S.left + (S.right - S.left) / 2 + "px").style("top", window.scrollY + S.bottom + "px"), e.html(Se.sanitize(p)), c.classed("hover", !0);
|
|
1130
|
+
}).on("mouseout", (l) => {
|
|
1131
|
+
e.transition().duration(500).style("opacity", 0), kt(l.currentTarget).classed("hover", !1);
|
|
1132
|
+
});
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Add a (style) class or css class to a state with the given id.
|
|
1136
|
+
* If the state isn't already in the list of known states, add it.
|
|
1137
|
+
* Might be called by parser when a style class or CSS class should be applied to a state
|
|
1138
|
+
*
|
|
1139
|
+
* @param itemIds - The id or a list of ids of the item(s) to apply the css class to
|
|
1140
|
+
* @param cssClassName - CSS class name
|
|
1141
|
+
*/
|
|
1142
|
+
setCssClass(t, e) {
|
|
1143
|
+
t.split(",").forEach((n) => {
|
|
1144
|
+
let s = this.getState(n);
|
|
1145
|
+
if (!s) {
|
|
1146
|
+
const l = n.trim();
|
|
1147
|
+
this.addState(l), s = this.getState(l);
|
|
1148
|
+
}
|
|
1149
|
+
s?.classes?.push(e);
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
/**
|
|
1153
|
+
* Add a style to a state with the given id.
|
|
1154
|
+
* @example style stateId fill:#f9f,stroke:#333,stroke-width:4px
|
|
1155
|
+
* where 'style' is the keyword
|
|
1156
|
+
* stateId is the id of a state
|
|
1157
|
+
* the rest of the string is the styleText (all of the attributes to be applied to the state)
|
|
1158
|
+
*
|
|
1159
|
+
* @param itemId - The id of item to apply the style to
|
|
1160
|
+
* @param styleText - the text of the attributes for the style
|
|
1161
|
+
*/
|
|
1162
|
+
setStyle(t, e) {
|
|
1163
|
+
this.getState(t)?.styles?.push(e);
|
|
1164
|
+
}
|
|
1165
|
+
/**
|
|
1166
|
+
* Add a text style to a state with the given id
|
|
1167
|
+
*
|
|
1168
|
+
* @param itemId - The id of item to apply the css class to
|
|
1169
|
+
* @param cssClassName - CSS class name
|
|
1170
|
+
*/
|
|
1171
|
+
setTextStyle(t, e) {
|
|
1172
|
+
this.getState(t)?.textStyles?.push(e);
|
|
1173
|
+
}
|
|
1174
|
+
bindFunctions(t) {
|
|
1175
|
+
this.funs.forEach((e) => {
|
|
1176
|
+
e(t);
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
/**
|
|
1180
|
+
* Finds the direction statement in the root document.
|
|
1181
|
+
* @returns the direction statement if present
|
|
1182
|
+
*/
|
|
1183
|
+
getDirectionStatement() {
|
|
1184
|
+
return this.rootDoc.find((t) => t.stmt === Rt);
|
|
1185
|
+
}
|
|
1186
|
+
getDirection() {
|
|
1187
|
+
return this.getDirectionStatement()?.value ?? be;
|
|
1188
|
+
}
|
|
1189
|
+
setDirection(t) {
|
|
1190
|
+
const e = this.getDirectionStatement();
|
|
1191
|
+
e ? e.value = t : this.rootDoc.unshift({ stmt: Rt, value: t });
|
|
1192
|
+
}
|
|
1193
|
+
trimColon(t) {
|
|
1194
|
+
return t.startsWith(":") ? t.slice(1).trim() : t.trim();
|
|
1195
|
+
}
|
|
1196
|
+
getData() {
|
|
1197
|
+
const t = $();
|
|
1198
|
+
for (const e of this.nodes)
|
|
1199
|
+
e.wrappingWidth ??= t.state?.wrappingWidth, e.isGroup || (e.minWidth ??= t.state?.minNodeWidth);
|
|
1200
|
+
return {
|
|
1201
|
+
nodes: this.nodes,
|
|
1202
|
+
edges: this.edges,
|
|
1203
|
+
other: {},
|
|
1204
|
+
config: t,
|
|
1205
|
+
direction: Qt(this.getRootDocV2())
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
getConfig() {
|
|
1209
|
+
return $().state;
|
|
1210
|
+
}
|
|
1211
|
+
}, Xe = /* @__PURE__ */ u((t) => {
|
|
1212
|
+
const { theme: e, bkgColorArray: n, borderColorArray: s } = t;
|
|
1213
|
+
if (!ge(e, s))
|
|
1214
|
+
return "";
|
|
1215
|
+
const l = ye(t.look), c = me(n);
|
|
1216
|
+
let p = "";
|
|
1217
|
+
for (let S = 0; S < Te(s); S++) {
|
|
1218
|
+
const a = s[S], m = c ? `fill: ${n[S % n.length]};` : "", T = `[data-look="${l}"][data-color-id="color-${S}"]`;
|
|
1219
|
+
p += `
|
|
1220
|
+
|
|
1221
|
+
/* The title strip: \`rect.outer\` spans the whole composite and \`rect.inner\` covers
|
|
1222
|
+
the body, so what stays visible of \`outer\` is the band behind the label. */
|
|
1223
|
+
${T}.statediagram-cluster rect.outer {
|
|
1224
|
+
stroke: ${a};
|
|
1225
|
+
${m}
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
${T}.statediagram-cluster rect.inner {
|
|
1229
|
+
stroke: ${a};
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1232
|
+
/* Concurrency regions. Siblings of one composite share a slot, so a divided composite
|
|
1233
|
+
reads as one thing split into parts rather than as several composites. */
|
|
1234
|
+
${T}.statediagram-cluster rect.divider {
|
|
1235
|
+
stroke: ${a};
|
|
1236
|
+
${m}
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
/* handDrawn draws the same container as roughjs shapes rather than plain rects, so it
|
|
1240
|
+
needs its own rules. \`roundedWithTitle\` and \`divider\` name those groups \`outer\`,
|
|
1241
|
+
\`inner\` and \`divider\` to match the classic branch, which is what lets these
|
|
1242
|
+
discriminate -- a bare \`.statediagram-cluster path\` rule reached the body as well and
|
|
1243
|
+
tinted the whole composite, losing \`compositeBackground\` and diverging from what
|
|
1244
|
+
classic and neo do.
|
|
1245
|
+
|
|
1246
|
+
roughjs emits two paths per shape and marks them: the filled shape carries
|
|
1247
|
+
\`stroke="none"\` and the sketched outline carries \`fill="none"\`. Splitting on that is
|
|
1248
|
+
what keeps \`fill\` off the outline -- a rough outline is open squiggles, not a closed
|
|
1249
|
+
region, so filling it produces smears -- and keeps \`stroke\` off the fill shape, which
|
|
1250
|
+
would otherwise gain an edge it was drawn without. */
|
|
1251
|
+
${T}.statediagram-cluster .outer path[stroke='none'] {
|
|
1252
|
+
${m}
|
|
1253
|
+
}
|
|
1254
|
+
|
|
1255
|
+
${T}.statediagram-cluster .outer path[fill='none'] {
|
|
1256
|
+
stroke: ${a};
|
|
1257
|
+
}
|
|
1258
|
+
|
|
1259
|
+
/* No \`.inner\` rule on purpose. The body shape is left entirely alone under handDrawn,
|
|
1260
|
+
where a rect's \`inner\` counterpart cannot be recoloured safely: roughjs draws a
|
|
1261
|
+
hachure fill as *stroked* lines, so its fill paths carry \`fill="none"\` exactly like
|
|
1262
|
+
the outline and no selector separates them. An \`.inner\` stroke rule therefore
|
|
1263
|
+
repainted the hatching of every alt composite in the palette colour instead of
|
|
1264
|
+
leaving it on \`altBackground\`. The container still reads as palette-coloured: the
|
|
1265
|
+
\`outer\` shape spans the whole composite, so its outline already frames the body. */
|
|
1266
|
+
|
|
1267
|
+
/* Regions split the same way, which is why \`divider\` fills solid rather than taking
|
|
1268
|
+
roughjs's default hachure -- see the note on that call. Hatched, both of its paths
|
|
1269
|
+
carried \`fill="none"\` and these two rules degenerated: the tint matched nothing and
|
|
1270
|
+
the border rule repainted the hatching. */
|
|
1271
|
+
${T}.statediagram-cluster .divider path[stroke='none'] {
|
|
1272
|
+
${m}
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
${T}.statediagram-cluster .divider path[fill='none'] {
|
|
1276
|
+
stroke: ${a};
|
|
1277
|
+
}
|
|
1278
|
+
`;
|
|
1279
|
+
}
|
|
1280
|
+
return p;
|
|
1281
|
+
}, "genColor"), Je = /* @__PURE__ */ u((t) => `
|
|
1282
|
+
${Xe(t)}
|
|
1283
|
+
defs [id$="-barbEnd"] {
|
|
1284
|
+
fill: ${t.transitionColor};
|
|
1285
|
+
stroke: ${t.transitionColor};
|
|
1286
|
+
}
|
|
1287
|
+
g.stateGroup text {
|
|
1288
|
+
fill: ${t.nodeBorder};
|
|
1289
|
+
stroke: none;
|
|
1290
|
+
font-size: 10px;
|
|
1291
|
+
}
|
|
1292
|
+
g.stateGroup text {
|
|
1293
|
+
fill: ${t.textColor};
|
|
1294
|
+
stroke: none;
|
|
1295
|
+
font-size: 10px;
|
|
1296
|
+
|
|
1297
|
+
}
|
|
1298
|
+
g.stateGroup .state-title {
|
|
1299
|
+
font-weight: bolder;
|
|
1300
|
+
fill: ${t.stateLabelColor};
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
g.stateGroup rect {
|
|
1304
|
+
fill: ${t.mainBkg};
|
|
1305
|
+
stroke: ${t.nodeBorder};
|
|
1306
|
+
}
|
|
1307
|
+
|
|
1308
|
+
g.stateGroup line {
|
|
1309
|
+
stroke: ${t.lineColor};
|
|
1310
|
+
stroke-width: ${t.strokeWidth || 1};
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1313
|
+
.transition {
|
|
1314
|
+
stroke: ${t.transitionColor};
|
|
1315
|
+
stroke-width: ${t.strokeWidth || 1};
|
|
1316
|
+
fill: none;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
.stateGroup .composit {
|
|
1320
|
+
fill: ${t.background};
|
|
1321
|
+
border-bottom: 1px
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
.stateGroup .alt-composit {
|
|
1325
|
+
fill: #e0e0e0;
|
|
1326
|
+
border-bottom: 1px
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
.state-note {
|
|
1330
|
+
stroke: ${t.noteBorderColor};
|
|
1331
|
+
fill: ${t.noteBkgColor};
|
|
1332
|
+
|
|
1333
|
+
text {
|
|
1334
|
+
fill: ${t.noteTextColor};
|
|
1335
|
+
stroke: none;
|
|
1336
|
+
font-size: 10px;
|
|
1337
|
+
}
|
|
1338
|
+
}
|
|
1339
|
+
|
|
1340
|
+
.stateLabel .box {
|
|
1341
|
+
stroke: none;
|
|
1342
|
+
stroke-width: 0;
|
|
1343
|
+
fill: ${t.mainBkg};
|
|
1344
|
+
opacity: 0.5;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
.edgeLabel .label rect {
|
|
1348
|
+
fill: ${t.labelBackgroundColor};
|
|
1349
|
+
opacity: 0.5;
|
|
1350
|
+
}
|
|
1351
|
+
.edgeLabel {
|
|
1352
|
+
background-color: ${t.edgeLabelBackground};
|
|
1353
|
+
p {
|
|
1354
|
+
background-color: ${t.edgeLabelBackground};
|
|
1355
|
+
}
|
|
1356
|
+
rect {
|
|
1357
|
+
opacity: 0.5;
|
|
1358
|
+
background-color: ${t.edgeLabelBackground};
|
|
1359
|
+
fill: ${t.edgeLabelBackground};
|
|
1360
|
+
}
|
|
1361
|
+
text-align: center;
|
|
1362
|
+
}
|
|
1363
|
+
.edgeLabel .label text {
|
|
1364
|
+
fill: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
1365
|
+
}
|
|
1366
|
+
.label div .edgeLabel {
|
|
1367
|
+
color: ${t.transitionLabelColor || t.tertiaryTextColor};
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1370
|
+
.stateLabel text {
|
|
1371
|
+
fill: ${t.stateLabelColor};
|
|
1372
|
+
font-size: 10px;
|
|
1373
|
+
font-weight: bold;
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
.node circle.state-start {
|
|
1377
|
+
fill: ${t.specialStateColor};
|
|
1378
|
+
stroke: ${t.specialStateColor};
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.node .fork-join {
|
|
1382
|
+
fill: ${t.specialStateColor};
|
|
1383
|
+
stroke: ${t.specialStateColor};
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
.node circle.state-end {
|
|
1387
|
+
fill: ${t.innerEndBackground};
|
|
1388
|
+
stroke: ${t.background};
|
|
1389
|
+
stroke-width: 1.5
|
|
1390
|
+
}
|
|
1391
|
+
.end-state-inner {
|
|
1392
|
+
fill: ${t.compositeBackground || t.background};
|
|
1393
|
+
// stroke: ${t.background};
|
|
1394
|
+
stroke-width: 1.5
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
.node rect {
|
|
1398
|
+
fill: ${t.stateBkg || t.mainBkg};
|
|
1399
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1400
|
+
stroke-width: ${t.strokeWidth || 1}px;
|
|
1401
|
+
}
|
|
1402
|
+
.node polygon {
|
|
1403
|
+
fill: ${t.mainBkg};
|
|
1404
|
+
stroke: ${t.stateBorder || t.nodeBorder};;
|
|
1405
|
+
stroke-width: ${t.strokeWidth || 1}px;
|
|
1406
|
+
}
|
|
1407
|
+
[id$="-barbEnd"] {
|
|
1408
|
+
fill: ${t.lineColor};
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
.statediagram-cluster rect {
|
|
1412
|
+
fill: ${t.compositeTitleBackground};
|
|
1413
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1414
|
+
stroke-width: ${t.strokeWidth || 1}px;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.cluster-label, .nodeLabel {
|
|
1418
|
+
color: ${t.stateLabelColor};
|
|
1419
|
+
// line-height: 1;
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
.statediagram-cluster rect.outer {
|
|
1423
|
+
rx: 5px;
|
|
1424
|
+
ry: 5px;
|
|
1425
|
+
}
|
|
1426
|
+
.statediagram-state .divider {
|
|
1427
|
+
stroke: ${t.stateBorder || t.nodeBorder};
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
.statediagram-state .title-state {
|
|
1431
|
+
rx: 5px;
|
|
1432
|
+
ry: 5px;
|
|
1433
|
+
}
|
|
1434
|
+
.statediagram-cluster.statediagram-cluster .inner {
|
|
1435
|
+
fill: ${t.compositeBackground || t.background};
|
|
1436
|
+
}
|
|
1437
|
+
.statediagram-cluster.statediagram-cluster-alt .inner {
|
|
1438
|
+
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
.statediagram-cluster .inner {
|
|
1442
|
+
rx:0;
|
|
1443
|
+
ry:0;
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
.statediagram-state rect.basic {
|
|
1447
|
+
rx: 5px;
|
|
1448
|
+
ry: 5px;
|
|
1449
|
+
}
|
|
1450
|
+
.statediagram-state rect.divider {
|
|
1451
|
+
stroke-dasharray: 10,10;
|
|
1452
|
+
fill: ${t.altBackground ? t.altBackground : "#efefef"};
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
.note-edge {
|
|
1456
|
+
stroke-dasharray: 5;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
.statediagram-note rect {
|
|
1460
|
+
fill: ${t.noteBkgColor};
|
|
1461
|
+
stroke: ${t.noteBorderColor};
|
|
1462
|
+
stroke-width: 1px;
|
|
1463
|
+
rx: 0;
|
|
1464
|
+
ry: 0;
|
|
1465
|
+
}
|
|
1466
|
+
.statediagram-note rect {
|
|
1467
|
+
fill: ${t.noteBkgColor};
|
|
1468
|
+
stroke: ${t.noteBorderColor};
|
|
1469
|
+
stroke-width: 1px;
|
|
1470
|
+
rx: 0;
|
|
1471
|
+
ry: 0;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
.statediagram-note text {
|
|
1475
|
+
fill: ${t.noteTextColor};
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
.statediagram-note .nodeLabel {
|
|
1479
|
+
color: ${t.noteTextColor};
|
|
1480
|
+
}
|
|
1481
|
+
.statediagram .edgeLabel {
|
|
1482
|
+
color: red; // ${t.noteTextColor};
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
[id$="-dependencyStart"], [id$="-dependencyEnd"] {
|
|
1486
|
+
fill: ${t.lineColor};
|
|
1487
|
+
stroke: ${t.lineColor};
|
|
1488
|
+
stroke-width: ${t.strokeWidth || 1};
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
.statediagramTitleText {
|
|
1492
|
+
text-anchor: middle;
|
|
1493
|
+
font-size: 18px;
|
|
1494
|
+
fill: ${t.textColor};
|
|
1495
|
+
}
|
|
1496
|
+
|
|
1497
|
+
[data-look="neo"].statediagram-cluster rect {
|
|
1498
|
+
fill: ${t.mainBkg};
|
|
1499
|
+
stroke: ${t.useGradient ? "url(" + t.svgId + "-gradient)" : t.stateBorder || t.nodeBorder};
|
|
1500
|
+
stroke-width: ${t.strokeWidth ?? 1};
|
|
1501
|
+
}
|
|
1502
|
+
[data-look="neo"].statediagram-cluster rect.outer {
|
|
1503
|
+
rx: ${t.radius}px;
|
|
1504
|
+
ry: ${t.radius}px;
|
|
1505
|
+
filter: ${t.dropShadow ? t.dropShadow.replace("url(#drop-shadow)", `url(${t.svgId}-drop-shadow)`) : "none"}
|
|
1506
|
+
}
|
|
1507
|
+
`, "getStyles"), qe = Je, ss = {
|
|
1508
|
+
parser: _e,
|
|
1509
|
+
get db() {
|
|
1510
|
+
return new Ke(2);
|
|
1511
|
+
},
|
|
1512
|
+
renderer: ze,
|
|
1513
|
+
styles: qe,
|
|
1514
|
+
init: /* @__PURE__ */ u((t) => {
|
|
1515
|
+
t.state || (t.state = {}), t.state.arrowMarkerAbsolute = t.arrowMarkerAbsolute;
|
|
1516
|
+
}, "init")
|
|
1517
|
+
};
|
|
1518
|
+
export {
|
|
1519
|
+
ss as diagram
|
|
1520
|
+
};
|