@seamly/web-ui 20.7.0 → 20.8.0-beta.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/hooks.js +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/index.debug.js +945 -790
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +187 -131
- package/build/dist/lib/index.js +24800 -19606
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +38 -4
- package/build/dist/lib/standalone.js +32920 -26742
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +39 -0
- package/build/dist/lib/storage.js +2 -2
- package/build/dist/lib/storage.min.js +1 -1
- package/build/dist/lib/style-guide.js +8780 -7907
- package/build/dist/lib/style-guide.min.js +2 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +38 -0
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/utils.js +1 -2
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +19 -9
- package/src/icons/avatar_agent-32.svg +7 -0
- package/src/icons/avatar_bot-32.svg +6 -1
- package/src/javascripts/api/index.js +1 -1
- package/src/javascripts/{config.js → config.ts} +3 -1
- package/src/javascripts/config.types.ts +96 -0
- package/src/javascripts/domains/app/actions.ts +83 -0
- package/src/javascripts/domains/app/app.types.ts +3 -0
- package/src/javascripts/domains/app/hooks.js +3 -5
- package/src/javascripts/domains/app/selectors.ts +6 -0
- package/src/javascripts/domains/app/slice.ts +30 -0
- package/src/javascripts/domains/config/actions.ts +45 -0
- package/src/javascripts/domains/config/hooks.ts +19 -0
- package/src/javascripts/domains/config/selectors.ts +24 -0
- package/src/javascripts/domains/config/slice.ts +113 -0
- package/src/javascripts/domains/errors/index.js +13 -9
- package/src/javascripts/domains/forms/context.ts +14 -0
- package/src/javascripts/domains/forms/forms.types.ts +24 -0
- package/src/javascripts/domains/forms/{hooks.js → hooks.ts} +23 -26
- package/src/javascripts/domains/forms/{provider.js → provider.tsx} +20 -14
- package/src/javascripts/domains/forms/{selectors.js → selectors.ts} +7 -8
- package/src/javascripts/domains/forms/slice.ts +84 -0
- package/src/javascripts/domains/forms/utils.ts +15 -0
- package/src/javascripts/domains/i18n/actions.ts +24 -0
- package/src/javascripts/domains/i18n/{hooks.js → hooks.ts} +2 -2
- package/src/javascripts/domains/i18n/i18n.types.ts +6 -0
- package/src/javascripts/domains/i18n/selectors.ts +16 -0
- package/src/javascripts/domains/i18n/{reducer.js → slice.ts} +40 -37
- package/src/javascripts/domains/interrupt/{hooks.js → hooks.ts} +2 -2
- package/src/javascripts/domains/interrupt/{middleware.js → middleware.ts} +11 -8
- package/src/javascripts/domains/interrupt/selectors.ts +6 -0
- package/src/javascripts/domains/interrupt/slice.ts +40 -0
- package/src/javascripts/domains/options/middleware.js +9 -6
- package/src/javascripts/domains/redux/redux.types.ts +11 -0
- package/src/javascripts/domains/store/index.ts +53 -0
- package/src/javascripts/domains/store/slice.ts +642 -0
- package/src/javascripts/domains/store/store.types.ts +146 -0
- package/src/javascripts/domains/translations/components/chat-status.js +2 -2
- package/src/javascripts/domains/translations/components/options-button.js +1 -1
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -2
- package/src/javascripts/domains/translations/hooks.ts +114 -0
- package/src/javascripts/domains/translations/middleware.js +29 -27
- package/src/javascripts/domains/translations/selectors.ts +12 -0
- package/src/javascripts/domains/translations/slice.ts +120 -0
- package/src/javascripts/domains/translations/translations.types.ts +19 -0
- package/src/javascripts/domains/visibility/{actions.js → actions.ts} +25 -19
- package/src/javascripts/domains/visibility/{hooks.js → hooks.ts} +13 -10
- package/src/javascripts/domains/visibility/{selectors.js → selectors.ts} +3 -6
- package/src/javascripts/domains/visibility/slice.ts +38 -0
- package/src/javascripts/domains/visibility/utils.js +0 -9
- package/src/javascripts/domains/visibility/visibility.types.ts +6 -0
- package/src/javascripts/index.ts +92 -0
- package/src/javascripts/lib/engine/index.js +15 -11
- package/src/javascripts/lib/external-api/initialize-api.js +1 -1
- package/src/javascripts/lib/id.js +5 -8
- package/src/javascripts/lib/mutex.js +3 -1
- package/src/javascripts/lib/store/providers/cookie-storage.js +1 -1
- package/src/javascripts/lib/store/providers/session-storage.js +1 -1
- package/src/javascripts/package/hooks.js +2 -2
- package/src/javascripts/package/utils.js +0 -1
- package/src/javascripts/schema.ts +1448 -0
- package/src/javascripts/style-guide/components/app.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +87 -65
- package/src/javascripts/style-guide/components/view.js +4 -4
- package/src/javascripts/style-guide/state-helpers/index.js +5 -5
- package/src/javascripts/style-guide/states.js +67 -7
- package/src/javascripts/style-guide.ts +5 -0
- package/src/javascripts/ui/components/app-options/index.js +2 -4
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +11 -7
- package/src/javascripts/ui/components/conversation/event/card-message.js +2 -2
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +2 -2
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +3 -3
- package/src/javascripts/ui/components/conversation/event/conversation-suggestions.js +19 -15
- package/src/javascripts/ui/components/conversation/event/cta.js +2 -2
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +44 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +2 -2
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +1 -1
- package/src/javascripts/ui/components/conversation/event/image.js +6 -8
- package/src/javascripts/ui/components/conversation/event/participant.js +2 -2
- package/src/javascripts/ui/components/conversation/event/splash.js +4 -4
- package/src/javascripts/ui/components/conversation/event/text.js +2 -2
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +3 -3
- package/src/javascripts/ui/components/conversation/event/video.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -26
- package/src/javascripts/ui/components/core/seamly-api-context.js +1 -1
- package/src/javascripts/ui/components/core/seamly-core.js +15 -14
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +98 -92
- package/src/javascripts/ui/components/core/seamly-file-upload.js +20 -24
- package/src/javascripts/ui/components/core/seamly-initializer.js +1 -1
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -4
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +2 -2
- package/src/javascripts/ui/components/core/seamly-read-state.js +10 -17
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +3 -3
- package/src/javascripts/ui/components/entry/entry-container.js +4 -6
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +3 -3
- package/src/javascripts/ui/components/entry/text-entry/index.js +3 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +6 -10
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +2 -2
- package/src/javascripts/ui/components/entry/upload/index.js +10 -9
- package/src/javascripts/ui/components/entry/upload-toggle.js +2 -2
- package/src/javascripts/ui/components/faq/faq.js +9 -7
- package/src/javascripts/ui/components/form-controls/file-input.js +1 -1
- package/src/javascripts/ui/components/form-controls/form.js +1 -1
- package/src/javascripts/ui/components/form-controls/input.js +1 -1
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +4 -4
- package/src/javascripts/ui/components/layout/chat-frame.js +3 -3
- package/src/javascripts/ui/components/layout/chat.js +11 -12
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +10 -9
- package/src/javascripts/ui/components/layout/header.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +23 -24
- package/src/javascripts/ui/components/layout/pre-chat-messages.js +11 -11
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +2 -2
- package/src/javascripts/ui/components/options/options-button.js +14 -10
- package/src/javascripts/ui/components/options/transcript/index.js +2 -2
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +1 -1
- package/src/javascripts/ui/components/suggestions/index.js +14 -10
- package/src/javascripts/ui/components/view/deprecated-view.js +19 -16
- package/src/javascripts/ui/components/view/index.js +12 -12
- package/src/javascripts/ui/components/view/inline-view.js +2 -2
- package/src/javascripts/ui/components/view/window-view/collapse-button.js +3 -3
- package/src/javascripts/ui/components/view/window-view/index.js +13 -13
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +13 -13
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +1 -1
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
- package/src/javascripts/ui/components/widgets/lightbox.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +1 -1
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +4 -6
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +14 -12
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -0
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +8 -3
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +28 -25
- package/src/javascripts/ui/hooks/seamly-hooks.js +25 -25
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +17 -19
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +20 -13
- package/src/javascripts/ui/hooks/use-seamly-chat.js +15 -25
- package/src/javascripts/ui/hooks/use-seamly-commands.js +46 -46
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +22 -24
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +8 -9
- package/src/javascripts/ui/hooks/use-single-file-upload.js +4 -6
- package/src/javascripts/ui/hooks/utility-hooks.js +4 -4
- package/src/javascripts/ui/utils/form-utils.js +0 -145
- package/src/javascripts/ui/utils/general-utils.js +3 -4
- package/src/javascripts/ui/utils/seamly-utils.ts +73 -0
- package/src/stylesheets/5-components/_message-carousel.scss +10 -8
- package/webpack/config.common.js +16 -0
- package/webpack/config.dev.js +1 -0
- package/webpack/config.package.js +26 -5
- package/webpack/defaults.js +7 -2
- package/webpack/parts/babel-loader-browser-plugins.js +1 -0
- package/webpack/parts/dev-server.js +4 -3
- package/CHANGELOG.md +0 -791
- package/src/javascripts/domains/app/actions.js +0 -112
- package/src/javascripts/domains/app/index.js +0 -7
- package/src/javascripts/domains/app/reducer.js +0 -16
- package/src/javascripts/domains/app/selectors.js +0 -8
- package/src/javascripts/domains/app/utils.js +0 -4
- package/src/javascripts/domains/config/actions.js +0 -7
- package/src/javascripts/domains/config/hooks.js +0 -23
- package/src/javascripts/domains/config/index.js +0 -7
- package/src/javascripts/domains/config/reducer.js +0 -79
- package/src/javascripts/domains/config/selectors.js +0 -23
- package/src/javascripts/domains/config/utils.js +0 -4
- package/src/javascripts/domains/forms/actions.js +0 -21
- package/src/javascripts/domains/forms/context.js +0 -6
- package/src/javascripts/domains/forms/index.js +0 -8
- package/src/javascripts/domains/forms/reducer.js +0 -84
- package/src/javascripts/domains/forms/utils.js +0 -20
- package/src/javascripts/domains/i18n/actions.js +0 -20
- package/src/javascripts/domains/i18n/index.js +0 -7
- package/src/javascripts/domains/i18n/selectors.js +0 -15
- package/src/javascripts/domains/i18n/utils.js +0 -4
- package/src/javascripts/domains/interrupt/actions.js +0 -4
- package/src/javascripts/domains/interrupt/index.js +0 -9
- package/src/javascripts/domains/interrupt/reducer.js +0 -22
- package/src/javascripts/domains/interrupt/selectors.js +0 -6
- package/src/javascripts/domains/interrupt/utils.js +0 -4
- package/src/javascripts/domains/options/index.js +0 -1
- package/src/javascripts/domains/redux/context.js +0 -6
- package/src/javascripts/domains/redux/create-redux-store.js +0 -21
- package/src/javascripts/domains/redux/hooks.js +0 -80
- package/src/javascripts/domains/redux/index.js +0 -19
- package/src/javascripts/domains/redux/provider.js +0 -5
- package/src/javascripts/domains/redux/utils.js +0 -12
- package/src/javascripts/domains/store/index.js +0 -46
- package/src/javascripts/domains/store/state-reducer.js +0 -56
- package/src/javascripts/domains/translations/actions.js +0 -11
- package/src/javascripts/domains/translations/hooks.js +0 -103
- package/src/javascripts/domains/translations/index.js +0 -10
- package/src/javascripts/domains/translations/reducer.js +0 -69
- package/src/javascripts/domains/translations/selectors.js +0 -16
- package/src/javascripts/domains/translations/utils.js +0 -4
- package/src/javascripts/domains/visibility/index.js +0 -8
- package/src/javascripts/domains/visibility/reducer.js +0 -24
- package/src/javascripts/index.js +0 -153
- package/src/javascripts/lib/redux-helpers/index.js +0 -99
- package/src/javascripts/style-guide.js +0 -5
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +0 -3
- package/src/javascripts/ui/utils/seamly-utils.js +0 -832
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { useI18n } from 'domains/i18n'
|
|
2
|
-
import { randomId } from 'lib/id'
|
|
3
|
-
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
1
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
4
2
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
registerUpload,
|
|
4
|
+
setUploadComplete,
|
|
5
|
+
setUploadError,
|
|
6
|
+
setUploadProgress,
|
|
7
|
+
} from 'domains/store/slice'
|
|
8
|
+
import { randomId } from 'lib/id'
|
|
9
|
+
import { useDispatch } from 'react-redux'
|
|
10
|
+
import { useSeamlyApiContext, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
9
11
|
import SeamlyFileUploadContext from './seamly-file-upload-context'
|
|
10
12
|
|
|
11
|
-
const {
|
|
12
|
-
REGISTER_UPLOAD,
|
|
13
|
-
SET_UPLOAD_PROGRESS,
|
|
14
|
-
SET_UPLOAD_ERROR,
|
|
15
|
-
SET_UPLOAD_COMPLETE,
|
|
16
|
-
} = seamlyActions
|
|
17
|
-
|
|
18
13
|
const SeamlyFileUpload = ({ children }) => {
|
|
19
14
|
const { t } = useI18n()
|
|
20
|
-
const dispatch =
|
|
15
|
+
const dispatch = useDispatch()
|
|
21
16
|
const api = useSeamlyApiContext()
|
|
22
17
|
const { addUploadBubble } = useSeamlyCommands()
|
|
23
18
|
|
|
@@ -27,7 +22,7 @@ const SeamlyFileUpload = ({ children }) => {
|
|
|
27
22
|
const uploadHandle = api.uploadFile(
|
|
28
23
|
file,
|
|
29
24
|
(p) => {
|
|
30
|
-
dispatch({
|
|
25
|
+
dispatch(setUploadProgress({ fileId, progress: Math.ceil(p) }))
|
|
31
26
|
},
|
|
32
27
|
(result) => {
|
|
33
28
|
const {
|
|
@@ -36,7 +31,7 @@ const SeamlyFileUpload = ({ children }) => {
|
|
|
36
31
|
occurredAt,
|
|
37
32
|
body: { contentType, filename, filesize, url },
|
|
38
33
|
} = result.body
|
|
39
|
-
dispatch(
|
|
34
|
+
dispatch(setUploadComplete(fileId))
|
|
40
35
|
addUploadBubble(
|
|
41
36
|
id,
|
|
42
37
|
transactionId,
|
|
@@ -68,16 +63,17 @@ const SeamlyFileUpload = ({ children }) => {
|
|
|
68
63
|
errorText = t('fileUpload.errors.general')
|
|
69
64
|
}
|
|
70
65
|
|
|
71
|
-
dispatch({
|
|
66
|
+
dispatch(setUploadError({ fileId, errorText }))
|
|
72
67
|
},
|
|
73
68
|
)
|
|
74
69
|
|
|
75
|
-
dispatch(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
dispatch(
|
|
71
|
+
registerUpload({
|
|
72
|
+
fileId,
|
|
73
|
+
fileName: file.name,
|
|
74
|
+
uploadHandle,
|
|
75
|
+
}),
|
|
76
|
+
)
|
|
81
77
|
}
|
|
82
78
|
|
|
83
79
|
return (
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'preact/hooks'
|
|
2
2
|
import { useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
3
|
-
import { useConfig } from 'domains/config'
|
|
3
|
+
import { useConfig } from 'domains/config/hooks'
|
|
4
4
|
|
|
5
5
|
const SeamlyInitializer = () => {
|
|
6
6
|
const { initUserSelectedOptions } = useSeamlyOptions()
|
|
@@ -8,10 +8,11 @@ import {
|
|
|
8
8
|
useSeamlyApiContext,
|
|
9
9
|
} from 'ui/hooks/seamly-hooks'
|
|
10
10
|
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
11
|
-
import { useTranslations } from 'domains/translations'
|
|
12
|
-
import { useInterrupt } from 'domains/interrupt'
|
|
13
|
-
import { useConfig } from 'domains/config'
|
|
14
|
-
import {
|
|
11
|
+
import { useTranslations } from 'domains/translations/hooks'
|
|
12
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
13
|
+
import { useConfig } from 'domains/config/hooks'
|
|
14
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
15
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
15
16
|
import { SeamlyEventBusContext } from './seamly-api-context'
|
|
16
17
|
|
|
17
18
|
function useSeamlyInstanceFunction(functionName, fn, deps = []) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useMemo } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
3
3
|
import {
|
|
4
4
|
useEvents,
|
|
5
5
|
useLiveRegion,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'ui/hooks/seamly-hooks'
|
|
8
8
|
import { newMessageScreenReaderWait } from 'config'
|
|
9
9
|
import { debounce } from 'ui/utils/general-utils'
|
|
10
|
-
import { useVisibility } from 'domains/visibility'
|
|
10
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
11
11
|
|
|
12
12
|
const SeamlyNewNotifications = () => {
|
|
13
13
|
const { t } = useI18n()
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'preact/hooks'
|
|
2
|
+
import { unreadScreenReaderWait } from 'config'
|
|
3
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
+
import { isUnreadMessage, setEventsRead } from 'domains/store/slice'
|
|
5
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
3
6
|
import {
|
|
4
7
|
useEvents,
|
|
5
|
-
useSeamlyCommands,
|
|
6
8
|
useLiveRegion,
|
|
9
|
+
useSeamlyCommands,
|
|
7
10
|
useSeamlyUnreadCount,
|
|
8
|
-
useSeamlyDispatchContext,
|
|
9
11
|
} from 'ui/hooks/seamly-hooks'
|
|
10
|
-
import { useI18n } from 'domains/i18n'
|
|
11
|
-
import {
|
|
12
|
-
seamlyActions,
|
|
13
|
-
readStates,
|
|
14
|
-
actionTypes,
|
|
15
|
-
isUnreadMessage,
|
|
16
|
-
} from 'ui/utils/seamly-utils'
|
|
17
12
|
import { debounce } from 'ui/utils/general-utils'
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
const { SET_EVENTS_READ } = seamlyActions
|
|
13
|
+
import { actionTypes, readStates } from 'ui/utils/seamly-utils'
|
|
14
|
+
import { useDispatch } from 'react-redux'
|
|
22
15
|
|
|
23
16
|
const SeamlyReadState = () => {
|
|
24
17
|
const { t } = useI18n()
|
|
25
18
|
const events = useEvents()
|
|
26
|
-
const dispatch =
|
|
19
|
+
const dispatch = useDispatch()
|
|
27
20
|
const { isOpen, isVisible } = useVisibility()
|
|
28
21
|
const { sendAction } = useSeamlyCommands()
|
|
29
22
|
const unreadCount = useSeamlyUnreadCount()
|
|
@@ -51,7 +44,7 @@ const SeamlyReadState = () => {
|
|
|
51
44
|
.map((event) => event.payload.id)
|
|
52
45
|
|
|
53
46
|
if (unread.length > 0) {
|
|
54
|
-
dispatch(
|
|
47
|
+
dispatch(setEventsRead(unread))
|
|
55
48
|
sendAction({ type: actionTypes.read, events: unread })
|
|
56
49
|
}
|
|
57
50
|
}, [events, dispatch, isOpen, sendAction])
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
3
3
|
import { className } from 'lib/css'
|
|
4
4
|
import {
|
|
5
5
|
useSkiplinkTargetFocusing,
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
useGeneratedId,
|
|
10
10
|
useSeamlyStateContext,
|
|
11
11
|
} from 'ui/hooks/seamly-hooks'
|
|
12
|
-
import { useInterrupt } from 'domains/interrupt'
|
|
13
|
-
import { useVisibility } from 'domains/visibility'
|
|
12
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
13
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
14
14
|
|
|
15
15
|
// Deprecated Toggle Button, should be removed once it is removed from clients
|
|
16
16
|
const DeprecatedToggleButton = ({ onOpenChat }) => {
|
|
@@ -4,15 +4,15 @@ import {
|
|
|
4
4
|
useSeamlyIdleDetachCountdown,
|
|
5
5
|
useSeamlyResumeConversationPrompt,
|
|
6
6
|
useSkiplinkTargetFocusing,
|
|
7
|
-
useSeamlyEntry,
|
|
8
7
|
useFileUploadMeta,
|
|
9
8
|
} from 'ui/hooks/seamly-hooks'
|
|
10
9
|
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
11
10
|
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
12
11
|
import IdleDetachWarning from 'ui/components/warnings/idle-detach-warning'
|
|
13
12
|
import ResumeConversationPrompt from 'ui/components/warnings/resume-conversation-prompt'
|
|
14
|
-
import { useConfig } from 'domains/config'
|
|
15
|
-
import { useVisibility } from 'domains/visibility'
|
|
13
|
+
import { useConfig } from 'domains/config/hooks'
|
|
14
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
15
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
16
16
|
import TextEntry from './text-entry'
|
|
17
17
|
import UploadToggle from './upload-toggle'
|
|
18
18
|
import Upload from './upload'
|
|
@@ -38,9 +38,7 @@ const EntryContainer = () => {
|
|
|
38
38
|
const { accountAllowsUploads } = useFileUploadMeta()
|
|
39
39
|
|
|
40
40
|
const focusFn = useCallback(() => {
|
|
41
|
-
runIfElementContainsOrHasFocus(entryContainer.current,
|
|
42
|
-
focusSkiplinkTarget()
|
|
43
|
-
})
|
|
41
|
+
runIfElementContainsOrHasFocus(entryContainer.current, focusSkiplinkTarget)
|
|
44
42
|
}, [focusSkiplinkTarget])
|
|
45
43
|
|
|
46
44
|
useEffect(() => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { maxCharacterSrDebounceDelay, maxCharacterWarningLimit } from 'config'
|
|
2
|
+
import { useFormControl } from 'domains/forms/hooks'
|
|
3
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
1
4
|
import { useEffect, useMemo } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n'
|
|
3
5
|
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
4
6
|
import { useEntryTextLimit } from 'ui/hooks/seamly-state-hooks'
|
|
5
7
|
import { debounce } from 'ui/utils/general-utils'
|
|
6
|
-
import { maxCharacterSrDebounceDelay, maxCharacterWarningLimit } from 'config'
|
|
7
|
-
import { useFormControl } from 'domains/forms'
|
|
8
8
|
|
|
9
9
|
export function useCharacterLimit(controlName) {
|
|
10
10
|
const { t } = useI18n()
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import FormProvider from 'domains/forms/provider'
|
|
2
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
3
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
1
4
|
import { useCallback } from 'preact/hooks'
|
|
2
5
|
import {
|
|
3
6
|
useSeamlyCommands,
|
|
4
7
|
useSkiplink,
|
|
5
8
|
useSkiplinkTargetFocusing,
|
|
6
9
|
} from 'ui/hooks/seamly-hooks'
|
|
7
|
-
import { FormProvider } from 'domains/forms'
|
|
8
10
|
import TextEntryForm from './text-entry-form'
|
|
9
|
-
import { useVisibility, visibilityStates } from '../../../../domains/visibility'
|
|
10
11
|
|
|
11
12
|
const controlName = 'userText'
|
|
12
13
|
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useFormControl } from 'domains/forms/hooks'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
2
3
|
import { className } from 'lib/css'
|
|
3
|
-
import {
|
|
4
|
-
useLiveRegion,
|
|
5
|
-
useSeamlyCommands,
|
|
6
|
-
useSeamlyEntry,
|
|
7
|
-
useSeamlyTyping,
|
|
8
|
-
} from 'ui/hooks/seamly-hooks'
|
|
9
|
-
import Icon from 'ui/components/layout/icon'
|
|
10
|
-
import { useFormControl } from 'domains/forms'
|
|
4
|
+
import { useCallback, useLayoutEffect, useMemo } from 'preact/hooks'
|
|
11
5
|
import Form from 'ui/components/form-controls/form'
|
|
12
6
|
import Input from 'ui/components/form-controls/input'
|
|
13
|
-
import
|
|
7
|
+
import Icon from 'ui/components/layout/icon'
|
|
8
|
+
import { useLiveRegion, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import { useSeamlyEntry, useSeamlyTyping } from 'ui/hooks/seamly-entry-hooks'
|
|
14
10
|
import { useCharacterLimit } from './hooks'
|
|
15
11
|
|
|
16
12
|
export default function TextEntryForm({ controlName, skipLinkId }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { className } from 'lib/css'
|
|
2
2
|
import Form from 'ui/components/form-controls/form'
|
|
3
3
|
import FileInput from 'ui/components/form-controls/file-input'
|
|
4
|
-
import { useI18n } from 'domains/i18n'
|
|
5
|
-
import { useFormControl } from 'domains/forms'
|
|
4
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
5
|
+
import { useFormControl } from 'domains/forms/hooks'
|
|
6
6
|
|
|
7
7
|
export default function FileInputForm({
|
|
8
8
|
skiplinkId,
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
1
|
+
import FormProvider from 'domains/forms/provider'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
2
3
|
import { className } from 'lib/css'
|
|
4
|
+
import { useCallback, useEffect, useMemo, useRef } from 'preact/hooks'
|
|
5
|
+
import UploadProgress from 'ui/components/widgets/upload-progress'
|
|
3
6
|
import {
|
|
4
|
-
useSkiplink,
|
|
5
7
|
useFileUploadMeta,
|
|
6
8
|
useFileUploads,
|
|
7
|
-
useSkiplinkTargetFocusing,
|
|
8
|
-
useLiveRegion,
|
|
9
9
|
useGeneratedId,
|
|
10
|
-
|
|
10
|
+
useLiveRegion,
|
|
11
|
+
useSkiplink,
|
|
12
|
+
useSkiplinkTargetFocusing,
|
|
11
13
|
} from 'ui/hooks/seamly-hooks'
|
|
14
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
12
15
|
import useSingleFileUpload from 'ui/hooks/use-single-file-upload'
|
|
13
|
-
import { useI18n } from 'domains/i18n'
|
|
14
|
-
import { formatBytes } from 'ui/utils/general-utils'
|
|
15
|
-
import UploadProgress from 'ui/components/widgets/upload-progress'
|
|
16
|
-
import { FormProvider } from 'domains/forms'
|
|
17
16
|
import { getValidator } from 'ui/utils/form-utils'
|
|
17
|
+
import { formatBytes } from 'ui/utils/general-utils'
|
|
18
18
|
import {
|
|
19
19
|
fileListObjectIsNotEmpty,
|
|
20
20
|
validateFileSize,
|
|
@@ -186,6 +186,7 @@ const Upload = () => {
|
|
|
186
186
|
onClickCancel={handleOnClickCancel}
|
|
187
187
|
/>
|
|
188
188
|
)}
|
|
189
|
+
|
|
189
190
|
{!canUpload.current && (
|
|
190
191
|
<>
|
|
191
192
|
<span className={className('notification')} id={notificationId}>
|
|
@@ -7,11 +7,11 @@ import InOutTransition, {
|
|
|
7
7
|
import {
|
|
8
8
|
useFileUploadMeta,
|
|
9
9
|
useSkiplinkTargetFocusing,
|
|
10
|
-
useSeamlyEntry,
|
|
11
10
|
useLiveRegion,
|
|
12
11
|
useSeamlyCurrentAgent,
|
|
13
12
|
} from 'ui/hooks/seamly-hooks'
|
|
14
|
-
import {
|
|
13
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
14
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
15
15
|
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
16
16
|
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
17
17
|
|
|
@@ -13,13 +13,13 @@ import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
|
13
13
|
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
14
14
|
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
15
15
|
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
16
|
-
import { useI18n } from 'domains/i18n'
|
|
16
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
17
17
|
import InOutTransition, {
|
|
18
18
|
transitionStartStates,
|
|
19
19
|
} from 'ui/components/widgets/in-out-transition'
|
|
20
|
-
import { useTranslatedEventData } from 'domains/translations'
|
|
21
|
-
import { useInterrupt } from 'domains/interrupt'
|
|
22
|
-
import { useUserHasResponded } from 'domains/app'
|
|
20
|
+
import { useTranslatedEventData } from 'domains/translations/hooks'
|
|
21
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
22
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
23
23
|
|
|
24
24
|
const Faq = () => {
|
|
25
25
|
const { t } = useI18n()
|
|
@@ -32,7 +32,9 @@ const Faq = () => {
|
|
|
32
32
|
const { hasPrompt, continueChat } = useSeamlyResumeConversationPrompt()
|
|
33
33
|
|
|
34
34
|
const lastFaqEventPayload = useSeamlyServiceData('suggestion')
|
|
35
|
-
const
|
|
35
|
+
const { body: eventBody } = useTranslatedEventData({
|
|
36
|
+
payload: lastFaqEventPayload,
|
|
37
|
+
})
|
|
36
38
|
const faqs = useMemo(() => {
|
|
37
39
|
const newFaqs = lastFaqEventPayload && !hasInterrupt ? eventBody : []
|
|
38
40
|
const itemBaseClass = `faqs__item`
|
|
@@ -55,8 +57,8 @@ const Faq = () => {
|
|
|
55
57
|
const prevHasFaqs = useRef(false)
|
|
56
58
|
|
|
57
59
|
const { isInline } = useSeamlyLayoutMode()
|
|
58
|
-
const
|
|
59
|
-
const hideForWindow = !isInline &&
|
|
60
|
+
const userHasResponded = useUserHasResponded()
|
|
61
|
+
const hideForWindow = !isInline && userHasResponded
|
|
60
62
|
const prevHideForWindow = useRef(hideForWindow)
|
|
61
63
|
|
|
62
64
|
const hasFaqs = !!faqs.length
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useCallback, useState } from 'preact/hooks'
|
|
2
2
|
import { className } from 'lib/css'
|
|
3
3
|
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
4
|
-
import { useFormControl, useFormContext } from 'domains/forms'
|
|
4
|
+
import { useFormControl, useFormContext } from 'domains/forms/hooks'
|
|
5
5
|
import Icon from 'ui/components/layout/icon'
|
|
6
6
|
import Error from './error'
|
|
7
7
|
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
useSeamlyCurrentAgent,
|
|
5
5
|
} from 'ui/hooks/seamly-hooks'
|
|
6
6
|
import { className } from 'lib/css'
|
|
7
|
-
import { useI18n } from 'domains/i18n'
|
|
8
|
-
import { useInterrupt } from 'domains/interrupt'
|
|
9
|
-
import { useStartChatIcon } from 'domains/config'
|
|
10
|
-
import { useVisibility } from 'domains/visibility'
|
|
7
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
8
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
9
|
+
import { useStartChatIcon } from 'domains/config/hooks'
|
|
10
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
11
11
|
import Icon from './icon'
|
|
12
12
|
|
|
13
13
|
const AgentInfo = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { className } from 'lib/css'
|
|
2
2
|
import AppOptions from 'ui/components/app-options'
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
3
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
4
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
5
|
+
import TranslationsChatStatus from 'domains/translations/components/chat-status'
|
|
6
6
|
|
|
7
7
|
function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
8
8
|
const { hasInterrupt, meta } = useInterrupt()
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
2
|
+
import { useConfig } from 'domains/config/hooks'
|
|
3
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
1
5
|
import { forwardRef } from 'preact/compat'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import { useConfig } from '../../../domains/config'
|
|
8
|
-
import { useUserHasResponded } from '../../../domains/app'
|
|
9
|
-
import { useI18n } from '../../../domains/i18n'
|
|
10
|
-
import { useVisibility, visibilityStates } from '../../../domains/visibility'
|
|
11
|
-
import Suggestions from '../suggestions'
|
|
6
|
+
import { className } from 'lib/css'
|
|
7
|
+
import { useSeamlyLayoutMode } from 'ui/hooks/seamly-state-hooks'
|
|
8
|
+
import { useSeamlyAppContainerClassNames } from 'ui/hooks/component-helper-hooks'
|
|
9
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
10
|
+
import Suggestions from 'ui/components/suggestions'
|
|
12
11
|
|
|
13
12
|
const Chat = forwardRef(
|
|
14
13
|
({ children, className: givenClassName = '' }, forwardedRef) => {
|
|
@@ -16,7 +15,7 @@ const Chat = forwardRef(
|
|
|
16
15
|
const { namespace, layoutMode } = useConfig()
|
|
17
16
|
const { isInline } = useSeamlyLayoutMode()
|
|
18
17
|
const appContainerClassNames = useSeamlyAppContainerClassNames()
|
|
19
|
-
const
|
|
18
|
+
const userHasResponded = useUserHasResponded()
|
|
20
19
|
const { t } = useI18n()
|
|
21
20
|
|
|
22
21
|
const defaultClassNames = [
|
|
@@ -35,7 +34,7 @@ const Chat = forwardRef(
|
|
|
35
34
|
classNames.push('chat--collapsed')
|
|
36
35
|
}
|
|
37
36
|
|
|
38
|
-
if (
|
|
37
|
+
if (userHasResponded) {
|
|
39
38
|
classNames.push('chat--user-responded')
|
|
40
39
|
}
|
|
41
40
|
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
2
|
+
import { useConfig } from 'domains/config/hooks'
|
|
3
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
5
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
2
6
|
import { className } from 'lib/css'
|
|
7
|
+
import { useCallback, useMemo } from 'preact/hooks'
|
|
8
|
+
import Faq from 'ui/components/faq/faq'
|
|
3
9
|
import {
|
|
4
10
|
useSeamlyAppContainerClassNames,
|
|
5
|
-
useSeamlyLayoutMode,
|
|
6
11
|
useSeamlyContainerElement,
|
|
12
|
+
useSeamlyLayoutMode,
|
|
7
13
|
} from 'ui/hooks/seamly-hooks'
|
|
8
|
-
import Faq from 'ui/components/faq/faq'
|
|
9
|
-
import { useConfig } from 'domains/config'
|
|
10
|
-
import { useUserHasResponded } from 'domains/app'
|
|
11
|
-
import { useI18n } from 'domains/i18n'
|
|
12
|
-
import { useVisibility, visibilityStates } from 'domains/visibility'
|
|
13
14
|
|
|
14
15
|
const DeprecatedAppFrame = ({ children }) => {
|
|
15
16
|
const [, setSeamlyContainerElement] = useSeamlyContainerElement()
|
|
@@ -17,7 +18,7 @@ const DeprecatedAppFrame = ({ children }) => {
|
|
|
17
18
|
const { zIndex, showFaq, layoutMode } = useConfig()
|
|
18
19
|
const { isInline } = useSeamlyLayoutMode()
|
|
19
20
|
const appContainerClassNames = useSeamlyAppContainerClassNames()
|
|
20
|
-
const
|
|
21
|
+
const userHasResponded = useUserHasResponded()
|
|
21
22
|
const { locale } = useI18n()
|
|
22
23
|
|
|
23
24
|
const containerElementRef = useCallback(
|
|
@@ -45,7 +46,7 @@ const DeprecatedAppFrame = ({ children }) => {
|
|
|
45
46
|
classNames.push('app--collapsed')
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
if (
|
|
49
|
+
if (userHasResponded) {
|
|
49
50
|
classNames.push('app--user-responded')
|
|
50
51
|
}
|
|
51
52
|
|
|
@@ -6,7 +6,6 @@ import {
|
|
|
6
6
|
useGeneratedId,
|
|
7
7
|
useSkiplinkTargetFocusing,
|
|
8
8
|
} from 'ui/hooks/seamly-hooks'
|
|
9
|
-
import SeamlySessionExpiredError from 'api/errors/seamly-session-expired-error'
|
|
10
9
|
|
|
11
10
|
const Interrupt = ({
|
|
12
11
|
originalError,
|
|
@@ -20,7 +19,7 @@ const Interrupt = ({
|
|
|
20
19
|
const headingId = useGeneratedId()
|
|
21
20
|
const { sendPolite } = useLiveRegion()
|
|
22
21
|
const focusSkiplinkTarget = useSkiplinkTargetFocusing()
|
|
23
|
-
const isExpiredError = originalError
|
|
22
|
+
const isExpiredError = originalError.name === 'SeamlySessionExpiredError'
|
|
24
23
|
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
if (isExpiredError) {
|
|
@@ -43,28 +42,28 @@ const Interrupt = ({
|
|
|
43
42
|
focusSkiplinkTarget()
|
|
44
43
|
}
|
|
45
44
|
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
<
|
|
49
|
-
<
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
{
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
45
|
+
return !isExpiredError ? (
|
|
46
|
+
<section className={className('interrupt')} aria-labelledby={headingId}>
|
|
47
|
+
<div className={className('interrupt__body')}>
|
|
48
|
+
<h2 id={headingId} className={className('interrupt__title')}>
|
|
49
|
+
{title}
|
|
50
|
+
</h2>
|
|
51
|
+
<p className={className('interrupt__message')}>{message}</p>
|
|
52
|
+
{buttonText && action && (
|
|
53
|
+
<div className={className('interrupt__actions')}>
|
|
54
|
+
<button
|
|
55
|
+
type="button"
|
|
56
|
+
className={className('button', 'button--primary')}
|
|
57
|
+
onClick={onClickHandler}
|
|
58
|
+
>
|
|
59
|
+
{buttonText}
|
|
60
|
+
</button>
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
) : (
|
|
66
|
+
<></>
|
|
68
67
|
)
|
|
69
68
|
}
|
|
70
69
|
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useInterrupt } from '
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
1
|
+
import { useConfig } from 'domains/config/hooks'
|
|
2
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
3
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
|
+
import useEventComponentMapping from 'ui/hooks/use-event-component-mapping'
|
|
6
|
+
|
|
7
|
+
export function PreChatMessageEvent({ event }) {
|
|
8
|
+
const [Component] = useEventComponentMapping(event)
|
|
9
|
+
return <Component event={event} />
|
|
10
|
+
}
|
|
6
11
|
|
|
7
12
|
export default function PreChatMessages() {
|
|
8
13
|
const { preChatEvents, layoutMode } = useConfig()
|
|
9
14
|
const { hasInterrupt } = useInterrupt()
|
|
10
15
|
const { isOpen } = useVisibility()
|
|
11
16
|
|
|
12
|
-
const isVisible = !(hasInterrupt || !preChatEvents
|
|
17
|
+
const isVisible = !(hasInterrupt || !preChatEvents?.length || isOpen)
|
|
13
18
|
|
|
14
19
|
return (
|
|
15
20
|
isVisible && (
|
|
@@ -32,8 +37,3 @@ export default function PreChatMessages() {
|
|
|
32
37
|
)
|
|
33
38
|
)
|
|
34
39
|
}
|
|
35
|
-
|
|
36
|
-
export function PreChatMessageEvent({ event }) {
|
|
37
|
-
const [Component] = useEventComponentMapping(event)
|
|
38
|
-
return <Component event={event} />
|
|
39
|
-
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { className } from 'lib/css'
|
|
2
|
-
import { useI18n } from 'domains/i18n'
|
|
3
|
-
import { useConfig } from 'domains/config'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
+
import { useConfig } from 'domains/config/hooks'
|
|
4
4
|
|
|
5
5
|
const PrivacyDisclaimer = () => {
|
|
6
6
|
const { t } = useI18n()
|