@seamly/web-ui 24.3.0 → 24.3.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/build/dist/lib/index.debug.js +25715 -24367
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +216 -0
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +2842 -1794
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +1992 -909
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/package.json +16 -16
- package/src/javascripts/core/api/index.ts +1 -4
- package/src/javascripts/core/domains/store/slice.ts +7 -2
- package/src/javascripts/core/lib/debug.ts +1 -4
- package/src/javascripts/core/ui/components/conversation/event/choice-prompt.tsx +1 -5
- package/src/javascripts/core/ui/hooks/use-seamly-commands.ts +0 -22
- package/src/javascripts/style-guide/states.ts +20 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seamly/web-ui",
|
|
3
|
-
"version": "24.3.
|
|
3
|
+
"version": "24.3.1",
|
|
4
4
|
"main": "build/dist/lib/index.js",
|
|
5
5
|
"types": "build/src/javascripts/index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"webpack/*"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@reduxjs/toolkit": "^2.
|
|
24
|
+
"@reduxjs/toolkit": "^2.6.1",
|
|
25
25
|
"@ultraq/icu-message-formatter": "^0.14.3",
|
|
26
|
-
"core-js": "^3.
|
|
26
|
+
"core-js": "^3.41.0",
|
|
27
27
|
"focus-trap": "^7.6.4",
|
|
28
28
|
"include-media": "^2.0.0",
|
|
29
29
|
"js-cookie": "^3.0.5",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"reconnecting-websocket": "^4.4.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@babel/core": "^7.26.
|
|
36
|
-
"@babel/preset-env": "^7.26.
|
|
35
|
+
"@babel/core": "^7.26.10",
|
|
36
|
+
"@babel/preset-env": "^7.26.9",
|
|
37
37
|
"@babel/preset-react": "^7.26.3",
|
|
38
38
|
"@babel/preset-typescript": "^7.26.0",
|
|
39
|
-
"@playwright/test": "^1.
|
|
39
|
+
"@playwright/test": "^1.51.0",
|
|
40
40
|
"@seamly/doc-site": "^4.0.0",
|
|
41
41
|
"@seamly/eslint-config": "^3.1.0",
|
|
42
42
|
"@seamly/prettier-config": "^3.1.0",
|
|
@@ -45,15 +45,15 @@
|
|
|
45
45
|
"@testing-library/preact": "^3.2.4",
|
|
46
46
|
"@types/core-js": "^2.5.8",
|
|
47
47
|
"@types/jest": "^29.5.12",
|
|
48
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
49
|
-
"@typescript-eslint/parser": "^8.
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^8.26.1",
|
|
49
|
+
"@typescript-eslint/parser": "^8.26.1",
|
|
50
50
|
"babel-jest": "^29.7.0",
|
|
51
51
|
"babel-loader": "^9.2.1",
|
|
52
52
|
"copy-webpack-plugin": "^12.0.2",
|
|
53
|
-
"dd-trace": "^5.
|
|
53
|
+
"dd-trace": "^5.42.0",
|
|
54
54
|
"eslint": "^8.57.0",
|
|
55
55
|
"eslint-config-prettier": "^9.1.0",
|
|
56
|
-
"eslint-import-resolver-typescript": "^3.
|
|
56
|
+
"eslint-import-resolver-typescript": "^3.9.1",
|
|
57
57
|
"eslint-plugin-filenames": "^1.3.2",
|
|
58
58
|
"eslint-plugin-import": "^2.29.1",
|
|
59
59
|
"eslint-plugin-jest": "^28.11.0",
|
|
@@ -69,14 +69,14 @@
|
|
|
69
69
|
"nyc": "^17.0.0",
|
|
70
70
|
"openapi-typescript": "^6.7",
|
|
71
71
|
"playwright-test-coverage": "^1.2.12",
|
|
72
|
-
"postcss": "^8.
|
|
73
|
-
"preact": "^10.
|
|
74
|
-
"prettier": "^3.
|
|
72
|
+
"postcss": "^8.5.3",
|
|
73
|
+
"preact": "^10.26.4",
|
|
74
|
+
"prettier": "^3.5.3",
|
|
75
75
|
"rimraf": "^6.0.1",
|
|
76
76
|
"style-loader": "^4.0.0",
|
|
77
|
-
"stylelint": "^16.
|
|
78
|
-
"typescript": "^5.
|
|
79
|
-
"webpack": "^5.
|
|
77
|
+
"stylelint": "^16.16.0",
|
|
78
|
+
"typescript": "^5.8.2",
|
|
79
|
+
"webpack": "^5.98.0",
|
|
80
80
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
81
81
|
"webpack-cli": "^6.0.1",
|
|
82
82
|
"webpack-dev-server": "^5.1.0",
|
|
@@ -233,13 +233,10 @@ export default class API {
|
|
|
233
233
|
return undefined
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
// Destructure the server locale from the payload
|
|
237
|
-
const localContentLocale = this.#config.context?.contentLocale
|
|
238
236
|
const localUserLocale = this.#config.context?.userLocale
|
|
239
237
|
|
|
240
238
|
return {
|
|
241
|
-
// Only send
|
|
242
|
-
...(localContentLocale ? { contentLocale: localContentLocale } : {}),
|
|
239
|
+
// Only send userLocale if explicitly set in the config (should be overridable by provided context)
|
|
243
240
|
...(localUserLocale ? { userLocale: localUserLocale } : {}),
|
|
244
241
|
...context,
|
|
245
242
|
}
|
|
@@ -361,8 +361,13 @@ export const storeSlice = createSlice({
|
|
|
361
361
|
Object.entries(participants).map(([_, value]) => [value.id, value]),
|
|
362
362
|
)
|
|
363
363
|
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
// Use the messages from the payload, as `events` only contains displayable ones.
|
|
365
|
+
// The first participant message found is the 'last', as we receive them from newest to oldest.
|
|
366
|
+
const lastParticipantEvent = messages.find(
|
|
367
|
+
(m) => m.type === 'participant',
|
|
368
|
+
)
|
|
369
|
+
// @ts-ignore TypeScript incorrectly assumes that the payload can be any of info/message/participant
|
|
370
|
+
const lastParticipantId = lastParticipantEvent?.payload?.participant?.id
|
|
366
371
|
|
|
367
372
|
const { entry } = service?.settings || {}
|
|
368
373
|
|
|
@@ -20,8 +20,7 @@ import type { MessageChoicePrompt } from 'domains/store/store.types'
|
|
|
20
20
|
export const useChoicePrompt = (event: MessageChoicePrompt) => {
|
|
21
21
|
const { payload } = event
|
|
22
22
|
const [showOptions, setShowOptions] = useState(false)
|
|
23
|
-
const { addMessageBubble,
|
|
24
|
-
useSeamlyCommands()
|
|
23
|
+
const { addMessageBubble, emitEvent, sendAction } = useSeamlyCommands()
|
|
25
24
|
const { activeServiceSessionId } = useSeamlyServiceInfo()
|
|
26
25
|
const lastEventId = useLastMessageEventId()
|
|
27
26
|
const { body } = useTranslatedEventData(event)
|
|
@@ -64,9 +63,6 @@ export const useChoicePrompt = (event: MessageChoicePrompt) => {
|
|
|
64
63
|
transactionId,
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
if (chooseAgain) {
|
|
68
|
-
addDivider('new_topic', transactionId)
|
|
69
|
-
}
|
|
70
66
|
addMessageBubble(choice.text, transactionId)
|
|
71
67
|
sendAction(action)
|
|
72
68
|
setShowOptions(false)
|
|
@@ -163,27 +163,6 @@ const useSeamlyCommands = () => {
|
|
|
163
163
|
[dispatch],
|
|
164
164
|
)
|
|
165
165
|
|
|
166
|
-
const addDivider = useCallback(
|
|
167
|
-
(subtype: 'new_topic', transactionId = randomId()) => {
|
|
168
|
-
dispatch(
|
|
169
|
-
addEvent({
|
|
170
|
-
type: 'info',
|
|
171
|
-
payload: {
|
|
172
|
-
type: 'divider',
|
|
173
|
-
body: {
|
|
174
|
-
subtype,
|
|
175
|
-
},
|
|
176
|
-
fromClient: false,
|
|
177
|
-
participant: null,
|
|
178
|
-
id: randomId(),
|
|
179
|
-
transactionId,
|
|
180
|
-
},
|
|
181
|
-
}),
|
|
182
|
-
)
|
|
183
|
-
},
|
|
184
|
-
[dispatch],
|
|
185
|
-
)
|
|
186
|
-
|
|
187
166
|
const sendAction = useCallback(
|
|
188
167
|
(body) => {
|
|
189
168
|
if (!body) {
|
|
@@ -245,7 +224,6 @@ const useSeamlyCommands = () => {
|
|
|
245
224
|
emitEvent,
|
|
246
225
|
addMessageBubble,
|
|
247
226
|
addUploadBubble,
|
|
248
|
-
addDivider,
|
|
249
227
|
apiConnected: api.connected,
|
|
250
228
|
apiConfigReady: api.configReady,
|
|
251
229
|
}
|
|
@@ -660,7 +660,7 @@ const choicePromptMessage = {
|
|
|
660
660
|
],
|
|
661
661
|
chooseAgain: true,
|
|
662
662
|
prompt: {
|
|
663
|
-
text: '
|
|
663
|
+
text: 'Here are some choice prompt options to choose from',
|
|
664
664
|
type: 'text',
|
|
665
665
|
variables: {},
|
|
666
666
|
},
|
|
@@ -1236,6 +1236,25 @@ const standardState = {
|
|
|
1236
1236
|
choicePromptMessage,
|
|
1237
1237
|
],
|
|
1238
1238
|
},
|
|
1239
|
+
choicePromptMessageWithoutManualInput: {
|
|
1240
|
+
category: categoryKeys.messages,
|
|
1241
|
+
headingText: 'Choice prompt message without manual input',
|
|
1242
|
+
description: '',
|
|
1243
|
+
...baseState,
|
|
1244
|
+
entryMeta: {
|
|
1245
|
+
...baseState.entryMeta,
|
|
1246
|
+
options: {
|
|
1247
|
+
text: {
|
|
1248
|
+
allowManualInput: false,
|
|
1249
|
+
},
|
|
1250
|
+
},
|
|
1251
|
+
},
|
|
1252
|
+
events: [choicePromptMessage],
|
|
1253
|
+
participantInfo,
|
|
1254
|
+
serviceInfo: {
|
|
1255
|
+
activeServiceSessionId: '3942159e-9878-469e-9120-f44fd6be0f35',
|
|
1256
|
+
},
|
|
1257
|
+
},
|
|
1239
1258
|
timeIndicators: {
|
|
1240
1259
|
category: categoryKeys.messages,
|
|
1241
1260
|
headingText: 'Time Indicators',
|