@davi-ai/retorik-framework 3.0.2 → 3.0.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.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +200 -64
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +198 -63
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -45,25 +45,6 @@ function $parcel$export(e, n, v, s) {
|
|
|
45
45
|
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
function $4e8fcace752f0f9d$export$2e2bcd8739ae039(RetorikAgent, props, element) {
|
|
49
|
-
const root = (0, $bZRJW$createRoot)(element);
|
|
50
|
-
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)(RetorikAgent, {
|
|
51
|
-
...props
|
|
52
|
-
}));
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
function $dafec95f7e9950f6$export$2e2bcd8739ae039(RetorikWidget, props, element) {
|
|
60
|
-
const root = (0, $bZRJW$createRoot)(element);
|
|
61
|
-
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)(RetorikWidget, {
|
|
62
|
-
...props
|
|
63
|
-
}));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
48
|
|
|
68
49
|
|
|
69
50
|
|
|
@@ -486,7 +467,10 @@ const $920719987d28bd50$var$createUtilsStore = ()=>(0, $bZRJW$createStore)((set,
|
|
|
486
467
|
},
|
|
487
468
|
setModalFullscreenContent: (value, fromActivity)=>{
|
|
488
469
|
set((state)=>{
|
|
489
|
-
if (!fromActivity
|
|
470
|
+
if (!fromActivity) return {
|
|
471
|
+
modalFullscreenContent: value
|
|
472
|
+
};
|
|
473
|
+
else if (fromActivity !== state.modalFullscreenContentNoDisplayId) // Set fromActivity data to check next time if we have to prevent unwanted re-rendering
|
|
490
474
|
return {
|
|
491
475
|
modalFullscreenContent: value,
|
|
492
476
|
modalFullscreenContentNoDisplayId: fromActivity
|
|
@@ -3147,7 +3131,7 @@ var $c54ebc4ba0100ff1$export$2e2bcd8739ae039 = $c54ebc4ba0100ff1$var$activityMid
|
|
|
3147
3131
|
|
|
3148
3132
|
|
|
3149
3133
|
var $dbfedf7e8087b1ae$exports = {};
|
|
3150
|
-
$dbfedf7e8087b1ae$exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.0.
|
|
3134
|
+
$dbfedf7e8087b1ae$exports = JSON.parse("{\"name\":\"@davi-ai/retorik-framework\",\"version\":\"3.0.4\",\"description\":\"Retorik Framework package\",\"author\":\"DAVI\",\"license\":\"MIT\",\"repository\":\"none\",\"main\":\"dist/index.js\",\"module\":\"dist/index.modern.js\",\"types\":\"dist/index.d.ts\",\"source\":\"src/index.tsx\",\"standalone\":\"standalone/index.js\",\"targets\":{\"standalone\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"standalone\",\"includeNodeModules\":{\"@testing-library/jest-dom\":false,\"@testing-library/react\":false,\"@testing-library/react-hooks\":false,\"@testing-library/user-event\":false,\"eslint\":false,\"eslint-config-prettier\":false,\"eslint-config-standard\":false,\"eslint-config-standard-react\":false,\"eslint-plugin-import\":false,\"eslint-plugin-node\":false,\"eslint-plugin-prettier\":false,\"eslint-plugin-promise\":false,\"eslint-plugin-react\":false,\"eslint-plugin-standard\":false,\"jest-junit\":false,\"npm-run-all\":false,\"parcel\":false,\"prettier\":false,\"raw-loader\":false,\"react-docgen-typescript-plugin\":false,\"react-scripts\":false,\"react-test-renderer\":false,\"tailwindcss\":false,\"typescript\":false}},\"module\":{\"context\":\"browser\",\"outputFormat\":\"esmodule\",\"distDir\":\"dist\"}},\"engines\":{\"node\":\">=10\"},\"scripts\":{\"build\":\"parcel build\",\"start\":\"parcel watch\",\"test\":\"jest --env=jsdom --reporters=jest-junit\",\"test-console\":\"jest --env=jsdom\",\"test-update-snapshots\":\"jest --env=jsdom --updateSnapshot\",\"test-coverage-console\":\"jest --env=jsdom --reporters=jest-junit --coverage\",\"test-coverage\":\"jest --env=jsdom --reporters=jest-junit --coverage --coverageReporters=cobertura\",\"report\":\"npx parcel build src/index.tsx --reporter @parcel/reporter-bundle-analyzer\",\"credentials\":\"vsts-npm-auth -config .npmrc\"},\"peerDependencies\":{\"react\":\"18.3.1\",\"react-dom\":\"18.3.1\"},\"devDependencies\":{\"@babel/core\":\"^7.19.1\",\"@babel/plugin-proposal-decorators\":\"^7.24.7\",\"@babel/plugin-proposal-private-property-in-object\":\"^7.21.11\",\"@babel/preset-env\":\"^7.25.4\",\"@babel/preset-react\":\"^7.24.7\",\"@babel/preset-typescript\":\"^7.24.7\",\"@babel/runtime\":\"^7.23.8\",\"@parcel/packager-ts\":\"^2.13.2\",\"@parcel/reporter-bundle-analyzer\":\"^2.13.2\",\"@parcel/reporter-sourcemap-visualiser\":\"^2.13.2\",\"@parcel/transformer-inline-string\":\"^2.13.2\",\"@parcel/transformer-typescript-types\":\"^2.13.2\",\"@parcel/validator-eslint\":\"^2.13.2\",\"@parcel/validator-typescript\":\"^2.13.2\",\"@testing-library/dom\":\"^10.4.0\",\"@testing-library/jest-dom\":\"6.5.0\",\"@testing-library/react\":\"16.0.1\",\"@testing-library/react-hooks\":\"8.0.1\",\"@testing-library/user-event\":\"14.5.2\",\"@types/jest\":\"^27.5.1\",\"@types/leaflet\":\"^1.8.0\",\"@types/node\":\"^12.12.38\",\"@types/react\":\"18.3.12\",\"@types/react-dom\":\"18.3.1\",\"@types/testing-library__jest-dom\":\"^5.14.5\",\"@types/testing-library__react\":\"latest\",\"@typescript-eslint/eslint-plugin\":\"^8.19.0\",\"@typescript-eslint/parser\":\"^8.19.0\",\"autoprefixer\":\"^10.4.7\",\"babel-eslint\":\"^10.0.3\",\"babel-jest\":\"^29.7.0\",\"babel-loader\":\"^8.2.5\",\"buffer\":\"^5.7.1\",\"canvas\":\"^2.9.0\",\"cross-env\":\"^7.0.2\",\"crypto-browserify\":\"^3.12.0\",\"eslint\":\"^9.16.0\",\"eslint-config-prettier\":\"^9.1.0\",\"eslint-config-standard\":\"^17.1.0\",\"eslint-config-standard-react\":\"^13.0.0\",\"eslint-plugin-import\":\"^2.31.0\",\"eslint-plugin-node\":\"^11.1.0\",\"eslint-plugin-prettier\":\"^5.2.1\",\"eslint-plugin-promise\":\"^7.2.1\",\"eslint-plugin-react\":\"^7.37.2\",\"https-browserify\":\"^1.0.0\",\"jest\":\"^29.7.0\",\"jest-environment-jsdom\":\"^29.7.0\",\"jest-junit\":\"16.0.0\",\"npm-run-all\":\"^4.1.5\",\"parcel\":\"^2.13.2\",\"postcss\":\"^8.4.14\",\"postcss-url\":\"^10.1.3\",\"prettier\":\"^2.0.4\",\"process\":\"^0.11.10\",\"punycode\":\"^1.4.1\",\"querystring-es3\":\"^0.2.1\",\"react\":\"^18\",\"react-docgen-typescript-plugin\":\"^1.0.5\",\"react-dom\":\"18.3.1\",\"react-scripts\":\"5.0.1\",\"react-test-renderer\":\"^18.3.1\",\"resize-observer-polyfill\":\"^1.5.1\",\"stream-browserify\":\"^3.0.0\",\"stream-http\":\"^3.2.0\",\"string_decoder\":\"^1.3.0\",\"tailwindcss\":\"^3.1.0\",\"typescript\":\"5.3.2\",\"url\":\"^0.11.0\",\"util\":\"^0.12.4\"},\"files\":[\"dist\"],\"dependencies\":{\"@davi-ai/body-engine-sprite\":\"3.0.0\",\"@davi-ai/react-bodyengine-three\":\"1.0.0\",\"@davi-ai/retorik-weather\":\"2.0.0\",\"@davi-ai/speechmarkdown-davi-js\":\"1.0.6\",\"@davi-ai/web-speech-cognitive-services-davi\":\"2.0.10\",\"@fluentui/react\":\"^8.103.3\",\"@lottiefiles/react-lottie-player\":\"^3.4.1\",\"@opentelemetry/api\":\"^1.9.0\",\"@opentelemetry/exporter-trace-otlp-http\":\"^0.200.0\",\"@opentelemetry/instrumentation\":\"^0.200.0\",\"@opentelemetry/instrumentation-document-load\":\"^0.45.0\",\"@opentelemetry/instrumentation-fetch\":\"^0.200.0\",\"@opentelemetry/resources\":\"^2.0.0\",\"@opentelemetry/sdk-trace-web\":\"^2.0.0\",\"@opentelemetry/semantic-conventions\":\"^1.32.0\",\"@react-spring/types\":\"^9.7.3\",\"@react-spring/web\":\"^9.7.3\",\"@react-three/drei\":\"^9.106.0\",\"@swc/helpers\":\"^0.5.0\",\"@types/geojson\":\"^7946.0.10\",\"@types/jsdom\":\"^16.2.14\",\"@use-gesture/react\":\"^10.2.15\",\"adaptivecards\":\"3.0.1\",\"botframework-directlinejs\":\"^0.15.5\",\"classnames\":\"^2.3.1\",\"detect-gpu\":\"^5.0.70\",\"leaflet\":\"^1.9.2\",\"markdown-it\":\"14.1.0\",\"pdfjs-dist\":\"3.11.174\",\"postcss-copy\":\"^7.1.0\",\"qrcode\":\"^1.5.1\",\"react-device-detect\":\"^2.2.3\",\"react-error-boundary\":\"^4.0.10\",\"react-leaflet\":\"^4.1.0\",\"react-pdf\":\"7.7.1\",\"react-shadow\":\"^20.5.0\",\"react-webcam\":\"^6.0.0\",\"swiper\":\"^8.4.5\",\"three\":\"0.174.0\",\"zustand\":\"^5.0.3\"},\"overrides\":{\"@davi-ai/web-speech-cognitive-services-davi\":\"$@davi-ai/web-speech-cognitive-services-davi\",\"three\":\"$three\",\"zustand\":\"$zustand\"},\"@parcel/resolver-default\":{\"packageExports\":true}}");
|
|
3151
3135
|
|
|
3152
3136
|
|
|
3153
3137
|
const $ca466c72d380f23a$var$initialState = {
|
|
@@ -3170,7 +3154,7 @@ const $ca466c72d380f23a$var$eventsWithoutCancel = [
|
|
|
3170
3154
|
'setuser',
|
|
3171
3155
|
'davi.gdprconsent'
|
|
3172
3156
|
];
|
|
3173
|
-
const $ca466c72d380f23a$var$createDirectlineStore = (modeRef, recognitionStateRef, retrievingConversationRef, conversationIdRef, isTactileRef, localeRef, sendBoxRefRef, setIsWaitingForResponse, unlockClickedButton, addBotEvent, addBotMessage, addUserEvent, addUserMessage, checkConversationId, setRetrievingConversation, checkDumpedLocaleFallback, cancelCurrentUtterance, checkActivityReplyToId, addSpeechRecognitionDynamicGrammar, toggleMicrophone)=>{
|
|
3157
|
+
const $ca466c72d380f23a$var$createDirectlineStore = (modeRef, recognitionStateRef, retrievingConversationRef, conversationIdRef, isTactileRef, localeRef, sendBoxRefRef, channelDataRef, setIsWaitingForResponse, unlockClickedButton, addBotEvent, addBotMessage, addUserEvent, addUserMessage, checkConversationId, setRetrievingConversation, checkDumpedLocaleFallback, cancelCurrentUtterance, checkActivityReplyToId, addSpeechRecognitionDynamicGrammar, toggleMicrophone)=>{
|
|
3174
3158
|
return (0, $bZRJW$createStore)((set, get)=>{
|
|
3175
3159
|
return {
|
|
3176
3160
|
...$ca466c72d380f23a$var$initialState,
|
|
@@ -3336,7 +3320,10 @@ const $ca466c72d380f23a$var$createDirectlineStore = (modeRef, recognitionStateRe
|
|
|
3336
3320
|
longitude: position.longitude
|
|
3337
3321
|
};
|
|
3338
3322
|
}
|
|
3339
|
-
return
|
|
3323
|
+
return channelDataRef.current ? {
|
|
3324
|
+
...dataAddedToChannelData,
|
|
3325
|
+
...channelDataRef.current
|
|
3326
|
+
} : dataAddedToChannelData;
|
|
3340
3327
|
},
|
|
3341
3328
|
checkMicrophoneAndCancel: ()=>{
|
|
3342
3329
|
if (modeRef.current === (0, $179a76b9823b36f3$export$9484bbecc3c49a2e).vocal && recognitionStateRef.current === (0, $179a76b9823b36f3$export$3f0071308968cd80).Listening) toggleMicrophone();
|
|
@@ -3473,12 +3460,12 @@ const $ca466c72d380f23a$export$adc771f45cf9b273 = (selector)=>{
|
|
|
3473
3460
|
const $ca466c72d380f23a$var$DirectlineProvider = ({ children: children })=>{
|
|
3474
3461
|
const mode = (0, $244e94971d503466$export$f299240efcda25a2)((state)=>state.mode);
|
|
3475
3462
|
const recognitionState = (0, $244e94971d503466$export$f299240efcda25a2)((state)=>state.activeRecognitionState);
|
|
3476
|
-
const speaking = (0, $244e94971d503466$export$f299240efcda25a2)((state)=>state.speaking);
|
|
3477
3463
|
const retrievingConversation = (0, $1cd684302a8789ac$export$b56465394e2b1287)((state)=>state.retrievingConversation);
|
|
3478
3464
|
const conversationId = (0, $1cd684302a8789ac$export$b56465394e2b1287)((state)=>state.conversationId);
|
|
3479
3465
|
const isTactile = (0, $da2b200601eaecd0$export$d13b2577cb75f2ad)((state)=>state.isTactile);
|
|
3480
3466
|
const locale = (0, $d167a4b44187cb6e$export$6650dace022cfacc)((state)=>state.locale);
|
|
3481
3467
|
const sendBoxRef = (0, $aab770e2a22c2c28$export$bd22554f31e5f96f)((state)=>state.sendBoxRef);
|
|
3468
|
+
const channelData = (0, $aab770e2a22c2c28$export$bd22554f31e5f96f)((state)=>state.configuration.channelData);
|
|
3482
3469
|
const modeRef = (0, $bZRJW$useRef)((0, $179a76b9823b36f3$export$9484bbecc3c49a2e).text);
|
|
3483
3470
|
const recognitionStateRef = (0, $bZRJW$useRef)((0, $179a76b9823b36f3$export$3f0071308968cd80).Closed);
|
|
3484
3471
|
const retrievingConversationRef = (0, $bZRJW$useRef)(false);
|
|
@@ -3486,12 +3473,13 @@ const $ca466c72d380f23a$var$DirectlineProvider = ({ children: children })=>{
|
|
|
3486
3473
|
const isTactileRef = (0, $bZRJW$useRef)(false);
|
|
3487
3474
|
const localeRef = (0, $bZRJW$useRef)('fr-FR');
|
|
3488
3475
|
const sendBoxRefRef = (0, $bZRJW$useRef)(null);
|
|
3476
|
+
const channelDataRef = (0, $bZRJW$useRef)(undefined);
|
|
3489
3477
|
const setIsWaitingForResponse = (0, $aab770e2a22c2c28$export$bd22554f31e5f96f)((state)=>state.actions.setIsWaitingForResponse);
|
|
3490
3478
|
const unlockClickedButton = (0, $920719987d28bd50$export$77e4cc5334565f28)((state)=>state.actions.unlockClickedButton);
|
|
3491
3479
|
const { addBotEvent: addBotEvent, addBotMessage: addBotMessage, addUserEvent: addUserEvent, addUserMessage: addUserMessage, checkConversationId: checkConversationId, setRetrievingConversation: setRetrievingConversation } = (0, $1cd684302a8789ac$export$b56465394e2b1287)((state)=>state.actions);
|
|
3492
3480
|
const checkDumpedLocaleFallback = (0, $d167a4b44187cb6e$export$6650dace022cfacc)((state)=>state.actions.checkDumpedLocaleFallback);
|
|
3493
3481
|
const { cancelCurrentUtterance: cancelCurrentUtterance, checkActivityReplyToId: checkActivityReplyToId, addSpeechRecognitionDynamicGrammar: addSpeechRecognitionDynamicGrammar, toggleMicrophone: toggleMicrophone } = (0, $244e94971d503466$export$f299240efcda25a2)((state)=>state.actions);
|
|
3494
|
-
const [store] = (0, $bZRJW$useState)(()=>$ca466c72d380f23a$var$createDirectlineStore(modeRef, recognitionStateRef, retrievingConversationRef, conversationIdRef, isTactileRef, localeRef, sendBoxRefRef, setIsWaitingForResponse, unlockClickedButton, addBotEvent, addBotMessage, addUserEvent, addUserMessage, checkConversationId, setRetrievingConversation, checkDumpedLocaleFallback, cancelCurrentUtterance, checkActivityReplyToId, addSpeechRecognitionDynamicGrammar, toggleMicrophone));
|
|
3482
|
+
const [store] = (0, $bZRJW$useState)(()=>$ca466c72d380f23a$var$createDirectlineStore(modeRef, recognitionStateRef, retrievingConversationRef, conversationIdRef, isTactileRef, localeRef, sendBoxRefRef, channelDataRef, setIsWaitingForResponse, unlockClickedButton, addBotEvent, addBotMessage, addUserEvent, addUserMessage, checkConversationId, setRetrievingConversation, checkDumpedLocaleFallback, cancelCurrentUtterance, checkActivityReplyToId, addSpeechRecognitionDynamicGrammar, toggleMicrophone));
|
|
3495
3483
|
(0, $bZRJW$useEffect)(()=>{
|
|
3496
3484
|
modeRef.current = mode;
|
|
3497
3485
|
}, [
|
|
@@ -3527,6 +3515,11 @@ const $ca466c72d380f23a$var$DirectlineProvider = ({ children: children })=>{
|
|
|
3527
3515
|
}, [
|
|
3528
3516
|
sendBoxRef
|
|
3529
3517
|
]);
|
|
3518
|
+
(0, $bZRJW$useEffect)(()=>{
|
|
3519
|
+
channelDataRef.current = channelData;
|
|
3520
|
+
}, [
|
|
3521
|
+
channelData
|
|
3522
|
+
]);
|
|
3530
3523
|
return /*#__PURE__*/ (0, $bZRJW$jsx)($ca466c72d380f23a$var$DirectlineContext.Provider, {
|
|
3531
3524
|
value: store,
|
|
3532
3525
|
children: children
|
|
@@ -5043,6 +5036,7 @@ const $05381dff3a76f568$export$5e05ceb0f0c2d3f = async ({ configurationData: con
|
|
|
5043
5036
|
|
|
5044
5037
|
|
|
5045
5038
|
|
|
5039
|
+
|
|
5046
5040
|
const $25e969779d25f701$var$getRetorikConfigs = async (props, baseAddress)=>{
|
|
5047
5041
|
const retorikProps = {
|
|
5048
5042
|
...props
|
|
@@ -5181,7 +5175,14 @@ const $25e969779d25f701$var$processJson = (json, retorikProps, baseAddress)=>{
|
|
|
5181
5175
|
useOldRemote: json.useOldRemote != null ? json.useOldRemote : true,
|
|
5182
5176
|
// Temporary parameter, will be removed
|
|
5183
5177
|
showTemporaryBanner: undefined,
|
|
5184
|
-
preventVirtualKeyboard: undefined
|
|
5178
|
+
preventVirtualKeyboard: undefined,
|
|
5179
|
+
channelData: json.channelData,
|
|
5180
|
+
newsConfig: {
|
|
5181
|
+
bannerTitle: json.newsBannerTitle,
|
|
5182
|
+
bannerTitleLocalized: json.newBannerTitleLocalized,
|
|
5183
|
+
removeTitleFromTextToSpeak: json.newsRemoveTitleFromTextToSpeak,
|
|
5184
|
+
removeSubtitleFromTextToSpeak: json.newsRemoveSubtitleFromTextToSpeak
|
|
5185
|
+
}
|
|
5185
5186
|
},
|
|
5186
5187
|
viewsConfig: {
|
|
5187
5188
|
homeRoute: 'home',
|
|
@@ -5367,7 +5368,7 @@ const $25e969779d25f701$var$processJson = (json, retorikProps, baseAddress)=>{
|
|
|
5367
5368
|
}
|
|
5368
5369
|
}
|
|
5369
5370
|
},
|
|
5370
|
-
defaultMode: json.defaultMode,
|
|
5371
|
+
defaultMode: json.disableSpeechMode ? (0, $179a76b9823b36f3$export$9484bbecc3c49a2e).text : json.defaultMode,
|
|
5371
5372
|
skipLoader: json.skipLoader,
|
|
5372
5373
|
// Language data
|
|
5373
5374
|
defaultCulture: json.defaultCulture,
|
|
@@ -5482,12 +5483,12 @@ const $99745679ea6e4377$var$TextBlock = ({ text: text, isTitle: isTitle, isSubti
|
|
|
5482
5483
|
setStyle(styleToApply);
|
|
5483
5484
|
}
|
|
5484
5485
|
}, []);
|
|
5485
|
-
return
|
|
5486
|
+
return /*#__PURE__*/ (0, $bZRJW$jsx)("div", {
|
|
5486
5487
|
className: `rf-w-full rf-text-cardFrameText ${style}`,
|
|
5487
5488
|
dangerouslySetInnerHTML: {
|
|
5488
|
-
__html: (0, $d94d08aa61ce84f3$export$d07f57595c356899)($99745679ea6e4377$var$md.render(text))
|
|
5489
|
+
__html: text ? (0, $d94d08aa61ce84f3$export$d07f57595c356899)($99745679ea6e4377$var$md.render(text)) : '\u00a0'
|
|
5489
5490
|
}
|
|
5490
|
-
})
|
|
5491
|
+
});
|
|
5491
5492
|
};
|
|
5492
5493
|
var $99745679ea6e4377$export$2e2bcd8739ae039 = $99745679ea6e4377$var$TextBlock;
|
|
5493
5494
|
|
|
@@ -10665,25 +10666,26 @@ function $4551c1f557108aed$export$bb3ea6dd2428edb6({ enabled: enabled, children:
|
|
|
10665
10666
|
|
|
10666
10667
|
|
|
10667
10668
|
|
|
10669
|
+
const $fa06276b53776b1b$var$checkResult = (lang, allLanguages)=>{
|
|
10670
|
+
let res;
|
|
10671
|
+
// Lang can be 2-chars
|
|
10672
|
+
if (lang.length === 2) res = allLanguages.find((language)=>{
|
|
10673
|
+
return language.split('-')[0]?.toLowerCase() === lang.toLowerCase();
|
|
10674
|
+
});
|
|
10675
|
+
else {
|
|
10676
|
+
res = allLanguages.find((language)=>{
|
|
10677
|
+
return language.toLowerCase() === lang.toLowerCase();
|
|
10678
|
+
});
|
|
10679
|
+
if (!res) res = allLanguages.find((language)=>{
|
|
10680
|
+
return language.startsWith(`${lang.split('-')[0].toLowerCase()}-`);
|
|
10681
|
+
});
|
|
10682
|
+
}
|
|
10683
|
+
return res;
|
|
10684
|
+
};
|
|
10668
10685
|
// Check if the locale in the current browser is in the array of available locales
|
|
10669
10686
|
const $fa06276b53776b1b$var$checkLocaleFromBrowser = (allLanguages)=>{
|
|
10670
10687
|
const navLang = navigator?.language;
|
|
10671
|
-
if (navLang && allLanguages?.length)
|
|
10672
|
-
let res;
|
|
10673
|
-
// Navigator language can be 2-chars
|
|
10674
|
-
if (navLang.length === 2) res = allLanguages.find((language)=>{
|
|
10675
|
-
return language.split('-')[0]?.toLowerCase() === navLang.toLowerCase();
|
|
10676
|
-
});
|
|
10677
|
-
else {
|
|
10678
|
-
res = allLanguages.find((language)=>{
|
|
10679
|
-
return language.toLowerCase() === navLang.toLowerCase();
|
|
10680
|
-
});
|
|
10681
|
-
if (!res) res = allLanguages.find((language)=>{
|
|
10682
|
-
return language.startsWith(`${navLang.split('-')[0].toLowerCase()}-`);
|
|
10683
|
-
});
|
|
10684
|
-
}
|
|
10685
|
-
if (res) return res;
|
|
10686
|
-
}
|
|
10688
|
+
if (navLang && allLanguages?.length) return $fa06276b53776b1b$var$checkResult(navLang, allLanguages);
|
|
10687
10689
|
return undefined;
|
|
10688
10690
|
};
|
|
10689
10691
|
const $fa06276b53776b1b$export$d64c0ac95bb7fd72 = (languageData, localeConfig)=>{
|
|
@@ -10692,12 +10694,18 @@ const $fa06276b53776b1b$export$d64c0ac95bb7fd72 = (languageData, localeConfig)=>
|
|
|
10692
10694
|
const browserLocale = $fa06276b53776b1b$var$checkLocaleFromBrowser(languageData.all);
|
|
10693
10695
|
if (browserLocale) return browserLocale;
|
|
10694
10696
|
}
|
|
10697
|
+
// Else check the "lang" tag in the html element
|
|
10698
|
+
const htmlElements = document.getElementsByTagName('html');
|
|
10699
|
+
if (htmlElements.length && htmlElements[0].lang) {
|
|
10700
|
+
const htmlLocale = $fa06276b53776b1b$var$checkResult(htmlElements[0].lang, languageData.all);
|
|
10701
|
+
if (htmlLocale) return htmlLocale;
|
|
10702
|
+
}
|
|
10695
10703
|
// Else, use default from languageData
|
|
10696
10704
|
return languageData.default;
|
|
10697
10705
|
};
|
|
10698
10706
|
const $fa06276b53776b1b$export$91fc93b93c368955 = (locale)=>{
|
|
10699
10707
|
const split = locale.split('-');
|
|
10700
|
-
return split.length
|
|
10708
|
+
return split.length ? split[1] : split[0];
|
|
10701
10709
|
};
|
|
10702
10710
|
|
|
10703
10711
|
|
|
@@ -13184,6 +13192,13 @@ const $3a6716bf6d00a1ec$var$RemoteButton = ({ type: type, backgroundColor: backg
|
|
|
13184
13192
|
const sendEvent = (0, $ca466c72d380f23a$export$adc771f45cf9b273)((state)=>state.actions.sendEvent);
|
|
13185
13193
|
const [icon, setIcon] = (0, $bZRJW$useState)();
|
|
13186
13194
|
const [label, setLabel] = (0, $bZRJW$useState)();
|
|
13195
|
+
const [hover, setHover] = (0, $bZRJW$useState)(false);
|
|
13196
|
+
const [backgroundColorHover, setBackgroundColorHover] = (0, $bZRJW$useState)(undefined);
|
|
13197
|
+
(0, $bZRJW$useEffect)(()=>{
|
|
13198
|
+
setBackgroundColorHover(backgroundColor?.replace('99', 'E6'));
|
|
13199
|
+
}, [
|
|
13200
|
+
backgroundColor
|
|
13201
|
+
]);
|
|
13187
13202
|
(0, $bZRJW$useEffect)(()=>{
|
|
13188
13203
|
switch(type){
|
|
13189
13204
|
case (0, $179a76b9823b36f3$export$4112462e5af80a05).history:
|
|
@@ -13327,13 +13342,15 @@ const $3a6716bf6d00a1ec$var$RemoteButton = ({ type: type, backgroundColor: backg
|
|
|
13327
13342
|
className: "rf-w-10 rf-h-10 rf-rounded-half rf-flex rf-justify-center rf-items-center rf-cursor-pointer",
|
|
13328
13343
|
style: {
|
|
13329
13344
|
zIndex: type === (0, $179a76b9823b36f3$export$4112462e5af80a05).close ? 60 : 5,
|
|
13330
|
-
backgroundColor: backgroundColor,
|
|
13345
|
+
backgroundColor: hover ? backgroundColorHover : backgroundColor,
|
|
13331
13346
|
boxShadow: type === (0, $179a76b9823b36f3$export$4112462e5af80a05).text || type === (0, $179a76b9823b36f3$export$4112462e5af80a05).close ? '0px 0px 6px #1A1A1A80' : undefined
|
|
13332
13347
|
},
|
|
13333
13348
|
"aria-label": label,
|
|
13334
13349
|
// data-map used in interactive map to use this button externaly
|
|
13335
13350
|
"data-map": type === (0, $179a76b9823b36f3$export$4112462e5af80a05).close ? 'fermer' : 'other',
|
|
13336
13351
|
onClick: handleClick,
|
|
13352
|
+
onPointerEnter: ()=>setHover(true),
|
|
13353
|
+
onPointerLeave: ()=>setHover(false),
|
|
13337
13354
|
children: icon
|
|
13338
13355
|
});
|
|
13339
13356
|
};
|
|
@@ -22930,6 +22947,13 @@ var $a6d09745a7145ed1$export$2e2bcd8739ae039 = $a6d09745a7145ed1$var$Version;
|
|
|
22930
22947
|
|
|
22931
22948
|
|
|
22932
22949
|
|
|
22950
|
+
const $af2bd3eba7cc813c$var$md = (0, $bZRJW$markdownit)({
|
|
22951
|
+
breaks: true,
|
|
22952
|
+
html: true,
|
|
22953
|
+
xhtmlOut: true,
|
|
22954
|
+
typographer: true,
|
|
22955
|
+
quotes: `""''`
|
|
22956
|
+
});
|
|
22933
22957
|
const $af2bd3eba7cc813c$var$springEnterDuration = 500;
|
|
22934
22958
|
const $af2bd3eba7cc813c$var$springQrcodeDuration = 500;
|
|
22935
22959
|
const $af2bd3eba7cc813c$var$DashboardItem = ({ index: index, text: text, textColor: textColor, backgroundColor: backgroundColor, image: image, action: action, onClick: onClick })=>{
|
|
@@ -23079,8 +23103,10 @@ const $af2bd3eba7cc813c$var$DashboardItem = ({ index: index, text: text, textCol
|
|
|
23079
23103
|
})
|
|
23080
23104
|
}),
|
|
23081
23105
|
/*#__PURE__*/ (0, $bZRJW$jsx)("div", {
|
|
23082
|
-
className: "rf-h-[35%] rf-w-full rf-flex rf-justify-center rf-items-center rf-text-center rf-text-extra-small-size-auto rf-
|
|
23083
|
-
|
|
23106
|
+
className: "rf-h-[35%] rf-w-full rf-flex rf-justify-center rf-items-center rf-text-center rf-text-extra-small-size-auto rf-overflow-y-hidden rf-scrollbar-thin",
|
|
23107
|
+
dangerouslySetInnerHTML: {
|
|
23108
|
+
__html: $af2bd3eba7cc813c$var$md.render(text)
|
|
23109
|
+
}
|
|
23084
23110
|
}),
|
|
23085
23111
|
qrCodeData && /*#__PURE__*/ (0, $bZRJW$jsxs)((0, $bZRJW$animated).div, {
|
|
23086
23112
|
className: "rf-absolute rf-h-full rf-w-full rf-top-0 rf-left-0 rf-z-ui rf-flex rf-flex-col rf-justify-center rf-items-center rf-gap-2 rf-p-2 rf-text-truewhite",
|
|
@@ -23515,6 +23541,13 @@ var $958af9b5cce7890d$export$2e2bcd8739ae039 = $958af9b5cce7890d$var$Mobile;
|
|
|
23515
23541
|
|
|
23516
23542
|
|
|
23517
23543
|
|
|
23544
|
+
const $1671238b3d664f2b$var$md = (0, $bZRJW$markdownit)({
|
|
23545
|
+
breaks: true,
|
|
23546
|
+
html: true,
|
|
23547
|
+
xhtmlOut: true,
|
|
23548
|
+
typographer: true,
|
|
23549
|
+
quotes: `""''`
|
|
23550
|
+
});
|
|
23518
23551
|
const $1671238b3d664f2b$var$DashboardItem = ({ text: text, textColor: textColor, image: image, action: action, onClick: onClick })=>{
|
|
23519
23552
|
const locale = (0, $d167a4b44187cb6e$export$6650dace022cfacc)((state)=>state.locale);
|
|
23520
23553
|
const { sendMessage: sendMessage, sendEvent: sendEvent } = (0, $ca466c72d380f23a$export$adc771f45cf9b273)((state)=>state.actions);
|
|
@@ -23586,7 +23619,9 @@ const $1671238b3d664f2b$var$DashboardItem = ({ text: text, textColor: textColor,
|
|
|
23586
23619
|
})
|
|
23587
23620
|
}),
|
|
23588
23621
|
/*#__PURE__*/ (0, $bZRJW$jsx)("div", {
|
|
23589
|
-
|
|
23622
|
+
dangerouslySetInnerHTML: {
|
|
23623
|
+
__html: $1671238b3d664f2b$var$md.render(text)
|
|
23624
|
+
}
|
|
23590
23625
|
})
|
|
23591
23626
|
]
|
|
23592
23627
|
});
|
|
@@ -25171,6 +25206,7 @@ var $c1e5018217fb7fb5$export$2e2bcd8739ae039 = $c1e5018217fb7fb5$var$Time;
|
|
|
25171
25206
|
|
|
25172
25207
|
|
|
25173
25208
|
|
|
25209
|
+
|
|
25174
25210
|
const $07fb045e03ad37d0$var$useNews = ()=>{
|
|
25175
25211
|
const activities = (0, $1cd684302a8789ac$export$b56465394e2b1287)((state)=>state.botEventActivities);
|
|
25176
25212
|
if (!activities.length) return {
|
|
@@ -25204,15 +25240,28 @@ var $07fb045e03ad37d0$export$2e2bcd8739ae039 = $07fb045e03ad37d0$var$useNews;
|
|
|
25204
25240
|
|
|
25205
25241
|
|
|
25206
25242
|
|
|
25243
|
+
|
|
25207
25244
|
const $de1f380ff3be314f$var$Banner = ({ news: news })=>{
|
|
25208
25245
|
const translation = (0, $d167a4b44187cb6e$export$6650dace022cfacc)((state)=>state.currentTranslations);
|
|
25209
25246
|
const locale = (0, $d167a4b44187cb6e$export$6650dace022cfacc)((state)=>state.locale);
|
|
25210
25247
|
const isMobile = (0, $da2b200601eaecd0$export$d13b2577cb75f2ad)((state)=>state.isMobile);
|
|
25211
25248
|
const currentWidth = (0, $da2b200601eaecd0$export$d13b2577cb75f2ad)((state)=>state.currentWidth);
|
|
25249
|
+
const newsConfig = (0, $aab770e2a22c2c28$export$bd22554f31e5f96f)((state)=>state.configuration.newsConfig);
|
|
25212
25250
|
const timerRef = (0, $bZRJW$useRef)(null);
|
|
25213
25251
|
const [scrollDuration, setScrollDuration] = (0, $bZRJW$useState)(0);
|
|
25214
25252
|
const [imageSize, setImageSize] = (0, $bZRJW$useState)(0);
|
|
25215
25253
|
const elementRef = (0, $bZRJW$useRef)(null);
|
|
25254
|
+
const bannerTitle = (0, $bZRJW$useMemo)(()=>{
|
|
25255
|
+
if (news.category) return news.category;
|
|
25256
|
+
else if (newsConfig?.bannerTitleLocalized?.[locale]) return newsConfig.bannerTitleLocalized[locale];
|
|
25257
|
+
else if (newsConfig?.bannerTitle) return newsConfig.bannerTitle;
|
|
25258
|
+
return translation.news.continuous;
|
|
25259
|
+
}, [
|
|
25260
|
+
news,
|
|
25261
|
+
newsConfig,
|
|
25262
|
+
locale,
|
|
25263
|
+
translation
|
|
25264
|
+
]);
|
|
25216
25265
|
/**
|
|
25217
25266
|
* Set animation for text horizontal scrolling if necessary
|
|
25218
25267
|
*/ const updateDuration = ()=>{
|
|
@@ -25251,7 +25300,7 @@ const $de1f380ff3be314f$var$Banner = ({ news: news })=>{
|
|
|
25251
25300
|
/*#__PURE__*/ (0, $bZRJW$jsx)("div", {
|
|
25252
25301
|
className: "rf-px-4 rf-pb-2 rf-pt-2 large:rf-pt-3 rf-font-bold rf-bg-red-600 rf-whitespace-nowrap",
|
|
25253
25302
|
ref: elementRef,
|
|
25254
|
-
children:
|
|
25303
|
+
children: bannerTitle?.toLocaleUpperCase(locale)
|
|
25255
25304
|
}),
|
|
25256
25305
|
/*#__PURE__*/ (0, $bZRJW$jsx)("div", {
|
|
25257
25306
|
className: "rf-px-4 rf-mb-2 rf-mt-2 large:rf-mt-3 rf-font-bold rf-line-clamp-1",
|
|
@@ -25306,6 +25355,7 @@ const $c6bafeb4a00d3b53$var$News = ({ intervalInSeconds: intervalInSeconds = 3,
|
|
|
25306
25355
|
const route = (0, $da2b200601eaecd0$export$d13b2577cb75f2ad)((state)=>state.route);
|
|
25307
25356
|
const isMobile = (0, $da2b200601eaecd0$export$d13b2577cb75f2ad)((state)=>state.isMobile);
|
|
25308
25357
|
const retorikNewsEnded = (0, $920719987d28bd50$export$77e4cc5334565f28)((state)=>state.retorikNewsEnded);
|
|
25358
|
+
const newsConfig = (0, $aab770e2a22c2c28$export$bd22554f31e5f96f)((state)=>state.configuration.newsConfig);
|
|
25309
25359
|
const { setCurrentNewsActivity: setCurrentNewsActivity, setRetorikNewsEnded: setRetorikNewsEnded } = (0, $920719987d28bd50$export$77e4cc5334565f28)((state)=>state.actions);
|
|
25310
25360
|
const sendEvent = (0, $ca466c72d380f23a$export$adc771f45cf9b273)((state)=>state.actions.sendEvent);
|
|
25311
25361
|
const news = (0, $bZRJW$useMemo)(()=>{
|
|
@@ -25326,9 +25376,11 @@ const $c6bafeb4a00d3b53$var$News = ({ intervalInSeconds: intervalInSeconds = 3,
|
|
|
25326
25376
|
(0, $bZRJW$useEffect)(()=>{
|
|
25327
25377
|
const currentNew = news[current];
|
|
25328
25378
|
if (currentNew) {
|
|
25379
|
+
const textTitle = newsConfig?.removeTitleFromTextToSpeak ? '' : `${currentNew.title}, <break/> `;
|
|
25380
|
+
const textSubtitle = newsConfig?.removeSubtitleFromTextToSpeak ? '' : `${currentNew.subtitle}: <break/> `;
|
|
25329
25381
|
const tempActivity = {
|
|
25330
25382
|
...activity,
|
|
25331
|
-
speak: `${
|
|
25383
|
+
speak: `${textTitle}${textSubtitle}${currentNew.text}`
|
|
25332
25384
|
};
|
|
25333
25385
|
setCurrentNewsActivity(tempActivity);
|
|
25334
25386
|
} else setCurrentNewsActivity(undefined);
|
|
@@ -25903,18 +25955,18 @@ const $972cc4ac7a9f8914$var$buildSSML = (activity, locale, speechMarkdownParser,
|
|
|
25903
25955
|
let speech = activity.speak || activity.text;
|
|
25904
25956
|
// Replace character not recognized in Microsoft TTS
|
|
25905
25957
|
speech = speech.replaceAll("\u2019", "'");
|
|
25906
|
-
if (sayAsWords && sayAsWords.length) {
|
|
25907
|
-
const wordsUsed = [];
|
|
25908
|
-
sayAsWords.forEach((tuple)=>{
|
|
25909
|
-
if (!wordsUsed.includes(tuple.text)) {
|
|
25910
|
-
const regex = new RegExp(`\\b${tuple.text}\\b`, 'gi');
|
|
25911
|
-
speech = speech.replaceAll(regex, `(${tuple.text})[ipa:"${tuple.ipa}"]`);
|
|
25912
|
-
wordsUsed.push(tuple.text);
|
|
25913
|
-
}
|
|
25914
|
-
});
|
|
25915
|
-
}
|
|
25916
25958
|
let textParsedAsSSML = '';
|
|
25917
25959
|
try {
|
|
25960
|
+
if (sayAsWords?.length) {
|
|
25961
|
+
const wordsUsed = [];
|
|
25962
|
+
sayAsWords.forEach((tuple)=>{
|
|
25963
|
+
if (!wordsUsed.includes(tuple.text.toLocaleLowerCase(locale))) {
|
|
25964
|
+
const regex = new RegExp(`\\b${tuple.text}\\b`, 'gi');
|
|
25965
|
+
speech = speech.replaceAll(regex, `(${tuple.text})[ipa:"${tuple.ipa}"]`);
|
|
25966
|
+
wordsUsed.push(tuple.text.toLocaleLowerCase(locale));
|
|
25967
|
+
}
|
|
25968
|
+
});
|
|
25969
|
+
}
|
|
25918
25970
|
textParsedAsSSML = speechMarkdownParser.toSSML(speech);
|
|
25919
25971
|
} catch (e) {
|
|
25920
25972
|
console.warn('Retorik Framework > error in speechmarkdown parser : ', e);
|
|
@@ -28831,6 +28883,89 @@ var $e54dad2fcfb83bae$export$2e2bcd8739ae039 = $e54dad2fcfb83bae$var$RetorikNews
|
|
|
28831
28883
|
|
|
28832
28884
|
|
|
28833
28885
|
|
|
28886
|
+
function $4e8fcace752f0f9d$export$2e2bcd8739ae039(RetorikAgent, props, element) {
|
|
28887
|
+
const root = (0, $bZRJW$createRoot)(element);
|
|
28888
|
+
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)(RetorikAgent, {
|
|
28889
|
+
...props
|
|
28890
|
+
}));
|
|
28891
|
+
}
|
|
28892
|
+
// WebComponent creation
|
|
28893
|
+
class $4e8fcace752f0f9d$var$RetorikAgentWebComponent extends HTMLElement {
|
|
28894
|
+
constructor(){
|
|
28895
|
+
super();
|
|
28896
|
+
}
|
|
28897
|
+
// Mehod called when the element is connected to the DOM
|
|
28898
|
+
connectedCallback() {
|
|
28899
|
+
const tenant = this.getAttribute('tenant');
|
|
28900
|
+
const prefix = this.getAttribute('prefix');
|
|
28901
|
+
const props = JSON.parse(this.getAttribute('props') || '{}');
|
|
28902
|
+
if (tenant) {
|
|
28903
|
+
const addressData = {
|
|
28904
|
+
tenant: tenant,
|
|
28905
|
+
prefix: prefix
|
|
28906
|
+
};
|
|
28907
|
+
this._renderAgent({
|
|
28908
|
+
...props,
|
|
28909
|
+
addressData: addressData
|
|
28910
|
+
});
|
|
28911
|
+
}
|
|
28912
|
+
}
|
|
28913
|
+
// React component rendering
|
|
28914
|
+
_renderAgent(props) {
|
|
28915
|
+
const root = (0, $bZRJW$createRoot)(this);
|
|
28916
|
+
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)((0, $8e48db9ccc2221d0$export$2e2bcd8739ae039), {
|
|
28917
|
+
...props
|
|
28918
|
+
}));
|
|
28919
|
+
}
|
|
28920
|
+
}
|
|
28921
|
+
// WebComponent registering in window
|
|
28922
|
+
window.customElements.define('retorik-agent', $4e8fcace752f0f9d$var$RetorikAgentWebComponent);
|
|
28923
|
+
|
|
28924
|
+
|
|
28925
|
+
|
|
28926
|
+
|
|
28927
|
+
|
|
28928
|
+
|
|
28929
|
+
function $dafec95f7e9950f6$export$2e2bcd8739ae039(RetorikWidget, props, element) {
|
|
28930
|
+
const root = (0, $bZRJW$createRoot)(element);
|
|
28931
|
+
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)(RetorikWidget, {
|
|
28932
|
+
...props
|
|
28933
|
+
}));
|
|
28934
|
+
}
|
|
28935
|
+
// WebComponent creation
|
|
28936
|
+
class $dafec95f7e9950f6$var$RetorikWidgetWebComponent extends HTMLElement {
|
|
28937
|
+
constructor(){
|
|
28938
|
+
super();
|
|
28939
|
+
}
|
|
28940
|
+
// Mehod called when the element is connected to the DOM
|
|
28941
|
+
connectedCallback() {
|
|
28942
|
+
const tenant = this.getAttribute('tenant');
|
|
28943
|
+
const prefix = this.getAttribute('prefix');
|
|
28944
|
+
const props = JSON.parse(this.getAttribute('props') || '{}');
|
|
28945
|
+
if (tenant) {
|
|
28946
|
+
const addressData = {
|
|
28947
|
+
tenant: tenant,
|
|
28948
|
+
prefix: prefix
|
|
28949
|
+
};
|
|
28950
|
+
this._renderWidget({
|
|
28951
|
+
...props,
|
|
28952
|
+
addressData: addressData
|
|
28953
|
+
});
|
|
28954
|
+
}
|
|
28955
|
+
}
|
|
28956
|
+
// React component rendering
|
|
28957
|
+
_renderWidget(props) {
|
|
28958
|
+
const root = (0, $bZRJW$createRoot)(this);
|
|
28959
|
+
root.render(/*#__PURE__*/ (0, $bZRJW$jsx)((0, $cd5ff35cf2f198d9$export$2e2bcd8739ae039), {
|
|
28960
|
+
...props
|
|
28961
|
+
}));
|
|
28962
|
+
}
|
|
28963
|
+
}
|
|
28964
|
+
// WebComponent registering in window
|
|
28965
|
+
window.customElements.define('retorik-widget', $dafec95f7e9950f6$var$RetorikWidgetWebComponent);
|
|
28966
|
+
|
|
28967
|
+
|
|
28968
|
+
|
|
28834
28969
|
|
|
28835
28970
|
|
|
28836
28971
|
|