@davi-ai/retorik-framework 1.1.6 → 1.1.7
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.map +1 -1
- package/dist/index.js +172 -116
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +166 -111
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -6226,7 +6226,7 @@ var $52fa5fc5e62f028e$export$2e2bcd8739ae039 = $52fa5fc5e62f028e$var$DisplaySubV
|
|
|
6226
6226
|
|
|
6227
6227
|
|
|
6228
6228
|
var $f335bf4cb9797237$exports = {};
|
|
6229
|
-
$f335bf4cb9797237$exports = JSON.parse('{"name":"@davi-ai/retorik-framework","version":"1.1.
|
|
6229
|
+
$f335bf4cb9797237$exports = JSON.parse('{"name":"@davi-ai/retorik-framework","version":"1.1.7","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":{"@storybook/addon-actions":false,"@storybook/addon-essentials":false,"@storybook/addon-interactions":false,"@storybook/addon-links":false,"@storybook/addon-postcss":false,"@storybook/builder-webpack5":false,"@storybook/manager-webpack5":false,"@storybook/preset-create-react-app":false,"@storybook/react":false,"@storybook/testing-library":false,"@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-update-snapshots":"jest --env=jsdom --updateSnapshot","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","storybook":"npm run build-tailwind && start-storybook -p 6006","build-storybook":"npm run build-tailwind && build-storybook","build-tailwind":"npx tailwindcss build -i ./src/tailwind.css -o ./.storybook/stories/styles.css"},"peerDependencies":{"react":"18","react-dom":"18"},"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.12.0","@parcel/reporter-bundle-analyzer":"^2.12.0","@parcel/reporter-sourcemap-visualiser":"^2.12.0","@parcel/transformer-inline-string":"^2.12.0","@parcel/transformer-typescript-types":"^2.12.0","@parcel/validator-eslint":"^2.12.0","@parcel/validator-typescript":"^2.12.0","@storybook/addon-actions":"^6.5.12","@storybook/addon-essentials":"^6.5.12","@storybook/addon-interactions":"^6.5.12","@storybook/addon-links":"^6.5.12","@storybook/addon-postcss":"^2.0.0","@storybook/builder-webpack5":"^6.5.12","@storybook/manager-webpack5":"^6.5.12","@storybook/preset-create-react-app":"^4.1.2","@storybook/react":"^6.5.12","@storybook/testing-library":"^0.0.13","@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","@types/react-dom":"18","@types/testing-library__jest-dom":"^5.14.5","@types/testing-library__react":"latest","@typescript-eslint/eslint-plugin":"^5.0","@typescript-eslint/parser":"^5.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":"^7.32.0","eslint-config-prettier":"^6.7.0","eslint-config-standard":"^14.1.0","eslint-config-standard-react":"^9.2.0","eslint-plugin-import":"^2.18.2","eslint-plugin-node":"^11.0.0","eslint-plugin-prettier":"^3.1.1","eslint-plugin-promise":"^4.2.1","eslint-plugin-react":"^7.17.0","eslint-plugin-standard":"^4.0.1","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.12.0","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","raw-loader":"^4.0.2","react":"^18","react-docgen-typescript-plugin":"^1.0.5","react-dom":"^18","react-scripts":"5.0.1","react-test-renderer":"^18.3.1","stream-browserify":"^3.0.0","stream-http":"^3.2.0","string_decoder":"^1.3.0","tailwindcss":"^3.1.0","typescript":"5.0","url":"^0.11.0","util":"^0.12.4"},"files":["dist"],"dependencies":{"@davi-ai/body-engine-sprite":"1.0.3","@davi-ai/retorik-weather":"1.0.0","@davi-ai/speechmarkdown-davi-js":"1.0.6","@davi-ai/web-speech-cognitive-services-davi":"2.0.8","@fluentui/react":"^8.103.3","@lottiefiles/react-lottie-player":"^3.4.1","@opentelemetry/api":"^1.4.1","@opentelemetry/exporter-trace-otlp-http":"^0.41.0","@opentelemetry/resources":"^1.15.0","@opentelemetry/sdk-trace-web":"^1.15.0","@opentelemetry/semantic-conventions":"^1.15.0","@react-spring/types":"^9.7.3","@react-spring/web":"^9.7.3","@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","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":"^19.0.3","react-webcam":"^6.0.0","swiper":"^8.4.5","zustand":"^4.1.1"}}');
|
|
6230
6230
|
|
|
6231
6231
|
|
|
6232
6232
|
const $0c96efd6debae4a9$var$Version = ({ isMobile: isMobile })=>{
|
|
@@ -13870,20 +13870,8 @@ var $0d96395552e34116$export$2e2bcd8739ae039 = $0d96395552e34116$var$Conversatio
|
|
|
13870
13870
|
|
|
13871
13871
|
|
|
13872
13872
|
|
|
13873
|
-
|
|
13874
|
-
|
|
13875
|
-
|
|
13876
|
-
|
|
13877
|
-
|
|
13878
13873
|
const $b22a7bbed115cb27$var$interval = 150 // 20 // 25
|
|
13879
13874
|
;
|
|
13880
|
-
const $b22a7bbed115cb27$var$md = new (0, $b3y7N$markdownit)({
|
|
13881
|
-
breaks: true,
|
|
13882
|
-
html: true,
|
|
13883
|
-
xhtmlOut: true,
|
|
13884
|
-
typographer: true,
|
|
13885
|
-
quotes: `""''`
|
|
13886
|
-
});
|
|
13887
13875
|
const $b22a7bbed115cb27$var$DisplayStreaming = ({ triggerScroll: triggerScroll, setStreamingEnded: setStreamingEnded, streamingActivity: streamingActivity, currentStreaming: currentStreaming, isMobile: isMobile })=>{
|
|
13888
13876
|
const locale = (0, $f902d4436881b887$export$6650dace022cfacc)((state)=>state.locale);
|
|
13889
13877
|
const streamingQueue = (0, $04ce41b46d359821$export$f299240efcda25a2)((state)=>state.streamingQueueForText);
|
|
@@ -13901,12 +13889,17 @@ const $b22a7bbed115cb27$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
13901
13889
|
}, [
|
|
13902
13890
|
streamingQueue
|
|
13903
13891
|
]);
|
|
13892
|
+
(0, $b3y7N$useEffect)(()=>{
|
|
13893
|
+
console.log("streamingActivity : ", streamingActivity);
|
|
13894
|
+
}, [
|
|
13895
|
+
streamingActivity
|
|
13896
|
+
]);
|
|
13904
13897
|
const intervalRef = (0, $b3y7N$useRef)(null);
|
|
13905
13898
|
const streamRef = (0, $b3y7N$useRef)([]);
|
|
13906
13899
|
const streamIndexRef = (0, $b3y7N$useRef)(0);
|
|
13907
13900
|
const previousTextRef = (0, $b3y7N$useRef)([]);
|
|
13908
13901
|
const handleNewStreaming = (text)=>{
|
|
13909
|
-
text = $
|
|
13902
|
+
text = (0, $2e5b8b358de6cd42$export$1b8fbc30fb87d9aa)(text, false).htmlText;
|
|
13910
13903
|
streamRef.current = text.split(" ");
|
|
13911
13904
|
setCurrentTextEnded(false);
|
|
13912
13905
|
intervalRef.current = setInterval(()=>{
|
|
@@ -13944,7 +13937,7 @@ const $b22a7bbed115cb27$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
13944
13937
|
streamingQueue.forEach((activity)=>{
|
|
13945
13938
|
fullText = `${fullText} ${activity.text}`;
|
|
13946
13939
|
});
|
|
13947
|
-
setStreamingTextToDisplay($
|
|
13940
|
+
setStreamingTextToDisplay((0, $2e5b8b358de6cd42$export$1b8fbc30fb87d9aa)(fullText, false).htmlText);
|
|
13948
13941
|
setStreamingEnded(true);
|
|
13949
13942
|
resetData();
|
|
13950
13943
|
}
|
|
@@ -14001,68 +13994,94 @@ const $b22a7bbed115cb27$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
14001
13994
|
var $b22a7bbed115cb27$export$2e2bcd8739ae039 = $b22a7bbed115cb27$var$DisplayStreaming;
|
|
14002
13995
|
|
|
14003
13996
|
|
|
14004
|
-
|
|
13997
|
+
|
|
13998
|
+
|
|
13999
|
+
|
|
14000
|
+
|
|
14001
|
+
|
|
14002
|
+
|
|
14003
|
+
|
|
14004
|
+
const $c7944488f0c23f01$var$DisplayNonStreaming = ({ nonStreamingActivities: nonStreamingActivities, isMobile: isMobile })=>{
|
|
14005
14005
|
const locale = (0, $f902d4436881b887$export$6650dace022cfacc)((state)=>state.locale);
|
|
14006
|
-
const currentStreaming = (0, $04ce41b46d359821$export$f299240efcda25a2)((state)=>state.currentStreaming);
|
|
14007
|
-
const streamingId = (0, $04ce41b46d359821$export$f299240efcda25a2)((state)=>state.streamingReplyToId);
|
|
14008
14006
|
const forceMobileView = (0, $56b00880a398c953$export$bd22554f31e5f96f)((state)=>state.configuration.forceMobileView);
|
|
14009
|
-
|
|
14007
|
+
return /*#__PURE__*/ (0, $b3y7N$jsx)((0, $b3y7N$react).Fragment, {
|
|
14008
|
+
children: nonStreamingActivities.map((activity, key)=>{
|
|
14009
|
+
const answerTime = activity.localTimestamp ? new Date(activity.localTimestamp) : activity.timestamp ? new Date(activity.timestamp) : new Date();
|
|
14010
|
+
return /*#__PURE__*/ (0, $b3y7N$jsxs)("div", {
|
|
14011
|
+
className: `${key > 0 && "rf-pt-2"} rf-text-textModePanelConversationBot rf-animate-slideBottom rf-flex rf-flex-col rf-items-start rf-gap-2`,
|
|
14012
|
+
children: [
|
|
14013
|
+
isMobile && /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14014
|
+
className: "rf-px-4 rf-text-[#9A9A9A]",
|
|
14015
|
+
children: answerTime.toLocaleString(locale, {
|
|
14016
|
+
hour: "numeric",
|
|
14017
|
+
minute: "numeric"
|
|
14018
|
+
})
|
|
14019
|
+
}),
|
|
14020
|
+
activity.htmlText ? /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14021
|
+
className: "rf-px-4",
|
|
14022
|
+
dangerouslySetInnerHTML: {
|
|
14023
|
+
__html: activity.htmlText
|
|
14024
|
+
}
|
|
14025
|
+
}) : activity.text ? /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14026
|
+
className: "rf-px-4",
|
|
14027
|
+
children: (0, $3792187fd212489a$export$d6c6ec86eedacfd9)(activity.text)
|
|
14028
|
+
}) : /*#__PURE__*/ (0, $b3y7N$jsx)((0, $b3y7N$react).Fragment, {}),
|
|
14029
|
+
!!activity?.attachments?.length && !(0, $1136774ec828a7ed$export$7c55936a30618336)(activity) && /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14030
|
+
className: `${forceMobileView ? "rf-m-auto" : "rf-w-full"} ${activity.attachments.length <= 1 && "rf-px-4"} rf-flex rf-flex-col rf-gap-2`,
|
|
14031
|
+
children: /*#__PURE__*/ (0, $b3y7N$jsx)((0, $d7c37f48f10c5387$export$2e2bcd8739ae039), {
|
|
14032
|
+
activity: activity
|
|
14033
|
+
})
|
|
14034
|
+
})
|
|
14035
|
+
]
|
|
14036
|
+
}, key);
|
|
14037
|
+
})
|
|
14038
|
+
});
|
|
14039
|
+
};
|
|
14040
|
+
var $c7944488f0c23f01$export$2e2bcd8739ae039 = $c7944488f0c23f01$var$DisplayNonStreaming;
|
|
14041
|
+
|
|
14042
|
+
|
|
14043
|
+
const $ea27a870d6ff37c7$var$DisplayStandard = ({ botResponses: botResponses, isMobile: isMobile, triggerScroll: triggerScroll, canBeStreaming: canBeStreaming })=>{
|
|
14044
|
+
const currentStreaming = (0, $04ce41b46d359821$export$f299240efcda25a2)((state)=>state.currentStreaming);
|
|
14045
|
+
const streamingReplyToId = (0, $04ce41b46d359821$export$f299240efcda25a2)((state)=>state.streamingReplyToId);
|
|
14010
14046
|
const [streamingEnded, setStreamingEnded] = (0, $b3y7N$useState)(false);
|
|
14011
|
-
const
|
|
14012
|
-
|
|
14013
|
-
return botResponses;
|
|
14047
|
+
const isStreaming = (0, $b3y7N$useMemo)(()=>{
|
|
14048
|
+
return !!(canBeStreaming && streamingReplyToId);
|
|
14014
14049
|
}, [
|
|
14015
|
-
|
|
14016
|
-
|
|
14050
|
+
canBeStreaming,
|
|
14051
|
+
streamingReplyToId
|
|
14017
14052
|
]);
|
|
14018
|
-
(0, $b3y7N$
|
|
14019
|
-
if (botResponses.length && currentStreaming)
|
|
14020
|
-
|
|
14053
|
+
const streamingActivity = (0, $b3y7N$useMemo)(()=>{
|
|
14054
|
+
if (botResponses.length && currentStreaming) return botResponses.find((act)=>act.replyToId === streamingReplyToId && act.value?.streamingCount);
|
|
14055
|
+
return undefined;
|
|
14021
14056
|
}, [
|
|
14057
|
+
isStreaming,
|
|
14022
14058
|
botResponses,
|
|
14023
|
-
currentStreaming
|
|
14024
|
-
streamingId
|
|
14059
|
+
currentStreaming
|
|
14025
14060
|
]);
|
|
14026
|
-
|
|
14027
|
-
|
|
14028
|
-
|
|
14029
|
-
|
|
14030
|
-
|
|
14031
|
-
|
|
14032
|
-
|
|
14033
|
-
|
|
14034
|
-
|
|
14035
|
-
|
|
14036
|
-
|
|
14037
|
-
|
|
14038
|
-
|
|
14039
|
-
|
|
14040
|
-
|
|
14041
|
-
|
|
14042
|
-
|
|
14043
|
-
|
|
14044
|
-
|
|
14045
|
-
|
|
14046
|
-
|
|
14047
|
-
|
|
14048
|
-
|
|
14049
|
-
|
|
14050
|
-
__html: activity.htmlText
|
|
14051
|
-
}
|
|
14052
|
-
}) : activity.text ? /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14053
|
-
className: "rf-px-4",
|
|
14054
|
-
children: (0, $3792187fd212489a$export$d6c6ec86eedacfd9)(activity.text)
|
|
14055
|
-
}) : /*#__PURE__*/ (0, $b3y7N$jsx)((0, $b3y7N$react).Fragment, {}),
|
|
14056
|
-
!!activity?.attachments?.length && !(0, $1136774ec828a7ed$export$7c55936a30618336)(activity) && /*#__PURE__*/ (0, $b3y7N$jsx)("div", {
|
|
14057
|
-
className: `${forceMobileView ? "rf-m-auto" : "rf-w-full"} ${activity.attachments.length <= 1 && "rf-px-4"} rf-flex rf-flex-col rf-gap-2`,
|
|
14058
|
-
children: /*#__PURE__*/ (0, $b3y7N$jsx)((0, $d7c37f48f10c5387$export$2e2bcd8739ae039), {
|
|
14059
|
-
activity: activity
|
|
14060
|
-
})
|
|
14061
|
-
})
|
|
14062
|
-
]
|
|
14063
|
-
}, key);
|
|
14064
|
-
})
|
|
14065
|
-
]
|
|
14061
|
+
const nonStreamingActivities = (0, $b3y7N$useMemo)(()=>{
|
|
14062
|
+
if (isStreaming) return botResponses.filter((act)=>act.replyToId === streamingReplyToId && !act.value?.streamingCount);
|
|
14063
|
+
return botResponses;
|
|
14064
|
+
}, [
|
|
14065
|
+
isStreaming,
|
|
14066
|
+
botResponses
|
|
14067
|
+
]);
|
|
14068
|
+
return /*#__PURE__*/ (0, $b3y7N$jsx)((0, $b3y7N$react).Fragment, {
|
|
14069
|
+
children: isStreaming ? /*#__PURE__*/ (0, $b3y7N$jsxs)((0, $b3y7N$react).Fragment, {
|
|
14070
|
+
children: [
|
|
14071
|
+
/*#__PURE__*/ (0, $b3y7N$jsx)((0, $b22a7bbed115cb27$export$2e2bcd8739ae039), {
|
|
14072
|
+
triggerScroll: triggerScroll,
|
|
14073
|
+
setStreamingEnded: setStreamingEnded,
|
|
14074
|
+
streamingActivity: streamingActivity,
|
|
14075
|
+
currentStreaming: currentStreaming,
|
|
14076
|
+
isMobile: isMobile
|
|
14077
|
+
}),
|
|
14078
|
+
streamingEnded && /*#__PURE__*/ (0, $b3y7N$jsx)((0, $c7944488f0c23f01$export$2e2bcd8739ae039), {
|
|
14079
|
+
nonStreamingActivities: nonStreamingActivities
|
|
14080
|
+
})
|
|
14081
|
+
]
|
|
14082
|
+
}) : /*#__PURE__*/ (0, $b3y7N$jsx)((0, $c7944488f0c23f01$export$2e2bcd8739ae039), {
|
|
14083
|
+
nonStreamingActivities: botResponses
|
|
14084
|
+
})
|
|
14066
14085
|
});
|
|
14067
14086
|
};
|
|
14068
14087
|
var $ea27a870d6ff37c7$export$2e2bcd8739ae039 = $ea27a870d6ff37c7$var$DisplayStandard;
|
|
@@ -20683,7 +20702,7 @@ const $fd8b465eaceabe41$export$284b58786299e6c5 = async ({ configurationData: co
|
|
|
20683
20702
|
|
|
20684
20703
|
|
|
20685
20704
|
|
|
20686
|
-
const $303b7224b8f411ea$var$RetorikConfigHandler = (
|
|
20705
|
+
const $303b7224b8f411ea$var$RetorikConfigHandler = ({ config: config, viewsConfig: viewsConfig, chatbotData: chatbotData, chatbotDataWidget: chatbotDataWidget, agentData: agentData, ponyfillFactoryCredentials: ponyfillFactoryCredentials, customVoice: customVoice, colors: colors, skipLoader: skipLoader, defaultMode: defaultMode, GDPR: GDPR, addressData: addressData, externalEventHandler: externalEventHandler, externalComponents: externalComponents, userData: userData, width: width, height: height, menuConfig: menuConfig, parent: parent })=>{
|
|
20687
20706
|
const [fetchedConfig, setFetchedConfig] = (0, $b3y7N$useState)();
|
|
20688
20707
|
const [mainConfig, setMainConfig] = (0, $b3y7N$useState)(undefined);
|
|
20689
20708
|
const [isConfigUpdated, setIsConfigUpdated] = (0, $b3y7N$useState)(false);
|
|
@@ -20705,14 +20724,33 @@ const $303b7224b8f411ea$var$RetorikConfigHandler = (props)=>{
|
|
|
20705
20724
|
setIsConfigUpdated(true);
|
|
20706
20725
|
};
|
|
20707
20726
|
const fetchConfigurationFromRetorikStudio = async ()=>{
|
|
20708
|
-
const fetchedConfig = await (0, $760b7137ab1b4bd7$export$2e2bcd8739ae039)(
|
|
20727
|
+
const fetchedConfig = await (0, $760b7137ab1b4bd7$export$2e2bcd8739ae039)({
|
|
20728
|
+
config: config,
|
|
20729
|
+
viewsConfig: viewsConfig,
|
|
20730
|
+
chatbotData: chatbotData,
|
|
20731
|
+
chatbotDataWidget: chatbotDataWidget,
|
|
20732
|
+
agentData: agentData,
|
|
20733
|
+
ponyfillFactoryCredentials: ponyfillFactoryCredentials,
|
|
20734
|
+
customVoice: customVoice,
|
|
20735
|
+
colors: colors,
|
|
20736
|
+
skipLoader: skipLoader,
|
|
20737
|
+
defaultMode: defaultMode,
|
|
20738
|
+
GDPR: GDPR,
|
|
20739
|
+
addressData: addressData,
|
|
20740
|
+
externalEventHandler: externalEventHandler,
|
|
20741
|
+
externalComponents: externalComponents,
|
|
20742
|
+
userData: userData,
|
|
20743
|
+
width: width,
|
|
20744
|
+
height: height,
|
|
20745
|
+
menuConfig: menuConfig
|
|
20746
|
+
});
|
|
20709
20747
|
console.log("Retorik Framework > configuration fetched from Retorik Studio");
|
|
20710
20748
|
fetchedConfig && setFetchedConfig(fetchedConfig);
|
|
20711
20749
|
};
|
|
20712
20750
|
const checkGDPR = async ()=>{
|
|
20713
20751
|
const data = await (0, $fd8b465eaceabe41$export$284b58786299e6c5)({
|
|
20714
|
-
configurationData:
|
|
20715
|
-
addressData:
|
|
20752
|
+
configurationData: GDPR,
|
|
20753
|
+
addressData: addressData
|
|
20716
20754
|
});
|
|
20717
20755
|
// Set GDPR data in utilsStore
|
|
20718
20756
|
data.data && (0, $3426110875af99d0$export$2d640df2114a2d77)(data.data);
|
|
@@ -20722,61 +20760,78 @@ const $303b7224b8f411ea$var$RetorikConfigHandler = (props)=>{
|
|
|
20722
20760
|
/**
|
|
20723
20761
|
* Fetch configuration once and det GDPR data from Retorik Studio and set them in store
|
|
20724
20762
|
*/ (0, $b3y7N$useEffect)(()=>{
|
|
20725
|
-
|
|
20726
|
-
|
|
20763
|
+
fetchConfigurationFromRetorikStudio();
|
|
20764
|
+
addressData && checkGDPR();
|
|
20727
20765
|
}, []);
|
|
20728
20766
|
(0, $b3y7N$useEffect)(()=>{
|
|
20729
|
-
if (fetchedConfig
|
|
20730
|
-
const { skipLoader:
|
|
20767
|
+
if (fetchedConfig) {
|
|
20768
|
+
const { skipLoader: _skipLoader, defaultMode: _defaultMode, config: _config, viewsConfig: _viewsConfig, chatbotData: _chatbotData, chatbotDataWidget: _chatbotDataWidget, agentData: _agentData, ponyfillFactoryCredentials: _ponyfillFactoryCredentials, customVoice: _customVoice, colors: _colors } = fetchedConfig;
|
|
20731
20769
|
const mergedMainConfig = {
|
|
20732
|
-
config:
|
|
20733
|
-
viewsConfig:
|
|
20734
|
-
chatbotData:
|
|
20735
|
-
...
|
|
20736
|
-
...
|
|
20737
|
-
} :
|
|
20738
|
-
chatbotDataWidget:
|
|
20739
|
-
...
|
|
20740
|
-
...
|
|
20741
|
-
} :
|
|
20742
|
-
agentData:
|
|
20743
|
-
ponyfillFactoryCredentials:
|
|
20744
|
-
customVoice:
|
|
20745
|
-
...
|
|
20746
|
-
...
|
|
20747
|
-
} :
|
|
20748
|
-
colors:
|
|
20749
|
-
skipLoader:
|
|
20750
|
-
defaultMode:
|
|
20770
|
+
config: config !== undefined ? (0, $1286c804208ea5de$export$6969335ea1e4e77c)(config, _config) : _config,
|
|
20771
|
+
viewsConfig: viewsConfig !== undefined ? (0, $1286c804208ea5de$export$6969335ea1e4e77c)(viewsConfig, _viewsConfig) : _viewsConfig,
|
|
20772
|
+
chatbotData: chatbotData !== undefined ? {
|
|
20773
|
+
..._chatbotData,
|
|
20774
|
+
...chatbotData
|
|
20775
|
+
} : _chatbotData,
|
|
20776
|
+
chatbotDataWidget: chatbotDataWidget !== undefined ? {
|
|
20777
|
+
..._chatbotDataWidget,
|
|
20778
|
+
...chatbotDataWidget
|
|
20779
|
+
} : _chatbotDataWidget,
|
|
20780
|
+
agentData: agentData !== undefined ? agentData : _agentData,
|
|
20781
|
+
ponyfillFactoryCredentials: ponyfillFactoryCredentials !== undefined ? ponyfillFactoryCredentials : _ponyfillFactoryCredentials,
|
|
20782
|
+
customVoice: customVoice !== undefined ? {
|
|
20783
|
+
..._customVoice,
|
|
20784
|
+
...customVoice
|
|
20785
|
+
} : _customVoice,
|
|
20786
|
+
colors: colors !== undefined ? (0, $1286c804208ea5de$export$6969335ea1e4e77c)(colors, (0, $1286c804208ea5de$export$2e2bcd8739ae039)(_colors)) : (0, $1286c804208ea5de$export$2e2bcd8739ae039)(_colors),
|
|
20787
|
+
skipLoader: skipLoader !== undefined ? skipLoader : _skipLoader,
|
|
20788
|
+
defaultMode: defaultMode !== undefined ? defaultMode : _defaultMode,
|
|
20751
20789
|
// Data not retrieved from Retorik Studio
|
|
20752
|
-
addressData:
|
|
20753
|
-
userData:
|
|
20754
|
-
externalEventHandler:
|
|
20755
|
-
externalComponents:
|
|
20756
|
-
width:
|
|
20757
|
-
height:
|
|
20790
|
+
addressData: addressData,
|
|
20791
|
+
userData: userData,
|
|
20792
|
+
externalEventHandler: externalEventHandler,
|
|
20793
|
+
externalComponents: externalComponents,
|
|
20794
|
+
width: width,
|
|
20795
|
+
height: height
|
|
20758
20796
|
};
|
|
20759
20797
|
// Prevent menus from being copied again after each modification of configuration
|
|
20760
20798
|
if (mergedMainConfig.config) {
|
|
20761
|
-
mergedMainConfig.config.baseMenu =
|
|
20762
|
-
mergedMainConfig.config.customMenu =
|
|
20763
|
-
mergedMainConfig.config.subMenu =
|
|
20799
|
+
mergedMainConfig.config.baseMenu = config?.baseMenu || menuConfig?.baseMenu;
|
|
20800
|
+
mergedMainConfig.config.customMenu = config?.customMenu || menuConfig?.customMenu;
|
|
20801
|
+
mergedMainConfig.config.subMenu = config?.subMenu || menuConfig?.subMenu;
|
|
20764
20802
|
}
|
|
20765
20803
|
checkEmergencyAndSetConfig(mergedMainConfig);
|
|
20766
20804
|
}
|
|
20767
20805
|
}, [
|
|
20768
|
-
|
|
20806
|
+
config,
|
|
20807
|
+
viewsConfig,
|
|
20808
|
+
chatbotData,
|
|
20809
|
+
chatbotDataWidget,
|
|
20810
|
+
agentData,
|
|
20811
|
+
ponyfillFactoryCredentials,
|
|
20812
|
+
customVoice,
|
|
20813
|
+
colors,
|
|
20814
|
+
skipLoader,
|
|
20815
|
+
defaultMode,
|
|
20816
|
+
GDPR,
|
|
20817
|
+
addressData,
|
|
20818
|
+
externalEventHandler,
|
|
20819
|
+
externalComponents,
|
|
20820
|
+
userData,
|
|
20821
|
+
width,
|
|
20822
|
+
height,
|
|
20823
|
+
menuConfig,
|
|
20769
20824
|
fetchedConfig
|
|
20770
20825
|
]);
|
|
20771
20826
|
return mainConfig ? /*#__PURE__*/ (0, $b3y7N$jsx)((0, $7ca39a491751a711$export$2e2bcd8739ae039), {
|
|
20772
|
-
parent:
|
|
20827
|
+
parent: parent,
|
|
20773
20828
|
...mainConfig
|
|
20774
20829
|
}) : /*#__PURE__*/ (0, $b3y7N$jsx)((0, $9c6965b05003bf9d$export$2e2bcd8739ae039), {
|
|
20775
20830
|
className: isConfigUpdated ? "rf-animate-loaderFadeOut" : "",
|
|
20776
|
-
parent:
|
|
20777
|
-
width:
|
|
20778
|
-
height:
|
|
20779
|
-
fullSize: !!(
|
|
20831
|
+
parent: parent,
|
|
20832
|
+
width: width,
|
|
20833
|
+
height: height,
|
|
20834
|
+
fullSize: !!(parent !== (0, $f5ca62954d1f1f5b$export$a31c5a03aaeee5f).widget && config?.fullSize !== false)
|
|
20780
20835
|
});
|
|
20781
20836
|
};
|
|
20782
20837
|
var $303b7224b8f411ea$export$2e2bcd8739ae039 = $303b7224b8f411ea$var$RetorikConfigHandler;
|