@botfabrik/engine-webclient 4.104.18-alpha.2 → 4.104.19

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.
@@ -13,7 +13,7 @@
13
13
  <meta name="theme-color" content="#000000" />
14
14
  <meta name="google" content="notranslate" />
15
15
  <title>Bubble Chat Client</title>
16
- <script type="module" crossorigin src="./assets/index-CyhFFdBd.js"></script>
16
+ <script type="module" crossorigin src="./assets/index-OGpqbf2g.js"></script>
17
17
  <link rel="stylesheet" crossorigin href="./assets/index-CzbajDSP.css">
18
18
  </head>
19
19
 
package/dist/index.js CHANGED
@@ -52,25 +52,17 @@ export default (clientName, environment, props) => async (bot) => {
52
52
  res.write(index(serverUrl.toString(), `${server}/embed/bundle.js`));
53
53
  res.end();
54
54
  });
55
- console.log('fabVisible', props.fabVisible);
56
- console.log('isFabAlwaysVisible', isFabAlwaysVisible(props));
57
- if (!isFabAlwaysVisible(props)) {
55
+ if (fabVisibilityIsConditional(props)) {
58
56
  bot.webserver.express.get(`/${clientName}/embed/bundle.js`, (req, res) => {
59
57
  const caller = req.query['caller'];
60
- const referer = req.get('referer');
58
+ const referer = req.get('referer')?.toLowerCase();
61
59
  const visibleUrls = Array.isArray(props.fabVisible)
62
60
  ? props.fabVisible
63
61
  : [];
64
- const isFromBaseUrl = referer
65
- ?.toLowerCase()
66
- .startsWith(bot.webserver.baseUrl.toLowerCase());
67
- const isFromVisibleUrl = visibleUrls.some((url) => referer?.toLowerCase().includes(url.toLowerCase()));
68
- console.log('referer', referer);
69
- console.log('visibleUrls', visibleUrls);
70
- console.log('isFromVisibleUrl', isFromVisibleUrl);
71
- console.log('baseUrl', bot.webserver.baseUrl);
72
- console.log('isFromBaseUrl', isFromBaseUrl);
73
- if (caller === 'bookmarklet' || isFromBaseUrl || isFromVisibleUrl) {
62
+ const isEmbedPage = !!referer?.startsWith(bot.webserver.baseUrl.toLowerCase());
63
+ const isFromVisibleUrl = isEmbedPage ||
64
+ visibleUrls.some((url) => referer?.startsWith(url.toLowerCase()));
65
+ if (caller === 'bookmarklet' || isFromVisibleUrl) {
74
66
  res.sendFile(`${__dirname}/embed/bundle.js`);
75
67
  }
76
68
  else {
@@ -137,7 +129,7 @@ const serveStaticOptions = {
137
129
  }
138
130
  },
139
131
  };
140
- const isFabAlwaysVisible = ({ fabVisible = true }) => fabVisible === true;
132
+ const fabVisibilityIsConditional = ({ fabVisible = true }) => fabVisible !== true;
141
133
  const onTerminateSession = (socket, bot) => async ({ sessionId, // passed if the user wants to restart the chat
142
134
  }) => {
143
135
  const session = await bot.createSession(sessionId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@botfabrik/engine-webclient",
3
- "version": "4.104.18-alpha.2",
3
+ "version": "4.104.19",
4
4
  "description": "Webclient for Botfabriks Bot Engine",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -31,9 +31,9 @@
31
31
  "dev:embed": "tsx --watch ./run-embed-local.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@botfabrik/engine-domain": "^4.104.14",
35
- "@botfabrik/engine-transcript-export": "^4.104.16",
36
- "@botfabrik/engine-utils": "^4.104.14",
34
+ "@botfabrik/engine-domain": "^4.104.19",
35
+ "@botfabrik/engine-transcript-export": "^4.104.19",
36
+ "@botfabrik/engine-utils": "^4.104.19",
37
37
  "@google-cloud/speech": "^7.2.1",
38
38
  "@node-saml/passport-saml": "^5.1.0",
39
39
  "express": "^5.2.1",
@@ -46,9 +46,9 @@
46
46
  "@types/jsonwebtoken": "^9.0.10",
47
47
  "@types/serve-static": "^2.2.0",
48
48
  "@types/ua-parser-js": "^0.7.39",
49
- "socket.io": "^4.8.1",
49
+ "socket.io": "^4.8.3",
50
50
  "tsx": "^4.21.0",
51
51
  "typescript": "5.9.3"
52
52
  },
53
- "gitHead": "e1f0ee90d27bb74ff651558dad1ba6f903ec6318"
53
+ "gitHead": "7677f93f772c0a198f0999f5be28b1d7f657e725"
54
54
  }