mio-previewer 0.1.8 → 0.2.1
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 +1 -0
- package/dist/_basePickBy-CLm1CU0x.cjs +1 -0
- package/dist/{_basePickBy-CFTZygnR.js → _basePickBy-DkRiFJ-E.js} +8 -8
- package/dist/{_baseUniq-COpRdEZm.js → _baseUniq-B1fwYad5.js} +1 -1
- package/dist/_baseUniq-CekcHsBe.cjs +1 -0
- package/dist/arc-CDhMgH2B.cjs +1 -0
- package/dist/{arc-CA-zaVHH.js → arc-D4W5-yWb.js} +15 -15
- package/dist/{architecture-O4VJ6CD3-CpYFg8kG.cjs → architecture-O4VJ6CD3-BbHBghel.cjs} +1 -1
- package/dist/{architecture-O4VJ6CD3-DhXiEYF9.js → architecture-O4VJ6CD3-CfP8XjP0.js} +1 -1
- package/dist/architectureDiagram-VXUJARFQ-BDL3gedm.cjs +36 -0
- package/dist/{architectureDiagram-VXUJARFQ-CMDGkfwW.js → architectureDiagram-VXUJARFQ-CzJivHFY.js} +132 -132
- package/dist/{blockDiagram-VD42YOAC-BboMD6jZ.cjs → blockDiagram-VD42YOAC-DBdqFDLx.cjs} +4 -4
- package/dist/{blockDiagram-VD42YOAC-B6yyyBoP.js → blockDiagram-VD42YOAC-D_XZl2Eb.js} +45 -45
- package/dist/{c4Diagram-YG6GDRKO-CAnMUU5Q.cjs → c4Diagram-YG6GDRKO-2hnuZJHF.cjs} +1 -1
- package/dist/{c4Diagram-YG6GDRKO-Bk3UfYds.js → c4Diagram-YG6GDRKO-CgC6tqEJ.js} +2 -2
- package/dist/{channel-CGHeB_wL.js → channel-CraiSeQV.js} +1 -1
- package/dist/channel-xOMKg_-4.cjs +1 -0
- package/dist/{chunk-4BX2VUAB-DQLiny3u.js → chunk-4BX2VUAB-CVf_ETaQ.js} +1 -1
- package/dist/chunk-4BX2VUAB-egC12k7-.cjs +1 -0
- package/dist/chunk-55IACEB6-BFZ7JSqc.cjs +1 -0
- package/dist/{chunk-55IACEB6-BvzkNW0T.js → chunk-55IACEB6-Dq94Wdt4.js} +3 -3
- package/dist/{chunk-B4BG7PRW-XH3xle9g.js → chunk-B4BG7PRW-oCKTyeaQ.js} +10 -10
- package/dist/{chunk-B4BG7PRW-DNWDyosT.cjs → chunk-B4BG7PRW-znGfblLg.cjs} +3 -3
- package/dist/{chunk-DI55MBZ5-DBabq0PW.cjs → chunk-DI55MBZ5-B7AP9KYc.cjs} +1 -1
- package/dist/{chunk-DI55MBZ5-7cI7r4vk.js → chunk-DI55MBZ5-DS_khDur.js} +3 -3
- package/dist/{chunk-FMBD7UC4-Z_IXsR9N.js → chunk-FMBD7UC4-0lVTgxji.js} +1 -1
- package/dist/{chunk-FMBD7UC4-BSSIfQJH.cjs → chunk-FMBD7UC4-DG4kzLo5.cjs} +1 -1
- package/dist/chunk-QN33PNHL-B6EPgPXH.cjs +1 -0
- package/dist/{chunk-QN33PNHL-dvg-wDdg.js → chunk-QN33PNHL-kjCT84jb.js} +1 -1
- package/dist/{chunk-QZHKN3VN-Chg9twhX.js → chunk-QZHKN3VN-DfYqbQcN.js} +1 -1
- package/dist/chunk-QZHKN3VN-Dmm7H5Wh.cjs +1 -0
- package/dist/chunk-TZMSLE5B-BrlmtB2t.cjs +1 -0
- package/dist/{chunk-TZMSLE5B-CIgbKyu_.js → chunk-TZMSLE5B-Cuq8NlPB.js} +1 -1
- package/dist/{classDiagram-v2-WZHVMYZB-CC9xOx_t.js → classDiagram-2ON5EDUG-Dczgi8gS.js} +2 -2
- package/dist/classDiagram-2ON5EDUG-wUPqnDRS.cjs +1 -0
- package/dist/{classDiagram-2ON5EDUG-CC9xOx_t.js → classDiagram-v2-WZHVMYZB-Dczgi8gS.js} +2 -2
- package/dist/classDiagram-v2-WZHVMYZB-wUPqnDRS.cjs +1 -0
- package/dist/clone-CrbBHCXn.cjs +1 -0
- package/dist/{clone-BrZZgHT6.js → clone-D9hv1j1h.js} +1 -1
- package/dist/{cose-bilkent-S5V4N54A-CDs3BBYp.js → cose-bilkent-S5V4N54A-KSElLyuF.js} +1 -1
- package/dist/cose-bilkent-S5V4N54A-rnw0q93t.cjs +1 -0
- package/dist/{dagre-6UL2VRFP-BlMhpFnF.js → dagre-6UL2VRFP-DOkXRRgJ.js} +119 -119
- package/dist/dagre-6UL2VRFP-T5CrPZNR.cjs +4 -0
- package/dist/diagram-PSM6KHXK-BXEAwzcF.cjs +24 -0
- package/dist/{diagram-PSM6KHXK-CoqSYWPX.js → diagram-PSM6KHXK-D7HktmMw.js} +53 -53
- package/dist/diagram-QEK2KX5R-BI-PDB7j.cjs +43 -0
- package/dist/{diagram-QEK2KX5R-FqbXBaqH.js → diagram-QEK2KX5R-Do7jHmxP.js} +20 -20
- package/dist/{diagram-S2PKOQOG-u-4zOtyY.js → diagram-S2PKOQOG-CSG6KtCZ.js} +23 -23
- package/dist/diagram-S2PKOQOG-CfhmS5k7.cjs +24 -0
- package/dist/{erDiagram-Q2GNP2WA-DWDeWLTL.cjs → erDiagram-Q2GNP2WA-Cw4tn2_6.cjs} +1 -1
- package/dist/{erDiagram-Q2GNP2WA-CXn9GtvJ.js → erDiagram-Q2GNP2WA-DidqXQWU.js} +4 -4
- package/dist/{flowDiagram-NV44I4VS-CvRJQSEg.js → flowDiagram-NV44I4VS-BqlQb2cR.js} +14 -14
- package/dist/{flowDiagram-NV44I4VS-C60QhUiz.cjs → flowDiagram-NV44I4VS-CUQTe4t9.cjs} +3 -3
- package/dist/{ganttDiagram-LVOFAZNH-bsx5CB5d.js → ganttDiagram-LVOFAZNH-B0C3qg5A.js} +2 -2
- package/dist/ganttDiagram-LVOFAZNH-B8jOPmLu.cjs +267 -0
- package/dist/{gitGraph-ZV4HHKMB-kRwxNQnW.cjs → gitGraph-ZV4HHKMB-CB9ajhxp.cjs} +1 -1
- package/dist/{gitGraph-ZV4HHKMB-BjAayPSR.js → gitGraph-ZV4HHKMB-CsN5cpQO.js} +1 -1
- package/dist/gitGraphDiagram-NY62KEGX-CXj0aQIN.cjs +65 -0
- package/dist/{gitGraphDiagram-NY62KEGX-DPM59sAG.js → gitGraphDiagram-NY62KEGX-ynz3n_1e.js} +45 -45
- package/dist/{graph-CilVg985.js → graph-BhAte7-5.js} +8 -8
- package/dist/graph-CIIQn5I2.cjs +1 -0
- package/dist/info-63CPKGFF-BvtdIoYJ.js +5 -0
- package/dist/{info-63CPKGFF-BKQtOsLZ.cjs → info-63CPKGFF-CG29IRtn.cjs} +1 -1
- package/dist/{infoDiagram-F6ZHWCRC-B6bTTLIe.js → infoDiagram-F6ZHWCRC-DcQBnkg_.js} +2 -2
- package/dist/infoDiagram-F6ZHWCRC-DnzUBQVK.cjs +2 -0
- package/dist/{journeyDiagram-XKPGCS4Q-BKPpLUXu.js → journeyDiagram-XKPGCS4Q-BdVWBQtJ.js} +4 -4
- package/dist/{journeyDiagram-XKPGCS4Q-CkWQvbbC.cjs → journeyDiagram-XKPGCS4Q-CdEW4XYQ.cjs} +1 -1
- package/dist/{kanban-definition-3W4ZIXB7-DzI_mEvf.cjs → kanban-definition-3W4ZIXB7-Bew0p3Gl.cjs} +2 -2
- package/dist/{kanban-definition-3W4ZIXB7-CLac2PpK.js → kanban-definition-3W4ZIXB7-DNIjwCXt.js} +44 -44
- package/dist/{layout-DOxjVt30.js → layout-DCZpTOLI.js} +4 -4
- package/dist/layout-DbqGrWwU.cjs +1 -0
- package/dist/{linear-nITCRSwN.js → linear-CsY9QRc_.js} +25 -25
- package/dist/linear-D57Dxm3q.cjs +1 -0
- package/dist/{mermaid-parser.core-BvyFzRhX.js → mermaid-parser.core-BbluJX95.js} +205 -205
- package/dist/{mermaid-parser.core-YAHoRfr_.cjs → mermaid-parser.core-ga2HTHrF.cjs} +2 -2
- package/dist/{mindmap-definition-VGOIOE7T-8Pk45I0T.cjs → mindmap-definition-VGOIOE7T-BEftwNrA.cjs} +2 -2
- package/dist/{mindmap-definition-VGOIOE7T-BTlAV786.js → mindmap-definition-VGOIOE7T-BbQTn5PO.js} +18 -18
- package/dist/mio-previewer.cjs.js +21 -13
- package/dist/mio-previewer.css +9 -1
- package/dist/mio-previewer.es.js +3647 -2009
- package/dist/{packet-HUATNLJX-Cn2d6cbh.js → packet-HUATNLJX-BYZ-7unW.js} +1 -1
- package/dist/{packet-HUATNLJX-CNiEJWxQ.cjs → packet-HUATNLJX-C9LbRxXz.cjs} +1 -1
- package/dist/{pie-WTHONI2E-CEUZL-GO.cjs → pie-WTHONI2E-DqVTGoNP.cjs} +1 -1
- package/dist/pie-WTHONI2E-i-288QEL.js +5 -0
- package/dist/pieDiagram-ADFJNKIX-BoOaszr6.cjs +30 -0
- package/dist/{pieDiagram-ADFJNKIX-CgDIBKwo.js → pieDiagram-ADFJNKIX-D7kjaWIZ.js} +44 -44
- package/dist/plugins/custom.cjs.js +1 -1
- package/dist/plugins/custom.es.js +79 -5
- package/dist/{quadrantDiagram-AYHSOK5B-CExSZwWH.cjs → quadrantDiagram-AYHSOK5B-COeV74SO.cjs} +1 -1
- package/dist/{quadrantDiagram-AYHSOK5B-TlBxKPiG.js → quadrantDiagram-AYHSOK5B-DjM4MGYN.js} +2 -2
- package/dist/radar-NJJJXTRR-Itq_ens6.js +5 -0
- package/dist/{radar-NJJJXTRR-D3p36qrE.cjs → radar-NJJJXTRR-bh6UuQXP.cjs} +1 -1
- package/dist/{requirementDiagram-UZGBJVZJ-Dl5ijlU7.js → requirementDiagram-UZGBJVZJ-CLdoLgSy.js} +27 -27
- package/dist/{requirementDiagram-UZGBJVZJ-BEcIIQ5C.cjs → requirementDiagram-UZGBJVZJ-DQIhoyrr.cjs} +1 -1
- package/dist/{sankeyDiagram-TZEHDZUN-bIR5yy8v.js → sankeyDiagram-TZEHDZUN-BAvVLG4v.js} +56 -56
- package/dist/sankeyDiagram-TZEHDZUN-D5xHz_Jm.cjs +10 -0
- package/dist/{sequenceDiagram-WL72ISMW-DT79Xx9V.js → sequenceDiagram-WL72ISMW-BAbKiRZ0.js} +3 -3
- package/dist/{sequenceDiagram-WL72ISMW-BG5OjhGw.cjs → sequenceDiagram-WL72ISMW-DLHURQob.cjs} +9 -9
- package/dist/{stateDiagram-FKZM4ZOC-CDfDuz0s.js → stateDiagram-FKZM4ZOC-WqHhHjjY.js} +16 -16
- package/dist/stateDiagram-FKZM4ZOC-n9QD1QXN.cjs +1 -0
- package/dist/stateDiagram-v2-4FDKWEC3-BpPIZzZI.cjs +1 -0
- package/dist/{stateDiagram-v2-4FDKWEC3-DroYR31A.js → stateDiagram-v2-4FDKWEC3-CJNT1WZZ.js} +2 -2
- package/dist/{timeline-definition-IT6M3QCI-CzA493Rr.js → timeline-definition-IT6M3QCI-Cq-b0lZ9.js} +24 -24
- package/dist/{timeline-definition-IT6M3QCI-BxCHgT34.cjs → timeline-definition-IT6M3QCI-CxbbLtcJ.cjs} +5 -5
- package/dist/{treemap-75Q7IDZK-hLeVdex4.cjs → treemap-75Q7IDZK-CfpODdSf.cjs} +1 -1
- package/dist/{treemap-75Q7IDZK-B7s32RV1.js → treemap-75Q7IDZK-DfpWbF7x.js} +1 -1
- package/dist/types/composables/useImageViewerManager.d.ts +11 -0
- package/dist/types/main-image-viewer-demo.d.ts +1 -0
- package/dist/types/plugins/custom/codeBlockPlugin.d.ts +11 -0
- package/dist/types/plugins/custom/imageViewerPlugin.d.ts +57 -0
- package/dist/types/plugins/custom/index.d.ts +2 -0
- package/dist/types/plugins/custom/mermaidPlugin.d.ts +15 -1
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/types.d.ts +23 -1
- package/dist/{cursorPlugin-CLM_tkck.js → viewer-B_aUwzOk.js} +3837 -3762
- package/dist/{cursorPlugin-vB5SgZWZ.cjs → viewer-C7W6Xd8R.cjs} +59 -59
- package/dist/{xychartDiagram-PRI3JC2R-DQLU-dCp.cjs → xychartDiagram-PRI3JC2R-4B9yAJO8.cjs} +1 -1
- package/dist/{xychartDiagram-PRI3JC2R-Bb_Kt4vj.js → xychartDiagram-PRI3JC2R-Dexq6uU_.js} +29 -29
- package/package.json +2 -1
- package/dist/_basePickBy-tPOC0EMH.cjs +0 -1
- package/dist/_baseUniq-DqpG5gxq.cjs +0 -1
- package/dist/arc-D6SpLjCN.cjs +0 -1
- package/dist/architectureDiagram-VXUJARFQ-C-ZDGP3T.cjs +0 -36
- package/dist/channel-By4yEUpY.cjs +0 -1
- package/dist/chunk-4BX2VUAB-r3h9zqZy.cjs +0 -1
- package/dist/chunk-55IACEB6-F8U2tzR2.cjs +0 -1
- package/dist/chunk-QN33PNHL-Cb-RTcJE.cjs +0 -1
- package/dist/chunk-QZHKN3VN-DR2ed2kF.cjs +0 -1
- package/dist/chunk-TZMSLE5B-D3CSz4N0.cjs +0 -1
- package/dist/classDiagram-2ON5EDUG-De8Dohf7.cjs +0 -1
- package/dist/classDiagram-v2-WZHVMYZB-De8Dohf7.cjs +0 -1
- package/dist/clone-CXoO9ncp.cjs +0 -1
- package/dist/cose-bilkent-S5V4N54A-0DFD6rcw.cjs +0 -1
- package/dist/dagre-6UL2VRFP-DuUBkSw0.cjs +0 -4
- package/dist/diagram-PSM6KHXK-CmQ4F2JN.cjs +0 -24
- package/dist/diagram-QEK2KX5R-DqSiNmiR.cjs +0 -43
- package/dist/diagram-S2PKOQOG-DYEcRvla.cjs +0 -24
- package/dist/ganttDiagram-LVOFAZNH-DuTD48a9.cjs +0 -267
- package/dist/gitGraphDiagram-NY62KEGX-DsyQIiCo.cjs +0 -65
- package/dist/graph-T55iHwif.cjs +0 -1
- package/dist/info-63CPKGFF-D-_lE7q9.js +0 -5
- package/dist/infoDiagram-F6ZHWCRC-Dfs9venE.cjs +0 -2
- package/dist/layout-LjH1X4pD.cjs +0 -1
- package/dist/linear-BZdfTIw6.cjs +0 -1
- package/dist/pie-WTHONI2E-COsOPmmh.js +0 -5
- package/dist/pieDiagram-ADFJNKIX-8mFQx_vI.cjs +0 -30
- package/dist/radar-NJJJXTRR-hKx4VhDB.js +0 -5
- package/dist/sankeyDiagram-TZEHDZUN-_AuPE8rx.cjs +0 -10
- package/dist/stateDiagram-FKZM4ZOC-CaZkY5ch.cjs +0 -1
- package/dist/stateDiagram-v2-4FDKWEC3-GfIoqgb_.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as G, a as
|
|
2
|
-
import { _ as f,
|
|
3
|
-
import { G as O } from "./graph-
|
|
4
|
-
import { l as J } from "./layout-
|
|
1
|
+
import { s as G, a as W, S as N } from "./chunk-DI55MBZ5-DS_khDur.js";
|
|
2
|
+
import { _ as f, c as t, d as H, l as S, e as P, k as z, R as _, S as U, O as C, u as F } from "./viewer-B_aUwzOk.js";
|
|
3
|
+
import { G as O } from "./graph-BhAte7-5.js";
|
|
4
|
+
import { l as J } from "./layout-DCZpTOLI.js";
|
|
5
5
|
var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit).attr("cy", t().state.padding + t().state.sizeUnit), "drawStartState"), D = /* @__PURE__ */ f((e) => e.append("line").style("stroke", "grey").style("stroke-dasharray", "3").attr("x1", t().state.textHeight).attr("class", "divider").attr("x2", t().state.textHeight * 2).attr("y1", 0).attr("y2", 0), "drawDivider"), Y = /* @__PURE__ */ f((e, i) => {
|
|
6
6
|
const d = e.append("text").attr("x", 2 * t().state.padding).attr("y", t().state.textHeight + 2 * t().state.padding).attr("font-size", t().state.fontSize).attr("class", "state-title").text(i.id), c = d.node().getBBox();
|
|
7
7
|
return e.insert("rect", ":first-child").attr("x", t().state.padding).attr("y", t().state.padding).attr("width", c.width + 2 * t().state.padding).attr("height", c.height + 2 * t().state.padding).attr("rx", t().state.radius), d;
|
|
@@ -43,14 +43,14 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
43
43
|
).attr(
|
|
44
44
|
"cy",
|
|
45
45
|
t().state.padding + t().state.sizeUnit + t().state.miniPadding
|
|
46
|
-
), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"),
|
|
46
|
+
), e.append("circle").attr("class", "end-state-inner").attr("r", t().state.sizeUnit).attr("cx", t().state.padding + t().state.sizeUnit + 2).attr("cy", t().state.padding + t().state.sizeUnit + 2)), "drawEndState"), Z = /* @__PURE__ */ f((e, i) => {
|
|
47
47
|
let d = t().state.forkWidth, c = t().state.forkHeight;
|
|
48
48
|
if (i.parentId) {
|
|
49
49
|
let n = d;
|
|
50
50
|
d = c, c = n;
|
|
51
51
|
}
|
|
52
52
|
return e.append("rect").style("stroke", "black").style("fill", "black").attr("width", d).attr("height", c).attr("x", t().state.padding).attr("y", t().state.padding);
|
|
53
|
-
}, "drawForkJoinState"),
|
|
53
|
+
}, "drawForkJoinState"), j = /* @__PURE__ */ f((e, i, d, c) => {
|
|
54
54
|
let n = 0;
|
|
55
55
|
const l = c.append("text");
|
|
56
56
|
l.style("text-anchor", "start"), l.attr("class", "noteText");
|
|
@@ -70,9 +70,9 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
return { textWidth: l.node().getBBox().width, textHeight: n };
|
|
73
|
-
}, "_drawLongText"),
|
|
73
|
+
}, "_drawLongText"), K = /* @__PURE__ */ f((e, i) => {
|
|
74
74
|
i.attr("class", "state-note");
|
|
75
|
-
const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } =
|
|
75
|
+
const d = i.append("rect").attr("x", 0).attr("y", t().state.padding), c = i.append("g"), { textWidth: n, textHeight: l } = j(e, 0, 0, c);
|
|
76
76
|
return d.attr("height", l + 2 * t().state.noteMargin), d.attr("width", n + t().state.noteMargin * 2), d;
|
|
77
77
|
}, "drawNote"), L = /* @__PURE__ */ f(function(e, i) {
|
|
78
78
|
const d = i.id, c = {
|
|
@@ -81,10 +81,10 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
81
81
|
width: 0,
|
|
82
82
|
height: 0
|
|
83
83
|
}, n = e.append("g").attr("id", d).attr("class", "stateGroup");
|
|
84
|
-
i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") &&
|
|
84
|
+
i.type === "start" && X(n), i.type === "end" && q(n), (i.type === "fork" || i.type === "join") && Z(n, i), i.type === "note" && K(i.note.text, n), i.type === "divider" && D(n), i.type === "default" && i.descriptions.length === 0 && Y(n, i), i.type === "default" && i.descriptions.length > 0 && I(n, i);
|
|
85
85
|
const l = n.node().getBBox();
|
|
86
86
|
return c.width = l.width + 2 * t().state.padding, c.height = l.height + 2 * t().state.padding, c;
|
|
87
|
-
}, "drawState"),
|
|
87
|
+
}, "drawState"), R = 0, Q = /* @__PURE__ */ f(function(e, i, d) {
|
|
88
88
|
const c = /* @__PURE__ */ f(function(s) {
|
|
89
89
|
switch (s) {
|
|
90
90
|
case N.relationType.AGGREGATION:
|
|
@@ -102,7 +102,7 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
102
102
|
return s.x;
|
|
103
103
|
}).y(function(s) {
|
|
104
104
|
return s.y;
|
|
105
|
-
}).curve(U), x = e.append("path").attr("d", l(n)).attr("id", "edge" +
|
|
105
|
+
}).curve(U), x = e.append("path").attr("d", l(n)).attr("id", "edge" + R).attr("class", "transition");
|
|
106
106
|
let a = "";
|
|
107
107
|
if (t().state.arrowMarkerAbsolute && (a = C(!0)), x.attr(
|
|
108
108
|
"marker-end",
|
|
@@ -124,8 +124,8 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
124
124
|
const r = s.node().getBBox();
|
|
125
125
|
s.insert("rect", ":first-child").attr("class", "box").attr("x", w - B / 2 - t().state.padding / 2).attr("y", p - k / 2 - t().state.padding / 2 - 3.5).attr("width", B + t().state.padding).attr("height", k + t().state.padding), S.info(r);
|
|
126
126
|
}
|
|
127
|
-
|
|
128
|
-
}, "drawEdge"), b, T = {},
|
|
127
|
+
R++;
|
|
128
|
+
}, "drawEdge"), b, T = {}, V = /* @__PURE__ */ f(function() {
|
|
129
129
|
}, "setConf"), tt = /* @__PURE__ */ f(function(e) {
|
|
130
130
|
e.append("defs").append("marker").attr("id", "dependencyEnd").attr("refX", 19).attr("refY", 7).attr("markerWidth", 20).attr("markerHeight", 28).attr("orient", "auto").append("path").attr("d", "M 19,7 L9,13 L14,7 L9,1 Z");
|
|
131
131
|
}, "insertMarkers"), et = /* @__PURE__ */ f(function(e, i, d, c) {
|
|
@@ -235,7 +235,7 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
235
235
|
});
|
|
236
236
|
let E = B.getBBox();
|
|
237
237
|
a.edges().forEach(function(r) {
|
|
238
|
-
r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))),
|
|
238
|
+
r !== void 0 && a.edge(r) !== void 0 && (S.debug("Edge " + r.v + " -> " + r.w + ": " + JSON.stringify(a.edge(r))), Q(i, a.edge(r), a.edge(r).relation));
|
|
239
239
|
}), E = B.getBBox();
|
|
240
240
|
const k = {
|
|
241
241
|
id: d || "root",
|
|
@@ -245,10 +245,10 @@ var X = /* @__PURE__ */ f((e) => e.append("circle").attr("class", "start-state")
|
|
|
245
245
|
};
|
|
246
246
|
return k.width = E.width + 2 * b.padding, k.height = E.height + 2 * b.padding, S.debug("Doc rendered", k, a), k;
|
|
247
247
|
}, "renderDoc"), it = {
|
|
248
|
-
setConf:
|
|
248
|
+
setConf: V,
|
|
249
249
|
draw: et
|
|
250
250
|
}, ot = {
|
|
251
|
-
parser:
|
|
251
|
+
parser: W,
|
|
252
252
|
get db() {
|
|
253
253
|
return new N(1);
|
|
254
254
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("./chunk-DI55MBZ5-B7AP9KYc.cjs"),t=require("./viewer-C7W6Xd8R.cjs"),T=require("./graph-CIIQn5I2.cjs"),H=require("./layout-DbqGrWwU.cjs");var z=t.__name(e=>e.append("circle").attr("class","start-state").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit),"drawStartState"),L=t.__name(e=>e.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",t.getConfig2().state.textHeight).attr("class","divider").attr("x2",t.getConfig2().state.textHeight*2).attr("y1",0).attr("y2",0),"drawDivider"),A=t.__name((e,n)=>{const d=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+2*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),g=d.node().getBBox();return e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",g.width+2*t.getConfig2().state.padding).attr("height",g.height+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),d},"drawSimpleState"),P=t.__name((e,n)=>{const d=t.__name(function(c,m,y){const b=c.append("tspan").attr("x",2*t.getConfig2().state.padding).text(m);y||b.attr("dy",t.getConfig2().state.textHeight)},"addTspan"),o=e.append("text").attr("x",2*t.getConfig2().state.padding).attr("y",t.getConfig2().state.textHeight+1.3*t.getConfig2().state.padding).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.descriptions[0]).node().getBBox(),l=o.height,p=e.append("text").attr("x",t.getConfig2().state.padding).attr("y",l+t.getConfig2().state.padding*.4+t.getConfig2().state.dividerMargin+t.getConfig2().state.textHeight).attr("class","state-description");let i=!0,r=!0;n.descriptions.forEach(function(c){i||(d(p,c,r),r=!1),i=!1});const C=e.append("line").attr("x1",t.getConfig2().state.padding).attr("y1",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("y2",t.getConfig2().state.padding+l+t.getConfig2().state.dividerMargin/2).attr("class","descr-divider"),h=p.node().getBBox(),s=Math.max(h.width,o.width);return C.attr("x2",s+3*t.getConfig2().state.padding),e.insert("rect",":first-child").attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding).attr("width",s+2*t.getConfig2().state.padding).attr("height",h.height+l+2*t.getConfig2().state.padding).attr("rx",t.getConfig2().state.radius),e},"drawDescrState"),R=t.__name((e,n,d)=>{const g=t.getConfig2().state.padding,o=2*t.getConfig2().state.padding,l=e.node().getBBox(),p=l.width,i=l.x,r=e.append("text").attr("x",0).attr("y",t.getConfig2().state.titleShift).attr("font-size",t.getConfig2().state.fontSize).attr("class","state-title").text(n.id),h=r.node().getBBox().width+o;let s=Math.max(h,p);s===p&&(s=s+o);let c;const m=e.node().getBBox();n.doc,c=i-g,h>p&&(c=(p-s)/2+g),Math.abs(i-m.x)<g&&h>p&&(c=i-(h-p)/2);const y=1-t.getConfig2().state.textHeight;return e.insert("rect",":first-child").attr("x",c).attr("y",y).attr("class",d?"alt-composit":"composit").attr("width",s).attr("height",m.height+t.getConfig2().state.textHeight+t.getConfig2().state.titleShift+1).attr("rx","0"),r.attr("x",c+g),h<=p&&r.attr("x",i+(s-o)/2-h/2+g),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",t.getConfig2().state.textHeight*3).attr("rx",t.getConfig2().state.radius),e.insert("rect",":first-child").attr("x",c).attr("y",t.getConfig2().state.titleShift-t.getConfig2().state.textHeight-t.getConfig2().state.padding).attr("width",s).attr("height",m.height+3+2*t.getConfig2().state.textHeight).attr("rx",t.getConfig2().state.radius),e},"addTitleAndBox"),W=t.__name(e=>(e.append("circle").attr("class","end-state-outer").attr("r",t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+t.getConfig2().state.miniPadding),e.append("circle").attr("class","end-state-inner").attr("r",t.getConfig2().state.sizeUnit).attr("cx",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2).attr("cy",t.getConfig2().state.padding+t.getConfig2().state.sizeUnit+2)),"drawEndState"),G=t.__name((e,n)=>{let d=t.getConfig2().state.forkWidth,g=t.getConfig2().state.forkHeight;if(n.parentId){let o=d;d=g,g=o}return e.append("rect").style("stroke","black").style("fill","black").attr("width",d).attr("height",g).attr("x",t.getConfig2().state.padding).attr("y",t.getConfig2().state.padding)},"drawForkJoinState"),D=t.__name((e,n,d,g)=>{let o=0;const l=g.append("text");l.style("text-anchor","start"),l.attr("class","noteText");let p=e.replace(/\r\n/g,"<br/>");p=p.replace(/\n/g,"<br/>");const i=p.split(t.common_default.lineBreakRegex);let r=1.25*t.getConfig2().state.noteMargin;for(const C of i){const h=C.trim();if(h.length>0){const s=l.append("tspan");if(s.text(h),r===0){const c=s.node().getBBox();r+=c.height}o+=r,s.attr("x",n+t.getConfig2().state.noteMargin),s.attr("y",d+o+1.25*t.getConfig2().state.noteMargin)}}return{textWidth:l.node().getBBox().width,textHeight:o}},"_drawLongText"),U=t.__name((e,n)=>{n.attr("class","state-note");const d=n.append("rect").attr("x",0).attr("y",t.getConfig2().state.padding),g=n.append("g"),{textWidth:o,textHeight:l}=D(e,0,0,g);return d.attr("height",l+2*t.getConfig2().state.noteMargin),d.attr("width",o+t.getConfig2().state.noteMargin*2),d},"drawNote"),k=t.__name(function(e,n){const d=n.id,g={id:d,label:n.id,width:0,height:0},o=e.append("g").attr("id",d).attr("class","stateGroup");n.type==="start"&&z(o),n.type==="end"&&W(o),(n.type==="fork"||n.type==="join")&&G(o,n),n.type==="note"&&U(n.note.text,o),n.type==="divider"&&L(o),n.type==="default"&&n.descriptions.length===0&&A(o,n),n.type==="default"&&n.descriptions.length>0&&P(o,n);const l=o.node().getBBox();return g.width=l.width+2*t.getConfig2().state.padding,g.height=l.height+2*t.getConfig2().state.padding,g},"drawState"),N=0,F=t.__name(function(e,n,d){const g=t.__name(function(r){switch(r){case _.StateDB.relationType.AGGREGATION:return"aggregation";case _.StateDB.relationType.EXTENSION:return"extension";case _.StateDB.relationType.COMPOSITION:return"composition";case _.StateDB.relationType.DEPENDENCY:return"dependency"}},"getRelationType");n.points=n.points.filter(r=>!Number.isNaN(r.y));const o=n.points,l=t.line().x(function(r){return r.x}).y(function(r){return r.y}).curve(t.curveBasis),p=e.append("path").attr("d",l(o)).attr("id","edge"+N).attr("class","transition");let i="";if(t.getConfig2().state.arrowMarkerAbsolute&&(i=t.getUrl(!0)),p.attr("marker-end","url("+i+"#"+g(_.StateDB.relationType.DEPENDENCY)+"End)"),d.title!==void 0){const r=e.append("g").attr("class","stateLabel"),{x:C,y:h}=t.utils_default.calcLabelPosition(n.points),s=t.common_default.getRows(d.title);let c=0;const m=[];let y=0,b=0;for(let x=0;x<=s.length;x++){const f=r.append("text").attr("text-anchor","middle").text(s[x]).attr("x",C).attr("y",h+c),u=f.node().getBBox();y=Math.max(y,u.width),b=Math.min(b,u.x),t.log.info(u.x,C,h+c),c===0&&(c=f.node().getBBox().height,t.log.info("Title height",c,h)),m.push(f)}let S=c*s.length;if(s.length>1){const x=(s.length-1)*c*.5;m.forEach((f,u)=>f.attr("y",h+u*c-x)),S=c*s.length}const a=r.node().getBBox();r.insert("rect",":first-child").attr("class","box").attr("x",C-y/2-t.getConfig2().state.padding/2).attr("y",h-S/2-t.getConfig2().state.padding/2-3.5).attr("width",y+t.getConfig2().state.padding).attr("height",S+t.getConfig2().state.padding),t.log.info(a)}N++},"drawEdge"),w,E={},O=t.__name(function(){},"setConf"),q=t.__name(function(e){e.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"insertMarkers"),J=t.__name(function(e,n,d,g){w=t.getConfig2().state;const o=t.getConfig2().securityLevel;let l;o==="sandbox"&&(l=t.select("#i"+n));const p=o==="sandbox"?t.select(l.nodes()[0].contentDocument.body):t.select("body"),i=o==="sandbox"?l.nodes()[0].contentDocument:document;t.log.debug("Rendering diagram "+e);const r=p.select(`[id='${n}']`);q(r);const C=g.db.getRootDoc();M(C,r,void 0,!1,p,i,g);const h=w.padding,s=r.node().getBBox(),c=s.width+h*2,m=s.height+h*2,y=c*1.75;t.configureSvgSize(r,m,y,w.useMaxWidth),r.attr("viewBox",`${s.x-w.padding} ${s.y-w.padding} `+c+" "+m)},"draw"),X=t.__name(e=>e?e.length*w.fontSizeFactor:1,"getLabelWidth"),M=t.__name((e,n,d,g,o,l,p)=>{const i=new T.Graph({compound:!0,multigraph:!0});let r,C=!0;for(r=0;r<e.length;r++)if(e[r].stmt==="relation"){C=!1;break}d?i.setGraph({rankdir:"LR",multigraph:!0,compound:!0,ranker:"tight-tree",ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,isMultiGraph:!0}):i.setGraph({rankdir:"TB",multigraph:!0,compound:!0,ranksep:C?1:w.edgeLengthFactor,nodeSep:C?1:50,ranker:"tight-tree",isMultiGraph:!0}),i.setDefaultEdgeLabel(function(){return{}});const h=p.db.getStates(),s=p.db.getRelations(),c=Object.keys(h);for(const a of c){const x=h[a];d&&(x.parentId=d);let f;if(x.doc){let u=n.append("g").attr("id",x.id).attr("class","stateGroup");f=M(x.doc,u,x.id,!g,o,l,p);{u=R(u,x,g);let B=u.node().getBBox();f.width=B.width,f.height=B.height+w.padding/2,E[x.id]={y:w.compositTitleSize}}}else f=k(n,x,i);if(x.note){const u={descriptions:[],id:x.id+"-note",note:x.note,type:"note"},B=k(n,u,i);x.note.position==="left of"?(i.setNode(f.id+"-note",B),i.setNode(f.id,f)):(i.setNode(f.id,f),i.setNode(f.id+"-note",B)),i.setParent(f.id,f.id+"-group"),i.setParent(f.id+"-note",f.id+"-group")}else i.setNode(f.id,f)}t.log.debug("Count=",i.nodeCount(),i);let m=0;s.forEach(function(a){m++,t.log.debug("Setting edge",a),i.setEdge(a.id1,a.id2,{relation:a,width:X(a.title),height:w.labelHeight*t.common_default.getRows(a.title).length,labelpos:"c"},"id"+m)}),H.layout(i),t.log.debug("Graph after layout",i.nodes());const y=n.node();i.nodes().forEach(function(a){a!==void 0&&i.node(a)!==void 0?(t.log.warn("Node "+a+": "+JSON.stringify(i.node(a))),o.select("#"+y.id+" #"+a).attr("transform","translate("+(i.node(a).x-i.node(a).width/2)+","+(i.node(a).y+(E[a]?E[a].y:0)-i.node(a).height/2)+" )"),o.select("#"+y.id+" #"+a).attr("data-x-shift",i.node(a).x-i.node(a).width/2),l.querySelectorAll("#"+y.id+" #"+a+" .divider").forEach(f=>{const u=f.parentElement;let B=0,v=0;u&&(u.parentElement&&(B=u.parentElement.getBBox().width),v=parseInt(u.getAttribute("data-x-shift"),10),Number.isNaN(v)&&(v=0)),f.setAttribute("x1",0-v+8),f.setAttribute("x2",B-v-8)})):t.log.debug("No Node "+a+": "+JSON.stringify(i.node(a)))});let b=y.getBBox();i.edges().forEach(function(a){a!==void 0&&i.edge(a)!==void 0&&(t.log.debug("Edge "+a.v+" -> "+a.w+": "+JSON.stringify(i.edge(a))),F(n,i.edge(a),i.edge(a).relation))}),b=y.getBBox();const S={id:d||"root",label:d||"root",width:0,height:0};return S.width=b.width+2*w.padding,S.height=b.height+2*w.padding,t.log.debug("Doc rendered",S,i),S},"renderDoc"),I={setConf:O,draw:J},Y={parser:_.stateDiagram_default,get db(){return new _.StateDB(1)},renderer:I,styles:_.styles_default,init:t.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=Y;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./chunk-DI55MBZ5-B7AP9KYc.cjs"),r=require("./viewer-C7W6Xd8R.cjs");var a={parser:t.stateDiagram_default,get db(){return new t.StateDB(2)},renderer:t.stateRenderer_v3_unified_default,styles:t.styles_default,init:r.__name(e=>{e.state||(e.state={}),e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},"init")};exports.diagram=a;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as a, b as t, a as r, S as s } from "./chunk-DI55MBZ5-
|
|
2
|
-
import { _ as i } from "./
|
|
1
|
+
import { s as a, b as t, a as r, S as s } from "./chunk-DI55MBZ5-DS_khDur.js";
|
|
2
|
+
import { _ as i } from "./viewer-B_aUwzOk.js";
|
|
3
3
|
var _ = {
|
|
4
4
|
parser: r,
|
|
5
5
|
get db() {
|
package/dist/{timeline-definition-IT6M3QCI-CzA493Rr.js → timeline-definition-IT6M3QCI-Cq-b0lZ9.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as s,
|
|
2
|
-
import { d as nt } from "./arc-
|
|
1
|
+
import { _ as s, c as xt, l as E, d as j, V as kt, W as vt, X as _t, Y as bt, B as wt, $ as St, y as Et } from "./viewer-B_aUwzOk.js";
|
|
2
|
+
import { d as nt } from "./arc-D4W5-yWb.js";
|
|
3
3
|
var Q = (function() {
|
|
4
4
|
var n = /* @__PURE__ */ s(function(x, r, a, c) {
|
|
5
5
|
for (a = a || {}, c = x.length; c--; a[x[c]] = r) ;
|
|
@@ -62,13 +62,13 @@ var Q = (function() {
|
|
|
62
62
|
}
|
|
63
63
|
}, "parseError"),
|
|
64
64
|
parse: /* @__PURE__ */ s(function(r) {
|
|
65
|
-
var a = this, c = [0], u = [], y = [null], o = [], w = this.table, v = "", N = 0, P = 0,
|
|
65
|
+
var a = this, c = [0], u = [], y = [null], o = [], w = this.table, v = "", N = 0, P = 0, W = 2, U = 1, H = o.slice.call(arguments, 1), g = Object.create(this.lexer), b = { yy: {} };
|
|
66
66
|
for (var L in this.yy)
|
|
67
67
|
Object.prototype.hasOwnProperty.call(this.yy, L) && (b.yy[L] = this.yy[L]);
|
|
68
68
|
g.setInput(r, b.yy), b.yy.lexer = g, b.yy.parser = this, typeof g.yylloc > "u" && (g.yylloc = {});
|
|
69
69
|
var $ = g.yylloc;
|
|
70
70
|
o.push($);
|
|
71
|
-
var
|
|
71
|
+
var z = g.options && g.options.ranges;
|
|
72
72
|
typeof b.yy.parseError == "function" ? this.parseError = b.yy.parseError : this.parseError = Object.getPrototypeOf(this).parseError;
|
|
73
73
|
function Z(T) {
|
|
74
74
|
c.length = c.length - 2 * T, y.length = y.length - T, o.length = o.length - T;
|
|
@@ -84,7 +84,7 @@ var Q = (function() {
|
|
|
84
84
|
var K = "";
|
|
85
85
|
O = [];
|
|
86
86
|
for (B in w[A])
|
|
87
|
-
this.terminals_[B] && B >
|
|
87
|
+
this.terminals_[B] && B > W && O.push("'" + this.terminals_[B] + "'");
|
|
88
88
|
g.showPosition ? K = "Parse error on line " + (N + 1) + `:
|
|
89
89
|
` + g.showPosition() + `
|
|
90
90
|
Expecting ` + O.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : K = "Parse error on line " + (N + 1) + ": Unexpected " + (S == U ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(K, {
|
|
@@ -107,7 +107,7 @@ Expecting ` + O.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : K = "
|
|
|
107
107
|
last_line: o[o.length - 1].last_line,
|
|
108
108
|
first_column: o[o.length - (M || 1)].first_column,
|
|
109
109
|
last_column: o[o.length - 1].last_column
|
|
110
|
-
},
|
|
110
|
+
}, z && (R._$.range = [
|
|
111
111
|
o[o.length - (M || 1)].range[0],
|
|
112
112
|
o[o.length - 1].range[1]
|
|
113
113
|
]), J = this.performAction.apply(R, [
|
|
@@ -366,8 +366,8 @@ wt(at, {
|
|
|
366
366
|
getSections: () => dt,
|
|
367
367
|
getTasks: () => ut
|
|
368
368
|
});
|
|
369
|
-
var F = "", lt = 0, X = [], G = [],
|
|
370
|
-
X.length = 0, G.length = 0, F = "",
|
|
369
|
+
var F = "", lt = 0, X = [], G = [], V = [], ot = /* @__PURE__ */ s(() => St, "getCommonDb"), ct = /* @__PURE__ */ s(function() {
|
|
370
|
+
X.length = 0, G.length = 0, F = "", V.length = 0, Et();
|
|
371
371
|
}, "clear"), ht = /* @__PURE__ */ s(function(n) {
|
|
372
372
|
F = n, X.push(n);
|
|
373
373
|
}, "addSection"), dt = /* @__PURE__ */ s(function() {
|
|
@@ -378,7 +378,7 @@ var F = "", lt = 0, X = [], G = [], z = [], ot = /* @__PURE__ */ s(() => St, "ge
|
|
|
378
378
|
let e = 0;
|
|
379
379
|
for (; !n && e < t; )
|
|
380
380
|
n = it(), e++;
|
|
381
|
-
return G.push(...
|
|
381
|
+
return G.push(...V), G;
|
|
382
382
|
}, "getTasks"), pt = /* @__PURE__ */ s(function(n, t, e) {
|
|
383
383
|
const l = {
|
|
384
384
|
id: lt++,
|
|
@@ -389,9 +389,9 @@ var F = "", lt = 0, X = [], G = [], z = [], ot = /* @__PURE__ */ s(() => St, "ge
|
|
|
389
389
|
//if event is defined, then add it the events array
|
|
390
390
|
events: e ? [e] : []
|
|
391
391
|
};
|
|
392
|
-
|
|
392
|
+
V.push(l);
|
|
393
393
|
}, "addTask"), yt = /* @__PURE__ */ s(function(n) {
|
|
394
|
-
|
|
394
|
+
V.find((e) => e.id === lt - 1).events.push(n);
|
|
395
395
|
}, "addEvent"), gt = /* @__PURE__ */ s(function(n) {
|
|
396
396
|
const t = {
|
|
397
397
|
section: F,
|
|
@@ -403,10 +403,10 @@ var F = "", lt = 0, X = [], G = [], z = [], ot = /* @__PURE__ */ s(() => St, "ge
|
|
|
403
403
|
G.push(t);
|
|
404
404
|
}, "addTaskOrg"), it = /* @__PURE__ */ s(function() {
|
|
405
405
|
const n = /* @__PURE__ */ s(function(e) {
|
|
406
|
-
return
|
|
406
|
+
return V[e].processed;
|
|
407
407
|
}, "compileTask");
|
|
408
408
|
let t = !0;
|
|
409
|
-
for (const [e, l] of
|
|
409
|
+
for (const [e, l] of V.entries())
|
|
410
410
|
n(e), t = t && l.processed;
|
|
411
411
|
return t;
|
|
412
412
|
}, "compileTasks"), It = {
|
|
@@ -560,11 +560,11 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
560
560
|
(t.class ? t.class + " " : "") + "timeline-node " + ("section-" + i)
|
|
561
561
|
);
|
|
562
562
|
const h = d.append("g"), f = d.append("g"), p = f.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(D, t.width).node().getBBox(), k = l.fontSize?.replace ? l.fontSize.replace("px", "") : l.fontSize;
|
|
563
|
-
return t.height = p.height + k * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, f.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"),
|
|
564
|
-
}, "drawNode"),
|
|
563
|
+
return t.height = p.height + k * 1.1 * 0.5 + t.padding, t.height = Math.max(t.height, t.maxHeight), t.width = t.width + 2 * t.padding, f.attr("transform", "translate(" + t.width / 2 + ", " + t.padding / 2 + ")"), Wt(h, t, i, l), t;
|
|
564
|
+
}, "drawNode"), Vt = /* @__PURE__ */ s(function(n, t, e) {
|
|
565
565
|
const l = n.append("g"), d = l.append("text").text(t.descr).attr("dy", "1em").attr("alignment-baseline", "middle").attr("dominant-baseline", "middle").attr("text-anchor", "middle").call(D, t.width).node().getBBox(), h = e.fontSize?.replace ? e.fontSize.replace("px", "") : e.fontSize;
|
|
566
566
|
return l.remove(), d.height + h * 1.1 * 0.5 + t.padding;
|
|
567
|
-
}, "getVirtualNodeHeight"),
|
|
567
|
+
}, "getVirtualNodeHeight"), Wt = /* @__PURE__ */ s(function(n, t, e) {
|
|
568
568
|
n.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr(
|
|
569
569
|
"d",
|
|
570
570
|
`M0 ${t.height - 5} v${-t.height + 10} q0,-5 5,-5 h${t.width - 10} q5,0 5,5 v${t.height - 5} H0 Z`
|
|
@@ -581,8 +581,8 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
581
581
|
getNoteRect: Y,
|
|
582
582
|
initGraphics: Rt,
|
|
583
583
|
drawNode: Ft,
|
|
584
|
-
getVirtualNodeHeight:
|
|
585
|
-
},
|
|
584
|
+
getVirtualNodeHeight: Vt
|
|
585
|
+
}, zt = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
586
586
|
const i = xt(), d = i.timeline?.leftMargin ?? 50;
|
|
587
587
|
E.debug("timeline", l.db);
|
|
588
588
|
const h = i.securityLevel;
|
|
@@ -621,9 +621,9 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
621
621
|
}, L = C.getVirtualNodeHeight(p, b, i);
|
|
622
622
|
E.debug("taskHeight before draw", L), a = Math.max(a, L + 20), N = Math.max(N, g.events.length);
|
|
623
623
|
let $ = 0;
|
|
624
|
-
for (const
|
|
624
|
+
for (const z of g.events) {
|
|
625
625
|
const Z = {
|
|
626
|
-
descr:
|
|
626
|
+
descr: z,
|
|
627
627
|
section: g.section,
|
|
628
628
|
number: g.section,
|
|
629
629
|
width: 150,
|
|
@@ -635,7 +635,7 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
635
635
|
g.events.length > 0 && ($ += (g.events.length - 1) * 10), P = Math.max(P, $);
|
|
636
636
|
}
|
|
637
637
|
E.debug("maxSectionHeight before draw", r), E.debug("maxTaskHeight before draw", a), x && x.length > 0 ? x.forEach((H) => {
|
|
638
|
-
const g = k.filter((
|
|
638
|
+
const g = k.filter((z) => z.section === H), b = {
|
|
639
639
|
number: w,
|
|
640
640
|
descr: H,
|
|
641
641
|
section: w,
|
|
@@ -671,8 +671,8 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
671
671
|
r,
|
|
672
672
|
!0
|
|
673
673
|
));
|
|
674
|
-
const
|
|
675
|
-
E.debug("bounds",
|
|
674
|
+
const W = p.node().getBBox();
|
|
675
|
+
E.debug("bounds", W), _ && p.append("text").text(_).attr("x", W.width / 2 - d).attr("font-size", "4ex").attr("font-weight", "bold").attr("y", 20), c = v ? r + a + 150 : a + 100, p.append("g").attr("class", "lineWrapper").append("line").attr("x1", d).attr("y1", c).attr("x2", W.width + 3 * d).attr("y2", c).attr("stroke-width", 4).attr("stroke", "black").attr("marker-end", "url(#arrowhead)"), kt(
|
|
676
676
|
void 0,
|
|
677
677
|
p,
|
|
678
678
|
i.timeline?.padding ?? 50,
|
|
@@ -719,7 +719,7 @@ var Ft = /* @__PURE__ */ s(function(n, t, e, l) {
|
|
|
719
719
|
}, "drawEvents"), Ot = {
|
|
720
720
|
setConf: /* @__PURE__ */ s(() => {
|
|
721
721
|
}, "setConf"),
|
|
722
|
-
draw:
|
|
722
|
+
draw: zt
|
|
723
723
|
}, jt = /* @__PURE__ */ s((n) => {
|
|
724
724
|
let t = "";
|
|
725
725
|
for (let e = 0; e < n.THEME_COLOR_LIMIT; e++)
|
package/dist/{timeline-definition-IT6M3QCI-BxCHgT34.cjs → timeline-definition-IT6M3QCI-CxbbLtcJ.cjs}
RENAMED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./viewer-C7W6Xd8R.cjs"),tt=require("./arc-CDhMgH2B.cjs");var J=(function(){var r=n.__name(function(m,s,a,c){for(a=a||{},c=m.length;c--;a[m[c]]=s);return a},"o"),t=[6,8,10,11,12,14,16,17,20,21],e=[1,9],l=[1,10],i=[1,11],d=[1,12],h=[1,13],_=[1,16],f=[1,17],p={trace:n.__name(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,period_statement:18,event_statement:19,period:20,event:21,$accept:0,$end:1},terminals_:{2:"error",4:"timeline",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",20:"period",21:"event"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[18,1],[19,1]],performAction:n.__name(function(s,a,c,u,g,o,w){var k=o.length-1;switch(g){case 1:return o[k-1];case 2:this.$=[];break;case 3:o[k-1].push(o[k]),this.$=o[k-1];break;case 4:case 5:this.$=o[k];break;case 6:case 7:this.$=[];break;case 8:u.getCommonDb().setDiagramTitle(o[k].substr(6)),this.$=o[k].substr(6);break;case 9:this.$=o[k].trim(),u.getCommonDb().setAccTitle(this.$);break;case 10:case 11:this.$=o[k].trim(),u.getCommonDb().setAccDescription(this.$);break;case 12:u.addSection(o[k].substr(8)),this.$=o[k].substr(8);break;case 15:u.addTask(o[k],0,""),this.$=o[k];break;case 16:u.addEvent(o[k].substr(2)),this.$=o[k];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},r(t,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:_,21:f},r(t,[2,7],{1:[2,1]}),r(t,[2,3]),{9:18,11:e,12:l,14:i,16:d,17:h,18:14,19:15,20:_,21:f},r(t,[2,5]),r(t,[2,6]),r(t,[2,8]),{13:[1,19]},{15:[1,20]},r(t,[2,11]),r(t,[2,12]),r(t,[2,13]),r(t,[2,14]),r(t,[2,15]),r(t,[2,16]),r(t,[2,4]),r(t,[2,9]),r(t,[2,10])],defaultActions:{},parseError:n.__name(function(s,a){if(a.recoverable)this.trace(s);else{var c=new Error(s);throw c.hash=a,c}},"parseError"),parse:n.__name(function(s){var a=this,c=[0],u=[],g=[null],o=[],w=this.table,k="",I=0,H=0,z=2,G=1,M=o.slice.call(arguments,1),y=Object.create(this.lexer),b={yy:{}};for(var N in this.yy)Object.prototype.hasOwnProperty.call(this.yy,N)&&(b.yy[N]=this.yy[N]);y.setInput(s,b.yy),b.yy.lexer=y,b.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var $=y.yylloc;o.push($);var V=y.options&&y.options.ranges;typeof b.yy.parseError=="function"?this.parseError=b.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function q(E){c.length=c.length-2*E,g.length=g.length-E,o.length=o.length-E}n.__name(q,"popStack");function Y(){var E;return E=u.pop()||y.lex()||G,typeof E!="number"&&(E instanceof Array&&(u=E,E=u.pop()),E=a.symbols_[E]||E),E}n.__name(Y,"lex");for(var S,P,T,U,C={},W,L,D,B;;){if(P=c[c.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((S===null||typeof S>"u")&&(S=Y()),T=w[P]&&w[P][S]),typeof T>"u"||!T.length||!T[0]){var Z="";B=[];for(W in w[P])this.terminals_[W]&&W>z&&B.push("'"+this.terminals_[W]+"'");y.showPosition?Z="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+y.showPosition()+`
|
|
3
|
-
Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on line "+(I+1)+": Unexpected "+(S==G?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Z,{text:y.match,token:this.terminals_[S]||S,line:y.yylineno,loc:$,expected:B})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+
|
|
3
|
+
Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on line "+(I+1)+": Unexpected "+(S==G?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(Z,{text:y.match,token:this.terminals_[S]||S,line:y.yylineno,loc:$,expected:B})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+S);switch(T[0]){case 1:c.push(S),g.push(y.yytext),o.push(y.yylloc),c.push(T[1]),S=null,H=y.yyleng,k=y.yytext,I=y.yylineno,$=y.yylloc;break;case 2:if(L=this.productions_[T[1]][1],C.$=g[g.length-L],C._$={first_line:o[o.length-(L||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(L||1)].first_column,last_column:o[o.length-1].last_column},V&&(C._$.range=[o[o.length-(L||1)].range[0],o[o.length-1].range[1]]),U=this.performAction.apply(C,[k,H,I,b.yy,T[1],g,o].concat(M)),typeof U<"u")return U;L&&(c=c.slice(0,-1*L*2),g=g.slice(0,-1*L),o=o.slice(0,-1*L)),c.push(this.productions_[T[1]][0]),g.push(C.$),o.push(C._$),D=w[c[c.length-2]][c[c.length-1]],c.push(D);break;case 3:return!0}}return!0},"parse")},x=(function(){var m={EOF:1,parseError:n.__name(function(a,c){if(this.yy.parser)this.yy.parser.parseError(a,c);else throw new Error(a)},"parseError"),setInput:n.__name(function(s,a){return this.yy=a||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={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n.__name(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var a=s.match(/(?:\r\n?|\n).*/g);return a?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:n.__name(function(s){var a=s.length,c=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-a),this.offset-=a;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),c.length-1&&(this.yylineno-=c.length-1);var g=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:c?(c.length===u.length?this.yylloc.first_column:0)+u[u.length-c.length].length-c[0].length:this.yylloc.first_column-a},this.options.ranges&&(this.yylloc.range=[g[0],g[0]+this.yyleng-a]),this.yyleng=this.yytext.length,this},"unput"),more:n.__name(function(){return this._more=!0,this},"more"),reject:n.__name(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else 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).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n.__name(function(s){this.unput(this.match.slice(s))},"less"),pastInput:n.__name(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n.__name(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n.__name(function(){var s=this.pastInput(),a=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
5
5
|
`+a+"^"},"showPosition"),test_match:n.__name(function(s,a){var c,u,g;if(this.options.backtrack_lexer&&(g={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(g.yylloc.range=this.yylloc.range.slice(0))),u=s[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},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],c=this.performAction.call(this,this.yy,this,a,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),c)return c;if(this._backtrack){for(var o in g)this[o]=g[o];return!1}return!1},"test_match"),next:n.__name(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,a,c,u;this._more||(this.yytext="",this.match="");for(var g=this._currentRules(),o=0;o<g.length;o++)if(c=this._input.match(this.rules[g[o]]),c&&(!a||c[0].length>a[0].length)){if(a=c,u=o,this.options.backtrack_lexer){if(s=this.test_match(c,g[o]),s!==!1)return s;if(this._backtrack){a=!1;continue}else return!1}else if(!this.options.flex)break}return a?(s=this.test_match(a,g[u]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
|
|
6
|
-
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n.__name(function(){var a=this.next();return a||this.lex()},"lex"),begin:n.__name(function(a){this.conditionStack.push(a)},"begin"),popState:n.__name(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n.__name(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:n.__name(function(a){this.begin(a)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n.__name(function(a,c,u,g){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return m})();p.lexer=x;function v(){this.yy={}}return n.__name(v,"Parser"),v.prototype=p,p.Parser=v,new v})();J.parser=J;var _t=J,it={};n.__export(it,{addEvent:()=>ut,addSection:()=>ot,addTask:()=>dt,addTaskOrg:()=>pt,clear:()=>lt,default:()=>ft,getCommonDb:()=>at,getSections:()=>ct,getTasks:()=>ht});var R="",st=0,K=[],O=[],F=[],at=n.__name(()=>n.commonDb_exports,"getCommonDb"),lt=n.__name(function(){K.length=0,O.length=0,R="",F.length=0,n.clear()},"clear"),ot=n.__name(function(r){R=r,K.push(r)},"addSection"),ct=n.__name(function(){return K},"getSections"),ht=n.__name(function(){let r=et();const t=100;let e=0;for(;!r&&e<t;)r=et(),e++;return O.push(...F),O},"getTasks"),dt=n.__name(function(r,t,e){const l={id:st++,section:R,type:R,task:r,score:t||0,events:e?[e]:[]};F.push(l)},"addTask"),ut=n.__name(function(r){F.find(e=>e.id===st-1).events.push(r)},"addEvent"),pt=n.__name(function(r){const t={section:R,type:R,description:r,task:r,classes:[]};O.push(t)},"addTaskOrg"),et=n.__name(function(){const r=n.__name(function(e){return F[e].processed},"compileTask");let t=!0;for(const[e,l]of F.entries())r(e),t=t&&l.processed;return t},"compileTasks"),ft={clear:lt,getCommonDb:at,addSection:ot,getSections:ct,getTasks:ht,addTask:dt,addTaskOrg:pt,addEvent:ut},mt=12,j=n.__name(function(r,t){const e=r.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),xt=n.__name(function(r,t){const l=r.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=r.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function d(f){const p=tt.d3arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}n.__name(d,"smile");function h(f){const p=tt.d3arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}n.__name(h,"sad");function _(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return n.__name(_,"ambivalent"),t.score>3?d(i):t.score<3?h(i):_(i),l},"drawFace"),kt=n.__name(function(r,t){const e=r.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),gt=n.__name(function(r,t){const e=t.text.replace(/<br\s*\/?>/gi," "),l=r.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);const i=l.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(e),l},"drawText"),vt=n.__name(function(r,t){function e(i,d,h,_,f){return i+","+d+" "+(i+h)+","+d+" "+(i+h)+","+(d+_-f)+" "+(i+h-f*1.2)+","+(d+_)+" "+i+","+(d+_)}n.__name(e,"genPoints");const l=r.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,gt(r,t)},"drawLabel"),bt=n.__name(function(r,t,e){const l=r.append("g"),i=Q();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=e.width,i.height=e.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,j(l,i),yt(e)(t.text,l,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),nt=-1,wt=n.__name(function(r,t,e){const l=t.x+e.width/2,i=r.append("g");nt++,i.append("line").attr("id","task"+nt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),xt(i,{cx:l,cy:300+(5-t.score)*30,score:t.score});const h=Q();h.x=t.x,h.y=t.y,h.fill=t.fill,h.width=e.width,h.height=e.height,h.class="task task-type-"+t.num,h.rx=3,h.ry=3,j(i,h),yt(e)(t.task,i,h.x,h.y,h.width,h.height,{class:"task"},e,t.colour)},"drawTask"),St=n.__name(function(r,t){j(r,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Et=n.__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Q=n.__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),yt=(function(){function r(i,d,h,_,f,p,x,v){const m=d.append("text").attr("x",h+f/2).attr("y",_+p/2+5).style("font-color",v).style("text-anchor","middle").text(i);l(m,x)}n.__name(r,"byText");function t(i,d,h,_,f,p,x,v,m){const{taskFontSize:s,taskFontFamily:a}=v,c=i.split(/<br\s*\/?>/gi);for(let u=0;u<c.length;u++){const g=u*s-s*(c.length-1)/2,o=d.append("text").attr("x",h+f/2).attr("y",_).attr("fill",m).style("text-anchor","middle").style("font-size",s).style("font-family",a);o.append("tspan").attr("x",h+f/2).attr("dy",g).text(c[u]),o.attr("y",_+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(o,x)}}n.__name(t,"byTspan");function e(i,d,h,_,f,p,x,v){const m=d.append("switch"),a=m.append("foreignObject").attr("x",h).attr("y",_).attr("width",f).attr("height",p).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,m,h,_,f,p,x,v),l(a,x)}n.__name(e,"byFo");function l(i,d){for(const h in d)h in d&&i.attr(h,d[h])}return n.__name(l,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?e:i.textPlacement==="old"?r:t}})(),Tt=n.__name(function(r){r.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(r,t){r.each(function(){var e=n.select(this),l=e.text().split(/(\s+|<br>)/).reverse(),i,d=[],h=1.1,_=e.attr("y"),f=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",_).attr("dy",f+"em");for(let x=0;x<l.length;x++)i=l[l.length-1-x],d.push(i),p.text(d.join(" ").trim()),(p.node().getComputedTextLength()>t||i==="<br>")&&(d.pop(),p.text(d.join(" ").trim()),i==="<br>"?d=[""]:d=[i],p=e.append("tspan").attr("x",0).attr("y",_).attr("dy",h+"em").text(i))})}n.__name(X,"wrap");var It=n.__name(function(r,t,e,l){const i=e%mt-1,d=r.append("g");t.section=i,d.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+i));const h=d.append("g"),_=d.append("g"),p=_.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),x=l.fontSize?.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+x*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,_.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),$t(h,t,i,l),t},"drawNode"),Nt=n.__name(function(r,t,e){const l=r.append("g"),d=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),h=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),d.height+h*1.1*.5+t.padding},"getVirtualNodeHeight"),$t=n.__name(function(r,t,e){r.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),r.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),A={drawRect:j,drawCircle:kt,drawSection:bt,drawText:gt,drawLabel:vt,drawTask:wt,drawBackgroundRect:St,getTextObj:Et,getNoteRect:Q,initGraphics:Tt,drawNode:It,getVirtualNodeHeight:Nt},Lt=n.__name(function(r,t,e,l){const i=n.getConfig2(),d=i.timeline?.leftMargin??50;n.log.debug("timeline",l.db);const h=i.securityLevel;let _;h==="sandbox"&&(_=n.select("#i"+t));const p=(h==="sandbox"?n.select(_.nodes()[0].contentDocument.body):n.select("body")).select("#"+t);p.append("g");const x=l.db.getTasks(),v=l.db.getCommonDb().getDiagramTitle();n.log.debug("task",x),A.initGraphics(p);const m=l.db.getSections();n.log.debug("sections",m);let s=0,a=0,c=0,u=0,g=50+d,o=50;u=50;let w=0,k=!0;m.forEach(function(M){const y={number:w,descr:M,section:w,width:150,padding:20,maxHeight:s},b=A.getVirtualNodeHeight(p,y,i);n.log.debug("sectionHeight before draw",b),s=Math.max(s,b+20)});let I=0,P=0;n.log.debug("tasks.length",x.length);for(const[M,y]of x.entries()){const b={number:M,descr:y,section:y.section,width:150,padding:20,maxHeight:a},N=A.getVirtualNodeHeight(p,b,i);n.log.debug("taskHeight before draw",N),a=Math.max(a,N+20),I=Math.max(I,y.events.length);let $=0;for(const V of y.events){const q={descr:V,section:y.section,number:y.section,width:150,padding:20,maxHeight:50};$+=A.getVirtualNodeHeight(p,q,i)}y.events.length>0&&($+=(y.events.length-1)*10),P=Math.max(P,$)}n.log.debug("maxSectionHeight before draw",s),n.log.debug("maxTaskHeight before draw",a),m&&m.length>0?m.forEach(M=>{const y=x.filter(V=>V.section===M),b={number:w,descr:M,section:w,width:200*Math.max(y.length,1)-50,padding:20,maxHeight:s};n.log.debug("sectionNode",b);const N=p.append("g"),$=A.drawNode(N,b,w,i);n.log.debug("sectionNode output",$),N.attr("transform",`translate(${g}, ${u})`),o+=s+50,y.length>0&&rt(p,y,w,g,o,a,i,I,P,s,!1),g+=200*Math.max(y.length,1),o=u,w++}):(k=!1,rt(p,x,w,g,o,a,i,I,P,s,!0));const z=p.node().getBBox();n.log.debug("bounds",z),v&&p.append("text").text(v).attr("x",z.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=k?s+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",c).attr("x2",z.width+3*d).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n.setupGraphViewbox(void 0,p,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),rt=n.__name(function(r,t,e,l,i,d,h,_,f,p,x){for(const v of t){const m={descr:v.task,section:e,number:e,width:150,padding:20,maxHeight:d};n.log.debug("taskNode",m);const s=r.append("g").attr("class","taskWrapper"),c=A.drawNode(s,m,e,h).height;if(n.log.debug("taskHeight after draw",c),s.attr("transform",`translate(${l}, ${i})`),d=Math.max(d,c),v.events){const u=r.append("g").attr("class","lineWrapper");let g=d;i+=100,g=g+Mt(r,v.events,e,l,i,h),i-=100,u.append("line").attr("x1",l+190/2).attr("y1",i+d).attr("x2",l+190/2).attr("y2",i+d+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,x&&!h.timeline?.disableMulticolor&&e++}i=i-10},"drawTasks"),Mt=n.__name(function(r,t,e,l,i,d){let h=0;const _=i;i=i+100;for(const f of t){const p={descr:f,section:e,number:e,width:150,padding:20,maxHeight:50};n.log.debug("eventNode",p);const x=r.append("g").attr("class","eventWrapper"),m=A.drawNode(x,p,e,d).height;h=h+m,x.attr("transform",`translate(${l}, ${i})`),i=i+10+m}return i=_,h},"drawEvents"),Pt={setConf:n.__name(()=>{},"setConf"),draw:Lt},Ht=n.__name(r=>{let t="";for(let e=0;e<r.THEME_COLOR_LIMIT;e++)r["lineColor"+e]=r["lineColor"+e]||r["cScaleInv"+e],n.isDark(r["lineColor"+e])?r["lineColor"+e]=n.lighten(r["lineColor"+e],20):r["lineColor"+e]=n.darken(r["lineColor"+e],20);for(let e=0;e<r.THEME_COLOR_LIMIT;e++){const l=""+(17-3*e);t+=`
|
|
6
|
+
`+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n.__name(function(){var a=this.next();return a||this.lex()},"lex"),begin:n.__name(function(a){this.conditionStack.push(a)},"begin"),popState:n.__name(function(){var a=this.conditionStack.length-1;return a>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n.__name(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:n.__name(function(a){return a=this.conditionStack.length-1-Math.abs(a||0),a>=0?this.conditionStack[a]:"INITIAL"},"topState"),pushState:n.__name(function(a){this.begin(a)},"pushState"),stateStackSize:n.__name(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n.__name(function(a,c,u,g){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 21;case 16:return 20;case 17:return 6;case 18:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:timeline\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^:\n]+)/i,/^(?::\s(?:[^:\n]|:(?!\s))+)/i,/^(?:[^#:\n]+)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18],inclusive:!0}}};return m})();p.lexer=x;function v(){this.yy={}}return n.__name(v,"Parser"),v.prototype=p,p.Parser=v,new v})();J.parser=J;var _t=J,it={};n.__export(it,{addEvent:()=>ut,addSection:()=>ot,addTask:()=>dt,addTaskOrg:()=>pt,clear:()=>lt,default:()=>ft,getCommonDb:()=>at,getSections:()=>ct,getTasks:()=>ht});var R="",st=0,K=[],O=[],F=[],at=n.__name(()=>n.commonDb_exports,"getCommonDb"),lt=n.__name(function(){K.length=0,O.length=0,R="",F.length=0,n.clear()},"clear"),ot=n.__name(function(r){R=r,K.push(r)},"addSection"),ct=n.__name(function(){return K},"getSections"),ht=n.__name(function(){let r=et();const t=100;let e=0;for(;!r&&e<t;)r=et(),e++;return O.push(...F),O},"getTasks"),dt=n.__name(function(r,t,e){const l={id:st++,section:R,type:R,task:r,score:t||0,events:e?[e]:[]};F.push(l)},"addTask"),ut=n.__name(function(r){F.find(e=>e.id===st-1).events.push(r)},"addEvent"),pt=n.__name(function(r){const t={section:R,type:R,description:r,task:r,classes:[]};O.push(t)},"addTaskOrg"),et=n.__name(function(){const r=n.__name(function(e){return F[e].processed},"compileTask");let t=!0;for(const[e,l]of F.entries())r(e),t=t&&l.processed;return t},"compileTasks"),ft={clear:lt,getCommonDb:at,addSection:ot,getSections:ct,getTasks:ht,addTask:dt,addTaskOrg:pt,addEvent:ut},mt=12,j=n.__name(function(r,t){const e=r.append("rect");return e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),e.attr("rx",t.rx),e.attr("ry",t.ry),t.class!==void 0&&e.attr("class",t.class),e},"drawRect"),xt=n.__name(function(r,t){const l=r.append("circle").attr("cx",t.cx).attr("cy",t.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=r.append("g");i.append("circle").attr("cx",t.cx-15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",t.cx+15/3).attr("cy",t.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function d(f){const p=tt.d3arc().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+2)+")")}n.__name(d,"smile");function h(f){const p=tt.d3arc().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);f.append("path").attr("class","mouth").attr("d",p).attr("transform","translate("+t.cx+","+(t.cy+7)+")")}n.__name(h,"sad");function _(f){f.append("line").attr("class","mouth").attr("stroke",2).attr("x1",t.cx-5).attr("y1",t.cy+7).attr("x2",t.cx+5).attr("y2",t.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return n.__name(_,"ambivalent"),t.score>3?d(i):t.score<3?h(i):_(i),l},"drawFace"),kt=n.__name(function(r,t){const e=r.append("circle");return e.attr("cx",t.cx),e.attr("cy",t.cy),e.attr("class","actor-"+t.pos),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("r",t.r),e.class!==void 0&&e.attr("class",e.class),t.title!==void 0&&e.append("title").text(t.title),e},"drawCircle"),gt=n.__name(function(r,t){const e=t.text.replace(/<br\s*\/?>/gi," "),l=r.append("text");l.attr("x",t.x),l.attr("y",t.y),l.attr("class","legend"),l.style("text-anchor",t.anchor),t.class!==void 0&&l.attr("class",t.class);const i=l.append("tspan");return i.attr("x",t.x+t.textMargin*2),i.text(e),l},"drawText"),vt=n.__name(function(r,t){function e(i,d,h,_,f){return i+","+d+" "+(i+h)+","+d+" "+(i+h)+","+(d+_-f)+" "+(i+h-f*1.2)+","+(d+_)+" "+i+","+(d+_)}n.__name(e,"genPoints");const l=r.append("polygon");l.attr("points",e(t.x,t.y,50,20,7)),l.attr("class","labelBox"),t.y=t.y+t.labelMargin,t.x=t.x+.5*t.labelMargin,gt(r,t)},"drawLabel"),bt=n.__name(function(r,t,e){const l=r.append("g"),i=Q();i.x=t.x,i.y=t.y,i.fill=t.fill,i.width=e.width,i.height=e.height,i.class="journey-section section-type-"+t.num,i.rx=3,i.ry=3,j(l,i),yt(e)(t.text,l,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+t.num},e,t.colour)},"drawSection"),nt=-1,wt=n.__name(function(r,t,e){const l=t.x+e.width/2,i=r.append("g");nt++,i.append("line").attr("id","task"+nt).attr("x1",l).attr("y1",t.y).attr("x2",l).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),xt(i,{cx:l,cy:300+(5-t.score)*30,score:t.score});const h=Q();h.x=t.x,h.y=t.y,h.fill=t.fill,h.width=e.width,h.height=e.height,h.class="task task-type-"+t.num,h.rx=3,h.ry=3,j(i,h),yt(e)(t.task,i,h.x,h.y,h.width,h.height,{class:"task"},e,t.colour)},"drawTask"),St=n.__name(function(r,t){j(r,{x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,class:"rect"}).lower()},"drawBackgroundRect"),Et=n.__name(function(){return{x:0,y:0,fill:void 0,"text-anchor":"start",width:100,height:100,textMargin:0,rx:0,ry:0}},"getTextObj"),Q=n.__name(function(){return{x:0,y:0,width:100,anchor:"start",height:100,rx:0,ry:0}},"getNoteRect"),yt=(function(){function r(i,d,h,_,f,p,x,v){const m=d.append("text").attr("x",h+f/2).attr("y",_+p/2+5).style("font-color",v).style("text-anchor","middle").text(i);l(m,x)}n.__name(r,"byText");function t(i,d,h,_,f,p,x,v,m){const{taskFontSize:s,taskFontFamily:a}=v,c=i.split(/<br\s*\/?>/gi);for(let u=0;u<c.length;u++){const g=u*s-s*(c.length-1)/2,o=d.append("text").attr("x",h+f/2).attr("y",_).attr("fill",m).style("text-anchor","middle").style("font-size",s).style("font-family",a);o.append("tspan").attr("x",h+f/2).attr("dy",g).text(c[u]),o.attr("y",_+p/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),l(o,x)}}n.__name(t,"byTspan");function e(i,d,h,_,f,p,x,v){const m=d.append("switch"),a=m.append("foreignObject").attr("x",h).attr("y",_).attr("width",f).attr("height",p).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");a.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),t(i,m,h,_,f,p,x,v),l(a,x)}n.__name(e,"byFo");function l(i,d){for(const h in d)h in d&&i.attr(h,d[h])}return n.__name(l,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?e:i.textPlacement==="old"?r:t}})(),Tt=n.__name(function(r){r.append("defs").append("marker").attr("id","arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics");function X(r,t){r.each(function(){var e=n.select(this),l=e.text().split(/(\s+|<br>)/).reverse(),i,d=[],h=1.1,_=e.attr("y"),f=parseFloat(e.attr("dy")),p=e.text(null).append("tspan").attr("x",0).attr("y",_).attr("dy",f+"em");for(let x=0;x<l.length;x++)i=l[l.length-1-x],d.push(i),p.text(d.join(" ").trim()),(p.node().getComputedTextLength()>t||i==="<br>")&&(d.pop(),p.text(d.join(" ").trim()),i==="<br>"?d=[""]:d=[i],p=e.append("tspan").attr("x",0).attr("y",_).attr("dy",h+"em").text(i))})}n.__name(X,"wrap");var It=n.__name(function(r,t,e,l){const i=e%mt-1,d=r.append("g");t.section=i,d.attr("class",(t.class?t.class+" ":"")+"timeline-node "+("section-"+i));const h=d.append("g"),_=d.append("g"),p=_.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),x=l.fontSize?.replace?l.fontSize.replace("px",""):l.fontSize;return t.height=p.height+x*1.1*.5+t.padding,t.height=Math.max(t.height,t.maxHeight),t.width=t.width+2*t.padding,_.attr("transform","translate("+t.width/2+", "+t.padding/2+")"),$t(h,t,i,l),t},"drawNode"),Nt=n.__name(function(r,t,e){const l=r.append("g"),d=l.append("text").text(t.descr).attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle").call(X,t.width).node().getBBox(),h=e.fontSize?.replace?e.fontSize.replace("px",""):e.fontSize;return l.remove(),d.height+h*1.1*.5+t.padding},"getVirtualNodeHeight"),$t=n.__name(function(r,t,e){r.append("path").attr("id","node-"+t.id).attr("class","node-bkg node-"+t.type).attr("d",`M0 ${t.height-5} v${-t.height+10} q0,-5 5,-5 h${t.width-10} q5,0 5,5 v${t.height-5} H0 Z`),r.append("line").attr("class","node-line-"+e).attr("x1",0).attr("y1",t.height).attr("x2",t.width).attr("y2",t.height)},"defaultBkg"),A={drawRect:j,drawCircle:kt,drawSection:bt,drawText:gt,drawLabel:vt,drawTask:wt,drawBackgroundRect:St,getTextObj:Et,getNoteRect:Q,initGraphics:Tt,drawNode:It,getVirtualNodeHeight:Nt},Lt=n.__name(function(r,t,e,l){const i=n.getConfig2(),d=i.timeline?.leftMargin??50;n.log.debug("timeline",l.db);const h=i.securityLevel;let _;h==="sandbox"&&(_=n.select("#i"+t));const p=(h==="sandbox"?n.select(_.nodes()[0].contentDocument.body):n.select("body")).select("#"+t);p.append("g");const x=l.db.getTasks(),v=l.db.getCommonDb().getDiagramTitle();n.log.debug("task",x),A.initGraphics(p);const m=l.db.getSections();n.log.debug("sections",m);let s=0,a=0,c=0,u=0,g=50+d,o=50;u=50;let w=0,k=!0;m.forEach(function(M){const y={number:w,descr:M,section:w,width:150,padding:20,maxHeight:s},b=A.getVirtualNodeHeight(p,y,i);n.log.debug("sectionHeight before draw",b),s=Math.max(s,b+20)});let I=0,H=0;n.log.debug("tasks.length",x.length);for(const[M,y]of x.entries()){const b={number:M,descr:y,section:y.section,width:150,padding:20,maxHeight:a},N=A.getVirtualNodeHeight(p,b,i);n.log.debug("taskHeight before draw",N),a=Math.max(a,N+20),I=Math.max(I,y.events.length);let $=0;for(const V of y.events){const q={descr:V,section:y.section,number:y.section,width:150,padding:20,maxHeight:50};$+=A.getVirtualNodeHeight(p,q,i)}y.events.length>0&&($+=(y.events.length-1)*10),H=Math.max(H,$)}n.log.debug("maxSectionHeight before draw",s),n.log.debug("maxTaskHeight before draw",a),m&&m.length>0?m.forEach(M=>{const y=x.filter(V=>V.section===M),b={number:w,descr:M,section:w,width:200*Math.max(y.length,1)-50,padding:20,maxHeight:s};n.log.debug("sectionNode",b);const N=p.append("g"),$=A.drawNode(N,b,w,i);n.log.debug("sectionNode output",$),N.attr("transform",`translate(${g}, ${u})`),o+=s+50,y.length>0&&rt(p,y,w,g,o,a,i,I,H,s,!1),g+=200*Math.max(y.length,1),o=u,w++}):(k=!1,rt(p,x,w,g,o,a,i,I,H,s,!0));const z=p.node().getBBox();n.log.debug("bounds",z),v&&p.append("text").text(v).attr("x",z.width/2-d).attr("font-size","4ex").attr("font-weight","bold").attr("y",20),c=k?s+a+150:a+100,p.append("g").attr("class","lineWrapper").append("line").attr("x1",d).attr("y1",c).attr("x2",z.width+3*d).attr("y2",c).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#arrowhead)"),n.setupGraphViewbox(void 0,p,i.timeline?.padding??50,i.timeline?.useMaxWidth??!1)},"draw"),rt=n.__name(function(r,t,e,l,i,d,h,_,f,p,x){for(const v of t){const m={descr:v.task,section:e,number:e,width:150,padding:20,maxHeight:d};n.log.debug("taskNode",m);const s=r.append("g").attr("class","taskWrapper"),c=A.drawNode(s,m,e,h).height;if(n.log.debug("taskHeight after draw",c),s.attr("transform",`translate(${l}, ${i})`),d=Math.max(d,c),v.events){const u=r.append("g").attr("class","lineWrapper");let g=d;i+=100,g=g+Mt(r,v.events,e,l,i,h),i-=100,u.append("line").attr("x1",l+190/2).attr("y1",i+d).attr("x2",l+190/2).attr("y2",i+d+100+f+100).attr("stroke-width",2).attr("stroke","black").attr("marker-end","url(#arrowhead)").attr("stroke-dasharray","5,5")}l=l+200,x&&!h.timeline?.disableMulticolor&&e++}i=i-10},"drawTasks"),Mt=n.__name(function(r,t,e,l,i,d){let h=0;const _=i;i=i+100;for(const f of t){const p={descr:f,section:e,number:e,width:150,padding:20,maxHeight:50};n.log.debug("eventNode",p);const x=r.append("g").attr("class","eventWrapper"),m=A.drawNode(x,p,e,d).height;h=h+m,x.attr("transform",`translate(${l}, ${i})`),i=i+10+m}return i=_,h},"drawEvents"),Ht={setConf:n.__name(()=>{},"setConf"),draw:Lt},Pt=n.__name(r=>{let t="";for(let e=0;e<r.THEME_COLOR_LIMIT;e++)r["lineColor"+e]=r["lineColor"+e]||r["cScaleInv"+e],n.isDark(r["lineColor"+e])?r["lineColor"+e]=n.lighten(r["lineColor"+e],20):r["lineColor"+e]=n.darken(r["lineColor"+e],20);for(let e=0;e<r.THEME_COLOR_LIMIT;e++){const l=""+(17-3*e);t+=`
|
|
7
7
|
.section-${e-1} rect, .section-${e-1} path, .section-${e-1} circle, .section-${e-1} path {
|
|
8
8
|
fill: ${r["cScale"+e]};
|
|
9
9
|
}
|
|
@@ -39,7 +39,7 @@ Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on
|
|
|
39
39
|
.edge {
|
|
40
40
|
stroke-width: 3;
|
|
41
41
|
}
|
|
42
|
-
${
|
|
42
|
+
${Pt(r)}
|
|
43
43
|
.section-root rect, .section-root path, .section-root circle {
|
|
44
44
|
fill: ${r.git0};
|
|
45
45
|
}
|
|
@@ -58,4 +58,4 @@ Expecting `+B.join(", ")+", got '"+(this.terminals_[S]||S)+"'":Z="Parse error on
|
|
|
58
58
|
.eventWrapper {
|
|
59
59
|
filter: brightness(120%);
|
|
60
60
|
}
|
|
61
|
-
`,"getStyles"),Ct=At,Rt={db:it,renderer:
|
|
61
|
+
`,"getStyles"),Ct=At,Rt={db:it,renderer:Ht,parser:_t,styles:Ct};exports.diagram=Rt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./mermaid-parser.core-ga2HTHrF.cjs");exports.TreemapModule=e.TreemapModule;exports.createTreemapServices=e.createTreemapServices;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 创建图片查看器管理器的 composable
|
|
3
|
+
* 用于在 MdRenderer 中统一管理所有图片的查看器实例
|
|
4
|
+
*/
|
|
5
|
+
export declare function useImageViewerManager(viewerOptions?: any): {
|
|
6
|
+
registerImage: (img: HTMLImageElement) => void;
|
|
7
|
+
unregisterImage: (img: HTMLImageElement) => void;
|
|
8
|
+
show: (index?: number) => void;
|
|
9
|
+
containerRef: import("vue").Ref<HTMLElement | null, HTMLElement | null>;
|
|
10
|
+
cleanup: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -12,6 +12,17 @@ export interface CodeBlockPluginOptions {
|
|
|
12
12
|
* @example { js: 'javascript', ts: 'typescript' }
|
|
13
13
|
*/
|
|
14
14
|
languageAliases?: Record<string, string>;
|
|
15
|
+
/**
|
|
16
|
+
* HTML 发布接口 URL
|
|
17
|
+
* @example 'https://api.example.com/publish'
|
|
18
|
+
*/
|
|
19
|
+
publishUrl?: string;
|
|
20
|
+
/**
|
|
21
|
+
* 发布成功后的回调函数
|
|
22
|
+
* @param url - 发布后返回的 URL
|
|
23
|
+
* @example (url) => console.log('Published:', url)
|
|
24
|
+
*/
|
|
25
|
+
onPublished?: (url: string) => void;
|
|
15
26
|
}
|
|
16
27
|
/**
|
|
17
28
|
* codeBlockPlugin - 代码块渲染插件
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { CustomPlugin } from '../../types';
|
|
2
|
+
import 'viewerjs/dist/viewer.css';
|
|
3
|
+
/**
|
|
4
|
+
* ImageViewer 插件配置选项
|
|
5
|
+
*/
|
|
6
|
+
export interface ImageViewerPluginOptions {
|
|
7
|
+
/**
|
|
8
|
+
* 优先级(默认 50)
|
|
9
|
+
*/
|
|
10
|
+
priority?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Viewer.js 配置选项
|
|
13
|
+
* @see https://github.com/fengyuanchen/viewerjs#options
|
|
14
|
+
*/
|
|
15
|
+
viewerOptions?: any;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* imageViewerPlugin - 图片预览插件
|
|
19
|
+
*
|
|
20
|
+
* 为 Markdown 中的图片添加点击放大预览功能,支持:
|
|
21
|
+
* - 点击图片放大预览
|
|
22
|
+
* - 移动端双指缩放
|
|
23
|
+
* - 拖动图片
|
|
24
|
+
* - 图片旋转
|
|
25
|
+
* - 图片翻转
|
|
26
|
+
* - 全屏查看
|
|
27
|
+
* - 键盘导航
|
|
28
|
+
*
|
|
29
|
+
* 基于 viewerjs 实现,自动集成到 Markdown 渲染的图片中
|
|
30
|
+
*
|
|
31
|
+
* @param options - 插件配置选项
|
|
32
|
+
* @param options.priority - 优先级(默认 50)
|
|
33
|
+
* @param options.viewerOptions - Viewer.js 配置选项
|
|
34
|
+
* @returns CustomPlugin
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* // 默认配置
|
|
39
|
+
* { plugin: imageViewerPlugin }
|
|
40
|
+
*
|
|
41
|
+
* // 自定义 Viewer 配置
|
|
42
|
+
* {
|
|
43
|
+
* plugin: imageViewerPlugin,
|
|
44
|
+
* options: {
|
|
45
|
+
* viewerOptions: {
|
|
46
|
+
* toolbar: true,
|
|
47
|
+
* navbar: true,
|
|
48
|
+
* title: true,
|
|
49
|
+
* button: true,
|
|
50
|
+
* loop: false
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* }
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function imageViewerPlugin(options?: ImageViewerPluginOptions): CustomPlugin;
|
|
57
|
+
export default imageViewerPlugin;
|
|
@@ -6,3 +6,5 @@ export { mermaidPlugin } from './mermaidPlugin';
|
|
|
6
6
|
export type { MermaidPluginOptions } from './mermaidPlugin';
|
|
7
7
|
export { cursorPlugin } from './cursorPlugin';
|
|
8
8
|
export type { CursorPluginOptions } from './cursorPlugin';
|
|
9
|
+
export { imageViewerPlugin } from './imageViewerPlugin';
|
|
10
|
+
export type { ImageViewerPluginOptions } from './imageViewerPlugin';
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Mermaid Plugin for RecursiveRenderer
|
|
3
|
-
* Detects code blocks with language="mermaid" and renders them
|
|
3
|
+
* Detects code blocks with language="mermaid" and renders them a
|
|
4
|
+
// 传递配置的主题和流式状态
|
|
5
|
+
const props: any = {
|
|
6
|
+
code,
|
|
7
|
+
isStreaming: context?.isStreaming || false
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
if (theme) {
|
|
11
|
+
props.theme = theme;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return h(MermaidDiagram, props)
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}ms
|
|
4
18
|
*/
|
|
5
19
|
import type { CustomPlugin } from '../../types';
|
|
6
20
|
/**
|
package/dist/types/types.d.ts
CHANGED
|
@@ -9,6 +9,27 @@ export type ASTNode = {
|
|
|
9
9
|
children?: ASTNode[];
|
|
10
10
|
data?: string;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* 渲染上下文(传递给插件的共享状态)
|
|
14
|
+
*/
|
|
15
|
+
export type RenderContext = {
|
|
16
|
+
/**
|
|
17
|
+
* 图片列表(用于图片预览等功能)
|
|
18
|
+
*/
|
|
19
|
+
images?: Array<{
|
|
20
|
+
src: string;
|
|
21
|
+
alt?: string;
|
|
22
|
+
title?: string;
|
|
23
|
+
}>;
|
|
24
|
+
/**
|
|
25
|
+
* 是否处于流式渲染模式
|
|
26
|
+
*/
|
|
27
|
+
isStreaming?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* 其他自定义状态
|
|
30
|
+
*/
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
};
|
|
12
33
|
/**
|
|
13
34
|
* Custom 插件接口
|
|
14
35
|
*/
|
|
@@ -30,8 +51,9 @@ export type CustomPlugin = {
|
|
|
30
51
|
* @param node 当前 AST 节点
|
|
31
52
|
* @param renderChildren 渲染子节点的函数
|
|
32
53
|
* @param h Vue 的 h 函数
|
|
54
|
+
* @param context 渲染上下文(包含共享状态)
|
|
33
55
|
*/
|
|
34
|
-
render: (node: ASTNode, renderChildren: () => (VNode | string | null)[], h: typeof import('vue').h) => VNode | string | null;
|
|
56
|
+
render: (node: ASTNode, renderChildren: () => (VNode | string | null)[], h: typeof import('vue').h, context?: RenderContext) => VNode | string | null;
|
|
35
57
|
};
|
|
36
58
|
/**
|
|
37
59
|
* Custom 插件配置(支持 options)
|