@ebay/nice-dag-react 1.0.8 → 1.0.9

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/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import K, { useCallback as F, useRef as G, useState as dr, useMemo as vr, useEffect as xe } from "react";
2
- import Ne from "react-dom";
1
+ import M, { useCallback as A, useRef as K, useState as dr, useMemo as vr, useEffect as Ne } from "react";
2
+ import ie from "react-dom";
3
3
  import pr from "@ebay/nice-dag-core";
4
- var oe = { exports: {} }, W = {};
4
+ var ue = { exports: {} }, V = {};
5
5
  /**
6
6
  * @license React
7
7
  * react-jsx-runtime.production.min.js
@@ -11,25 +11,25 @@ var oe = { exports: {} }, W = {};
11
11
  * This source code is licensed under the MIT license found in the
12
12
  * LICENSE file in the root directory of this source tree.
13
13
  */
14
- var je;
14
+ var Fe;
15
15
  function gr() {
16
- if (je)
17
- return W;
18
- je = 1;
19
- var c = K, l = Symbol.for("react.element"), T = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, C = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
20
- function x(O, p, P) {
21
- var i, b = {}, g = null, y = null;
22
- P !== void 0 && (g = "" + P), p.key !== void 0 && (g = "" + p.key), p.ref !== void 0 && (y = p.ref);
23
- for (i in p)
24
- E.call(p, i) && !m.hasOwnProperty(i) && (b[i] = p[i]);
25
- if (O && O.defaultProps)
26
- for (i in p = O.defaultProps, p)
27
- b[i] === void 0 && (b[i] = p[i]);
28
- return { $$typeof: l, type: O, key: g, ref: y, props: b, _owner: C.current };
16
+ if (Fe)
17
+ return V;
18
+ Fe = 1;
19
+ var s = M, l = Symbol.for("react.element"), T = Symbol.for("react.fragment"), m = Object.prototype.hasOwnProperty, y = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
20
+ function _(w, p, O) {
21
+ var g, u = {}, C = null, R = null;
22
+ O !== void 0 && (C = "" + O), p.key !== void 0 && (C = "" + p.key), p.ref !== void 0 && (R = p.ref);
23
+ for (g in p)
24
+ m.call(p, g) && !P.hasOwnProperty(g) && (u[g] = p[g]);
25
+ if (w && w.defaultProps)
26
+ for (g in p = w.defaultProps, p)
27
+ u[g] === void 0 && (u[g] = p[g]);
28
+ return { $$typeof: l, type: w, key: C, ref: R, props: u, _owner: y.current };
29
29
  }
30
- return W.Fragment = T, W.jsx = x, W.jsxs = x, W;
30
+ return V.Fragment = T, V.jsx = _, V.jsxs = _, V;
31
31
  }
32
- var Y = {};
32
+ var L = {};
33
33
  /**
34
34
  * @license React
35
35
  * react-jsx-runtime.development.js
@@ -39,50 +39,50 @@ var Y = {};
39
39
  * This source code is licensed under the MIT license found in the
40
40
  * LICENSE file in the root directory of this source tree.
41
41
  */
42
- var ke;
42
+ var Ae;
43
43
  function hr() {
44
- return ke || (ke = 1, process.env.NODE_ENV !== "production" && function() {
45
- var c = K, l = Symbol.for("react.element"), T = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), C = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), x = Symbol.for("react.provider"), O = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), P = Symbol.for("react.suspense"), i = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), g = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), L = Symbol.iterator, M = "@@iterator";
46
- function D(e) {
44
+ return Ae || (Ae = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var s = M, l = Symbol.for("react.element"), T = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), _ = Symbol.for("react.provider"), w = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), R = Symbol.for("react.offscreen"), D = Symbol.iterator, H = "@@iterator";
46
+ function U(e) {
47
47
  if (e === null || typeof e != "object")
48
48
  return null;
49
- var r = L && e[L] || e[M];
49
+ var r = D && e[D] || e[H];
50
50
  return typeof r == "function" ? r : null;
51
51
  }
52
- var _ = c.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
52
+ var E = s.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
53
  function f(e) {
54
54
  {
55
55
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
56
56
  t[n - 1] = arguments[n];
57
- H("error", e, t);
57
+ S("error", e, t);
58
58
  }
59
59
  }
60
- function H(e, r, t) {
60
+ function S(e, r, t) {
61
61
  {
62
- var n = _.ReactDebugCurrentFrame, u = n.getStackAddendum();
63
- u !== "" && (r += "%s", t = t.concat([u]));
64
- var s = t.map(function(o) {
62
+ var n = E.ReactDebugCurrentFrame, i = n.getStackAddendum();
63
+ i !== "" && (r += "%s", t = t.concat([i]));
64
+ var c = t.map(function(o) {
65
65
  return String(o);
66
66
  });
67
- s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
67
+ c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
68
68
  }
69
69
  }
70
- var A = !1, Ae = !1, Ie = !1, $e = !1, We = !1, ie;
71
- ie = Symbol.for("react.module.reference");
70
+ var X = !1, $ = !1, Ie = !1, $e = !1, We = !1, ce;
71
+ ce = Symbol.for("react.module.reference");
72
72
  function Ye(e) {
73
- return !!(typeof e == "string" || typeof e == "function" || e === E || e === m || We || e === C || e === P || e === i || $e || e === y || A || Ae || Ie || typeof e == "object" && e !== null && (e.$$typeof === g || e.$$typeof === b || e.$$typeof === x || e.$$typeof === O || e.$$typeof === p || e.$$typeof === ie || e.getModuleId !== void 0));
73
+ return !!(typeof e == "string" || typeof e == "function" || e === m || e === P || We || e === y || e === O || e === g || $e || e === R || X || $ || Ie || typeof e == "object" && e !== null && (e.$$typeof === C || e.$$typeof === u || e.$$typeof === _ || e.$$typeof === w || e.$$typeof === p || e.$$typeof === ce || e.getModuleId !== void 0));
74
74
  }
75
- function Le(e, r, t) {
75
+ function Ve(e, r, t) {
76
76
  var n = e.displayName;
77
77
  if (n)
78
78
  return n;
79
- var u = r.displayName || r.name || "";
80
- return u !== "" ? t + "(" + u + ")" : t;
79
+ var i = r.displayName || r.name || "";
80
+ return i !== "" ? t + "(" + i + ")" : t;
81
81
  }
82
- function ue(e) {
82
+ function le(e) {
83
83
  return e.displayName || "Context";
84
84
  }
85
- function w(e) {
85
+ function x(e) {
86
86
  if (e == null)
87
87
  return null;
88
88
  if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
@@ -90,36 +90,36 @@ function hr() {
90
90
  if (typeof e == "string")
91
91
  return e;
92
92
  switch (e) {
93
- case E:
93
+ case m:
94
94
  return "Fragment";
95
95
  case T:
96
96
  return "Portal";
97
- case m:
97
+ case P:
98
98
  return "Profiler";
99
- case C:
99
+ case y:
100
100
  return "StrictMode";
101
- case P:
101
+ case O:
102
102
  return "Suspense";
103
- case i:
103
+ case g:
104
104
  return "SuspenseList";
105
105
  }
106
106
  if (typeof e == "object")
107
107
  switch (e.$$typeof) {
108
- case O:
108
+ case w:
109
109
  var r = e;
110
- return ue(r) + ".Consumer";
111
- case x:
110
+ return le(r) + ".Consumer";
111
+ case _:
112
112
  var t = e;
113
- return ue(t._context) + ".Provider";
113
+ return le(t._context) + ".Provider";
114
114
  case p:
115
- return Le(e, e.render, "ForwardRef");
116
- case b:
115
+ return Ve(e, e.render, "ForwardRef");
116
+ case u:
117
117
  var n = e.displayName || null;
118
- return n !== null ? n : w(e.type) || "Memo";
119
- case g: {
120
- var u = e, s = u._payload, o = u._init;
118
+ return n !== null ? n : x(e.type) || "Memo";
119
+ case C: {
120
+ var i = e, c = i._payload, o = i._init;
121
121
  try {
122
- return w(o(s));
122
+ return x(o(c));
123
123
  } catch {
124
124
  return null;
125
125
  }
@@ -127,18 +127,18 @@ function hr() {
127
127
  }
128
128
  return null;
129
129
  }
130
- var j = Object.assign, I = 0, se, ce, fe, le, de, ve, pe;
131
- function ge() {
130
+ var k = Object.assign, W = 0, fe, de, ve, pe, ge, he, me;
131
+ function Ee() {
132
132
  }
133
- ge.__reactDisabledLog = !0;
134
- function Me() {
133
+ Ee.__reactDisabledLog = !0;
134
+ function Le() {
135
135
  {
136
- if (I === 0) {
137
- se = console.log, ce = console.info, fe = console.warn, le = console.error, de = console.group, ve = console.groupCollapsed, pe = console.groupEnd;
136
+ if (W === 0) {
137
+ fe = console.log, de = console.info, ve = console.warn, pe = console.error, ge = console.group, he = console.groupCollapsed, me = console.groupEnd;
138
138
  var e = {
139
139
  configurable: !0,
140
140
  enumerable: !0,
141
- value: ge,
141
+ value: Ee,
142
142
  writable: !0
143
143
  };
144
144
  Object.defineProperties(console, {
@@ -151,77 +151,77 @@ function hr() {
151
151
  groupEnd: e
152
152
  });
153
153
  }
154
- I++;
154
+ W++;
155
155
  }
156
156
  }
157
- function Ve() {
157
+ function Me() {
158
158
  {
159
- if (I--, I === 0) {
159
+ if (W--, W === 0) {
160
160
  var e = {
161
161
  configurable: !0,
162
162
  enumerable: !0,
163
163
  writable: !0
164
164
  };
165
165
  Object.defineProperties(console, {
166
- log: j({}, e, {
167
- value: se
168
- }),
169
- info: j({}, e, {
170
- value: ce
171
- }),
172
- warn: j({}, e, {
166
+ log: k({}, e, {
173
167
  value: fe
174
168
  }),
175
- error: j({}, e, {
176
- value: le
177
- }),
178
- group: j({}, e, {
169
+ info: k({}, e, {
179
170
  value: de
180
171
  }),
181
- groupCollapsed: j({}, e, {
172
+ warn: k({}, e, {
182
173
  value: ve
183
174
  }),
184
- groupEnd: j({}, e, {
175
+ error: k({}, e, {
185
176
  value: pe
177
+ }),
178
+ group: k({}, e, {
179
+ value: ge
180
+ }),
181
+ groupCollapsed: k({}, e, {
182
+ value: he
183
+ }),
184
+ groupEnd: k({}, e, {
185
+ value: me
186
186
  })
187
187
  });
188
188
  }
189
- I < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
189
+ W < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
190
  }
191
191
  }
192
- var X = _.ReactCurrentDispatcher, Z;
193
- function V(e, r, t) {
192
+ var Z = E.ReactCurrentDispatcher, Q;
193
+ function B(e, r, t) {
194
194
  {
195
- if (Z === void 0)
195
+ if (Q === void 0)
196
196
  try {
197
197
  throw Error();
198
- } catch (u) {
199
- var n = u.stack.trim().match(/\n( *(at )?)/);
200
- Z = n && n[1] || "";
198
+ } catch (i) {
199
+ var n = i.stack.trim().match(/\n( *(at )?)/);
200
+ Q = n && n[1] || "";
201
201
  }
202
202
  return `
203
- ` + Z + e;
203
+ ` + Q + e;
204
204
  }
205
205
  }
206
- var Q = !1, U;
206
+ var ee = !1, q;
207
207
  {
208
208
  var Ue = typeof WeakMap == "function" ? WeakMap : Map;
209
- U = new Ue();
209
+ q = new Ue();
210
210
  }
211
- function he(e, r) {
212
- if (!e || Q)
211
+ function Re(e, r) {
212
+ if (!e || ee)
213
213
  return "";
214
214
  {
215
- var t = U.get(e);
215
+ var t = q.get(e);
216
216
  if (t !== void 0)
217
217
  return t;
218
218
  }
219
219
  var n;
220
- Q = !0;
221
- var u = Error.prepareStackTrace;
220
+ ee = !0;
221
+ var i = Error.prepareStackTrace;
222
222
  Error.prepareStackTrace = void 0;
223
- var s;
224
- s = X.current, X.current = null, Me();
223
+ var c;
224
+ c = Z.current, Z.current = null, Le();
225
225
  try {
226
226
  if (r) {
227
227
  var o = function() {
@@ -234,29 +234,29 @@ function hr() {
234
234
  }), typeof Reflect == "object" && Reflect.construct) {
235
235
  try {
236
236
  Reflect.construct(o, []);
237
- } catch (S) {
238
- n = S;
237
+ } catch (j) {
238
+ n = j;
239
239
  }
240
240
  Reflect.construct(e, [], o);
241
241
  } else {
242
242
  try {
243
243
  o.call();
244
- } catch (S) {
245
- n = S;
244
+ } catch (j) {
245
+ n = j;
246
246
  }
247
247
  e.call(o.prototype);
248
248
  }
249
249
  } else {
250
250
  try {
251
251
  throw Error();
252
- } catch (S) {
253
- n = S;
252
+ } catch (j) {
253
+ n = j;
254
254
  }
255
255
  e();
256
256
  }
257
- } catch (S) {
258
- if (S && n && typeof S.stack == "string") {
259
- for (var a = S.stack.split(`
257
+ } catch (j) {
258
+ if (j && n && typeof j.stack == "string") {
259
+ for (var a = j.stack.split(`
260
260
  `), h = n.stack.split(`
261
261
  `), d = a.length - 1, v = h.length - 1; d >= 1 && v >= 0 && a[d] !== h[v]; )
262
262
  v--;
@@ -265,69 +265,69 @@ function hr() {
265
265
  if (d !== 1 || v !== 1)
266
266
  do
267
267
  if (d--, v--, v < 0 || a[d] !== h[v]) {
268
- var R = `
268
+ var b = `
269
269
  ` + a[d].replace(" at new ", " at ");
270
- return e.displayName && R.includes("<anonymous>") && (R = R.replace("<anonymous>", e.displayName)), typeof e == "function" && U.set(e, R), R;
270
+ return e.displayName && b.includes("<anonymous>") && (b = b.replace("<anonymous>", e.displayName)), typeof e == "function" && q.set(e, b), b;
271
271
  }
272
272
  while (d >= 1 && v >= 0);
273
273
  break;
274
274
  }
275
275
  }
276
276
  } finally {
277
- Q = !1, X.current = s, Ve(), Error.prepareStackTrace = u;
277
+ ee = !1, Z.current = c, Me(), Error.prepareStackTrace = i;
278
278
  }
279
- var N = e ? e.displayName || e.name : "", De = N ? V(N) : "";
280
- return typeof e == "function" && U.set(e, De), De;
279
+ var F = e ? e.displayName || e.name : "", ke = F ? B(F) : "";
280
+ return typeof e == "function" && q.set(e, ke), ke;
281
281
  }
282
282
  function Be(e, r, t) {
283
- return he(e, !1);
283
+ return Re(e, !1);
284
284
  }
285
285
  function qe(e) {
286
286
  var r = e.prototype;
287
287
  return !!(r && r.isReactComponent);
288
288
  }
289
- function B(e, r, t) {
289
+ function J(e, r, t) {
290
290
  if (e == null)
291
291
  return "";
292
292
  if (typeof e == "function")
293
- return he(e, qe(e));
293
+ return Re(e, qe(e));
294
294
  if (typeof e == "string")
295
- return V(e);
295
+ return B(e);
296
296
  switch (e) {
297
- case P:
298
- return V("Suspense");
299
- case i:
300
- return V("SuspenseList");
297
+ case O:
298
+ return B("Suspense");
299
+ case g:
300
+ return B("SuspenseList");
301
301
  }
302
302
  if (typeof e == "object")
303
303
  switch (e.$$typeof) {
304
304
  case p:
305
305
  return Be(e.render);
306
- case b:
307
- return B(e.type, r, t);
308
- case g: {
309
- var n = e, u = n._payload, s = n._init;
306
+ case u:
307
+ return J(e.type, r, t);
308
+ case C: {
309
+ var n = e, i = n._payload, c = n._init;
310
310
  try {
311
- return B(s(u), r, t);
311
+ return J(c(i), r, t);
312
312
  } catch {
313
313
  }
314
314
  }
315
315
  }
316
316
  return "";
317
317
  }
318
- var q = Object.prototype.hasOwnProperty, me = {}, Ee = _.ReactDebugCurrentFrame;
319
- function J(e) {
318
+ var G = Object.prototype.hasOwnProperty, be = {}, ye = E.ReactDebugCurrentFrame;
319
+ function z(e) {
320
320
  if (e) {
321
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
322
- Ee.setExtraStackFrame(t);
321
+ var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
322
+ ye.setExtraStackFrame(t);
323
323
  } else
324
- Ee.setExtraStackFrame(null);
324
+ ye.setExtraStackFrame(null);
325
325
  }
326
- function Je(e, r, t, n, u) {
326
+ function Je(e, r, t, n, i) {
327
327
  {
328
- var s = Function.call.bind(q);
328
+ var c = Function.call.bind(G);
329
329
  for (var o in e)
330
- if (s(e, o)) {
330
+ if (c(e, o)) {
331
331
  var a = void 0;
332
332
  try {
333
333
  if (typeof e[o] != "function") {
@@ -338,12 +338,12 @@ function hr() {
338
338
  } catch (d) {
339
339
  a = d;
340
340
  }
341
- a && !(a instanceof Error) && (J(u), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), J(null)), a instanceof Error && !(a.message in me) && (me[a.message] = !0, J(u), f("Failed %s type: %s", t, a.message), J(null));
341
+ a && !(a instanceof Error) && (z(i), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), z(null)), a instanceof Error && !(a.message in be) && (be[a.message] = !0, z(i), f("Failed %s type: %s", t, a.message), z(null));
342
342
  }
343
343
  }
344
344
  }
345
345
  var Ge = Array.isArray;
346
- function ee(e) {
346
+ function re(e) {
347
347
  return Ge(e);
348
348
  }
349
349
  function ze(e) {
@@ -354,27 +354,27 @@ function hr() {
354
354
  }
355
355
  function Ke(e) {
356
356
  try {
357
- return be(e), !1;
357
+ return _e(e), !1;
358
358
  } catch {
359
359
  return !0;
360
360
  }
361
361
  }
362
- function be(e) {
362
+ function _e(e) {
363
363
  return "" + e;
364
364
  }
365
- function Re(e) {
365
+ function Ce(e) {
366
366
  if (Ke(e))
367
- return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), be(e);
367
+ return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ze(e)), _e(e);
368
368
  }
369
- var $ = _.ReactCurrentOwner, He = {
369
+ var Y = E.ReactCurrentOwner, He = {
370
370
  key: !0,
371
371
  ref: !0,
372
372
  __self: !0,
373
373
  __source: !0
374
- }, ye, _e, re;
375
- re = {};
374
+ }, Te, Pe, te;
375
+ te = {};
376
376
  function Xe(e) {
377
- if (q.call(e, "ref")) {
377
+ if (G.call(e, "ref")) {
378
378
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
379
379
  if (r && r.isReactWarning)
380
380
  return !1;
@@ -382,7 +382,7 @@ function hr() {
382
382
  return e.ref !== void 0;
383
383
  }
384
384
  function Ze(e) {
385
- if (q.call(e, "key")) {
385
+ if (G.call(e, "key")) {
386
386
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
387
387
  if (r && r.isReactWarning)
388
388
  return !1;
@@ -390,15 +390,15 @@ function hr() {
390
390
  return e.key !== void 0;
391
391
  }
392
392
  function Qe(e, r) {
393
- if (typeof e.ref == "string" && $.current && r && $.current.stateNode !== r) {
394
- var t = w($.current.type);
395
- re[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', w($.current.type), e.ref), re[t] = !0);
393
+ if (typeof e.ref == "string" && Y.current && r && Y.current.stateNode !== r) {
394
+ var t = x(Y.current.type);
395
+ te[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', x(Y.current.type), e.ref), te[t] = !0);
396
396
  }
397
397
  }
398
398
  function er(e, r) {
399
399
  {
400
400
  var t = function() {
401
- ye || (ye = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
401
+ Te || (Te = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
402
402
  };
403
403
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
404
404
  get: t,
@@ -409,7 +409,7 @@ function hr() {
409
409
  function rr(e, r) {
410
410
  {
411
411
  var t = function() {
412
- _e || (_e = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
412
+ Pe || (Pe = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
413
413
  };
414
414
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
415
415
  get: t,
@@ -417,14 +417,14 @@ function hr() {
417
417
  });
418
418
  }
419
419
  }
420
- var tr = function(e, r, t, n, u, s, o) {
420
+ var tr = function(e, r, t, n, i, c, o) {
421
421
  var a = {
422
422
  $$typeof: l,
423
423
  type: e,
424
424
  key: r,
425
425
  ref: t,
426
426
  props: o,
427
- _owner: s
427
+ _owner: c
428
428
  };
429
429
  return a._store = {}, Object.defineProperty(a._store, "validated", {
430
430
  configurable: !1,
@@ -440,44 +440,44 @@ function hr() {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
- value: u
443
+ value: i
444
444
  }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
445
445
  };
446
- function nr(e, r, t, n, u) {
446
+ function nr(e, r, t, n, i) {
447
447
  {
448
- var s, o = {}, a = null, h = null;
449
- t !== void 0 && (Re(t), a = "" + t), Ze(r) && (Re(r.key), a = "" + r.key), Xe(r) && (h = r.ref, Qe(r, u));
450
- for (s in r)
451
- q.call(r, s) && !He.hasOwnProperty(s) && (o[s] = r[s]);
448
+ var c, o = {}, a = null, h = null;
449
+ t !== void 0 && (Ce(t), a = "" + t), Ze(r) && (Ce(r.key), a = "" + r.key), Xe(r) && (h = r.ref, Qe(r, i));
450
+ for (c in r)
451
+ G.call(r, c) && !He.hasOwnProperty(c) && (o[c] = r[c]);
452
452
  if (e && e.defaultProps) {
453
453
  var d = e.defaultProps;
454
- for (s in d)
455
- o[s] === void 0 && (o[s] = d[s]);
454
+ for (c in d)
455
+ o[c] === void 0 && (o[c] = d[c]);
456
456
  }
457
457
  if (a || h) {
458
458
  var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
459
459
  a && er(o, v), h && rr(o, v);
460
460
  }
461
- return tr(e, a, h, u, n, $.current, o);
461
+ return tr(e, a, h, i, n, Y.current, o);
462
462
  }
463
463
  }
464
- var te = _.ReactCurrentOwner, Te = _.ReactDebugCurrentFrame;
465
- function k(e) {
464
+ var ne = E.ReactCurrentOwner, we = E.ReactDebugCurrentFrame;
465
+ function N(e) {
466
466
  if (e) {
467
- var r = e._owner, t = B(e.type, e._source, r ? r.type : null);
468
- Te.setExtraStackFrame(t);
467
+ var r = e._owner, t = J(e.type, e._source, r ? r.type : null);
468
+ we.setExtraStackFrame(t);
469
469
  } else
470
- Te.setExtraStackFrame(null);
470
+ we.setExtraStackFrame(null);
471
471
  }
472
- var ne;
473
- ne = !1;
474
- function ae(e) {
472
+ var ae;
473
+ ae = !1;
474
+ function oe(e) {
475
475
  return typeof e == "object" && e !== null && e.$$typeof === l;
476
476
  }
477
- function Ce() {
477
+ function Oe() {
478
478
  {
479
- if (te.current) {
480
- var e = w(te.current.type);
479
+ if (ne.current) {
480
+ var e = x(ne.current.type);
481
481
  if (e)
482
482
  return `
483
483
 
@@ -497,10 +497,10 @@ Check your code at ` + r + ":" + t + ".";
497
497
  return "";
498
498
  }
499
499
  }
500
- var Oe = {};
500
+ var De = {};
501
501
  function or(e) {
502
502
  {
503
- var r = Ce();
503
+ var r = Oe();
504
504
  if (!r) {
505
505
  var t = typeof e == "string" ? e : e.displayName || e.name;
506
506
  t && (r = `
@@ -510,35 +510,35 @@ Check the top-level render call using <` + t + ">.");
510
510
  return r;
511
511
  }
512
512
  }
513
- function Pe(e, r) {
513
+ function Se(e, r) {
514
514
  {
515
515
  if (!e._store || e._store.validated || e.key != null)
516
516
  return;
517
517
  e._store.validated = !0;
518
518
  var t = or(r);
519
- if (Oe[t])
519
+ if (De[t])
520
520
  return;
521
- Oe[t] = !0;
521
+ De[t] = !0;
522
522
  var n = "";
523
- e && e._owner && e._owner !== te.current && (n = " It was passed a child from " + w(e._owner.type) + "."), k(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), k(null);
523
+ e && e._owner && e._owner !== ne.current && (n = " It was passed a child from " + x(e._owner.type) + "."), N(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), N(null);
524
524
  }
525
525
  }
526
- function we(e, r) {
526
+ function xe(e, r) {
527
527
  {
528
528
  if (typeof e != "object")
529
529
  return;
530
- if (ee(e))
530
+ if (re(e))
531
531
  for (var t = 0; t < e.length; t++) {
532
532
  var n = e[t];
533
- ae(n) && Pe(n, r);
533
+ oe(n) && Se(n, r);
534
534
  }
535
- else if (ae(e))
535
+ else if (oe(e))
536
536
  e._store && (e._store.validated = !0);
537
537
  else if (e) {
538
- var u = D(e);
539
- if (typeof u == "function" && u !== e.entries)
540
- for (var s = u.call(e), o; !(o = s.next()).done; )
541
- ae(o.value) && Pe(o.value, r);
538
+ var i = U(e);
539
+ if (typeof i == "function" && i !== e.entries)
540
+ for (var c = i.call(e), o; !(o = c.next()).done; )
541
+ oe(o.value) && Se(o.value, r);
542
542
  }
543
543
  }
544
544
  }
@@ -550,17 +550,17 @@ Check the top-level render call using <` + t + ">.");
550
550
  var t;
551
551
  if (typeof r == "function")
552
552
  t = r.propTypes;
553
- else if (typeof r == "object" && (r.$$typeof === p || r.$$typeof === b))
553
+ else if (typeof r == "object" && (r.$$typeof === p || r.$$typeof === u))
554
554
  t = r.propTypes;
555
555
  else
556
556
  return;
557
557
  if (t) {
558
- var n = w(r);
558
+ var n = x(r);
559
559
  Je(t, e.props, "prop", n, e);
560
- } else if (r.PropTypes !== void 0 && !ne) {
561
- ne = !0;
562
- var u = w(r);
563
- f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
560
+ } else if (r.PropTypes !== void 0 && !ae) {
561
+ ae = !0;
562
+ var i = x(r);
563
+ f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", i || "Unknown");
564
564
  }
565
565
  typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
566
566
  }
@@ -570,179 +570,194 @@ Check the top-level render call using <` + t + ">.");
570
570
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
571
571
  var n = r[t];
572
572
  if (n !== "children" && n !== "key") {
573
- k(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), k(null);
573
+ N(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), N(null);
574
574
  break;
575
575
  }
576
576
  }
577
- e.ref !== null && (k(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), k(null));
577
+ e.ref !== null && (N(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), N(null));
578
578
  }
579
579
  }
580
- function Se(e, r, t, n, u, s) {
580
+ function je(e, r, t, n, i, c) {
581
581
  {
582
582
  var o = Ye(e);
583
583
  if (!o) {
584
584
  var a = "";
585
585
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
586
- var h = ar(u);
587
- h ? a += h : a += Ce();
586
+ var h = ar(i);
587
+ h ? a += h : a += Oe();
588
588
  var d;
589
- e === null ? d = "null" : ee(e) ? d = "array" : e !== void 0 && e.$$typeof === l ? (d = "<" + (w(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
589
+ e === null ? d = "null" : re(e) ? d = "array" : e !== void 0 && e.$$typeof === l ? (d = "<" + (x(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, a);
590
590
  }
591
- var v = nr(e, r, t, u, s);
591
+ var v = nr(e, r, t, i, c);
592
592
  if (v == null)
593
593
  return v;
594
594
  if (o) {
595
- var R = r.children;
596
- if (R !== void 0)
595
+ var b = r.children;
596
+ if (b !== void 0)
597
597
  if (n)
598
- if (ee(R)) {
599
- for (var N = 0; N < R.length; N++)
600
- we(R[N], e);
601
- Object.freeze && Object.freeze(R);
598
+ if (re(b)) {
599
+ for (var F = 0; F < b.length; F++)
600
+ xe(b[F], e);
601
+ Object.freeze && Object.freeze(b);
602
602
  } else
603
603
  f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
604
604
  else
605
- we(R, e);
605
+ xe(b, e);
606
606
  }
607
- return e === E ? ur(v) : ir(v), v;
607
+ return e === m ? ur(v) : ir(v), v;
608
608
  }
609
609
  }
610
610
  function sr(e, r, t) {
611
- return Se(e, r, t, !0);
611
+ return je(e, r, t, !0);
612
612
  }
613
613
  function cr(e, r, t) {
614
- return Se(e, r, t, !1);
614
+ return je(e, r, t, !1);
615
615
  }
616
- var fr = cr, lr = sr;
617
- Y.Fragment = E, Y.jsx = fr, Y.jsxs = lr;
618
- }()), Y;
616
+ var lr = cr, fr = sr;
617
+ L.Fragment = m, L.jsx = lr, L.jsxs = fr;
618
+ }()), L;
619
619
  }
620
- (function(c) {
621
- process.env.NODE_ENV === "production" ? c.exports = gr() : c.exports = hr();
622
- })(oe);
623
- const Fe = oe.exports.Fragment, z = oe.exports.jsx;
624
- class mr extends K.Component {
620
+ (function(s) {
621
+ process.env.NODE_ENV === "production" ? s.exports = gr() : s.exports = hr();
622
+ })(ue);
623
+ const se = ue.exports.Fragment, I = ue.exports.jsx;
624
+ class mr extends M.Component {
625
625
  render() {
626
626
  if (this.props.niceDag && this.props.node.ref) {
627
627
  const l = this.props.niceDag.getElementByNodeId(this.props.node.id);
628
628
  if (l)
629
- return Ne.createPortal(/* @__PURE__ */ z(Fe, {
629
+ return ie.createPortal(/* @__PURE__ */ I(se, {
630
630
  children: this.props.render(this.props)
631
631
  }), l);
632
632
  }
633
633
  return null;
634
634
  }
635
635
  }
636
- class Er extends K.Component {
636
+ class Er extends M.Component {
637
637
  render() {
638
- return this.props.niceDag && this.props.edge.ref ? Ne.createPortal(/* @__PURE__ */ z(Fe, {
638
+ return this.props.niceDag && this.props.edge.ref ? ie.createPortal(/* @__PURE__ */ I(se, {
639
639
  children: this.props.render(this.props)
640
640
  }), this.props.edge.ref) : null;
641
641
  }
642
642
  }
643
- function Tr(c) {
644
- const l = F(() => {
645
- c.remove();
646
- }, [c]), T = F((E, C = 40) => {
647
- c.insertNodes(E, C);
648
- }, [c]);
643
+ class Rr extends M.Component {
644
+ render() {
645
+ if (this.props.niceDag) {
646
+ const l = this.props.niceDag.getRootContentElement();
647
+ return ie.createPortal(/* @__PURE__ */ I(se, {
648
+ children: this.props.render(this.props.niceDag)
649
+ }), l);
650
+ }
651
+ return null;
652
+ }
653
+ }
654
+ function Tr(s) {
655
+ const l = A(() => {
656
+ s.remove();
657
+ }, [s]), T = A((m, y = 40) => {
658
+ s.insertNodes(m, y);
659
+ }, [s]);
649
660
  return {
650
661
  onEdgeRemove: l,
651
662
  onNodeInsert: T
652
663
  };
653
664
  }
654
- function Cr({
655
- node: c,
665
+ function Pr({
666
+ node: s,
656
667
  niceDag: l
657
668
  }) {
658
- const T = F(() => {
659
- c.remove();
660
- }, [c]), E = F((m) => {
661
- l.startEdgeDragging(c, m);
662
- }, [l, c]), C = F((m) => {
663
- l.startNodeDragging(c, m);
664
- }, [l, c]);
669
+ const T = A(() => {
670
+ s.remove();
671
+ }, [s]), m = A((P) => {
672
+ l.startEdgeDragging(s, P);
673
+ }, [l, s]), y = A((P) => {
674
+ l.startNodeDragging(s, P);
675
+ }, [l, s]);
665
676
  return {
666
677
  onNodeRemove: T,
667
- startEdgeDragging: E,
668
- startNodeDragging: C
678
+ startEdgeDragging: m,
679
+ startNodeDragging: y
669
680
  };
670
681
  }
671
- function br(c) {
682
+ function br(s) {
672
683
  const {
673
684
  initNodes: l
674
- } = c;
685
+ } = s;
675
686
  if (!l)
676
687
  throw new Error("initNodes can't be undefined!");
677
688
  }
678
- function Or(c) {
679
- br(c);
689
+ function wr(s) {
690
+ br(s);
680
691
  const {
681
692
  onMount: l,
682
693
  renderNode: T,
683
- renderEdge: E,
684
- scrollPosition: C,
685
- initNodes: m,
686
- minimapConfig: x,
687
- ...O
688
- } = c, p = G(null), P = G(null), i = G(null), b = G(), [g, y] = dr(0), L = F(() => {
689
- i.current && i.current.destory();
690
- }, [y]), M = vr(() => ({
694
+ renderRootView: m,
695
+ renderEdge: y,
696
+ scrollPosition: P,
697
+ initNodes: _,
698
+ minimapConfig: w,
699
+ ...p
700
+ } = s, O = K(null), g = K(null), u = K(null), C = K(), [R, D] = dr(0), H = A(() => {
701
+ u.current && u.current.destory();
702
+ }, [D]), U = vr(() => ({
691
703
  onChange: () => {
692
- y(g + 1);
693
- }
694
- }), [y, g]);
695
- return xe(() => {
696
- if (b.current !== m) {
697
- if (!i.current) {
698
- const D = pr.init({
699
- container: p.current,
700
- minimapContainer: P.current,
701
- minimapConfig: x,
702
- ...O
703
- }, c.editable);
704
- i.current = D;
704
+ D(R + 1);
705
+ }
706
+ }), [D, R]);
707
+ return Ne(() => {
708
+ if (C.current !== _) {
709
+ if (!u.current) {
710
+ const E = pr.init({
711
+ container: O.current,
712
+ minimapContainer: g.current,
713
+ minimapConfig: w,
714
+ ...p
715
+ }, s.editable);
716
+ u.current = E;
705
717
  }
706
- i.current.withNodes(m).render(), y(g + 1), b.current = m, l && l();
718
+ u.current.withNodes(_).render(), D(R + 1), C.current = _, l && l();
707
719
  }
708
- return i.current.addNiceDagChangeListener(M), () => {
709
- i.current.removeNiceDagChangeListener(M);
720
+ return u.current.addNiceDagChangeListener(U), () => {
721
+ u.current.removeNiceDagChangeListener(U);
710
722
  };
711
- }, [m, y, g, l]), xe(() => (i.current && i.current.isDestoried && (i.current.withNodes(m).render(), y(g + 1)), () => {
712
- i.current && i.current.destory();
723
+ }, [_, D, R, l]), Ne(() => (u.current && u.current.isDestoried && (u.current.withNodes(_).render(), D(R + 1)), () => {
724
+ u.current && u.current.destory();
713
725
  }), []), {
714
- niceDag: i.current,
715
- niceDagEl: p,
716
- minimapEl: P,
726
+ niceDag: u.current,
727
+ niceDagEl: O,
728
+ minimapEl: g,
717
729
  render: () => {
718
- if (i.current) {
719
- const D = i.current.getAllNodes();
720
- let _ = (D == null ? void 0 : D.length) > 0 ? D.map((f) => /* @__PURE__ */ z(mr, {
730
+ if (u.current) {
731
+ const E = u.current.getAllNodes();
732
+ let f = (E == null ? void 0 : E.length) > 0 ? E.map((S) => /* @__PURE__ */ I(mr, {
721
733
  render: T,
722
- node: f,
723
- niceDag: i.current,
724
- patchVersion: g
725
- }, f.id)) : null;
726
- if (E) {
727
- const f = i.current.getAllEdges(), H = (f == null ? void 0 : f.length) > 0 ? f.map((A) => /* @__PURE__ */ z(Er, {
728
- render: E,
729
- edge: A,
730
- patchVersion: g,
731
- niceDag: i.current
732
- }, `edge-${A.source.id}-${A.target.id}`)) : [];
733
- _ = [..._, ...H];
734
+ node: S,
735
+ niceDag: u.current,
736
+ patchVersion: R
737
+ }, S.id)) : null;
738
+ if (m && (f = [...f, /* @__PURE__ */ I(Rr, {
739
+ niceDag: u.current,
740
+ render: m
741
+ })]), y) {
742
+ const S = u.current.getAllEdges(), X = (S == null ? void 0 : S.length) > 0 ? S.map(($) => /* @__PURE__ */ I(Er, {
743
+ render: y,
744
+ edge: $,
745
+ patchVersion: R,
746
+ niceDag: u.current
747
+ }, `edge-${$.source.id}-${$.target.id}`)) : [];
748
+ f = [...f, ...X];
734
749
  }
735
- return _;
750
+ return f;
736
751
  }
737
752
  return null;
738
753
  },
739
- reset: L
754
+ reset: H
740
755
  };
741
756
  }
742
757
  export {
743
758
  Er as NiceDagEdge,
744
759
  mr as NiceDagNode,
745
- Or as useNiceDag,
760
+ wr as useNiceDag,
746
761
  Tr as useNiceDagEdge,
747
- Cr as useNiceDagNode
762
+ Pr as useNiceDagNode
748
763
  };