@seamly/web-ui 24.0.0-beta.9 → 24.0.0
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 +14 -15
- 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.map +1 -1
- package/build/dist/lib/index.js +14 -15
- 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/standalone.js +14 -15
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +14 -15
- 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/build/dist/lib/utils.js +14 -15
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +20 -1
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.ts +1 -17
package/package.json
CHANGED
|
@@ -28,6 +28,7 @@ import useSeamlyEventBusContext from 'ui/hooks/event-bus-hooks'
|
|
|
28
28
|
import {
|
|
29
29
|
useSeamlyCommands,
|
|
30
30
|
useSeamlyIdleDetachCountdown,
|
|
31
|
+
useSeamlyResumeConversationPrompt,
|
|
31
32
|
} from 'ui/hooks/seamly-hooks'
|
|
32
33
|
import useSeamlyConversation from 'ui/hooks/use-seamly-conversation'
|
|
33
34
|
import type { ChannelEvent } from 'domains/store/store.types'
|
|
@@ -44,6 +45,12 @@ const SeamlyEventSubscriber = () => {
|
|
|
44
45
|
const prevEmittedEventId = useRef(null)
|
|
45
46
|
const { initCountdown, endCountdown } = useSeamlyIdleDetachCountdown()
|
|
46
47
|
const { emitEvent } = useSeamlyCommands()
|
|
48
|
+
const { hasPrompt, continueChat } = useSeamlyResumeConversationPrompt()
|
|
49
|
+
const hasResumeConversationPrompt = useRef(hasPrompt)
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
hasResumeConversationPrompt.current = hasPrompt
|
|
53
|
+
}, [hasPrompt])
|
|
47
54
|
|
|
48
55
|
useEffect(() => {
|
|
49
56
|
if (conversation.socket) {
|
|
@@ -212,6 +219,10 @@ const SeamlyEventSubscriber = () => {
|
|
|
212
219
|
break
|
|
213
220
|
}
|
|
214
221
|
|
|
222
|
+
if (hasResumeConversationPrompt.current) {
|
|
223
|
+
continueChat()
|
|
224
|
+
}
|
|
225
|
+
|
|
215
226
|
dispatch(addEvent(event as unknown as ChannelEvent))
|
|
216
227
|
|
|
217
228
|
break
|
|
@@ -280,7 +291,15 @@ const SeamlyEventSubscriber = () => {
|
|
|
280
291
|
|
|
281
292
|
return true
|
|
282
293
|
})
|
|
283
|
-
}, [
|
|
294
|
+
}, [
|
|
295
|
+
continueChat,
|
|
296
|
+
conversation,
|
|
297
|
+
dispatch,
|
|
298
|
+
emitEvent,
|
|
299
|
+
endCountdown,
|
|
300
|
+
eventBus,
|
|
301
|
+
initCountdown,
|
|
302
|
+
])
|
|
284
303
|
|
|
285
304
|
useEffect(() => {
|
|
286
305
|
conversation.onConnection(({ connected }) => {
|
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
useSeamlyCommands,
|
|
16
16
|
useSeamlyConversationUrl,
|
|
17
17
|
useSeamlyLayoutMode,
|
|
18
|
-
useSeamlyResumeConversationPrompt,
|
|
19
18
|
useSeamlyUnreadCount,
|
|
20
19
|
} from 'ui/hooks/seamly-hooks'
|
|
21
20
|
import { actionTypes, sourceTypes } from 'ui/utils/seamly-utils'
|
|
@@ -47,8 +46,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
47
46
|
const currentVisibility = useRef(visible)
|
|
48
47
|
const eventBus = useSeamlyEventBusContext()
|
|
49
48
|
const api = useSeamlyApiContext()
|
|
50
|
-
const { hasPrompt, continueChat } = useSeamlyResumeConversationPrompt()
|
|
51
|
-
const hasResumeConversationPrompt = useRef(hasPrompt)
|
|
52
49
|
const unreadCount = useSeamlyUnreadCount()
|
|
53
50
|
const previousUnreadCount = useRef<number | null>(null)
|
|
54
51
|
const previousVisibilityState = useRef<VisibilityOptions>(null)
|
|
@@ -61,16 +58,11 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
61
58
|
|
|
62
59
|
useEffect(() => {
|
|
63
60
|
currentVisibility.current = visible
|
|
64
|
-
|
|
65
|
-
}, [hasPrompt, visible])
|
|
61
|
+
}, [visible])
|
|
66
62
|
|
|
67
63
|
useSeamlyInstanceFunction(
|
|
68
64
|
'askText',
|
|
69
65
|
(text) => {
|
|
70
|
-
if (hasResumeConversationPrompt.current) {
|
|
71
|
-
continueChat()
|
|
72
|
-
}
|
|
73
|
-
|
|
74
66
|
sendMessage({ body: text })
|
|
75
67
|
},
|
|
76
68
|
[api.send],
|
|
@@ -83,7 +75,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
83
75
|
},
|
|
84
76
|
[api.send],
|
|
85
77
|
)
|
|
86
|
-
|
|
87
78
|
useSeamlyInstanceFunction('getVisibility', (callback) => {
|
|
88
79
|
if (callback) {
|
|
89
80
|
callback(currentVisibility.current)
|
|
@@ -93,7 +84,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
93
84
|
)
|
|
94
85
|
}
|
|
95
86
|
})
|
|
96
|
-
|
|
97
87
|
useSeamlyInstanceFunction(
|
|
98
88
|
'setVisibility',
|
|
99
89
|
(args: VisibilityOptions | VisibilityActionArgs) => {
|
|
@@ -112,7 +102,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
112
102
|
},
|
|
113
103
|
[config.api],
|
|
114
104
|
)
|
|
115
|
-
|
|
116
105
|
useSeamlyInstanceFunction(
|
|
117
106
|
'sendCustomAction',
|
|
118
107
|
(actionType, body) => {
|
|
@@ -120,7 +109,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
120
109
|
},
|
|
121
110
|
[api.send],
|
|
122
111
|
)
|
|
123
|
-
|
|
124
112
|
useSeamlyInstanceFunction(
|
|
125
113
|
'setTopic',
|
|
126
114
|
({ name, fallbackMessage, message, userTriggered }) => {
|
|
@@ -128,10 +116,6 @@ const SeamlyInstanceFunctionsLoader = () => {
|
|
|
128
116
|
dispatch(updateConfig({ showSuggestions: false }))
|
|
129
117
|
}
|
|
130
118
|
|
|
131
|
-
if (hasResumeConversationPrompt.current) {
|
|
132
|
-
continueChat()
|
|
133
|
-
}
|
|
134
|
-
|
|
135
119
|
if (name && fallbackMessage) {
|
|
136
120
|
sendAction({
|
|
137
121
|
type: actionTypes.setTopic,
|