@photoroom/ui 0.1.618 → 0.1.620

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/index.mjs CHANGED
@@ -3382,7 +3382,7 @@ function Ts({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
3382
3382
  });
3383
3383
  }
3384
3384
  updateSnapshot() {
3385
- this.snapshot || !this.instance || (this.snapshot = this.measure(), this.snapshot && !zo(this.snapshot.measuredBox.x) && !zo(this.snapshot.measuredBox.y) && (this.snapshot = void 0));
3385
+ !this.snapshot && this.instance && (this.snapshot = this.measure(), this.snapshot && !zo(this.snapshot.measuredBox.x) && !zo(this.snapshot.measuredBox.y) && (this.snapshot = void 0));
3386
3386
  }
3387
3387
  updateLayout() {
3388
3388
  if (!this.instance || (this.updateScroll(), !(this.options.alwaysMeasureLayout && this.isLead()) && !this.isLayoutDirty)) return;
@@ -3484,7 +3484,7 @@ function Ts({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
3484
3484
  if (!this.layout || !(r || i)) return;
3485
3485
  this.resolvedRelativeTargetAt = yn.timestamp;
3486
3486
  let a = this.getClosestProjectingParent();
3487
- a && this.linkedParentVersion !== a.layoutVersion && !a.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (this.options.layoutAnchor !== !1 && a && a.layout ? this.createRelativeTarget(a, this.layout.layoutBox, a.layout.layoutBox) : this.removeRelativeTarget()), !(!this.relativeTarget && !this.targetDelta) && (this.target || (this.target = Ha(), this.targetWithTransforms = Ha()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), tre(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || void 0)) : this.targetDelta ? (this.resumingFrom ? this.applyTransform(this.layout.layoutBox, !1, this.target) : Lo(this.target, this.layout.layoutBox), fo(this.target, this.targetDelta)) : Lo(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.options.layoutAnchor !== !1 && a && !!a.resumingFrom == !!this.resumingFrom && !a.options.layoutScroll && a.target && this.animationProgress !== 1 ? this.createRelativeTarget(a, this.target, a.target) : this.relativeParent = this.relativeTarget = void 0), Ra.value && ys.calculatedTargetDeltas++);
3487
+ a && this.linkedParentVersion !== a.layoutVersion && !a.options.layoutRoot && this.removeRelativeTarget(), !this.targetDelta && !this.relativeTarget && (this.options.layoutAnchor !== !1 && a && a.layout ? this.createRelativeTarget(a, this.layout.layoutBox, a.layout.layoutBox) : this.removeRelativeTarget()), (this.relativeTarget || this.targetDelta) && (this.target || (this.target = Ha(), this.targetWithTransforms = Ha()), this.relativeTarget && this.relativeTargetOrigin && this.relativeParent && this.relativeParent.target ? (this.forceRelativeParentToResolveTarget(), tre(this.target, this.relativeTarget, this.relativeParent.target, this.options.layoutAnchor || void 0)) : this.targetDelta ? (this.resumingFrom ? this.applyTransform(this.layout.layoutBox, !1, this.target) : Lo(this.target, this.layout.layoutBox), fo(this.target, this.targetDelta)) : Lo(this.target, this.layout.layoutBox), this.attemptToResolveRelativeTarget && (this.attemptToResolveRelativeTarget = !1, this.options.layoutAnchor !== !1 && a && !!a.resumingFrom == !!this.resumingFrom && !a.options.layoutScroll && a.target && this.animationProgress !== 1 ? this.createRelativeTarget(a, this.target, a.target) : this.relativeParent = this.relativeTarget = void 0), Ra.value && ys.calculatedTargetDeltas++);
3488
3488
  }
3489
3489
  getClosestProjectingParent() {
3490
3490
  if (!(!this.parent || io(this.parent.latestValues) || oo(this.parent.latestValues))) return this.parent.isProjecting() ? this.parent : this.parent.getClosestProjectingParent();
@@ -3532,7 +3532,7 @@ function Ts({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
3532
3532
  setAnimationOrigin(e, t = !1, n) {
3533
3533
  let r = this.snapshot, i = r ? r.latestValues : {}, a = { ...this.latestValues }, o = Ba();
3534
3534
  (!this.relativeParent || !this.relativeParent.options.layoutRoot) && (this.relativeTarget = this.relativeTargetOrigin = void 0), this.attemptToResolveRelativeTarget = !t;
3535
- let s = Ha(), c = (r ? r.source : void 0) !== (this.layout ? this.layout.source : void 0), l = this.getStack(), u = !l || l.members.length <= 1, d = !!(c && !u && this.options.crossfade === !0 && !this.path.some(Ws));
3535
+ let s = Ha(), c = (r ? r.source : void 0) !== (this.layout ? this.layout.source : void 0), l = this.getStack(), u = !l || l.members.length <= 1, d = !(!c || u || this.options.crossfade !== !0 || this.path.some(Ws));
3536
3536
  this.animationProgress = 0;
3537
3537
  let f, p = n?.interpolateProjection(e);
3538
3538
  this.mixTargetDelta = (t) => {
@@ -3565,7 +3565,7 @@ function Ts({ attachResizeListener: e, defaultParent: t, measureScroll: n, check
3565
3565
  }
3566
3566
  applyTransformsToTarget() {
3567
3567
  let e = this.getLead(), { targetWithTransforms: t, target: n, layout: r, latestValues: i } = e;
3568
- if (!(!t || !n || !r)) {
3568
+ if (t && n && r) {
3569
3569
  if (this !== e && this.layout && r && Xs(this.options.animationType, this.layout.layoutBox, r.layoutBox)) {
3570
3570
  n = this.target || Ha();
3571
3571
  let t = zo(this.layout.layoutBox.x);
@@ -5022,10 +5022,10 @@ var Ul = class extends to {
5022
5022
  } catch {
5023
5023
  e = !0;
5024
5024
  }
5025
- !e || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
5025
+ e && this.node.animationState && (this.node.animationState.setActive("whileFocus", !0), this.isActive = !0);
5026
5026
  }
5027
5027
  onBlur() {
5028
- !this.isActive || !this.node.animationState || (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
5028
+ this.isActive && this.node.animationState && (this.node.animationState.setActive("whileFocus", !1), this.isActive = !1);
5029
5029
  }
5030
5030
  mount() {
5031
5031
  this.unmount = It(fs(this.node.current, "focus", () => this.onFocus()), fs(this.node.current, "blur", () => this.onBlur()));
@@ -11804,7 +11804,7 @@ function Gh({ threshold: e, delay: t, trackVisibility: n, rootMargin: r, scrollM
11804
11804
  entry: void 0
11805
11805
  }), m = Uh((e, t) => {
11806
11806
  let n = d.current;
11807
- d.current = e, !(n === void 0 && !e) && (p({
11807
+ d.current = e, (n !== void 0 || e) && (p({
11808
11808
  inView: e,
11809
11809
  entry: t
11810
11810
  }), u?.(e, t));
@@ -13965,7 +13965,7 @@ var Ob = /*@__PURE__*/ K("$ZodArray", (e, t) => {
13965
13965
  });
13966
13966
  function kb(e, t, n, r, i, a) {
13967
13967
  let o = n in r, s = a === "optional";
13968
- if (!(!o && s && i === "optional")) {
13968
+ if (o || !s || i !== "optional") {
13969
13969
  if (e.issues.length) {
13970
13970
  if (i !== void 0 && s && !o) return;
13971
13971
  t.issues.push(...q_(n, e.issues));
@@ -14516,7 +14516,7 @@ function fx(e, t) {
14516
14516
  let t = Object.getOwnPropertyDescriptor(a, e);
14517
14517
  if (!t || t.get) continue;
14518
14518
  let n = t.value;
14519
- if (!(!n || typeof n != "object")) {
14519
+ if (n && typeof n == "object") {
14520
14520
  if (n._zod) i(n);
14521
14521
  else if (Array.isArray(n)) for (let e of n) i(e);
14522
14522
  }
@@ -18433,7 +18433,7 @@ var ile = "__AMPLITUDE_SCRIPT_URL__", ale = "sdk.error.uncaught", ole = function
18433
18433
  typeof t == "string" ? [t] : [];
18434
18434
  }, sle = function(e) {
18435
18435
  var t = XS();
18436
- if (!(!t || typeof t.addEventListener != "function")) {
18436
+ if (t && typeof t.addEventListener == "function") {
18437
18437
  var n = function(e) {
18438
18438
  var t = e.error instanceof Error ? e.error : void 0, n = t?.stack, r = NC({
18439
18439
  filename: e.filename,
@@ -19522,7 +19522,7 @@ var rw = new (function() {
19522
19522
  };
19523
19523
  }, e.prototype.observeFetch = function(e) {
19524
19524
  var t = this;
19525
- !this.globalScope || !e || (this.globalScope.fetch = function(n, r) {
19525
+ this.globalScope && e && (this.globalScope.fetch = function(n, r) {
19526
19526
  return q(t, void 0, void 0, function() {
19527
19527
  var t, i, a, o, s = this;
19528
19528
  return J(this, function(c) {
@@ -19574,7 +19574,7 @@ var rw = new (function() {
19574
19574
  return null;
19575
19575
  };
19576
19576
  }, e.prototype.observeXhr = function(t, n, r) {
19577
- if (!(!this.globalScope || !t || !n)) {
19577
+ if (this.globalScope && t && n) {
19578
19578
  var i = this.globalScope.XMLHttpRequest.prototype, a = this;
19579
19579
  i.open = function() {
19580
19580
  var e = [...arguments], n = this, r = yS(e, 2), i = r[0], o = r[1];
@@ -20429,7 +20429,7 @@ function xw(e, t, n) {
20429
20429
  }
20430
20430
  function eue(e, t) {
20431
20431
  var n, r;
20432
- if (!(typeof e != "object" || !e || !e.captureRules?.length)) {
20432
+ if (typeof e == "object" && e && e.captureRules?.length) {
20433
20433
  var i = Y({}, e), a = i.captureRules ?? [];
20434
20434
  try {
20435
20435
  for (var o = vS(a), s = o.next(); !s.done; s = o.next()) {
@@ -20450,7 +20450,7 @@ function eue(e, t) {
20450
20450
  }
20451
20451
  function Sw(e) {
20452
20452
  var t, n, r, i, a, o;
20453
- if (!(typeof e != "object" || !e) && !Array.isArray(e)) {
20453
+ if (typeof e == "object" && e && !Array.isArray(e)) {
20454
20454
  var s = Object.keys(e);
20455
20455
  try {
20456
20456
  for (var c = vS(s), l = c.next(); !l.done; l = c.next()) {
@@ -20476,7 +20476,7 @@ function Sw(e) {
20476
20476
  try {
20477
20477
  for (var h = (a = void 0, vS(["responseHeaders", "requestHeaders"])), g = h.next(); !g.done; g = h.next()) {
20478
20478
  var _ = g.value, v = m[_] ?? {}, y = v.captureSafeHeaders, b = v.allowlist;
20479
- if (!(!y && !b)) {
20479
+ if (y || b) {
20480
20480
  if (b !== void 0 && !Array.isArray(b)) {
20481
20481
  delete m[_];
20482
20482
  continue;
@@ -20850,7 +20850,7 @@ var wue = function(e, t, n) {
20850
20850
  var t = parseInt(e, 32);
20851
20851
  if (!isNaN(t)) return t;
20852
20852
  }, Tue = function(e) {
20853
- if (!(!atob || !escape || !e)) try {
20853
+ if (atob && escape && e) try {
20854
20854
  return decodeURIComponent(escape(atob(e)));
20855
20855
  } catch {
20856
20856
  return;
@@ -21063,7 +21063,7 @@ var Gue = function(e) {
21063
21063
  var a, o, s, c, l, u, d, f, p, m, h, g, _, v, y, b, x, S, C, w, T;
21064
21064
  return J(this, function(E) {
21065
21065
  switch (E.label) {
21066
- case 0: return a = t.identityStorage || "cookie", o = "", a === "cookie" && !t.cookieOptions?.domain && t.cookieOptions?.domain !== "" ? [4, Yue(void 0, r)] : [3, 2];
21066
+ case 0: return a = t.identityStorage || "cookie", o = "", a !== "cookie" || t.cookieOptions?.domain || t.cookieOptions?.domain === "" ? [3, 2] : [4, Yue(void 0, r)];
21067
21067
  case 1: o = E.sent(), E.label = 2;
21068
21068
  case 2: return s = Y({
21069
21069
  domain: t.cookieOptions?.domain ?? o,
@@ -22813,7 +22813,7 @@ function Hfe(e, t, n) {
22813
22813
  if (!Bfe.includes(String(e.getAttribute("type"))) && !zfe.includes(o)) try {
22814
22814
  for (var h = vS(p), g = h.next(); !g.done; g = h.next()) {
22815
22815
  var _ = g.value;
22816
- if (!(m && !Rfe.includes(_.name))) {
22816
+ if (!m || Rfe.includes(_.name)) {
22817
22817
  if (t.has(_.name)) {
22818
22818
  f[_.name] = ow;
22819
22819
  continue;
@@ -23045,7 +23045,7 @@ var ZT = function() {
23045
23045
  }(), Jfe = "configs.analyticsSDK.browserSDK.autocapture.elementSelector";
23046
23046
  function QT(e, t) {
23047
23047
  var n = e.remoteConfigClient;
23048
- if (!(!e.fetchRemoteConfig || !n)) {
23048
+ if (e.fetchRemoteConfig && n) {
23049
23049
  var r = n.subscribe(Jfe, "all", function(n, r) {
23050
23050
  e.loggerProvider.debug(`@amplitude/element-selector: remote-config delivery (source=${String(r)}) ${JSON.stringify(n)}`), t.updateSelectorConfig(n, e.loggerProvider);
23051
23051
  });
@@ -23595,7 +23595,7 @@ var pE = 5, mE = 4e3, ppe = function(e) {
23595
23595
  return e.next();
23596
23596
  }
23597
23597
  var i = window.getSelection();
23598
- if (!(!i || i.isCollapsed)) return e.next();
23598
+ if (i && !i.isCollapsed) return e.next();
23599
23599
  };
23600
23600
  return window.document.addEventListener("selectionchange", t), function() {
23601
23601
  window.document.removeEventListener("selectionchange", t);
@@ -23852,11 +23852,11 @@ function vE(e, t) {
23852
23852
  return !1;
23853
23853
  }
23854
23854
  function Cpe(e, t, n, r, i) {
23855
- if (!(e.hosts && !e.hosts.find(function(e) {
23855
+ if ((!e.hosts || e.hosts.find(function(e) {
23856
23856
  return _E(t, e);
23857
23857
  })) && !(r && e.urls && !bC(r, e.urls)) && !(i && e.methods && !e.methods.find(function(e) {
23858
23858
  return i.toLowerCase() === e.toLowerCase() || e === "*";
23859
- }))) return !((n || n === 0) && !vE(n, e.statusCodeRange || gE));
23859
+ }))) return !n && n !== 0 || !!vE(n, e.statusCodeRange || gE);
23860
23860
  }
23861
23861
  function wpe(e) {
23862
23862
  var t = e.indexOf("#"), n = t >= 0 ? e.slice(t + 1) : "", r = t >= 0 ? e.slice(0, t) : e, i = r.indexOf("?"), a = i >= 0 ? r.slice(i + 1) : "", o = i >= 0 ? r.slice(0, i) : r;
@@ -29341,14 +29341,14 @@ var MI = typeof kI == "function" ? jI : OI, NI = Object.defineProperty, PI = (e,
29341
29341
  }, "RovingFocusGroupImpl")), qI = "RovingFocusGroupItem", JI = /* @__PURE__ */ R.forwardRef(/* @__PURE__ */ PI(function(e, t) {
29342
29342
  let { __scopeRovingFocusGroup: n, focusable: r = !0, active: i = !1, tabStopId: a, children: o, ...s } = e, c = cf(), l = a || c, u = WI(qI, n), d = u.currentTabStopId === l, f = zI(n), { onFocusableItemAdd: p, onFocusableItemRemove: m, currentTabStopId: h } = u, g = MI();
29343
29343
  return sf(() => {
29344
- if (!(!g || !r)) return p(), () => m();
29344
+ if (g && r) return p(), () => m();
29345
29345
  }, [
29346
29346
  g,
29347
29347
  r,
29348
29348
  p,
29349
29349
  m
29350
29350
  ]), R.useEffect(() => {
29351
- if (!(g || !r)) return p(), () => m();
29351
+ if (!g && r) return p(), () => m();
29352
29352
  }, [
29353
29353
  g,
29354
29354
  r,
@@ -29438,11 +29438,11 @@ var eL = GI, tL = JI, nL = function(e) {
29438
29438
  var i = cL(t, Array.isArray(e) ? e : [e]);
29439
29439
  aL[n] || (aL[n] = /* @__PURE__ */ new WeakMap());
29440
29440
  var a = aL[n], o = [], s = /* @__PURE__ */ new Set(), c = new Set(i), l = function(e) {
29441
- !e || s.has(e) || (s.add(e), l(e.parentNode));
29441
+ e && !s.has(e) && (s.add(e), l(e.parentNode));
29442
29442
  };
29443
29443
  i.forEach(l);
29444
29444
  var u = function(e) {
29445
- !e || c.has(e) || Array.prototype.forEach.call(e.children, function(e) {
29445
+ e && !c.has(e) && Array.prototype.forEach.call(e.children, function(e) {
29446
29446
  if (s.has(e)) u(e);
29447
29447
  else try {
29448
29448
  var t = e.getAttribute(r), i = t !== null && t !== "false", c = (rL.get(e) || 0) + 1, l = (a.get(e) || 0) + 1;
@@ -29883,7 +29883,7 @@ function fR(e) {
29883
29883
  return iR(h, t, e, h === "h" ? s : c, !0);
29884
29884
  }, []), c = R.useCallback(function(e) {
29885
29885
  var n = e;
29886
- if (!(!dR.length || dR[dR.length - 1] !== a)) {
29886
+ if (dR.length && dR[dR.length - 1] === a) {
29887
29887
  var r = "deltaY" in n ? oR(n) : aR(n), i = t.current.filter(function(e) {
29888
29888
  return e.name === n.type && (e.target === n.target || n.target === e.shadowParent) && cR(e.delta, r);
29889
29889
  })[0];
@@ -32165,7 +32165,7 @@ function KH(e = {}) {
32165
32165
  //#region src/hooks/useWindowDragEvents.ts
32166
32166
  var qH = ({ enabled: e, onDragEnter: t, onDragOver: n, onDrop: r, onDragLeave: i }) => {
32167
32167
  De(() => {
32168
- if (!(!e || !t)) return window.addEventListener("dragenter", t), () => {
32168
+ if (e && t) return window.addEventListener("dragenter", t), () => {
32169
32169
  window.removeEventListener("dragenter", t);
32170
32170
  };
32171
32171
  }, [e, t]), De(() => {
@@ -36420,7 +36420,7 @@ var BJ = (e) => /* @__PURE__ */ I(EJ, {
36420
36420
  })
36421
36421
  }), VJ = ({ className: e, children: t, onPointerDownOutside: n, ...r }) => /* @__PURE__ */ I(_J, {
36422
36422
  onPointerDownOutside: (e) => {
36423
- n?.(e), !(e.defaultPrevented || !(e.target instanceof Element)) && (!e.target.closest("[data-dialog-overlay]") || e.target.closest("[data-sonner-toast]")) && e.preventDefault();
36423
+ n?.(e), !e.defaultPrevented && e.target instanceof Element && (!e.target.closest("[data-dialog-overlay]") || e.target.closest("[data-sonner-toast]")) && e.preventDefault();
36424
36424
  },
36425
36425
  className: U("bg-surface-high shadow-700 misc-dialog-rounding relative h-full w-full outline-hidden", "radix-state-closed:animate-dialog-leave radix-state-open:animate-dialog-enter", e),
36426
36426
  ...r,
@@ -37214,29 +37214,28 @@ var xY = ({ title: e, avatar: t, badgeLabel: n, className: r, ref: i, ...a }) =>
37214
37214
  ref: i,
37215
37215
  ...a,
37216
37216
  className: H("shrink-0 cursor-pointer outline-hidden", "rounded-500 flex h-14 w-full items-center gap-3 p-2", "data-radix-collection-item:focus:bg-background-borderless-subdued-hover", "data-radix-collection-item:active:bg-background-borderless-subdued-down", "[&:not([data-radix-collection-item])]:hover:bg-background-borderless-subdued-hover", "[&:not([data-radix-collection-item])]:focus-visible:bg-background-borderless-subdued-hover", "[&:not([data-radix-collection-item])]:active:bg-background-borderless-subdued-down", "[&:not([data-radix-collection-item])]:focus-visible:misc-border-size-focus-ring", "[&:not([data-radix-collection-item])]:focus-visible:ring-misc-focus-indicator", "aria-expanded:bg-background-borderless-subdued-hover", r),
37217
- children: [
37218
- /* @__PURE__ */ I(mh, {
37219
- ...t,
37220
- size: 40
37221
- }),
37222
- /* @__PURE__ */ L("div", {
37223
- className: "flex min-w-0 grow flex-col gap-[3px] text-start",
37217
+ children: [/* @__PURE__ */ I(mh, {
37218
+ ...t,
37219
+ size: 40
37220
+ }), /* @__PURE__ */ L("div", {
37221
+ className: "flex min-w-0 grow flex-col gap-[3px] text-start",
37222
+ children: [/* @__PURE__ */ L("div", {
37223
+ className: "flex min-w-0 items-center gap-1",
37224
37224
  children: [/* @__PURE__ */ I("span", {
37225
37225
  className: "component-semi-strong-500 text-content-primary min-w-0 truncate",
37226
37226
  children: e
37227
- }), !!n && /* @__PURE__ */ I("div", {
37228
- className: "flex items-center gap-1.5",
37229
- children: /* @__PURE__ */ I(kh, {
37230
- size: "small",
37231
- children: n
37232
- })
37227
+ }), /* @__PURE__ */ I("span", {
37228
+ className: "text-content-tertiary h-4 w-4 shrink-0",
37229
+ children: /* @__PURE__ */ I(d, {})
37233
37230
  })]
37234
- }),
37235
- /* @__PURE__ */ I("span", {
37236
- className: "text-content-tertiary h-4 w-4 shrink-0",
37237
- children: /* @__PURE__ */ I(d, {})
37238
- })
37239
- ]
37231
+ }), !!n && /* @__PURE__ */ I("div", {
37232
+ className: "flex items-center gap-1.5",
37233
+ children: /* @__PURE__ */ I(kh, {
37234
+ size: "small",
37235
+ children: n
37236
+ })
37237
+ })]
37238
+ })]
37240
37239
  });
37241
37240
  xY.displayName = "SpacePullDownButton";
37242
37241
  //#endregion
@@ -38078,7 +38077,7 @@ var vme = {
38078
38077
  e,
38079
38078
  l.value
38080
38079
  ]), f = B(() => {
38081
- !o || !u.current || (o(), u.current.focus());
38080
+ o && u.current && (o(), u.current.focus());
38082
38081
  }, [o]);
38083
38082
  return /* @__PURE__ */ L("div", {
38084
38083
  className: H("relative", s),
@@ -38776,8 +38775,8 @@ var Pme = ({ x: e, y: t }, { width: n, height: r }, i, a) => ({
38776
38775
  RX.Header = NX, RX.AccessoryBar = jX, RX.Content = MX;
38777
38776
  //#endregion
38778
38777
  //#region src/components/editor/HoverObjectBox/HoverObjectBox.tsx
38779
- var zme = ({ className: e, left: t, top: n, width: r, height: i, transform: a, ...o }) => /* @__PURE__ */ I("div", {
38780
- className: U("pointer-events-none absolute origin-center", "outline-content-accent outline-1 outline-dashed", "rounded-[2px]", e),
38778
+ var zme = ({ className: e, left: t, top: n, width: r, height: i, transform: a, outlineStyle: o = "dashed", ...s }) => /* @__PURE__ */ I("div", {
38779
+ className: U("pointer-events-none absolute origin-center", "outline-content-accent outline-1", o === "dashed" ? "outline-dashed" : "outline-solid", "rounded-[2px]", e),
38781
38780
  style: {
38782
38781
  left: t,
38783
38782
  top: n,
@@ -38785,7 +38784,7 @@ var zme = ({ className: e, left: t, top: n, width: r, height: i, transform: a, .
38785
38784
  height: i,
38786
38785
  transform: a
38787
38786
  },
38788
- ...o
38787
+ ...s
38789
38788
  }), Bme = ({ ...e }) => /* @__PURE__ */ I("div", {
38790
38789
  ...e,
38791
38790
  className: H("rounded-250 bg-misc-replaceable flex size-250 items-center justify-center text-black", e.className),
@@ -39620,7 +39619,7 @@ function YZ(e, t) {
39620
39619
  hhe(n, r, i, t, n[a]);
39621
39620
  for (var o = 0; o < t; ++o) {
39622
39621
  var s = o, c = n[o + i * t];
39623
- !FZ(c, 1e-7) || i === o || phe(n, r, s, i, t, -c);
39622
+ FZ(c, 1e-7) && i !== o && phe(n, r, s, i, t, -c);
39624
39623
  }
39625
39624
  }
39626
39625
  return r;
@@ -40273,7 +40272,7 @@ var Ihe = /*#__PURE__*/ function(e) {
40273
40272
  var t = e !== null && e.apply(this, arguments) || this;
40274
40273
  return t._startRect = null, t._startPos = [], t._prevTime = 0, t._timer = 0, t._prevScrollPos = [0, 0], t._isWait = !1, t._flag = !1, t._currentOptions = null, t._lock = !1, t._unregister = null, t._onScroll = function() {
40275
40274
  var e = t._currentOptions;
40276
- t._lock || !e || t.emit("scrollDrag", { next: function(n) {
40275
+ !t._lock && e && t.emit("scrollDrag", { next: function(n) {
40277
40276
  t.checkScroll({
40278
40277
  container: e.container,
40279
40278
  inputEvent: n
@@ -40707,7 +40706,7 @@ var GQ = /* @__PURE__ */ function() {
40707
40706
  n === void 0 && (n = {});
40708
40707
  var r = e.call(this) || this;
40709
40708
  r.options = {}, r.flag = !1, r.pinchFlag = !1, r.data = {}, r.isDrag = !1, r.isPinch = !1, r.clientStores = [], r.targets = [], r.prevTime = 0, r.doubleFlag = !1, r._useMouse = !1, r._useTouch = !1, r._useDrag = !1, r._dragFlag = !1, r._isTrusted = !1, r._isMouseEvent = !1, r._isSecondaryButton = !1, r._preventMouseEvent = !1, r._prevInputEvent = null, r._isDragAPI = !1, r._isIdle = !0, r._preventMouseEventId = 0, r._window = window, r.onDragStart = function(e, t) {
40710
- if (t === void 0 && (t = !0), !(!r.flag && e.cancelable === !1)) {
40709
+ if (t === void 0 && (t = !0), r.flag || e.cancelable !== !1) {
40711
40710
  var n = e.type.indexOf("drag") >= -1;
40712
40711
  if (!(r.flag && n)) {
40713
40712
  r._isDragAPI = !0;
@@ -42941,11 +42940,11 @@ var I1 = {
42941
42940
  var ne = nQ(te, g), re = nQ(P, g), ie = nQ(re, m), ae = nQ(ne, h);
42942
42941
  n.prevDist = re, n.prevBeforeDist = ne, n.passDelta = ie, n.passDist = re;
42943
42942
  var oe = n.left + ne[0], se = n.top + ne[1], ce = n.right - ne[0], le = n.bottom - ne[1], F = v$(n, `translate(${P[0]}px, ${P[1]}px)`, `translate(${re[0]}px, ${re[1]}px)`);
42944
- if (k$(t, F), e.state.dragInfo.dist = r ? [0, 0] : re, !(!r && !v && ie.every(function(e) {
42943
+ if (k$(t, F), e.state.dragInfo.dist = r ? [0, 0] : re, r || v || !ie.every(function(e) {
42945
42944
  return !e;
42946
- }) && ae.some(function(e) {
42945
+ }) || !ae.some(function(e) {
42947
42946
  return !e;
42948
- }))) {
42947
+ })) {
42949
42948
  var ue = e.state, de = ue.width, fe = ue.height, pe = H0(e, t, X({
42950
42949
  transform: F,
42951
42950
  dist: re,
@@ -43227,7 +43226,7 @@ var z1 = a2("resizable"), B1 = {
43227
43226
  },
43228
43227
  dragControlAfter: function(e, t) {
43229
43228
  var n = t.datas, r = n.isResize, i = n.startOffsetWidth, a = n.startOffsetHeight, o = n.prevWidth, s = n.prevHeight;
43230
- if (!(!r || e.props.checkResizableError === !1)) {
43229
+ if (r && e.props.checkResizableError !== !1) {
43231
43230
  var c = e.state, l = c.width, u = c.height, d = l - (i + o), f = u - (a + s), p = $(d) > 3, m = $(f) > 3;
43232
43231
  if (p && (n.startWidth += d, n.startOffsetWidth += d, n.prevWidth += d), m && (n.startHeight += f, n.startOffsetHeight += f, n.prevHeight += f), p || m) return this.dragControl(e, t);
43233
43232
  }
@@ -43571,7 +43570,7 @@ var d_e = {
43571
43570
  setRotation: function(e) {
43572
43571
  O = e - N, T = O, j = O;
43573
43572
  }
43574
- }, !0)), n = Z(W1(e, y, m, T, N, te), 3), w = n[0], T = n[1], E = n[2], r = Z(W1(e, y, h, O, N, te), 3), D = r[0], O = r[1], k = r[2], i = Z(W1(e, y, g, j, ee, te), 3), A = i[0], j = i[1], M = i[2], !(!A && !D && !w && !C && !f)) {
43573
+ }, !0)), n = Z(W1(e, y, m, T, N, te), 3), w = n[0], T = n[1], E = n[2], r = Z(W1(e, y, h, O, N, te), 3), D = r[0], O = r[1], k = r[2], i = Z(W1(e, y, g, j, ee, te), 3), A = i[0], j = i[1], M = i[2], A || D || w || C || f) {
43575
43574
  var ie = v$(a, `rotate(${k}deg)`, `rotate(${O}deg)`);
43576
43575
  f && (a.fixedPosition = F$(e, a.targetAllTransform, a.fixedDirection, a.fixedOffset, a));
43577
43576
  var ae = Age(e, O, a), oe = nQ(tQ(d || [0, 0], ae), a.prevInverseDist || [0, 0]);
@@ -46347,7 +46346,7 @@ function uve(e, t, n, r, i) {
46347
46346
  var r = t === "n" || t === "s";
46348
46347
  e.forEach(function(e, i) {
46349
46348
  var a = e.direction, o = e.horizontal, s = e.vertical;
46350
- !a || a.indexOf(t) === -1 || (c[i] = [r || !o ? 0 : n[0], !r || !s ? 0 : n[1]]);
46349
+ a && a.indexOf(t) !== -1 && (c[i] = [r || !o ? 0 : n[0], !r || !s ? 0 : n[1]]);
46351
46350
  });
46352
46351
  }) : c[t] = n;
46353
46352
  return c;
@@ -46762,7 +46761,7 @@ function hve(e, t, n, r) {
46762
46761
  var t = e.virtual;
46763
46762
  return e.vertical && !t;
46764
46763
  }).length, o = -1;
46765
- if (t === 0 && (i === 0 ? o = 0 : i === 1 && (o = 1)), t === 2 && (i <= 2 ? o = 2 : i <= 3 && (o = 3)), t === 3 && (a === 0 ? o = 4 : a < 4 && (o = 7)), t === 1 && (a <= 1 ? o = 5 : a <= 2 && (o = 6)), !(o === -1 || !e[o].virtual)) {
46764
+ if (t === 0 && (i === 0 ? o = 0 : i === 1 && (o = 1)), t === 2 && (i <= 2 ? o = 2 : i <= 3 && (o = 3)), t === 3 && (a === 0 ? o = 4 : a < 4 && (o = 7)), t === 1 && (a <= 1 ? o = 5 : a <= 2 && (o = 6)), o !== -1 && e[o].virtual) {
46766
46765
  var s = e[o];
46767
46766
  gve(e, o), o < 4 ? s.pos[0] = n : s.pos[1] = r;
46768
46767
  }
@@ -47753,7 +47752,7 @@ var X2 = /* @__PURE__ */ function(e) {
47753
47752
  }, t.prototype.checkUpdate = function() {
47754
47753
  this._isPropTargetChanged = !1;
47755
47754
  var e = this.props, t = e.target, n = e.container, r = e.parentMoveable, i = this.state, a = i.target, o = i.container;
47756
- if (!(!a && !t)) {
47755
+ if (a || t) {
47757
47756
  this.updateAbles();
47758
47757
  var s = !J0(a, t);
47759
47758
  if (s || !J0(o, n)) {
@@ -48059,7 +48058,7 @@ var X2 = /* @__PURE__ */ function(e) {
48059
48058
  },
48060
48059
  dragGroupEnd: function(e, t) {
48061
48060
  var n = t.inputEvent, r = t.inputTarget;
48062
- if (!(!n || !r || t.isDrag || e.isMoveableElement(r) || t.datas.inputTarget === r)) {
48061
+ if (n && r && !t.isDrag && !e.isMoveableElement(r) && t.datas.inputTarget !== r) {
48063
48062
  var i = e.props.targets, a = i.indexOf(r), o = a > -1, s = !1;
48064
48063
  a === -1 && (a = CZ(i, function(e) {
48065
48064
  return e.contains(r);
@@ -49131,7 +49130,7 @@ var Hve = W(["component-500 text-content-primary flex flex-row items-center"], {
49131
49130
  return /* @__PURE__ */ L("form", {
49132
49131
  className: U("misc-dropdown-inner-rounding flex w-full shrink-0 items-center gap-2", "[&:not(:focus-within)]:hover:bg-background-subdued-hover", s),
49133
49132
  onSubmit: (e) => {
49134
- e.preventDefault(), !(!d || o) && i();
49133
+ e.preventDefault(), d && !o && i();
49135
49134
  },
49136
49135
  children: [/* @__PURE__ */ I("input", {
49137
49136
  type: "text",
@@ -50123,15 +50122,15 @@ var l3 = (e) => e.isFile === !0, u3 = (e) => e.isDirectory === !0, wye = new Int
50123
50122
  if (!r || r.disabled) return;
50124
50123
  let i = r.multiple, a = r.accept;
50125
50124
  r.accept = t.join(","), r.multiple = e, f.current = (e) => {
50126
- r.multiple = i, r.accept = a, !(!e || !e.length) && n(e);
50125
+ r.multiple = i, r.accept = a, e && e.length && n(e);
50127
50126
  }, r.click();
50128
50127
  }), [r]), m = B(async ({ accept: e = r ?? l_ } = {}) => (await p({
50129
50128
  multiple: !1,
50130
50129
  accept: e
50131
50130
  }))[0], [p, r]), h = B((e, n = !1, r = !1, i) => {
50132
- t || !e || !e.length || a?.(e, n, r, i);
50131
+ !t && e && e.length && a?.(e, n, r, i);
50133
50132
  }, [t, a]), g = B((e) => {
50134
- e.preventDefault(), !(t || !e.dataTransfer?.types.includes("Files")) && (i?.(), c(!0));
50133
+ e.preventDefault(), !t && e.dataTransfer?.types.includes("Files") && (i?.(), c(!0));
50135
50134
  }, [t, i]), _ = B((e) => {
50136
50135
  e.preventDefault(), c(!1);
50137
50136
  }, []), v = B((e) => {
@@ -50216,7 +50215,7 @@ var l3 = (e) => e.isFile === !0, u3 = (e) => e.isDirectory === !0, wye = new Int
50216
50215
  }
50217
50216
  }, [h]);
50218
50217
  return GH((n) => {
50219
- t || !e || h(n);
50218
+ !t && e && h(n);
50220
50219
  }), {
50221
50220
  isDragging: s,
50222
50221
  inputRef: l,
@@ -52730,7 +52729,7 @@ var F6 = ({ isSearchable: e = !0, value: t, defaultValue: n = "", onValueChange:
52730
52729
  o
52731
52730
  ]), O = B(() => E(""), [E]), k = Ne(() => T.findIndex(({ item: e }) => e.value === C), [T, C]);
52732
52731
  return w4(() => {
52733
- !b || k === -1 || (S.current?.scrollToIndex(k), setTimeout(() => {
52732
+ b && k !== -1 && (S.current?.scrollToIndex(k), setTimeout(() => {
52734
52733
  document.querySelector("[data-radix-select-item][data-state=checked]")?.focus({ preventScroll: !0 });
52735
52734
  }, 0));
52736
52735
  }, [b, k]), /* @__PURE__ */ L(P6, {
@@ -55449,10 +55448,10 @@ var aCe = (e) => {
55449
55448
  te(!1), D(null), xe.current = null;
55450
55449
  },
55451
55450
  onPointerDown: (e) => {
55452
- e.button !== 2 && (De || !he || (F.current = /* @__PURE__ */ new Date(), oe(ye.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (te(!0), xe.current = {
55451
+ e.button !== 2 && !De && he && (F.current = /* @__PURE__ */ new Date(), oe(ye.current), e.target.setPointerCapture(e.pointerId), e.target.tagName !== "BUTTON" && (te(!0), xe.current = {
55453
55452
  x: e.clientX,
55454
55453
  y: e.clientY
55455
- })));
55454
+ }));
55456
55455
  },
55457
55456
  onPointerUp: () => {
55458
55457
  if (P || !he) return;
@@ -55719,7 +55718,7 @@ var sCe = /*#__PURE__*/ z.forwardRef(function(e, t) {
55719
55718
  t = {
55720
55719
  ...t,
55721
55720
  ...e
55722
- }, !(!this.getNotifications().some((e) => e.id === n) && t.type === "progress") && this.#t(t, { id: n });
55721
+ }, (this.getNotifications().some((e) => e.id === n) || t.type !== "progress") && this.#t(t, { id: n });
55723
55722
  },
55724
55723
  dismiss: () => this.dismissNotification(n)
55725
55724
  };
@@ -56525,7 +56524,7 @@ function UCe({ isOpen: e, modal: t, nested: n, hasBeenOpened: r, preventScrollRe
56525
56524
  typeof document > "u" || document.querySelector("[data-vaul-drawer]") || u();
56526
56525
  };
56527
56526
  }, [t, u]), z.useEffect(() => {
56528
- n || !r || (e ? (!window.matchMedia("(display-mode: standalone)").matches && l(), t || window.setTimeout(() => {
56527
+ !n && r && (e ? (!window.matchMedia("(display-mode: standalone)").matches && l(), t || window.setTimeout(() => {
56529
56528
  u();
56530
56529
  }, 500)) : u());
56531
56530
  }, [
@@ -56576,7 +56575,7 @@ function f7({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: i, sn
56576
56575
  return (window.innerWidth - s7) / window.innerWidth;
56577
56576
  }
56578
56577
  function Ce(e) {
56579
- !u && !a || fe.current && !fe.current.contains(e.target) || (pe.current = fe.current?.getBoundingClientRect().height || 0, me.current = fe.current?.getBoundingClientRect().width || 0, ee(!0), ie.current = /* @__PURE__ */ new Date(), B5() && window.addEventListener("touchend", () => se.current = !1, { once: !0 }), e.target.setPointerCapture(e.pointerId), le.current = e7(b) ? e.pageY : e.pageX);
56578
+ (u || a) && (!fe.current || fe.current.contains(e.target)) && (pe.current = fe.current?.getBoundingClientRect().height || 0, me.current = fe.current?.getBoundingClientRect().width || 0, ee(!0), ie.current = /* @__PURE__ */ new Date(), B5() && window.addEventListener("touchend", () => se.current = !1, { once: !0 }), e.target.setPointerCapture(e.pointerId), le.current = e7(b) ? e.pageY : e.pageX);
56580
56579
  }
56581
56580
  function we(e, t) {
56582
56581
  let n = e, r = window.getSelection()?.toString(), i = fe.current ? t7(fe.current, b) : null, a = /* @__PURE__ */ new Date();
@@ -56684,7 +56683,7 @@ function f7({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: i, sn
56684
56683
  }, !0);
56685
56684
  }
56686
56685
  function De() {
56687
- !N || !fe.current || (fe.current.classList.remove(c7), se.current = !1, ee(!1), ae.current = /* @__PURE__ */ new Date());
56686
+ N && fe.current && (fe.current.classList.remove(c7), se.current = !1, ee(!1), ae.current = /* @__PURE__ */ new Date());
56688
56687
  }
56689
56688
  function Oe(e) {
56690
56689
  if (!N || !fe.current) return;
@@ -56756,7 +56755,7 @@ function f7({ open: e, onOpenChange: t, children: n, onDrag: r, onRelease: i, sn
56756
56755
  }, [g]), /*#__PURE__*/ z.createElement(aJ, {
56757
56756
  defaultOpen: x,
56758
56757
  onOpenChange: (e) => {
56759
- !u && !e || (e ? M(!0) : B(!0), A(e));
56758
+ (u || e) && (e ? M(!0) : B(!0), A(e));
56760
56759
  },
56761
56760
  open: k
56762
56761
  }, /*#__PURE__*/ z.createElement(L5.Provider, { value: {
@@ -59425,7 +59424,7 @@ var NTe = ({ lang: e, monthlyProcessedImages: t = 1e3, items: n, partnerCard: r,
59425
59424
  localizedPrice: a,
59426
59425
  localizedCurrency: r,
59427
59426
  pricePerImage: Ne(() => {
59428
- if (!(!r || !a)) return Dh({
59427
+ if (r && a) return Dh({
59429
59428
  locale: e,
59430
59429
  currency: r,
59431
59430
  value: a / 100
@@ -62685,8 +62684,7 @@ var TDe = /* @__PURE__ */ _t(((e) => {
62685
62684
  e.enable("");
62686
62685
  }
62687
62686
  function s(t) {
62688
- var n, r;
62689
- for (n = 0, r = e.skips.length; n < r; n++) if (e.skips[n].test(t)) return !1;
62687
+ for (var n = 0, r = e.skips.length; n < r; n++) if (e.skips[n].test(t)) return !1;
62690
62688
  for (n = 0, r = e.names.length; n < r; n++) if (e.names[n].test(t)) return !0;
62691
62689
  return !1;
62692
62690
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photoroom/ui",
3
- "version": "0.1.618",
3
+ "version": "0.1.620",
4
4
  "private": false,
5
5
  "description": "Photoroom design system components",
6
6
  "sideEffects": [