@zenpatient-org/healthspan-marketing-ui 0.2.52 → 0.2.53
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),x=require("../../../../utils/cn/cn.cjs.js"),r=require("../../../../src/components/AdvancedGallery/components/VideoSlide/videoSlide.module.css"),h=require("../../../Icon/Icon.cjs.js"),j=require("../../../Icon/constants.cjs.js"),P=require("../../../AudioButton/AudioButton.cjs.js"),I=({item:o,isActive:l,onClick:a})=>{const[c,u]=s.useState(!1),[p,i]=s.useState(!0),e=s.useRef(null),f=s.useRef(null);s.useEffect(()=>{const t=e.current;if(!t)return;const d=()=>{u(!1)};return l?(t.muted=!0,i(!0),t.play().then(()=>{u(!0)})):(t.pause(),t.currentTime=0,u(!1)),t.addEventListener("ended",d),()=>{t.removeEventListener("ended",d)}},[l]);const m=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.play(),u(!0)),a()},[a]),v=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.muted=!e.current.muted,i(e.current.muted))},[]),y=s.useCallback(()=>{e.current&&o.videoType==="complex"&&(c?(e.current.pause(),u(!1)):(e.current.play(),u(!0))),a()},[o.videoType,c,a]);return n.jsx("div",{className:r.root,ref:f,onClick:y,children:n.jsxs("div",{className:r.videoContainer,children:[n.jsx("video",{ref:e,src:o.url,playsInline:!0,autoPlay:!0,muted:!0,controls:!1,poster:o.preview,className:x.cn(r.video,!c&&r.mediaHidden)}),o.videoType==="complex"&&!c&&n.jsx("div",{className:r.playButton,children:n.jsx("button",{className:r.customPlayButton,onClick:m,children:n.jsx(h.Icon,{className:r.icon,name:j.EIconName.ALT_PLAY})})}),o.videoType==="complex"&&c&&n.jsx("div",{className:r.audioButton,children:n.jsx(P.AudioButton,{isMuted:p,onClick:v})})]})})};exports.VideoSlide=I;
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),s=require("react"),x=require("../../../../utils/cn/cn.cjs.js"),r=require("../../../../src/components/AdvancedGallery/components/VideoSlide/videoSlide.module.css"),h=require("../../../Icon/Icon.cjs.js"),j=require("../../../Icon/constants.cjs.js"),P=require("../../../AudioButton/AudioButton.cjs.js"),I=({item:o,isActive:l,onClick:a})=>{const[c,u]=s.useState(!1),[p,i]=s.useState(!0),e=s.useRef(null),f=s.useRef(null);s.useEffect(()=>{const t=e.current;if(!t)return;const d=()=>{u(!1)};return l?(t.muted=!0,i(!0),t.play().then(()=>{u(!0)})):(t.pause(),t.currentTime=0,u(!1)),t.addEventListener("ended",d),()=>{t.removeEventListener("ended",d)}},[l]);const m=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.play(),u(!0)),a()},[a]),v=s.useCallback(t=>{t.stopPropagation(),e.current&&(e.current.muted=!e.current.muted,i(e.current.muted))},[]),y=s.useCallback(()=>{e.current&&o.videoType==="complex"&&(c?(e.current.pause(),u(!1)):(e.current.play(),u(!0))),a()},[o.videoType,c,a]);return n.jsx("div",{className:r.root,ref:f,onClick:y,children:n.jsxs("div",{className:r.videoContainer,children:[n.jsx("video",{ref:e,src:o.url,playsInline:!0,autoPlay:!0,muted:!0,loop:!0,controls:!1,poster:o.preview,className:x.cn(r.video,!c&&r.mediaHidden)}),o.videoType==="complex"&&!c&&n.jsx("div",{className:r.playButton,children:n.jsx("button",{className:r.customPlayButton,onClick:m,children:n.jsx(h.Icon,{className:r.icon,name:j.EIconName.ALT_PLAY})})}),o.videoType==="complex"&&c&&n.jsx("div",{className:r.audioButton,children:n.jsx(P.AudioButton,{isMuted:p,onClick:v})})]})})};exports.VideoSlide=I;
|
|
@@ -6,8 +6,8 @@ import r from "../../../../components/AdvancedGallery/components/VideoSlide/vide
|
|
|
6
6
|
import { Icon as E } from "../../../Icon/Icon.es.js";
|
|
7
7
|
import { EIconName as I } from "../../../Icon/constants.es.js";
|
|
8
8
|
import { AudioButton as g } from "../../../AudioButton/AudioButton.es.js";
|
|
9
|
-
const k = ({ item: n, isActive: c, onClick:
|
|
10
|
-
const [
|
|
9
|
+
const k = ({ item: n, isActive: c, onClick: a }) => {
|
|
10
|
+
const [u, s] = m(!1), [f, i] = m(!0), e = p(null), v = p(null);
|
|
11
11
|
x(() => {
|
|
12
12
|
const t = e.current;
|
|
13
13
|
if (!t) return;
|
|
@@ -22,14 +22,14 @@ const k = ({ item: n, isActive: c, onClick: u }) => {
|
|
|
22
22
|
}, [c]);
|
|
23
23
|
const y = l(
|
|
24
24
|
(t) => {
|
|
25
|
-
t.stopPropagation(), e.current && (e.current.play(), s(!0)),
|
|
25
|
+
t.stopPropagation(), e.current && (e.current.play(), s(!0)), a();
|
|
26
26
|
},
|
|
27
|
-
[
|
|
27
|
+
[a]
|
|
28
28
|
), h = l((t) => {
|
|
29
29
|
t.stopPropagation(), e.current && (e.current.muted = !e.current.muted, i(e.current.muted));
|
|
30
30
|
}, []), N = l(() => {
|
|
31
|
-
e.current && n.videoType === "complex" && (
|
|
32
|
-
}, [n.videoType,
|
|
31
|
+
e.current && n.videoType === "complex" && (u ? (e.current.pause(), s(!1)) : (e.current.play(), s(!0))), a();
|
|
32
|
+
}, [n.videoType, u, a]);
|
|
33
33
|
return /* @__PURE__ */ o("div", { className: r.root, ref: v, onClick: N, children: /* @__PURE__ */ P("div", { className: r.videoContainer, children: [
|
|
34
34
|
/* @__PURE__ */ o(
|
|
35
35
|
"video",
|
|
@@ -39,13 +39,14 @@ const k = ({ item: n, isActive: c, onClick: u }) => {
|
|
|
39
39
|
playsInline: !0,
|
|
40
40
|
autoPlay: !0,
|
|
41
41
|
muted: !0,
|
|
42
|
+
loop: !0,
|
|
42
43
|
controls: !1,
|
|
43
44
|
poster: n.preview,
|
|
44
|
-
className: T(r.video, !
|
|
45
|
+
className: T(r.video, !u && r.mediaHidden)
|
|
45
46
|
}
|
|
46
47
|
),
|
|
47
|
-
n.videoType === "complex" && !
|
|
48
|
-
n.videoType === "complex" &&
|
|
48
|
+
n.videoType === "complex" && !u && /* @__PURE__ */ o("div", { className: r.playButton, children: /* @__PURE__ */ o("button", { className: r.customPlayButton, onClick: y, children: /* @__PURE__ */ o(E, { className: r.icon, name: I.ALT_PLAY }) }) }),
|
|
49
|
+
n.videoType === "complex" && u && /* @__PURE__ */ o("div", { className: r.audioButton, children: /* @__PURE__ */ o(g, { isMuted: f, onClick: h }) })
|
|
49
50
|
] }) });
|
|
50
51
|
};
|
|
51
52
|
export {
|