@zjlab-frontier/markdown 1.0.18 → 1.0.20

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.
Files changed (47) hide show
  1. package/README.md +294 -294
  2. package/dist/{arc-B8UMP-AJ.mjs → arc-Bmi5t8KK.mjs} +1 -1
  3. package/dist/{blockDiagram-c4efeb88-r24kd2hu.mjs → blockDiagram-c4efeb88-Dd0x6JTg.mjs} +5 -5
  4. package/dist/{c4Diagram-c83219d4-z9w7uVen.mjs → c4Diagram-c83219d4-D3D4s9q1.mjs} +2 -2
  5. package/dist/{channel-dqqq-K_U.mjs → channel-wqHDK2Vk.mjs} +1 -1
  6. package/dist/{classDiagram-beda092f-BtqoBPMR.mjs → classDiagram-beda092f-ZzL6ZuZg.mjs} +5 -5
  7. package/dist/{classDiagram-v2-2358418a-DHVohr92.mjs → classDiagram-v2-2358418a-BFf1C0SA.mjs} +5 -5
  8. package/dist/{clone-B4QiX4zR.mjs → clone-CtyKi4pv.mjs} +1 -1
  9. package/dist/createText-1719965b-CZfUO5kz.mjs +2955 -0
  10. package/dist/{edges-96097737-DoF5f5fc.mjs → edges-96097737-Dusc1b_j.mjs} +3 -3
  11. package/dist/{erDiagram-0228fc6a-Dm1WEsjD.mjs → erDiagram-0228fc6a-DutRPDlF.mjs} +4 -4
  12. package/dist/{flowDb-c6c81e3f-BIABGGNT.mjs → flowDb-c6c81e3f-BjYaNdgw.mjs} +1 -1
  13. package/dist/{flowDiagram-50d868cf-Drlbs6TR.mjs → flowDiagram-50d868cf-DA1fybVO.mjs} +6 -6
  14. package/dist/{flowDiagram-v2-4f6560a1-CJ8JOGIA.mjs → flowDiagram-v2-4f6560a1-B8E2EFyO.mjs} +5 -5
  15. package/dist/{flowchart-elk-definition-6af322e1-foE7GSGg.mjs → flowchart-elk-definition-6af322e1-BUHRnUOc.mjs} +4 -4
  16. package/dist/{ganttDiagram-a2739b55-CcFduPwA.mjs → ganttDiagram-a2739b55-DTBniGMY.mjs} +2 -2
  17. package/dist/{gitGraphDiagram-82fe8481-CkpuANf-.mjs → gitGraphDiagram-82fe8481-dtMfCAcI.mjs} +1 -1
  18. package/dist/{graph-3GmqmA5U.mjs → graph-YqjZta1-.mjs} +1 -1
  19. package/dist/{index-Bi55S4bg.mjs → index-1CNW5FsF.mjs} +39302 -41695
  20. package/dist/{index-5325376f-D4WVCpip.mjs → index-5325376f-BvIGCGnK.mjs} +6 -6
  21. package/dist/index.d.ts +3 -2
  22. package/dist/index.es.js +18 -7
  23. package/dist/index.umd.js +310 -309
  24. package/dist/{infoDiagram-8eee0895-C4U6pGyU.mjs → infoDiagram-8eee0895-BoorTk5E.mjs} +1 -1
  25. package/dist/{journeyDiagram-c64418c1-CWb1kxw2.mjs → journeyDiagram-c64418c1-bfy7opJJ.mjs} +3 -3
  26. package/dist/{layout-lIExPCso.mjs → layout-gqtC3BaP.mjs} +2 -2
  27. package/dist/{line-q3FYPVlY.mjs → line-BQrGRLem.mjs} +1 -1
  28. package/dist/{linear-CYxN76vj.mjs → linear-BlnO0k7G.mjs} +1 -1
  29. package/dist/markdown-core.d.ts +68 -0
  30. package/dist/markdown.d.ts +44 -44
  31. package/dist/markdownTestContent.d.ts +1 -1
  32. package/dist/{mindmap-definition-8da855dc-DcZLqRm2.mjs → mindmap-definition-8da855dc-CY83fkM3.mjs} +2 -2
  33. package/dist/{pieDiagram-a8764435-BTXLny3M.mjs → pieDiagram-a8764435-D-4PvRHe.mjs} +2 -2
  34. package/dist/{quadrantDiagram-1e28029f-DTLBVQir.mjs → quadrantDiagram-1e28029f-pzlP9p9m.mjs} +2 -2
  35. package/dist/{requirementDiagram-08caed73-B482Rm0K.mjs → requirementDiagram-08caed73-C4hpIgzM.mjs} +4 -4
  36. package/dist/{sankeyDiagram-a04cb91d-D3mZ2QuD.mjs → sankeyDiagram-a04cb91d-D-RVjLag.mjs} +1 -1
  37. package/dist/{sequenceDiagram-c5b8d532-D64tmcjg.mjs → sequenceDiagram-c5b8d532-CqUH37-4.mjs} +2 -2
  38. package/dist/{stateDiagram-1ecb1508-DLa5IHb-.mjs → stateDiagram-1ecb1508-DToPpofg.mjs} +5 -5
  39. package/dist/{stateDiagram-v2-c2b004d7-C7CtacUk.mjs → stateDiagram-v2-c2b004d7-DtoBK6eZ.mjs} +5 -5
  40. package/dist/{styles-b4e223ce-Bz0Hg9uA.mjs → styles-b4e223ce-yS3By_tE.mjs} +1 -1
  41. package/dist/{styles-ca3715f6-puXwKPZV.mjs → styles-ca3715f6-CFUyt9WC.mjs} +1 -1
  42. package/dist/{styles-d45a18b0-DzSpNYE7.mjs → styles-d45a18b0-DbqSLl-5.mjs} +4 -4
  43. package/dist/{svgDrawCommon-b86b1483-_kxEU-iH.mjs → svgDrawCommon-b86b1483-vSp9aK34.mjs} +1 -1
  44. package/dist/{timeline-definition-faaaa080-BGFJV1pG.mjs → timeline-definition-faaaa080-DekReGSM.mjs} +2 -2
  45. package/dist/{xychartDiagram-f5964ef8-Bkojct23.mjs → xychartDiagram-f5964ef8-BW3WJ8FQ.mjs} +4 -4
  46. package/package.json +75 -63
  47. package/dist/createText-1719965b-Bb5L57vX.mjs +0 -155
@@ -1,155 +0,0 @@
1
- import { l as b, b6 as T, b7 as m, i as W, Z as E, b8 as w } from "./index-Bi55S4bg.mjs";
2
- function S(n) {
3
- const t = n.replace(/\n{2,}/g, `
4
- `);
5
- return w(t);
6
- }
7
- function j(n) {
8
- const t = S(n), { children: e } = m(t), o = [[]];
9
- let s = 0;
10
- function i(r, a = "normal") {
11
- r.type === "text" ? r.value.split(`
12
- `).forEach((l, p) => {
13
- p !== 0 && (s++, o.push([])), l.split(" ").forEach((f) => {
14
- f && o[s].push({ content: f, type: a });
15
- });
16
- }) : (r.type === "strong" || r.type === "emphasis") && r.children.forEach((c) => {
17
- i(c, r.type);
18
- });
19
- }
20
- return e.forEach((r) => {
21
- r.type === "paragraph" && r.children.forEach((a) => {
22
- i(a);
23
- });
24
- }), o;
25
- }
26
- function v(n) {
27
- const { children: t } = m(n);
28
- function e(o) {
29
- return o.type === "text" ? o.value.replace(/\n/g, "<br/>") : o.type === "strong" ? `<strong>${o.children.map(e).join("")}</strong>` : o.type === "emphasis" ? `<em>${o.children.map(e).join("")}</em>` : o.type === "paragraph" ? `<p>${o.children.map(e).join("")}</p>` : `Unsupported markdown: ${o.type}`;
30
- }
31
- return t.map(e).join("");
32
- }
33
- function L(n) {
34
- return Intl.Segmenter ? [...new Intl.Segmenter().segment(n)].map((t) => t.segment) : [...n];
35
- }
36
- function $(n, t) {
37
- const e = L(t.content);
38
- return x(n, [], e, t.type);
39
- }
40
- function x(n, t, e, o) {
41
- if (e.length === 0)
42
- return [
43
- { content: t.join(""), type: o },
44
- { content: "", type: o }
45
- ];
46
- const [s, ...i] = e, r = [...t, s];
47
- return n([{ content: r.join(""), type: o }]) ? x(n, r, i, o) : (t.length === 0 && s && (t.push(s), e.shift()), [
48
- { content: t.join(""), type: o },
49
- { content: e.join(""), type: o }
50
- ]);
51
- }
52
- function k(n, t) {
53
- if (n.some(({ content: e }) => e.includes(`
54
- `)))
55
- throw new Error("splitLineToFitWidth does not support newlines in the line");
56
- return h(n, t);
57
- }
58
- function h(n, t, e = [], o = []) {
59
- if (n.length === 0)
60
- return o.length > 0 && e.push(o), e.length > 0 ? e : [];
61
- let s = "";
62
- n[0].content === " " && (s = " ", n.shift());
63
- const i = n.shift() ?? { content: " ", type: "normal" }, r = [...o];
64
- if (s !== "" && r.push({ content: s, type: "normal" }), r.push(i), t(r))
65
- return h(n, t, e, r);
66
- if (o.length > 0)
67
- e.push(o), n.unshift(i);
68
- else if (i.content) {
69
- const [a, c] = $(t, i);
70
- e.push([a]), c.content && n.unshift(c);
71
- }
72
- return h(n, t, e);
73
- }
74
- function M(n, t) {
75
- t && n.attr("style", t);
76
- }
77
- function R(n, t, e, o, s = !1) {
78
- const i = n.append("foreignObject"), r = i.append("xhtml:div"), a = t.label, c = t.isNode ? "nodeLabel" : "edgeLabel";
79
- r.html(
80
- W(
81
- `
82
- <span class="${c} ${o}" ` + (t.labelStyle ? 'style="' + t.labelStyle + '"' : "") + ">" + a + "</span>",
83
- E()
84
- )
85
- ), M(r, t.labelStyle), r.style("display", "table-cell"), r.style("white-space", "nowrap"), r.style("max-width", e + "px"), r.attr("xmlns", "http://www.w3.org/1999/xhtml"), s && r.attr("class", "labelBkg");
86
- let l = r.node().getBoundingClientRect();
87
- return l.width === e && (r.style("display", "table"), r.style("white-space", "break-spaces"), r.style("width", e + "px"), l = r.node().getBoundingClientRect()), i.style("width", l.width), i.style("height", l.height), i.node();
88
- }
89
- function d(n, t, e) {
90
- return n.append("tspan").attr("class", "text-outer-tspan").attr("x", 0).attr("y", t * e - 0.1 + "em").attr("dy", e + "em");
91
- }
92
- function B(n, t, e) {
93
- const o = n.append("text"), s = d(o, 1, t);
94
- g(s, e);
95
- const i = s.node().getComputedTextLength();
96
- return o.remove(), i;
97
- }
98
- function I(n, t, e) {
99
- var o;
100
- const s = n.append("text"), i = d(s, 1, t);
101
- g(i, [{ content: e, type: "normal" }]);
102
- const r = (o = i.node()) == null ? void 0 : o.getBoundingClientRect();
103
- return r && s.remove(), r;
104
- }
105
- function N(n, t, e, o = !1) {
106
- const i = t.append("g"), r = i.insert("rect").attr("class", "background"), a = i.append("text").attr("y", "-10.1");
107
- let c = 0;
108
- for (const l of e) {
109
- const p = (u) => B(i, 1.1, u) <= n, f = p(l) ? [l] : k(l, p);
110
- for (const u of f) {
111
- const y = d(a, c, 1.1);
112
- g(y, u), c++;
113
- }
114
- }
115
- if (o) {
116
- const l = a.node().getBBox(), p = 2;
117
- return r.attr("x", -p).attr("y", -p).attr("width", l.width + 2 * p).attr("height", l.height + 2 * p), i.node();
118
- } else
119
- return a.node();
120
- }
121
- function g(n, t) {
122
- n.text(""), t.forEach((e, o) => {
123
- const s = n.append("tspan").attr("font-style", e.type === "emphasis" ? "italic" : "normal").attr("class", "text-inner-tspan").attr("font-weight", e.type === "strong" ? "bold" : "normal");
124
- o === 0 ? s.text(e.content) : s.text(" " + e.content);
125
- });
126
- }
127
- const O = (n, t = "", {
128
- style: e = "",
129
- isTitle: o = !1,
130
- classes: s = "",
131
- useHtmlLabels: i = !0,
132
- isNode: r = !0,
133
- width: a = 200,
134
- addSvgBackground: c = !1
135
- } = {}) => {
136
- if (b.info("createText", t, e, o, s, i, r, c), i) {
137
- const l = v(t), p = {
138
- isNode: r,
139
- label: T(l).replace(
140
- /fa[blrs]?:fa-[\w-]+/g,
141
- // cspell: disable-line
142
- (u) => `<i class='${u.replace(":", " ")}'></i>`
143
- ),
144
- labelStyle: e.replace("fill:", "color:")
145
- };
146
- return R(n, p, a, s, c);
147
- } else {
148
- const l = j(t);
149
- return N(a, n, l, c);
150
- }
151
- };
152
- export {
153
- O as a,
154
- I as c
155
- };