@cntrl-site/components 1.0.102 → 1.0.104

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.
Files changed (50) hide show
  1. package/dist/ClickGallerie-D7g093HX.js +36 -0
  2. package/dist/{ClickGallerie-D_O1XhAO.mjs → ClickGallerie-QSOQjSdv.mjs} +92 -91
  3. package/dist/Components/ClickGallerie/ClickGallerie.d.ts +1 -0
  4. package/dist/Components/Scale/Scale.d.ts +2 -0
  5. package/dist/Components/helpers/LazyVideo/LazyVideo.d.ts +4 -0
  6. package/dist/Components/utils/index.d.ts +1 -0
  7. package/dist/Components/utils/useLazyVideos.d.ts +15 -0
  8. package/dist/Grid-B2_o1dvz.mjs +1576 -0
  9. package/dist/Grid-Bq6bk2AQ.js +374 -0
  10. package/dist/{Helix-2Vr-9WBa.js → Helix-B7rxlvKq.js} +2 -2
  11. package/dist/{Helix-BmkAKT1G.mjs → Helix-BrKQzGX5.mjs} +53 -53
  12. package/dist/{Hive-BGMWinrW.mjs → Hive-BusARSOi.mjs} +114 -111
  13. package/dist/Hive-Dh5nKPGm.js +321 -0
  14. package/dist/LazyVideo-Cn_vmMq8.js +1 -0
  15. package/dist/LazyVideo-D8eVYFyw.mjs +15 -0
  16. package/dist/Marquee-CdtAqhQE.mjs +563 -0
  17. package/dist/Marquee-DUN8wUax.js +133 -0
  18. package/dist/{Mercury-DuKJQ1Zo.mjs → Mercury-BRqlbk4i.mjs} +55 -54
  19. package/dist/Mercury-C-O2VGkK.js +267 -0
  20. package/dist/{PretextComponent-C3YFICy8.js → PretextComponent-D5P0AjnL.js} +1 -1
  21. package/dist/{PretextComponent-Ct0newmn.mjs → PretextComponent-s4DDfmzY.mjs} +25 -16
  22. package/dist/Scale-Bg3bGICG.js +114 -0
  23. package/dist/Scale-TnkWtRrs.mjs +409 -0
  24. package/dist/{Waterfall-A0FjM2my.mjs → Waterfall-DKuh4bnv.mjs} +299 -295
  25. package/dist/Waterfall-fdiHR0Rc.js +287 -0
  26. package/dist/{components-OE3ac1dr.js → components-DzNixU7Q.js} +1 -1
  27. package/dist/{components-w-jHX-2U.mjs → components-Yf9Zjska.mjs} +1 -1
  28. package/dist/elements.js +1 -1
  29. package/dist/elements.mjs +8 -8
  30. package/dist/elements.node.js +1 -1
  31. package/dist/elements.node.mjs +1 -1
  32. package/dist/index.js +1 -1
  33. package/dist/index.mjs +2 -2
  34. package/dist/sources.js +260 -72
  35. package/dist/sources.mjs +264 -76
  36. package/dist/useLazyVideos-BbgdvELi.js +1 -0
  37. package/dist/useLazyVideos-CZLyNolX.mjs +72 -0
  38. package/dist/utils.js +1 -1
  39. package/dist/utils.mjs +14 -12
  40. package/package.json +5 -3
  41. package/dist/ClickGallerie-M9xdGR1G.js +0 -36
  42. package/dist/Grid-CemGhf3F.js +0 -374
  43. package/dist/Grid-cfQsXW3b.mjs +0 -1553
  44. package/dist/Hive-BC6zQBsv.js +0 -321
  45. package/dist/Marquee-BYClHHws.mjs +0 -551
  46. package/dist/Marquee-vmHaTGIP.js +0 -133
  47. package/dist/Mercury-BwF_XW2w.js +0 -267
  48. package/dist/Scale-976sjO8e.js +0 -111
  49. package/dist/Scale-rLNT4KAk.mjs +0 -345
  50. package/dist/Waterfall-DnPDHbCL.js +0 -287
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("react/jsx-runtime"),l=require("react"),te=require("./useScopedStyles-Bf6yohVQ.js"),ne={sizeType:"custom",value:700,min:400,max:700};function z(o,a){return{widthPx:o,heightPx:o*a}}function q(o,a,i,s,t,h){return{x:Math.min(Math.max(o,t/2),i-t/2),y:Math.min(Math.max(a,h/2),s-h/2)}}function A(o,a,i,s){const{heightPx:t}=z(i,s);return q(o/2,a/2,o,a,i,t)}function Z(o,a,i){for(const s of i){const{heightPx:t}=z(s.widthPx,s.aspectRatio),h=s.widthPx/2,f=t/2;if(o>=s.x-h&&o<=s.x+h&&a>=s.y-f&&a<=s.y+f)return!0}return!1}function se(o,a,i,s,t,h,f,p){if(t==="system")return"none";const P=s.getBoundingClientRect(),R=document.elementFromPoint(P.left+o,P.top+a);return R&&R.closest("a")?"none":Z(o,a,i)||h==="area"?f??"none":p??"none"}function H(o,a,i){var p;const{sizeType:s,value:t,min:h,max:f}=a;return s==="custom"?t:s==="as is"?((p=i.get(o))==null?void 0:p.naturalWidth)??t:Math.round(Math.random()*(f-h)+h)}function re(o){return`
2
+ .${o}-root {
3
+ position: absolute;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100%;
7
+ height: 100%;
8
+ overflow: hidden;
9
+ }
10
+ .${o}-wrapper {
11
+ position: absolute;
12
+ transform: translate(-50%, -50%);
13
+ height: auto;
14
+ }
15
+ .${o}-image {
16
+ display: block;
17
+ width: 100%;
18
+ height: auto;
19
+ object-fit: cover;
20
+ position: relative;
21
+ user-select: none;
22
+ pointer-events: none;
23
+ }
24
+ .${o}-link {
25
+ width: 100%;
26
+ display: block;
27
+ }
28
+ .${o}-cursor {
29
+ position: absolute;
30
+ top: 0;
31
+ left: 0;
32
+ pointer-events: none;
33
+ width: 32px;
34
+ height: 32px;
35
+ }
36
+ `}function oe(o){return new Promise(a=>{const i=new Image;i.onload=()=>{a({aspectRatio:i.naturalHeight/i.naturalWidth,naturalWidth:i.naturalWidth})},i.onerror=()=>{a({aspectRatio:1,naturalWidth:700})},i.src=o})}async function ae(o){const a=[...new Set(o.filter(Boolean))],i=await Promise.all(a.map(async s=>[s,await oe(s)]));return new Map(i)}function ie({settings:o,content:a=[],isEditor:i}){const{prefix:s}=te.useScopedStyles(),[t,h]=l.useState(null),[f,p]=l.useState([]),[P,R]=l.useState(0),J=l.useRef(0),[F,K]=l.useState({x:0,y:0}),[X,Y]=l.useState("none"),M=l.useRef({x:0,y:0}),[w,G]=l.useState(!1),[N,T]=l.useState(!1),S=l.useRef(new Map),{imageSize:k=ne,cursor:O="system",target:$="area",origin:Q,position:V,visible:W="all",defaultCursor:b=null,hoverCursor:j=null}=o,I=Q??V??"random",y=a.filter(e=>{var n;return!!((n=e==null?void 0:e.image)!=null&&n.assetId)}),D=l.useMemo(()=>re(s),[s]),v=l.useCallback((e,n,r=f)=>{if(!t)return;const d=t.getBoundingClientRect(),c=e-d.left,u=n-d.top;K({x:c,y:u}),Y(se(c,u,r,t,O,$,j,b))},[t,f,O,$,j,b]);l.useEffect(()=>{const e=[...y.map(r=>r.image.assetId),b,j].filter(r=>!!r);if(e.length===0){S.current=new Map,T(!0);return}let n=!1;return T(!1),ae(e).then(r=>{n||(S.current=r,T(!0))}),()=>{n=!0}},[a,b,j]),l.useEffect(()=>{if(!t)return;const e=r=>{r.stopPropagation(),M.current={x:r.clientX,y:r.clientY},v(r.clientX,r.clientY)},n=()=>{w&&v(M.current.x,M.current.y)};return t.addEventListener("mousemove",e),window.addEventListener("scroll",n,!0),()=>{t.removeEventListener("mousemove",e),window.removeEventListener("scroll",n,!0)}},[t,w,v]),l.useEffect(()=>{!t||!w||v(M.current.x,M.current.y)},[f,t,w,v]),l.useEffect(()=>{w||Y("none")},[w]);const U=(e,n,r,d={})=>{var C,L;if(!((C=e==null?void 0:e.image)!=null&&C.assetId))return null;const c=((L=S.current.get(e.image.assetId))==null?void 0:L.aspectRatio)??1,u=H(e.image.assetId,k,S.current),{heightPx:E}=z(u,c);let m=0,g=0;return I==="same"?{x:m,y:g}=A(n,r,u,c):(m=d.x??Math.random()*n,g=d.y??Math.random()*r,{x:m,y:g}=q(m,g,n,r,u,E)),{id:J.current++,assetId:e.image.assetId,link:e.link,name:e.image.name,x:m,y:g,xRatio:m/n,yRatio:g/r,aspectRatio:c,widthPx:u}},B=()=>{if(!t)return;const e=t.getBoundingClientRect(),n=e.width,r=e.height;n===0||r===0||p(d=>d.length===0?d:d.map(c=>{const u=k.sizeType==="random"?c.widthPx:H(c.assetId,k,S.current),{heightPx:E}=z(u,c.aspectRatio);if(I==="same"){const{x:C,y:L}=A(n,r,u,c.aspectRatio);return{...c,x:C,y:L,widthPx:u}}const{x:m,y:g}=q(c.xRatio*n,c.yRatio*r,n,r,u,E);return{...c,x:m,y:g,widthPx:u}}))};l.useEffect(()=>{if(!t||y.length===0||!N)return;const e=t.getBoundingClientRect(),n=e.width,r=e.height,d=U(y[0],n,r);d&&(p([d]),R(y.length>1?1:0))},[k,I,t,a,N]),l.useEffect(()=>{if(!t)return;B();const e=new ResizeObserver(B);return e.observe(t),window.addEventListener("resize",B),()=>{e.disconnect(),window.removeEventListener("resize",B)}},[t,I,k,f.length]),l.useEffect(()=>{W==="last One"&&p(e=>e.length>0?[e[e.length-1]]:[])},[W]);const ee=e=>{if(!t||y.length===0||!N)return;const n=t.getBoundingClientRect(),r=e.clientX-n.left,d=e.clientY-n.top;if($==="image"&&!Z(r,d,f))return;let c=0,u=0;I==="on Click"?(c=r,u=d):I==="same"?(c=n.width/2,u=n.height/2):(c=Math.random()*n.width,u=Math.random()*n.height);const E=y[P%y.length],m=U(E,n.width,n.height,{x:c,y:u});if(!m)return;const g=W==="all"?[...f,m]:[m];p(g),R(C=>(C+1)%y.length),v(e.clientX,e.clientY,g)},_=O==="custom"&&X!=="none";return x.jsxs(x.Fragment,{children:[x.jsx("style",{dangerouslySetInnerHTML:{__html:D}}),x.jsxs("div",{ref:h,onClick:ee,onMouseEnter:()=>G(!0),onMouseLeave:()=>G(!1),className:`${s}-root`,style:{cursor:_?"none":"default"},children:[f.map(e=>x.jsx("div",{className:`${s}-wrapper`,style:{top:`${e.y}px`,left:`${e.x}px`,width:`${e.widthPx}px`,cursor:_?"none":"default"},children:$==="area"&&e.link?x.jsx("a",{href:e.link,target:"_blank",rel:"noreferrer",className:`${s}-link`,children:x.jsx("img",{src:e.assetId,alt:e.name,className:`${s}-image`})}):x.jsx("img",{src:e.assetId,alt:e.name,className:`${s}-image`})},e.id)),w&&_&&x.jsx("div",{className:`${s}-cursor`,style:{left:`${F.x}px`,top:`${F.y}px`,transform:"translate(-50%, -50%)",backgroundImage:`url('${X}')`,backgroundSize:"cover",backgroundPosition:"center"}})]})]})}exports.ClickGallerie=ie;
@@ -1,57 +1,57 @@
1
- import { jsxs as Z, Fragment as ne, jsx as M } from "react/jsx-runtime";
2
- import { useState as y, useRef as j, useMemo as re, useCallback as se, useEffect as w } from "react";
3
- import { u as oe } from "./useScopedStyles-DhBG3557.mjs";
4
- const ae = {
1
+ import { jsxs as Z, Fragment as oe, jsx as M } from "react/jsx-runtime";
2
+ import { useState as y, useRef as Y, useMemo as se, useCallback as ie, useEffect as w } from "react";
3
+ import { u as ae } from "./useScopedStyles-DhBG3557.mjs";
4
+ const ce = {
5
5
  sizeType: "custom",
6
6
  value: 700,
7
7
  min: 400,
8
8
  max: 700
9
9
  };
10
- function T(o, a) {
10
+ function T(s, i) {
11
11
  return {
12
- widthPx: o,
13
- heightPx: o * a
12
+ widthPx: s,
13
+ heightPx: s * i
14
14
  };
15
15
  }
16
- function O(o, a, i, r, t, f) {
16
+ function j(s, i, a, r, t, f) {
17
17
  return {
18
- x: Math.min(Math.max(o, t / 2), i - t / 2),
19
- y: Math.min(Math.max(a, f / 2), r - f / 2)
18
+ x: Math.min(Math.max(s, t / 2), a - t / 2),
19
+ y: Math.min(Math.max(i, f / 2), r - f / 2)
20
20
  };
21
21
  }
22
- function J(o, a, i, r) {
23
- const { heightPx: t } = T(i, r);
24
- return O(
25
- o / 2,
26
- a / 2,
27
- o,
28
- a,
22
+ function J(s, i, a, r) {
23
+ const { heightPx: t } = T(a, r);
24
+ return j(
25
+ s / 2,
26
+ i / 2,
27
+ s,
29
28
  i,
29
+ a,
30
30
  t
31
31
  );
32
32
  }
33
- function Q(o, a, i) {
34
- for (const r of i) {
33
+ function Q(s, i, a) {
34
+ for (const r of a) {
35
35
  const { heightPx: t } = T(r.widthPx, r.aspectRatio), f = r.widthPx / 2, d = t / 2;
36
- if (o >= r.x - f && o <= r.x + f && a >= r.y - d && a <= r.y + d)
36
+ if (s >= r.x - f && s <= r.x + f && i >= r.y - d && i <= r.y + d)
37
37
  return !0;
38
38
  }
39
39
  return !1;
40
40
  }
41
- function ie(o, a, i, r, t, f, d, g) {
41
+ function le(s, i, a, r, t, f, d, g) {
42
42
  if (t === "system")
43
43
  return "none";
44
- const E = r.getBoundingClientRect(), R = document.elementFromPoint(E.left + o, E.top + a);
45
- return R && R.closest("a") ? "none" : Q(o, a, i) || f === "area" ? d ?? "none" : g ?? "none";
44
+ const S = r.getBoundingClientRect(), R = document.elementFromPoint(S.left + s, S.top + i);
45
+ return R && R.closest("a") ? "none" : Q(s, i, a) || f === "area" ? d ?? "none" : g ?? "none";
46
46
  }
47
- function K(o, a, i) {
47
+ function K(s, i, a) {
48
48
  var g;
49
- const { sizeType: r, value: t, min: f, max: d } = a;
50
- return r === "custom" ? t : r === "as is" ? ((g = i.get(o)) == null ? void 0 : g.naturalWidth) ?? t : Math.round(Math.random() * (d - f) + f);
49
+ const { sizeType: r, value: t, min: f, max: d } = i;
50
+ return r === "custom" ? t : r === "as is" ? ((g = a.get(s)) == null ? void 0 : g.naturalWidth) ?? t : Math.round(Math.random() * (d - f) + f);
51
51
  }
52
- function ce(o) {
52
+ function ue(s) {
53
53
  return `
54
- .${o}-root {
54
+ .${s}-root {
55
55
  position: absolute;
56
56
  top: 0;
57
57
  left: 0;
@@ -59,12 +59,12 @@ function ce(o) {
59
59
  height: 100%;
60
60
  overflow: hidden;
61
61
  }
62
- .${o}-wrapper {
62
+ .${s}-wrapper {
63
63
  position: absolute;
64
64
  transform: translate(-50%, -50%);
65
65
  height: auto;
66
66
  }
67
- .${o}-image {
67
+ .${s}-image {
68
68
  display: block;
69
69
  width: 100%;
70
70
  height: auto;
@@ -73,11 +73,11 @@ function ce(o) {
73
73
  user-select: none;
74
74
  pointer-events: none;
75
75
  }
76
- .${o}-link {
76
+ .${s}-link {
77
77
  width: 100%;
78
78
  display: block;
79
79
  }
80
- .${o}-cursor {
80
+ .${s}-cursor {
81
81
  position: absolute;
82
82
  top: 0;
83
83
  left: 0;
@@ -87,66 +87,67 @@ function ce(o) {
87
87
  }
88
88
  `;
89
89
  }
90
- function le(o) {
91
- return new Promise((a) => {
92
- const i = new Image();
93
- i.onload = () => {
94
- a({
95
- aspectRatio: i.naturalHeight / i.naturalWidth,
96
- naturalWidth: i.naturalWidth
90
+ function de(s) {
91
+ return new Promise((i) => {
92
+ const a = new Image();
93
+ a.onload = () => {
94
+ i({
95
+ aspectRatio: a.naturalHeight / a.naturalWidth,
96
+ naturalWidth: a.naturalWidth
97
97
  });
98
- }, i.onerror = () => {
99
- a({ aspectRatio: 1, naturalWidth: 700 });
100
- }, i.src = o;
98
+ }, a.onerror = () => {
99
+ i({ aspectRatio: 1, naturalWidth: 700 });
100
+ }, a.src = s;
101
101
  });
102
102
  }
103
- async function ue(o) {
104
- const a = [...new Set(o.filter(Boolean))], i = await Promise.all(
105
- a.map(async (r) => [r, await le(r)])
103
+ async function fe(s) {
104
+ const i = [...new Set(s.filter(Boolean))], a = await Promise.all(
105
+ i.map(async (r) => [r, await de(r)])
106
106
  );
107
- return new Map(i);
107
+ return new Map(a);
108
108
  }
109
- function he({ settings: o, content: a = [], isEditor: i }) {
110
- const { prefix: r } = oe(), [t, f] = y(null), [d, g] = y([]), [E, R] = y(0), V = j(0), [U, D] = y({ x: 0, y: 0 }), [A, G] = y("none"), k = j({ x: 0, y: 0 }), [x, q] = y(!1), [W, _] = y(!1), $ = j(/* @__PURE__ */ new Map()), {
111
- imageSize: P = ae,
109
+ function pe({ settings: s, content: i = [], isEditor: a }) {
110
+ const { prefix: r } = ae(), [t, f] = y(null), [d, g] = y([]), [S, R] = y(0), V = Y(0), [U, D] = y({ x: 0, y: 0 }), [A, G] = y("none"), k = Y({ x: 0, y: 0 }), [x, q] = y(!1), [W, _] = y(!1), $ = Y(/* @__PURE__ */ new Map()), {
111
+ imageSize: P = ce,
112
112
  cursor: F = "system",
113
- target: S = "area",
114
- position: I = "random",
115
- visible: X = "all",
113
+ target: E = "area",
114
+ origin: ee,
115
+ position: te,
116
+ visible: O = "all",
116
117
  defaultCursor: B = null,
117
118
  hoverCursor: L = null
118
- } = o, p = a.filter(
119
+ } = s, I = ee ?? te ?? "random", p = i.filter(
119
120
  (e) => {
120
121
  var n;
121
122
  return !!((n = e == null ? void 0 : e.image) != null && n.assetId);
122
123
  }
123
- ), ee = re(() => ce(r), [r]), v = se((e, n, s = d) => {
124
+ ), ne = se(() => ue(r), [r]), v = ie((e, n, o = d) => {
124
125
  if (!t) return;
125
126
  const u = t.getBoundingClientRect(), c = e - u.left, l = n - u.top;
126
127
  D({ x: c, y: l }), G(
127
- ie(c, l, s, t, F, S, L, B)
128
+ le(c, l, o, t, F, E, L, B)
128
129
  );
129
- }, [t, d, F, S, L, B]);
130
+ }, [t, d, F, E, L, B]);
130
131
  w(() => {
131
132
  const e = [
132
- ...p.map((s) => s.image.assetId),
133
+ ...p.map((o) => o.image.assetId),
133
134
  B,
134
135
  L
135
- ].filter((s) => !!s);
136
+ ].filter((o) => !!o);
136
137
  if (e.length === 0) {
137
138
  $.current = /* @__PURE__ */ new Map(), _(!0);
138
139
  return;
139
140
  }
140
141
  let n = !1;
141
- return _(!1), ue(e).then((s) => {
142
- n || ($.current = s, _(!0));
142
+ return _(!1), fe(e).then((o) => {
143
+ n || ($.current = o, _(!0));
143
144
  }), () => {
144
145
  n = !0;
145
146
  };
146
- }, [a, B, L]), w(() => {
147
+ }, [i, B, L]), w(() => {
147
148
  if (!t) return;
148
- const e = (s) => {
149
- s.stopPropagation(), k.current = { x: s.clientX, y: s.clientY }, v(s.clientX, s.clientY);
149
+ const e = (o) => {
150
+ o.stopPropagation(), k.current = { x: o.clientX, y: o.clientY }, v(o.clientX, o.clientY);
150
151
  }, n = () => {
151
152
  x && v(k.current.x, k.current.y);
152
153
  };
@@ -158,12 +159,12 @@ function he({ settings: o, content: a = [], isEditor: i }) {
158
159
  }, [d, t, x, v]), w(() => {
159
160
  x || G("none");
160
161
  }, [x]);
161
- const H = (e, n, s, u = {}) => {
162
+ const H = (e, n, o, u = {}) => {
162
163
  var C, N;
163
164
  if (!((C = e == null ? void 0 : e.image) != null && C.assetId)) return null;
164
165
  const c = ((N = $.current.get(e.image.assetId)) == null ? void 0 : N.aspectRatio) ?? 1, l = K(e.image.assetId, P, $.current), { heightPx: b } = T(l, c);
165
166
  let m = 0, h = 0;
166
- return I === "same" ? { x: m, y: h } = J(n, s, l, c) : (m = u.x ?? Math.random() * n, h = u.y ?? Math.random() * s, { x: m, y: h } = O(m, h, n, s, l, b)), {
167
+ return I === "same" ? { x: m, y: h } = J(n, o, l, c) : (m = u.x ?? Math.random() * n, h = u.y ?? Math.random() * o, { x: m, y: h } = j(m, h, n, o, l, b)), {
167
168
  id: V.current++,
168
169
  assetId: e.image.assetId,
169
170
  link: e.link,
@@ -171,24 +172,24 @@ function he({ settings: o, content: a = [], isEditor: i }) {
171
172
  x: m,
172
173
  y: h,
173
174
  xRatio: m / n,
174
- yRatio: h / s,
175
+ yRatio: h / o,
175
176
  aspectRatio: c,
176
177
  widthPx: l
177
178
  };
178
179
  }, z = () => {
179
180
  if (!t) return;
180
- const e = t.getBoundingClientRect(), n = e.width, s = e.height;
181
- n === 0 || s === 0 || g((u) => u.length === 0 ? u : u.map((c) => {
181
+ const e = t.getBoundingClientRect(), n = e.width, o = e.height;
182
+ n === 0 || o === 0 || g((u) => u.length === 0 ? u : u.map((c) => {
182
183
  const l = P.sizeType === "random" ? c.widthPx : K(c.assetId, P, $.current), { heightPx: b } = T(l, c.aspectRatio);
183
184
  if (I === "same") {
184
- const { x: C, y: N } = J(n, s, l, c.aspectRatio);
185
+ const { x: C, y: N } = J(n, o, l, c.aspectRatio);
185
186
  return { ...c, x: C, y: N, widthPx: l };
186
187
  }
187
- const { x: m, y: h } = O(
188
+ const { x: m, y: h } = j(
188
189
  c.xRatio * n,
189
- c.yRatio * s,
190
+ c.yRatio * o,
190
191
  n,
191
- s,
192
+ o,
192
193
  l,
193
194
  b
194
195
  );
@@ -197,9 +198,9 @@ function he({ settings: o, content: a = [], isEditor: i }) {
197
198
  };
198
199
  w(() => {
199
200
  if (!t || p.length === 0 || !W) return;
200
- const e = t.getBoundingClientRect(), n = e.width, s = e.height, u = H(p[0], n, s);
201
+ const e = t.getBoundingClientRect(), n = e.width, o = e.height, u = H(p[0], n, o);
201
202
  u && (g([u]), R(p.length > 1 ? 1 : 0));
202
- }, [P, I, t, a, W]), w(() => {
203
+ }, [P, I, t, i, W]), w(() => {
203
204
  if (!t) return;
204
205
  z();
205
206
  const e = new ResizeObserver(z);
@@ -207,30 +208,30 @@ function he({ settings: o, content: a = [], isEditor: i }) {
207
208
  e.disconnect(), window.removeEventListener("resize", z);
208
209
  };
209
210
  }, [t, I, P, d.length]), w(() => {
210
- X === "last One" && g((e) => e.length > 0 ? [e[e.length - 1]] : []);
211
- }, [X]);
212
- const te = (e) => {
211
+ O === "last One" && g((e) => e.length > 0 ? [e[e.length - 1]] : []);
212
+ }, [O]);
213
+ const re = (e) => {
213
214
  if (!t || p.length === 0 || !W) return;
214
- const n = t.getBoundingClientRect(), s = e.clientX - n.left, u = e.clientY - n.top;
215
- if (S === "image" && !Q(s, u, d)) return;
215
+ const n = t.getBoundingClientRect(), o = e.clientX - n.left, u = e.clientY - n.top;
216
+ if (E === "image" && !Q(o, u, d)) return;
216
217
  let c = 0, l = 0;
217
- I === "on Click" ? (c = s, l = u) : I === "same" ? (c = n.width / 2, l = n.height / 2) : (c = Math.random() * n.width, l = Math.random() * n.height);
218
- const b = p[E % p.length], m = H(b, n.width, n.height, { x: c, y: l });
218
+ I === "on Click" ? (c = o, l = u) : I === "same" ? (c = n.width / 2, l = n.height / 2) : (c = Math.random() * n.width, l = Math.random() * n.height);
219
+ const b = p[S % p.length], m = H(b, n.width, n.height, { x: c, y: l });
219
220
  if (!m) return;
220
- const h = X === "all" ? [...d, m] : [m];
221
+ const h = O === "all" ? [...d, m] : [m];
221
222
  g(h), R((C) => (C + 1) % p.length), v(e.clientX, e.clientY, h);
222
- }, Y = F === "custom" && A !== "none";
223
- return /* @__PURE__ */ Z(ne, { children: [
224
- /* @__PURE__ */ M("style", { dangerouslySetInnerHTML: { __html: ee } }),
223
+ }, X = F === "custom" && A !== "none";
224
+ return /* @__PURE__ */ Z(oe, { children: [
225
+ /* @__PURE__ */ M("style", { dangerouslySetInnerHTML: { __html: ne } }),
225
226
  /* @__PURE__ */ Z(
226
227
  "div",
227
228
  {
228
229
  ref: f,
229
- onClick: te,
230
+ onClick: re,
230
231
  onMouseEnter: () => q(!0),
231
232
  onMouseLeave: () => q(!1),
232
233
  className: `${r}-root`,
233
- style: { cursor: Y ? "none" : "default" },
234
+ style: { cursor: X ? "none" : "default" },
234
235
  children: [
235
236
  d.map((e) => /* @__PURE__ */ M(
236
237
  "div",
@@ -240,13 +241,13 @@ function he({ settings: o, content: a = [], isEditor: i }) {
240
241
  top: `${e.y}px`,
241
242
  left: `${e.x}px`,
242
243
  width: `${e.widthPx}px`,
243
- cursor: Y ? "none" : "default"
244
+ cursor: X ? "none" : "default"
244
245
  },
245
- children: S === "area" && e.link ? /* @__PURE__ */ M("a", { href: e.link, target: "_blank", rel: "noreferrer", className: `${r}-link`, children: /* @__PURE__ */ M("img", { src: e.assetId, alt: e.name, className: `${r}-image` }) }) : /* @__PURE__ */ M("img", { src: e.assetId, alt: e.name, className: `${r}-image` })
246
+ children: E === "area" && e.link ? /* @__PURE__ */ M("a", { href: e.link, target: "_blank", rel: "noreferrer", className: `${r}-link`, children: /* @__PURE__ */ M("img", { src: e.assetId, alt: e.name, className: `${r}-image` }) }) : /* @__PURE__ */ M("img", { src: e.assetId, alt: e.name, className: `${r}-image` })
246
247
  },
247
248
  e.id
248
249
  )),
249
- x && Y && /* @__PURE__ */ M(
250
+ x && X && /* @__PURE__ */ M(
250
251
  "div",
251
252
  {
252
253
  className: `${r}-cursor`,
@@ -266,5 +267,5 @@ function he({ settings: o, content: a = [], isEditor: i }) {
266
267
  ] });
267
268
  }
268
269
  export {
269
- he as ClickGallerie
270
+ pe as ClickGallerie
270
271
  };
@@ -16,6 +16,7 @@ type ClickGallerieSettings = {
16
16
  imageSize?: ImageSizeSettings;
17
17
  cursor?: 'system' | 'custom';
18
18
  target?: 'area' | 'image';
19
+ origin?: 'random' | 'same' | 'on Click';
19
20
  position?: 'random' | 'same' | 'on Click';
20
21
  visible?: 'all' | 'last One';
21
22
  defaultCursor?: string | null;
@@ -11,6 +11,8 @@ type ScaleSettings = {
11
11
  maxHeight?: number;
12
12
  transition?: number;
13
13
  bgImage?: 'greyscale' | 'blur' | 'as is';
14
+ origin?: 'center' | 'mouse' | 'random';
15
+ position?: 'center' | 'mouse' | 'random';
14
16
  };
15
17
  type ScaleProps = {
16
18
  settings: ScaleSettings;
@@ -0,0 +1,4 @@
1
+ import { VideoHTMLAttributes } from 'react';
2
+ export declare const LazyVideo: import('react').ForwardRefExoticComponent<Omit<VideoHTMLAttributes<HTMLVideoElement>, "preload"> & {
3
+ nearPreload?: "auto" | "metadata";
4
+ } & import('react').RefAttributes<HTMLVideoElement>>;
@@ -4,6 +4,7 @@ export { getColorAlpha } from './getColorAlpha';
4
4
  export { getFormFieldValidationError, isValidEmailFormat, isValidPhoneFormat, } from './formFieldValidation';
5
5
  export type { ValidatableFormField } from './formFieldValidation';
6
6
  export { useScopedStyles } from './useScopedStyles';
7
+ export { useLazyVideos } from './useLazyVideos';
7
8
  export type { ScopedStyles } from './useScopedStyles';
8
9
  export type { CommonComponentProps } from '../props';
9
10
  export { readTestimonialTextMeasure } from './readTestimonialTextMeasure';
@@ -0,0 +1,15 @@
1
+ export declare const NEAR_VIEWPORT_MARGIN = "100% 0px";
2
+ type VideoPreload = 'none' | 'metadata' | 'auto';
3
+ type IntersectionListener = (isIntersecting: boolean) => void;
4
+ export declare function observeIntersection(element: Element, rootMargin: string, listener: IntersectionListener): () => void;
5
+ export declare function raisePreload(video: HTMLVideoElement, preload: VideoPreload): void;
6
+ export declare function playVideo(video: HTMLVideoElement): void;
7
+ export declare function pauseVideo(video: HTMLVideoElement): void;
8
+ type LazyVideosOptions = {
9
+ autoPlay?: boolean;
10
+ preload?: Exclude<VideoPreload, 'none'>;
11
+ selector?: string;
12
+ shouldPlay?: (video: HTMLVideoElement) => boolean;
13
+ };
14
+ export declare function useLazyVideos(element: Element | null, { autoPlay, preload, selector, shouldPlay }?: LazyVideosOptions): void;
15
+ export {};