@davi-ai/retorik-framework 4.0.1 → 4.0.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/NewsContainer.c0a24775.js.map +1 -1
- package/dist/NewsContainer.c3331d80.js.map +1 -1
- package/dist/{VeilleManager.46a9de36.js → VeilleManager.26dcadac.js} +22 -93
- package/dist/VeilleManager.26dcadac.js.map +1 -0
- package/dist/{VeilleManager.1ff7aa0f.js → VeilleManager.72cf0e9c.js} +21 -88
- package/dist/VeilleManager.72cf0e9c.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +209 -124
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +202 -124
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
- package/dist/VeilleManager.1ff7aa0f.js.map +0 -1
- package/dist/VeilleManager.46a9de36.js.map +0 -1
|
@@ -55,28 +55,16 @@ var $9x9Q9 = parcelRequire("9x9Q9");
|
|
|
55
55
|
|
|
56
56
|
var $G07Rs = parcelRequire("G07Rs");
|
|
57
57
|
const $167bfc94e5487988$var$springDuration = 500;
|
|
58
|
-
const $167bfc94e5487988$var$
|
|
59
|
-
(0, $7WHA7.Routes).EmptyVeille,
|
|
60
|
-
(0, $7WHA7.Routes).NewsInVeille,
|
|
61
|
-
(0, $7WHA7.Routes).ScreenSaver,
|
|
62
|
-
(0, $7WHA7.Routes).SlideShow
|
|
63
|
-
];
|
|
64
|
-
const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
58
|
+
const $167bfc94e5487988$var$VeilleManager = ({ onClose: onClose })=>{
|
|
65
59
|
var _veilleConfiguration_views_screenSaver, _veilleConfiguration_views, _veilleConfiguration_views_screenSaver1, _veilleConfiguration_views1, _veilleConfiguration_views_slideShow, _veilleConfiguration_views2, _veilleConfiguration_views_slideShow1, _veilleConfiguration_views3;
|
|
66
60
|
const dispatch = (0, $ehKZo$reactredux.useDispatch)();
|
|
67
|
-
const addressData = (0, $ehKZo$reactredux.useSelector)((state)=>state.retorikReducer.addressData);
|
|
68
|
-
const loaderClosed = (0, $ehKZo$reactredux.useSelector)((state)=>state.retorikReducer.loaderClosed);
|
|
69
|
-
const appAvailable = (0, $ehKZo$reactredux.useSelector)((state)=>state.retorikReducer.appAvailable);
|
|
70
61
|
const route = (0, $ehKZo$reactredux.useSelector)((state)=>state.viewReducer.route);
|
|
71
62
|
const veilleConfiguration = (0, $ehKZo$reactredux.useSelector)((state)=>state.viewReducer.veilleConfiguration);
|
|
72
63
|
const muted = (0, $ehKZo$reactredux.useSelector)((state)=>state.speechReducer.muted);
|
|
73
|
-
const typingCount = (0, $ehKZo$reactredux.useSelector)((state)=>state.directlineReducer.typingCount);
|
|
74
|
-
const [veilleLaunched, setVeilleLaunched] = (0, $ehKZo$react.useState)(false);
|
|
75
64
|
const [loop, setLoop] = (0, $ehKZo$react.useState)(false);
|
|
76
65
|
const veilleDataRef = (0, $ehKZo$react.useRef)(veilleConfiguration);
|
|
77
66
|
const availableItemsToDisplayRef = (0, $ehKZo$react.useRef)([]);
|
|
78
67
|
const currentItemDisplayedRef = (0, $ehKZo$react.useRef)(0);
|
|
79
|
-
const timerRef = (0, $ehKZo$react.useRef)(null);
|
|
80
68
|
const fadeTimerRef = (0, $ehKZo$react.useRef)(null);
|
|
81
69
|
const oldMutedRef = (0, $ehKZo$react.useRef)(muted);
|
|
82
70
|
const [spring, api] = (0, $ehKZo$reactspringweb.useSpring)(()=>({
|
|
@@ -85,7 +73,7 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
85
73
|
}
|
|
86
74
|
}));
|
|
87
75
|
(0, $ehKZo$react.useEffect)(()=>{
|
|
88
|
-
|
|
76
|
+
api.start({
|
|
89
77
|
from: {
|
|
90
78
|
opacity: 0
|
|
91
79
|
},
|
|
@@ -96,9 +84,7 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
96
84
|
duration: $167bfc94e5487988$var$springDuration
|
|
97
85
|
}
|
|
98
86
|
});
|
|
99
|
-
}, [
|
|
100
|
-
veilleLaunched
|
|
101
|
-
]);
|
|
87
|
+
}, []);
|
|
102
88
|
const handleClose = ()=>{
|
|
103
89
|
api.start({
|
|
104
90
|
from: {
|
|
@@ -117,51 +103,9 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
117
103
|
dispatch((0, $kpW3P.storeActions).speech.setMuted(oldMutedRef.current));
|
|
118
104
|
// Get back to home view
|
|
119
105
|
dispatch((0, $kpW3P.storeActions).view.setRoute((0, $7WHA7.Routes).Home));
|
|
106
|
+
onClose();
|
|
120
107
|
}, $167bfc94e5487988$var$springDuration);
|
|
121
108
|
};
|
|
122
|
-
const launchVeille = async ()=>{
|
|
123
|
-
var // Set muted state to true if it is demanded in the configuration
|
|
124
|
-
_veilleDataRef_current_views_news, _veilleDataRef_current_views;
|
|
125
|
-
// Kill current directline if needed, and create a new one if the news are included in the veille
|
|
126
|
-
if (veilleDataRef.current.killConversationOnLaunch) {
|
|
127
|
-
var _veilleDataRef_current_views_news1, _veilleDataRef_current_views1;
|
|
128
|
-
await dispatch((0, $kpW3P.storeActions).directline.endConversation());
|
|
129
|
-
((_veilleDataRef_current_views1 = veilleDataRef.current.views) === null || _veilleDataRef_current_views1 === void 0 ? void 0 : (_veilleDataRef_current_views_news1 = _veilleDataRef_current_views1.news) === null || _veilleDataRef_current_views_news1 === void 0 ? void 0 : _veilleDataRef_current_views_news1.enabled) && dispatch((0, $kpW3P.storeActions).directline.recreateDirectline({
|
|
130
|
-
addressData: addressData,
|
|
131
|
-
userId: `veille_${Date.now()}`,
|
|
132
|
-
skipWelcome: true
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
((_veilleDataRef_current_views = veilleDataRef.current.views) === null || _veilleDataRef_current_views === void 0 ? void 0 : (_veilleDataRef_current_views_news = _veilleDataRef_current_views.news) === null || _veilleDataRef_current_views_news === void 0 ? void 0 : _veilleDataRef_current_views_news.muted) && dispatch((0, $kpW3P.storeActions).speech.setMuted(true));
|
|
136
|
-
setVeilleLaunched(true);
|
|
137
|
-
dispatch((0, $kpW3P.storeActions).view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : (0, $7WHA7.Routes).EmptyVeille));
|
|
138
|
-
};
|
|
139
|
-
const refreshTimer = ()=>{
|
|
140
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
141
|
-
timerRef.current = setTimeout(()=>{
|
|
142
|
-
launchVeille();
|
|
143
|
-
}, (veilleDataRef.current.delayBeforeLaunchInSeconds || 120) * 1000);
|
|
144
|
-
};
|
|
145
|
-
const exitVeille = (firstTime)=>{
|
|
146
|
-
var _veilleDataRef_current;
|
|
147
|
-
// Recreate directline if needed
|
|
148
|
-
if (!firstTime && ((_veilleDataRef_current = veilleDataRef.current) === null || _veilleDataRef_current === void 0 ? void 0 : _veilleDataRef_current.killConversationOnLaunch)) {
|
|
149
|
-
var // Reset directline if a new one has already been recreated for the news inside the veille
|
|
150
|
-
_veilleDataRef_current_views_news, _veilleDataRef_current_views;
|
|
151
|
-
((_veilleDataRef_current_views = veilleDataRef.current.views) === null || _veilleDataRef_current_views === void 0 ? void 0 : (_veilleDataRef_current_views_news = _veilleDataRef_current_views.news) === null || _veilleDataRef_current_views_news === void 0 ? void 0 : _veilleDataRef_current_views_news.enabled) && dispatch((0, $kpW3P.storeActions).directline.endConversation());
|
|
152
|
-
dispatch((0, $kpW3P.storeActions).directline.recreateDirectline({
|
|
153
|
-
addressData: addressData
|
|
154
|
-
}));
|
|
155
|
-
}
|
|
156
|
-
setVeilleLaunched(false);
|
|
157
|
-
// Set back the current item's index to 0 and clear the timeout
|
|
158
|
-
currentItemDisplayedRef.current = 0;
|
|
159
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
160
|
-
// Launch the timer for veille opening
|
|
161
|
-
refreshTimer();
|
|
162
|
-
// Get back to home view if we came here to close the veille
|
|
163
|
-
!firstTime && handleClose();
|
|
164
|
-
};
|
|
165
109
|
const switchComponent = ()=>{
|
|
166
110
|
if (availableItemsToDisplayRef.current.length > currentItemDisplayedRef.current + 1) {
|
|
167
111
|
currentItemDisplayedRef.current++;
|
|
@@ -172,34 +116,20 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
172
116
|
}
|
|
173
117
|
};
|
|
174
118
|
(0, $ehKZo$react.useEffect)(()=>{
|
|
119
|
+
var _veilleConfiguration_views_screenSaver, _veilleConfiguration_views, _veilleConfiguration_views_news, _veilleConfiguration_views1, _veilleConfiguration_views_slideShow, _veilleConfiguration_views2, // Mute the sound if the news in veille has to be muted
|
|
120
|
+
_veilleDataRef_current_views_news, _veilleDataRef_current_views;
|
|
175
121
|
veilleDataRef.current = veilleConfiguration;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
}, [
|
|
188
|
-
veilleConfiguration,
|
|
189
|
-
appAvailable,
|
|
190
|
-
loaderClosed
|
|
191
|
-
]);
|
|
192
|
-
/**
|
|
193
|
-
* Refresh the timer of the veille on each typing activity emitted
|
|
194
|
-
*/ (0, $ehKZo$react.useEffect)(()=>{
|
|
195
|
-
!veilleLaunched && refreshTimer();
|
|
196
|
-
}, [
|
|
197
|
-
typingCount,
|
|
198
|
-
veilleLaunched
|
|
199
|
-
]);
|
|
200
|
-
(0, $ehKZo$react.useEffect)(()=>{
|
|
122
|
+
const tempViewArray = [];
|
|
123
|
+
((_veilleConfiguration_views = veilleConfiguration.views) === null || _veilleConfiguration_views === void 0 ? void 0 : (_veilleConfiguration_views_screenSaver = _veilleConfiguration_views.screenSaver) === null || _veilleConfiguration_views_screenSaver === void 0 ? void 0 : _veilleConfiguration_views_screenSaver.enabled) && tempViewArray.push((0, $7WHA7.Routes).ScreenSaver);
|
|
124
|
+
((_veilleConfiguration_views1 = veilleConfiguration.views) === null || _veilleConfiguration_views1 === void 0 ? void 0 : (_veilleConfiguration_views_news = _veilleConfiguration_views1.news) === null || _veilleConfiguration_views_news === void 0 ? void 0 : _veilleConfiguration_views_news.enabled) && tempViewArray.push((0, $7WHA7.Routes).NewsInVeille);
|
|
125
|
+
((_veilleConfiguration_views2 = veilleConfiguration.views) === null || _veilleConfiguration_views2 === void 0 ? void 0 : (_veilleConfiguration_views_slideShow = _veilleConfiguration_views2.slideShow) === null || _veilleConfiguration_views_slideShow === void 0 ? void 0 : _veilleConfiguration_views_slideShow.enabled) && tempViewArray.push((0, $7WHA7.Routes).SlideShow);
|
|
126
|
+
// Set loop if there is only 1 item to display
|
|
127
|
+
setLoop(tempViewArray.length === 1);
|
|
128
|
+
availableItemsToDisplayRef.current = tempViewArray;
|
|
129
|
+
currentItemDisplayedRef.current = 0;
|
|
130
|
+
((_veilleDataRef_current_views = veilleDataRef.current.views) === null || _veilleDataRef_current_views === void 0 ? void 0 : (_veilleDataRef_current_views_news = _veilleDataRef_current_views.news) === null || _veilleDataRef_current_views_news === void 0 ? void 0 : _veilleDataRef_current_views_news.muted) && dispatch((0, $kpW3P.storeActions).speech.setMuted(true));
|
|
131
|
+
dispatch((0, $kpW3P.storeActions).view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : (0, $7WHA7.Routes).EmptyVeille));
|
|
201
132
|
return ()=>{
|
|
202
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
203
133
|
(fadeTimerRef === null || fadeTimerRef === void 0 ? void 0 : fadeTimerRef.current) && clearTimeout(fadeTimerRef.current);
|
|
204
134
|
// Switch back the muted state (it could have not been changed but for security let's set it)
|
|
205
135
|
dispatch((0, $kpW3P.storeActions).speech.setMuted(oldMutedRef.current));
|
|
@@ -209,16 +139,15 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
209
139
|
children: [
|
|
210
140
|
/*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsxs)((0, $ehKZo$reactspringweb.animated).div, {
|
|
211
141
|
id: "retorik-framework-veille-manager",
|
|
212
|
-
className: "rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid-cols-8 rf-grid-rows-12",
|
|
142
|
+
className: "rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid rf-grid-cols-8 rf-grid-rows-12",
|
|
213
143
|
style: {
|
|
214
|
-
display: $167bfc94e5487988$var$veilleRelatedRoutes.includes(route) ? 'grid' : 'none',
|
|
215
144
|
...spring
|
|
216
145
|
},
|
|
217
146
|
children: [
|
|
218
147
|
/*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsx)((0, $kL6vX.default), {}),
|
|
219
|
-
veilleConfiguration.autoExitFromWebcam &&
|
|
148
|
+
veilleConfiguration.autoExitFromWebcam && /*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsx)((0, $8sMtK.default), {
|
|
220
149
|
detectionThreshold: 0.95,
|
|
221
|
-
onFaceDetected: ()=>
|
|
150
|
+
onFaceDetected: ()=>handleClose()
|
|
222
151
|
}),
|
|
223
152
|
route === (0, $7WHA7.Routes).EmptyVeille && /*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsx)((0, $8KeRZ.default), {}),
|
|
224
153
|
route === (0, $7WHA7.Routes).NewsInVeille && /*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsx)((0, $2sSL9.default), {
|
|
@@ -244,9 +173,9 @@ const $167bfc94e5487988$var$VeilleManager = ()=>{
|
|
|
244
173
|
})
|
|
245
174
|
]
|
|
246
175
|
}),
|
|
247
|
-
|
|
176
|
+
/*#__PURE__*/ (0, $ehKZo$reactjsxruntime.jsx)("div", {
|
|
248
177
|
className: "rf-z-overlay rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-transparent rf-cursor-pointer",
|
|
249
|
-
onClick: ()=>
|
|
178
|
+
onClick: ()=>handleClose()
|
|
250
179
|
})
|
|
251
180
|
]
|
|
252
181
|
});
|
|
@@ -577,4 +506,4 @@ var $a2463c3887d0d0a1$export$2e2bcd8739ae039 = $a2463c3887d0d0a1$var$SlideShow;
|
|
|
577
506
|
|
|
578
507
|
|
|
579
508
|
|
|
580
|
-
//# sourceMappingURL=VeilleManager.
|
|
509
|
+
//# sourceMappingURL=VeilleManager.26dcadac.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,uCAAiB;AAMvB,MAAM,sCAAgB,CAAC,WAAE,OAAO,EAAsB;QA0FrC,wCAAA,4BACE,yCAAA,6BAQD,sCAAA,6BACC,uCAAA;IAnGjB,MAAM,WAAW,CAAA,GAAA,6BAAU;IAC3B,MAAM,QAAQ,CAAA,GAAA,6BAAU,EAAE,CAAC,QAAqB,MAAM,WAAW,CAAC,KAAK;IACvE,MAAM,sBAAsB,CAAA,GAAA,6BAAU,EAAE,CAAC,QAAqB,MAAM,WAAW,CAAC,mBAAmB;IACnG,MAAM,QAAQ,CAAA,GAAA,6BAAU,EAAE,CAAC,QAAqB,MAAM,aAAa,CAAC,KAAK;IAEzE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,qBAAO,EAAW;IAE1C,MAAM,gBAAgB,CAAA,GAAA,mBAAK,EAAuB;IAClD,MAAM,6BAA6B,CAAA,GAAA,mBAAK,EAAiB,EAAE;IAC3D,MAAM,0BAA0B,CAAA,GAAA,mBAAK,EAAU;IAC/C,MAAM,eAAe,CAAA,GAAA,mBAAK,EAAwC;IAClE,MAAM,cAAc,CAAA,GAAA,mBAAK,EAAW;IAEpC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAA,GAAA,+BAAQ,EAAE,IAAO,CAAA;YACrC,MAAM;gBAAE,SAAS;YAAE;QACrB,CAAA;IAEA,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,KAAK,CAAC;YACR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,SAAU,OAAO,KAAI,aAAa,SAAS,OAAO;QAClD,IAAI,iBAAA,2BAAA,KAAM,MAAM,EACd,SAAS,OAAO,GAAG,WAAW;YAC5B,iBAAiB,KAAK,MAAM,GAAG,IAAK,OAAO,gBAAgB,KAAK,gBAAiB,gBAAgB,eAAe;QAClH,GAAG,AAAC,CAAA,SAAS,CAAA,IAAK;aAElB;IAEJ,GAAG;QAAC;KAAa;IAEjB,CAAA,GAAA,sBAAQ,EAAE;QACR,OAAO;YACL,CAAA,qBAAA,+BAAA,SAAU,OAAO,KAAI,aAAa,SAAS,OAAO;YAClD,CAAA,yBAAA,mCAAA,aAAc,OAAO,KAAI,aAAa,aAAa,OAAO;QAC5D;IACF,GAAG,EAAE;IAEL,qBACE,gCAAC,CAAA,GAAA,8BAAO,EAAE,GAAG;QAAC,WAAU;QAAwH,OAAO;YAAE,GAAG,MAAM;QAAC;kBACjK,cAAA,gCAAC;YAAI,WAAW,GAAG,OAAO,WAAW,GAAG,OAAO,UAAU,GAAG,cAAc,aAAa;YAAE,KAAK,CAAA,iBAAA,2BAAA,IAAM,CAAC,aAAa,KAAI;YAAI,KAAI;;;AAGpI;IAEA,2CAAe","sources":["src/components/Veille/VeilleManager.tsx","src/components/Veille/CallToAction.tsx","src/components/Icons/Miscellaneous/TouchIcon.tsx","src/components/Veille/FaceDetector.tsx","src/components/Veille/EmptyVeille.tsx","src/components/Veille/ScreenSaver.tsx","src/components/Veille/SlideShow.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\nimport { useSelector, useDispatch } from 'react-redux'\r\nimport { RootState, storeActions } from '../../store'\r\n\r\nimport { Routes } from '../../models/enums'\r\nimport type { VeilleConfiguration } from '../../models/types'\r\n\r\nimport NewsView from '../Views/NewsView'\r\nimport CallToAction from './CallToAction'\r\nimport FaceDetector from './FaceDetector'\r\nimport EmptyVeille from './EmptyVeille'\r\nimport ScreenSaver from './ScreenSaver'\r\nimport SlideShow from './SlideShow'\r\n\r\nconst springDuration = 500\r\n\r\ninterface VeilleManagerProps {\r\n onClose: () => void\r\n}\r\n\r\nconst VeilleManager = ({ onClose }: VeilleManagerProps) => {\r\n const dispatch = useDispatch()\r\n const route = useSelector((state: RootState) => state.viewReducer.route)\r\n const veilleConfiguration = useSelector((state: RootState) => state.viewReducer.veilleConfiguration)\r\n const muted = useSelector((state: RootState) => state.speechReducer.muted)\r\n\r\n const [loop, setLoop] = useState<boolean>(false)\r\n\r\n const veilleDataRef = useRef<VeilleConfiguration>(veilleConfiguration)\r\n const availableItemsToDisplayRef = useRef<Array<Routes>>([])\r\n const currentItemDisplayedRef = useRef<number>(0)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const oldMutedRef = useRef<boolean>(muted)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: { opacity: 0 }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: { opacity: 0 },\r\n to: { opacity: 1 },\r\n config: { duration: springDuration }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: { opacity: 1 },\r\n to: { opacity: 0 },\r\n config: { duration: springDuration }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Switch back the muted state (it could have not been changed but for security let's set it)\r\n dispatch(storeActions.speech.setMuted(oldMutedRef.current))\r\n // Get back to home view\r\n dispatch(storeActions.view.setRoute(Routes.Home))\r\n onClose()\r\n }, springDuration)\r\n }\r\n\r\n const switchComponent = (): void => {\r\n if (availableItemsToDisplayRef.current.length > currentItemDisplayedRef.current + 1) {\r\n currentItemDisplayedRef.current++\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current[currentItemDisplayedRef.current]))\r\n } else {\r\n currentItemDisplayedRef.current = 0\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current[0]))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n veilleDataRef.current = veilleConfiguration\r\n const tempViewArray: Array<Routes> = []\r\n veilleConfiguration.views?.screenSaver?.enabled && tempViewArray.push(Routes.ScreenSaver)\r\n veilleConfiguration.views?.news?.enabled && tempViewArray.push(Routes.NewsInVeille)\r\n veilleConfiguration.views?.slideShow?.enabled && tempViewArray.push(Routes.SlideShow)\r\n // Set loop if there is only 1 item to display\r\n setLoop(tempViewArray.length === 1)\r\n availableItemsToDisplayRef.current = tempViewArray\r\n currentItemDisplayedRef.current = 0\r\n // Mute the sound if the news in veille has to be muted\r\n veilleDataRef.current.views?.news?.muted && dispatch(storeActions.speech.setMuted(true))\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : Routes.EmptyVeille))\r\n\r\n return () => {\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n // Switch back the muted state (it could have not been changed but for security let's set it)\r\n dispatch(storeActions.speech.setMuted(oldMutedRef.current))\r\n }\r\n }, [])\r\n\r\n return (\r\n <React.Fragment>\r\n <animated.div\r\n id='retorik-framework-veille-manager'\r\n className='rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid rf-grid-cols-8 rf-grid-rows-12'\r\n style={{\r\n ...spring\r\n }}\r\n >\r\n <CallToAction />\r\n {veilleConfiguration.autoExitFromWebcam && <FaceDetector detectionThreshold={0.95} onFaceDetected={() => handleClose()} />}\r\n\r\n {route === Routes.EmptyVeille && <EmptyVeille />}\r\n {route === Routes.NewsInVeille && <NewsView hideMenu={true} isRetorikNews={true} handleEndedWithoutloop={switchComponent} loop={loop} fromVeille={true} />}\r\n {route === Routes.ScreenSaver && (\r\n <ScreenSaver\r\n url={veilleConfiguration.views?.screenSaver?.url}\r\n timer={veilleConfiguration.views?.screenSaver?.timerBeforeSwitchInSeconds}\r\n loop={loop}\r\n springDuration={springDuration}\r\n switchComponent={switchComponent}\r\n />\r\n )}\r\n {route === Routes.SlideShow && (\r\n <SlideShow\r\n urls={veilleConfiguration.views?.slideShow?.urls}\r\n timer={veilleConfiguration.views?.slideShow?.timerBeforeSwitchInSeconds}\r\n loop={loop}\r\n springDuration={springDuration}\r\n switchComponent={switchComponent}\r\n />\r\n )}\r\n </animated.div>\r\n\r\n {/* Overlay to exit the veille */}\r\n <div className='rf-z-overlay rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-transparent rf-cursor-pointer' onClick={() => handleClose()} />\r\n </React.Fragment>\r\n )\r\n}\r\n\r\nexport default VeilleManager\r\n","import React, { useState } from 'react'\r\nimport { useSelector } from 'react-redux'\r\nimport { RootState } from '../../store'\r\nimport { getColorWithTransparency } from '../../utils/colorUtils'\r\nimport TouchIcon from '../Icons/Miscellaneous/TouchIcon'\r\n\r\nconst CallToAction = (): JSX.Element => {\r\n const themeColors = useSelector((state: RootState) => state.viewReducer.themeColors)\r\n const [colorWithTransparency] = useState<string>(getColorWithTransparency(themeColors.primary, 0.5))\r\n\r\n return (\r\n <div className='rf-absolute rf-z-ui rf-bottom-0 rf-right-0 rf-w-80 rf-h-80 rf-grid rf-grid-cols-1 rf-grid-rows-1 rf-justify-end rf-justify-items-end rf-content-end rf-items-end rf-text-center rf-overflow-hidden rf-z-10'>\r\n <div className='rf-relative rf-col-start-1 rf-col-end-2 rf-row-start-1 rf-row-end-2 rf-w-48 rf-h-36 rf-rotate-45 rf-translate-y-8' style={{ backgroundColor: colorWithTransparency }}></div>\r\n <div className='rf-relative rf-col-start-1 rf-col-end-2 rf-row-start-1 rf-row-end-2 rf-w-50 rf-h-32 rf-flex rf-flex-col rf-gap-2 rf-justify-center rf-items-center rf-text-white'>\r\n <TouchIcon />\r\n <p className='rf-mx-4'>Click on screen to start</p>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default CallToAction\r\n","import React from \"react\";\r\nimport type { IconDefaultProps } from '../../../models/types'\r\n\r\nconst TouchIcon = ({ className, color }: IconDefaultProps) => {\r\n return (\r\n <svg\r\n viewBox=\"0 0 48 67\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n stroke={color || 'currentColor'}\r\n fill={color || 'currentColor'}\r\n className={className || 'rf-h-12 rf-w-12'}\r\n >\r\n <path\r\n d=\"m41 24c-1.7 0-3.2 0.65-4.4 1.7-1.2-1.1-2.7-1.7-4.4-1.7-1.7 0-3.2 0.65-4.4 1.7-0.48-0.44-1-0.8-1.6-1.1 2.1-2.6 3.4-6 3.4-9.5 2.8e-4 -8.3-6.7-15-15-15-8.3 0-15 6.7-15 15 0 5.8 3.3 11 8.4 13v18c0 11 8.9 20 20 20 11 0 20-8.9 20-20v-16c0-3.6-2.9-6.6-6.6-6.6zm-37-8.8c0-5.9 4.8-11 11-11 5.9 0 11 4.8 11 11 0 3.4-1.6 6.5-4.1 8.5v-8.5c0-3.6-2.9-6.6-6.6-6.6-3.6 0-6.6 2.9-6.6 6.6v8.5c-2.6-2-4.1-5.1-4.1-8.5zm39 32c0 8.5-6.9 15-15 15-8.5 0-15-6.9-15-15v-20c4e-3 -0.072 4e-3 -0.14 0-0.22v-12c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v20c0 1.2 0.96 2.1 2.1 2.1 1.2 0 2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3s2.3 1 2.3 2.3v4.7c0 1.2 0.96 2.1 2.1 2.1 1.2 0 2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v4.7c0 1.2 0.96 2.1 2.1 2.1s2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v16z\"\r\n strokeWidth=\".29\"\r\n />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default TouchIcon;\r\n","import React, { useEffect, useState, useRef } from 'react'\r\nimport { FaceDetector as MediapipeFaceDetector, FilesetResolver, Detection } from '@mediapipe/tasks-vision'\r\n\r\ninterface FaceDetectorProps {\r\n detectionThreshold: number\r\n onFaceDetected: (detections?: Array<Detection>, imageWidth?: number, imageHeight?: number) => void\r\n showThumbnail?: boolean\r\n rotation?: number\r\n}\r\n\r\nconst runningMode = 'VIDEO'\r\nlet lastVideoTime = -1\r\nconst defaultConstraints: MediaStreamConstraints = {\r\n video: {\r\n facingMode: 'user'\r\n }\r\n}\r\n\r\nconst FaceDetector = ({ detectionThreshold, onFaceDetected, showThumbnail, rotation }: FaceDetectorProps): JSX.Element => {\r\n const [webcamWidth, setWebcamWidth] = useState<number>(0)\r\n const [webcamHeight, setWebcamHeight] = useState<number>(0)\r\n const [faceDetector, setFaceDetector] = useState<MediapipeFaceDetector | undefined>()\r\n const videoRef = useRef<HTMLVideoElement>(null)\r\n const rotationRef = useRef<number>(rotation || 0)\r\n\r\n useEffect(() => {\r\n rotationRef.current = rotation || 0\r\n }, [rotation])\r\n\r\n useEffect(() => {\r\n const createfaceDetector = async () => {\r\n const vision = await FilesetResolver.forVisionTasks('https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.0/wasm')\r\n const newFaceDetector = await MediapipeFaceDetector.createFromOptions(vision, {\r\n baseOptions: {\r\n modelAssetPath: `https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite`,\r\n delegate: 'GPU'\r\n },\r\n runningMode: runningMode\r\n })\r\n\r\n newFaceDetector && setFaceDetector(newFaceDetector)\r\n }\r\n\r\n const initializefaceDetector = async () => {\r\n navigator.mediaDevices\r\n .getUserMedia(defaultConstraints)\r\n .then((display) => {\r\n const settings = display.getVideoTracks()[0].getSettings()\r\n setWebcamWidth(settings.width || 0)\r\n setWebcamHeight(settings.height || 0)\r\n createfaceDetector()\r\n })\r\n .catch((error) => console.warn('Retorik Framework > an error occured when trying to use the webcam : ', error))\r\n }\r\n\r\n initializefaceDetector()\r\n }, [])\r\n\r\n const predictWebcam = async () => {\r\n if (faceDetector && videoRef.current) {\r\n let startTimeMs = performance.now()\r\n\r\n // Detect faces using detectForVideo\r\n if (videoRef.current.currentTime !== lastVideoTime) {\r\n lastVideoTime = videoRef.current.currentTime\r\n const detections = faceDetector.detectForVideo(videoRef.current, startTimeMs, { rotationDegrees: rotationRef.current }).detections\r\n\r\n if (detections.length) {\r\n const score = detections[0].categories[0].score\r\n score > detectionThreshold && onFaceDetected(detections, videoRef.current.videoWidth, videoRef.current.videoHeight)\r\n }\r\n }\r\n }\r\n\r\n // Call this function again to keep predicting when the browser is ready\r\n window.requestAnimationFrame(predictWebcam)\r\n }\r\n\r\n useEffect(() => {\r\n if (faceDetector && videoRef.current) {\r\n // Activate the webcam stream\r\n navigator.mediaDevices\r\n .getUserMedia(defaultConstraints)\r\n .then((stream) => {\r\n if (videoRef.current) {\r\n videoRef.current.srcObject = stream\r\n videoRef.current.addEventListener('loadeddata', predictWebcam)\r\n }\r\n })\r\n .catch((err) => {\r\n console.error(err)\r\n })\r\n }\r\n }, [faceDetector])\r\n\r\n return (\r\n <div id='retorik-framework-face-detector' className={`rf-absolute rf-top-0 rf-left-0 ${!showThumbnail && 'rf-invisible'}`}>\r\n <video\r\n ref={videoRef}\r\n src=''\r\n autoPlay\r\n style={{\r\n rotate: `${rotation}deg`,\r\n width: showThumbnail ? webcamWidth / 2 : webcamWidth,\r\n height: showThumbnail ? webcamHeight / 2 : webcamHeight\r\n }}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nexport default FaceDetector\r\n","import React from 'react'\r\n\r\nconst EmptyVeille = () => {\r\n return (\r\n <div className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-black rf-flex rf-justify-center rf-items-center'>\r\n <div className='rf-uppercase rf-font-bold rf-text-3xl rf-text-white rf-animate-pulse'>click or tap on the screen...</div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default EmptyVeille\r\n","import React, { useEffect, useRef } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\n\r\ninterface ScreenSaverProps {\r\n url?: string\r\n timer?: number\r\n loop?: boolean\r\n springDuration: number\r\n switchComponent: () => void\r\n}\r\n\r\nconst ScreenSaver = ({ url, timer, loop, springDuration, switchComponent }: ScreenSaverProps) => {\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: {\r\n opacity: 0\r\n }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: {\r\n opacity: 1\r\n },\r\n to: {\r\n opacity: 0\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Get back to home view\r\n switchComponent()\r\n }, springDuration)\r\n }\r\n\r\n useEffect(() => {\r\n if (!loop) {\r\n timerRef.current = setTimeout(() => {\r\n handleClose()\r\n }, (timer || 8) * 1000 - springDuration)\r\n }\r\n\r\n return () => {\r\n timerRef.current && clearTimeout(timerRef.current)\r\n fadeTimerRef.current && clearTimeout(fadeTimerRef.current)\r\n }\r\n }, [])\r\n\r\n return (\r\n <animated.div\r\n className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full'\r\n style={{\r\n backgroundImage: `url(${url})`,\r\n backgroundPosition: 'center',\r\n backgroundRepeat: 'no-repeat',\r\n backgroundSize: 'cover',\r\n ...spring\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default ScreenSaver\r\n","import React, { useEffect, useState, useRef } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\n\r\ninterface SlideShowProps {\r\n urls?: Array<string>\r\n timer?: number\r\n loop?: boolean\r\n springDuration: number\r\n switchComponent: () => void\r\n}\r\n\r\nconst SlideShow = ({ urls, timer, loop, springDuration, switchComponent }: SlideShowProps) => {\r\n const [currentIndex, setCurrentIndex] = useState<number>(0)\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: {\r\n opacity: 0\r\n }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: {\r\n opacity: 1\r\n },\r\n to: {\r\n opacity: 0\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Get back to home view\r\n switchComponent()\r\n }, springDuration)\r\n }\r\n\r\n useEffect(() => {\r\n timerRef?.current && clearTimeout(timerRef.current)\r\n if (urls?.length) {\r\n timerRef.current = setTimeout(() => {\r\n currentIndex === urls.length - 1 ? (loop ? setCurrentIndex(0) : handleClose()) : setCurrentIndex(currentIndex + 1)\r\n }, (timer || 5) * 1000)\r\n } else {\r\n switchComponent()\r\n }\r\n }, [currentIndex])\r\n\r\n useEffect(() => {\r\n return () => {\r\n timerRef?.current && clearTimeout(timerRef.current)\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n }\r\n }, [])\r\n\r\n return (\r\n <animated.div className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-flex rf-justify-center rf-items-center rf-bg-black' style={{ ...spring }}>\r\n <img className={`${window.innerHeight > window.innerWidth ? 'rf-w-full' : 'rf-h-full'}`} src={urls?.[currentIndex] || ''} alt='slideshow' />\r\n </animated.div>\r\n )\r\n}\r\n\r\nexport default SlideShow\r\n"],"names":[],"version":3,"file":"VeilleManager.26dcadac.js.map","sourceRoot":"../"}
|
|
@@ -42,27 +42,15 @@ var $62g7u = parcelRequire("62g7u");
|
|
|
42
42
|
|
|
43
43
|
var $kBIQ4 = parcelRequire("kBIQ4");
|
|
44
44
|
const $ae415dac8b23893c$var$springDuration = 500;
|
|
45
|
-
const $ae415dac8b23893c$var$
|
|
46
|
-
(0, $4ucVo.Routes).EmptyVeille,
|
|
47
|
-
(0, $4ucVo.Routes).NewsInVeille,
|
|
48
|
-
(0, $4ucVo.Routes).ScreenSaver,
|
|
49
|
-
(0, $4ucVo.Routes).SlideShow
|
|
50
|
-
];
|
|
51
|
-
const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
45
|
+
const $ae415dac8b23893c$var$VeilleManager = ({ onClose: onClose })=>{
|
|
52
46
|
const dispatch = (0, $1cDKu$useDispatch)();
|
|
53
|
-
const addressData = (0, $1cDKu$useSelector)((state)=>state.retorikReducer.addressData);
|
|
54
|
-
const loaderClosed = (0, $1cDKu$useSelector)((state)=>state.retorikReducer.loaderClosed);
|
|
55
|
-
const appAvailable = (0, $1cDKu$useSelector)((state)=>state.retorikReducer.appAvailable);
|
|
56
47
|
const route = (0, $1cDKu$useSelector)((state)=>state.viewReducer.route);
|
|
57
48
|
const veilleConfiguration = (0, $1cDKu$useSelector)((state)=>state.viewReducer.veilleConfiguration);
|
|
58
49
|
const muted = (0, $1cDKu$useSelector)((state)=>state.speechReducer.muted);
|
|
59
|
-
const typingCount = (0, $1cDKu$useSelector)((state)=>state.directlineReducer.typingCount);
|
|
60
|
-
const [veilleLaunched, setVeilleLaunched] = (0, $1cDKu$useState)(false);
|
|
61
50
|
const [loop, setLoop] = (0, $1cDKu$useState)(false);
|
|
62
51
|
const veilleDataRef = (0, $1cDKu$useRef)(veilleConfiguration);
|
|
63
52
|
const availableItemsToDisplayRef = (0, $1cDKu$useRef)([]);
|
|
64
53
|
const currentItemDisplayedRef = (0, $1cDKu$useRef)(0);
|
|
65
|
-
const timerRef = (0, $1cDKu$useRef)(null);
|
|
66
54
|
const fadeTimerRef = (0, $1cDKu$useRef)(null);
|
|
67
55
|
const oldMutedRef = (0, $1cDKu$useRef)(muted);
|
|
68
56
|
const [spring, api] = (0, $1cDKu$useSpring)(()=>({
|
|
@@ -71,7 +59,7 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
71
59
|
}
|
|
72
60
|
}));
|
|
73
61
|
(0, $1cDKu$useEffect)(()=>{
|
|
74
|
-
|
|
62
|
+
api.start({
|
|
75
63
|
from: {
|
|
76
64
|
opacity: 0
|
|
77
65
|
},
|
|
@@ -82,9 +70,7 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
82
70
|
duration: $ae415dac8b23893c$var$springDuration
|
|
83
71
|
}
|
|
84
72
|
});
|
|
85
|
-
}, [
|
|
86
|
-
veilleLaunched
|
|
87
|
-
]);
|
|
73
|
+
}, []);
|
|
88
74
|
const handleClose = ()=>{
|
|
89
75
|
api.start({
|
|
90
76
|
from: {
|
|
@@ -103,47 +89,9 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
103
89
|
dispatch((0, $8ItUL.storeActions).speech.setMuted(oldMutedRef.current));
|
|
104
90
|
// Get back to home view
|
|
105
91
|
dispatch((0, $8ItUL.storeActions).view.setRoute((0, $4ucVo.Routes).Home));
|
|
92
|
+
onClose();
|
|
106
93
|
}, $ae415dac8b23893c$var$springDuration);
|
|
107
94
|
};
|
|
108
|
-
const launchVeille = async ()=>{
|
|
109
|
-
// Kill current directline if needed, and create a new one if the news are included in the veille
|
|
110
|
-
if (veilleDataRef.current.killConversationOnLaunch) {
|
|
111
|
-
await dispatch((0, $8ItUL.storeActions).directline.endConversation());
|
|
112
|
-
veilleDataRef.current.views?.news?.enabled && dispatch((0, $8ItUL.storeActions).directline.recreateDirectline({
|
|
113
|
-
addressData: addressData,
|
|
114
|
-
userId: `veille_${Date.now()}`,
|
|
115
|
-
skipWelcome: true
|
|
116
|
-
}));
|
|
117
|
-
}
|
|
118
|
-
// Set muted state to true if it is demanded in the configuration
|
|
119
|
-
veilleDataRef.current.views?.news?.muted && dispatch((0, $8ItUL.storeActions).speech.setMuted(true));
|
|
120
|
-
setVeilleLaunched(true);
|
|
121
|
-
dispatch((0, $8ItUL.storeActions).view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : (0, $4ucVo.Routes).EmptyVeille));
|
|
122
|
-
};
|
|
123
|
-
const refreshTimer = ()=>{
|
|
124
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
125
|
-
timerRef.current = setTimeout(()=>{
|
|
126
|
-
launchVeille();
|
|
127
|
-
}, (veilleDataRef.current.delayBeforeLaunchInSeconds || 120) * 1000);
|
|
128
|
-
};
|
|
129
|
-
const exitVeille = (firstTime)=>{
|
|
130
|
-
// Recreate directline if needed
|
|
131
|
-
if (!firstTime && veilleDataRef.current?.killConversationOnLaunch) {
|
|
132
|
-
// Reset directline if a new one has already been recreated for the news inside the veille
|
|
133
|
-
veilleDataRef.current.views?.news?.enabled && dispatch((0, $8ItUL.storeActions).directline.endConversation());
|
|
134
|
-
dispatch((0, $8ItUL.storeActions).directline.recreateDirectline({
|
|
135
|
-
addressData: addressData
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
setVeilleLaunched(false);
|
|
139
|
-
// Set back the current item's index to 0 and clear the timeout
|
|
140
|
-
currentItemDisplayedRef.current = 0;
|
|
141
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
142
|
-
// Launch the timer for veille opening
|
|
143
|
-
refreshTimer();
|
|
144
|
-
// Get back to home view if we came here to close the veille
|
|
145
|
-
!firstTime && handleClose();
|
|
146
|
-
};
|
|
147
95
|
const switchComponent = ()=>{
|
|
148
96
|
if (availableItemsToDisplayRef.current.length > currentItemDisplayedRef.current + 1) {
|
|
149
97
|
currentItemDisplayedRef.current++;
|
|
@@ -155,32 +103,18 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
155
103
|
};
|
|
156
104
|
(0, $1cDKu$useEffect)(()=>{
|
|
157
105
|
veilleDataRef.current = veilleConfiguration;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
veilleConfiguration,
|
|
170
|
-
appAvailable,
|
|
171
|
-
loaderClosed
|
|
172
|
-
]);
|
|
173
|
-
/**
|
|
174
|
-
* Refresh the timer of the veille on each typing activity emitted
|
|
175
|
-
*/ (0, $1cDKu$useEffect)(()=>{
|
|
176
|
-
!veilleLaunched && refreshTimer();
|
|
177
|
-
}, [
|
|
178
|
-
typingCount,
|
|
179
|
-
veilleLaunched
|
|
180
|
-
]);
|
|
181
|
-
(0, $1cDKu$useEffect)(()=>{
|
|
106
|
+
const tempViewArray = [];
|
|
107
|
+
veilleConfiguration.views?.screenSaver?.enabled && tempViewArray.push((0, $4ucVo.Routes).ScreenSaver);
|
|
108
|
+
veilleConfiguration.views?.news?.enabled && tempViewArray.push((0, $4ucVo.Routes).NewsInVeille);
|
|
109
|
+
veilleConfiguration.views?.slideShow?.enabled && tempViewArray.push((0, $4ucVo.Routes).SlideShow);
|
|
110
|
+
// Set loop if there is only 1 item to display
|
|
111
|
+
setLoop(tempViewArray.length === 1);
|
|
112
|
+
availableItemsToDisplayRef.current = tempViewArray;
|
|
113
|
+
currentItemDisplayedRef.current = 0;
|
|
114
|
+
// Mute the sound if the news in veille has to be muted
|
|
115
|
+
veilleDataRef.current.views?.news?.muted && dispatch((0, $8ItUL.storeActions).speech.setMuted(true));
|
|
116
|
+
dispatch((0, $8ItUL.storeActions).view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : (0, $4ucVo.Routes).EmptyVeille));
|
|
182
117
|
return ()=>{
|
|
183
|
-
timerRef.current && clearTimeout(timerRef.current);
|
|
184
118
|
fadeTimerRef?.current && clearTimeout(fadeTimerRef.current);
|
|
185
119
|
// Switch back the muted state (it could have not been changed but for security let's set it)
|
|
186
120
|
dispatch((0, $8ItUL.storeActions).speech.setMuted(oldMutedRef.current));
|
|
@@ -190,16 +124,15 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
190
124
|
children: [
|
|
191
125
|
/*#__PURE__*/ (0, $1cDKu$jsxs)((0, $1cDKu$animated).div, {
|
|
192
126
|
id: "retorik-framework-veille-manager",
|
|
193
|
-
className: "rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid-cols-8 rf-grid-rows-12",
|
|
127
|
+
className: "rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid rf-grid-cols-8 rf-grid-rows-12",
|
|
194
128
|
style: {
|
|
195
|
-
display: $ae415dac8b23893c$var$veilleRelatedRoutes.includes(route) ? 'grid' : 'none',
|
|
196
129
|
...spring
|
|
197
130
|
},
|
|
198
131
|
children: [
|
|
199
132
|
/*#__PURE__*/ (0, $1cDKu$jsx)((0, $lmkZT.default), {}),
|
|
200
|
-
veilleConfiguration.autoExitFromWebcam &&
|
|
133
|
+
veilleConfiguration.autoExitFromWebcam && /*#__PURE__*/ (0, $1cDKu$jsx)((0, $dJb7j.default), {
|
|
201
134
|
detectionThreshold: 0.95,
|
|
202
|
-
onFaceDetected: ()=>
|
|
135
|
+
onFaceDetected: ()=>handleClose()
|
|
203
136
|
}),
|
|
204
137
|
route === (0, $4ucVo.Routes).EmptyVeille && /*#__PURE__*/ (0, $1cDKu$jsx)((0, $9fA0k.default), {}),
|
|
205
138
|
route === (0, $4ucVo.Routes).NewsInVeille && /*#__PURE__*/ (0, $1cDKu$jsx)((0, $6Wtfz.default), {
|
|
@@ -225,9 +158,9 @@ const $ae415dac8b23893c$var$VeilleManager = ()=>{
|
|
|
225
158
|
})
|
|
226
159
|
]
|
|
227
160
|
}),
|
|
228
|
-
|
|
161
|
+
/*#__PURE__*/ (0, $1cDKu$jsx)("div", {
|
|
229
162
|
className: "rf-z-overlay rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-transparent rf-cursor-pointer",
|
|
230
|
-
onClick: ()=>
|
|
163
|
+
onClick: ()=>handleClose()
|
|
231
164
|
})
|
|
232
165
|
]
|
|
233
166
|
});
|
|
@@ -558,4 +491,4 @@ var $8ccf4a1e66e2b9e3$export$2e2bcd8739ae039 = $8ccf4a1e66e2b9e3$var$SlideShow;
|
|
|
558
491
|
|
|
559
492
|
|
|
560
493
|
|
|
561
|
-
//# sourceMappingURL=VeilleManager.
|
|
494
|
+
//# sourceMappingURL=VeilleManager.72cf0e9c.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,uCAAiB;AAMvB,MAAM,sCAAgB,CAAC,WAAE,OAAO,EAAsB;IACpD,MAAM,WAAW,CAAA,GAAA,kBAAU;IAC3B,MAAM,QAAQ,CAAA,GAAA,kBAAU,EAAE,CAAC,QAAqB,MAAM,WAAW,CAAC,KAAK;IACvE,MAAM,sBAAsB,CAAA,GAAA,kBAAU,EAAE,CAAC,QAAqB,MAAM,WAAW,CAAC,mBAAmB;IACnG,MAAM,QAAQ,CAAA,GAAA,kBAAU,EAAE,CAAC,QAAqB,MAAM,aAAa,CAAC,KAAK;IAEzE,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAA,GAAA,eAAO,EAAW;IAE1C,MAAM,gBAAgB,CAAA,GAAA,aAAK,EAAuB;IAClD,MAAM,6BAA6B,CAAA,GAAA,aAAK,EAAiB,EAAE;IAC3D,MAAM,0BAA0B,CAAA,GAAA,aAAK,EAAU;IAC/C,MAAM,eAAe,CAAA,GAAA,aAAK,EAAwC;IAClE,MAAM,cAAc,CAAA,GAAA,aAAK,EAAW;IAEpC,MAAM,CAAC,QAAQ,IAAI,GAAG,CAAA,GAAA,gBAAQ,EAAE,IAAO,CAAA;YACrC,MAAM;gBAAE,S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ille/VeilleManager.tsx","src/components/Veille/CallToAction.tsx","src/components/Icons/Miscellaneous/TouchIcon.tsx","src/components/Veille/FaceDetector.tsx","src/components/Veille/EmptyVeille.tsx","src/components/Veille/ScreenSaver.tsx","src/components/Veille/SlideShow.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\nimport { useSelector, useDispatch } from 'react-redux'\r\nimport { RootState, storeActions } from '../../store'\r\n\r\nimport { Routes } from '../../models/enums'\r\nimport type { VeilleConfiguration } from '../../models/types'\r\n\r\nimport NewsView from '../Views/NewsView'\r\nimport CallToAction from './CallToAction'\r\nimport FaceDetector from './FaceDetector'\r\nimport EmptyVeille from './EmptyVeille'\r\nimport ScreenSaver from './ScreenSaver'\r\nimport SlideShow from './SlideShow'\r\n\r\nconst springDuration = 500\r\n\r\ninterface VeilleManagerProps {\r\n onClose: () => void\r\n}\r\n\r\nconst VeilleManager = ({ onClose }: VeilleManagerProps) => {\r\n const dispatch = useDispatch()\r\n const route = useSelector((state: RootState) => state.viewReducer.route)\r\n const veilleConfiguration = useSelector((state: RootState) => state.viewReducer.veilleConfiguration)\r\n const muted = useSelector((state: RootState) => state.speechReducer.muted)\r\n\r\n const [loop, setLoop] = useState<boolean>(false)\r\n\r\n const veilleDataRef = useRef<VeilleConfiguration>(veilleConfiguration)\r\n const availableItemsToDisplayRef = useRef<Array<Routes>>([])\r\n const currentItemDisplayedRef = useRef<number>(0)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const oldMutedRef = useRef<boolean>(muted)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: { opacity: 0 }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: { opacity: 0 },\r\n to: { opacity: 1 },\r\n config: { duration: springDuration }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: { opacity: 1 },\r\n to: { opacity: 0 },\r\n config: { duration: springDuration }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Switch back the muted state (it could have not been changed but for security let's set it)\r\n dispatch(storeActions.speech.setMuted(oldMutedRef.current))\r\n // Get back to home view\r\n dispatch(storeActions.view.setRoute(Routes.Home))\r\n onClose()\r\n }, springDuration)\r\n }\r\n\r\n const switchComponent = (): void => {\r\n if (availableItemsToDisplayRef.current.length > currentItemDisplayedRef.current + 1) {\r\n currentItemDisplayedRef.current++\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current[currentItemDisplayedRef.current]))\r\n } else {\r\n currentItemDisplayedRef.current = 0\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current[0]))\r\n }\r\n }\r\n\r\n useEffect(() => {\r\n veilleDataRef.current = veilleConfiguration\r\n const tempViewArray: Array<Routes> = []\r\n veilleConfiguration.views?.screenSaver?.enabled && tempViewArray.push(Routes.ScreenSaver)\r\n veilleConfiguration.views?.news?.enabled && tempViewArray.push(Routes.NewsInVeille)\r\n veilleConfiguration.views?.slideShow?.enabled && tempViewArray.push(Routes.SlideShow)\r\n // Set loop if there is only 1 item to display\r\n setLoop(tempViewArray.length === 1)\r\n availableItemsToDisplayRef.current = tempViewArray\r\n currentItemDisplayedRef.current = 0\r\n // Mute the sound if the news in veille has to be muted\r\n veilleDataRef.current.views?.news?.muted && dispatch(storeActions.speech.setMuted(true))\r\n dispatch(storeActions.view.setRoute(availableItemsToDisplayRef.current.length ? availableItemsToDisplayRef.current[0] : Routes.EmptyVeille))\r\n\r\n return () => {\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n // Switch back the muted state (it could have not been changed but for security let's set it)\r\n dispatch(storeActions.speech.setMuted(oldMutedRef.current))\r\n }\r\n }, [])\r\n\r\n return (\r\n <React.Fragment>\r\n <animated.div\r\n id='retorik-framework-veille-manager'\r\n className='rf-relative rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-grid rf-grid-cols-8 rf-grid-rows-12'\r\n style={{\r\n ...spring\r\n }}\r\n >\r\n <CallToAction />\r\n {veilleConfiguration.autoExitFromWebcam && <FaceDetector detectionThreshold={0.95} onFaceDetected={() => handleClose()} />}\r\n\r\n {route === Routes.EmptyVeille && <EmptyVeille />}\r\n {route === Routes.NewsInVeille && <NewsView hideMenu={true} isRetorikNews={true} handleEndedWithoutloop={switchComponent} loop={loop} fromVeille={true} />}\r\n {route === Routes.ScreenSaver && (\r\n <ScreenSaver\r\n url={veilleConfiguration.views?.screenSaver?.url}\r\n timer={veilleConfiguration.views?.screenSaver?.timerBeforeSwitchInSeconds}\r\n loop={loop}\r\n springDuration={springDuration}\r\n switchComponent={switchComponent}\r\n />\r\n )}\r\n {route === Routes.SlideShow && (\r\n <SlideShow\r\n urls={veilleConfiguration.views?.slideShow?.urls}\r\n timer={veilleConfiguration.views?.slideShow?.timerBeforeSwitchInSeconds}\r\n loop={loop}\r\n springDuration={springDuration}\r\n switchComponent={switchComponent}\r\n />\r\n )}\r\n </animated.div>\r\n\r\n {/* Overlay to exit the veille */}\r\n <div className='rf-z-overlay rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-transparent rf-cursor-pointer' onClick={() => handleClose()} />\r\n </React.Fragment>\r\n )\r\n}\r\n\r\nexport default VeilleManager\r\n","import React, { useState } from 'react'\r\nimport { useSelector } from 'react-redux'\r\nimport { RootState } from '../../store'\r\nimport { getColorWithTransparency } from '../../utils/colorUtils'\r\nimport TouchIcon from '../Icons/Miscellaneous/TouchIcon'\r\n\r\nconst CallToAction = (): JSX.Element => {\r\n const themeColors = useSelector((state: RootState) => state.viewReducer.themeColors)\r\n const [colorWithTransparency] = useState<string>(getColorWithTransparency(themeColors.primary, 0.5))\r\n\r\n return (\r\n <div className='rf-absolute rf-z-ui rf-bottom-0 rf-right-0 rf-w-80 rf-h-80 rf-grid rf-grid-cols-1 rf-grid-rows-1 rf-justify-end rf-justify-items-end rf-content-end rf-items-end rf-text-center rf-overflow-hidden rf-z-10'>\r\n <div className='rf-relative rf-col-start-1 rf-col-end-2 rf-row-start-1 rf-row-end-2 rf-w-48 rf-h-36 rf-rotate-45 rf-translate-y-8' style={{ backgroundColor: colorWithTransparency }}></div>\r\n <div className='rf-relative rf-col-start-1 rf-col-end-2 rf-row-start-1 rf-row-end-2 rf-w-50 rf-h-32 rf-flex rf-flex-col rf-gap-2 rf-justify-center rf-items-center rf-text-white'>\r\n <TouchIcon />\r\n <p className='rf-mx-4'>Click on screen to start</p>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default CallToAction\r\n","import React from \"react\";\r\nimport type { IconDefaultProps } from '../../../models/types'\r\n\r\nconst TouchIcon = ({ className, color }: IconDefaultProps) => {\r\n return (\r\n <svg\r\n viewBox=\"0 0 48 67\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n stroke={color || 'currentColor'}\r\n fill={color || 'currentColor'}\r\n className={className || 'rf-h-12 rf-w-12'}\r\n >\r\n <path\r\n d=\"m41 24c-1.7 0-3.2 0.65-4.4 1.7-1.2-1.1-2.7-1.7-4.4-1.7-1.7 0-3.2 0.65-4.4 1.7-0.48-0.44-1-0.8-1.6-1.1 2.1-2.6 3.4-6 3.4-9.5 2.8e-4 -8.3-6.7-15-15-15-8.3 0-15 6.7-15 15 0 5.8 3.3 11 8.4 13v18c0 11 8.9 20 20 20 11 0 20-8.9 20-20v-16c0-3.6-2.9-6.6-6.6-6.6zm-37-8.8c0-5.9 4.8-11 11-11 5.9 0 11 4.8 11 11 0 3.4-1.6 6.5-4.1 8.5v-8.5c0-3.6-2.9-6.6-6.6-6.6-3.6 0-6.6 2.9-6.6 6.6v8.5c-2.6-2-4.1-5.1-4.1-8.5zm39 32c0 8.5-6.9 15-15 15-8.5 0-15-6.9-15-15v-20c4e-3 -0.072 4e-3 -0.14 0-0.22v-12c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v20c0 1.2 0.96 2.1 2.1 2.1 1.2 0 2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3s2.3 1 2.3 2.3v4.7c0 1.2 0.96 2.1 2.1 2.1 1.2 0 2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v4.7c0 1.2 0.96 2.1 2.1 2.1s2.1-0.96 2.1-2.1v-4.7c0-1.2 1-2.3 2.3-2.3 1.2 0 2.3 1 2.3 2.3v16z\"\r\n strokeWidth=\".29\"\r\n />\r\n </svg>\r\n );\r\n};\r\n\r\nexport default TouchIcon;\r\n","import React, { useEffect, useState, useRef } from 'react'\r\nimport { FaceDetector as MediapipeFaceDetector, FilesetResolver, Detection } from '@mediapipe/tasks-vision'\r\n\r\ninterface FaceDetectorProps {\r\n detectionThreshold: number\r\n onFaceDetected: (detections?: Array<Detection>, imageWidth?: number, imageHeight?: number) => void\r\n showThumbnail?: boolean\r\n rotation?: number\r\n}\r\n\r\nconst runningMode = 'VIDEO'\r\nlet lastVideoTime = -1\r\nconst defaultConstraints: MediaStreamConstraints = {\r\n video: {\r\n facingMode: 'user'\r\n }\r\n}\r\n\r\nconst FaceDetector = ({ detectionThreshold, onFaceDetected, showThumbnail, rotation }: FaceDetectorProps): JSX.Element => {\r\n const [webcamWidth, setWebcamWidth] = useState<number>(0)\r\n const [webcamHeight, setWebcamHeight] = useState<number>(0)\r\n const [faceDetector, setFaceDetector] = useState<MediapipeFaceDetector | undefined>()\r\n const videoRef = useRef<HTMLVideoElement>(null)\r\n const rotationRef = useRef<number>(rotation || 0)\r\n\r\n useEffect(() => {\r\n rotationRef.current = rotation || 0\r\n }, [rotation])\r\n\r\n useEffect(() => {\r\n const createfaceDetector = async () => {\r\n const vision = await FilesetResolver.forVisionTasks('https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.0/wasm')\r\n const newFaceDetector = await MediapipeFaceDetector.createFromOptions(vision, {\r\n baseOptions: {\r\n modelAssetPath: `https://storage.googleapis.com/mediapipe-models/face_detector/blaze_face_short_range/float16/1/blaze_face_short_range.tflite`,\r\n delegate: 'GPU'\r\n },\r\n runningMode: runningMode\r\n })\r\n\r\n newFaceDetector && setFaceDetector(newFaceDetector)\r\n }\r\n\r\n const initializefaceDetector = async () => {\r\n navigator.mediaDevices\r\n .getUserMedia(defaultConstraints)\r\n .then((display) => {\r\n const settings = display.getVideoTracks()[0].getSettings()\r\n setWebcamWidth(settings.width || 0)\r\n setWebcamHeight(settings.height || 0)\r\n createfaceDetector()\r\n })\r\n .catch((error) => console.warn('Retorik Framework > an error occured when trying to use the webcam : ', error))\r\n }\r\n\r\n initializefaceDetector()\r\n }, [])\r\n\r\n const predictWebcam = async () => {\r\n if (faceDetector && videoRef.current) {\r\n let startTimeMs = performance.now()\r\n\r\n // Detect faces using detectForVideo\r\n if (videoRef.current.currentTime !== lastVideoTime) {\r\n lastVideoTime = videoRef.current.currentTime\r\n const detections = faceDetector.detectForVideo(videoRef.current, startTimeMs, { rotationDegrees: rotationRef.current }).detections\r\n\r\n if (detections.length) {\r\n const score = detections[0].categories[0].score\r\n score > detectionThreshold && onFaceDetected(detections, videoRef.current.videoWidth, videoRef.current.videoHeight)\r\n }\r\n }\r\n }\r\n\r\n // Call this function again to keep predicting when the browser is ready\r\n window.requestAnimationFrame(predictWebcam)\r\n }\r\n\r\n useEffect(() => {\r\n if (faceDetector && videoRef.current) {\r\n // Activate the webcam stream\r\n navigator.mediaDevices\r\n .getUserMedia(defaultConstraints)\r\n .then((stream) => {\r\n if (videoRef.current) {\r\n videoRef.current.srcObject = stream\r\n videoRef.current.addEventListener('loadeddata', predictWebcam)\r\n }\r\n })\r\n .catch((err) => {\r\n console.error(err)\r\n })\r\n }\r\n }, [faceDetector])\r\n\r\n return (\r\n <div id='retorik-framework-face-detector' className={`rf-absolute rf-top-0 rf-left-0 ${!showThumbnail && 'rf-invisible'}`}>\r\n <video\r\n ref={videoRef}\r\n src=''\r\n autoPlay\r\n style={{\r\n rotate: `${rotation}deg`,\r\n width: showThumbnail ? webcamWidth / 2 : webcamWidth,\r\n height: showThumbnail ? webcamHeight / 2 : webcamHeight\r\n }}\r\n />\r\n </div>\r\n )\r\n}\r\n\r\nexport default FaceDetector\r\n","import React from 'react'\r\n\r\nconst EmptyVeille = () => {\r\n return (\r\n <div className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-bg-black rf-flex rf-justify-center rf-items-center'>\r\n <div className='rf-uppercase rf-font-bold rf-text-3xl rf-text-white rf-animate-pulse'>click or tap on the screen...</div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default EmptyVeille\r\n","import React, { useEffect, useRef } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\n\r\ninterface ScreenSaverProps {\r\n url?: string\r\n timer?: number\r\n loop?: boolean\r\n springDuration: number\r\n switchComponent: () => void\r\n}\r\n\r\nconst ScreenSaver = ({ url, timer, loop, springDuration, switchComponent }: ScreenSaverProps) => {\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: {\r\n opacity: 0\r\n }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: {\r\n opacity: 1\r\n },\r\n to: {\r\n opacity: 0\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Get back to home view\r\n switchComponent()\r\n }, springDuration)\r\n }\r\n\r\n useEffect(() => {\r\n if (!loop) {\r\n timerRef.current = setTimeout(() => {\r\n handleClose()\r\n }, (timer || 8) * 1000 - springDuration)\r\n }\r\n\r\n return () => {\r\n timerRef.current && clearTimeout(timerRef.current)\r\n fadeTimerRef.current && clearTimeout(fadeTimerRef.current)\r\n }\r\n }, [])\r\n\r\n return (\r\n <animated.div\r\n className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full'\r\n style={{\r\n backgroundImage: `url(${url})`,\r\n backgroundPosition: 'center',\r\n backgroundRepeat: 'no-repeat',\r\n backgroundSize: 'cover',\r\n ...spring\r\n }}\r\n />\r\n )\r\n}\r\n\r\nexport default ScreenSaver\r\n","import React, { useEffect, useState, useRef } from 'react'\r\nimport { useSpring, animated } from '@react-spring/web'\r\n\r\ninterface SlideShowProps {\r\n urls?: Array<string>\r\n timer?: number\r\n loop?: boolean\r\n springDuration: number\r\n switchComponent: () => void\r\n}\r\n\r\nconst SlideShow = ({ urls, timer, loop, springDuration, switchComponent }: SlideShowProps) => {\r\n const [currentIndex, setCurrentIndex] = useState<number>(0)\r\n const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n const fadeTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null)\r\n\r\n const [spring, api] = useSpring(() => ({\r\n from: {\r\n opacity: 0\r\n }\r\n }))\r\n\r\n useEffect(() => {\r\n api.start({\r\n from: {\r\n opacity: 0\r\n },\r\n to: {\r\n opacity: 1\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n }, [])\r\n\r\n const handleClose = (): void => {\r\n api.start({\r\n from: {\r\n opacity: 1\r\n },\r\n to: {\r\n opacity: 0\r\n },\r\n config: {\r\n duration: springDuration\r\n }\r\n })\r\n\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n fadeTimerRef.current = setTimeout(() => {\r\n // Get back to home view\r\n switchComponent()\r\n }, springDuration)\r\n }\r\n\r\n useEffect(() => {\r\n timerRef?.current && clearTimeout(timerRef.current)\r\n if (urls?.length) {\r\n timerRef.current = setTimeout(() => {\r\n currentIndex === urls.length - 1 ? (loop ? setCurrentIndex(0) : handleClose()) : setCurrentIndex(currentIndex + 1)\r\n }, (timer || 5) * 1000)\r\n } else {\r\n switchComponent()\r\n }\r\n }, [currentIndex])\r\n\r\n useEffect(() => {\r\n return () => {\r\n timerRef?.current && clearTimeout(timerRef.current)\r\n fadeTimerRef?.current && clearTimeout(fadeTimerRef.current)\r\n }\r\n }, [])\r\n\r\n return (\r\n <animated.div className='rf-col-start-1 rf-col-span-full rf-row-start-1 rf-row-span-full rf-flex rf-justify-center rf-items-center rf-bg-black' style={{ ...spring }}>\r\n <img className={`${window.innerHeight > window.innerWidth ? 'rf-w-full' : 'rf-h-full'}`} src={urls?.[currentIndex] || ''} alt='slideshow' />\r\n </animated.div>\r\n )\r\n}\r\n\r\nexport default SlideShow\r\n"],"names":[],"version":3,"file":"VeilleManager.72cf0e9c.js.map"}
|
package/dist/index.d.ts
CHANGED
|
@@ -755,6 +755,7 @@ export interface RetorikMainComponentConfiguration extends RetorikSharedProps {
|
|
|
755
755
|
GDPR?: GDPR;
|
|
756
756
|
customScripts?: Array<string>;
|
|
757
757
|
customCSS?: Array<string>;
|
|
758
|
+
enableVirtualKeyboard?: boolean;
|
|
758
759
|
}
|
|
759
760
|
export interface RetorikMainComponentProps extends RetorikMainComponentConfiguration {
|
|
760
761
|
menuConfig?: RetorikMenusConfiguration;
|