@sourcegraph/amp 0.0.1749585689-g82b91d → 0.0.1749614780-g9a56bd
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/dist/amp.js +3 -3
- package/dist/architectureDiagram-RWNHDUBN-1v8WgxdD.js +4635 -0
- package/dist/blockDiagram-XZSR5OGQ-XFBYN-jB.js +2243 -0
- package/dist/c4Diagram-6R2MQUNL-B0L0pltn.js +1587 -0
- package/dist/chunk-COUQ6RZ3-qd4eG6tc.js +17852 -0
- package/dist/chunk-CRQPXCKQ-yjI467Bq.js +65 -0
- package/dist/chunk-EFPBJHX4-DdHmqd0M.js +1378 -0
- package/dist/chunk-EOAU2GW5-CpRNAcjo.js +253 -0
- package/dist/chunk-IHYUGLNO-DJcRQIf7.js +1365 -0
- package/dist/chunk-K2ZEYYM2-CbqHhUqy.js +9 -0
- package/dist/chunk-Q7VUVKE6-gBSSbdjU.js +24 -0
- package/dist/chunk-T2M37SMK-Br8mK30k.js +1411 -0
- package/dist/chunk-TGZYFRKZ-BYBLXoJz.js +1331 -0
- package/dist/chunk-YJGJQOYZ-BGiSkWF0.js +19 -0
- package/dist/classDiagram-LB37KKQG-DhFsEyDS.js +17 -0
- package/dist/classDiagram-v2-KFQJBC22-DhFsEyDS.js +17 -0
- package/dist/{client-C1WG2nEf.js → client-D-YAg8x6.js} +6 -6
- package/dist/{console-DK0gDzNQ.js → console-CoE5Qzyz.js} +41106 -22971
- package/dist/create_file.node-Co0Uh1F3.js +21 -0
- package/dist/dagre-CMTPJJKG-UDPzd9Iy.js +446 -0
- package/dist/diagram-BIPOGRU5-B7TV59-n.js +128 -0
- package/dist/diagram-YF4VECWA-LsAZsciQ.js +219 -0
- package/dist/{edit_file.node-BH524GkF.js → edit_file.node-CmTZeBc2.js} +11 -11
- package/dist/erDiagram-AK44R45H-BWpeEu7D.js +843 -0
- package/dist/{executable-5cBRGrsC.js → executable-BE7tfoX5.js} +1 -1
- package/dist/{files-CybxYgbE.js → files-DqpRf5q4.js} +10 -10
- package/dist/flowDiagram-XARHJDSH-DzpV02UB.js +1618 -0
- package/dist/ganttDiagram-H5QQZTZ5-C0BhJTzn.js +1605 -0
- package/dist/gitGraphDiagram-XHLTLO3W-0EiOmv44.js +701 -0
- package/dist/{glob.node-C6HbLuPt.js → glob.node-DNei8bFS.js} +11 -11
- package/dist/{index-C2wo7rRZ.js → index-BcjxaWOc.js} +31 -31
- package/dist/infoDiagram-TP2HPDHO-CQX5a0Fc.js +24 -0
- package/dist/journeyDiagram-VHRN44N3-C82dEe4G.js +809 -0
- package/dist/kanban-definition-K5J3OUUV-xilJcrom.js +718 -0
- package/dist/katex-5N2NCDMP-CAsrnb6_.js +11703 -0
- package/dist/{list_directory.node-ZQscizpi.js → list_directory.node-CMiNNbXP.js} +1 -1
- package/dist/{load-profile-BbmyxO_7.js → load-profile-Cg8XaTx6.js} +1 -1
- package/dist/{main-CiUaVPC2.js → main-CtwgALCc.js} +23 -16
- package/dist/mindmap-definition-TI5ONXTW-BNaRba4R.js +3221 -0
- package/dist/{node-VrazB_nQ.js → node-Bfma_T75.js} +58 -58
- package/dist/{node-DvmQAW7h.js → node-BtG1o_DD.js} +2 -2
- package/dist/{node-GgocwWwI.js → node-CZJC9BSF.js} +3 -3
- package/dist/{node-Cpbjmhrj.js → node-Cp3D7_hw.js} +71 -71
- package/dist/{node-CiFAW-F3.js → node-Ctw1i0nl.js} +12 -12
- package/dist/{node-CgVq0JJ9.js → node-D1zxOCuN.js} +1 -1
- package/dist/pieDiagram-FPR3CNQC-_30_tQz0.js +120 -0
- package/dist/quadrantDiagram-RLP5YTJ2-CTD43GTk.js +1028 -0
- package/dist/radar-MK3ICKWK-55CS4JTO-afihMdR4.js +14398 -0
- package/dist/{read_file.node-CIdAFiJ6.js → read_file.node-QZ0VCmB2.js} +1 -1
- package/dist/requirementDiagram-P5NVWGNK-Sd2_6g8e.js +853 -0
- package/dist/sankeyDiagram-C6NZRJHT-D1EcCYaw.js +864 -0
- package/dist/sequenceDiagram-6SLVIXKN-CghQTpGf.js +2283 -0
- package/dist/stateDiagram-WI5ZVJ5I-Bv21MlSK.js +272 -0
- package/dist/stateDiagram-v2-KVDSFUFK-BgP0D8xL.js +17 -0
- package/dist/{stdio-D9HyubOc.js → stdio-yXWLIEvb.js} +8 -8
- package/dist/storybook.js +7 -7
- package/dist/timeline-definition-65575674-BUqRZdJ-.js +800 -0
- package/dist/{undo_edit.node-VYuTxRwd.js → undo_edit.node-BkletvTZ.js} +5 -5
- package/dist/xychartDiagram-674MFTBU-DjBabATx.js +1291 -0
- package/package.json +1 -1
- package/dist/create_file.node-DtVTaHj5.js +0 -21
@@ -0,0 +1,253 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
import { y as _, k as c, f as a, i as l, A as j, v as m, o as L } from "./chunk-TGZYFRKZ-BYBLXoJz.js";
|
3
|
+
import { _ as o, bs as g, bt as O, bu as y } from "./console-CoE5Qzyz.js";
|
4
|
+
var P = "\0", u = "\0", v = "", C = class {
|
5
|
+
static {
|
6
|
+
o(this, "Graph");
|
7
|
+
}
|
8
|
+
constructor(e = {}) {
|
9
|
+
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 = g(void 0), this._defaultEdgeLabelFn = g(void 0), this._nodes = {}, this._isCompound && (this._parent = {}, this._children = {}, this._children[u] = {}), this._in = {}, this._preds = {}, this._out = {}, this._sucs = {}, this._edgeObjs = {}, this._edgeLabels = {};
|
10
|
+
}
|
11
|
+
/* === Graph functions ========= */
|
12
|
+
isDirected() {
|
13
|
+
return this._isDirected;
|
14
|
+
}
|
15
|
+
isMultigraph() {
|
16
|
+
return this._isMultigraph;
|
17
|
+
}
|
18
|
+
isCompound() {
|
19
|
+
return this._isCompound;
|
20
|
+
}
|
21
|
+
setGraph(e) {
|
22
|
+
return this._label = e, this;
|
23
|
+
}
|
24
|
+
graph() {
|
25
|
+
return this._label;
|
26
|
+
}
|
27
|
+
/* === Node functions ========== */
|
28
|
+
setDefaultNodeLabel(e) {
|
29
|
+
return O(e) || (e = g(e)), this._defaultNodeLabelFn = e, this;
|
30
|
+
}
|
31
|
+
nodeCount() {
|
32
|
+
return this._nodeCount;
|
33
|
+
}
|
34
|
+
nodes() {
|
35
|
+
return _(this._nodes);
|
36
|
+
}
|
37
|
+
sources() {
|
38
|
+
var e = this;
|
39
|
+
return c(this.nodes(), function(t) {
|
40
|
+
return y(e._in[t]);
|
41
|
+
});
|
42
|
+
}
|
43
|
+
sinks() {
|
44
|
+
var e = this;
|
45
|
+
return c(this.nodes(), function(t) {
|
46
|
+
return y(e._out[t]);
|
47
|
+
});
|
48
|
+
}
|
49
|
+
setNodes(e, t) {
|
50
|
+
var s = arguments, i = this;
|
51
|
+
return a(e, function(n) {
|
52
|
+
s.length > 1 ? i.setNode(n, t) : i.setNode(n);
|
53
|
+
}), this;
|
54
|
+
}
|
55
|
+
setNode(e, t) {
|
56
|
+
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] = u, this._children[e] = {}, this._children[u][e] = !0), this._in[e] = {}, this._preds[e] = {}, this._out[e] = {}, this._sucs[e] = {}, ++this._nodeCount, this);
|
57
|
+
}
|
58
|
+
node(e) {
|
59
|
+
return this._nodes[e];
|
60
|
+
}
|
61
|
+
hasNode(e) {
|
62
|
+
return Object.prototype.hasOwnProperty.call(this._nodes, e);
|
63
|
+
}
|
64
|
+
removeNode(e) {
|
65
|
+
if (Object.prototype.hasOwnProperty.call(this._nodes, e)) {
|
66
|
+
var t = /* @__PURE__ */ o((s) => this.removeEdge(this._edgeObjs[s]), "removeEdge");
|
67
|
+
delete this._nodes[e], this._isCompound && (this._removeFromParentsChildList(e), delete this._parent[e], a(this.children(e), (s) => {
|
68
|
+
this.setParent(s);
|
69
|
+
}), delete this._children[e]), a(_(this._in[e]), t), delete this._in[e], delete this._preds[e], a(_(this._out[e]), t), delete this._out[e], delete this._sucs[e], --this._nodeCount;
|
70
|
+
}
|
71
|
+
return this;
|
72
|
+
}
|
73
|
+
setParent(e, t) {
|
74
|
+
if (!this._isCompound)
|
75
|
+
throw new Error("Cannot set parent in a non-compound graph");
|
76
|
+
if (l(t))
|
77
|
+
t = u;
|
78
|
+
else {
|
79
|
+
t += "";
|
80
|
+
for (var s = t; !l(s); s = this.parent(s))
|
81
|
+
if (s === e)
|
82
|
+
throw new Error("Setting " + t + " as parent of " + e + " would create a cycle");
|
83
|
+
this.setNode(t);
|
84
|
+
}
|
85
|
+
return this.setNode(e), this._removeFromParentsChildList(e), this._parent[e] = t, this._children[t][e] = !0, this;
|
86
|
+
}
|
87
|
+
_removeFromParentsChildList(e) {
|
88
|
+
delete this._children[this._parent[e]][e];
|
89
|
+
}
|
90
|
+
parent(e) {
|
91
|
+
if (this._isCompound) {
|
92
|
+
var t = this._parent[e];
|
93
|
+
if (t !== u)
|
94
|
+
return t;
|
95
|
+
}
|
96
|
+
}
|
97
|
+
children(e) {
|
98
|
+
if (l(e) && (e = u), this._isCompound) {
|
99
|
+
var t = this._children[e];
|
100
|
+
if (t)
|
101
|
+
return _(t);
|
102
|
+
} else {
|
103
|
+
if (e === u)
|
104
|
+
return this.nodes();
|
105
|
+
if (this.hasNode(e))
|
106
|
+
return [];
|
107
|
+
}
|
108
|
+
}
|
109
|
+
predecessors(e) {
|
110
|
+
var t = this._preds[e];
|
111
|
+
if (t)
|
112
|
+
return _(t);
|
113
|
+
}
|
114
|
+
successors(e) {
|
115
|
+
var t = this._sucs[e];
|
116
|
+
if (t)
|
117
|
+
return _(t);
|
118
|
+
}
|
119
|
+
neighbors(e) {
|
120
|
+
var t = this.predecessors(e);
|
121
|
+
if (t)
|
122
|
+
return j(t, this.successors(e));
|
123
|
+
}
|
124
|
+
isLeaf(e) {
|
125
|
+
var t;
|
126
|
+
return this.isDirected() ? t = this.successors(e) : t = this.neighbors(e), t.length === 0;
|
127
|
+
}
|
128
|
+
filterNodes(e) {
|
129
|
+
var t = new this.constructor({
|
130
|
+
directed: this._isDirected,
|
131
|
+
multigraph: this._isMultigraph,
|
132
|
+
compound: this._isCompound
|
133
|
+
});
|
134
|
+
t.setGraph(this.graph());
|
135
|
+
var s = this;
|
136
|
+
a(this._nodes, function(r, h) {
|
137
|
+
e(h) && t.setNode(h, r);
|
138
|
+
}), a(this._edgeObjs, function(r) {
|
139
|
+
t.hasNode(r.v) && t.hasNode(r.w) && t.setEdge(r, s.edge(r));
|
140
|
+
});
|
141
|
+
var i = {};
|
142
|
+
function n(r) {
|
143
|
+
var h = s.parent(r);
|
144
|
+
return h === void 0 || t.hasNode(h) ? (i[r] = h, h) : h in i ? i[h] : n(h);
|
145
|
+
}
|
146
|
+
return o(n, "findParent"), this._isCompound && a(t.nodes(), function(r) {
|
147
|
+
t.setParent(r, n(r));
|
148
|
+
}), t;
|
149
|
+
}
|
150
|
+
/* === Edge functions ========== */
|
151
|
+
setDefaultEdgeLabel(e) {
|
152
|
+
return O(e) || (e = g(e)), this._defaultEdgeLabelFn = e, this;
|
153
|
+
}
|
154
|
+
edgeCount() {
|
155
|
+
return this._edgeCount;
|
156
|
+
}
|
157
|
+
edges() {
|
158
|
+
return m(this._edgeObjs);
|
159
|
+
}
|
160
|
+
setPath(e, t) {
|
161
|
+
var s = this, i = arguments;
|
162
|
+
return L(e, function(n, r) {
|
163
|
+
return i.length > 1 ? s.setEdge(n, r, t) : s.setEdge(n, r), r;
|
164
|
+
}), this;
|
165
|
+
}
|
166
|
+
/*
|
167
|
+
* setEdge(v, w, [value, [name]])
|
168
|
+
* setEdge({ v, w, [name] }, [value])
|
169
|
+
*/
|
170
|
+
setEdge() {
|
171
|
+
var e, t, s, i, n = !1, r = arguments[0];
|
172
|
+
typeof r == "object" && r !== null && "v" in r ? (e = r.v, t = r.w, s = r.name, arguments.length === 2 && (i = arguments[1], n = !0)) : (e = r, t = arguments[1], s = arguments[3], arguments.length > 2 && (i = arguments[2], n = !0)), e = "" + e, t = "" + t, l(s) || (s = "" + s);
|
173
|
+
var h = f(this._isDirected, e, t, s);
|
174
|
+
if (Object.prototype.hasOwnProperty.call(this._edgeLabels, h))
|
175
|
+
return n && (this._edgeLabels[h] = i), this;
|
176
|
+
if (!l(s) && !this._isMultigraph)
|
177
|
+
throw new Error("Cannot set a named edge when isMultigraph = false");
|
178
|
+
this.setNode(e), this.setNode(t), this._edgeLabels[h] = n ? i : this._defaultEdgeLabelFn(e, t, s);
|
179
|
+
var d = N(this._isDirected, e, t, s);
|
180
|
+
return e = d.v, t = d.w, Object.freeze(d), this._edgeObjs[h] = d, b(this._preds[t], e), b(this._sucs[e], t), this._in[t][h] = d, this._out[e][h] = d, this._edgeCount++, this;
|
181
|
+
}
|
182
|
+
edge(e, t, s) {
|
183
|
+
var i = arguments.length === 1 ? p(this._isDirected, arguments[0]) : f(this._isDirected, e, t, s);
|
184
|
+
return this._edgeLabels[i];
|
185
|
+
}
|
186
|
+
hasEdge(e, t, s) {
|
187
|
+
var i = arguments.length === 1 ? p(this._isDirected, arguments[0]) : f(this._isDirected, e, t, s);
|
188
|
+
return Object.prototype.hasOwnProperty.call(this._edgeLabels, i);
|
189
|
+
}
|
190
|
+
removeEdge(e, t, s) {
|
191
|
+
var i = arguments.length === 1 ? p(this._isDirected, arguments[0]) : f(this._isDirected, e, t, s), n = this._edgeObjs[i];
|
192
|
+
return n && (e = n.v, t = n.w, delete this._edgeLabels[i], delete this._edgeObjs[i], E(this._preds[t], e), E(this._sucs[e], t), delete this._in[t][i], delete this._out[e][i], this._edgeCount--), this;
|
193
|
+
}
|
194
|
+
inEdges(e, t) {
|
195
|
+
var s = this._in[e];
|
196
|
+
if (s) {
|
197
|
+
var i = m(s);
|
198
|
+
return t ? c(i, function(n) {
|
199
|
+
return n.v === t;
|
200
|
+
}) : i;
|
201
|
+
}
|
202
|
+
}
|
203
|
+
outEdges(e, t) {
|
204
|
+
var s = this._out[e];
|
205
|
+
if (s) {
|
206
|
+
var i = m(s);
|
207
|
+
return t ? c(i, function(n) {
|
208
|
+
return n.w === t;
|
209
|
+
}) : i;
|
210
|
+
}
|
211
|
+
}
|
212
|
+
nodeEdges(e, t) {
|
213
|
+
var s = this.inEdges(e, t);
|
214
|
+
if (s)
|
215
|
+
return s.concat(this.outEdges(e, t));
|
216
|
+
}
|
217
|
+
};
|
218
|
+
C.prototype._nodeCount = 0;
|
219
|
+
C.prototype._edgeCount = 0;
|
220
|
+
function b(e, t) {
|
221
|
+
e[t] ? e[t]++ : e[t] = 1;
|
222
|
+
}
|
223
|
+
o(b, "incrementOrInitEntry");
|
224
|
+
function E(e, t) {
|
225
|
+
--e[t] || delete e[t];
|
226
|
+
}
|
227
|
+
o(E, "decrementOrRemoveEntry");
|
228
|
+
function f(e, t, s, i) {
|
229
|
+
var n = "" + t, r = "" + s;
|
230
|
+
if (!e && n > r) {
|
231
|
+
var h = n;
|
232
|
+
n = r, r = h;
|
233
|
+
}
|
234
|
+
return n + v + r + v + (l(i) ? P : i);
|
235
|
+
}
|
236
|
+
o(f, "edgeArgsToId");
|
237
|
+
function N(e, t, s, i) {
|
238
|
+
var n = "" + t, r = "" + s;
|
239
|
+
if (!e && n > r) {
|
240
|
+
var h = n;
|
241
|
+
n = r, r = h;
|
242
|
+
}
|
243
|
+
var d = { v: n, w: r };
|
244
|
+
return i && (d.name = i), d;
|
245
|
+
}
|
246
|
+
o(N, "edgeArgsToObj");
|
247
|
+
function p(e, t) {
|
248
|
+
return f(e, t.v, t.w, t.name);
|
249
|
+
}
|
250
|
+
o(p, "edgeObjToId");
|
251
|
+
export {
|
252
|
+
C as G
|
253
|
+
};
|