@geekapps/silo-elements-nextjs 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1461,6 +1461,7 @@ function Video({
1461
1461
  const ageRatingTextRef = useRef(null);
1462
1462
  const ageRatingShownRef = useRef(false);
1463
1463
  const ageRatingQueuedRef = useRef(false);
1464
+ const ageRatingPendingRef = useRef(false);
1464
1465
  const [clickIcon, setClickIcon] = useState(null);
1465
1466
  const clickIconTimerRef = useRef(null);
1466
1467
  const clickIconRef = useRef(null);
@@ -1610,7 +1611,13 @@ function Video({
1610
1611
  gsap.to(el, {
1611
1612
  opacity: controlsVisible ? 1 : 0,
1612
1613
  duration: 0.2,
1613
- ease: "power1.inOut"
1614
+ ease: "power1.inOut",
1615
+ onComplete: () => {
1616
+ if (!controlsVisible && ageRatingPendingRef.current) {
1617
+ ageRatingPendingRef.current = false;
1618
+ showAgeRatingRef.current?.();
1619
+ }
1620
+ }
1614
1621
  });
1615
1622
  el.style.pointerEvents = controlsVisible ? "" : "none";
1616
1623
  if (player) {
@@ -1686,7 +1693,7 @@ function Video({
1686
1693
  if (!wrap) return;
1687
1694
  if (ageRatingTlRef.current) ageRatingTlRef.current.kill();
1688
1695
  const HOLD = 12;
1689
- const tl = gsap.timeline({ delay: 0.6 });
1696
+ const tl = gsap.timeline({ delay: 0.3 });
1690
1697
  tl.fromTo(wrap, { opacity: 0 }, { opacity: 1, duration: 0.5, ease: "power2.out" });
1691
1698
  if (icon) {
1692
1699
  tl.fromTo(
@@ -1719,7 +1726,7 @@ function Video({
1719
1726
  }
1720
1727
  const shouldShow = !ageRatingShownRef.current || ageRatingQueuedRef.current;
1721
1728
  ageRatingQueuedRef.current = false;
1722
- if (shouldShow) showAgeRating();
1729
+ if (shouldShow) ageRatingPendingRef.current = true;
1723
1730
  setHasPlayed(true);
1724
1731
  showControlsTemporarily();
1725
1732
  };
@@ -3318,7 +3325,20 @@ function Video({
3318
3325
  activeCue && /* @__PURE__ */ jsx(
3319
3326
  "div",
3320
3327
  {
3321
- className: `pointer-events-none absolute inset-x-0 z-40 flex justify-center px-4 transition-all duration-200${controlsVisible ? "bottom-20 @sm:bottom-24 @lg:bottom-28" : "bottom-4 @sm:bottom-6"}`,
3328
+ className: "pointer-events-none absolute inset-x-0 z-40 flex justify-center px-4",
3329
+ style: {
3330
+ bottom: (() => {
3331
+ if (preview) {
3332
+ const frameW = preview.cue.w ?? 160;
3333
+ const frameH = preview.cue.h ?? 90;
3334
+ const thumbH = Math.round(200 * (frameH / frameW));
3335
+ return `${80 + thumbH + 32 + 10}px`;
3336
+ }
3337
+ if (controlsVisible) return "5rem";
3338
+ return "1rem";
3339
+ })(),
3340
+ transition: "bottom 0.2s ease"
3341
+ },
3322
3342
  children: /* @__PURE__ */ jsx(
3323
3343
  "div",
3324
3344
  {