@seamly/web-ui 20.8.1 → 21.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/deprecated-view.js +1 -1
- package/build/dist/lib/index.debug.js +585 -584
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +110 -110
- package/build/dist/lib/index.js +20269 -26441
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +6 -1
- package/build/dist/lib/standalone.js +27728 -34583
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/storage.js +6 -15
- package/build/dist/lib/style-guide.js +9660 -8970
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.js +1 -1
- package/build/dist/lib/styles.js +1 -1
- package/build/dist/lib/utils.js +85 -3
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +54 -52
- package/src/icons/icon_check-16.svg +14 -0
- package/src/icons/icon_check-32.svg +14 -0
- package/src/javascripts/api/conversation-connector.ts +149 -0
- package/src/javascripts/api/errors/seamly-base-error.js +19 -0
- package/src/javascripts/api/errors/seamly-unavailable-error.js +5 -7
- package/src/javascripts/api/{index.js → index.ts} +163 -116
- package/src/javascripts/config.types.ts +5 -4
- package/src/javascripts/domains/app/actions.ts +47 -46
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/config/actions.ts +2 -8
- package/src/javascripts/domains/config/hooks.ts +1 -1
- package/src/javascripts/domains/config/selectors.ts +6 -6
- package/src/javascripts/domains/config/slice.ts +3 -3
- package/src/javascripts/domains/errors/index.ts +66 -0
- package/src/javascripts/domains/forms/context.ts +1 -1
- package/src/javascripts/domains/forms/forms.types.ts +3 -3
- package/src/javascripts/domains/forms/hooks.ts +10 -10
- package/src/javascripts/domains/forms/provider.tsx +9 -9
- package/src/javascripts/domains/i18n/actions.ts +11 -5
- package/src/javascripts/domains/i18n/hooks.ts +11 -8
- package/src/javascripts/domains/i18n/selectors.ts +10 -4
- package/src/javascripts/domains/i18n/slice.ts +0 -1
- package/src/javascripts/domains/interrupt/hooks.ts +1 -1
- package/src/javascripts/domains/interrupt/middleware.ts +1 -1
- package/src/javascripts/domains/store/index.ts +1 -1
- package/src/javascripts/domains/store/selectors.ts +16 -0
- package/src/javascripts/domains/store/slice.ts +47 -41
- package/src/javascripts/domains/store/store.types.ts +38 -10
- package/src/javascripts/domains/translations/components/{options-button.js → options-button.tsx} +30 -20
- package/src/javascripts/domains/translations/components/options-dialog/index.tsx +33 -0
- package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +37 -0
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +85 -0
- package/src/javascripts/domains/translations/components/translation-status.tsx +15 -0
- package/src/javascripts/domains/translations/hooks.ts +77 -11
- package/src/javascripts/domains/translations/slice.ts +20 -9
- package/src/javascripts/domains/translations/translations.types.ts +4 -2
- package/src/javascripts/domains/visibility/actions.ts +6 -10
- package/src/javascripts/domains/visibility/hooks.ts +33 -14
- package/src/javascripts/domains/visibility/selectors.ts +3 -2
- package/src/javascripts/domains/visibility/slice.ts +2 -6
- package/src/javascripts/index.ts +19 -21
- package/src/javascripts/lib/engine/{index.js → index.tsx} +25 -7
- package/src/javascripts/lib/url-helpers.ts +112 -0
- package/src/javascripts/package/utils.js +5 -2
- package/src/javascripts/schema.ts +28 -0
- package/src/javascripts/style-guide/components/app.js +16 -12
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +6 -3
- package/src/javascripts/style-guide/components/view.js +1 -1
- package/src/javascripts/style-guide/states.js +129 -31
- package/src/javascripts/style-guide/style-guide-engine.js +1 -1
- package/src/javascripts/ui/components/app-options/index.js +25 -6
- package/src/javascripts/ui/components/chat-app.js +1 -1
- package/src/javascripts/ui/components/chat-status/chat-status-action.tsx +30 -0
- package/src/javascripts/ui/components/chat-status/index.tsx +61 -0
- package/src/javascripts/ui/components/conversation/component-filter.js +9 -9
- package/src/javascripts/ui/components/conversation/{conversation.js → conversation.tsx} +32 -41
- package/src/javascripts/ui/components/conversation/event/card-component.js +2 -2
- package/src/javascripts/ui/components/conversation/event/card-message.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +2 -2
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +4 -4
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +2 -2
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/chat-scroll/chat-scroll-context.ts +12 -0
- package/src/javascripts/ui/components/conversation/event/chat-scroll/chat-scroll-provider.tsx +46 -0
- package/src/javascripts/ui/components/conversation/event/chat-scroll/unread-messages-button.tsx +27 -0
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +12 -8
- package/src/javascripts/ui/components/conversation/event/conversation-suggestions.js +6 -6
- package/src/javascripts/ui/components/conversation/event/cta.js +2 -2
- package/src/javascripts/ui/components/conversation/event/divider/index.js +0 -1
- 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 +17 -22
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +2 -2
- package/src/javascripts/ui/components/conversation/event/event-participant.js +1 -1
- package/src/javascripts/ui/components/conversation/event/event.tsx +66 -0
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +1 -1
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +1 -1
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +1 -1
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/splash.js +1 -1
- package/src/javascripts/ui/components/conversation/event/translation.js +1 -1
- package/src/javascripts/ui/components/conversation/event/upload.js +2 -2
- package/src/javascripts/ui/components/conversation/event/video.js +2 -2
- package/src/javascripts/ui/components/conversation/event-divider.js +1 -1
- package/src/javascripts/ui/components/conversation/message-container.js +1 -1
- package/src/javascripts/ui/components/conversation/use-chat-scroll.ts +108 -0
- package/src/javascripts/ui/components/core/{seamly-activity-monitor.js → seamly-activity-monitor.tsx} +12 -5
- package/src/javascripts/ui/components/core/seamly-api-context.ts +7 -0
- package/src/javascripts/ui/components/core/seamly-chat.tsx +8 -0
- package/src/javascripts/ui/components/core/{seamly-core.js → seamly-core.tsx} +27 -14
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +340 -0
- package/src/javascripts/ui/components/core/seamly-file-upload.js +2 -2
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +1 -1
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +24 -11
- package/src/javascripts/ui/components/core/seamly-live-region.js +4 -4
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +3 -3
- package/src/javascripts/ui/components/core/seamly-read-state.js +2 -33
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +4 -4
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +3 -3
- package/src/javascripts/ui/components/entry/text-entry/index.js +3 -3
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +4 -4
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +3 -3
- package/src/javascripts/ui/components/entry/upload/index.js +5 -5
- package/src/javascripts/ui/components/entry/upload-toggle.js +6 -6
- package/src/javascripts/ui/components/faq/faq.js +14 -14
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +3 -3
- package/src/javascripts/ui/components/layout/agent-info.js +3 -3
- package/src/javascripts/ui/components/layout/chat-frame.js +20 -12
- package/src/javascripts/ui/components/layout/chat.js +5 -5
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +6 -6
- package/src/javascripts/ui/components/layout/deprecated-chat-frame.js +34 -0
- package/src/javascripts/ui/components/layout/header.js +2 -2
- package/src/javascripts/ui/components/layout/icon.js +11 -9
- package/src/javascripts/ui/components/layout/interrupt.js +7 -5
- package/src/javascripts/ui/components/layout/pre-chat-messages.js +1 -1
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +2 -2
- package/src/javascripts/ui/components/options/options-button.js +5 -5
- package/src/javascripts/ui/components/options/{options-frame.js → options-frame.tsx} +52 -18
- package/src/javascripts/ui/components/options/transcript/index.js +9 -10
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +2 -2
- package/src/javascripts/ui/components/suggestions/index.js +8 -8
- package/src/javascripts/ui/components/suggestions/suggestions-item.js +1 -1
- package/src/javascripts/{domains/translations/components/chat-status.js → ui/components/translation-chat-status/index.tsx} +13 -14
- package/src/javascripts/ui/components/translation-proposal/index.tsx +36 -0
- package/src/javascripts/ui/components/view/app-view.js +2 -7
- package/src/javascripts/ui/components/view/deprecated-view.js +8 -10
- package/src/javascripts/ui/components/view/index.js +6 -6
- package/src/javascripts/ui/components/view/inline-view.js +4 -8
- package/src/javascripts/ui/components/view/window-view/collapse-button.js +2 -2
- package/src/javascripts/ui/components/view/window-view/index.js +11 -17
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +6 -6
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +3 -3
- package/src/javascripts/ui/components/warnings/prompt.js +1 -1
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +4 -4
- package/src/javascripts/ui/components/widgets/in-out-transition.js +20 -18
- package/src/javascripts/ui/components/widgets/lightbox.js +3 -3
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +2 -2
- package/src/javascripts/ui/hooks/file-upload-hooks.js +1 -1
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +6 -6
- package/src/javascripts/ui/hooks/seamly-hooks.js +11 -10
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +6 -6
- package/src/javascripts/ui/hooks/{seamly-state-hooks.js → seamly-state-hooks.ts} +9 -6
- package/src/javascripts/ui/hooks/use-click-outside.ts +29 -0
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +11 -10
- package/src/javascripts/ui/hooks/use-interval.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-actions.ts +29 -29
- package/src/javascripts/ui/hooks/use-seamly-chat.js +13 -23
- package/src/javascripts/ui/hooks/use-seamly-commands.js +20 -15
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +8 -8
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +1 -1
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/javascripts/ui/utils/general-utils.js +0 -23
- package/src/javascripts/ui/utils/seamly-utils.ts +10 -1
- package/src/javascripts/ui/utils/seamly-utils.types.ts +9 -0
- package/src/stylesheets/1-settings/_config.scss +1 -1
- package/src/stylesheets/3-chat/_chat.scss +23 -5
- package/src/stylesheets/5-components/_chat-status.scss +72 -16
- package/src/stylesheets/5-components/_conversation.scss +35 -1
- package/src/stylesheets/5-components/_disclaimer.scss +0 -5
- package/src/stylesheets/5-components/_options.scss +16 -2
- package/src/stylesheets/5-components/_translation-options.scss +39 -0
- package/src/stylesheets/6-default-implementation/_scrollbar.scss +1 -1
- package/src/stylesheets/7-deprecated/3-app/_app.scss +19 -4
- package/src/stylesheets/7-deprecated/5-components/_chat-status.scss +5 -0
- package/src/stylesheets/7-deprecated/5-components/_options.scss +1 -0
- package/src/stylesheets/7-deprecated/5-components/_translation-options.scss +39 -0
- package/src/stylesheets/deprecated-view.scss +1 -0
- package/src/stylesheets/styles.scss +1 -0
- package/webpack/config.common.js +4 -4
- package/webpack/config.package.js +10 -16
- package/webpack/config.site.js +4 -1
- package/webpack/config.test.js +2 -1
- package/build/dist/lib/deprecated-view.css +0 -1
- package/build/dist/lib/styles-default-implementation.css +0 -1
- package/build/dist/lib/styles.css +0 -1
- package/src/.DS_Store +0 -0
- package/src/javascripts/api/event-producer.js +0 -20
- package/src/javascripts/api/producer.js +0 -136
- package/src/javascripts/domains/errors/index.js +0 -37
- package/src/javascripts/domains/translations/components/options-dialog/form.js +0 -70
- package/src/javascripts/domains/translations/components/options-dialog/index.js +0 -87
- package/src/javascripts/ui/components/chat-status/index.js +0 -38
- package/src/javascripts/ui/components/conversation/event/event.js +0 -36
- package/src/javascripts/ui/components/core/seamly-api-context.js +0 -5
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +0 -279
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
import {
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'preact/hooks'
|
|
2
|
+
import { newMessageScreenReaderWait } from 'config'
|
|
3
3
|
import {
|
|
4
4
|
useEvents,
|
|
5
5
|
useLiveRegion,
|
|
6
6
|
useSeamlyIsHistoryLoaded,
|
|
7
7
|
} from 'ui/hooks/seamly-hooks'
|
|
8
|
-
import { newMessageScreenReaderWait } from 'config'
|
|
9
8
|
import { debounce } from 'ui/utils/general-utils'
|
|
9
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
10
10
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
11
11
|
|
|
12
12
|
const SeamlyNewNotifications = () => {
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
import { useEffect, useMemo, useRef } from 'preact/hooks'
|
|
2
2
|
import { unreadScreenReaderWait } from 'config'
|
|
3
|
+
import { useLiveRegion, useSeamlyUnreadCount } from 'ui/hooks/seamly-hooks'
|
|
4
|
+
import { debounce } from 'ui/utils/general-utils'
|
|
3
5
|
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
-
import { isUnreadMessage, setEventsRead } from 'domains/store/slice'
|
|
5
6
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
6
|
-
import {
|
|
7
|
-
useEvents,
|
|
8
|
-
useLiveRegion,
|
|
9
|
-
useSeamlyCommands,
|
|
10
|
-
useSeamlyUnreadCount,
|
|
11
|
-
} from 'ui/hooks/seamly-hooks'
|
|
12
|
-
import { debounce } from 'ui/utils/general-utils'
|
|
13
|
-
import { actionTypes, readStates } from 'ui/utils/seamly-utils'
|
|
14
|
-
import { useDispatch } from 'react-redux'
|
|
15
7
|
|
|
16
8
|
const SeamlyReadState = () => {
|
|
17
9
|
const { t } = useI18n()
|
|
18
|
-
const events = useEvents()
|
|
19
|
-
const dispatch = useDispatch()
|
|
20
10
|
const { isOpen, isVisible } = useVisibility()
|
|
21
|
-
const { sendAction } = useSeamlyCommands()
|
|
22
11
|
const unreadCount = useSeamlyUnreadCount()
|
|
23
12
|
const { sendPolite } = useLiveRegion()
|
|
24
13
|
const sendLive = useMemo(
|
|
@@ -29,26 +18,6 @@ const SeamlyReadState = () => {
|
|
|
29
18
|
const prevIsVisible = useRef(null)
|
|
30
19
|
const cancelSend = useRef(null)
|
|
31
20
|
|
|
32
|
-
useEffect(() => {
|
|
33
|
-
if (!isOpen) {
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const unread = events
|
|
38
|
-
.filter((event) => {
|
|
39
|
-
return (
|
|
40
|
-
isUnreadMessage(event) &&
|
|
41
|
-
event.payload.messageStatus === readStates.received
|
|
42
|
-
)
|
|
43
|
-
})
|
|
44
|
-
.map((event) => event.payload.id)
|
|
45
|
-
|
|
46
|
-
if (unread.length > 0) {
|
|
47
|
-
dispatch(setEventsRead(unread))
|
|
48
|
-
sendAction({ type: actionTypes.read, events: unread })
|
|
49
|
-
}
|
|
50
|
-
}, [events, dispatch, isOpen, sendAction])
|
|
51
|
-
|
|
52
21
|
useEffect(() => {
|
|
53
22
|
if (
|
|
54
23
|
prevIsVisible.current !== isVisible &&
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import { className } from 'lib/css'
|
|
4
2
|
import {
|
|
5
|
-
useSkiplinkTargetFocusing,
|
|
6
3
|
useFocusIfSeamlyContainedFocus,
|
|
4
|
+
useGeneratedId,
|
|
7
5
|
useSeamlyCurrentAgent,
|
|
8
6
|
useSeamlyHeaderData,
|
|
9
|
-
useGeneratedId,
|
|
10
7
|
useSeamlyStateContext,
|
|
8
|
+
useSkiplinkTargetFocusing,
|
|
11
9
|
} from 'ui/hooks/seamly-hooks'
|
|
10
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
12
11
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
13
12
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
13
|
+
import { className } from 'lib/css'
|
|
14
14
|
|
|
15
15
|
// Deprecated Toggle Button, should be removed once it is removed from clients
|
|
16
16
|
const DeprecatedToggleButton = ({ onOpenChat }) => {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { useEffect, useRef, useState
|
|
2
|
-
import
|
|
1
|
+
import { useCallback, useEffect, useRef, useState } from 'preact/hooks'
|
|
2
|
+
import IdleDetachWarning from 'ui/components/warnings/idle-detach-warning'
|
|
3
|
+
import ResumeConversationPrompt from 'ui/components/warnings/resume-conversation-prompt'
|
|
4
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
3
5
|
import {
|
|
6
|
+
useFileUploadMeta,
|
|
4
7
|
useSeamlyIdleDetachCountdown,
|
|
5
8
|
useSeamlyResumeConversationPrompt,
|
|
6
9
|
useSkiplinkTargetFocusing,
|
|
7
|
-
useFileUploadMeta,
|
|
8
10
|
} from 'ui/hooks/seamly-hooks'
|
|
9
|
-
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
10
11
|
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
11
|
-
import
|
|
12
|
-
import ResumeConversationPrompt from 'ui/components/warnings/resume-conversation-prompt'
|
|
12
|
+
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
13
13
|
import { useConfig } from 'domains/config/hooks'
|
|
14
14
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
15
|
-
import {
|
|
15
|
+
import { className } from 'lib/css'
|
|
16
16
|
import TextEntry from './text-entry'
|
|
17
|
-
import UploadToggle from './upload-toggle'
|
|
18
17
|
import Upload from './upload'
|
|
18
|
+
import UploadToggle from './upload-toggle'
|
|
19
19
|
|
|
20
20
|
const EntryContainer = () => {
|
|
21
21
|
const { isOpen } = useVisibility()
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { maxCharacterSrDebounceDelay, maxCharacterWarningLimit } from 'config'
|
|
2
|
-
import { useFormControl } from 'domains/forms/hooks'
|
|
3
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
4
1
|
import { useEffect, useMemo } from 'preact/hooks'
|
|
2
|
+
import { maxCharacterSrDebounceDelay, maxCharacterWarningLimit } from 'config'
|
|
5
3
|
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
6
4
|
import { useEntryTextLimit } from 'ui/hooks/seamly-state-hooks'
|
|
7
5
|
import { debounce } from 'ui/utils/general-utils'
|
|
6
|
+
import { useFormControl } from 'domains/forms/hooks'
|
|
7
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
8
8
|
|
|
9
9
|
export function useCharacterLimit(controlName) {
|
|
10
10
|
const { t } = useI18n()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import FormProvider from 'domains/forms/provider'
|
|
2
|
-
import { visibilityStates } from 'domains/visibility/constants'
|
|
3
|
-
import { useVisibility } from 'domains/visibility/hooks'
|
|
4
1
|
import { useCallback } from 'preact/hooks'
|
|
5
2
|
import {
|
|
6
3
|
useSeamlyCommands,
|
|
7
4
|
useSkiplink,
|
|
8
5
|
useSkiplinkTargetFocusing,
|
|
9
6
|
} from 'ui/hooks/seamly-hooks'
|
|
7
|
+
import FormProvider from 'domains/forms/provider'
|
|
8
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
9
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
10
10
|
import TextEntryForm from './text-entry-form'
|
|
11
11
|
|
|
12
12
|
const controlName = 'textMessageEntry'
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { useFormControl } from 'domains/forms/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import { className } from 'lib/css'
|
|
4
1
|
import { useCallback, useLayoutEffect, useMemo } from 'preact/hooks'
|
|
5
2
|
import Form from 'ui/components/form-controls/form'
|
|
6
3
|
import Input from 'ui/components/form-controls/input'
|
|
7
4
|
import Icon from 'ui/components/layout/icon'
|
|
8
|
-
import { useLiveRegion, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
9
5
|
import { useSeamlyEntry, useSeamlyTyping } from 'ui/hooks/seamly-entry-hooks'
|
|
6
|
+
import { useLiveRegion, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
7
|
+
import { useFormControl } from 'domains/forms/hooks'
|
|
8
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
9
|
+
import { className } from 'lib/css'
|
|
10
10
|
import { useCharacterLimit } from './hooks'
|
|
11
11
|
|
|
12
12
|
export default function TextEntryForm({ controlName, skipLinkId }) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
|
-
import Form from 'ui/components/form-controls/form'
|
|
3
1
|
import FileInput from 'ui/components/form-controls/file-input'
|
|
4
|
-
import
|
|
2
|
+
import Form from 'ui/components/form-controls/form'
|
|
5
3
|
import { useFormControl } from 'domains/forms/hooks'
|
|
4
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
5
|
+
import { className } from 'lib/css'
|
|
6
6
|
|
|
7
7
|
export default function FileInputForm({
|
|
8
8
|
skiplinkId,
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import FormProvider from 'domains/forms/provider'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import { className } from 'lib/css'
|
|
4
1
|
import { useCallback, useEffect, useMemo, useRef } from 'preact/hooks'
|
|
5
2
|
import UploadProgress from 'ui/components/widgets/upload-progress'
|
|
3
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
6
4
|
import {
|
|
7
5
|
useFileUploadMeta,
|
|
8
6
|
useFileUploads,
|
|
@@ -11,7 +9,6 @@ import {
|
|
|
11
9
|
useSkiplink,
|
|
12
10
|
useSkiplinkTargetFocusing,
|
|
13
11
|
} from 'ui/hooks/seamly-hooks'
|
|
14
|
-
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
15
12
|
import useSingleFileUpload from 'ui/hooks/use-single-file-upload'
|
|
16
13
|
import { getValidator } from 'ui/utils/form-utils'
|
|
17
14
|
import { formatBytes } from 'ui/utils/general-utils'
|
|
@@ -19,6 +16,9 @@ import {
|
|
|
19
16
|
fileListObjectIsNotEmpty,
|
|
20
17
|
validateFileSize,
|
|
21
18
|
} from 'ui/utils/validations'
|
|
19
|
+
import FormProvider from 'domains/forms/provider'
|
|
20
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
21
|
+
import { className } from 'lib/css'
|
|
22
22
|
import FileInputForm from './file-upload-form'
|
|
23
23
|
|
|
24
24
|
const formName = 'fileListForm'
|
|
@@ -54,7 +54,7 @@ const Upload = () => {
|
|
|
54
54
|
useEffect(() => {
|
|
55
55
|
if (
|
|
56
56
|
prevContentHintText.current &&
|
|
57
|
-
containerRef.current
|
|
57
|
+
containerRef.current?.contains(document.activeElement) &&
|
|
58
58
|
document.activeElement.tagName === 'INPUT'
|
|
59
59
|
) {
|
|
60
60
|
sendAssertive(contentHintText)
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { className } from 'lib/css'
|
|
1
|
+
import { useEffect, useRef, useState } from 'preact/hooks'
|
|
3
2
|
import Icon from 'ui/components/layout/icon'
|
|
4
3
|
import InOutTransition, {
|
|
5
4
|
transitionStartStates,
|
|
6
5
|
} from 'ui/components/widgets/in-out-transition'
|
|
6
|
+
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
7
7
|
import {
|
|
8
8
|
useFileUploadMeta,
|
|
9
|
-
useSkiplinkTargetFocusing,
|
|
10
9
|
useLiveRegion,
|
|
11
10
|
useSeamlyCurrentAgent,
|
|
11
|
+
useSkiplinkTargetFocusing,
|
|
12
12
|
} from 'ui/hooks/seamly-hooks'
|
|
13
|
-
import { useSeamlyEntry } from 'ui/hooks/seamly-entry-hooks'
|
|
14
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
15
|
-
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
16
13
|
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
14
|
+
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
15
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
16
|
+
import { className } from 'lib/css'
|
|
17
17
|
|
|
18
18
|
const UploadToggle = () => {
|
|
19
19
|
const { t } = useI18n()
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { useEffect,
|
|
2
|
-
import { className } from 'lib/css'
|
|
1
|
+
import { useEffect, useMemo, useRef } from 'preact/hooks'
|
|
3
2
|
import Icon from 'ui/components/layout/icon'
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import InOutTransition, {
|
|
4
|
+
transitionStartStates,
|
|
5
|
+
} from 'ui/components/widgets/in-out-transition'
|
|
6
|
+
import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
7
|
+
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
7
8
|
import {
|
|
8
|
-
useSeamlyServiceData,
|
|
9
9
|
useSeamlyLayoutMode,
|
|
10
|
+
useSeamlyServiceData,
|
|
10
11
|
} from 'ui/hooks/seamly-state-hooks'
|
|
11
|
-
import
|
|
12
|
-
import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
13
|
-
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
12
|
+
import useSeamlyCommands from 'ui/hooks/use-seamly-commands'
|
|
14
13
|
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
15
14
|
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
15
|
+
import { useGeneratedId } from 'ui/hooks/utility-hooks'
|
|
16
|
+
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
17
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
18
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
16
19
|
import { useI18n } from 'domains/i18n/hooks'
|
|
17
|
-
import InOutTransition, {
|
|
18
|
-
transitionStartStates,
|
|
19
|
-
} from 'ui/components/widgets/in-out-transition'
|
|
20
|
-
import { useTranslatedEventData } from 'domains/translations/hooks'
|
|
21
20
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
22
|
-
import {
|
|
21
|
+
import { useTranslatedEventData } from 'domains/translations/hooks'
|
|
22
|
+
import { className } from 'lib/css'
|
|
23
23
|
|
|
24
24
|
const Faq = () => {
|
|
25
25
|
const { t } = useI18n()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { className } from 'lib/css'
|
|
1
|
+
import { useEffect, useState } from 'preact/hooks'
|
|
3
2
|
import Icon from 'ui/components/layout/icon'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
4
|
|
|
5
5
|
export default function Error({ id, error }) {
|
|
6
6
|
const [isAvailable, setIsAvailable] = useState(false)
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback, useState } from 'preact/hooks'
|
|
2
|
-
import { className } from 'lib/css'
|
|
3
|
-
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
4
|
-
import { useFormControl, useFormContext } from 'domains/forms/hooks'
|
|
5
2
|
import Icon from 'ui/components/layout/icon'
|
|
3
|
+
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
4
|
+
import { useFormContext, useFormControl } from 'domains/forms/hooks'
|
|
5
|
+
import { className } from 'lib/css'
|
|
6
6
|
import Error from './error'
|
|
7
7
|
|
|
8
8
|
export default function FileInput({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
+
useSeamlyCurrentAgent,
|
|
2
3
|
useSeamlyHeaderData,
|
|
3
4
|
useSeamlyUnreadCount,
|
|
4
|
-
useSeamlyCurrentAgent,
|
|
5
5
|
} from 'ui/hooks/seamly-hooks'
|
|
6
|
-
import {
|
|
6
|
+
import { useStartChatIcon } from 'domains/config/hooks'
|
|
7
7
|
import { useI18n } from 'domains/i18n/hooks'
|
|
8
8
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
9
|
-
import { useStartChatIcon } from 'domains/config/hooks'
|
|
10
9
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
10
|
+
import { className } from 'lib/css'
|
|
11
11
|
import Icon from './icon'
|
|
12
12
|
|
|
13
13
|
const AgentInfo = () => {
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
1
|
import AppOptions from 'ui/components/app-options'
|
|
2
|
+
import ChatScrollProvider from 'ui/components/conversation/event/chat-scroll/chat-scroll-provider'
|
|
3
|
+
import EntryContainer from 'ui/components/entry/entry-container'
|
|
4
|
+
import CollapseButton from 'ui/components/view/window-view/collapse-button'
|
|
5
|
+
import { useSeamlyLayoutMode } from 'ui/hooks/seamly-state-hooks'
|
|
3
6
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
7
|
+
import TranslationStatus from 'domains/translations/components/translation-status'
|
|
4
8
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
5
|
-
import
|
|
9
|
+
import { className } from 'lib/css'
|
|
6
10
|
|
|
7
11
|
function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
8
12
|
const { hasInterrupt, meta } = useInterrupt()
|
|
9
|
-
const { isOpen } = useVisibility()
|
|
13
|
+
const { isOpen, closeChat } = useVisibility()
|
|
14
|
+
const { isWindow } = useSeamlyLayoutMode()
|
|
10
15
|
|
|
11
|
-
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
return <InterruptComponent {...meta} />
|
|
15
|
-
}
|
|
16
|
-
return null
|
|
16
|
+
if (hasInterrupt) {
|
|
17
|
+
if (isOpen) {
|
|
18
|
+
return <InterruptComponent {...meta} />
|
|
17
19
|
}
|
|
18
|
-
return
|
|
20
|
+
return null
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
return (
|
|
22
24
|
<>
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
+
<ChatScrollProvider>
|
|
26
|
+
<div className={className('chat__container__header')}>
|
|
27
|
+
<TranslationStatus />
|
|
28
|
+
{isOpen && isWindow && <CollapseButton onClick={closeChat} />}
|
|
29
|
+
</div>
|
|
30
|
+
{children}
|
|
31
|
+
</ChatScrollProvider>
|
|
32
|
+
<EntryContainer />
|
|
25
33
|
{isOpen && <AppOptions />}
|
|
26
34
|
</>
|
|
27
35
|
)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
+
import { forwardRef } from 'preact/compat'
|
|
2
|
+
import Suggestions from 'ui/components/suggestions'
|
|
3
|
+
import { useSeamlyAppContainerClassNames } from 'ui/hooks/component-helper-hooks'
|
|
4
|
+
import { useSeamlyLayoutMode } from 'ui/hooks/seamly-state-hooks'
|
|
1
5
|
import { useUserHasResponded } from 'domains/app/hooks'
|
|
2
6
|
import { useConfig } from 'domains/config/hooks'
|
|
3
7
|
import { useI18n } from 'domains/i18n/hooks'
|
|
8
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
4
9
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
5
|
-
import { forwardRef } from 'preact/compat'
|
|
6
10
|
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'
|
|
11
11
|
|
|
12
12
|
const Chat = forwardRef(
|
|
13
13
|
({ children, className: givenClassName = '' }, forwardedRef) => {
|
|
@@ -1,9 +1,3 @@
|
|
|
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'
|
|
6
|
-
import { className } from 'lib/css'
|
|
7
1
|
import { useCallback, useMemo } from 'preact/hooks'
|
|
8
2
|
import Faq from 'ui/components/faq/faq'
|
|
9
3
|
import {
|
|
@@ -11,6 +5,12 @@ import {
|
|
|
11
5
|
useSeamlyContainerElement,
|
|
12
6
|
useSeamlyLayoutMode,
|
|
13
7
|
} from 'ui/hooks/seamly-hooks'
|
|
8
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
9
|
+
import { useConfig } from 'domains/config/hooks'
|
|
10
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
11
|
+
import { visibilityStates } from 'domains/visibility/constants'
|
|
12
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
13
|
+
import { className } from 'lib/css'
|
|
14
14
|
|
|
15
15
|
const DeprecatedAppFrame = ({ children }) => {
|
|
16
16
|
const [, setSeamlyContainerElement] = useSeamlyContainerElement()
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import AppOptions from 'ui/components/app-options'
|
|
2
|
+
import ChatScrollProvider from 'ui/components/conversation/event/chat-scroll/chat-scroll-provider'
|
|
3
|
+
import EntryContainer from 'ui/components/entry/entry-container'
|
|
4
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
5
|
+
import TranslationStatus from 'domains/translations/components/translation-status'
|
|
6
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
7
|
+
import { className } from 'lib/css'
|
|
8
|
+
|
|
9
|
+
function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
10
|
+
const { hasInterrupt, meta } = useInterrupt()
|
|
11
|
+
const { isOpen } = useVisibility()
|
|
12
|
+
|
|
13
|
+
if (hasInterrupt) {
|
|
14
|
+
if (isOpen) {
|
|
15
|
+
return <InterruptComponent {...meta} />
|
|
16
|
+
}
|
|
17
|
+
return null
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<>
|
|
22
|
+
<ChatScrollProvider>
|
|
23
|
+
<div className={className('chat__container__header')}>
|
|
24
|
+
<TranslationStatus />
|
|
25
|
+
</div>
|
|
26
|
+
{children}
|
|
27
|
+
</ChatScrollProvider>
|
|
28
|
+
<EntryContainer />
|
|
29
|
+
{isOpen && <AppOptions />}
|
|
30
|
+
</>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default ChatFrame
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useRef } from 'preact/hooks'
|
|
2
|
-
import { className } from 'lib/css'
|
|
3
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
4
2
|
import { useSeamlyStateContext } from 'ui/hooks/seamly-hooks'
|
|
3
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
5
|
import Icon from './icon'
|
|
6
6
|
|
|
7
7
|
const Header = ({ children, onCloseChat }) => {
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { className as classNameFn } from 'lib/css'
|
|
2
|
-
|
|
3
1
|
/* eslint-disable import/no-webpack-loader-syntax */
|
|
4
2
|
// The eslint rules are disabled for this as otherwsise we'd need to include the loader rule in all implementations
|
|
5
3
|
// this can again be changed when we can import pre-built packages in implementations
|
|
6
|
-
|
|
7
4
|
import iconAvatar32 from '!!raw-loader!../../../../icons/avatar_bot-32.svg'
|
|
5
|
+
import iconArrowLeft16 from '!!raw-loader!../../../../icons/icon_arrow_left-16.svg'
|
|
6
|
+
import iconArrowRight16 from '!!raw-loader!../../../../icons/icon_arrow_right-16.svg'
|
|
8
7
|
import iconBalloon32 from '!!raw-loader!../../../../icons/icon_balloon-32.svg'
|
|
9
|
-
import
|
|
8
|
+
import iconCheck16 from '!!raw-loader!../../../../icons/icon_check-16.svg'
|
|
9
|
+
import iconCheck32 from '!!raw-loader!../../../../icons/icon_check-32.svg'
|
|
10
10
|
import iconChevronDown8 from '!!raw-loader!../../../../icons/icon_chevron_down-8.svg'
|
|
11
|
-
import
|
|
11
|
+
import iconChevronDown32 from '!!raw-loader!../../../../icons/icon_chevron_down-32.svg'
|
|
12
12
|
import iconChevronRight8 from '!!raw-loader!../../../../icons/icon_chevron_right-8.svg'
|
|
13
|
-
import
|
|
13
|
+
import iconChevronRight16 from '!!raw-loader!../../../../icons/icon_chevron_right-16.svg'
|
|
14
14
|
import iconClose8 from '!!raw-loader!../../../../icons/icon_close-8.svg'
|
|
15
|
+
import iconClose16 from '!!raw-loader!../../../../icons/icon_close-16.svg'
|
|
15
16
|
import iconDownload16 from '!!raw-loader!../../../../icons/icon_download-16.svg'
|
|
16
17
|
import iconEnlarge32 from '!!raw-loader!../../../../icons/icon_enlarge-32.svg'
|
|
17
18
|
import iconError16 from '!!raw-loader!../../../../icons/icon_error-16.svg'
|
|
18
|
-
import iconArrowLeft16 from '!!raw-loader!../../../../icons/icon_arrow_left-16.svg'
|
|
19
|
-
import iconArrowRight16 from '!!raw-loader!../../../../icons/icon_arrow_right-16.svg'
|
|
20
19
|
import iconFile32 from '!!raw-loader!../../../../icons/icon_file-32.svg'
|
|
21
20
|
import iconNewTopic32 from '!!raw-loader!../../../../icons/icon_newtopic-32.svg'
|
|
22
21
|
import iconNewTranslation16 from '!!raw-loader!../../../../icons/icon_newtranslation-16.svg'
|
|
@@ -24,6 +23,7 @@ import iconNewTranslation32 from '!!raw-loader!../../../../icons/icon_newtransla
|
|
|
24
23
|
import iconOptions32 from '!!raw-loader!../../../../icons/icon_options-32.svg'
|
|
25
24
|
import iconSend32 from '!!raw-loader!../../../../icons/icon_send-32.svg'
|
|
26
25
|
import iconUpload32 from '!!raw-loader!../../../../icons/icon_upload-32.svg'
|
|
26
|
+
import { className as classNameFn } from 'lib/css'
|
|
27
27
|
|
|
28
28
|
/* eslint-enable import/no-webpack-loader-syntax */
|
|
29
29
|
|
|
@@ -48,9 +48,11 @@ const ICONS = {
|
|
|
48
48
|
error16: iconError16,
|
|
49
49
|
arrowLeft16: iconArrowLeft16,
|
|
50
50
|
arrowRight16: iconArrowRight16,
|
|
51
|
+
check32: iconCheck32,
|
|
52
|
+
check16: iconCheck16,
|
|
51
53
|
}
|
|
52
54
|
|
|
53
|
-
const Icon = ({ name, size = '32', className, alt }) => {
|
|
55
|
+
const Icon = ({ name, size = '32', className = undefined, alt }) => {
|
|
54
56
|
const iconName = `${name}${size}`
|
|
55
57
|
|
|
56
58
|
return (
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useEffect } from 'preact/hooks'
|
|
2
|
-
import { className } from 'lib/css'
|
|
3
2
|
import {
|
|
4
|
-
useSeamlyCommands,
|
|
5
|
-
useLiveRegion,
|
|
6
3
|
useGeneratedId,
|
|
4
|
+
useLiveRegion,
|
|
5
|
+
useSeamlyCommands,
|
|
7
6
|
useSkiplinkTargetFocusing,
|
|
8
7
|
} from 'ui/hooks/seamly-hooks'
|
|
8
|
+
import { className } from 'lib/css'
|
|
9
9
|
|
|
10
10
|
const Interrupt = ({
|
|
11
11
|
originalError,
|
|
@@ -22,7 +22,7 @@ const Interrupt = ({
|
|
|
22
22
|
const isExpiredError = originalError.name === 'SeamlySessionExpiredError'
|
|
23
23
|
|
|
24
24
|
useEffect(() => {
|
|
25
|
-
if (isExpiredError) {
|
|
25
|
+
if (isExpiredError && seamlyCommands[action]) {
|
|
26
26
|
seamlyCommands[action]()
|
|
27
27
|
}
|
|
28
28
|
}, [action, seamlyCommands, isExpiredError])
|
|
@@ -38,7 +38,9 @@ const Interrupt = ({
|
|
|
38
38
|
}, [sendPolite, srText, isExpiredError])
|
|
39
39
|
|
|
40
40
|
const onClickHandler = () => {
|
|
41
|
-
seamlyCommands[action]
|
|
41
|
+
if (seamlyCommands[action]) {
|
|
42
|
+
seamlyCommands[action]()
|
|
43
|
+
}
|
|
42
44
|
focusSkiplinkTarget()
|
|
43
45
|
}
|
|
44
46
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import useEventComponentMapping from 'ui/hooks/use-event-component-mapping'
|
|
1
2
|
import { useConfig } from 'domains/config/hooks'
|
|
2
3
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
3
4
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
4
5
|
import { className } from 'lib/css'
|
|
5
|
-
import useEventComponentMapping from 'ui/hooks/use-event-component-mapping'
|
|
6
6
|
|
|
7
7
|
export function PreChatMessageEvent({ event }) {
|
|
8
8
|
const [Component] = useEventComponentMapping(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
1
|
import { useConfig } from 'domains/config/hooks'
|
|
2
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
4
|
|
|
5
5
|
const PrivacyDisclaimer = () => {
|
|
6
6
|
const { t } = useI18n()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRef } from 'preact'
|
|
2
|
-
import {
|
|
3
|
-
import { className } from 'lib/css'
|
|
4
|
-
import { useSeamlyOptions, useOptionButton } from 'ui/hooks/seamly-hooks'
|
|
5
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'preact/hooks'
|
|
6
3
|
import Icon from 'ui/components/layout/icon'
|
|
7
4
|
import InOutTransition, {
|
|
8
5
|
transitionStartStates,
|
|
9
6
|
} from 'ui/components/widgets/in-out-transition'
|
|
10
|
-
import { getKey, keyNames, focusElement } from 'ui/utils/general-utils'
|
|
11
7
|
import { timeout } from 'ui/hooks/focus-helper-hooks'
|
|
8
|
+
import { useOptionButton, useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import { focusElement, getKey, keyNames } from 'ui/utils/general-utils'
|
|
10
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
11
|
+
import { className } from 'lib/css'
|
|
12
12
|
import Options from './options'
|
|
13
13
|
|
|
14
14
|
const OptionsButton = () => {
|