@botfabrik/engine-webclient 4.73.0 → 4.74.1
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/client/assets/{index-D9sAGRT3.js → index-CE3y_1Qm.js} +34 -34
- package/dist/client/assets/index-CE3y_1Qm.js.map +1 -0
- package/dist/client/index.html +1 -1
- package/dist/index.js +2 -1
- package/dist/middleware/index.js +9 -1
- package/dist/setTranslations.d.ts +4 -0
- package/dist/setTranslations.js +6 -0
- package/package.json +6 -6
- package/dist/client/assets/index-D9sAGRT3.js.map +0 -1
package/dist/client/index.html
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<meta name="theme-color" content="#000000" />
|
|
8
8
|
<meta name="google" content="notranslate" />
|
|
9
9
|
<title>Bubble Chat Client</title>
|
|
10
|
-
<script type="module" crossorigin src="./assets/index-
|
|
10
|
+
<script type="module" crossorigin src="./assets/index-CE3y_1Qm.js"></script>
|
|
11
11
|
<link rel="stylesheet" crossorigin href="./assets/index-CiW-VCiN.css">
|
|
12
12
|
</head>
|
|
13
13
|
|
package/dist/index.js
CHANGED
|
@@ -36,6 +36,7 @@ const getSupportedClientLocale_1 = __importDefault(require("./getSupportedClient
|
|
|
36
36
|
const loadPreviousConversation_1 = __importDefault(require("./loadPreviousConversation"));
|
|
37
37
|
const middleware_1 = __importDefault(require("./middleware"));
|
|
38
38
|
const requestSessionData_1 = __importDefault(require("./requestSessionData"));
|
|
39
|
+
const setTranslations_1 = __importDefault(require("./setTranslations"));
|
|
39
40
|
const speechToText_1 = __importDefault(require("./speechToText"));
|
|
40
41
|
const views_1 = __importDefault(require("./views"));
|
|
41
42
|
const version = require('../package.json').version;
|
|
@@ -209,7 +210,7 @@ const sendConfigurationToClient = (socket, props, bot, clientName) => {
|
|
|
209
210
|
const locale = (0, extractLocale_1.default)(socket.handshake.query, socket.request.headers['accept-language']);
|
|
210
211
|
const supportedLocale = bot.translation.detectSupportedLocale(locale);
|
|
211
212
|
const clientLocale = (0, getSupportedClientLocale_1.default)(supportedLocale);
|
|
212
|
-
|
|
213
|
+
(0, setTranslations_1.default)(socket, bot, clientLocale, clientName);
|
|
213
214
|
// enable speech support
|
|
214
215
|
if (props.speech) {
|
|
215
216
|
socket.emit('enable-speech-support');
|
package/dist/middleware/index.js
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const engine_domain_1 = require("@botfabrik/engine-domain");
|
|
4
7
|
const engine_utils_1 = require("@botfabrik/engine-utils");
|
|
5
8
|
const __1 = require("..");
|
|
6
|
-
|
|
9
|
+
const setTranslations_1 = __importDefault(require("../setTranslations"));
|
|
10
|
+
exports.default = (clientName, nsp) => async (bot) => {
|
|
7
11
|
return async (next, _state, action, session) => {
|
|
8
12
|
const sessionInfo = session.getSessionInfo();
|
|
9
13
|
const clientInfo = sessionInfo.client;
|
|
@@ -27,6 +31,10 @@ exports.default = (clientName, nsp) => async () => {
|
|
|
27
31
|
case engine_domain_1.ActionTypes.RESTART_CHAT_REQUEST:
|
|
28
32
|
restartChat(nsp, session);
|
|
29
33
|
break;
|
|
34
|
+
case engine_domain_1.ActionTypes.GUEST_LOCALE_CHANGED:
|
|
35
|
+
const { locale } = session.translator;
|
|
36
|
+
(0, setTranslations_1.default)(nsp, bot, locale, clientName);
|
|
37
|
+
break;
|
|
30
38
|
}
|
|
31
39
|
}
|
|
32
40
|
next(action);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const setTranslations = (socket, bot, clientLocale, clientName) => {
|
|
4
|
+
socket.emit('set-translations', clientLocale, bot.translation.getResourceBundle(clientLocale)[clientName] || {});
|
|
5
|
+
};
|
|
6
|
+
exports.default = setTranslations;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botfabrik/engine-webclient",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.74.1",
|
|
4
4
|
"description": "Webclient for Botfabriks Bot Engine",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"dev:embed": "tsx --watch ./run-embed-local.ts"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@botfabrik/engine-core": "^4.
|
|
24
|
-
"@botfabrik/engine-domain": "^4.
|
|
25
|
-
"@botfabrik/engine-transcript-export": "^4.
|
|
26
|
-
"@botfabrik/engine-utils": "^4.
|
|
23
|
+
"@botfabrik/engine-core": "^4.74.1",
|
|
24
|
+
"@botfabrik/engine-domain": "^4.74.0",
|
|
25
|
+
"@botfabrik/engine-transcript-export": "^4.74.1",
|
|
26
|
+
"@botfabrik/engine-utils": "^4.74.0",
|
|
27
27
|
"@google-cloud/speech": "^6.7.0",
|
|
28
28
|
"accept-language-parser": "^1.5.0",
|
|
29
29
|
"express": "^4.21.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"tsx": "^4.19.1",
|
|
41
41
|
"typescript": "5.1.6"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "e3ffbddb0c4c908edd0d3934e08f5f7644941d2c"
|
|
44
44
|
}
|