bg-editor 0.0.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.
Files changed (67) hide show
  1. package/LICENSE +8 -0
  2. package/README.md +51 -0
  3. package/README.zh-CN.md +51 -0
  4. package/dist/_basePickBy-4kmg42pS.js +158 -0
  5. package/dist/_baseUniq-WOvvCHTI.js +621 -0
  6. package/dist/arc-wItjmL5I.js +90 -0
  7. package/dist/architecture-U656AL7Q-FYDwFSxk.js +12 -0
  8. package/dist/architectureDiagram-VXUJARFQ-iG5MkBjx.js +4666 -0
  9. package/dist/blockDiagram-VD42YOAC-i2GlXmWy.js +2268 -0
  10. package/dist/c4Diagram-YG6GDRKO-IufO7T1R.js +1587 -0
  11. package/dist/channel-Dah4F59k.js +12 -0
  12. package/dist/chunk-4BX2VUAB-5_v9rnje.js +15 -0
  13. package/dist/chunk-55IACEB6-BDNtSypP.js +15 -0
  14. package/dist/chunk-B4BG7PRW-DzaYPsfW.js +1382 -0
  15. package/dist/chunk-DI55MBZ5-Buwrprkw.js +1377 -0
  16. package/dist/chunk-FMBD7UC4-BaEPEIWb.js +26 -0
  17. package/dist/chunk-QN33PNHL-DhbA7i5G.js +26 -0
  18. package/dist/chunk-QZHKN3VN-BAb_D1oz.js +22 -0
  19. package/dist/chunk-TZMSLE5B-OU1MJ2do.js +71 -0
  20. package/dist/classDiagram-2ON5EDUG-KStC8v09.js +23 -0
  21. package/dist/classDiagram-v2-WZHVMYZB-KStC8v09.js +23 -0
  22. package/dist/clone-C74UiRbr.js +15 -0
  23. package/dist/cose-bilkent-S5V4N54A-eRXCoix2.js +2612 -0
  24. package/dist/cytoscape.esm-BG3R4uVs.js +18738 -0
  25. package/dist/dagre-6UL2VRFP-Bi83jPQf.js +451 -0
  26. package/dist/defaultLocale-DgmhL6Re.js +178 -0
  27. package/dist/diagram-PSM6KHXK-aW98k2-4.js +539 -0
  28. package/dist/diagram-QEK2KX5R-BR--iNM5.js +224 -0
  29. package/dist/diagram-S2PKOQOG-NTnEy5_O.js +149 -0
  30. package/dist/erDiagram-Q2GNP2WA-C8oZ5c-S.js +848 -0
  31. package/dist/flowDiagram-NV44I4VS-DiKad3Bb.js +1627 -0
  32. package/dist/ganttDiagram-LVOFAZNH-CthzjjJq.js +2506 -0
  33. package/dist/gitGraph-F6HP7TQM-CuXAC0XT.js +12 -0
  34. package/dist/gitGraphDiagram-NY62KEGX-d4KszKqi.js +706 -0
  35. package/dist/graph-CnOTx4E0.js +254 -0
  36. package/dist/index-D6-Wf75-.js +122127 -0
  37. package/dist/info-NVLQJR56-Dhmtdc7O.js +12 -0
  38. package/dist/infoDiagram-ER5ION4S-DedidjTu.js +31 -0
  39. package/dist/init-d639unba.js +23 -0
  40. package/dist/journeyDiagram-XKPGCS4Q-BylvmUWL.js +843 -0
  41. package/dist/kanban-definition-3W4ZIXB7-DGV_aVgU.js +725 -0
  42. package/dist/layout-OXk4OSoz.js +1342 -0
  43. package/dist/linear-CO_vz87n.js +266 -0
  44. package/dist/mermaid-parser.core-CYtF6phW.js +12928 -0
  45. package/dist/mindmap-definition-VGOIOE7T-BU05Y6Vz.js +790 -0
  46. package/dist/ordinal-CofNqUw2.js +68 -0
  47. package/dist/packet-BFZMPI3H-D7H_8Q-U.js +12 -0
  48. package/dist/pie-7BOR55EZ-BNWNcO5Z.js +12 -0
  49. package/dist/pieDiagram-ADFJNKIX-reGTUsiW.js +168 -0
  50. package/dist/quadrantDiagram-AYHSOK5B-NeHOJ0lX.js +1029 -0
  51. package/dist/radar-NHE76QYJ-DrVEcvh1.js +12 -0
  52. package/dist/requirementDiagram-UZGBJVZJ-BE76XNaT.js +857 -0
  53. package/dist/sankeyDiagram-TZEHDZUN-UHfMLEKl.js +817 -0
  54. package/dist/sequenceDiagram-WL72ISMW-62KWnVbh.js +2518 -0
  55. package/dist/stateDiagram-FKZM4ZOC--_CkWvu6.js +270 -0
  56. package/dist/stateDiagram-v2-4FDKWEC3-Dj7ZjAmI.js +23 -0
  57. package/dist/style.css +1 -0
  58. package/dist/timeline-definition-IT6M3QCI-C3Wb0xMN.js +804 -0
  59. package/dist/treemap-KMMF4GRG-Bc8F2dFd.js +12 -0
  60. package/dist/umo-editor.js +16 -0
  61. package/dist/xychartDiagram-PRI3JC2R-D2J307cO.js +1347 -0
  62. package/package.json +200 -0
  63. package/types/index.d.ts +277 -0
  64. package/types/src/components/index.d.ts +9 -0
  65. package/types/src/components/menus/button.vue.d.ts +583 -0
  66. package/types/src/components/modal.vue.d.ts +2 -0
  67. package/types/src/components/tooltip.vue.d.ts +27 -0
@@ -0,0 +1,254 @@
1
+ import "./style.css";
2
+ import { aA as N, aB as j, aC as f, aD as b, aE as E } from "./index-D6-Wf75-.js";
3
+ import { a as v, c as P, k as _, f as g, d, i as l, v as p, r as D } from "./_baseUniq-WOvvCHTI.js";
4
+ /**
5
+ * @umoteam/editor 9.0.1
6
+ * @license MIT
7
+ * @author umodoc https://www.umodoc.com
8
+ * @see https://www.umodoc.com
9
+ **/
10
+ var w = N(function(o) {
11
+ return v(P(o, 1, j, !0));
12
+ }), F = "\0", a = "\0", O = "";
13
+ class L {
14
+ constructor(e = {}) {
15
+ 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 = f(void 0), this._defaultEdgeLabelFn = f(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[a] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
16
+ }
17
+ /* === Graph functions ========= */
18
+ isDirected() {
19
+ return this._isDirected;
20
+ }
21
+ isMultigraph() {
22
+ return this._isMultigraph;
23
+ }
24
+ isCompound() {
25
+ return this._isCompound;
26
+ }
27
+ setGraph(e) {
28
+ return this._label = e, this;
29
+ }
30
+ graph() {
31
+ return this._label;
32
+ }
33
+ /* === Node functions ========== */
34
+ setDefaultNodeLabel(e) {
35
+ return b(e) || (e = f(e)), this._defaultNodeLabelFn = e, this;
36
+ }
37
+ nodeCount() {
38
+ return this._nodeCount;
39
+ }
40
+ nodes() {
41
+ return _(this._nodes);
42
+ }
43
+ sources() {
44
+ var e = this;
45
+ return g(this.nodes(), function(t) {
46
+ return E(e._in[t]);
47
+ });
48
+ }
49
+ sinks() {
50
+ var e = this;
51
+ return g(this.nodes(), function(t) {
52
+ return E(e._out[t]);
53
+ });
54
+ }
55
+ setNodes(e, t) {
56
+ var s = arguments, i = this;
57
+ return d(e, function(r) {
58
+ s.length > 1 ? i.setNode(r, t) : i.setNode(r);
59
+ }), this;
60
+ }
61
+ setNode(e, t) {
62
+ 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] = a, this._children[e] = {}, this._children[a][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this);
63
+ }
64
+ node(e) {
65
+ return this._nodes[e];
66
+ }
67
+ hasNode(e) {
68
+ return Object.prototype.hasOwnProperty.call(this._nodes, e);
69
+ }
70
+ removeNode(e) {
71
+ if (Object.prototype.hasOwnProperty.call(this._nodes, e)) {
72
+ var t = (s) => this.removeEdge(this._edgeObjs[s]);
73
+ delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], d(this.children(e), (s) => {
74
+ this.setParent(s);
75
+ }), delete this._children[e]), d(_(this._in[e]), t), delete this._in[e], delete this._preds[e], d(_(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount;
76
+ }
77
+ return this;
78
+ }
79
+ setParent(e, t) {
80
+ if (!this._isCompound)
81
+ throw new Error("Cannot set parent in a non-compound graph");
82
+ if (l(t))
83
+ t = a;
84
+ else {
85
+ t += "";
86
+ for (var s = t; !l(s); s = this.parent(s))
87
+ if (s === e)
88
+ throw new Error("Setting " + t + " as parent of " + e + " would create a cycle");
89
+ this.setNode(t);
90
+ }
91
+ return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this;
92
+ }
93
+ _removeFromParentsChildList(e) {
94
+ delete this._children[this._parent[e]][e];
95
+ }
96
+ parent(e) {
97
+ if (this._isCompound) {
98
+ var t = this._parent[e];
99
+ if (t !== a)
100
+ return t;
101
+ }
102
+ }
103
+ children(e) {
104
+ if (l(e) && (e = a), this._isCompound) {
105
+ var t = this._children[e];
106
+ if (t)
107
+ return _(t);
108
+ } else {
109
+ if (e === a)
110
+ return this.nodes();
111
+ if (this.hasNode(e))
112
+ return [];
113
+ }
114
+ }
115
+ predecessors(e) {
116
+ var t = this._preds[e];
117
+ if (t)
118
+ return _(t);
119
+ }
120
+ successors(e) {
121
+ var t = this._sucs[e];
122
+ if (t)
123
+ return _(t);
124
+ }
125
+ neighbors(e) {
126
+ var t = this.predecessors(e);
127
+ if (t)
128
+ return w(t, this.successors(e));
129
+ }
130
+ isLeaf(e) {
131
+ var t;
132
+ return this.isDirected() ? t = this.successors(e) : t = this.neighbors(e), t.length === 0;
133
+ }
134
+ filterNodes(e) {
135
+ var t = new this.constructor({
136
+ directed: this._isDirected,
137
+ multigraph: this._isMultigraph,
138
+ compound: this._isCompound
139
+ });
140
+ t.setGraph(this.graph());
141
+ var s = this;
142
+ d(this._nodes, function(n, h) {
143
+ e(h) && t.setNode(h, n);
144
+ }), d(this._edgeObjs, function(n) {
145
+ t.hasNode(n.v) && t.hasNode(n.w) && t.setEdge(n, s.edge(n));
146
+ });
147
+ var i = {};
148
+ function r(n) {
149
+ var h = s.parent(n);
150
+ return h === void 0 || t.hasNode(h) ? (i[n] = h, h) : h in i ? i[h] : r(h);
151
+ }
152
+ return this._isCompound && d(t.nodes(), function(n) {
153
+ t.setParent(n, r(n));
154
+ }), t;
155
+ }
156
+ /* === Edge functions ========== */
157
+ setDefaultEdgeLabel(e) {
158
+ return b(e) || (e = f(e)), this._defaultEdgeLabelFn = e, this;
159
+ }
160
+ edgeCount() {
161
+ return this._edgeCount;
162
+ }
163
+ edges() {
164
+ return p(this._edgeObjs);
165
+ }
166
+ setPath(e, t) {
167
+ var s = this, i = arguments;
168
+ return D(e, function(r, n) {
169
+ return i.length > 1 ? s.setEdge(r, n, t) : s.setEdge(r, n), n;
170
+ }), this;
171
+ }
172
+ /*
173
+ * setEdge(v, w, [value, [name]])
174
+ * setEdge({ v, w, [name] }, [value])
175
+ */
176
+ setEdge() {
177
+ var e, t, s, i, r = !1, n = arguments[0];
178
+ typeof n == "object" && n !== null && "v" in n ? (e = n.v, t = n.w, s = n.name, arguments.length === 2 && (i = arguments[1], r = !0)) : (e = n, t = arguments[1], s = arguments[3], arguments.length > 2 && (i = arguments[2], r = !0)), e = "" + e, t = "" + t, l(s) || (s = "" + s);
179
+ var h = c(this._isDirected, e, t, s);
180
+ if (Object.prototype.hasOwnProperty.call(this._edgeLabels, h))
181
+ return r && (this._edgeLabels[h] = i), this;
182
+ if (!l(s) && !this._isMultigraph)
183
+ throw new Error("Cannot set a named edge when isMultigraph = false");
184
+ this.setNode(e), this.setNode(t), this._edgeLabels[h] = r ? i : this._defaultEdgeLabelFn(e, t, s);
185
+ var u = M(this._isDirected, e, t, s);
186
+ return e = u.v, t = u.w, Object.freeze(u), this._edgeObjs[h] = u, C(this._preds[t], e), C(this._sucs[e], t), this._in[t][h] = u, this._out[e][h] = u, this._edgeCount++, this;
187
+ }
188
+ edge(e, t, s) {
189
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s);
190
+ return this._edgeLabels[i];
191
+ }
192
+ hasEdge(e, t, s) {
193
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s);
194
+ return Object.prototype.hasOwnProperty.call(this._edgeLabels, i);
195
+ }
196
+ removeEdge(e, t, s) {
197
+ var i = arguments.length === 1 ? m(this._isDirected, arguments[0]) : c(this._isDirected, e, t, s), r = this._edgeObjs[i];
198
+ return r && (e = r.v, t = r.w, delete this._edgeLabels[i], delete this._edgeObjs[i], y(this._preds[t], e), y(this._sucs[e], t), delete this._in[t][i], delete this._out[e][i], this._edgeCount--), this;
199
+ }
200
+ inEdges(e, t) {
201
+ var s = this._in[e];
202
+ if (s) {
203
+ var i = p(s);
204
+ return t ? g(i, function(r) {
205
+ return r.v === t;
206
+ }) : i;
207
+ }
208
+ }
209
+ outEdges(e, t) {
210
+ var s = this._out[e];
211
+ if (s) {
212
+ var i = p(s);
213
+ return t ? g(i, function(r) {
214
+ return r.w === t;
215
+ }) : i;
216
+ }
217
+ }
218
+ nodeEdges(e, t) {
219
+ var s = this.inEdges(e, t);
220
+ if (s)
221
+ return s.concat(this.outEdges(e, t));
222
+ }
223
+ }
224
+ L.prototype._nodeCount = 0;
225
+ L.prototype._edgeCount = 0;
226
+ function C(o, e) {
227
+ o[e] ? o[e]++ : o[e] = 1;
228
+ }
229
+ function y(o, e) {
230
+ --o[e] || delete o[e];
231
+ }
232
+ function c(o, e, t, s) {
233
+ var i = "" + e, r = "" + t;
234
+ if (!o && i > r) {
235
+ var n = i;
236
+ i = r, r = n;
237
+ }
238
+ return i + O + r + O + (l(s) ? F : s);
239
+ }
240
+ function M(o, e, t, s) {
241
+ var i = "" + e, r = "" + t;
242
+ if (!o && i > r) {
243
+ var n = i;
244
+ i = r, r = n;
245
+ }
246
+ var h = { v: i, w: r };
247
+ return s && (h.name = s), h;
248
+ }
249
+ function m(o, e) {
250
+ return c(o, e.v, e.w, e.name);
251
+ }
252
+ export {
253
+ L as G
254
+ };