@seamly/web-ui 20.8.1 → 21.0.1-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/components.js +14855 -20
- package/build/dist/lib/components.min.js +2 -1
- package/build/dist/lib/components.min.js.LICENSE.txt +48 -0
- package/build/dist/lib/config.js +9 -3
- package/build/dist/lib/config.min.js +1 -1
- package/build/dist/lib/contexts.js +14 -5
- package/build/dist/lib/contexts.min.js +1 -1
- package/build/dist/lib/deprecated-view.js +1 -1
- package/build/dist/lib/hooks.js +8446 -20
- package/build/dist/lib/hooks.min.js +2 -1
- package/build/dist/lib/hooks.min.js.LICENSE.txt +38 -0
- 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 +20279 -26454
- 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 +27823 -34681
- 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 +23181 -7921
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.LICENSE.txt +10 -0
- package/build/dist/lib/styles-default-implementation.js +1 -1
- package/build/dist/lib/styles.js +1 -1
- package/build/dist/lib/utils.js +22149 -17
- package/build/dist/lib/utils.min.js +2 -1
- package/build/dist/lib/utils.min.js.LICENSE.txt +48 -0
- 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 +42 -0
- package/src/javascripts/domains/translations/components/options-dialog/translation-options.tsx +81 -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 +18 -22
- package/src/javascripts/lib/engine/{index.js → index.tsx} +25 -7
- package/src/javascripts/lib/url-helpers.ts +112 -0
- package/src/javascripts/package/components.js +15 -1
- package/src/javascripts/package/config.js +1 -1
- package/src/javascripts/package/contexts.js +5 -3
- package/src/javascripts/package/hooks.js +19 -1
- package/src/javascripts/package/utils.js +13 -3
- 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 +14 -9
- package/src/javascripts/style-guide/components/view.js +2 -2
- package/src/javascripts/style-guide/states.js +132 -36
- package/src/javascripts/style-guide/style-guide-engine.js +2 -1
- package/src/javascripts/style-guide/style-guide-external-api.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 +30 -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 +14 -24
- 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 +24 -9
- 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 -6
- package/src/stylesheets/5-components/_translation-options.scss +51 -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 -4
- package/src/stylesheets/7-deprecated/5-components/_translation-options.scss +49 -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
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import ChatStatus from 'ui/components/chat-status'
|
|
2
|
+
import ChatStatusAction from 'ui/components/chat-status/chat-status-action'
|
|
3
|
+
import {
|
|
4
|
+
useTranslationProposal,
|
|
5
|
+
useTranslationsContainer,
|
|
6
|
+
} from 'domains/translations/hooks'
|
|
7
|
+
|
|
8
|
+
export default function TranslationProposal() {
|
|
9
|
+
const {
|
|
10
|
+
showProposal,
|
|
11
|
+
translationProposal,
|
|
12
|
+
dismissTranslationProposal,
|
|
13
|
+
activateTranslationProposal,
|
|
14
|
+
} = useTranslationProposal()
|
|
15
|
+
|
|
16
|
+
const { id } = useTranslationsContainer()
|
|
17
|
+
|
|
18
|
+
if (!showProposal) {
|
|
19
|
+
return null
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<ChatStatus
|
|
24
|
+
handleClose={dismissTranslationProposal}
|
|
25
|
+
srCloseButtonText={translationProposal.srDismissButtonText}
|
|
26
|
+
id={id}
|
|
27
|
+
title={translationProposal.titleLabel}
|
|
28
|
+
>
|
|
29
|
+
<ChatStatusAction
|
|
30
|
+
handleClick={activateTranslationProposal}
|
|
31
|
+
icon="newTranslation"
|
|
32
|
+
title={translationProposal.buttonLabel}
|
|
33
|
+
/>
|
|
34
|
+
</ChatStatus>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import Chat from '../layout/chat'
|
|
2
|
-
import Interrupt from '../layout/interrupt'
|
|
3
1
|
import Conversation from '../conversation/conversation'
|
|
4
|
-
import
|
|
2
|
+
import Chat from '../layout/chat'
|
|
5
3
|
import ChatFrame from '../layout/chat-frame'
|
|
6
|
-
import
|
|
4
|
+
import Interrupt from '../layout/interrupt'
|
|
7
5
|
|
|
8
6
|
const AppView = () => {
|
|
9
|
-
useSeamlyChat()
|
|
10
|
-
|
|
11
7
|
return (
|
|
12
8
|
<Chat>
|
|
13
9
|
<ChatFrame interruptComponent={Interrupt}>
|
|
14
10
|
<Conversation />
|
|
15
|
-
<EntryContainer />
|
|
16
11
|
</ChatFrame>
|
|
17
12
|
</Chat>
|
|
18
13
|
)
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import ChatFrame from 'ui/components/layout/deprecated-chat-frame'
|
|
2
|
+
import { useShowInlineView, useVisibility } from 'domains/visibility/hooks'
|
|
3
|
+
import { useSeamlyChat } from '../../hooks/seamly-hooks'
|
|
4
|
+
import Conversation from '../conversation/conversation'
|
|
5
|
+
import DeprecatedToggleButton from '../entry/deprecated-toggle-button'
|
|
4
6
|
import AgentInfo from '../layout/agent-info'
|
|
7
|
+
import DeprecatedAppFrame from '../layout/deprecated-app-frame'
|
|
5
8
|
import Header from '../layout/header'
|
|
6
|
-
import Conversation from '../conversation/conversation'
|
|
7
|
-
import EntryContainer from '../entry/entry-container'
|
|
8
9
|
import Interrupt from '../layout/interrupt'
|
|
9
|
-
import { useSeamlyChat } from '../../hooks/seamly-hooks'
|
|
10
|
-
import DeprecatedToggleButton from '../entry/deprecated-toggle-button'
|
|
11
10
|
|
|
12
11
|
const ShowInlineView = ({ children }) => {
|
|
13
12
|
const { showInlineView, containerRef } = useShowInlineView()
|
|
@@ -16,8 +15,8 @@ const ShowInlineView = ({ children }) => {
|
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
const DeprecatedView = () => {
|
|
19
|
-
|
|
20
|
-
const { openChat, closeChat } =
|
|
18
|
+
useSeamlyChat()
|
|
19
|
+
const { isVisible, openChat, closeChat } = useVisibility()
|
|
21
20
|
|
|
22
21
|
return (
|
|
23
22
|
isVisible && (
|
|
@@ -29,7 +28,6 @@ const DeprecatedView = () => {
|
|
|
29
28
|
</Header>
|
|
30
29
|
<ChatFrame interruptComponent={Interrupt}>
|
|
31
30
|
<Conversation />
|
|
32
|
-
<EntryContainer />
|
|
33
31
|
</ChatFrame>
|
|
34
32
|
</DeprecatedAppFrame>
|
|
35
33
|
</ShowInlineView>
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useUserHasResponded } from 'domains/app/hooks'
|
|
2
1
|
import { useCallback, useMemo } from 'preact/hooks'
|
|
3
|
-
import { useVisibility } from 'domains/visibility/hooks'
|
|
4
|
-
import { useSeamlyContainerElement } from 'ui/hooks/focus-helper-hooks'
|
|
5
|
-
import { useConfig } from 'domains/config/hooks'
|
|
6
|
-
import { useSeamlyAppContainerClassNames } from 'ui/hooks/component-helper-hooks'
|
|
7
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
8
2
|
import AppView from 'ui/components/view/app-view'
|
|
9
3
|
import InlineView from 'ui/components/view/inline-view'
|
|
10
4
|
import WindowView from 'ui/components/view/window-view'
|
|
5
|
+
import { useSeamlyAppContainerClassNames } from 'ui/hooks/component-helper-hooks'
|
|
6
|
+
import { useSeamlyContainerElement } from 'ui/hooks/focus-helper-hooks'
|
|
7
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
8
|
+
import { useConfig } from 'domains/config/hooks'
|
|
9
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
10
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
11
11
|
import { className } from 'lib/css'
|
|
12
12
|
|
|
13
13
|
const ViewComponentsMap = {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
|
-
import { useVisibility, useShowInlineView } from 'domains/visibility/hooks'
|
|
3
1
|
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { useShowInlineView, useVisibility } from 'domains/visibility/hooks'
|
|
3
|
+
import { className } from 'lib/css'
|
|
6
4
|
import Conversation from '../conversation/conversation'
|
|
7
|
-
import
|
|
5
|
+
import Chat from '../layout/chat'
|
|
8
6
|
import ChatFrame from '../layout/chat-frame'
|
|
9
|
-
import
|
|
7
|
+
import Interrupt from '../layout/interrupt'
|
|
10
8
|
import PreChatMessages from '../layout/pre-chat-messages'
|
|
11
9
|
import Suggestions from '../suggestions'
|
|
12
10
|
import InOutTransition, {
|
|
@@ -14,7 +12,6 @@ import InOutTransition, {
|
|
|
14
12
|
} from '../widgets/in-out-transition'
|
|
15
13
|
|
|
16
14
|
const InlineView = () => {
|
|
17
|
-
useSeamlyChat()
|
|
18
15
|
const { showInlineView, containerRef } = useShowInlineView()
|
|
19
16
|
|
|
20
17
|
const { isOpen } = useVisibility()
|
|
@@ -49,7 +46,6 @@ const InlineView = () => {
|
|
|
49
46
|
{showInlineView && (
|
|
50
47
|
<ChatFrame interruptComponent={Interrupt}>
|
|
51
48
|
{isOpen && <Conversation />}
|
|
52
|
-
<EntryContainer />
|
|
53
49
|
</ChatFrame>
|
|
54
50
|
)}
|
|
55
51
|
</Chat>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { useCallback } from 'preact/hooks'
|
|
2
|
+
import Icon from 'ui/components/layout/icon'
|
|
1
3
|
import { useI18n } from 'domains/i18n/hooks'
|
|
2
4
|
import { className } from 'lib/css'
|
|
3
|
-
import Icon from 'ui/components/layout/icon'
|
|
4
|
-
import { useCallback } from 'preact/hooks'
|
|
5
5
|
|
|
6
6
|
const CollapseButton = ({ onClick }) => {
|
|
7
7
|
const { t } = useI18n()
|
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import { useUserHasResponded } from 'domains/app/hooks'
|
|
2
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
+
import Conversation from 'ui/components/conversation/conversation'
|
|
3
|
+
import Text from 'ui/components/conversation/event/text'
|
|
4
|
+
import Chat from 'ui/components/layout/chat'
|
|
5
|
+
import ChatFrame from 'ui/components/layout/chat-frame'
|
|
6
|
+
import Interrupt from 'ui/components/layout/interrupt'
|
|
7
|
+
import PreChatMessages from 'ui/components/layout/pre-chat-messages'
|
|
8
|
+
import InOutTransition, {
|
|
9
|
+
transitionStartStates,
|
|
10
|
+
} from 'ui/components/widgets/in-out-transition'
|
|
11
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
3
12
|
import { useI18n } from 'domains/i18n/hooks'
|
|
4
13
|
import { useVisibility } from 'domains/visibility/hooks'
|
|
5
14
|
import { className } from 'lib/css'
|
|
6
|
-
import { useSeamlyChat } from '../../../hooks/seamly-hooks'
|
|
7
|
-
import Conversation from '../../conversation/conversation'
|
|
8
|
-
import Text from '../../conversation/event/text'
|
|
9
|
-
import EntryContainer from '../../entry/entry-container'
|
|
10
|
-
import Chat from '../../layout/chat'
|
|
11
|
-
import ChatFrame from '../../layout/chat-frame'
|
|
12
|
-
import Interrupt from '../../layout/interrupt'
|
|
13
|
-
import PreChatMessages from '../../layout/pre-chat-messages'
|
|
14
|
-
import InOutTransition, {
|
|
15
|
-
transitionStartStates,
|
|
16
|
-
} from '../../widgets/in-out-transition'
|
|
17
|
-
import CollapseButton from './collapse-button'
|
|
18
15
|
import WindowOpenButton from './window-open-button'
|
|
19
16
|
|
|
20
17
|
const WindowView = () => {
|
|
21
|
-
const {
|
|
22
|
-
const { isOpen } = useVisibility()
|
|
18
|
+
const { isOpen, openChat } = useVisibility()
|
|
23
19
|
const userHasResponded = useUserHasResponded()
|
|
24
20
|
const { t } = useI18n()
|
|
25
21
|
const continueChatText = t('window.chat.continue')
|
|
@@ -68,10 +64,8 @@ const WindowView = () => {
|
|
|
68
64
|
transitionStartState={transitionStartStates.notRendered}
|
|
69
65
|
>
|
|
70
66
|
<Chat>
|
|
71
|
-
{isOpen && <CollapseButton onClick={closeChat} />}
|
|
72
67
|
<ChatFrame interruptComponent={Interrupt}>
|
|
73
68
|
<Conversation />
|
|
74
|
-
<EntryContainer />
|
|
75
69
|
</ChatFrame>
|
|
76
70
|
</Chat>
|
|
77
71
|
</InOutTransition>
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { useStartChatIcon } from 'domains/config/hooks'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
4
|
-
import { useVisibility } from 'domains/visibility/hooks'
|
|
5
|
-
import { className } from 'lib/css'
|
|
6
|
-
import Icon from 'ui/components/layout/icon'
|
|
7
1
|
import { useCallback } from 'preact/hooks'
|
|
2
|
+
import Icon from 'ui/components/layout/icon'
|
|
8
3
|
import InOutTransition, {
|
|
9
4
|
transitionStartStates,
|
|
10
5
|
} from 'ui/components/widgets/in-out-transition'
|
|
@@ -14,6 +9,11 @@ import {
|
|
|
14
9
|
useSeamlyCurrentAgent,
|
|
15
10
|
useSeamlyUnreadCount,
|
|
16
11
|
} from 'ui/hooks/seamly-state-hooks'
|
|
12
|
+
import { useStartChatIcon } from 'domains/config/hooks'
|
|
13
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
14
|
+
import { useInterrupt } from 'domains/interrupt/hooks'
|
|
15
|
+
import { useVisibility } from 'domains/visibility/hooks'
|
|
16
|
+
import { className } from 'lib/css'
|
|
17
17
|
|
|
18
18
|
const ButtonIcon = () => {
|
|
19
19
|
const startChatIcon = useStartChatIcon()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
4
1
|
import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
5
2
|
import useSeamlyActivityEventHandler from 'ui/hooks/use-seamly-activity-event-handler'
|
|
6
3
|
import useSeamlyCommands from 'ui/hooks/use-seamly-commands'
|
|
4
|
+
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
5
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
6
|
+
import { className } from 'lib/css'
|
|
7
7
|
import Prompt from './prompt'
|
|
8
8
|
|
|
9
9
|
const IdleDetachWarning = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { useGeneratedId, useSkiplink } from 'ui/hooks/seamly-hooks'
|
|
1
2
|
import { className } from 'lib/css'
|
|
2
|
-
import { useSkiplink, useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
3
3
|
|
|
4
4
|
const Prompt = ({ baseClassName, children, title }) => {
|
|
5
5
|
const skiplinkTargetId = useSkiplink()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { className } from 'lib/css'
|
|
2
|
-
import { useI18n } from 'domains/i18n/hooks'
|
|
3
|
-
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
4
|
-
import useSeamlyActivityEventHandler from 'ui/hooks/use-seamly-activity-event-handler'
|
|
5
1
|
import { useSeamlyCurrentAgent } from 'ui/hooks/seamly-state-hooks'
|
|
2
|
+
import useSeamlyActivityEventHandler from 'ui/hooks/use-seamly-activity-event-handler'
|
|
3
|
+
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
4
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
5
|
+
import { className } from 'lib/css'
|
|
6
6
|
import Prompt from './prompt'
|
|
7
7
|
|
|
8
8
|
const ResumeConversationPrompt = () => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useRef, useState
|
|
1
|
+
import { cloneElement, toChildArray } from 'preact'
|
|
2
|
+
import { useEffect, useRef, useState } from 'preact/hooks'
|
|
3
|
+
import { defaultTransitionTimeMs } from 'config'
|
|
3
4
|
import { useStableCallback } from 'ui/hooks/seamly-hooks'
|
|
4
5
|
import { className } from 'lib/css'
|
|
5
|
-
import { defaultTransitionTimeMs } from 'config'
|
|
6
6
|
|
|
7
7
|
const transitionClasses = {
|
|
8
8
|
visible: className('transition--visible'),
|
|
@@ -21,13 +21,13 @@ export const transitionStartStates = {
|
|
|
21
21
|
const InOutTransition = ({
|
|
22
22
|
children,
|
|
23
23
|
isActive,
|
|
24
|
-
timeout,
|
|
24
|
+
timeout = defaultTransitionTimeMs,
|
|
25
25
|
transitionStartState = transitionStartStates.notRendered,
|
|
26
|
-
onInTransitionComplete,
|
|
27
|
-
onOutTransitionComplete,
|
|
26
|
+
onInTransitionComplete = () => {},
|
|
27
|
+
onOutTransitionComplete = () => {},
|
|
28
28
|
}) => {
|
|
29
29
|
const prevIsActive = useRef(false)
|
|
30
|
-
const timeoutVal =
|
|
30
|
+
const timeoutVal = parseInt(timeout, 10)
|
|
31
31
|
|
|
32
32
|
const onInTransitionCompleteHandler = useStableCallback(
|
|
33
33
|
onInTransitionComplete,
|
|
@@ -98,17 +98,19 @@ const InOutTransition = ({
|
|
|
98
98
|
])
|
|
99
99
|
|
|
100
100
|
return (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
101
|
+
<>
|
|
102
|
+
{renderChildren &&
|
|
103
|
+
toChildArray(children).map((child) => {
|
|
104
|
+
const { className: childClassName = '' } = child.props
|
|
105
|
+
const cleanClasses = childClassName
|
|
106
|
+
.split(' ')
|
|
107
|
+
.filter((cl) => !transitionClassesArray.includes(cl))
|
|
108
|
+
|
|
109
|
+
return cloneElement(child, {
|
|
110
|
+
className: [...cleanClasses, ...activeTransitionClasses].join(' '),
|
|
111
|
+
})
|
|
112
|
+
})}
|
|
113
|
+
</>
|
|
112
114
|
)
|
|
113
115
|
}
|
|
114
116
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useRef } from 'preact/hooks'
|
|
2
|
-
import
|
|
2
|
+
import Icon from 'ui/components/layout/icon'
|
|
3
3
|
import {
|
|
4
4
|
useSeamlyActivityEventHandler,
|
|
5
5
|
useSeamlyAppContainerClassNames,
|
|
6
6
|
} from 'ui/hooks/seamly-hooks'
|
|
7
|
-
import { className } from 'lib/css'
|
|
8
|
-
import Icon from 'ui/components/layout/icon'
|
|
9
7
|
import { useConfig } from 'domains/config/hooks'
|
|
8
|
+
import { useI18n } from 'domains/i18n/hooks'
|
|
9
|
+
import { className } from 'lib/css'
|
|
10
10
|
import Modal from './modal'
|
|
11
11
|
|
|
12
12
|
const Lightbox = ({ url, description, onClose: onCloseHandler }) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { render, toChildArray } from 'preact'
|
|
2
|
+
import { useEffect, useLayoutEffect, useRef, useState } from 'preact/hooks'
|
|
2
3
|
import { createFocusTrap } from 'focus-trap'
|
|
3
|
-
import { useLayoutEffect, useEffect, useRef, useState } from 'preact/hooks'
|
|
4
|
-
import { createAriaHider } from 'ui/utils/general-utils'
|
|
5
4
|
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
5
|
+
import { createAriaHider } from 'ui/utils/general-utils'
|
|
6
6
|
|
|
7
7
|
const Modal = ({
|
|
8
8
|
children,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Error from 'ui/components/form-controls/error'
|
|
2
2
|
import { useFileUploads } from 'ui/hooks/seamly-hooks'
|
|
3
3
|
import { useI18n } from 'domains/i18n/hooks'
|
|
4
|
-
import
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
5
|
|
|
6
6
|
const UploadProgress = () => {
|
|
7
7
|
const { t } = useI18n()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { clearAllUploads } from 'domains/store/slice'
|
|
2
1
|
import { useCallback, useContext } from 'preact/hooks'
|
|
3
2
|
import { useDispatch } from 'react-redux'
|
|
4
3
|
import SeamlyFileUploadContext from 'ui/components/core/seamly-file-upload-context'
|
|
4
|
+
import { clearAllUploads } from 'domains/store/slice'
|
|
5
5
|
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
6
6
|
|
|
7
7
|
const useSeamlyFileUploadContext = () => useContext(SeamlyFileUploadContext)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { setSeamlyContainerElement } from 'domains/store/slice'
|
|
2
1
|
import { useCallback, useRef } from 'preact/hooks'
|
|
3
2
|
import { useDispatch } from 'react-redux'
|
|
4
3
|
import {
|
|
5
4
|
focusElement,
|
|
6
5
|
runIfElementContainsOrHasFocus,
|
|
7
6
|
} from 'ui/utils/general-utils'
|
|
7
|
+
import { setSeamlyContainerElement } from 'domains/store/slice'
|
|
8
8
|
import { useSeamlyStateContext, useSkiplink } from './seamly-state-hooks'
|
|
9
9
|
|
|
10
10
|
export const timeout = (ms = 0) =>
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from 'preact/hooks'
|
|
2
|
+
import { useDispatch } from 'react-redux'
|
|
1
3
|
import { typingTimeout } from 'config'
|
|
4
|
+
import { useSeamlyCommands, useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
5
|
+
import { useSeamlyStateContext } from 'ui/hooks/seamly-state-hooks'
|
|
6
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
2
7
|
import {
|
|
3
|
-
setBlockAutoEntrySwitch,
|
|
4
8
|
setActiveEntryType,
|
|
9
|
+
setBlockAutoEntrySwitch,
|
|
5
10
|
setUserEntryType,
|
|
6
11
|
} from 'domains/store/slice'
|
|
7
|
-
import { useSeamlyCommands, useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
8
|
-
import { useRef, useEffect, useCallback } from 'preact/hooks'
|
|
9
|
-
import { useSeamlyStateContext } from 'ui/hooks/seamly-state-hooks'
|
|
10
|
-
import { useDispatch } from 'react-redux'
|
|
11
|
-
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
12
12
|
|
|
13
13
|
export const useSeamlyTyping = () => {
|
|
14
14
|
const { sendAction } = useSeamlyCommands()
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect } from 'preact/hooks'
|
|
2
2
|
// Import extracted hooks here for use inside this file
|
|
3
3
|
import { useSeamlyApiContext } from './seamly-api-hooks'
|
|
4
|
+
|
|
4
5
|
// Export extracted hooks here,
|
|
5
6
|
// although this is a redundant, it prevents a bazillion code changes for now.
|
|
6
7
|
// TODO: Remove exports and import them from the correct files
|
|
@@ -56,16 +57,16 @@ export const useSeamlyEventStream = (nextFn, filterFn) => {
|
|
|
56
57
|
const api = useSeamlyApiContext()
|
|
57
58
|
|
|
58
59
|
useEffect(() => {
|
|
59
|
-
if (api.
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
60
|
+
if (api.connectionInfo && api.conversation?.channel) {
|
|
61
|
+
const { channel } = api.conversation
|
|
62
|
+
|
|
63
|
+
channel.onMessage = (type, payload) => {
|
|
64
|
+
if (!filterFn || filterFn({ type, payload })) {
|
|
65
|
+
nextFn({ type, payload })
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return payload
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
}, [
|
|
71
|
+
}, [nextFn, filterFn, api.connectionInfo, api.conversation])
|
|
71
72
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
import { useCallback } from 'preact/hooks'
|
|
2
|
+
import { useDispatch } from 'react-redux'
|
|
3
|
+
import { useElementFocusingById } from 'ui/hooks/focus-helper-hooks'
|
|
4
|
+
import { useSeamlyObjectStore } from 'ui/hooks/seamly-api-hooks'
|
|
5
|
+
import { useSeamlyStateContext } from 'ui/hooks/seamly-state-hooks'
|
|
1
6
|
import { useI18n } from 'domains/i18n/hooks'
|
|
2
7
|
import {
|
|
3
8
|
hideOption as dispatchHideOption,
|
|
9
|
+
showOption as dispatchShowOption,
|
|
4
10
|
setUserSelectedOption as dispatchUserSelectedOption,
|
|
5
11
|
setUserSelectedOptions as dispatchUserSelectedOptions,
|
|
6
|
-
showOption as dispatchShowOption,
|
|
7
12
|
} from 'domains/store/slice'
|
|
8
|
-
import { useCallback } from 'preact/hooks'
|
|
9
|
-
import { useDispatch } from 'react-redux'
|
|
10
|
-
import { useElementFocusingById } from 'ui/hooks/focus-helper-hooks'
|
|
11
|
-
import { useSeamlyObjectStore } from 'ui/hooks/seamly-api-hooks'
|
|
12
|
-
import { useSeamlyStateContext } from 'ui/hooks/seamly-state-hooks'
|
|
13
13
|
|
|
14
14
|
export const useSeamlyOptions = () => {
|
|
15
15
|
const { t } = useI18n()
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import * as ConfigSelectors from 'domains/config/selectors'
|
|
2
|
-
import { microsecondsToMilliseconds } from 'ui/utils/general-utils'
|
|
3
1
|
import { createSelector } from '@reduxjs/toolkit'
|
|
2
|
+
import { useSelector } from 'react-redux'
|
|
3
|
+
import { microsecondsToMilliseconds } from 'ui/utils/general-utils'
|
|
4
4
|
import { selectUserHasResponded } from 'domains/app/selectors'
|
|
5
5
|
import { useConfig } from 'domains/config/hooks'
|
|
6
|
-
import
|
|
6
|
+
import * as ConfigSelectors from 'domains/config/selectors'
|
|
7
|
+
import type { RootState } from 'domains/store'
|
|
8
|
+
import type { ChannelEvent, ServiceDataEvent } from 'domains/store/store.types'
|
|
7
9
|
|
|
8
|
-
export const selectState = ({ state }) => state
|
|
10
|
+
export const selectState = ({ state }: RootState) => state
|
|
9
11
|
export const useSeamlyStateContext = () => useSelector(selectState)
|
|
10
12
|
|
|
11
13
|
export const selectEventsWithSuggestion = createSelector(
|
|
@@ -22,7 +24,7 @@ export const selectEventsWithSuggestion = createSelector(
|
|
|
22
24
|
return events
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
const suggestionsEvent = {
|
|
27
|
+
const suggestionsEvent: ServiceDataEvent = {
|
|
26
28
|
type: 'service_data',
|
|
27
29
|
payload: serviceData.suggestion,
|
|
28
30
|
}
|
|
@@ -34,7 +36,7 @@ export const selectEventsWithSuggestion = createSelector(
|
|
|
34
36
|
export const selectEvents = createSelector(
|
|
35
37
|
selectEventsWithSuggestion,
|
|
36
38
|
ConfigSelectors.selectConfig,
|
|
37
|
-
(events, config) => {
|
|
39
|
+
(events, config): ChannelEvent[] => {
|
|
38
40
|
const { enabled, threshold } = config?.messages?.timeIndicator ?? {}
|
|
39
41
|
if (!enabled) {
|
|
40
42
|
return events
|
|
@@ -128,6 +130,7 @@ export const useSeamlyLayoutMode = () => {
|
|
|
128
130
|
return {
|
|
129
131
|
isInline: layoutMode === 'inline',
|
|
130
132
|
isWindow: layoutMode === 'window',
|
|
133
|
+
isApp: layoutMode === 'app',
|
|
131
134
|
isResolving: !layoutMode,
|
|
132
135
|
}
|
|
133
136
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'preact/hooks'
|
|
2
|
+
|
|
3
|
+
const useClickOutside = (callback: Function) => {
|
|
4
|
+
const ref = useRef<HTMLElement>(null)
|
|
5
|
+
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const handler = ({ target }: TouchEvent | MouseEvent): void => {
|
|
8
|
+
if (
|
|
9
|
+
ref.current &&
|
|
10
|
+
target instanceof HTMLElement &&
|
|
11
|
+
!ref.current.contains(target)
|
|
12
|
+
) {
|
|
13
|
+
callback()
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
document.addEventListener('click', handler, true)
|
|
18
|
+
document.addEventListener('touchstart', handler, true)
|
|
19
|
+
|
|
20
|
+
return () => {
|
|
21
|
+
document.removeEventListener('click', handler, true)
|
|
22
|
+
document.removeEventListener('touchstart', handler, true)
|
|
23
|
+
}
|
|
24
|
+
}, [callback, ref])
|
|
25
|
+
|
|
26
|
+
return ref
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default useClickOutside
|
|
@@ -4,22 +4,23 @@ import { payloadTypes } from 'ui/utils/seamly-utils'
|
|
|
4
4
|
|
|
5
5
|
const useEventComponentMapping = (event) => {
|
|
6
6
|
const components = useContext(ComponentContext)
|
|
7
|
-
|
|
7
|
+
const componentType = components[event.type]
|
|
8
|
+
let Component = componentType[event.payload.type]
|
|
8
9
|
let SubComponent = null
|
|
9
10
|
|
|
10
11
|
if (event.payload.type === payloadTypes.choicePrompt) {
|
|
11
|
-
SubComponent =
|
|
12
|
+
SubComponent = componentType[event.payload.body.prompt.type]
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (event.type === 'participant') {
|
|
16
|
+
Component = componentType[event.type]
|
|
12
17
|
}
|
|
13
18
|
|
|
14
|
-
|
|
15
|
-
|
|
19
|
+
if (Component && typeof Component !== 'function') {
|
|
20
|
+
Component = Component[event.payload.body.type]
|
|
21
|
+
}
|
|
16
22
|
|
|
17
|
-
return [
|
|
18
|
-
Component && typeof Component !== 'function'
|
|
19
|
-
? Component[event.payload.body.type] || components.fallback
|
|
20
|
-
: Component,
|
|
21
|
-
SubComponent,
|
|
22
|
-
]
|
|
23
|
+
return [Component || components.fallback, SubComponent]
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
export default useEventComponentMapping
|