@superrb/react-addons 4.0.0-30 → 4.0.0-31
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/.idea/codeStyles/Project.xml +61 -0
- package/.idea/codeStyles/codeStyleConfig.xml +5 -0
- package/.idea/copilot.data.migration.ask2agent.xml +6 -0
- package/.idea/inspectionProfiles/Project_Default.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/prettier.xml +6 -0
- package/.idea/react-addons.iml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.yarn/install-state.gz +0 -0
- package/.yarnrc.yml +1 -0
- package/config.d.ts.map +1 -1
- package/config.js +374 -1
- package/package.json +2 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/.vscode/extensions.json +0 -7
- package/.vscode/settings.json +0 -10
- package/.yarn/sdks/eslint/bin/eslint.js +0 -32
- package/.yarn/sdks/eslint/lib/api.js +0 -32
- package/.yarn/sdks/eslint/lib/unsupported-api.js +0 -32
- package/.yarn/sdks/eslint/package.json +0 -14
- package/.yarn/sdks/integrations.yml +0 -5
- package/.yarn/sdks/prettier/bin/prettier.cjs +0 -32
- package/.yarn/sdks/prettier/index.cjs +0 -32
- package/.yarn/sdks/prettier/package.json +0 -7
- package/.yarn/sdks/typescript/bin/tsc +0 -32
- package/.yarn/sdks/typescript/bin/tsserver +0 -32
- package/.yarn/sdks/typescript/lib/tsc.js +0 -32
- package/.yarn/sdks/typescript/lib/tsserver.js +0 -248
- package/.yarn/sdks/typescript/lib/tsserverlibrary.js +0 -248
- package/.yarn/sdks/typescript/lib/typescript.js +0 -32
- package/.yarn/sdks/typescript/package.json +0 -10
- package/actions.d.ts +0 -6
- package/actions.d.ts.map +0 -1
- package/actions.js +0 -18
- package/components/video.d.ts +0 -17
- package/components/video.d.ts.map +0 -1
- package/components/video.js +0 -44
- package/context/cookies-context-provider.d.ts +0 -13
- package/context/cookies-context-provider.d.ts.map +0 -1
- package/context/cookies-context-provider.js +0 -54
- package/context.d.ts +0 -8
- package/context.d.ts.map +0 -1
- package/context.js +0 -7
package/components/video.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ImageField } from '@prismicio/client';
|
|
2
|
-
import { OnProgressProps } from 'react-player/base';
|
|
3
|
-
declare const Video: ({ url, teaserUrl, image, sizes, className, controls, muted, onPlay, onTeaserPlay, onProgress, onTeaserProgress, }: {
|
|
4
|
-
url: string;
|
|
5
|
-
teaserUrl?: string | undefined;
|
|
6
|
-
image: ImageField;
|
|
7
|
-
sizes?: string | undefined;
|
|
8
|
-
className?: string | undefined;
|
|
9
|
-
controls?: boolean | undefined;
|
|
10
|
-
muted?: boolean | undefined;
|
|
11
|
-
onPlay?: (() => void) | undefined;
|
|
12
|
-
onTeaserPlay?: (() => void) | undefined;
|
|
13
|
-
onProgress?: ((state: OnProgressProps) => void) | undefined;
|
|
14
|
-
onTeaserProgress?: ((state: OnProgressProps) => void) | undefined;
|
|
15
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
-
export default Video;
|
|
17
|
-
//# sourceMappingURL=video.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"video.d.ts","sourceRoot":"","sources":["../src/components/video.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAK9C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAGnD,QAAA,MAAM,KAAK;SAaJ,MAAM;;;;;;;oBAOI,IAAI;0BACE,IAAI;8CACgB,IAAI;oDACE,IAAI;6CAuGpD,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/components/video.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { extendClass } from '@superrb/react-addons/utils';
|
|
3
|
-
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import ReactPlayer from 'react-player/lazy';
|
|
5
|
-
import PlayButton from './play-button';
|
|
6
|
-
import { useMotionAllowed } from '@superrb/react-addons/hooks';
|
|
7
|
-
const Video = ({ url, teaserUrl, image, sizes = '100vw', className = '', controls = false, muted = false, onPlay = () => { }, onTeaserPlay = () => { }, onProgress = (state) => { }, onTeaserProgress = (state) => { }, }) => {
|
|
8
|
-
const motionAllowed = useMotionAllowed();
|
|
9
|
-
const [videoStarted, setVideoStarted] = useState(false);
|
|
10
|
-
const [playing, setPlaying] = useState(false);
|
|
11
|
-
const [teaserPlaying, setTeaserPlaying] = useState(!!teaserUrl && motionAllowed);
|
|
12
|
-
const [progress, setProgress] = useState(0);
|
|
13
|
-
const video = useRef();
|
|
14
|
-
const teaserVideo = useRef();
|
|
15
|
-
useEffect(() => {
|
|
16
|
-
if (playing && !teaserPlaying) {
|
|
17
|
-
onPlay();
|
|
18
|
-
}
|
|
19
|
-
if (teaserPlaying && !playing) {
|
|
20
|
-
onTeaserPlay();
|
|
21
|
-
}
|
|
22
|
-
}, [playing, teaserPlaying, onPlay, onTeaserPlay]);
|
|
23
|
-
return (_jsxs("div", { className: `video ${className}`, children: [teaserUrl && (_jsx("div", { className: "video__teaser-wrapper", "aria-hidden": playing, children: _jsx(ReactPlayer, { className: `video__teaser ${extendClass(className, 'teaser')}`, url: teaserUrl, playing: teaserPlaying, loop: true, autoplay: true, playsinline: true, controls: false, onPlay: () => {
|
|
24
|
-
setVideoStarted(true);
|
|
25
|
-
}, muted: true, width: "100%", height: "100%", onProgress: (state) => {
|
|
26
|
-
setProgress(state.played);
|
|
27
|
-
onTeaserProgress(state);
|
|
28
|
-
}, ref: teaserVideo }) })), url && (_jsx("div", { className: "video__player-wrapper", "aria-hidden": !playing, children: _jsx(ReactPlayer, { className: `video__player ${extendClass(className, 'player')}`, url: url, playing: playing, loop: false, autoplay: true, playsinline: true, controls: controls, onPlay: () => {
|
|
29
|
-
setVideoStarted(true);
|
|
30
|
-
}, muted: muted, width: "100%", height: "100%", "aria-hidden": !playing, onProgress: (state) => {
|
|
31
|
-
setProgress(state.played);
|
|
32
|
-
onProgress(state);
|
|
33
|
-
}, ref: video }) })), _jsx(Image, { image: image, className: `video__image ${extendClass(className, 'image')}`, "aria-hidden": (videoStarted && controls) || playing, sizes: sizes }), (!playing || !controls) && (_jsx(PlayButton, { className: "video__play", onClick: () => {
|
|
34
|
-
if (controls) {
|
|
35
|
-
video.current?.seekTo(0);
|
|
36
|
-
setTeaserPlaying(false);
|
|
37
|
-
setPlaying(true);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
setPlaying((playing) => !playing);
|
|
41
|
-
setTeaserPlaying((playing) => !playing);
|
|
42
|
-
}, progress: progress, "aria-hidden": playing }))] }));
|
|
43
|
-
};
|
|
44
|
-
export default Video;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
2
|
-
export declare const CookiesContext: import("react").Context<{
|
|
3
|
-
cookiesAccepted: boolean;
|
|
4
|
-
setCookiesAccepted: (accepted: boolean) => void;
|
|
5
|
-
trackingCookiesAccepted: boolean;
|
|
6
|
-
setTrackingCookiesAccepted: (accepted: boolean) => void;
|
|
7
|
-
popupOpen: boolean;
|
|
8
|
-
openPopup: () => void;
|
|
9
|
-
closePopup: () => void;
|
|
10
|
-
}>;
|
|
11
|
-
export declare const CookiesContextProvider: ({ children }: PropsWithChildren<{}>) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export default CookiesContextProvider;
|
|
13
|
-
//# sourceMappingURL=cookies-context-provider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cookies-context-provider.d.ts","sourceRoot":"","sources":["../src/context/cookies-context-provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EAKlB,MAAM,OAAO,CAAA;AAGd,eAAO,MAAM,cAAc;;mCAEM,OAAO;;2CAEC,OAAO;;;;EAI9C,CAAA;AAEF,eAAO,MAAM,sBAAsB,iBAAkB,iBAAiB,CAAC,EAAE,CAAC,4CA2DzE,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useCallback, useEffect, useState, } from 'react';
|
|
4
|
-
import Cookies from 'js-cookie';
|
|
5
|
-
export const CookiesContext = createContext({
|
|
6
|
-
cookiesAccepted: false,
|
|
7
|
-
setCookiesAccepted: (accepted) => { },
|
|
8
|
-
trackingCookiesAccepted: false,
|
|
9
|
-
setTrackingCookiesAccepted: (accepted) => { },
|
|
10
|
-
popupOpen: false,
|
|
11
|
-
openPopup: () => { },
|
|
12
|
-
closePopup: () => { },
|
|
13
|
-
});
|
|
14
|
-
export const CookiesContextProvider = ({ children }) => {
|
|
15
|
-
const [cookiesAccepted, setCookiesAcceptedStorage] = useState(false);
|
|
16
|
-
const [popupOpen, setPopupOpenStorage] = useState(false);
|
|
17
|
-
const [trackingCookiesAccepted, setTrackingCookiesAcceptedStorage] = useState(false);
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
const accepted = Cookies.get('accepted-cookies') || false;
|
|
20
|
-
setCookiesAcceptedStorage(!!accepted);
|
|
21
|
-
}, [setCookiesAcceptedStorage]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
const accepted = Cookies.get('accepted-tracking-cookies') || false;
|
|
24
|
-
setTrackingCookiesAcceptedStorage(!!accepted);
|
|
25
|
-
}, [setTrackingCookiesAcceptedStorage]);
|
|
26
|
-
const setCookiesAccepted = useCallback((accepted) => {
|
|
27
|
-
Cookies.set('accepted-cookies', accepted.toString(), {
|
|
28
|
-
expires: 30,
|
|
29
|
-
});
|
|
30
|
-
setCookiesAcceptedStorage(accepted);
|
|
31
|
-
}, [setCookiesAcceptedStorage]);
|
|
32
|
-
const setTrackingCookiesAccepted = useCallback((accepted) => {
|
|
33
|
-
Cookies.set('accepted-tracking-cookies', accepted.toString(), {
|
|
34
|
-
expires: 30,
|
|
35
|
-
});
|
|
36
|
-
setTrackingCookiesAcceptedStorage(accepted);
|
|
37
|
-
}, [setTrackingCookiesAcceptedStorage]);
|
|
38
|
-
const openPopup = useCallback(() => {
|
|
39
|
-
setPopupOpenStorage(true);
|
|
40
|
-
}, [setPopupOpenStorage]);
|
|
41
|
-
const closePopup = useCallback(() => {
|
|
42
|
-
setPopupOpenStorage(false);
|
|
43
|
-
}, [setPopupOpenStorage]);
|
|
44
|
-
return (_jsx(CookiesContext.Provider, { value: {
|
|
45
|
-
cookiesAccepted,
|
|
46
|
-
setCookiesAccepted,
|
|
47
|
-
trackingCookiesAccepted,
|
|
48
|
-
setTrackingCookiesAccepted,
|
|
49
|
-
popupOpen,
|
|
50
|
-
openPopup,
|
|
51
|
-
closePopup,
|
|
52
|
-
}, children: children }));
|
|
53
|
-
};
|
|
54
|
-
export default CookiesContextProvider;
|
package/context.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context
|
|
3
|
-
*/
|
|
4
|
-
import { CookiesContext, CookiesContextProvider } from './context/cookies-context-provider';
|
|
5
|
-
import { ModalContext, ModalContextProvider } from './context/modal-context-provider';
|
|
6
|
-
import { NavContext, NavContextProvider } from './context/nav-context-provider';
|
|
7
|
-
export { CookiesContext, CookiesContextProvider, ModalContext, ModalContextProvider, NavContext, NavContextProvider, };
|
|
8
|
-
//# sourceMappingURL=context.d.ts.map
|
package/context.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["src/context.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EACL,cAAc,EACd,sBAAsB,EACvB,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EACL,YAAY,EACZ,oBAAoB,EACrB,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAE/E,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,kBAAkB,GACnB,CAAA"}
|
package/context.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Context
|
|
3
|
-
*/
|
|
4
|
-
import { CookiesContext, CookiesContextProvider, } from './context/cookies-context-provider';
|
|
5
|
-
import { ModalContext, ModalContextProvider, } from './context/modal-context-provider';
|
|
6
|
-
import { NavContext, NavContextProvider } from './context/nav-context-provider';
|
|
7
|
-
export { CookiesContext, CookiesContextProvider, ModalContext, ModalContextProvider, NavContext, NavContextProvider, };
|