@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,837 @@
|
|
|
1
|
+
import { g as ae } from "./chunk-XXDRQBXY-B-AMQgD2.js";
|
|
2
|
+
import { s as ce } from "./chunk-VQ5W62QI-CXRv7FiX.js";
|
|
3
|
+
import { _ as l, l as C, p as le, r as he, L as de, O as G, c as B, j as F, bd as ge, a1 as ue, a2 as pe, a3 as fe } from "./mermaid.core-DXv6D2Sm.js";
|
|
4
|
+
const E = [];
|
|
5
|
+
for (let e = 0; e < 256; ++e)
|
|
6
|
+
E.push((e + 256).toString(16).slice(1));
|
|
7
|
+
function me(e, n = 0) {
|
|
8
|
+
return (E[e[n + 0]] + E[e[n + 1]] + E[e[n + 2]] + E[e[n + 3]] + "-" + E[e[n + 4]] + E[e[n + 5]] + "-" + E[e[n + 6]] + E[e[n + 7]] + "-" + E[e[n + 8]] + E[e[n + 9]] + "-" + E[e[n + 10]] + E[e[n + 11]] + E[e[n + 12]] + E[e[n + 13]] + E[e[n + 14]] + E[e[n + 15]]).toLowerCase();
|
|
9
|
+
}
|
|
10
|
+
const ye = new Uint8Array(16);
|
|
11
|
+
function Ee() {
|
|
12
|
+
return crypto.getRandomValues(ye);
|
|
13
|
+
}
|
|
14
|
+
function _e(e, n, d) {
|
|
15
|
+
return crypto.randomUUID ? crypto.randomUUID() : be(e);
|
|
16
|
+
}
|
|
17
|
+
function be(e, n, d) {
|
|
18
|
+
e = e || {};
|
|
19
|
+
const a = e.random ?? e.rng?.() ?? Ee();
|
|
20
|
+
if (a.length < 16)
|
|
21
|
+
throw new Error("Random bytes length must be >= 16");
|
|
22
|
+
return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, me(a);
|
|
23
|
+
}
|
|
24
|
+
var Y = (function() {
|
|
25
|
+
var e = /* @__PURE__ */ l(function(L, s, i, o) {
|
|
26
|
+
for (i = i || {}, o = L.length; o--; i[L[o]] = s) ;
|
|
27
|
+
return i;
|
|
28
|
+
}, "o"), n = [1, 4], d = [1, 13], a = [1, 12], t = [1, 15], h = [1, 16], p = [1, 20], m = [1, 19], _ = [6, 7, 8], T = [1, 26], I = [1, 24], w = [1, 25], g = [6, 7, 11], R = [1, 6, 13, 15, 16, 19, 22], q = [1, 33], J = [1, 34], A = [1, 6, 7, 11, 13, 15, 16, 19, 22], j = {
|
|
29
|
+
trace: /* @__PURE__ */ l(function() {
|
|
30
|
+
}, "trace"),
|
|
31
|
+
yy: {},
|
|
32
|
+
symbols_: { error: 2, start: 3, mindMap: 4, spaceLines: 5, SPACELINE: 6, NL: 7, MINDMAP: 8, document: 9, stop: 10, EOF: 11, statement: 12, SPACELIST: 13, node: 14, ICON: 15, CLASS: 16, nodeWithId: 17, nodeWithoutId: 18, NODE_DSTART: 19, NODE_DESCR: 20, NODE_DEND: 21, NODE_ID: 22, $accept: 0, $end: 1 },
|
|
33
|
+
terminals_: { 2: "error", 6: "SPACELINE", 7: "NL", 8: "MINDMAP", 11: "EOF", 13: "SPACELIST", 15: "ICON", 16: "CLASS", 19: "NODE_DSTART", 20: "NODE_DESCR", 21: "NODE_DEND", 22: "NODE_ID" },
|
|
34
|
+
productions_: [0, [3, 1], [3, 2], [5, 1], [5, 2], [5, 2], [4, 2], [4, 3], [10, 1], [10, 1], [10, 1], [10, 2], [10, 2], [9, 3], [9, 2], [12, 2], [12, 2], [12, 2], [12, 1], [12, 1], [12, 1], [12, 1], [12, 1], [14, 1], [14, 1], [18, 3], [17, 1], [17, 4]],
|
|
35
|
+
performAction: /* @__PURE__ */ l(function(s, i, o, c, f, r, $) {
|
|
36
|
+
var u = r.length - 1;
|
|
37
|
+
switch (f) {
|
|
38
|
+
case 6:
|
|
39
|
+
case 7:
|
|
40
|
+
return c;
|
|
41
|
+
case 8:
|
|
42
|
+
c.getLogger().trace("Stop NL ");
|
|
43
|
+
break;
|
|
44
|
+
case 9:
|
|
45
|
+
c.getLogger().trace("Stop EOF ");
|
|
46
|
+
break;
|
|
47
|
+
case 11:
|
|
48
|
+
c.getLogger().trace("Stop NL2 ");
|
|
49
|
+
break;
|
|
50
|
+
case 12:
|
|
51
|
+
c.getLogger().trace("Stop EOF2 ");
|
|
52
|
+
break;
|
|
53
|
+
case 15:
|
|
54
|
+
c.getLogger().info("Node: ", r[u].id), c.addNode(r[u - 1].length, r[u].id, r[u].descr, r[u].type);
|
|
55
|
+
break;
|
|
56
|
+
case 16:
|
|
57
|
+
c.getLogger().trace("Icon: ", r[u]), c.decorateNode({ icon: r[u] });
|
|
58
|
+
break;
|
|
59
|
+
case 17:
|
|
60
|
+
case 21:
|
|
61
|
+
c.decorateNode({ class: r[u] });
|
|
62
|
+
break;
|
|
63
|
+
case 18:
|
|
64
|
+
c.getLogger().trace("SPACELIST");
|
|
65
|
+
break;
|
|
66
|
+
case 19:
|
|
67
|
+
c.getLogger().trace("Node: ", r[u].id), c.addNode(0, r[u].id, r[u].descr, r[u].type);
|
|
68
|
+
break;
|
|
69
|
+
case 20:
|
|
70
|
+
c.decorateNode({ icon: r[u] });
|
|
71
|
+
break;
|
|
72
|
+
case 25:
|
|
73
|
+
c.getLogger().trace("node found ..", r[u - 2]), this.$ = { id: r[u - 1], descr: r[u - 1], type: c.getType(r[u - 2], r[u]) };
|
|
74
|
+
break;
|
|
75
|
+
case 26:
|
|
76
|
+
this.$ = { id: r[u], descr: r[u], type: c.nodeType.DEFAULT };
|
|
77
|
+
break;
|
|
78
|
+
case 27:
|
|
79
|
+
c.getLogger().trace("node found ..", r[u - 3]), this.$ = { id: r[u - 3], descr: r[u - 1], type: c.getType(r[u - 2], r[u]) };
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}, "anonymous"),
|
|
83
|
+
table: [{ 3: 1, 4: 2, 5: 3, 6: [1, 5], 8: n }, { 1: [3] }, { 1: [2, 1] }, { 4: 6, 6: [1, 7], 7: [1, 8], 8: n }, { 6: d, 7: [1, 10], 9: 9, 12: 11, 13: a, 14: 14, 15: t, 16: h, 17: 17, 18: 18, 19: p, 22: m }, e(_, [2, 3]), { 1: [2, 2] }, e(_, [2, 4]), e(_, [2, 5]), { 1: [2, 6], 6: d, 12: 21, 13: a, 14: 14, 15: t, 16: h, 17: 17, 18: 18, 19: p, 22: m }, { 6: d, 9: 22, 12: 11, 13: a, 14: 14, 15: t, 16: h, 17: 17, 18: 18, 19: p, 22: m }, { 6: T, 7: I, 10: 23, 11: w }, e(g, [2, 22], { 17: 17, 18: 18, 14: 27, 15: [1, 28], 16: [1, 29], 19: p, 22: m }), e(g, [2, 18]), e(g, [2, 19]), e(g, [2, 20]), e(g, [2, 21]), e(g, [2, 23]), e(g, [2, 24]), e(g, [2, 26], { 19: [1, 30] }), { 20: [1, 31] }, { 6: T, 7: I, 10: 32, 11: w }, { 1: [2, 7], 6: d, 12: 21, 13: a, 14: 14, 15: t, 16: h, 17: 17, 18: 18, 19: p, 22: m }, e(R, [2, 14], { 7: q, 11: J }), e(A, [2, 8]), e(A, [2, 9]), e(A, [2, 10]), e(g, [2, 15]), e(g, [2, 16]), e(g, [2, 17]), { 20: [1, 35] }, { 21: [1, 36] }, e(R, [2, 13], { 7: q, 11: J }), e(A, [2, 11]), e(A, [2, 12]), { 21: [1, 37] }, e(g, [2, 25]), e(g, [2, 27])],
|
|
84
|
+
defaultActions: { 2: [2, 1], 6: [2, 2] },
|
|
85
|
+
parseError: /* @__PURE__ */ l(function(s, i) {
|
|
86
|
+
if (i.recoverable)
|
|
87
|
+
this.trace(s);
|
|
88
|
+
else {
|
|
89
|
+
var o = new Error(s);
|
|
90
|
+
throw o.hash = i, o;
|
|
91
|
+
}
|
|
92
|
+
}, "parseError"),
|
|
93
|
+
parse: /* @__PURE__ */ l(function(s) {
|
|
94
|
+
var i = this, o = [0], c = [], f = [null], r = [], $ = this.table, u = "", M = 0, K = 0, ie = 2, Q = 1, se = r.slice.call(arguments, 1), y = Object.create(this.lexer), D = { yy: {} };
|
|
95
|
+
for (var H in this.yy)
|
|
96
|
+
Object.prototype.hasOwnProperty.call(this.yy, H) && (D.yy[H] = this.yy[H]);
|
|
97
|
+
y.setInput(s, D.yy), D.yy.lexer = y, D.yy.parser = this, typeof y.yylloc > "u" && (y.yylloc = {});
|
|
98
|
+
var W = y.yylloc;
|
|
99
|
+
r.push(W);
|
|
100
|
+
var re = y.options && y.options.ranges;
|
|
101
|
+
typeof D.yy.parseError == "function" ? this.parseError = D.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
102
|
+
function oe(k) {
|
|
103
|
+
o.length = o.length - 2 * k, f.length = f.length - k, r.length = r.length - k;
|
|
104
|
+
}
|
|
105
|
+
l(oe, "popStack");
|
|
106
|
+
function Z() {
|
|
107
|
+
var k;
|
|
108
|
+
return k = c.pop() || y.lex() || Q, typeof k != "number" && (k instanceof Array && (c = k, k = c.pop()), k = i.symbols_[k] || k), k;
|
|
109
|
+
}
|
|
110
|
+
l(Z, "lex");
|
|
111
|
+
for (var b, v, S, z, O = {}, U, x, ee, V; ; ) {
|
|
112
|
+
if (v = o[o.length - 1], this.defaultActions[v] ? S = this.defaultActions[v] : ((b === null || typeof b > "u") && (b = Z()), S = $[v] && $[v][b]), typeof S > "u" || !S.length || !S[0]) {
|
|
113
|
+
var X = "";
|
|
114
|
+
V = [];
|
|
115
|
+
for (U in $[v])
|
|
116
|
+
this.terminals_[U] && U > ie && V.push("'" + this.terminals_[U] + "'");
|
|
117
|
+
y.showPosition ? X = "Parse error on line " + (M + 1) + `:
|
|
118
|
+
` + y.showPosition() + `
|
|
119
|
+
Expecting ` + V.join(", ") + ", got '" + (this.terminals_[b] || b) + "'" : X = "Parse error on line " + (M + 1) + ": Unexpected " + (b == Q ? "end of input" : "'" + (this.terminals_[b] || b) + "'"), this.parseError(X, {
|
|
120
|
+
text: y.match,
|
|
121
|
+
token: this.terminals_[b] || b,
|
|
122
|
+
line: y.yylineno,
|
|
123
|
+
loc: W,
|
|
124
|
+
expected: V
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
if (S[0] instanceof Array && S.length > 1)
|
|
128
|
+
throw new Error("Parse Error: multiple actions possible at state: " + v + ", token: " + b);
|
|
129
|
+
switch (S[0]) {
|
|
130
|
+
case 1:
|
|
131
|
+
o.push(b), f.push(y.yytext), r.push(y.yylloc), o.push(S[1]), b = null, K = y.yyleng, u = y.yytext, M = y.yylineno, W = y.yylloc;
|
|
132
|
+
break;
|
|
133
|
+
case 2:
|
|
134
|
+
if (x = this.productions_[S[1]][1], O.$ = f[f.length - x], O._$ = {
|
|
135
|
+
first_line: r[r.length - (x || 1)].first_line,
|
|
136
|
+
last_line: r[r.length - 1].last_line,
|
|
137
|
+
first_column: r[r.length - (x || 1)].first_column,
|
|
138
|
+
last_column: r[r.length - 1].last_column
|
|
139
|
+
}, re && (O._$.range = [
|
|
140
|
+
r[r.length - (x || 1)].range[0],
|
|
141
|
+
r[r.length - 1].range[1]
|
|
142
|
+
]), z = this.performAction.apply(O, [
|
|
143
|
+
u,
|
|
144
|
+
K,
|
|
145
|
+
M,
|
|
146
|
+
D.yy,
|
|
147
|
+
S[1],
|
|
148
|
+
f,
|
|
149
|
+
r
|
|
150
|
+
].concat(se)), typeof z < "u")
|
|
151
|
+
return z;
|
|
152
|
+
x && (o = o.slice(0, -1 * x * 2), f = f.slice(0, -1 * x), r = r.slice(0, -1 * x)), o.push(this.productions_[S[1]][0]), f.push(O.$), r.push(O._$), ee = $[o[o.length - 2]][o[o.length - 1]], o.push(ee);
|
|
153
|
+
break;
|
|
154
|
+
case 3:
|
|
155
|
+
return !0;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return !0;
|
|
159
|
+
}, "parse")
|
|
160
|
+
}, ne = /* @__PURE__ */ (function() {
|
|
161
|
+
var L = {
|
|
162
|
+
EOF: 1,
|
|
163
|
+
parseError: /* @__PURE__ */ l(function(i, o) {
|
|
164
|
+
if (this.yy.parser)
|
|
165
|
+
this.yy.parser.parseError(i, o);
|
|
166
|
+
else
|
|
167
|
+
throw new Error(i);
|
|
168
|
+
}, "parseError"),
|
|
169
|
+
// resets the lexer, sets new input
|
|
170
|
+
setInput: /* @__PURE__ */ l(function(s, i) {
|
|
171
|
+
return this.yy = i || this.yy || {}, this._input = s, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
|
|
172
|
+
first_line: 1,
|
|
173
|
+
first_column: 0,
|
|
174
|
+
last_line: 1,
|
|
175
|
+
last_column: 0
|
|
176
|
+
}, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
|
|
177
|
+
}, "setInput"),
|
|
178
|
+
// consumes and returns one char from the input
|
|
179
|
+
input: /* @__PURE__ */ l(function() {
|
|
180
|
+
var s = this._input[0];
|
|
181
|
+
this.yytext += s, this.yyleng++, this.offset++, this.match += s, this.matched += s;
|
|
182
|
+
var i = s.match(/(?:\r\n?|\n).*/g);
|
|
183
|
+
return i ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), s;
|
|
184
|
+
}, "input"),
|
|
185
|
+
// unshifts one char (or a string) into the input
|
|
186
|
+
unput: /* @__PURE__ */ l(function(s) {
|
|
187
|
+
var i = s.length, o = s.split(/(?:\r\n?|\n)/g);
|
|
188
|
+
this._input = s + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - i), this.offset -= i;
|
|
189
|
+
var c = this.match.split(/(?:\r\n?|\n)/g);
|
|
190
|
+
this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), o.length - 1 && (this.yylineno -= o.length - 1);
|
|
191
|
+
var f = this.yylloc.range;
|
|
192
|
+
return this.yylloc = {
|
|
193
|
+
first_line: this.yylloc.first_line,
|
|
194
|
+
last_line: this.yylineno + 1,
|
|
195
|
+
first_column: this.yylloc.first_column,
|
|
196
|
+
last_column: o ? (o.length === c.length ? this.yylloc.first_column : 0) + c[c.length - o.length].length - o[0].length : this.yylloc.first_column - i
|
|
197
|
+
}, this.options.ranges && (this.yylloc.range = [f[0], f[0] + this.yyleng - i]), this.yyleng = this.yytext.length, this;
|
|
198
|
+
}, "unput"),
|
|
199
|
+
// When called from action, caches matched text and appends it on next action
|
|
200
|
+
more: /* @__PURE__ */ l(function() {
|
|
201
|
+
return this._more = !0, this;
|
|
202
|
+
}, "more"),
|
|
203
|
+
// 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.
|
|
204
|
+
reject: /* @__PURE__ */ l(function() {
|
|
205
|
+
if (this.options.backtrack_lexer)
|
|
206
|
+
this._backtrack = !0;
|
|
207
|
+
else
|
|
208
|
+
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).
|
|
209
|
+
` + this.showPosition(), {
|
|
210
|
+
text: "",
|
|
211
|
+
token: null,
|
|
212
|
+
line: this.yylineno
|
|
213
|
+
});
|
|
214
|
+
return this;
|
|
215
|
+
}, "reject"),
|
|
216
|
+
// retain first n characters of the match
|
|
217
|
+
less: /* @__PURE__ */ l(function(s) {
|
|
218
|
+
this.unput(this.match.slice(s));
|
|
219
|
+
}, "less"),
|
|
220
|
+
// displays already matched input, i.e. for error messages
|
|
221
|
+
pastInput: /* @__PURE__ */ l(function() {
|
|
222
|
+
var s = this.matched.substr(0, this.matched.length - this.match.length);
|
|
223
|
+
return (s.length > 20 ? "..." : "") + s.substr(-20).replace(/\n/g, "");
|
|
224
|
+
}, "pastInput"),
|
|
225
|
+
// displays upcoming input, i.e. for error messages
|
|
226
|
+
upcomingInput: /* @__PURE__ */ l(function() {
|
|
227
|
+
var s = this.match;
|
|
228
|
+
return s.length < 20 && (s += this._input.substr(0, 20 - s.length)), (s.substr(0, 20) + (s.length > 20 ? "..." : "")).replace(/\n/g, "");
|
|
229
|
+
}, "upcomingInput"),
|
|
230
|
+
// displays the character position where the lexing error occurred, i.e. for error messages
|
|
231
|
+
showPosition: /* @__PURE__ */ l(function() {
|
|
232
|
+
var s = this.pastInput(), i = new Array(s.length + 1).join("-");
|
|
233
|
+
return s + this.upcomingInput() + `
|
|
234
|
+
` + i + "^";
|
|
235
|
+
}, "showPosition"),
|
|
236
|
+
// test the lexed token: return FALSE when not a match, otherwise return token
|
|
237
|
+
test_match: /* @__PURE__ */ l(function(s, i) {
|
|
238
|
+
var o, c, f;
|
|
239
|
+
if (this.options.backtrack_lexer && (f = {
|
|
240
|
+
yylineno: this.yylineno,
|
|
241
|
+
yylloc: {
|
|
242
|
+
first_line: this.yylloc.first_line,
|
|
243
|
+
last_line: this.last_line,
|
|
244
|
+
first_column: this.yylloc.first_column,
|
|
245
|
+
last_column: this.yylloc.last_column
|
|
246
|
+
},
|
|
247
|
+
yytext: this.yytext,
|
|
248
|
+
match: this.match,
|
|
249
|
+
matches: this.matches,
|
|
250
|
+
matched: this.matched,
|
|
251
|
+
yyleng: this.yyleng,
|
|
252
|
+
offset: this.offset,
|
|
253
|
+
_more: this._more,
|
|
254
|
+
_input: this._input,
|
|
255
|
+
yy: this.yy,
|
|
256
|
+
conditionStack: this.conditionStack.slice(0),
|
|
257
|
+
done: this.done
|
|
258
|
+
}, this.options.ranges && (f.yylloc.range = this.yylloc.range.slice(0))), c = s[0].match(/(?:\r\n?|\n).*/g), c && (this.yylineno += c.length), this.yylloc = {
|
|
259
|
+
first_line: this.yylloc.last_line,
|
|
260
|
+
last_line: this.yylineno + 1,
|
|
261
|
+
first_column: this.yylloc.last_column,
|
|
262
|
+
last_column: c ? c[c.length - 1].length - c[c.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + s[0].length
|
|
263
|
+
}, this.yytext += s[0], this.match += s[0], this.matches = s, 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(s[0].length), this.matched += s[0], o = this.performAction.call(this, this.yy, this, i, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), o)
|
|
264
|
+
return o;
|
|
265
|
+
if (this._backtrack) {
|
|
266
|
+
for (var r in f)
|
|
267
|
+
this[r] = f[r];
|
|
268
|
+
return !1;
|
|
269
|
+
}
|
|
270
|
+
return !1;
|
|
271
|
+
}, "test_match"),
|
|
272
|
+
// return next match in input
|
|
273
|
+
next: /* @__PURE__ */ l(function() {
|
|
274
|
+
if (this.done)
|
|
275
|
+
return this.EOF;
|
|
276
|
+
this._input || (this.done = !0);
|
|
277
|
+
var s, i, o, c;
|
|
278
|
+
this._more || (this.yytext = "", this.match = "");
|
|
279
|
+
for (var f = this._currentRules(), r = 0; r < f.length; r++)
|
|
280
|
+
if (o = this._input.match(this.rules[f[r]]), o && (!i || o[0].length > i[0].length)) {
|
|
281
|
+
if (i = o, c = r, this.options.backtrack_lexer) {
|
|
282
|
+
if (s = this.test_match(o, f[r]), s !== !1)
|
|
283
|
+
return s;
|
|
284
|
+
if (this._backtrack) {
|
|
285
|
+
i = !1;
|
|
286
|
+
continue;
|
|
287
|
+
} else
|
|
288
|
+
return !1;
|
|
289
|
+
} else if (!this.options.flex)
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
return i ? (s = this.test_match(i, f[c]), s !== !1 ? s : !1) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + `. Unrecognized text.
|
|
293
|
+
` + this.showPosition(), {
|
|
294
|
+
text: "",
|
|
295
|
+
token: null,
|
|
296
|
+
line: this.yylineno
|
|
297
|
+
});
|
|
298
|
+
}, "next"),
|
|
299
|
+
// return next match that has a token
|
|
300
|
+
lex: /* @__PURE__ */ l(function() {
|
|
301
|
+
var i = this.next();
|
|
302
|
+
return i || this.lex();
|
|
303
|
+
}, "lex"),
|
|
304
|
+
// activates a new lexer condition state (pushes the new lexer condition state onto the condition stack)
|
|
305
|
+
begin: /* @__PURE__ */ l(function(i) {
|
|
306
|
+
this.conditionStack.push(i);
|
|
307
|
+
}, "begin"),
|
|
308
|
+
// pop the previously active lexer condition state off the condition stack
|
|
309
|
+
popState: /* @__PURE__ */ l(function() {
|
|
310
|
+
var i = this.conditionStack.length - 1;
|
|
311
|
+
return i > 0 ? this.conditionStack.pop() : this.conditionStack[0];
|
|
312
|
+
}, "popState"),
|
|
313
|
+
// produce the lexer rule set which is active for the currently active lexer condition state
|
|
314
|
+
_currentRules: /* @__PURE__ */ l(function() {
|
|
315
|
+
return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
|
|
316
|
+
}, "_currentRules"),
|
|
317
|
+
// return the currently active lexer condition state; when an index argument is provided it produces the N-th previous condition state, if available
|
|
318
|
+
topState: /* @__PURE__ */ l(function(i) {
|
|
319
|
+
return i = this.conditionStack.length - 1 - Math.abs(i || 0), i >= 0 ? this.conditionStack[i] : "INITIAL";
|
|
320
|
+
}, "topState"),
|
|
321
|
+
// alias for begin(condition)
|
|
322
|
+
pushState: /* @__PURE__ */ l(function(i) {
|
|
323
|
+
this.begin(i);
|
|
324
|
+
}, "pushState"),
|
|
325
|
+
// return the number of states currently on the stack
|
|
326
|
+
stateStackSize: /* @__PURE__ */ l(function() {
|
|
327
|
+
return this.conditionStack.length;
|
|
328
|
+
}, "stateStackSize"),
|
|
329
|
+
options: { "case-insensitive": !0 },
|
|
330
|
+
performAction: /* @__PURE__ */ l(function(i, o, c, f) {
|
|
331
|
+
switch (c) {
|
|
332
|
+
case 0:
|
|
333
|
+
return i.getLogger().trace("Found comment", o.yytext), 6;
|
|
334
|
+
case 1:
|
|
335
|
+
return 8;
|
|
336
|
+
case 2:
|
|
337
|
+
this.begin("CLASS");
|
|
338
|
+
break;
|
|
339
|
+
case 3:
|
|
340
|
+
return this.popState(), 16;
|
|
341
|
+
case 4:
|
|
342
|
+
this.popState();
|
|
343
|
+
break;
|
|
344
|
+
case 5:
|
|
345
|
+
i.getLogger().trace("Begin icon"), this.begin("ICON");
|
|
346
|
+
break;
|
|
347
|
+
case 6:
|
|
348
|
+
return i.getLogger().trace("SPACELINE"), 6;
|
|
349
|
+
case 7:
|
|
350
|
+
return 7;
|
|
351
|
+
case 8:
|
|
352
|
+
return 15;
|
|
353
|
+
case 9:
|
|
354
|
+
i.getLogger().trace("end icon"), this.popState();
|
|
355
|
+
break;
|
|
356
|
+
case 10:
|
|
357
|
+
return i.getLogger().trace("Exploding node"), this.begin("NODE"), 19;
|
|
358
|
+
case 11:
|
|
359
|
+
return i.getLogger().trace("Cloud"), this.begin("NODE"), 19;
|
|
360
|
+
case 12:
|
|
361
|
+
return i.getLogger().trace("Explosion Bang"), this.begin("NODE"), 19;
|
|
362
|
+
case 13:
|
|
363
|
+
return i.getLogger().trace("Cloud Bang"), this.begin("NODE"), 19;
|
|
364
|
+
case 14:
|
|
365
|
+
return this.begin("NODE"), 19;
|
|
366
|
+
case 15:
|
|
367
|
+
return this.begin("NODE"), 19;
|
|
368
|
+
case 16:
|
|
369
|
+
return this.begin("NODE"), 19;
|
|
370
|
+
case 17:
|
|
371
|
+
return this.begin("NODE"), 19;
|
|
372
|
+
case 18:
|
|
373
|
+
return 13;
|
|
374
|
+
case 19:
|
|
375
|
+
return 22;
|
|
376
|
+
case 20:
|
|
377
|
+
return 11;
|
|
378
|
+
case 21:
|
|
379
|
+
this.begin("NSTR2");
|
|
380
|
+
break;
|
|
381
|
+
case 22:
|
|
382
|
+
return "NODE_DESCR";
|
|
383
|
+
case 23:
|
|
384
|
+
this.popState();
|
|
385
|
+
break;
|
|
386
|
+
case 24:
|
|
387
|
+
i.getLogger().trace("Starting NSTR"), this.begin("NSTR");
|
|
388
|
+
break;
|
|
389
|
+
case 25:
|
|
390
|
+
return i.getLogger().trace("description:", o.yytext), "NODE_DESCR";
|
|
391
|
+
case 26:
|
|
392
|
+
this.popState();
|
|
393
|
+
break;
|
|
394
|
+
case 27:
|
|
395
|
+
return this.popState(), i.getLogger().trace("node end ))"), "NODE_DEND";
|
|
396
|
+
case 28:
|
|
397
|
+
return this.popState(), i.getLogger().trace("node end )"), "NODE_DEND";
|
|
398
|
+
case 29:
|
|
399
|
+
return this.popState(), i.getLogger().trace("node end ...", o.yytext), "NODE_DEND";
|
|
400
|
+
case 30:
|
|
401
|
+
return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
|
|
402
|
+
case 31:
|
|
403
|
+
return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
|
|
404
|
+
case 32:
|
|
405
|
+
return this.popState(), i.getLogger().trace("node end (-"), "NODE_DEND";
|
|
406
|
+
case 33:
|
|
407
|
+
return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
|
|
408
|
+
case 34:
|
|
409
|
+
return this.popState(), i.getLogger().trace("node end (("), "NODE_DEND";
|
|
410
|
+
case 35:
|
|
411
|
+
return i.getLogger().trace("Long description:", o.yytext), 20;
|
|
412
|
+
case 36:
|
|
413
|
+
return i.getLogger().trace("Long description:", o.yytext), 20;
|
|
414
|
+
}
|
|
415
|
+
}, "anonymous"),
|
|
416
|
+
rules: [/^(?:\s*%%.*)/i, /^(?:mindmap\b)/i, /^(?::::)/i, /^(?:.+)/i, /^(?:\n)/i, /^(?:::icon\()/i, /^(?:[\s]+[\n])/i, /^(?:[\n]+)/i, /^(?:[^\)]+)/i, /^(?:\))/i, /^(?:-\))/i, /^(?:\(-)/i, /^(?:\)\))/i, /^(?:\))/i, /^(?:\(\()/i, /^(?:\{\{)/i, /^(?:\()/i, /^(?:\[)/i, /^(?:[\s]+)/i, /^(?:[^\(\[\n\)\{\}]+)/i, /^(?:$)/i, /^(?:["][`])/i, /^(?:[^`"]+)/i, /^(?:[`]["])/i, /^(?:["])/i, /^(?:[^"]+)/i, /^(?:["])/i, /^(?:[\)]\))/i, /^(?:[\)])/i, /^(?:[\]])/i, /^(?:\}\})/i, /^(?:\(-)/i, /^(?:-\))/i, /^(?:\(\()/i, /^(?:\()/i, /^(?:[^\)\]\(\}]+)/i, /^(?:.+(?!\(\())/i],
|
|
417
|
+
conditions: { CLASS: { rules: [3, 4], inclusive: !1 }, ICON: { rules: [8, 9], inclusive: !1 }, NSTR2: { rules: [22, 23], inclusive: !1 }, NSTR: { rules: [25, 26], inclusive: !1 }, NODE: { rules: [21, 24, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36], inclusive: !1 }, INITIAL: { rules: [0, 1, 2, 5, 6, 7, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20], inclusive: !0 } }
|
|
418
|
+
};
|
|
419
|
+
return L;
|
|
420
|
+
})();
|
|
421
|
+
j.lexer = ne;
|
|
422
|
+
function P() {
|
|
423
|
+
this.yy = {};
|
|
424
|
+
}
|
|
425
|
+
return l(P, "Parser"), P.prototype = j, j.Parser = P, new P();
|
|
426
|
+
})();
|
|
427
|
+
Y.parser = Y;
|
|
428
|
+
var ke = Y, te = 12, N = {
|
|
429
|
+
DEFAULT: 0,
|
|
430
|
+
NO_BORDER: 0,
|
|
431
|
+
ROUNDED_RECT: 1,
|
|
432
|
+
RECT: 2,
|
|
433
|
+
CIRCLE: 3,
|
|
434
|
+
CLOUD: 4,
|
|
435
|
+
BANG: 5,
|
|
436
|
+
HEXAGON: 6
|
|
437
|
+
}, Se = class {
|
|
438
|
+
constructor() {
|
|
439
|
+
this.nodes = [], this.count = 0, this.elements = {}, this.getLogger = this.getLogger.bind(this), this.nodeType = N, this.clear(), this.getType = this.getType.bind(this), this.getElementById = this.getElementById.bind(this), this.getParent = this.getParent.bind(this), this.getMindmap = this.getMindmap.bind(this), this.addNode = this.addNode.bind(this), this.decorateNode = this.decorateNode.bind(this);
|
|
440
|
+
}
|
|
441
|
+
static {
|
|
442
|
+
l(this, "MindmapDB");
|
|
443
|
+
}
|
|
444
|
+
clear() {
|
|
445
|
+
this.nodes = [], this.count = 0, this.elements = {}, this.baseLevel = void 0;
|
|
446
|
+
}
|
|
447
|
+
getParent(e) {
|
|
448
|
+
for (let n = this.nodes.length - 1; n >= 0; n--)
|
|
449
|
+
if (this.nodes[n].level < e)
|
|
450
|
+
return this.nodes[n];
|
|
451
|
+
return null;
|
|
452
|
+
}
|
|
453
|
+
getMindmap() {
|
|
454
|
+
return this.nodes.length > 0 ? this.nodes[0] : null;
|
|
455
|
+
}
|
|
456
|
+
addNode(e, n, d, a) {
|
|
457
|
+
C.info("addNode", e, n, d, a);
|
|
458
|
+
let t = !1;
|
|
459
|
+
this.nodes.length === 0 ? (this.baseLevel = e, e = 0, t = !0) : this.baseLevel !== void 0 && (e = e - this.baseLevel, t = !1);
|
|
460
|
+
const h = B();
|
|
461
|
+
let p = h.mindmap?.padding ?? G.mindmap.padding;
|
|
462
|
+
switch (a) {
|
|
463
|
+
case this.nodeType.ROUNDED_RECT:
|
|
464
|
+
case this.nodeType.RECT:
|
|
465
|
+
case this.nodeType.HEXAGON:
|
|
466
|
+
p *= 2;
|
|
467
|
+
break;
|
|
468
|
+
}
|
|
469
|
+
const m = {
|
|
470
|
+
id: this.count++,
|
|
471
|
+
nodeId: F(n, h),
|
|
472
|
+
level: e,
|
|
473
|
+
descr: F(d, h),
|
|
474
|
+
type: a,
|
|
475
|
+
children: [],
|
|
476
|
+
width: h.mindmap?.maxNodeWidth ?? G.mindmap.maxNodeWidth,
|
|
477
|
+
padding: p,
|
|
478
|
+
isRoot: t
|
|
479
|
+
}, _ = this.getParent(e);
|
|
480
|
+
if (_)
|
|
481
|
+
_.children.push(m), this.nodes.push(m);
|
|
482
|
+
else if (t)
|
|
483
|
+
this.nodes.push(m);
|
|
484
|
+
else
|
|
485
|
+
throw new Error(
|
|
486
|
+
`There can be only one root. No parent could be found for ("${m.descr}")`
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
getType(e, n) {
|
|
490
|
+
switch (C.debug("In get type", e, n), e) {
|
|
491
|
+
case "[":
|
|
492
|
+
return this.nodeType.RECT;
|
|
493
|
+
case "(":
|
|
494
|
+
return n === ")" ? this.nodeType.ROUNDED_RECT : this.nodeType.CLOUD;
|
|
495
|
+
case "((":
|
|
496
|
+
return this.nodeType.CIRCLE;
|
|
497
|
+
case ")":
|
|
498
|
+
return this.nodeType.CLOUD;
|
|
499
|
+
case "))":
|
|
500
|
+
return this.nodeType.BANG;
|
|
501
|
+
case "{{":
|
|
502
|
+
return this.nodeType.HEXAGON;
|
|
503
|
+
default:
|
|
504
|
+
return this.nodeType.DEFAULT;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
setElementForId(e, n) {
|
|
508
|
+
this.elements[e] = n;
|
|
509
|
+
}
|
|
510
|
+
getElementById(e) {
|
|
511
|
+
return this.elements[e];
|
|
512
|
+
}
|
|
513
|
+
decorateNode(e) {
|
|
514
|
+
if (!e)
|
|
515
|
+
return;
|
|
516
|
+
const n = B(), d = this.nodes[this.nodes.length - 1];
|
|
517
|
+
e.icon && (d.icon = F(e.icon, n)), e.class && (d.class = F(e.class, n));
|
|
518
|
+
}
|
|
519
|
+
type2Str(e) {
|
|
520
|
+
switch (e) {
|
|
521
|
+
case this.nodeType.DEFAULT:
|
|
522
|
+
return "no-border";
|
|
523
|
+
case this.nodeType.RECT:
|
|
524
|
+
return "rect";
|
|
525
|
+
case this.nodeType.ROUNDED_RECT:
|
|
526
|
+
return "rounded-rect";
|
|
527
|
+
case this.nodeType.CIRCLE:
|
|
528
|
+
return "circle";
|
|
529
|
+
case this.nodeType.CLOUD:
|
|
530
|
+
return "cloud";
|
|
531
|
+
case this.nodeType.BANG:
|
|
532
|
+
return "bang";
|
|
533
|
+
case this.nodeType.HEXAGON:
|
|
534
|
+
return "hexgon";
|
|
535
|
+
// cspell: disable-line
|
|
536
|
+
default:
|
|
537
|
+
return "no-border";
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Assign color sections by top-level branch (default) or structural depth.
|
|
542
|
+
* @param node - The mindmap node to process
|
|
543
|
+
* @param sectionNumber - The section number to assign (undefined for root)
|
|
544
|
+
* @param depth - Distance from the root, independent of indentation width
|
|
545
|
+
* @param colorByDepth - Whether to assign sections by depth instead of top-level branch
|
|
546
|
+
*/
|
|
547
|
+
assignSections(e, n, d = 0, a = !1) {
|
|
548
|
+
if (e.level === 0 ? e.section = void 0 : e.section = a ? (d - 1) % (te - 1) : n, e.children)
|
|
549
|
+
for (const [t, h] of e.children.entries()) {
|
|
550
|
+
const p = e.level === 0 ? t % (te - 1) : n;
|
|
551
|
+
this.assignSections(h, p, d + 1, a);
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Convert mindmap tree structure to flat array of nodes
|
|
556
|
+
* @param node - The mindmap node to process
|
|
557
|
+
* @param processedNodes - Array to collect processed nodes
|
|
558
|
+
*/
|
|
559
|
+
flattenNodes(e, n) {
|
|
560
|
+
const d = B(), a = ["mindmap-node"];
|
|
561
|
+
e.isRoot === !0 ? a.push("section-root", "section--1") : e.section !== void 0 && a.push(`section-${e.section}`), e.class && a.push(e.class);
|
|
562
|
+
const t = a.join(" "), h = /* @__PURE__ */ l((m) => {
|
|
563
|
+
const T = (d.theme?.toLowerCase() ?? "").includes("redux");
|
|
564
|
+
switch (m) {
|
|
565
|
+
case N.CIRCLE:
|
|
566
|
+
return "mindmapCircle";
|
|
567
|
+
case N.RECT:
|
|
568
|
+
return "rect";
|
|
569
|
+
case N.ROUNDED_RECT:
|
|
570
|
+
return "rounded";
|
|
571
|
+
case N.CLOUD:
|
|
572
|
+
return "cloud";
|
|
573
|
+
case N.BANG:
|
|
574
|
+
return "bang";
|
|
575
|
+
case N.HEXAGON:
|
|
576
|
+
return "hexagon";
|
|
577
|
+
case N.DEFAULT:
|
|
578
|
+
return T ? "rounded" : "defaultMindmapNode";
|
|
579
|
+
case N.NO_BORDER:
|
|
580
|
+
default:
|
|
581
|
+
return "rect";
|
|
582
|
+
}
|
|
583
|
+
}, "getShapeFromType"), p = {
|
|
584
|
+
id: e.id.toString(),
|
|
585
|
+
domId: "node_" + e.id.toString(),
|
|
586
|
+
label: e.descr,
|
|
587
|
+
labelType: "markdown",
|
|
588
|
+
isGroup: !1,
|
|
589
|
+
shape: h(e.type),
|
|
590
|
+
width: e.width,
|
|
591
|
+
height: e.height ?? 0,
|
|
592
|
+
padding: e.padding,
|
|
593
|
+
cssClasses: t,
|
|
594
|
+
cssStyles: [],
|
|
595
|
+
// Mindmap styles don't set text-anchor: middle, so SVG-text labels must be
|
|
596
|
+
// offset by half their width to be centred (issue #8387)
|
|
597
|
+
centerLabel: !0,
|
|
598
|
+
look: d.look,
|
|
599
|
+
icon: e.icon,
|
|
600
|
+
x: e.x,
|
|
601
|
+
y: e.y,
|
|
602
|
+
// Mindmap-specific properties
|
|
603
|
+
level: e.level,
|
|
604
|
+
nodeId: e.nodeId,
|
|
605
|
+
type: e.type,
|
|
606
|
+
section: e.section
|
|
607
|
+
};
|
|
608
|
+
if (n.push(p), e.children)
|
|
609
|
+
for (const m of e.children)
|
|
610
|
+
this.flattenNodes(m, n);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Generate edges from parent-child relationships in mindmap tree
|
|
614
|
+
* @param node - The mindmap node to process
|
|
615
|
+
* @param edges - Array to collect edges
|
|
616
|
+
*/
|
|
617
|
+
generateEdges(e, n) {
|
|
618
|
+
if (!e.children)
|
|
619
|
+
return;
|
|
620
|
+
const d = B();
|
|
621
|
+
for (const a of e.children) {
|
|
622
|
+
let t = "edge";
|
|
623
|
+
a.section !== void 0 && (t += ` section-edge-${a.section}`);
|
|
624
|
+
const h = e.level + 1;
|
|
625
|
+
t += ` edge-depth-${h}`;
|
|
626
|
+
const p = {
|
|
627
|
+
id: `edge_${e.id}_${a.id}`,
|
|
628
|
+
start: e.id.toString(),
|
|
629
|
+
end: a.id.toString(),
|
|
630
|
+
type: "normal",
|
|
631
|
+
curve: "basis",
|
|
632
|
+
thickness: "normal",
|
|
633
|
+
look: d.look,
|
|
634
|
+
classes: t,
|
|
635
|
+
// Store mindmap-specific data
|
|
636
|
+
depth: e.level,
|
|
637
|
+
section: a.section
|
|
638
|
+
};
|
|
639
|
+
n.push(p), this.generateEdges(a, n);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Get structured data for layout algorithms
|
|
644
|
+
* Following the pattern established by ER diagrams
|
|
645
|
+
* @returns Structured data containing nodes, edges, and config
|
|
646
|
+
*/
|
|
647
|
+
getData() {
|
|
648
|
+
const e = this.getMindmap(), n = B(), a = ge().layout !== void 0, t = n;
|
|
649
|
+
if (a || (t.layout = "cose-bilkent"), !e)
|
|
650
|
+
return {
|
|
651
|
+
nodes: [],
|
|
652
|
+
edges: [],
|
|
653
|
+
config: t
|
|
654
|
+
};
|
|
655
|
+
C.debug("getData: mindmapRoot", e, n), this.assignSections(e, void 0, 0, n.mindmap?.colorBy === "depth");
|
|
656
|
+
const h = [], p = [];
|
|
657
|
+
this.flattenNodes(e, h), this.generateEdges(e, p), C.debug(
|
|
658
|
+
`getData: processed ${h.length} nodes and ${p.length} edges`
|
|
659
|
+
);
|
|
660
|
+
const m = /* @__PURE__ */ new Map();
|
|
661
|
+
for (const _ of h)
|
|
662
|
+
m.set(_.id, {
|
|
663
|
+
shape: _.shape,
|
|
664
|
+
width: _.width,
|
|
665
|
+
height: _.height,
|
|
666
|
+
padding: _.padding
|
|
667
|
+
});
|
|
668
|
+
return {
|
|
669
|
+
nodes: h,
|
|
670
|
+
edges: p,
|
|
671
|
+
config: t,
|
|
672
|
+
// Store the root node for mindmap-specific layout algorithms
|
|
673
|
+
rootNode: e,
|
|
674
|
+
// Properties required by dagre layout algorithm
|
|
675
|
+
markers: ["point"],
|
|
676
|
+
// Mindmaps don't use markers
|
|
677
|
+
direction: "TB",
|
|
678
|
+
// Top-to-bottom direction for mindmaps
|
|
679
|
+
nodeSpacing: 50,
|
|
680
|
+
// Default spacing between nodes
|
|
681
|
+
rankSpacing: 50,
|
|
682
|
+
// Default spacing between ranks
|
|
683
|
+
// Add shapes for ELK compatibility
|
|
684
|
+
shapes: Object.fromEntries(m),
|
|
685
|
+
// Additional properties that layout algorithms might expect
|
|
686
|
+
type: "mindmap",
|
|
687
|
+
diagramId: "mindmap-" + _e()
|
|
688
|
+
};
|
|
689
|
+
}
|
|
690
|
+
// Expose logger to grammar
|
|
691
|
+
getLogger() {
|
|
692
|
+
return C;
|
|
693
|
+
}
|
|
694
|
+
}, xe = /* @__PURE__ */ l(async (e, n, d, a) => {
|
|
695
|
+
C.debug(`Rendering mindmap diagram
|
|
696
|
+
` + e);
|
|
697
|
+
const t = a.db, h = t.getData(), p = ae(n, h.config.securityLevel);
|
|
698
|
+
if (h.type = a.type, h.layoutAlgorithm = le(h.config.layout, {
|
|
699
|
+
fallback: "cose-bilkent"
|
|
700
|
+
}), h.diagramId = n, !t.getMindmap())
|
|
701
|
+
return;
|
|
702
|
+
h.nodes.forEach((g) => {
|
|
703
|
+
g.shape === "rounded" ? (g.radius = 15, g.taper = 15, g.stroke = "none", g.width = 0, g.padding = 15) : g.shape === "circle" ? g.padding = 10 : g.shape === "rect" ? (g.width = 0, g.padding = 10) : g.shape === "hexagon" && (g.width = 0, g.height = 0);
|
|
704
|
+
}), await he(h, p);
|
|
705
|
+
const { themeVariables: _ } = de(), { useGradient: T, gradientStart: I, gradientStop: w } = _;
|
|
706
|
+
if (T && I && w) {
|
|
707
|
+
const g = p.attr("id"), R = p.append("defs").append("linearGradient").attr("id", `${g}-gradient`).attr("gradientUnits", "objectBoundingBox").attr("x1", "0%").attr("y1", "0%").attr("x2", "100%").attr("y2", "0%");
|
|
708
|
+
R.append("stop").attr("offset", "0%").attr("stop-color", I).attr("stop-opacity", 1), R.append("stop").attr("offset", "100%").attr("stop-color", w).attr("stop-opacity", 1);
|
|
709
|
+
}
|
|
710
|
+
ce(
|
|
711
|
+
p,
|
|
712
|
+
h.config.mindmap?.padding ?? G.mindmap.padding,
|
|
713
|
+
"mindmapDiagram",
|
|
714
|
+
h.config.mindmap?.useMaxWidth ?? G.mindmap.useMaxWidth
|
|
715
|
+
);
|
|
716
|
+
}, "draw"), Ne = {
|
|
717
|
+
draw: xe
|
|
718
|
+
}, Le = /* @__PURE__ */ l((e) => {
|
|
719
|
+
const { theme: n, look: d } = e;
|
|
720
|
+
let a = "";
|
|
721
|
+
for (let t = 0; t < e.THEME_COLOR_LIMIT; t++)
|
|
722
|
+
e["lineColor" + t] = e["lineColor" + t] || e["cScaleInv" + t], ue(e["lineColor" + t]) ? e["lineColor" + t] = pe(e["lineColor" + t], 20) : e["lineColor" + t] = fe(e["lineColor" + t], 20);
|
|
723
|
+
for (let t = 0; t < e.THEME_COLOR_LIMIT; t++) {
|
|
724
|
+
const h = "" + (d === "neo" ? Math.max(10 - (t - 1) * 2, 2) : 17 - 3 * t), p = n === "redux" || n === "redux-dark" ? e.nodeBorder : e["cScaleLabel" + (n === "neutral" ? 1 : t)];
|
|
725
|
+
a += `
|
|
726
|
+
.section-${t - 1} rect, .section-${t - 1} path, .section-${t - 1} circle, .section-${t - 1} polygon, .section-${t - 1} path {
|
|
727
|
+
fill: ${e["cScale" + t]};
|
|
728
|
+
}
|
|
729
|
+
.section-${t - 1} text {
|
|
730
|
+
fill: ${e["cScaleLabel" + t]};
|
|
731
|
+
}
|
|
732
|
+
.section-${t - 1} span {
|
|
733
|
+
color: ${e["cScaleLabel" + t]};
|
|
734
|
+
}
|
|
735
|
+
.node-icon-${t - 1} {
|
|
736
|
+
font-size: 40px;
|
|
737
|
+
color: ${e["cScaleLabel" + t]};
|
|
738
|
+
}
|
|
739
|
+
.section-edge-${t - 1}{
|
|
740
|
+
stroke: ${e["cScale" + t]};
|
|
741
|
+
}
|
|
742
|
+
.edge-depth-${t - 1}{
|
|
743
|
+
stroke-width: ${h};
|
|
744
|
+
}
|
|
745
|
+
.section-${t - 1} line {
|
|
746
|
+
stroke: ${e["cScaleInv" + t]} ;
|
|
747
|
+
stroke-width: 3;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
.disabled, .disabled circle, .disabled text {
|
|
751
|
+
fill: lightgray;
|
|
752
|
+
}
|
|
753
|
+
.disabled text {
|
|
754
|
+
fill: #efefef;
|
|
755
|
+
}
|
|
756
|
+
[data-look="neo"].mindmap-node.section-${t - 1} rect, [data-look="neo"].mindmap-node.section-${t - 1} path, [data-look="neo"].mindmap-node.section-${t - 1} circle, [data-look="neo"].mindmap-node.section-${t - 1} polygon {
|
|
757
|
+
fill: ${n === "redux" || n === "redux-dark" || n === "neutral" ? e.mainBkg : e["cScale" + t]};
|
|
758
|
+
stroke: ${n === "redux" || n === "redux-dark" ? e.nodeBorder : e["cScale" + t]};
|
|
759
|
+
stroke-width: ${e.strokeWidth ?? 2}px;
|
|
760
|
+
}
|
|
761
|
+
[data-look="neo"].section-edge-${t - 1}{
|
|
762
|
+
stroke: ${n?.includes("redux") || n === "neo-dark" ? e.nodeBorder : e["cScale" + t]};
|
|
763
|
+
}
|
|
764
|
+
[data-look="neo"].mindmap-node.section-${t - 1} text, [data-look="neo"].mindmap-node.section-${t - 1} span {
|
|
765
|
+
fill: ${p};
|
|
766
|
+
color: ${p};
|
|
767
|
+
}
|
|
768
|
+
`;
|
|
769
|
+
}
|
|
770
|
+
return a;
|
|
771
|
+
}, "genSections"), De = /* @__PURE__ */ l((e, n, d) => {
|
|
772
|
+
let a = "";
|
|
773
|
+
for (let t = 0; t < e; t++)
|
|
774
|
+
a += `
|
|
775
|
+
[data-look="neo"].mindmap-node.section-${t - 1} rect, [data-look="neo"].mindmap-node.section-${t - 1} path, [data-look="neo"].mindmap-node.section-${t - 1} circle, [data-look="neo"].mindmap-node.section-${t - 1} polygon {
|
|
776
|
+
stroke: url(${n}-gradient);
|
|
777
|
+
fill: ${d};
|
|
778
|
+
}
|
|
779
|
+
.section-${t - 1} line {
|
|
780
|
+
stroke-width: 0;
|
|
781
|
+
}`;
|
|
782
|
+
return a;
|
|
783
|
+
}, "genGradient"), ve = /* @__PURE__ */ l((e) => {
|
|
784
|
+
const { theme: n } = e, d = e.svgId, a = n?.includes("redux") ? e.nodeBorder : e["cScaleLabel" + (n === "neutral" ? 1 : 0)], t = e.dropShadow ? e.dropShadow.replace("url(#drop-shadow)", `url(${d}-drop-shadow)`) : "none";
|
|
785
|
+
return `
|
|
786
|
+
.edge {
|
|
787
|
+
stroke-width: 3;
|
|
788
|
+
}
|
|
789
|
+
${Le(e)}
|
|
790
|
+
.section-root rect, .section-root path, .section-root circle, .section-root polygon {
|
|
791
|
+
fill: ${e.git0};
|
|
792
|
+
}
|
|
793
|
+
.section-root text {
|
|
794
|
+
fill: ${e.gitBranchLabel0};
|
|
795
|
+
}
|
|
796
|
+
.section-root span {
|
|
797
|
+
color: ${n?.includes("redux") ? e.nodeBorder : e.gitBranchLabel0};
|
|
798
|
+
}
|
|
799
|
+
.icon-container {
|
|
800
|
+
height:100%;
|
|
801
|
+
display: flex;
|
|
802
|
+
justify-content: center;
|
|
803
|
+
align-items: center;
|
|
804
|
+
}
|
|
805
|
+
.edge {
|
|
806
|
+
fill: none;
|
|
807
|
+
}
|
|
808
|
+
.mindmap-node-label {
|
|
809
|
+
dy: 1em;
|
|
810
|
+
alignment-baseline: middle;
|
|
811
|
+
text-anchor: middle;
|
|
812
|
+
dominant-baseline: middle;
|
|
813
|
+
text-align: center;
|
|
814
|
+
}
|
|
815
|
+
[data-look="neo"].mindmap-node {
|
|
816
|
+
filter: ${t};
|
|
817
|
+
}
|
|
818
|
+
[data-look="neo"].mindmap-node.section-root rect, [data-look="neo"].mindmap-node.section-root path, [data-look="neo"].mindmap-node.section-root circle, [data-look="neo"].mindmap-node.section-root polygon {
|
|
819
|
+
fill: ${n?.includes("redux") ? e.mainBkg : e.git0};
|
|
820
|
+
}
|
|
821
|
+
[data-look="neo"].mindmap-node.section-root .text-inner-tspan, [data-look="neo"].mindmap-node.section-root span {
|
|
822
|
+
fill: ${a};
|
|
823
|
+
color: ${a};
|
|
824
|
+
}
|
|
825
|
+
${e.useGradient && d && e.mainBkg ? De(e.THEME_COLOR_LIMIT, d, e.mainBkg) : ""}
|
|
826
|
+
`;
|
|
827
|
+
}, "getStyles"), Te = ve, we = {
|
|
828
|
+
get db() {
|
|
829
|
+
return new Se();
|
|
830
|
+
},
|
|
831
|
+
renderer: Ne,
|
|
832
|
+
parser: ke,
|
|
833
|
+
styles: Te
|
|
834
|
+
};
|
|
835
|
+
export {
|
|
836
|
+
we as diagram
|
|
837
|
+
};
|