@nubisco/ui 1.57.0 → 1.58.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.
package/dist/index.mjs CHANGED
@@ -23339,7 +23339,7 @@ var Y$t = {
23339
23339
  }
23340
23340
  function ye(e) {
23341
23341
  let t = e.target instanceof HTMLElement ? e.target : null;
23342
- if (t?.closest(".nb-blueprint-card__port")) return;
23342
+ if (t?.closest(".nb-blueprint__chrome") || t?.closest(".nb-blueprint-card__port")) return;
23343
23343
  if (e.button === 1) {
23344
23344
  be(e);
23345
23345
  return;
@@ -23773,32 +23773,35 @@ var Y$t = {
23773
23773
  function St(e) {
23774
23774
  return r.animateConnections === "never" ? !1 : r.animateConnections === "always" ? !0 : r.animateConnections === "levels" ? !1 : e.active !== !1;
23775
23775
  }
23776
- function Ct() {
23777
- let e = Infinity, t = Infinity, n = -Infinity, i = -Infinity;
23776
+ function Ct(e) {
23777
+ let t = Infinity, n = Infinity, i = -Infinity, a = -Infinity, o = e && e.length ? new Set(e) : null, s = 0;
23778
23778
  if (r.cards) {
23779
23779
  if (r.cards.length === 0) return null;
23780
- for (let a of r.cards) {
23781
- let { w: r, h: o } = bt(a);
23782
- e = Math.min(e, a.x), t = Math.min(t, a.y), n = Math.max(n, a.x + r), i = Math.max(i, a.y + o);
23780
+ for (let e of r.cards) {
23781
+ if (o && !o.has(e.id)) continue;
23782
+ let { w: r, h: c } = bt(e);
23783
+ t = Math.min(t, e.x), n = Math.min(n, e.y), i = Math.max(i, e.x + r), a = Math.max(a, e.y + c), s++;
23783
23784
  }
23784
- return {
23785
- minX: e,
23786
- minY: t,
23787
- maxX: n,
23788
- maxY: i
23789
- };
23785
+ return s > 0 ? {
23786
+ minX: t,
23787
+ minY: n,
23788
+ maxX: i,
23789
+ maxY: a
23790
+ } : null;
23790
23791
  }
23791
23792
  if (!v.value) return null;
23792
- let a = v.value.querySelectorAll("[data-card-id]");
23793
- return a.length === 0 ? null : (a.forEach((r) => {
23794
- let a = r, o = Fe(a), s = a.offsetWidth, c = a.offsetHeight;
23795
- e = Math.min(e, o.x), t = Math.min(t, o.y), n = Math.max(n, o.x + s), i = Math.max(i, o.y + c);
23796
- }), {
23797
- minX: e,
23798
- minY: t,
23799
- maxX: n,
23800
- maxY: i
23801
- });
23793
+ let c = v.value.querySelectorAll("[data-card-id]");
23794
+ return c.length === 0 ? null : (c.forEach((e) => {
23795
+ let r = e;
23796
+ if (o && !o.has(r.getAttribute("data-card-id") ?? "")) return;
23797
+ let c = Fe(r), l = r.offsetWidth, u = r.offsetHeight;
23798
+ t = Math.min(t, c.x), n = Math.min(n, c.y), i = Math.max(i, c.x + l), a = Math.max(a, c.y + u), s++;
23799
+ }), s > 0 ? {
23800
+ minX: t,
23801
+ minY: n,
23802
+ maxX: i,
23803
+ maxY: a
23804
+ } : null);
23802
23805
  }
23803
23806
  function wt() {
23804
23807
  if (k.value = 1, !v.value) return;
@@ -23810,20 +23813,21 @@ var Y$t = {
23810
23813
  let t = v.value.getBoundingClientRect(), n = (e.minX + e.maxX) / 2, r = (e.minY + e.maxY) / 2;
23811
23814
  w.value = t.width / 2 - n, D.value = t.height / 2 - r;
23812
23815
  }
23813
- function Tt(e = 40) {
23816
+ function Tt(e = 40, t) {
23814
23817
  if (!v.value) return;
23815
- let t = Ct();
23816
- if (!t) {
23818
+ let n = Ct(t);
23819
+ if (!n) {
23820
+ if (t && t.length) return;
23817
23821
  Et();
23818
23822
  return;
23819
23823
  }
23820
- let n = v.value.getBoundingClientRect(), r = t.maxX - t.minX, i = t.maxY - t.minY;
23821
- if (r <= 0 || i <= 0) {
23824
+ let r = v.value.getBoundingClientRect(), i = n.maxX - n.minX, a = n.maxY - n.minY;
23825
+ if (i <= 0 || a <= 0) {
23822
23826
  wt();
23823
23827
  return;
23824
23828
  }
23825
- let a = n.width - e * 2, o = n.height - e * 2, s = a / r, c = o / i, l = Math.max(x9, Math.min(S9, Math.min(s, c))), u = (t.minX + t.maxX) / 2, d = (t.minY + t.maxY) / 2;
23826
- k.value = l, w.value = n.width / 2 - u * l, D.value = n.height / 2 - d * l;
23829
+ let o = r.width - e * 2, s = r.height - e * 2, c = o / i, l = s / a, u = Math.max(x9, Math.min(S9, Math.min(c, l))), d = (n.minX + n.maxX) / 2, f = (n.minY + n.maxY) / 2;
23830
+ k.value = u, w.value = r.width / 2 - d * u, D.value = r.height / 2 - f * u;
23827
23831
  }
23828
23832
  function Et() {
23829
23833
  w.value = 0, D.value = 0, k.value = 1;
@@ -24152,7 +24156,7 @@ var Y$t = {
24152
24156
  u("div", X$t, [A(t.$slots, "chrome", {}, void 0, !0)])
24153
24157
  ], 34));
24154
24158
  }
24155
- }), [["__scopeId", "data-v-216f0032"]]);
24159
+ }), [["__scopeId", "data-v-0dfaf0e3"]]);
24156
24160
  //#endregion
24157
24161
  //#region src/composables/useBlueprint.composable.ts
24158
24162
  function E9() {