@cntrl-site/components 1.0.33-alpha.1 → 1.0.33-alpha.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.mjs CHANGED
@@ -3612,8 +3612,8 @@ const Tu = ({ settings: e, content: t, styles: n, portalId: i, activeEvent: o, i
3612
3612
  }, [e, B, C, n]);
3613
3613
  const Te = (N.type === "scale" || N.type === "fade") && N.direction === "vert" && ie.type === "drag";
3614
3614
  Ne(() => {
3615
- var $e, Ze;
3616
- if (!e || !Te || !((Ze = ($e = f.current) == null ? void 0 : $e.splide) != null && Ze.root)) return;
3615
+ var $e, Je;
3616
+ if (!e || !Te || !((Je = ($e = f.current) == null ? void 0 : $e.splide) != null && Je.root)) return;
3617
3617
  const F = f.current.splide.root, ee = 30, P = (se, We) => {
3618
3618
  if (W.current) {
3619
3619
  const De = Math.abs(se - W.current.x), Ve = Math.abs(We - W.current.y);
@@ -3881,7 +3881,7 @@ const Tu = ({ settings: e, content: t, styles: n, portalId: i, activeEvent: o, i
3881
3881
  justifyContent: H ? "flex-start" : V()
3882
3882
  },
3883
3883
  children: n.map((ae, ne) => {
3884
- const be = ne === C, _e = L[ne], $e = ue.grid.size * (be ? ue.activeState.scale : 1), Ze = () => {
3884
+ const be = ne === C, _e = L[ne], $e = ue.grid.size * (be ? ue.activeState.scale : 1), Je = () => {
3885
3885
  if (ue.fit !== "fit") return {};
3886
3886
  if (!_e)
3887
3887
  return N.direction === "horiz" ? { height: O($e, r) } : { width: O($e, r) };
@@ -3908,7 +3908,7 @@ const Tu = ({ settings: e, content: t, styles: n, portalId: i, activeEvent: o, i
3908
3908
  ...N.direction === "horiz" && ue.fit !== "fit" ? { height: O($e, r) } : {},
3909
3909
  ...N.direction === "vert" && ue.fit !== "fit" ? { width: O($e, r) } : {},
3910
3910
  ...ue.fit === "cover" ? { width: O($e, r), height: O($e, r) } : {},
3911
- ...Ze(),
3911
+ ...Je(),
3912
3912
  transition: be ? "all 0.25s ease-out" : "none",
3913
3913
  opacity: be ? ue.activeState.opacity / 100 : ue.opacity / 100,
3914
3914
  "--thumb-hover": ue.activeState.opacity / 100
@@ -5294,7 +5294,7 @@ function Pu({ settings: e, isEditor: t, isEditMode: n, isPreviewMode: i, metadat
5294
5294
  wordSpacing: pe ?? 0,
5295
5295
  textAppearance: we,
5296
5296
  color: M
5297
- }, $e = Zt(Ot(Ie, t)), Ze = O(C ?? 0, t), se = {
5297
+ }, $e = Zt(Ot(Ie, t)), Je = O(C ?? 0, t), se = {
5298
5298
  fontSettings: {
5299
5299
  fontFamily: X,
5300
5300
  fontWeight: (ve == null ? void 0 : ve.fontWeight) ?? 400,
@@ -5439,7 +5439,7 @@ function Pu({ settings: e, isEditor: t, isEditMode: n, isPreviewMode: i, metadat
5439
5439
  style: {
5440
5440
  borderStyle: "solid",
5441
5441
  borderRadius: O(y ?? 0, t),
5442
- borderWidth: Ze,
5442
+ borderWidth: Je,
5443
5443
  paddingTop: O((w == null ? void 0 : w.top) ?? 0, t),
5444
5444
  paddingRight: O((w == null ? void 0 : w.right) ?? 0, t),
5445
5445
  paddingBottom: O((w == null ? void 0 : w.bottom) ?? 0, t),
@@ -7076,7 +7076,7 @@ const Hu = ({ settings: e, isEditor: t, isPreviewMode: n, metadata: i, activeEve
7076
7076
  borderRadius: O(X, t),
7077
7077
  borderWidth: O(W, t),
7078
7078
  borderStyle: "solid"
7079
- }, $e = { borderLeftWidth: O(W, t) }, Ze = async (se) => {
7079
+ }, $e = { borderLeftWidth: O(W, t) }, Je = async (se) => {
7080
7080
  if (se.preventDefault(), !r) return;
7081
7081
  const We = Object.fromEntries(
7082
7082
  ie.map((Ve) => {
@@ -7115,7 +7115,7 @@ const Hu = ({ settings: e, isEditor: t, isPreviewMode: n, metadata: i, activeEve
7115
7115
  /* @__PURE__ */ G(
7116
7116
  "form",
7117
7117
  {
7118
- onSubmit: Ze,
7118
+ onSubmit: Je,
7119
7119
  className: `${a}-form`,
7120
7120
  style: {
7121
7121
  ...Ie,
@@ -9757,12 +9757,12 @@ const rp = 30, Oa = 2, ap = ({ settings: e, content: t, isEditor: n, isPreviewMo
9757
9757
  if (!P || !j) return;
9758
9758
  let V = 0;
9759
9759
  const ae = () => {
9760
- const _e = P.getBoundingClientRect().width, Ie = j.getBoundingClientRect().width, $e = we.current, Ze = typeof $e == "number" && Math.abs($e - Ie) <= 0.25;
9760
+ const _e = P.getBoundingClientRect().width, Ie = j.getBoundingClientRect().width, $e = we.current, Je = typeof $e == "number" && Math.abs($e - Ie) <= 0.25;
9761
9761
  if (we.current = Ie, he(_e), typeof Ie == "number" && Ie > 0 && X <= 0) {
9762
9762
  W(Ie);
9763
9763
  return;
9764
9764
  }
9765
- Ze && Ie !== X ? W(Ie) : !Ze && X <= 0 && (cancelAnimationFrame(V), V = requestAnimationFrame(ae));
9765
+ Je && Ie !== X ? W(Ie) : !Je && X <= 0 && (cancelAnimationFrame(V), V = requestAnimationFrame(ae));
9766
9766
  }, ne = () => {
9767
9767
  cancelAnimationFrame(V), V = requestAnimationFrame(ae);
9768
9768
  };
@@ -13453,7 +13453,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13453
13453
  titleColor: I,
13454
13454
  subtitleColor: L,
13455
13455
  lightboxCounterColor: J
13456
- }, Mp, _p), Ie = `${r && r !== "default" ? `${s}-state-${r}` : ""}${Z === "on hover" && (!n || i) ? ` ${s}-show-text-hover` : ""}`.trim(), $e = $ === 0 ? 1 / 0 : $, Ze = (t ?? []).slice(0, $e), se = u.entryWidth ?? 0.2, We = (y == null ? void 0 : y.display) === "cover", De = (y == null ? void 0 : y.ratioValue) ?? "1:1", Ve = (y == null ? void 0 : y.reversed) ?? !1, [ft, $t] = De.split(":").map(Number), It = `${Ve ? $t : ft} / ${Ve ? ft : $t}`, jt = O(se ?? 0, n), _t = !We && w !== "off", tt = {
13456
+ }, Mp, _p), Ie = `${r && r !== "default" ? `${s}-state-${r}` : ""}${Z === "on hover" && (!n || i) ? ` ${s}-show-text-hover` : ""}`.trim(), $e = $ === 0 ? 1 / 0 : $, Je = (t ?? []).slice(0, $e), se = u.entryWidth ?? 0.2, We = (y == null ? void 0 : y.display) === "cover", De = (y == null ? void 0 : y.ratioValue) ?? "1:1", Ve = (y == null ? void 0 : y.reversed) ?? !1, [ft, $t] = De.split(":").map(Number), It = `${Ve ? $t : ft} / ${Ve ? ft : $t}`, jt = O(se ?? 0, n), _t = !We && w !== "off", tt = {
13457
13457
  width: jt,
13458
13458
  ...We ? { aspectRatio: It, height: "auto", overflow: "hidden" } : { height: "auto" }
13459
13459
  }, He = `${s}-item-image-wrapper${_t ? ` ${s}-item-image-wrapper-fit-slider` : ""}`.trim(), Ue = p === "d" || p === "e" || p === "f", nt = fe === "on", je = `calc(${O(se ?? 0, n)} * (${v} / 100))`, yt = O(se * v / 100, n), Wt = We ? {
@@ -13470,24 +13470,24 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13470
13470
  maxWidth: "100%"
13471
13471
  }, [rt, Bt] = de("ltr"), [Kt, Ke] = de(0), xt = ce(null);
13472
13472
  Ne(() => {
13473
- const Je = xt.current;
13474
- if (!Je) return;
13473
+ const Ze = xt.current;
13474
+ if (!Ze) return;
13475
13475
  const St = new ResizeObserver((Ct) => {
13476
13476
  Ke(Math.round(Ct[0].contentRect.width));
13477
13477
  });
13478
- return St.observe(Je), () => St.disconnect();
13478
+ return St.observe(Ze), () => St.disconnect();
13479
13479
  }, []);
13480
13480
  const ct = (() => {
13481
- const Je = { ...ne }, St = xt.current ? getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim() : "";
13482
- return St && (Je["--cntrl-article-width"] = St), Je;
13483
- })(), [ot, ut] = de(!1), [pt, hn] = de([]), [Pn, fn] = de(0), dt = m === "on" && (!n || i), dn = (Je, St) => {
13484
- n && !i || m !== "off" && (hn(Je), fn(St), ut(!0));
13481
+ const Ze = { ...ne }, St = xt.current ? getComputedStyle(xt.current).getPropertyValue("--cntrl-article-width").trim() : "";
13482
+ return St && (Ze["--cntrl-article-width"] = St), Ze;
13483
+ })(), [ot, ut] = de(!1), [pt, hn] = de([]), [Pn, fn] = de(0), dt = m === "on" && (!n || i), dn = (Ze, St) => {
13484
+ n && !i || m !== "off" && (hn(Ze), fn(St), ut(!0));
13485
13485
  };
13486
13486
  Ne(() => {
13487
13487
  if (!ot || m !== "on" || typeof document > "u") return;
13488
- const Je = document.body.style.overflow;
13488
+ const Ze = document.body.style.overflow;
13489
13489
  return document.body.style.overflow = "hidden", () => {
13490
- document.body.style.overflow = Je;
13490
+ document.body.style.overflow = Ze;
13491
13491
  };
13492
13492
  }, [ot, m]), Ne(() => {
13493
13493
  !n || i || ut(!1);
@@ -13507,10 +13507,10 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13507
13507
  width: O(u.wrapperWidth ?? 0, n),
13508
13508
  ...nt ? { [`--${s}-align-entries-row-gap`]: O(x ?? 0, n) } : {}
13509
13509
  },
13510
- children: Ze.map((Je, St) => {
13510
+ children: Je.map((Ze, St) => {
13511
13511
  var Nt;
13512
- const Ct = Da(Je.title), me = Da(Je.subtitle), Pe = (((Nt = Je.link) == null ? void 0 : Nt.length) ?? 0) > 0 && m === "off" ? Je.link : void 0, Oe = Math.floor(St / u.columnsCount) === Math.ceil(Ze.length / u.columnsCount) - 1, ze = Ue ? /* @__PURE__ */ G("div", { className: `${s}-item-text-block`, children: [
13513
- Ct && /* @__PURE__ */ l("p", { className: ee, style: { width: je, ...ye, ...j }, children: Je.title }),
13512
+ const Ct = Da(Ze.title), me = Da(Ze.subtitle), Pe = (((Nt = Ze.link) == null ? void 0 : Nt.length) ?? 0) > 0 && m === "off" ? Ze.link : void 0, Oe = Math.floor(St / u.columnsCount) === Math.ceil(Je.length / u.columnsCount) - 1, ze = Ue ? /* @__PURE__ */ G("div", { className: `${s}-item-text-block`, children: [
13513
+ Ct && /* @__PURE__ */ l("p", { className: ee, style: { width: je, ...ye, ...j }, children: Ze.title }),
13514
13514
  Ct && /* @__PURE__ */ l(
13515
13515
  "div",
13516
13516
  {
@@ -13522,7 +13522,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13522
13522
  }
13523
13523
  }
13524
13524
  ),
13525
- me && /* @__PURE__ */ l("p", { className: P, style: { width: je, ...Te, ...V }, children: Je.subtitle }),
13525
+ me && /* @__PURE__ */ l("p", { className: P, style: { width: je, ...Te, ...V }, children: Ze.subtitle }),
13526
13526
  me && /* @__PURE__ */ l(
13527
13527
  "div",
13528
13528
  {
@@ -13546,7 +13546,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13546
13546
  }
13547
13547
  }
13548
13548
  ),
13549
- Ct && /* @__PURE__ */ l("p", { className: ee, style: { width: je, ...ye, ...j }, children: Je.title }),
13549
+ Ct && /* @__PURE__ */ l("p", { className: ee, style: { width: je, ...ye, ...j }, children: Ze.title }),
13550
13550
  Ue && Ct && /* @__PURE__ */ l(
13551
13551
  "div",
13552
13552
  {
@@ -13570,7 +13570,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13570
13570
  }
13571
13571
  }
13572
13572
  ),
13573
- me && /* @__PURE__ */ l("p", { className: P, style: { width: je, ...Te, ...V }, children: Je.subtitle }),
13573
+ me && /* @__PURE__ */ l("p", { className: P, style: { width: je, ...Te, ...V }, children: Ze.subtitle }),
13574
13574
  Ue && me && /* @__PURE__ */ l(
13575
13575
  "div",
13576
13576
  {
@@ -13588,7 +13588,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13588
13588
  ] }) : /* @__PURE__ */ G(Ye, { children: [
13589
13589
  st,
13590
13590
  Et
13591
- ] }), at = Tp(Je.gallery), Xe = at.filter((Qe) => Qe.lightboxMedia).map((Qe) => Qe.lightboxMedia), mt = /* @__PURE__ */ l("div", { className: He, style: tt, children: at.length === 0 ? null : w === "off" ? (() => {
13591
+ ] }), at = Tp(Ze.gallery), Xe = at.filter((Qe) => Qe.lightboxMedia).map((Qe) => Qe.lightboxMedia), mt = /* @__PURE__ */ l("div", { className: He, style: tt, children: at.length === 0 ? null : w === "off" ? (() => {
13592
13592
  const { displayMedia: Qe, lightboxMedia: lt } = at[0], Rt = lt ? Xe.findIndex((Pt) => Pt.url === lt.url) : -1;
13593
13593
  return /* @__PURE__ */ l(
13594
13594
  Va,
@@ -13660,7 +13660,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13660
13660
  {
13661
13661
  className: ee,
13662
13662
  style: { width: je, ...ye, ...j },
13663
- children: Je.title
13663
+ children: Ze.title
13664
13664
  }
13665
13665
  ),
13666
13666
  /* @__PURE__ */ l(
@@ -13679,7 +13679,7 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13679
13679
  {
13680
13680
  className: P,
13681
13681
  style: { width: je, ...Te, ...V },
13682
- children: Je.subtitle
13682
+ children: Ze.subtitle
13683
13683
  }
13684
13684
  )
13685
13685
  ] });
@@ -13725,8 +13725,8 @@ function kp({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
13725
13725
  index: Pn,
13726
13726
  imageDisplay: Ap(C),
13727
13727
  onClose: () => ut(!1),
13728
- onPrev: () => fn((Je) => (Je - 1 + pt.length) % pt.length),
13729
- onNext: () => fn((Je) => (Je + 1) % pt.length),
13728
+ onPrev: () => fn((Ze) => (Ze - 1 + pt.length) % pt.length),
13729
+ onNext: () => fn((Ze) => (Ze + 1) % pt.length),
13730
13730
  counterClassName: ae,
13731
13731
  counterStyle: F
13732
13732
  }
@@ -17496,15 +17496,15 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
17496
17496
  _e
17497
17497
  ),
17498
17498
  [Ie, u, ae, ne, be, _e]
17499
- ), Ze = Ni(e), se = Re(
17499
+ ), Je = Ni(e), se = Re(
17500
17500
  () => Qt.slice(0, u).map((me) => ae[me]),
17501
17501
  [u, ae]
17502
17502
  ), We = Re(
17503
- () => pa(u, Ze, ae),
17504
- [u, Ze, ae]
17503
+ () => pa(u, Je, ae),
17504
+ [u, Je, ae]
17505
17505
  ), De = Re(
17506
- () => _o(u, Ze, ae),
17507
- [u, Ze, ae]
17506
+ () => _o(u, Je, ae),
17507
+ [u, Je, ae]
17508
17508
  ), Ve = Re(
17509
17509
  () => $e.map((me, Pe) => ul(
17510
17510
  De[Pe] ?? 0,
@@ -17541,7 +17541,7 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
17541
17541
  Lt,
17542
17542
  y ?? 0,
17543
17543
  n ?? !1
17544
- ).borderTopWidth, Bt = ve != null ? `${ve}px` : `calc(${rt} + ${He(yt)})`, Kt = h ? "rowPaddingTopB" : "rowPaddingTop", Ke = $e[0], xt = $e[$e.length - 1], ct = Ve[0], ot = Ve[Ve.length - 1], ut = Ke && ct ? Math.max(ct.paddingLeft, mi) : 0, pt = xt && ot ? Math.max(ot.paddingRight, mi) : 0, hn = Ze, Pn = (me) => {
17544
+ ).borderTopWidth, Bt = ve != null ? `${ve}px` : `calc(${rt} + ${He(yt)})`, Kt = h ? "rowPaddingTopB" : "rowPaddingTop", Ke = $e[0], xt = $e[$e.length - 1], ct = Ve[0], ot = Ve[Ve.length - 1], ut = Ke && ct ? Math.max(ct.paddingLeft, mi) : 0, pt = xt && ot ? Math.max(ot.paddingRight, mi) : 0, hn = Je, Pn = (me) => {
17545
17545
  const Pe = pe.current;
17546
17546
  if (!Pe)
17547
17547
  return { x: 0, y: 0 };
@@ -17575,7 +17575,7 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
17575
17575
  ie(null);
17576
17576
  }, tn = (me) => {
17577
17577
  F && ja(me, s), N && ie(null);
17578
- }, Je = (me) => {
17578
+ }, Ze = (me) => {
17579
17579
  F && Ka(me, s);
17580
17580
  };
17581
17581
  kt(() => {
@@ -17913,7 +17913,7 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
17913
17913
  areaStyle: {
17914
17914
  position: "absolute",
17915
17915
  top: 0,
17916
- left: He(Math.max(ye, Ze - ye)),
17916
+ left: He(Math.max(ye, Je - ye)),
17917
17917
  width: He(ye),
17918
17918
  height: "100%"
17919
17919
  }
@@ -18089,7 +18089,7 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
18089
18089
  Pe,
18090
18090
  We,
18091
18091
  se,
18092
- Ze
18092
+ Je
18093
18093
  ), st = We.slice(0, Pe + 1).reduce((Et, Ae) => Et + Ae, 0) - Qa / 2;
18094
18094
  return /* @__PURE__ */ l("div", { style: { position: "absolute", inset: 0, pointerEvents: "none" }, children: /* @__PURE__ */ l(
18095
18095
  "div",
@@ -18131,7 +18131,7 @@ function wm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
18131
18131
  },
18132
18132
  onClick: _t ? tt : void 0,
18133
18133
  onMouseEnter: F || N ? tn : void 0,
18134
- onMouseLeave: F ? Je : void 0,
18134
+ onMouseLeave: F ? Ze : void 0,
18135
18135
  children: /* @__PURE__ */ l(
18136
18136
  "div",
18137
18137
  {
@@ -22262,7 +22262,7 @@ function qm({ settings: e, content: t, isEditor: n, isPreviewMode: i, isEditMode
22262
22262
  }, [$]), Ne(() => {
22263
22263
  n && !o && !i && U(/* @__PURE__ */ new Set());
22264
22264
  }, [n, o, i]);
22265
- const B = (He) => O(He, n ?? !1), ye = Math.max(N, Rn), re = Math.max(ue, Rn), Le = Math.max(h, Rn), Te = Math.max(pe, Rn), Se = Math.max(we, Rn), ke = Math.max(ve, Rn), F = Math.max(Fe, Rn), ee = Math.max(0, (s ?? 1) - C - y), P = Math.max(0, (s ?? 1) - we), j = Math.max(0, (s ?? 1) - pe), V = Math.max(C, Rn), ae = Math.max(0, (s ?? 1) - N - y), ne = Re(() => fe.size === 0 ? 0 : Math.min(...fe), [fe]), be = Ee((He) => fe.has(He), [fe]), _e = D && x === "default" ? `${r}-entry-hover-default` : "", Ie = m ?? "", $e = Ie !== "", Ze = w.replace(/^rotate /, ""), se = `${r}-icon-anim-${Ze}`, We = Zt(Ot(
22265
+ const B = (He) => O(He, n ?? !1), ye = Math.max(N, Rn), re = Math.max(ue, Rn), Le = Math.max(h, Rn), Te = Math.max(pe, Rn), Se = Math.max(we, Rn), ke = Math.max(ve, Rn), F = Math.max(Fe, Rn), ee = Math.max(0, (s ?? 1) - C - y), P = Math.max(0, (s ?? 1) - we), j = Math.max(0, (s ?? 1) - pe), V = Math.max(C, Rn), ae = Math.max(0, (s ?? 1) - N - y), ne = Re(() => fe.size === 0 ? 0 : Math.min(...fe), [fe]), be = Ee((He) => fe.has(He), [fe]), _e = D && x === "default" ? `${r}-entry-hover-default` : "", Ie = m ?? "", $e = Ie !== "", Je = w.replace(/^rotate /, ""), se = `${r}-icon-anim-${Je}`, We = Zt(Ot(
22266
22266
  ss(
22267
22267
  f,
22268
22268
  M,
@@ -24283,7 +24283,7 @@ const ls = {
24283
24283
  ]), $e = Ee(
24284
24284
  (c) => O(c, i ?? !1),
24285
24285
  [i]
24286
- ), Ze = $e(M ?? 0), se = Re(
24286
+ ), Je = $e(M ?? 0), se = Re(
24287
24287
  () => ({
24288
24288
  title1MarginLeft: L,
24289
24289
  title2MarginLeft: J,
@@ -24486,7 +24486,7 @@ const ls = {
24486
24486
  }), Bt = ce(null), Kt = ce(null), Ke = ce(0), xt = ce("forward"), ct = ce(0), ot = ce(null), ut = ce(!1), pt = t.length > 1 && (!o || !!a), hn = pt ? 3 : 1, Pn = Re(
24487
24487
  () => Array.from({ length: hn }, () => t).flat(),
24488
24488
  [t, hn]
24489
- ), [fn, dt] = de(!1), [dn, tn] = de(!1), [Je, St] = de(!0), Ct = ce(null), me = ce(null), Pe = ce(!1), Oe = ce(!1), ze = ce(null), st = ce(null), Et = ye && !Je, Ae = Ee(() => {
24489
+ ), [fn, dt] = de(!1), [dn, tn] = de(!1), [Ze, St] = de(!0), Ct = ce(null), me = ce(null), Pe = ce(!1), Oe = ce(!1), ze = ce(null), st = ce(null), Et = ye && !Ze, Ae = Ee(() => {
24490
24490
  ye && (St(!0), st.current && clearTimeout(st.current), st.current = setTimeout(() => {
24491
24491
  rt.current.isActive || St(!1);
24492
24492
  }, og));
@@ -24581,7 +24581,7 @@ const ls = {
24581
24581
  "data-controls-reverse": o ? "" : void 0,
24582
24582
  className: o ? `${e}-control` : void 0,
24583
24583
  style: {
24584
- height: Ze,
24584
+ height: Je,
24585
24585
  width: "100%",
24586
24586
  flexShrink: 0,
24587
24587
  pointerEvents: o ? "auto" : "none"
@@ -27006,7 +27006,7 @@ const Eg = yg(), Pg = {
27006
27006
  closeIconHoverColor: te,
27007
27007
  contentMarginTop: he = 0,
27008
27008
  iconMarginRight: X = 0
27009
- } = n, W = Ee((k) => O(k, i ?? !1), [i]), Q = W(m ?? 0), z = `${y}%`, H = `${C}%`, Y = W(f), oe = W(he), ie = W(X), N = Io("title1", Lo(n, "title1"), i), ue = Io("title2", Lo(n, "title2"), i), h = Io("title3", Lo(n, "title3"), i), pe = Io("count", Lo(n, "count"), i), we = J === "mobile", ve = !i || !!a, Fe = !o && (!i || !!a), Z = Re(() => Fo(t, v), [t, v]), [fe, U] = de(r), D = Z[fe], B = D == null ? void 0 : D.entry, [ye, re] = de(!1), [Le, Te] = de(null), [Se, ke] = de(!1), [F, ee] = de(null), [P, j] = de(!1), [V, ae] = de(0), [ne, be] = de(), [_e, Ie] = de(), [$e, Ze] = de(null), se = ce(null), We = ce(0), De = ce(0), Ve = ce(0), ft = ce(!1), $t = ce(null), Ft = ce(null), Lt = ce(null), It = ce(null), jt = ce(null), _t = ce(null), tt = ce(null), He = Ee(() => {
27009
+ } = n, W = Ee((k) => O(k, i ?? !1), [i]), Q = W(m ?? 0), z = `${y}%`, H = `${C}%`, Y = W(f), oe = W(he), ie = W(X), N = Io("title1", Lo(n, "title1"), i), ue = Io("title2", Lo(n, "title2"), i), h = Io("title3", Lo(n, "title3"), i), pe = Io("count", Lo(n, "count"), i), we = J === "mobile", ve = !i || !!a, Fe = !o && (!i || !!a), Z = Re(() => Fo(t, v), [t, v]), [fe, U] = de(r), D = Z[fe], B = D == null ? void 0 : D.entry, [ye, re] = de(!1), [Le, Te] = de(null), [Se, ke] = de(!1), [F, ee] = de(null), [P, j] = de(!1), [V, ae] = de(0), [ne, be] = de(), [_e, Ie] = de(), [$e, Je] = de(null), se = ce(null), We = ce(0), De = ce(0), Ve = ce(0), ft = ce(!1), $t = ce(null), Ft = ce(null), Lt = ce(null), It = ce(null), jt = ce(null), _t = ce(null), tt = ce(null), He = Ee(() => {
27010
27010
  const k = Ft.current;
27011
27011
  if (!k) return;
27012
27012
  const ge = k.closest(`.${e}-lightbox-content-area`);
@@ -27047,7 +27047,7 @@ const Eg = yg(), Pg = {
27047
27047
  const b = We.current, q = w === "fade" && ys(c == null ? void 0 : c.entry) !== ys(g == null ? void 0 : g.entry), le = ot(Lt.current), Ce = q ? (() => {
27048
27048
  const et = He();
27049
27049
  Sl(() => {
27050
- Ze(g.entry);
27050
+ Je(g.entry);
27051
27051
  }), Lt.current && et && (Lt.current.style.width = `${et}px`);
27052
27052
  const Ht = ot(Lt.current);
27053
27053
  return Lt.current && (Lt.current.style.width = ""), { measuredIncomingTitlesHeight: Ht, incomingTitlesMeasureWidth: et };
@@ -27056,8 +27056,8 @@ const Eg = yg(), Pg = {
27056
27056
  (Ce == null ? void 0 : Ce.measuredIncomingTitlesHeight) ?? 0
27057
27057
  ) || void 0;
27058
27058
  ae(b), ee(fe), j(!0), U(ge), ct(ge), Ve.current = ge, q ? (Ue(), Be && be(Be), Ce != null && Ce.incomingTitlesMeasureWidth && Ie(Ce.incomingTitlesMeasureWidth), Te((c == null ? void 0 : c.entryIndex) ?? null), ke(!0), De.current = g.entryIndex, se.current = setTimeout(() => {
27059
- Te(null), ke(!1), be(void 0), Ie(void 0), Ze(null), se.current = null;
27060
- }, 400)) : (Ue(), Te(null), ke(!1), be(void 0), Ie(void 0), Ze(null), De.current = g.entryIndex);
27059
+ Te(null), ke(!1), be(void 0), Ie(void 0), Je(null), se.current = null;
27060
+ }, 400)) : (Ue(), Te(null), ke(!1), be(void 0), Ie(void 0), Je(null), De.current = g.entryIndex);
27061
27061
  }, [fe, Ue, He, ot, Z, ct, w]), pt = Ee(() => {
27062
27062
  tt.current = null;
27063
27063
  }, []), hn = Ee((k) => {
@@ -27129,7 +27129,7 @@ const Eg = yg(), Pg = {
27129
27129
  };
27130
27130
  return window.addEventListener("keydown", k), () => window.removeEventListener("keydown", k);
27131
27131
  }, [ut, je, fe, Z.length]), kt(() => {
27132
- Ue(), We.current = 0, ae(0), ee(null), j(!1), Te(null), ke(!1), be(void 0), Ie(void 0), Ze(null), U((k) => {
27132
+ Ue(), We.current = 0, ae(0), ee(null), j(!1), Te(null), ke(!1), be(void 0), Ie(void 0), Je(null), U((k) => {
27133
27133
  const ge = Math.max(0, Z.length - 1);
27134
27134
  return Math.min(k, ge);
27135
27135
  });
@@ -27138,7 +27138,7 @@ const Eg = yg(), Pg = {
27138
27138
  const k = Math.max(0, Z.length - 1), ge = Math.min(Math.max(0, r), k);
27139
27139
  Ve.current = ge, De.current = ((c = Z[ge]) == null ? void 0 : c.entryIndex) ?? 0, U(ge);
27140
27140
  }, [r]);
27141
- const dt = Le !== null ? t[Le] : null, dn = F !== null ? Z[F] : null, tn = (B == null ? void 0 : B.title1) || (B == null ? void 0 : B.title2) || (B == null ? void 0 : B.title3) || (dt == null ? void 0 : dt.title1) || (dt == null ? void 0 : dt.title2) || (dt == null ? void 0 : dt.title3), Je = Og(v, Z, t), St = M !== null, Ct = tn || Je || St, me = Je && St ? { gap: Y } : void 0, Pe = `${e}-titles-stack${we ? ` ${e}-titles-stack-stacked` : ""}`, Oe = `${e}-titles-layer-out${we ? ` ${e}-titles-layer-out-stacked` : ""}`, ze = `${e}-titles-layer-out`, st = (E ?? 0) > 0 || o, Et = W(L), Ae = Re(
27141
+ const dt = Le !== null ? t[Le] : null, dn = F !== null ? Z[F] : null, tn = (B == null ? void 0 : B.title1) || (B == null ? void 0 : B.title2) || (B == null ? void 0 : B.title3) || (dt == null ? void 0 : dt.title1) || (dt == null ? void 0 : dt.title2) || (dt == null ? void 0 : dt.title3), Ze = Og(v, Z, t), St = M !== null, Ct = tn || Ze || St, me = Ze && St ? { gap: Y } : void 0, Pe = `${e}-titles-stack${we ? ` ${e}-titles-stack-stacked` : ""}`, Oe = `${e}-titles-layer-out${we ? ` ${e}-titles-layer-out-stacked` : ""}`, ze = `${e}-titles-layer-out`, st = (E ?? 0) > 0 || o, Et = W(L), Ae = Re(
27142
27142
  () => ({
27143
27143
  title1Width: S ?? Er.title1Width,
27144
27144
  title2Width: T ?? Er.title2Width,
@@ -27341,7 +27341,7 @@ const Eg = yg(), Pg = {
27341
27341
  "aria-atomic": "true",
27342
27342
  children: Hg(Z, fe, v, t)
27343
27343
  }
27344
- ), oi = () => Je ? o && St ? /* @__PURE__ */ G("div", { className: `${e}-text-bar-cell`, style: { flexShrink: 0 }, children: [
27344
+ ), oi = () => Ze ? o && St ? /* @__PURE__ */ G("div", { className: `${e}-text-bar-cell`, style: { flexShrink: 0 }, children: [
27345
27345
  Mn(),
27346
27346
  /* @__PURE__ */ l(
27347
27347
  "div",
@@ -27360,7 +27360,7 @@ const Eg = yg(), Pg = {
27360
27360
  }
27361
27361
  }
27362
27362
  )
27363
- ] }) : Mn() : null, ri = () => !Je && !St ? null : /* @__PURE__ */ G(
27363
+ ] }) : Mn() : null, ri = () => !Ze && !St ? null : /* @__PURE__ */ G(
27364
27364
  "div",
27365
27365
  {
27366
27366
  className: `${e}-titles-row-header-controls`,
@@ -27379,7 +27379,7 @@ const Eg = yg(), Pg = {
27379
27379
  position: "relative"
27380
27380
  },
27381
27381
  children: [
27382
- Je || tn ? Xt() : null,
27382
+ Ze || tn ? Xt() : null,
27383
27383
  st ? vn("single-row") : null,
27384
27384
  on(B),
27385
27385
  /* @__PURE__ */ l("div", { style: { flex: 1, minWidth: 0 }, "aria-hidden": "true" }),
@@ -27393,7 +27393,7 @@ const Eg = yg(), Pg = {
27393
27393
  className: `${e}-titles-row ${e}-titles-row-header`,
27394
27394
  style: { width: "100%", position: "relative" },
27395
27395
  children: [
27396
- Je || tn ? Xt() : null,
27396
+ Ze || tn ? Xt() : null,
27397
27397
  st ? vn("single-row") : null,
27398
27398
  /* @__PURE__ */ G(
27399
27399
  "div",
@@ -27498,7 +27498,7 @@ const Eg = yg(), Pg = {
27498
27498
  {
27499
27499
  className: `${e}-titles-row-top`,
27500
27500
  children: [
27501
- Je || tn ? Xt() : null,
27501
+ Ze || tn ? Xt() : null,
27502
27502
  st ? vn("two-row") : null,
27503
27503
  ge !== void 0 ? /* @__PURE__ */ l(
27504
27504
  "div",
@@ -30037,9 +30037,15 @@ function ah(e) {
30037
30037
  function sh(e) {
30038
30038
  return e === "blur" ? rh : e === "greyscale" ? oh : 0;
30039
30039
  }
30040
- function _i(e, t = 1) {
30041
- const n = sh(e) * Math.max(0, Math.min(1, t));
30042
- return e === "greyscale" ? `grayscale(${n}%)` : e === "blur" ? `blur(${n / 4}px)` : "none";
30040
+ function _i(e, t = 1, n = 1) {
30041
+ const i = sh(e) * Math.max(0, Math.min(1, t));
30042
+ if (e === "greyscale")
30043
+ return `grayscale(${i}%)`;
30044
+ if (e === "blur") {
30045
+ const o = i / 4;
30046
+ return o <= 0 ? "none" : `blur(${o / Math.max(n, 1)}px)`;
30047
+ }
30048
+ return "none";
30043
30049
  }
30044
30050
  function bs(e) {
30045
30051
  return e <= 1 ? { backgroundIndex: 0, activeIndex: 0 } : { backgroundIndex: 0, activeIndex: 1 };
@@ -30118,8 +30124,8 @@ function ph({ settings: e, content: t, isEditor: n, isPreviewMode: i }) {
30118
30124
  }).filter((be) => !!be);
30119
30125
  uh(ne, (be, _e) => {
30120
30126
  Q((Ie) => {
30121
- var $e, Ze;
30122
- return (($e = Ie[be]) == null ? void 0 : $e.width) === _e.width && ((Ze = Ie[be]) == null ? void 0 : Ze.height) === _e.height ? Ie : { ...Ie, [be]: _e };
30127
+ var $e, Je;
30128
+ return (($e = Ie[be]) == null ? void 0 : $e.width) === _e.width && ((Je = Ie[be]) == null ? void 0 : Je.height) === _e.height ? Ie : { ...Ie, [be]: _e };
30123
30129
  });
30124
30130
  });
30125
30131
  }, [t]), Ne(() => {
@@ -30131,10 +30137,10 @@ function ph({ settings: e, content: t, isEditor: n, isPreviewMode: i }) {
30131
30137
  const Fe = Ee((ne) => {
30132
30138
  var se, We, De, Ve;
30133
30139
  if (!ie || w || v.length <= 1) return;
30134
- const be = ne === "next" ? ($ + 1) % v.length : ($ - 1 + v.length) % v.length, _e = ve((We = (se = v[$]) == null ? void 0 : se.image) == null ? void 0 : We.url), Ie = ve((Ve = (De = v[be]) == null ? void 0 : De.image) == null ? void 0 : Ve.url), $e = xs(z.width, z.height, _e), Ze = xs(z.width, z.height, Ie);
30135
- Y.current && clearTimeout(Y.current), X(ne), A(!0), S(!0), ne === "next" ? (_($), L(be), f(0), R(1), te(_i(u, 0))) : (C(lh(be, v.length)), _(be), L($), f(1), R(Ze), te(_i(u, 1))), requestAnimationFrame(() => {
30140
+ const be = ne === "next" ? ($ + 1) % v.length : ($ - 1 + v.length) % v.length, _e = ve((We = (se = v[$]) == null ? void 0 : se.image) == null ? void 0 : We.url), Ie = ve((Ve = (De = v[be]) == null ? void 0 : De.image) == null ? void 0 : Ve.url), $e = xs(z.width, z.height, _e), Je = xs(z.width, z.height, Ie);
30141
+ Y.current && clearTimeout(Y.current), X(ne), A(!0), S(!0), ne === "next" ? (_($), L(be), f(0), R(1), te(_i(u, 0, 1))) : (C(lh(be, v.length)), _(be), L($), f(1), R(Je), te(_i(u, 1, Je))), requestAnimationFrame(() => {
30136
30142
  A(!1), requestAnimationFrame(() => {
30137
- ne === "next" ? (f(1), R($e), te(_i(u, 1))) : (f(0), R(1), te(_i(u, 0)));
30143
+ ne === "next" ? (f(1), R($e), te(_i(u, 1, $e))) : (f(0), R(1), te(_i(u, 0, 1)));
30138
30144
  });
30139
30145
  }), Y.current = setTimeout(() => {
30140
30146
  ne === "next" && C($), m(be), _(null), L(null), S(!1);
@@ -30412,13 +30418,14 @@ function getEffectAmount(bgImage: ZoomSettings['bgImage']): number {
30412
30418
  return 0;
30413
30419
  }
30414
30420
 
30415
- function getBackgroundFilter(bgImage: ZoomSettings['bgImage'], progress = 1): string {
30421
+ function getBackgroundFilter(bgImage: ZoomSettings['bgImage'], progress = 1, scale = 1): string {
30416
30422
  const amount = getEffectAmount(bgImage) * Math.max(0, Math.min(1, progress));
30417
30423
  if (bgImage === 'greyscale') {
30418
30424
  return \`grayscale(\${amount}%)\`;
30419
30425
  }
30420
30426
  if (bgImage === 'blur') {
30421
- return \`blur(\${amount / 4}px)\`;
30427
+ const blurPx = amount / 4;
30428
+ return blurPx <= 0 ? 'none' : \`blur(\${blurPx / Math.max(scale, 1)}px)\`;
30422
30429
  }
30423
30430
  return 'none';
30424
30431
  }
@@ -30624,14 +30631,14 @@ export function Zoom({ settings, content, isEditor, isPreviewMode }: ZoomProps)
30624
30631
  setIncomingIndex(targetIndex);
30625
30632
  setIncomingScale(0);
30626
30633
  setOutgoingScale(1);
30627
- setOutgoingFilter(getBackgroundFilter(bgImage, 0));
30634
+ setOutgoingFilter(getBackgroundFilter(bgImage, 0, 1));
30628
30635
  } else {
30629
30636
  setBackgroundIndex(getPreviousBackgroundIndex(targetIndex, items.length));
30630
30637
  setOutgoingIndex(targetIndex);
30631
30638
  setIncomingIndex(activeIndex);
30632
30639
  setIncomingScale(1);
30633
30640
  setOutgoingScale(targetCoverScale);
30634
- setOutgoingFilter(getBackgroundFilter(bgImage, 1));
30641
+ setOutgoingFilter(getBackgroundFilter(bgImage, 1, targetCoverScale));
30635
30642
  }
30636
30643
 
30637
30644
  requestAnimationFrame(() => {
@@ -30640,11 +30647,11 @@ export function Zoom({ settings, content, isEditor, isPreviewMode }: ZoomProps)
30640
30647
  if (direction === 'next') {
30641
30648
  setIncomingScale(1);
30642
30649
  setOutgoingScale(activeCoverScale);
30643
- setOutgoingFilter(getBackgroundFilter(bgImage, 1));
30650
+ setOutgoingFilter(getBackgroundFilter(bgImage, 1, activeCoverScale));
30644
30651
  } else {
30645
30652
  setIncomingScale(0);
30646
30653
  setOutgoingScale(1);
30647
- setOutgoingFilter(getBackgroundFilter(bgImage, 0));
30654
+ setOutgoingFilter(getBackgroundFilter(bgImage, 0, 1));
30648
30655
  }
30649
30656
  });
30650
30657
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/components",
3
- "version": "1.0.33-alpha.1",
3
+ "version": "1.0.33-alpha.2",
4
4
  "description": "Custom components for control editor and public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",