novelaid-markdown 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/README.md +15 -0
  2. package/dist/_baseFor-Btt7qhvA.js +394 -0
  3. package/dist/arc-B1ElyJRe.js +80 -0
  4. package/dist/architecture-YZFGNWBL-DbwpLiaF.js +3 -0
  5. package/dist/architectureDiagram-Q4EWVU46-DPdA1a51.js +4057 -0
  6. package/dist/array-D9V22jUe.js +6 -0
  7. package/dist/blockDiagram-DXYQGD6D-Bf0IzYoN.js +3035 -0
  8. package/dist/c4Diagram-AHTNJAMY-BlTBDzAq.js +2961 -0
  9. package/dist/channel-CoqXOEHz.js +5 -0
  10. package/dist/chunk-2KRD3SAO-r21hNzXt.js +23 -0
  11. package/dist/chunk-336JU56O-DcVNMTsS.js +49 -0
  12. package/dist/chunk-426QAEUC-B4JQ_vPF.js +9 -0
  13. package/dist/chunk-4BX2VUAB-JBqrV_IE.js +8 -0
  14. package/dist/chunk-4TB4RGXK-DHS8LN6H.js +3255 -0
  15. package/dist/chunk-55IACEB6-C9COrGK_.js +8 -0
  16. package/dist/chunk-5FUZZQ4R-CdCLluck.js +3638 -0
  17. package/dist/chunk-5PVQY5BW-Dgwc0dUk.js +1299 -0
  18. package/dist/chunk-67CJDMHE-UQ-a7p3g.js +23 -0
  19. package/dist/chunk-7N4EOEYR-CPiwpV-A.js +35 -0
  20. package/dist/chunk-AA7GKIK3-DR_Iqho4.js +30 -0
  21. package/dist/chunk-BSJP7CBP-BrxQKL1l.js +82 -0
  22. package/dist/chunk-CIAEETIT-tbco3aB3.js +23 -0
  23. package/dist/chunk-EDXVE4YY-BHsZxHlc.js +25 -0
  24. package/dist/chunk-ENJZ2VHE-Dm2kuGCh.js +560 -0
  25. package/dist/chunk-FMBD7UC4-DwV8Wmed.js +5 -0
  26. package/dist/chunk-FOC6F5B3-CQtHQje_.js +23 -0
  27. package/dist/chunk-ICPOFSXX-B9lsZaK9.js +3363 -0
  28. package/dist/chunk-K5T4RW27-DI9nuGzI.js +16082 -0
  29. package/dist/chunk-KGLVRYIC-BMNH9LI-.js +23 -0
  30. package/dist/chunk-LIHQZDEY-Dc-yVZ_W.js +64 -0
  31. package/dist/chunk-ORNJ4GCN-DqZLt4_8.js +31 -0
  32. package/dist/chunk-OYMX7WX6-B8KpS9qK.js +2014 -0
  33. package/dist/chunk-QZHKN3VN-C4dmvHME.js +15 -0
  34. package/dist/chunk-U2HBQHQK-BME65g2a.js +1896 -0
  35. package/dist/chunk-X2U36JSP-CesuQ-Sm.js +67 -0
  36. package/dist/chunk-XPW4576I-Wv7jaLUC.js +1146 -0
  37. package/dist/chunk-YZCP3GAM-CJIt1xzm.js +60 -0
  38. package/dist/chunk-ZZ45TVLE-CMBGSmdv.js +32 -0
  39. package/dist/chunk-ha4E1CQs.js +20 -0
  40. package/dist/classDiagram-6PBFFD2Q-kvmQgIxu.js +29 -0
  41. package/dist/classDiagram-v2-HSJHXN6E-DLlYyLVf.js +29 -0
  42. package/dist/clone-B5XHQkPs.js +8 -0
  43. package/dist/cose-bilkent-S5V4N54A-xGhciOop.js +2250 -0
  44. package/dist/cytoscape.esm-BgCYa94Q.js +18103 -0
  45. package/dist/dagre-KV5264BT-DNe8h1eH.js +293 -0
  46. package/dist/dagre-SfibWTbo.js +1606 -0
  47. package/dist/defaultLocale-9iKoEQQi.js +201 -0
  48. package/dist/diagram-5BDNPKRD-D_R6IIhE.js +101 -0
  49. package/dist/diagram-G4DWMVQ6-CGlOggN-.js +524 -0
  50. package/dist/diagram-MMDJMWI5-GlxWkSbK.js +213 -0
  51. package/dist/diagram-TYMM5635-Empbfz-2.js +133 -0
  52. package/dist/dist-Dz2K8jVv.js +59 -0
  53. package/dist/erDiagram-SMLLAGMA-DSnlNLPr.js +1700 -0
  54. package/dist/{esm-Psdhd_27.js → esm-Binvve4F.js} +285 -303
  55. package/dist/flatten-BeeUCBYF.js +40 -0
  56. package/dist/flowDiagram-DWJPFMVM-YAh0NsG9.js +4145 -0
  57. package/dist/ganttDiagram-T4ZO3ILL-DkmkZTO5.js +3077 -0
  58. package/dist/gitGraph-7Q5UKJZL-DamMrPFa.js +3 -0
  59. package/dist/gitGraphDiagram-UUTBAWPF-IjLQtHgn.js +728 -0
  60. package/dist/graphlib-DSQqP-5Y.js +373 -0
  61. package/dist/index.css +2 -0
  62. package/dist/index.js +115 -38
  63. package/dist/index.umd.cjs +3218 -23
  64. package/dist/info-OMHHGYJF-BovemagY.js +3 -0
  65. package/dist/infoDiagram-42DDH7IO-izJQDQJs.js +19 -0
  66. package/dist/init-DkX7cl9c.js +15 -0
  67. package/dist/isEmpty-kLGD071T.js +35 -0
  68. package/dist/ishikawaDiagram-UXIWVN3A-SJb5qsLR.js +718 -0
  69. package/dist/journeyDiagram-VCZTEJTY-BDa8bFXG.js +883 -0
  70. package/dist/kanban-definition-6JOO6SKY-i73I3KFw.js +973 -0
  71. package/dist/katex-DI2iMRYj.js +22000 -0
  72. package/dist/line-BD0OIRsH.js +34 -0
  73. package/dist/linear-DV1pG6aV.js +289 -0
  74. package/dist/mermaid-parser.core-CZznKIov.js +69 -0
  75. package/dist/mermaid.core-a1TLqUAY.js +951 -0
  76. package/dist/mindmap-definition-QFDTVHPH-DPG-HkqU.js +1009 -0
  77. package/dist/ordinal-Zd5qpGcV.js +65 -0
  78. package/dist/packet-4T2RLAQJ-BEP9UcAl.js +3 -0
  79. package/dist/path-BSwIfggT.js +85 -0
  80. package/dist/pie-ZZUOXDRM-AZqQmg1p.js +3 -0
  81. package/dist/pieDiagram-DEJITSTG-Cj1YBlb1.js +165 -0
  82. package/dist/quadrantDiagram-34T5L4WZ-ypBI9wre.js +1974 -0
  83. package/dist/radar-PYXPWWZC-BpKM_Ghb.js +3 -0
  84. package/dist/{react-markdown-BXmDW998.js → react-markdown-CwHVAeQi.js} +82 -81
  85. package/dist/reduce-DQgHi9nw.js +532 -0
  86. package/dist/{rehype-raw-_yRr8ewB.js → rehype-raw-CbJS4QeP.js} +346 -346
  87. package/dist/{remark-gfm-Cfc5YeEq.js → remark-gfm-D_QtAzOA.js} +2 -2
  88. package/dist/requirementDiagram-MS252O5E-CkuWjAxJ.js +2221 -0
  89. package/dist/rough.esm-Dun2l6dn.js +1352 -0
  90. package/dist/sankeyDiagram-XADWPNL6-BzIHfJyL.js +920 -0
  91. package/dist/sequenceDiagram-FGHM5R23-NC0cKvy5.js +4157 -0
  92. package/dist/src-D7IEzgYM.js +2149 -0
  93. package/dist/stateDiagram-FHFEXIEX-vd0cNpSx.js +217 -0
  94. package/dist/stateDiagram-v2-QKLJ7IA2-BXsBMk9U.js +27 -0
  95. package/dist/timeline-definition-GMOUNBTQ-DeOvCyAs.js +1068 -0
  96. package/dist/treeView-SZITEDCU-D-ftaYOL.js +3 -0
  97. package/dist/treemap-W4RFUUIX-B2bp9KIg.js +3 -0
  98. package/dist/vennDiagram-DHZGUBPP-Hraq3pvR.js +1858 -0
  99. package/dist/wardley-RL74JXVD-BdjKuxh8.js +3 -0
  100. package/dist/wardleyDiagram-NUSXRM2D-C06eRanG.js +578 -0
  101. package/dist/xychartDiagram-5P7HB3ND-BiD79JlS.js +2044 -0
  102. package/package.json +2 -1
  103. /package/dist/{blank-line-ClJSvRAu.js → blank-line-DxLGQ569.js} +0 -0
  104. /package/dist/{lib-DWIu06lZ.js → lib-z8X9LcoZ.js} +0 -0
@@ -0,0 +1,373 @@
1
+ import { C as e, E as t, S as n, T as r, a as i, b as a, c as o, i as s, n as c, s as l, t as u, w as d, x as f } from "./reduce-DQgHi9nw.js";
2
+ import { C as p, E as m, g as ee, h, l as g, p as te, u as _, v, w as ne } from "./_baseFor-Btt7qhvA.js";
3
+ import { n as y, t as b } from "./isEmpty-kLGD071T.js";
4
+ import { A as re, C as x, D as S, E as ie, M as ae, O as oe, T as se, j as C, k as ce, w, x as T, y as le } from "./chunk-5PVQY5BW-Dgwc0dUk.js";
5
+ //#region node_modules/lodash-es/_baseAssign.js
6
+ function ue(e, t) {
7
+ return e && w(t, f(t), e);
8
+ }
9
+ //#endregion
10
+ //#region node_modules/lodash-es/_baseAssignIn.js
11
+ function de(e, t) {
12
+ return e && w(t, x(t), e);
13
+ }
14
+ //#endregion
15
+ //#region node_modules/lodash-es/_copySymbols.js
16
+ function fe(e, t) {
17
+ return w(e, n(e), t);
18
+ }
19
+ //#endregion
20
+ //#region node_modules/lodash-es/_getSymbolsIn.js
21
+ var E = Object.getOwnPropertySymbols ? function(e) {
22
+ for (var t = []; e;) r(t, n(e)), e = oe(e);
23
+ return t;
24
+ } : e;
25
+ //#endregion
26
+ //#region node_modules/lodash-es/_copySymbolsIn.js
27
+ function pe(e, t) {
28
+ return w(e, E(e), t);
29
+ }
30
+ //#endregion
31
+ //#region node_modules/lodash-es/_getAllKeysIn.js
32
+ function me(e) {
33
+ return d(e, x, E);
34
+ }
35
+ //#endregion
36
+ //#region node_modules/lodash-es/_initCloneArray.js
37
+ var he = Object.prototype.hasOwnProperty;
38
+ function ge(e) {
39
+ var t = e.length, n = new e.constructor(t);
40
+ return t && typeof e[0] == "string" && he.call(e, "index") && (n.index = e.index, n.input = e.input), n;
41
+ }
42
+ //#endregion
43
+ //#region node_modules/lodash-es/_cloneDataView.js
44
+ function _e(e, t) {
45
+ var n = t ? C(e.buffer) : e.buffer;
46
+ return new e.constructor(n, e.byteOffset, e.byteLength);
47
+ }
48
+ //#endregion
49
+ //#region node_modules/lodash-es/_cloneRegExp.js
50
+ var D = /\w*$/;
51
+ function O(e) {
52
+ var t = new e.constructor(e.source, D.exec(e));
53
+ return t.lastIndex = e.lastIndex, t;
54
+ }
55
+ //#endregion
56
+ //#region node_modules/lodash-es/_cloneSymbol.js
57
+ var k = m ? m.prototype : void 0, A = k ? k.valueOf : void 0;
58
+ function j(e) {
59
+ return A ? Object(A.call(e)) : {};
60
+ }
61
+ //#endregion
62
+ //#region node_modules/lodash-es/_initCloneByTag.js
63
+ var M = "[object Boolean]", N = "[object Date]", P = "[object Map]", F = "[object Number]", I = "[object RegExp]", ve = "[object Set]", ye = "[object String]", be = "[object Symbol]", xe = "[object ArrayBuffer]", Se = "[object DataView]", Ce = "[object Float32Array]", we = "[object Float64Array]", Te = "[object Int8Array]", Ee = "[object Int16Array]", De = "[object Int32Array]", Oe = "[object Uint8Array]", ke = "[object Uint8ClampedArray]", Ae = "[object Uint16Array]", je = "[object Uint32Array]";
64
+ function Me(e, t, n) {
65
+ var r = e.constructor;
66
+ switch (t) {
67
+ case xe: return C(e);
68
+ case M:
69
+ case N: return new r(+e);
70
+ case Se: return _e(e, n);
71
+ case Ce:
72
+ case we:
73
+ case Te:
74
+ case Ee:
75
+ case De:
76
+ case Oe:
77
+ case ke:
78
+ case Ae:
79
+ case je: return re(e, n);
80
+ case P: return new r();
81
+ case F:
82
+ case ye: return new r(e);
83
+ case I: return O(e);
84
+ case ve: return new r();
85
+ case be: return j(e);
86
+ }
87
+ }
88
+ //#endregion
89
+ //#region node_modules/lodash-es/_baseIsMap.js
90
+ var Ne = "[object Map]";
91
+ function Pe(e) {
92
+ return h(e) && y(e) == Ne;
93
+ }
94
+ //#endregion
95
+ //#region node_modules/lodash-es/isMap.js
96
+ var L = g && g.isMap, Fe = L ? _(L) : Pe, Ie = "[object Set]";
97
+ function Le(e) {
98
+ return h(e) && y(e) == Ie;
99
+ }
100
+ //#endregion
101
+ //#region node_modules/lodash-es/isSet.js
102
+ var R = g && g.isSet, Re = R ? _(R) : Le, ze = 1, Be = 2, Ve = 4, z = "[object Arguments]", He = "[object Array]", Ue = "[object Boolean]", We = "[object Date]", Ge = "[object Error]", B = "[object Function]", Ke = "[object GeneratorFunction]", qe = "[object Map]", Je = "[object Number]", V = "[object Object]", Ye = "[object RegExp]", Xe = "[object Set]", Ze = "[object String]", Qe = "[object Symbol]", $e = "[object WeakMap]", et = "[object ArrayBuffer]", tt = "[object DataView]", nt = "[object Float32Array]", rt = "[object Float64Array]", it = "[object Int8Array]", at = "[object Int16Array]", ot = "[object Int32Array]", st = "[object Uint8Array]", ct = "[object Uint8ClampedArray]", lt = "[object Uint16Array]", ut = "[object Uint32Array]", H = {};
103
+ H[z] = H[He] = H[et] = H[tt] = H[Ue] = H[We] = H[nt] = H[rt] = H[it] = H[at] = H[ot] = H[qe] = H[Je] = H[V] = H[Ye] = H[Xe] = H[Ze] = H[Qe] = H[st] = H[ct] = H[lt] = H[ut] = !0, H[Ge] = H[B] = H[$e] = !1;
104
+ function U(e, t, n, r, i, o) {
105
+ var c, l = t & ze, u = t & Be, d = t & Ve;
106
+ if (n && (c = i ? n(e, r, i, o) : n(e)), c !== void 0) return c;
107
+ if (!ne(e)) return e;
108
+ var p = ee(e);
109
+ if (p) {
110
+ if (c = ge(e), !l) return ce(e, c);
111
+ } else {
112
+ var m = y(e), h = m == B || m == Ke;
113
+ if (te(e)) return ae(e, l);
114
+ if (m == V || m == z || h && !i) {
115
+ if (c = u || h ? {} : S(e), !l) return u ? pe(e, de(c, e)) : fe(e, ue(c, e));
116
+ } else {
117
+ if (!H[m]) return i ? e : {};
118
+ c = Me(e, m, l);
119
+ }
120
+ }
121
+ o ||= new v();
122
+ var g = o.get(e);
123
+ if (g) return g;
124
+ o.set(e, c), Re(e) ? e.forEach(function(r) {
125
+ c.add(U(r, t, n, r, e, o));
126
+ }) : Fe(e) && e.forEach(function(r, i) {
127
+ c.set(i, U(r, t, n, i, e, o));
128
+ });
129
+ var _ = p ? void 0 : (d ? u ? me : a : u ? x : f)(e);
130
+ return s(_ || e, function(r, i) {
131
+ _ && (i = r, r = e[i]), se(c, i, U(r, t, n, i, e, o));
132
+ }), c;
133
+ }
134
+ //#endregion
135
+ //#region node_modules/lodash-es/_baseValues.js
136
+ function W(e, n) {
137
+ return t(n, function(t) {
138
+ return e[t];
139
+ });
140
+ }
141
+ //#endregion
142
+ //#region node_modules/lodash-es/values.js
143
+ function G(e) {
144
+ return e == null ? [] : W(e, f(e));
145
+ }
146
+ //#endregion
147
+ //#region node_modules/lodash-es/isUndefined.js
148
+ function K(e) {
149
+ return e === void 0;
150
+ }
151
+ //#endregion
152
+ //#region node_modules/lodash-es/union.js
153
+ var dt = le(function(e) {
154
+ return i(l(e, 1, ie, !0));
155
+ }), ft = "\0", q = "\0", J = "", Y = class {
156
+ constructor(e = {}) {
157
+ this._isDirected = Object.prototype.hasOwnProperty.call(e, "directed") ? e.directed : !0, this._isMultigraph = Object.prototype.hasOwnProperty.call(e, "multigraph") ? e.multigraph : !1, this._isCompound = Object.prototype.hasOwnProperty.call(e, "compound") ? e.compound : !1, this._label = void 0, this._defaultNodeLabelFn = T(void 0), this._defaultEdgeLabelFn = T(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[q] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
158
+ }
159
+ isDirected() {
160
+ return this._isDirected;
161
+ }
162
+ isMultigraph() {
163
+ return this._isMultigraph;
164
+ }
165
+ isCompound() {
166
+ return this._isCompound;
167
+ }
168
+ setGraph(e) {
169
+ return this._label = e, this;
170
+ }
171
+ graph() {
172
+ return this._label;
173
+ }
174
+ setDefaultNodeLabel(e) {
175
+ return p(e) || (e = T(e)), this._defaultNodeLabelFn = e, this;
176
+ }
177
+ nodeCount() {
178
+ return this._nodeCount;
179
+ }
180
+ nodes() {
181
+ return f(this._nodes);
182
+ }
183
+ sources() {
184
+ var e = this;
185
+ return o(this.nodes(), function(t) {
186
+ return b(e._in[t]);
187
+ });
188
+ }
189
+ sinks() {
190
+ var e = this;
191
+ return o(this.nodes(), function(t) {
192
+ return b(e._out[t]);
193
+ });
194
+ }
195
+ setNodes(e, t) {
196
+ var n = arguments, r = this;
197
+ return c(e, function(e) {
198
+ n.length > 1 ? r.setNode(e, t) : r.setNode(e);
199
+ }), this;
200
+ }
201
+ setNode(e, t) {
202
+ return Object.prototype.hasOwnProperty.call(this._nodes, e) ? (arguments.length > 1 && (this._nodes[e] = t), this) : (this._nodes[e] = arguments.length > 1 ? t : this._defaultNodeLabelFn(e), this._isCompound && (this._parent[e] = q, this._children[e] = {}, this._children[q][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this);
203
+ }
204
+ node(e) {
205
+ return this._nodes[e];
206
+ }
207
+ hasNode(e) {
208
+ return Object.prototype.hasOwnProperty.call(this._nodes, e);
209
+ }
210
+ removeNode(e) {
211
+ if (Object.prototype.hasOwnProperty.call(this._nodes, e)) {
212
+ var t = (e) => this.removeEdge(this._edgeObjs[e]);
213
+ delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], c(this.children(e), (e) => {
214
+ this.setParent(e);
215
+ }), delete this._children[e]), c(f(this._in[e]), t), delete this._in[e], delete this._preds[e], c(f(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount;
216
+ }
217
+ return this;
218
+ }
219
+ setParent(e, t) {
220
+ if (!this._isCompound) throw Error("Cannot set parent in a non-compound graph");
221
+ if (K(t)) t = q;
222
+ else {
223
+ t += "";
224
+ for (var n = t; !K(n); n = this.parent(n)) if (n === e) throw Error("Setting " + t + " as parent of " + e + " would create a cycle");
225
+ this.setNode(t);
226
+ }
227
+ return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this;
228
+ }
229
+ _removeFromParentsChildList(e) {
230
+ delete this._children[this._parent[e]][e];
231
+ }
232
+ parent(e) {
233
+ if (this._isCompound) {
234
+ var t = this._parent[e];
235
+ if (t !== q) return t;
236
+ }
237
+ }
238
+ children(e) {
239
+ if (K(e) && (e = q), this._isCompound) {
240
+ var t = this._children[e];
241
+ if (t) return f(t);
242
+ } else if (e === q) return this.nodes();
243
+ else if (this.hasNode(e)) return [];
244
+ }
245
+ predecessors(e) {
246
+ var t = this._preds[e];
247
+ if (t) return f(t);
248
+ }
249
+ successors(e) {
250
+ var t = this._sucs[e];
251
+ if (t) return f(t);
252
+ }
253
+ neighbors(e) {
254
+ var t = this.predecessors(e);
255
+ if (t) return dt(t, this.successors(e));
256
+ }
257
+ isLeaf(e) {
258
+ return (this.isDirected() ? this.successors(e) : this.neighbors(e)).length === 0;
259
+ }
260
+ filterNodes(e) {
261
+ var t = new this.constructor({
262
+ directed: this._isDirected,
263
+ multigraph: this._isMultigraph,
264
+ compound: this._isCompound
265
+ });
266
+ t.setGraph(this.graph());
267
+ var n = this;
268
+ c(this._nodes, function(n, r) {
269
+ e(r) && t.setNode(r, n);
270
+ }), c(this._edgeObjs, function(e) {
271
+ t.hasNode(e.v) && t.hasNode(e.w) && t.setEdge(e, n.edge(e));
272
+ });
273
+ var r = {};
274
+ function i(e) {
275
+ var a = n.parent(e);
276
+ return a === void 0 || t.hasNode(a) ? (r[e] = a, a) : a in r ? r[a] : i(a);
277
+ }
278
+ return this._isCompound && c(t.nodes(), function(e) {
279
+ t.setParent(e, i(e));
280
+ }), t;
281
+ }
282
+ setDefaultEdgeLabel(e) {
283
+ return p(e) || (e = T(e)), this._defaultEdgeLabelFn = e, this;
284
+ }
285
+ edgeCount() {
286
+ return this._edgeCount;
287
+ }
288
+ edges() {
289
+ return G(this._edgeObjs);
290
+ }
291
+ setPath(e, t) {
292
+ var n = this, r = arguments;
293
+ return u(e, function(e, i) {
294
+ return r.length > 1 ? n.setEdge(e, i, t) : n.setEdge(e, i), i;
295
+ }), this;
296
+ }
297
+ setEdge() {
298
+ var e, t, n, r, i = !1, a = arguments[0];
299
+ typeof a == "object" && a && "v" in a ? (e = a.v, t = a.w, n = a.name, arguments.length === 2 && (r = arguments[1], i = !0)) : (e = a, t = arguments[1], n = arguments[3], arguments.length > 2 && (r = arguments[2], i = !0)), e = "" + e, t = "" + t, K(n) || (n = "" + n);
300
+ var o = Q(this._isDirected, e, t, n);
301
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, o)) return i && (this._edgeLabels[o] = r), this;
302
+ if (!K(n) && !this._isMultigraph) throw Error("Cannot set a named edge when isMultigraph = false");
303
+ this.setNode(e), this.setNode(t), this._edgeLabels[o] = i ? r : this._defaultEdgeLabelFn(e, t, n);
304
+ var s = pt(this._isDirected, e, t, n);
305
+ return e = s.v, t = s.w, Object.freeze(s), this._edgeObjs[o] = s, X(this._preds[t], e), X(this._sucs[e], t), this._in[t][o] = s, this._out[e][o] = s, this._edgeCount++, this;
306
+ }
307
+ edge(e, t, n) {
308
+ var r = arguments.length === 1 ? $(this._isDirected, arguments[0]) : Q(this._isDirected, e, t, n);
309
+ return this._edgeLabels[r];
310
+ }
311
+ hasEdge(e, t, n) {
312
+ var r = arguments.length === 1 ? $(this._isDirected, arguments[0]) : Q(this._isDirected, e, t, n);
313
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, r);
314
+ }
315
+ removeEdge(e, t, n) {
316
+ var r = arguments.length === 1 ? $(this._isDirected, arguments[0]) : Q(this._isDirected, e, t, n), i = this._edgeObjs[r];
317
+ return i && (e = i.v, t = i.w, delete this._edgeLabels[r], delete this._edgeObjs[r], Z(this._preds[t], e), Z(this._sucs[e], t), delete this._in[t][r], delete this._out[e][r], this._edgeCount--), this;
318
+ }
319
+ inEdges(e, t) {
320
+ var n = this._in[e];
321
+ if (n) {
322
+ var r = G(n);
323
+ return t ? o(r, function(e) {
324
+ return e.v === t;
325
+ }) : r;
326
+ }
327
+ }
328
+ outEdges(e, t) {
329
+ var n = this._out[e];
330
+ if (n) {
331
+ var r = G(n);
332
+ return t ? o(r, function(e) {
333
+ return e.w === t;
334
+ }) : r;
335
+ }
336
+ }
337
+ nodeEdges(e, t) {
338
+ var n = this.inEdges(e, t);
339
+ if (n) return n.concat(this.outEdges(e, t));
340
+ }
341
+ };
342
+ Y.prototype._nodeCount = 0, Y.prototype._edgeCount = 0;
343
+ function X(e, t) {
344
+ e[t] ? e[t]++ : e[t] = 1;
345
+ }
346
+ function Z(e, t) {
347
+ --e[t] || delete e[t];
348
+ }
349
+ function Q(e, t, n, r) {
350
+ var i = "" + t, a = "" + n;
351
+ if (!e && i > a) {
352
+ var o = i;
353
+ i = a, a = o;
354
+ }
355
+ return i + J + a + J + (K(r) ? ft : r);
356
+ }
357
+ function pt(e, t, n, r) {
358
+ var i = "" + t, a = "" + n;
359
+ if (!e && i > a) {
360
+ var o = i;
361
+ i = a, a = o;
362
+ }
363
+ var s = {
364
+ v: i,
365
+ w: a
366
+ };
367
+ return r && (s.name = r), s;
368
+ }
369
+ function $(e, t) {
370
+ return Q(e, t.v, t.w, t.name);
371
+ }
372
+ //#endregion
373
+ export { U as i, K as n, G as r, Y as t };
package/dist/index.css ADDED
@@ -0,0 +1,2 @@
1
+ ruby rt{font-size:.5em}.bouten{text-emphasis:dot}
2
+ /*$vite$:1*/
package/dist/index.js CHANGED
@@ -32,10 +32,87 @@ var o = class e {
32
32
  let t = e;
33
33
  return t = t.replace(s.RUBY_WITH_PIPE, "<ruby>$1<rt>$2</rt></ruby>"), t = t.replace(s.RUBY_WITHOUT_PIPE, "<ruby>$1<rt>$2</rt></ruby>"), t = t.replace(s.BOUTEN, "<span class=\"bouten\">$1</span>"), t;
34
34
  }]
35
- }, l = class {
35
+ }, l = null, u = null, d = async () => l || (u ||= (async () => {
36
+ try {
37
+ let e = await import("./mermaid.core-a1TLqUAY.js");
38
+ return l = e.default || e, l;
39
+ } catch (e) {
40
+ throw u = null, e;
41
+ }
42
+ })(), u), f = Promise.resolve(), p = {
43
+ name: "mermaid",
44
+ codeProcessors: [{
45
+ language: "mermaid",
46
+ component: ({ value: e, attributes: n = {} }) => {
47
+ let [o, s] = r(""), { width: c, height: l } = n;
48
+ return t(() => {
49
+ let t = !0, n = () => {
50
+ ["dmermaid-debug", "mermaid-error-container"].forEach((e) => {
51
+ let t = document.getElementById(e);
52
+ t && t.remove();
53
+ }), document.querySelectorAll("[id^=\"dmermaid-\"]").forEach((e) => {
54
+ e.parentNode === document.body && e.remove();
55
+ });
56
+ };
57
+ return (async () => {
58
+ if (!e || e.trim() === "") {
59
+ s("");
60
+ return;
61
+ }
62
+ let r = e.substring(0, 20).replace(/\n/g, " ");
63
+ s("<div class=\"mermaid-loading\" style=\"opacity: 0.6; padding: 1em; font-size: 12px; color: gray;\">Mermaid rendering...</div>");
64
+ let i = (async () => {
65
+ if (await f, t) try {
66
+ let i = new Promise((e, t) => setTimeout(() => t(/* @__PURE__ */ Error("Rendering Timeout (5s)")), 5e3));
67
+ await Promise.race([(async () => {
68
+ let i = await d();
69
+ if (!t || (n(), await i.parse(e), !t)) return;
70
+ console.log(`[Mermaid] Executing render: ${r}...`);
71
+ let a = `mermaid-${Math.random().toString(36).substring(2, 11)}`, { svg: o } = await i.render(a, e);
72
+ t && s(o);
73
+ })(), i]);
74
+ } catch (r) {
75
+ if (!t) return;
76
+ console.error(`[Mermaid] Render failed: ${e}`, r), n(), s(`<pre class="mermaid-error" style="color: #f44336; padding: 1em; border: 1px solid #f44336; border-radius: 4px; background: rgba(244, 67, 54, 0.05); font-size: 13px; white-space: pre-wrap; word-break: break-all;">Mermaid Syntax Error:\n${r instanceof Error ? r.message : "Invalid Mermaid syntax"}</pre>`);
77
+ }
78
+ })();
79
+ f = (async () => {
80
+ try {
81
+ await i;
82
+ } catch {}
83
+ })(), await i;
84
+ })(), () => {
85
+ t = !1;
86
+ };
87
+ }, [e]), /* @__PURE__ */ a("div", {
88
+ className: "mermaid-container",
89
+ style: {
90
+ display: "flex",
91
+ justifyContent: "center",
92
+ alignItems: "center",
93
+ margin: "1.5em 0",
94
+ maxWidth: "100%",
95
+ overflow: "auto",
96
+ width: c || "100%",
97
+ height: l || "auto"
98
+ },
99
+ children: [/* @__PURE__ */ i("style", { children: "\n .mermaid-container svg {\n max-width: 100%;\n max-height: 100%;\n height: auto;\n }\n " }), /* @__PURE__ */ i("div", {
100
+ style: {
101
+ width: "100%",
102
+ height: "100%",
103
+ display: "flex",
104
+ justifyContent: "center",
105
+ alignItems: "center"
106
+ },
107
+ dangerouslySetInnerHTML: { __html: o }
108
+ })]
109
+ });
110
+ }
111
+ }]
112
+ }, m = class {
36
113
  registry;
37
114
  constructor() {
38
- this.registry = new o(), this.registry.register(c);
115
+ this.registry = new o(), this.registry.register(c), this.registry.register(p);
39
116
  }
40
117
  registerPlugin(e) {
41
118
  this.registry.register(e);
@@ -51,27 +128,27 @@ var o = class e {
51
128
  getCodeProcessors() {
52
129
  return this.registry.getCodeProcessors();
53
130
  }
54
- }, u = new l();
131
+ }, h = new m();
55
132
  //#endregion
56
133
  //#region src/utils/attribute-parser.ts
57
- function d(e) {
134
+ function g(e) {
58
135
  return e.replace(/-([a-z])/g, (e) => e[1].toUpperCase());
59
136
  }
60
- function f(e) {
137
+ function _(e) {
61
138
  let t = {};
62
139
  if (!e) return t;
63
140
  let n = e.trim();
64
141
  n.startsWith("{") && n.endsWith("}") ? n = n.substring(1, n.length - 1).trim() : n.startsWith("{") && (n = n.substring(1).trim());
65
142
  let r = /([a-zA-Z0-9_-]+)(?:=([^"'\r\n\t ,{}]+|"(?:\\"|[^"])*"|'(?:\\'|[^'])*'))?/g, i;
66
143
  for (; (i = r.exec(n)) !== null;) {
67
- let e = i[1], n = i[2], r = d(e);
144
+ let e = i[1], n = i[2], r = g(e);
68
145
  n === void 0 ? t[r] = !0 : ((n.startsWith("\"") && n.endsWith("\"") || n.startsWith("'") && n.endsWith("'")) && (n = n.substring(1, n.length - 1)), (r === "width" || r === "height") && /^\d+$/.test(n) && (n = `${n}px`), t[r] = n);
69
146
  }
70
147
  return t;
71
148
  }
72
149
  //#endregion
73
150
  //#region src/renderer/NovelaidMarkdown.tsx
74
- function p({ src: e, alt: t, filePath: n, title: r }) {
151
+ function v({ src: e, alt: t, filePath: n, title: r }) {
75
152
  let a = e, o = t, s, c;
76
153
  if (o && o.includes("|")) {
77
154
  let e = o.lastIndexOf("|"), t = o.substring(e + 1).trim();
@@ -95,7 +172,7 @@ function p({ src: e, alt: t, filePath: n, title: r }) {
95
172
  height: c
96
173
  });
97
174
  }
98
- var m = class extends e.Component {
175
+ var y = class extends e.Component {
99
176
  constructor(e) {
100
177
  super(e), this.state = { hasError: !1 };
101
178
  }
@@ -118,19 +195,19 @@ var m = class extends e.Component {
118
195
  }) : this.props.children;
119
196
  }
120
197
  };
121
- function h({ content: e, filePath: a, className: o = "", onLinkClick: s }) {
122
- let [c, l] = r(null), [d, h] = r(null), [g, _] = r(null);
198
+ function b({ content: e, filePath: a, className: o = "", onLinkClick: s }) {
199
+ let [c, l] = r(null), [u, d] = r(null), [f, p] = r(null);
123
200
  t(() => {
124
201
  Promise.all([
125
- import("./react-markdown-BXmDW998.js"),
126
- import("./remark-gfm-Cfc5YeEq.js"),
127
- import("./rehype-raw-_yRr8ewB.js")
128
- ]).then(([e, t, n]) => (l(() => e.default), h(() => t.default), _(() => n.default), null)).catch((e) => {
202
+ import("./react-markdown-CwHVAeQi.js"),
203
+ import("./remark-gfm-D_QtAzOA.js"),
204
+ import("./rehype-raw-CbJS4QeP.js")
205
+ ]).then(([e, t, n]) => (l(() => e.default), d(() => t.default), p(() => n.default), null)).catch((e) => {
129
206
  console.error("Failed to load markdown modules:", e);
130
207
  });
131
208
  }, []);
132
- let v = n(() => ({
133
- img: (e) => /* @__PURE__ */ i(p, {
209
+ let m = n(() => ({
210
+ img: (e) => /* @__PURE__ */ i(v, {
134
211
  ...e,
135
212
  filePath: a
136
213
  }),
@@ -149,24 +226,24 @@ function h({ content: e, filePath: a, className: o = "", onLinkClick: s }) {
149
226
  let e = s.indexOf("{");
150
227
  c = s.substring(0, e), l ||= s.substring(e);
151
228
  }
152
- let d = f(l), p = c || "", m = String(t).replace(/\n$/, ""), h = { ...d }, g = u.getCodePreprocessors();
153
- for (let e of g) if (e.languages.includes(p) || e.languages.includes("*")) {
229
+ let u = _(l), d = c || "", f = String(t).replace(/\n$/, ""), p = { ...u }, m = h.getCodePreprocessors();
230
+ for (let e of m) if (e.languages.includes(d) || e.languages.includes("*")) {
154
231
  let t = e.preprocess({
155
- language: p,
156
- code: m,
157
- attributes: h
232
+ language: d,
233
+ code: f,
234
+ attributes: p
158
235
  });
159
- p = t.language, m = t.code, h = t.attributes;
236
+ d = t.language, f = t.code, p = t.attributes;
160
237
  }
161
- let _ = u.getCodeProcessors().find((e) => e.language === p);
162
- if (_) {
163
- let e = _.component;
238
+ let g = h.getCodeProcessors().find((e) => e.language === d);
239
+ if (g) {
240
+ let e = g.component;
164
241
  return /* @__PURE__ */ i(e, {
165
- value: m,
166
- language: p,
167
- attributes: h,
242
+ value: f,
243
+ language: d,
244
+ attributes: p,
168
245
  ...a
169
- }, m);
246
+ }, f);
170
247
  }
171
248
  return /* @__PURE__ */ i("code", {
172
249
  className: n,
@@ -175,21 +252,21 @@ function h({ content: e, filePath: a, className: o = "", onLinkClick: s }) {
175
252
  });
176
253
  }
177
254
  }), [a, s]);
178
- if (!c || !d || !g) return /* @__PURE__ */ i("div", { children: "Loading preview..." });
179
- let y = u.preprocess(e);
255
+ if (!c || !u || !f) return /* @__PURE__ */ i("div", { children: "Loading preview..." });
256
+ let g = h.preprocess(e);
180
257
  return /* @__PURE__ */ i("div", {
181
258
  className: o,
182
- children: /* @__PURE__ */ i(m, {
183
- content: y,
259
+ children: /* @__PURE__ */ i(y, {
260
+ content: g,
184
261
  filePath: a,
185
262
  children: /* @__PURE__ */ i(c, {
186
- remarkPlugins: [d],
187
- rehypePlugins: [g],
188
- components: v,
189
- children: y
263
+ remarkPlugins: [u],
264
+ rehypePlugins: [f],
265
+ components: m,
266
+ children: g
190
267
  })
191
268
  })
192
269
  });
193
270
  }
194
271
  //#endregion
195
- export { h as NovelaidMarkdown, l as NovelaidMarkdownProcessor, u as defaultProcessor };
272
+ export { b as NovelaidMarkdown, m as NovelaidMarkdownProcessor, h as defaultProcessor };