@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.js
CHANGED
|
@@ -6304,7 +6304,7 @@ var $ef4ae4bb0e8b8f8c$export$2e2bcd8739ae039 = $ef4ae4bb0e8b8f8c$var$DisplaySubV
|
|
|
6304
6304
|
|
|
6305
6305
|
|
|
6306
6306
|
var $696df75883117d57$exports = {};
|
|
6307
|
-
$696df75883117d57$exports = JSON.parse('{"name":"@davi-ai/retorik-framework","version":"1.1.
|
|
6307
|
+
$696df75883117d57$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"}}');
|
|
6308
6308
|
|
|
6309
6309
|
|
|
6310
6310
|
const $71d6c880af885c00$var$Version = ({ isMobile: isMobile })=>{
|
|
@@ -13979,20 +13979,8 @@ var $016ac743b008b7bc$export$2e2bcd8739ae039 = $016ac743b008b7bc$var$Conversatio
|
|
|
13979
13979
|
|
|
13980
13980
|
|
|
13981
13981
|
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
13982
|
const $8113fa9a024156c4$var$interval = 150 // 20 // 25
|
|
13988
13983
|
;
|
|
13989
|
-
const $8113fa9a024156c4$var$md = new (0, ($parcel$interopDefault($dWhh5$markdownit)))({
|
|
13990
|
-
breaks: true,
|
|
13991
|
-
html: true,
|
|
13992
|
-
xhtmlOut: true,
|
|
13993
|
-
typographer: true,
|
|
13994
|
-
quotes: `""''`
|
|
13995
|
-
});
|
|
13996
13984
|
const $8113fa9a024156c4$var$DisplayStreaming = ({ triggerScroll: triggerScroll, setStreamingEnded: setStreamingEnded, streamingActivity: streamingActivity, currentStreaming: currentStreaming, isMobile: isMobile })=>{
|
|
13997
13985
|
var _streamingActivity_attachments;
|
|
13998
13986
|
const locale = (0, $b6a8688e7db7a7b9$export$6650dace022cfacc)((state)=>state.locale);
|
|
@@ -14011,12 +13999,17 @@ const $8113fa9a024156c4$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
14011
13999
|
}, [
|
|
14012
14000
|
streamingQueue
|
|
14013
14001
|
]);
|
|
14002
|
+
(0, $dWhh5$react.useEffect)(()=>{
|
|
14003
|
+
console.log("streamingActivity : ", streamingActivity);
|
|
14004
|
+
}, [
|
|
14005
|
+
streamingActivity
|
|
14006
|
+
]);
|
|
14014
14007
|
const intervalRef = (0, $dWhh5$react.useRef)(null);
|
|
14015
14008
|
const streamRef = (0, $dWhh5$react.useRef)([]);
|
|
14016
14009
|
const streamIndexRef = (0, $dWhh5$react.useRef)(0);
|
|
14017
14010
|
const previousTextRef = (0, $dWhh5$react.useRef)([]);
|
|
14018
14011
|
const handleNewStreaming = (text)=>{
|
|
14019
|
-
text = $
|
|
14012
|
+
text = (0, $48f0df83bc0817a8$export$1b8fbc30fb87d9aa)(text, false).htmlText;
|
|
14020
14013
|
streamRef.current = text.split(" ");
|
|
14021
14014
|
setCurrentTextEnded(false);
|
|
14022
14015
|
intervalRef.current = setInterval(()=>{
|
|
@@ -14054,7 +14047,7 @@ const $8113fa9a024156c4$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
14054
14047
|
streamingQueue.forEach((activity)=>{
|
|
14055
14048
|
fullText = `${fullText} ${activity.text}`;
|
|
14056
14049
|
});
|
|
14057
|
-
setStreamingTextToDisplay($
|
|
14050
|
+
setStreamingTextToDisplay((0, $48f0df83bc0817a8$export$1b8fbc30fb87d9aa)(fullText, false).htmlText);
|
|
14058
14051
|
setStreamingEnded(true);
|
|
14059
14052
|
resetData();
|
|
14060
14053
|
}
|
|
@@ -14111,72 +14104,101 @@ const $8113fa9a024156c4$var$DisplayStreaming = ({ triggerScroll: triggerScroll,
|
|
|
14111
14104
|
var $8113fa9a024156c4$export$2e2bcd8739ae039 = $8113fa9a024156c4$var$DisplayStreaming;
|
|
14112
14105
|
|
|
14113
14106
|
|
|
14114
|
-
|
|
14107
|
+
|
|
14108
|
+
|
|
14109
|
+
|
|
14110
|
+
|
|
14111
|
+
|
|
14112
|
+
|
|
14113
|
+
|
|
14114
|
+
const $625082d013e43196$var$DisplayNonStreaming = ({ nonStreamingActivities: nonStreamingActivities, isMobile: isMobile })=>{
|
|
14115
14115
|
const locale = (0, $b6a8688e7db7a7b9$export$6650dace022cfacc)((state)=>state.locale);
|
|
14116
|
-
const currentStreaming = (0, $5f7f457957bd2c8d$export$f299240efcda25a2)((state)=>state.currentStreaming);
|
|
14117
|
-
const streamingId = (0, $5f7f457957bd2c8d$export$f299240efcda25a2)((state)=>state.streamingReplyToId);
|
|
14118
14116
|
const forceMobileView = (0, $c7242af7a2bc5e50$export$bd22554f31e5f96f)((state)=>state.configuration.forceMobileView);
|
|
14119
|
-
|
|
14117
|
+
return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {
|
|
14118
|
+
children: nonStreamingActivities.map((activity, key)=>{
|
|
14119
|
+
var _activity_attachments;
|
|
14120
|
+
const answerTime = activity.localTimestamp ? new Date(activity.localTimestamp) : activity.timestamp ? new Date(activity.timestamp) : new Date();
|
|
14121
|
+
return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsxs)("div", {
|
|
14122
|
+
className: `${key > 0 && "rf-pt-2"} rf-text-textModePanelConversationBot rf-animate-slideBottom rf-flex rf-flex-col rf-items-start rf-gap-2`,
|
|
14123
|
+
children: [
|
|
14124
|
+
isMobile && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14125
|
+
className: "rf-px-4 rf-text-[#9A9A9A]",
|
|
14126
|
+
children: answerTime.toLocaleString(locale, {
|
|
14127
|
+
hour: "numeric",
|
|
14128
|
+
minute: "numeric"
|
|
14129
|
+
})
|
|
14130
|
+
}),
|
|
14131
|
+
activity.htmlText ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14132
|
+
className: "rf-px-4",
|
|
14133
|
+
dangerouslySetInnerHTML: {
|
|
14134
|
+
__html: activity.htmlText
|
|
14135
|
+
}
|
|
14136
|
+
}) : activity.text ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14137
|
+
className: "rf-px-4",
|
|
14138
|
+
children: (0, $547da4225675b90f$export$d6c6ec86eedacfd9)(activity.text)
|
|
14139
|
+
}) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {}),
|
|
14140
|
+
!!(activity === null || activity === void 0 ? void 0 : (_activity_attachments = activity.attachments) === null || _activity_attachments === void 0 ? void 0 : _activity_attachments.length) && !(0, $1a0bdae30bc87d45$export$7c55936a30618336)(activity) && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14141
|
+
className: `${forceMobileView ? "rf-m-auto" : "rf-w-full"} ${activity.attachments.length <= 1 && "rf-px-4"} rf-flex rf-flex-col rf-gap-2`,
|
|
14142
|
+
children: /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $c0f9a707e7db7f07$export$2e2bcd8739ae039), {
|
|
14143
|
+
activity: activity
|
|
14144
|
+
})
|
|
14145
|
+
})
|
|
14146
|
+
]
|
|
14147
|
+
}, key);
|
|
14148
|
+
})
|
|
14149
|
+
});
|
|
14150
|
+
};
|
|
14151
|
+
var $625082d013e43196$export$2e2bcd8739ae039 = $625082d013e43196$var$DisplayNonStreaming;
|
|
14152
|
+
|
|
14153
|
+
|
|
14154
|
+
const $a2a195f52aaf1332$var$DisplayStandard = ({ botResponses: botResponses, isMobile: isMobile, triggerScroll: triggerScroll, canBeStreaming: canBeStreaming })=>{
|
|
14155
|
+
const currentStreaming = (0, $5f7f457957bd2c8d$export$f299240efcda25a2)((state)=>state.currentStreaming);
|
|
14156
|
+
const streamingReplyToId = (0, $5f7f457957bd2c8d$export$f299240efcda25a2)((state)=>state.streamingReplyToId);
|
|
14120
14157
|
const [streamingEnded, setStreamingEnded] = (0, $dWhh5$react.useState)(false);
|
|
14121
|
-
const
|
|
14122
|
-
|
|
14123
|
-
return botResponses;
|
|
14158
|
+
const isStreaming = (0, $dWhh5$react.useMemo)(()=>{
|
|
14159
|
+
return !!(canBeStreaming && streamingReplyToId);
|
|
14124
14160
|
}, [
|
|
14125
|
-
|
|
14126
|
-
|
|
14161
|
+
canBeStreaming,
|
|
14162
|
+
streamingReplyToId
|
|
14127
14163
|
]);
|
|
14128
|
-
(0, $dWhh5$react.
|
|
14129
|
-
if (botResponses.length && currentStreaming)
|
|
14164
|
+
const streamingActivity = (0, $dWhh5$react.useMemo)(()=>{
|
|
14165
|
+
if (botResponses.length && currentStreaming) return botResponses.find((act)=>{
|
|
14130
14166
|
var _act_value;
|
|
14131
|
-
return act.replyToId ===
|
|
14132
|
-
})
|
|
14133
|
-
|
|
14167
|
+
return act.replyToId === streamingReplyToId && ((_act_value = act.value) === null || _act_value === void 0 ? void 0 : _act_value.streamingCount);
|
|
14168
|
+
});
|
|
14169
|
+
return undefined;
|
|
14134
14170
|
}, [
|
|
14171
|
+
isStreaming,
|
|
14135
14172
|
botResponses,
|
|
14136
|
-
currentStreaming
|
|
14137
|
-
streamingId
|
|
14173
|
+
currentStreaming
|
|
14138
14174
|
]);
|
|
14139
|
-
|
|
14140
|
-
|
|
14141
|
-
|
|
14142
|
-
|
|
14143
|
-
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
|
|
14150
|
-
|
|
14151
|
-
|
|
14152
|
-
|
|
14153
|
-
|
|
14154
|
-
|
|
14155
|
-
|
|
14156
|
-
|
|
14157
|
-
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
|
|
14161
|
-
|
|
14162
|
-
|
|
14163
|
-
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
}) : activity.text ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14167
|
-
className: "rf-px-4",
|
|
14168
|
-
children: (0, $547da4225675b90f$export$d6c6ec86eedacfd9)(activity.text)
|
|
14169
|
-
}) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {}),
|
|
14170
|
-
!!(activity === null || activity === void 0 ? void 0 : (_activity_attachments = activity.attachments) === null || _activity_attachments === void 0 ? void 0 : _activity_attachments.length) && !(0, $1a0bdae30bc87d45$export$7c55936a30618336)(activity) && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)("div", {
|
|
14171
|
-
className: `${forceMobileView ? "rf-m-auto" : "rf-w-full"} ${activity.attachments.length <= 1 && "rf-px-4"} rf-flex rf-flex-col rf-gap-2`,
|
|
14172
|
-
children: /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $c0f9a707e7db7f07$export$2e2bcd8739ae039), {
|
|
14173
|
-
activity: activity
|
|
14174
|
-
})
|
|
14175
|
-
})
|
|
14176
|
-
]
|
|
14177
|
-
}, key);
|
|
14178
|
-
})
|
|
14179
|
-
]
|
|
14175
|
+
const nonStreamingActivities = (0, $dWhh5$react.useMemo)(()=>{
|
|
14176
|
+
if (isStreaming) return botResponses.filter((act)=>{
|
|
14177
|
+
var _act_value;
|
|
14178
|
+
return act.replyToId === streamingReplyToId && !((_act_value = act.value) === null || _act_value === void 0 ? void 0 : _act_value.streamingCount);
|
|
14179
|
+
});
|
|
14180
|
+
return botResponses;
|
|
14181
|
+
}, [
|
|
14182
|
+
isStreaming,
|
|
14183
|
+
botResponses
|
|
14184
|
+
]);
|
|
14185
|
+
return /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {
|
|
14186
|
+
children: isStreaming ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsxs)((0, ($parcel$interopDefault($dWhh5$react))).Fragment, {
|
|
14187
|
+
children: [
|
|
14188
|
+
/*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $8113fa9a024156c4$export$2e2bcd8739ae039), {
|
|
14189
|
+
triggerScroll: triggerScroll,
|
|
14190
|
+
setStreamingEnded: setStreamingEnded,
|
|
14191
|
+
streamingActivity: streamingActivity,
|
|
14192
|
+
currentStreaming: currentStreaming,
|
|
14193
|
+
isMobile: isMobile
|
|
14194
|
+
}),
|
|
14195
|
+
streamingEnded && /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $625082d013e43196$export$2e2bcd8739ae039), {
|
|
14196
|
+
nonStreamingActivities: nonStreamingActivities
|
|
14197
|
+
})
|
|
14198
|
+
]
|
|
14199
|
+
}) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $625082d013e43196$export$2e2bcd8739ae039), {
|
|
14200
|
+
nonStreamingActivities: botResponses
|
|
14201
|
+
})
|
|
14180
14202
|
});
|
|
14181
14203
|
};
|
|
14182
14204
|
var $a2a195f52aaf1332$export$2e2bcd8739ae039 = $a2a195f52aaf1332$var$DisplayStandard;
|
|
@@ -20867,8 +20889,7 @@ const $9b7229e19d910060$export$284b58786299e6c5 = async ({ configurationData: co
|
|
|
20867
20889
|
|
|
20868
20890
|
|
|
20869
20891
|
|
|
20870
|
-
const $ce7633a58d99dcca$var$RetorikConfigHandler = (
|
|
20871
|
-
var _props_config;
|
|
20892
|
+
const $ce7633a58d99dcca$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 })=>{
|
|
20872
20893
|
const [fetchedConfig, setFetchedConfig] = (0, $dWhh5$react.useState)();
|
|
20873
20894
|
const [mainConfig, setMainConfig] = (0, $dWhh5$react.useState)(undefined);
|
|
20874
20895
|
const [isConfigUpdated, setIsConfigUpdated] = (0, $dWhh5$react.useState)(false);
|
|
@@ -20891,14 +20912,33 @@ const $ce7633a58d99dcca$var$RetorikConfigHandler = (props)=>{
|
|
|
20891
20912
|
setIsConfigUpdated(true);
|
|
20892
20913
|
};
|
|
20893
20914
|
const fetchConfigurationFromRetorikStudio = async ()=>{
|
|
20894
|
-
const fetchedConfig = await (0, $ba3150a69d33f468$export$2e2bcd8739ae039)(
|
|
20915
|
+
const fetchedConfig = await (0, $ba3150a69d33f468$export$2e2bcd8739ae039)({
|
|
20916
|
+
config: config,
|
|
20917
|
+
viewsConfig: viewsConfig,
|
|
20918
|
+
chatbotData: chatbotData,
|
|
20919
|
+
chatbotDataWidget: chatbotDataWidget,
|
|
20920
|
+
agentData: agentData,
|
|
20921
|
+
ponyfillFactoryCredentials: ponyfillFactoryCredentials,
|
|
20922
|
+
customVoice: customVoice,
|
|
20923
|
+
colors: colors,
|
|
20924
|
+
skipLoader: skipLoader,
|
|
20925
|
+
defaultMode: defaultMode,
|
|
20926
|
+
GDPR: GDPR,
|
|
20927
|
+
addressData: addressData,
|
|
20928
|
+
externalEventHandler: externalEventHandler,
|
|
20929
|
+
externalComponents: externalComponents,
|
|
20930
|
+
userData: userData,
|
|
20931
|
+
width: width,
|
|
20932
|
+
height: height,
|
|
20933
|
+
menuConfig: menuConfig
|
|
20934
|
+
});
|
|
20895
20935
|
console.log("Retorik Framework > configuration fetched from Retorik Studio");
|
|
20896
20936
|
fetchedConfig && setFetchedConfig(fetchedConfig);
|
|
20897
20937
|
};
|
|
20898
20938
|
const checkGDPR = async ()=>{
|
|
20899
20939
|
const data = await (0, $9b7229e19d910060$export$284b58786299e6c5)({
|
|
20900
|
-
configurationData:
|
|
20901
|
-
addressData:
|
|
20940
|
+
configurationData: GDPR,
|
|
20941
|
+
addressData: addressData
|
|
20902
20942
|
});
|
|
20903
20943
|
// Set GDPR data in utilsStore
|
|
20904
20944
|
data.data && (0, $70e3d65f5a106231$export$2d640df2114a2d77)(data.data);
|
|
@@ -20908,62 +20948,78 @@ const $ce7633a58d99dcca$var$RetorikConfigHandler = (props)=>{
|
|
|
20908
20948
|
/**
|
|
20909
20949
|
* Fetch configuration once and det GDPR data from Retorik Studio and set them in store
|
|
20910
20950
|
*/ (0, $dWhh5$react.useEffect)(()=>{
|
|
20911
|
-
|
|
20912
|
-
|
|
20951
|
+
fetchConfigurationFromRetorikStudio();
|
|
20952
|
+
addressData && checkGDPR();
|
|
20913
20953
|
}, []);
|
|
20914
20954
|
(0, $dWhh5$react.useEffect)(()=>{
|
|
20915
|
-
if (fetchedConfig
|
|
20916
|
-
const { skipLoader:
|
|
20955
|
+
if (fetchedConfig) {
|
|
20956
|
+
const { skipLoader: _skipLoader, defaultMode: _defaultMode, config: _config, viewsConfig: _viewsConfig, chatbotData: _chatbotData, chatbotDataWidget: _chatbotDataWidget, agentData: _agentData, ponyfillFactoryCredentials: _ponyfillFactoryCredentials, customVoice: _customVoice, colors: _colors } = fetchedConfig;
|
|
20917
20957
|
const mergedMainConfig = {
|
|
20918
|
-
config:
|
|
20919
|
-
viewsConfig:
|
|
20920
|
-
chatbotData:
|
|
20921
|
-
...
|
|
20922
|
-
...
|
|
20923
|
-
} :
|
|
20924
|
-
chatbotDataWidget:
|
|
20925
|
-
...
|
|
20926
|
-
...
|
|
20927
|
-
} :
|
|
20928
|
-
agentData:
|
|
20929
|
-
ponyfillFactoryCredentials:
|
|
20930
|
-
customVoice:
|
|
20931
|
-
...
|
|
20932
|
-
...
|
|
20933
|
-
} :
|
|
20934
|
-
colors:
|
|
20935
|
-
skipLoader:
|
|
20936
|
-
defaultMode:
|
|
20958
|
+
config: config !== undefined ? (0, $68ec406cc754e31c$export$6969335ea1e4e77c)(config, _config) : _config,
|
|
20959
|
+
viewsConfig: viewsConfig !== undefined ? (0, $68ec406cc754e31c$export$6969335ea1e4e77c)(viewsConfig, _viewsConfig) : _viewsConfig,
|
|
20960
|
+
chatbotData: chatbotData !== undefined ? {
|
|
20961
|
+
..._chatbotData,
|
|
20962
|
+
...chatbotData
|
|
20963
|
+
} : _chatbotData,
|
|
20964
|
+
chatbotDataWidget: chatbotDataWidget !== undefined ? {
|
|
20965
|
+
..._chatbotDataWidget,
|
|
20966
|
+
...chatbotDataWidget
|
|
20967
|
+
} : _chatbotDataWidget,
|
|
20968
|
+
agentData: agentData !== undefined ? agentData : _agentData,
|
|
20969
|
+
ponyfillFactoryCredentials: ponyfillFactoryCredentials !== undefined ? ponyfillFactoryCredentials : _ponyfillFactoryCredentials,
|
|
20970
|
+
customVoice: customVoice !== undefined ? {
|
|
20971
|
+
..._customVoice,
|
|
20972
|
+
...customVoice
|
|
20973
|
+
} : _customVoice,
|
|
20974
|
+
colors: colors !== undefined ? (0, $68ec406cc754e31c$export$6969335ea1e4e77c)(colors, (0, $68ec406cc754e31c$export$2e2bcd8739ae039)(_colors)) : (0, $68ec406cc754e31c$export$2e2bcd8739ae039)(_colors),
|
|
20975
|
+
skipLoader: skipLoader !== undefined ? skipLoader : _skipLoader,
|
|
20976
|
+
defaultMode: defaultMode !== undefined ? defaultMode : _defaultMode,
|
|
20937
20977
|
// Data not retrieved from Retorik Studio
|
|
20938
|
-
addressData:
|
|
20939
|
-
userData:
|
|
20940
|
-
externalEventHandler:
|
|
20941
|
-
externalComponents:
|
|
20942
|
-
width:
|
|
20943
|
-
height:
|
|
20978
|
+
addressData: addressData,
|
|
20979
|
+
userData: userData,
|
|
20980
|
+
externalEventHandler: externalEventHandler,
|
|
20981
|
+
externalComponents: externalComponents,
|
|
20982
|
+
width: width,
|
|
20983
|
+
height: height
|
|
20944
20984
|
};
|
|
20945
20985
|
// Prevent menus from being copied again after each modification of configuration
|
|
20946
20986
|
if (mergedMainConfig.config) {
|
|
20947
|
-
|
|
20948
|
-
mergedMainConfig.config.
|
|
20949
|
-
mergedMainConfig.config.
|
|
20950
|
-
mergedMainConfig.config.subMenu = ((_props_config2 = props.config) === null || _props_config2 === void 0 ? void 0 : _props_config2.subMenu) || ((_props_menuConfig2 = props.menuConfig) === null || _props_menuConfig2 === void 0 ? void 0 : _props_menuConfig2.subMenu);
|
|
20987
|
+
mergedMainConfig.config.baseMenu = (config === null || config === void 0 ? void 0 : config.baseMenu) || (menuConfig === null || menuConfig === void 0 ? void 0 : menuConfig.baseMenu);
|
|
20988
|
+
mergedMainConfig.config.customMenu = (config === null || config === void 0 ? void 0 : config.customMenu) || (menuConfig === null || menuConfig === void 0 ? void 0 : menuConfig.customMenu);
|
|
20989
|
+
mergedMainConfig.config.subMenu = (config === null || config === void 0 ? void 0 : config.subMenu) || (menuConfig === null || menuConfig === void 0 ? void 0 : menuConfig.subMenu);
|
|
20951
20990
|
}
|
|
20952
20991
|
checkEmergencyAndSetConfig(mergedMainConfig);
|
|
20953
20992
|
}
|
|
20954
20993
|
}, [
|
|
20955
|
-
|
|
20994
|
+
config,
|
|
20995
|
+
viewsConfig,
|
|
20996
|
+
chatbotData,
|
|
20997
|
+
chatbotDataWidget,
|
|
20998
|
+
agentData,
|
|
20999
|
+
ponyfillFactoryCredentials,
|
|
21000
|
+
customVoice,
|
|
21001
|
+
colors,
|
|
21002
|
+
skipLoader,
|
|
21003
|
+
defaultMode,
|
|
21004
|
+
GDPR,
|
|
21005
|
+
addressData,
|
|
21006
|
+
externalEventHandler,
|
|
21007
|
+
externalComponents,
|
|
21008
|
+
userData,
|
|
21009
|
+
width,
|
|
21010
|
+
height,
|
|
21011
|
+
menuConfig,
|
|
20956
21012
|
fetchedConfig
|
|
20957
21013
|
]);
|
|
20958
21014
|
return mainConfig ? /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $bbc725a084d1069a$export$2e2bcd8739ae039), {
|
|
20959
|
-
parent:
|
|
21015
|
+
parent: parent,
|
|
20960
21016
|
...mainConfig
|
|
20961
21017
|
}) : /*#__PURE__*/ (0, $dWhh5$reactjsxruntime.jsx)((0, $9569bd86e01b07fd$export$2e2bcd8739ae039), {
|
|
20962
21018
|
className: isConfigUpdated ? "rf-animate-loaderFadeOut" : "",
|
|
20963
|
-
parent:
|
|
20964
|
-
width:
|
|
20965
|
-
height:
|
|
20966
|
-
fullSize: !!(
|
|
21019
|
+
parent: parent,
|
|
21020
|
+
width: width,
|
|
21021
|
+
height: height,
|
|
21022
|
+
fullSize: !!(parent !== (0, $71c613e2e831c34c$export$a31c5a03aaeee5f).widget && (config === null || config === void 0 ? void 0 : config.fullSize) !== false)
|
|
20967
21023
|
});
|
|
20968
21024
|
};
|
|
20969
21025
|
var $ce7633a58d99dcca$export$2e2bcd8739ae039 = $ce7633a58d99dcca$var$RetorikConfigHandler;
|