@sigx/terminal 0.3.0 → 0.3.2

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/index.js CHANGED
@@ -1374,7 +1374,7 @@ function Mt(e) {
1374
1374
  return;
1375
1375
  }
1376
1376
  if (n.type === V) {
1377
- w(e, n, i, !1);
1377
+ n.dom = e.dom, w(e, n, i, !1, n.dom ?? null);
1378
1378
  return;
1379
1379
  }
1380
1380
  let d = n.dom = e.dom;
@@ -1390,40 +1390,40 @@ function Mt(e) {
1390
1390
  }
1391
1391
  w(e, n, d, m && f !== "foreignObject");
1392
1392
  }
1393
- function w(e, t, n, r = !1) {
1394
- let i = e.children, a = t.children;
1395
- a.forEach((e) => e.parent = t), T(n, i, a, r);
1393
+ function w(e, t, n, r = !1, i = null) {
1394
+ let a = e.children, o = t.children;
1395
+ o.forEach((e) => e.parent = t), T(n, a, o, r, i);
1396
1396
  }
1397
- function T(e, n, r, i = !1) {
1397
+ function T(e, n, r, i = !1, a = null) {
1398
1398
  process.env.NODE_ENV !== "production" && jt(r);
1399
- let a = 0, o = n.length - 1, s = n[0], c = n[o], l = 0, d = r.length - 1, f = r[0], p = r[d], m;
1400
- for (; a <= o && l <= d;) if (s == null) s = n[++a];
1401
- else if (c == null) c = n[--o];
1402
- else if (q(s, f)) C(s, f, e), s = n[++a], f = r[++l];
1403
- else if (q(c, p)) C(c, p, e), c = n[--o], p = r[--d];
1404
- else if (q(s, p)) {
1405
- C(s, p, e);
1406
- let i = s.dom, o = c.dom ? u(c.dom) : null;
1407
- i && t(i, e, o), s = n[++a], p = r[--d];
1408
- } else if (q(c, f)) {
1409
- C(c, f, e);
1410
- let i = c.dom, a = s.dom ?? null;
1411
- i && t(i, e, a), c = n[--o], f = r[++l];
1399
+ let o = 0, s = n.length - 1, c = n[0], l = n[s], d = 0, f = r.length - 1, p = r[0], m = r[f], h;
1400
+ for (; o <= s && d <= f;) if (c == null) c = n[++o];
1401
+ else if (l == null) l = n[--s];
1402
+ else if (q(c, p)) C(c, p, e), c = n[++o], p = r[++d];
1403
+ else if (q(l, m)) C(l, m, e), l = n[--s], m = r[--f];
1404
+ else if (q(c, m)) {
1405
+ C(c, m, e);
1406
+ let i = c.dom, a = l.dom ? u(l.dom) : null;
1407
+ i && t(i, e, a), c = n[++o], m = r[--f];
1408
+ } else if (q(l, p)) {
1409
+ C(l, p, e);
1410
+ let i = l.dom, a = c.dom ?? null;
1411
+ i && t(i, e, a), l = n[--s], p = r[++d];
1412
1412
  } else {
1413
- m ||= kt(n, a, o);
1414
- let c = f.key == null ? At(n, f, a, o) : m.get(String(f.key));
1415
- if (c != null) {
1416
- let r = n[c];
1417
- C(r, f, e), n[c] = void 0, r.dom && s.dom && t(r.dom, e, s.dom);
1418
- } else x(f, e, s.dom ?? null, i);
1419
- f = r[++l];
1413
+ h ||= kt(n, o, s);
1414
+ let a = p.key == null ? At(n, p, o, s) : h.get(String(p.key));
1415
+ if (a != null) {
1416
+ let r = n[a];
1417
+ C(r, p, e), n[a] = void 0, r.dom && c.dom && t(r.dom, e, c.dom);
1418
+ } else x(p, e, c.dom ?? null, i);
1419
+ p = r[++d];
1420
1420
  }
1421
- if (a > o) {
1422
- if (l <= d) {
1423
- let t = r[d + 1] == null ? null : r[d + 1].dom ?? null;
1424
- for (let n = l; n <= d; n++) x(r[n], e, t, i);
1421
+ if (o > s) {
1422
+ if (d <= f) {
1423
+ let t = r[f + 1]?.dom ?? null ?? a ?? null;
1424
+ for (let n = d; n <= f; n++) x(r[n], e, t, i);
1425
1425
  }
1426
- } else if (l > d) for (let t = a; t <= o; t++) n[t] && S(n[t], e);
1426
+ } else if (d > f) for (let t = o; t <= s; t++) n[t] && S(n[t], e);
1427
1427
  }
1428
1428
  function E(e, n, r, i) {
1429
1429
  let a = o("");