@seamly/web-ui 20.0.0-beta.6 → 20.1.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.css +1 -1
- package/build/dist/lib/index.debug.js +138 -149
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +0 -4
- package/build/dist/lib/index.js +669 -655
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +702 -688
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +7288 -7266
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +1 -2
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +24 -19
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +30 -8
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/app/utils.js +1 -1
- package/src/javascripts/domains/config/hooks.js +18 -1
- package/src/javascripts/domains/config/index.js +0 -1
- package/src/javascripts/domains/config/reducer.js +7 -3
- package/src/javascripts/domains/config/selectors.js +1 -1
- package/src/javascripts/domains/config/utils.js +1 -1
- package/src/javascripts/domains/errors/index.js +2 -2
- package/src/javascripts/domains/forms/hooks.js +1 -1
- package/src/javascripts/domains/forms/provider.js +5 -3
- package/src/javascripts/domains/forms/reducer.js +1 -1
- package/src/javascripts/domains/forms/selectors.js +1 -1
- package/src/javascripts/domains/forms/utils.js +1 -1
- package/src/javascripts/domains/i18n/actions.js +1 -1
- package/src/javascripts/domains/i18n/hooks.js +1 -1
- package/src/javascripts/domains/i18n/reducer.js +1 -1
- package/src/javascripts/domains/i18n/utils.js +1 -1
- package/src/javascripts/domains/interrupt/hooks.js +2 -2
- package/src/javascripts/domains/interrupt/middleware.js +6 -6
- package/src/javascripts/domains/interrupt/reducer.js +1 -1
- package/src/javascripts/domains/interrupt/utils.js +1 -1
- package/src/javascripts/domains/options/middleware.js +1 -1
- package/src/javascripts/domains/store/index.js +10 -14
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +8 -5
- package/src/javascripts/domains/translations/components/options-button.js +6 -6
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
- package/src/javascripts/domains/translations/hooks.js +7 -3
- package/src/javascripts/domains/translations/middleware.js +5 -2
- package/src/javascripts/domains/translations/reducer.js +4 -4
- package/src/javascripts/domains/translations/selectors.js +1 -1
- package/src/javascripts/domains/translations/utils.js +1 -1
- package/src/javascripts/domains/visibility/actions.js +3 -3
- package/src/javascripts/domains/visibility/hooks.js +1 -1
- package/src/javascripts/domains/visibility/utils.js +1 -1
- package/src/javascripts/lib/css.js +1 -1
- package/src/javascripts/lib/engine/index.js +6 -5
- package/src/javascripts/lib/external-api/index.js +1 -1
- package/src/javascripts/lib/redux-helpers/index.js +1 -1
- package/src/javascripts/style-guide/components/app.js +9 -5
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +27 -13
- package/src/javascripts/style-guide/components/view.js +16 -3
- package/src/javascripts/style-guide/states.js +23 -41
- package/src/javascripts/style-guide/style-guide-engine.js +13 -1
- package/src/javascripts/style-guide.js +2 -0
- package/src/javascripts/ui/components/app-options/index.js +4 -4
- package/src/javascripts/ui/components/chat-status/index.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +6 -6
- package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
- package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
- package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
- package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +13 -10
- package/src/javascripts/ui/components/conversation/event/event.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/participant.js +6 -6
- package/src/javascripts/ui/components/conversation/event/text.js +3 -3
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +18 -15
- package/src/javascripts/ui/components/conversation/event/video.js +4 -4
- package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
- package/src/javascripts/ui/components/conversation/loader.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -4
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
- package/src/javascripts/ui/components/core/seamly-core.js +2 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
- package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
- package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
- package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
- package/src/javascripts/ui/components/entry/upload/index.js +10 -10
- package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
- package/src/javascripts/ui/components/faq/faq.js +16 -16
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
- package/src/javascripts/ui/components/form-controls/form.js +2 -2
- 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/form-controls/wrapper.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +13 -17
- package/src/javascripts/ui/components/layout/chat-frame.js +6 -6
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
- package/src/javascripts/ui/components/layout/header.js +3 -3
- package/src/javascripts/ui/components/layout/icon.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +3 -3
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
- package/src/javascripts/ui/components/options/options-button.js +8 -13
- package/src/javascripts/ui/components/options/options-frame.js +4 -4
- package/src/javascripts/ui/components/options/options.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +8 -8
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +7 -7
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
- package/src/javascripts/ui/components/warnings/prompt.js +2 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
- package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
- package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
- package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/javascripts/ui/utils/seamly-utils.js +9 -2
- package/src/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_input.scss +2 -2
- package/src/stylesheets/5-components/_message-body.scss +19 -12
- package/src/stylesheets/6-default-implementation/_hover.scss +24 -12
- package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
- package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -3
- package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
- package/webpack/config.common.js +5 -0
- package/webpack/config.package.js +3 -0
- package/src/javascripts/domains/config/middleware.js +0 -22
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import Icon from './icon'
|
|
2
1
|
import {
|
|
3
2
|
useSeamlyHeaderData,
|
|
4
3
|
useSeamlyUnreadCount,
|
|
5
4
|
useSeamlyCurrentAgent,
|
|
6
|
-
} from '
|
|
7
|
-
import { className } from '
|
|
8
|
-
import { useI18n } from '
|
|
9
|
-
import { useInterrupt } from '
|
|
10
|
-
import {
|
|
11
|
-
import { useVisibility } from '
|
|
5
|
+
} from 'ui/hooks/seamly-hooks'
|
|
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'
|
|
11
|
+
import Icon from './icon'
|
|
12
12
|
|
|
13
13
|
const AgentInfo = () => {
|
|
14
14
|
const { t } = useI18n()
|
|
@@ -17,12 +17,8 @@ const AgentInfo = () => {
|
|
|
17
17
|
const { isOpen } = useVisibility()
|
|
18
18
|
const currentAgent = useSeamlyCurrentAgent()
|
|
19
19
|
const { hasInterrupt } = useInterrupt()
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
const { startChatIcon } = defaults || {}
|
|
23
|
-
|
|
24
|
-
const avatar = currentAgent && !hasInterrupt ? currentAgent.avatar : null
|
|
25
|
-
|
|
20
|
+
const startChatIcon = useStartChatIcon()
|
|
21
|
+
const src = currentAgent?.avatar ?? startChatIcon
|
|
26
22
|
const displaySubtitle = hasInterrupt ? '' : subTitle
|
|
27
23
|
|
|
28
24
|
const classNames = ['message-count']
|
|
@@ -36,13 +32,13 @@ const AgentInfo = () => {
|
|
|
36
32
|
}
|
|
37
33
|
|
|
38
34
|
return (
|
|
39
|
-
(
|
|
35
|
+
(displaySubtitle || !isOpen) && (
|
|
40
36
|
<div className={className('agent-info')}>
|
|
41
37
|
<div className={className('agent-info__graphic')}>
|
|
42
|
-
{
|
|
38
|
+
{src ? (
|
|
43
39
|
<img
|
|
44
|
-
className={className(avatar ? 'avatar' : 'icon')}
|
|
45
|
-
src={
|
|
40
|
+
className={className(currentAgent?.avatar ? 'avatar' : 'icon')}
|
|
41
|
+
src={src}
|
|
46
42
|
alt=""
|
|
47
43
|
/>
|
|
48
44
|
) : (
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import AppOptions from '
|
|
3
|
-
import { ChatStatus as TranslationsChatStatus } from '
|
|
4
|
-
import { useInterrupt } from '
|
|
5
|
-
import { useVisibility } from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import AppOptions from 'ui/components/app-options'
|
|
3
|
+
import { ChatStatus as TranslationsChatStatus } from 'domains/translations'
|
|
4
|
+
import { useInterrupt } from 'domains/interrupt'
|
|
5
|
+
import { useVisibility } from 'domains/visibility'
|
|
6
6
|
|
|
7
7
|
function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
8
8
|
const { hasInterrupt, meta } = useInterrupt()
|
|
@@ -22,7 +22,7 @@ function ChatFrame({ children, interruptComponent: InterruptComponent }) {
|
|
|
22
22
|
<>
|
|
23
23
|
<TranslationsChatStatus />
|
|
24
24
|
<div className={className('chat__container')}>{getContent()}</div>
|
|
25
|
-
<AppOptions />
|
|
25
|
+
{isOpen && <AppOptions />}
|
|
26
26
|
</>
|
|
27
27
|
)
|
|
28
28
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { useCallback, useMemo } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
3
|
import {
|
|
4
4
|
useSeamlyAppContainerClassNames,
|
|
5
5
|
useSeamlyLayoutMode,
|
|
6
6
|
useSeamlyContainerElement,
|
|
7
|
-
} from '
|
|
8
|
-
import Faq from '
|
|
9
|
-
import { useConfig } from '
|
|
10
|
-
import { useUserHasResponded } from '
|
|
11
|
-
import { useI18n } from '
|
|
12
|
-
import { useVisibility, visibilityStates } from '
|
|
7
|
+
} 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
13
|
|
|
14
14
|
const DeprecatedAppFrame = ({ children }) => {
|
|
15
15
|
const [, setSeamlyContainerElement] = useSeamlyContainerElement()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useRef } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import { useI18n } from 'domains/i18n'
|
|
4
|
+
import { useSeamlyStateContext } from 'ui/hooks/seamly-hooks'
|
|
3
5
|
import Icon from './icon'
|
|
4
|
-
import { useI18n } from '../../../domains/i18n'
|
|
5
|
-
import { useSeamlyStateContext } from '../../hooks/seamly-hooks'
|
|
6
6
|
|
|
7
7
|
const Header = ({ children, onCloseChat }) => {
|
|
8
8
|
const { headerCollapseButtonId } = useSeamlyStateContext()
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { className as classNameFn } from '
|
|
1
|
+
import { className as classNameFn } from 'lib/css'
|
|
2
2
|
|
|
3
3
|
/* eslint-disable import/no-webpack-loader-syntax */
|
|
4
4
|
// The eslint rules are disabled for this as otherwsise we'd need to include the loader rule in all implementations
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
3
|
import {
|
|
4
4
|
useSeamlyCommands,
|
|
5
5
|
useLiveRegion,
|
|
6
6
|
useGeneratedId,
|
|
7
7
|
useSkiplinkTargetFocusing,
|
|
8
|
-
} from '
|
|
9
|
-
import SeamlySessionExpiredError from '
|
|
8
|
+
} from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import SeamlySessionExpiredError from 'api/errors/seamly-session-expired-error'
|
|
10
10
|
|
|
11
11
|
const Interrupt = ({
|
|
12
12
|
originalError,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import { useConfig } from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { useConfig } from 'domains/config'
|
|
4
4
|
|
|
5
5
|
const PrivacyDisclaimer = () => {
|
|
6
6
|
const { t } = useI18n()
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createRef } from 'preact'
|
|
2
2
|
import { useState, useRef, useEffect, useMemo } from 'preact/hooks'
|
|
3
|
-
import { className } from '
|
|
4
|
-
import { useSeamlyOptions, useOptionButton } from '
|
|
5
|
-
import { useI18n } from '
|
|
6
|
-
import Icon from '
|
|
7
|
-
import Options from './options'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
|
+
import { useSeamlyOptions, useOptionButton } from 'ui/hooks/seamly-hooks'
|
|
5
|
+
import { useI18n } from 'domains/i18n'
|
|
6
|
+
import Icon from 'ui/components/layout/icon'
|
|
8
7
|
import InOutTransition, {
|
|
9
8
|
transitionStartStates,
|
|
10
|
-
} from '
|
|
11
|
-
import { getKey, keyNames, focusElement } from '
|
|
9
|
+
} from 'ui/components/widgets/in-out-transition'
|
|
10
|
+
import { getKey, keyNames, focusElement } from 'ui/utils/general-utils'
|
|
11
|
+
import Options from './options'
|
|
12
12
|
|
|
13
13
|
const OptionsButton = () => {
|
|
14
14
|
const { t } = useI18n()
|
|
@@ -193,11 +193,7 @@ const OptionsButton = () => {
|
|
|
193
193
|
ref={(item) => {
|
|
194
194
|
menuItemButtons.current[i] = item
|
|
195
195
|
}}
|
|
196
|
-
className={className([
|
|
197
|
-
'button',
|
|
198
|
-
'button--secondary',
|
|
199
|
-
...(available ? [] : ['button--disabled']),
|
|
200
|
-
])}
|
|
196
|
+
className={className(['button', 'button--secondary'])}
|
|
201
197
|
onKeyDown={(e) => onMenuItemKeyDownHandler(e, i)}
|
|
202
198
|
onKeyPress={(e) => onKeyPressHandler(e, i)}
|
|
203
199
|
onClick={() => onMenuItemClickHandler(name, available)}
|
|
@@ -227,7 +223,6 @@ const OptionsButton = () => {
|
|
|
227
223
|
...(!multiMenu && firstOptionName
|
|
228
224
|
? [`chat__options__button--${firstOptionName}`]
|
|
229
225
|
: []),
|
|
230
|
-
...(!multiMenu && !firstOption.available ? ['button--disabled'] : []),
|
|
231
226
|
])}
|
|
232
227
|
id={id}
|
|
233
228
|
onClick={onClickHandler}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useRef, useEffect } from 'preact/hooks'
|
|
2
|
-
import Icon from '
|
|
2
|
+
import Icon from 'ui/components/layout/icon'
|
|
3
3
|
import {
|
|
4
4
|
useGeneratedId,
|
|
5
5
|
useOptionButton,
|
|
6
6
|
useSeamlyOptions,
|
|
7
|
-
} from '
|
|
8
|
-
import { className } from '
|
|
9
|
-
import { focusElement } from '
|
|
7
|
+
} from 'ui/hooks/seamly-hooks'
|
|
8
|
+
import { className } from 'lib/css'
|
|
9
|
+
import { focusElement } from 'ui/utils/general-utils'
|
|
10
10
|
|
|
11
11
|
const OptionsFrame = ({
|
|
12
12
|
className: givenClassName,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { useCallback, useMemo, useState } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import OptionsFrame from '
|
|
4
|
-
import { className } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import OptionsFrame from 'ui/components/options/options-frame'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
5
|
import {
|
|
6
6
|
useGeneratedId,
|
|
7
7
|
useOptionButton,
|
|
8
8
|
useSeamlyCommands,
|
|
9
9
|
useSeamlyOptions,
|
|
10
|
-
} from '
|
|
11
|
-
import { actionTypes } from '
|
|
12
|
-
import { FormProvider } from '
|
|
10
|
+
} from 'ui/hooks/seamly-hooks'
|
|
11
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
12
|
+
import { FormProvider } from 'domains/forms'
|
|
13
|
+
import { getValidator } from 'ui/utils/form-utils'
|
|
14
|
+
import { isEmailString, isNotEmptyString } from 'ui/utils/validations'
|
|
13
15
|
import TranscriptForm from './transcript-form'
|
|
14
|
-
import { getValidator } from '../../../utils/form-utils'
|
|
15
|
-
import { isEmailString, isNotEmptyString } from '../../../utils/validations'
|
|
16
16
|
|
|
17
17
|
const formId = 'sendTranscript'
|
|
18
18
|
const controlName = 'email'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import Form from '
|
|
4
|
-
import Input from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import Form from 'ui/components/form-controls/form'
|
|
4
|
+
import Input from 'ui/components/form-controls/input'
|
|
5
5
|
|
|
6
6
|
export default function TranscriptForm({ controlName, describedById }) {
|
|
7
7
|
const { t } = useI18n()
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useSkiplinkTargetFocusing,
|
|
7
7
|
} from '../../../hooks/seamly-hooks'
|
|
8
8
|
import { useI18n } from '../../../../domains/i18n'
|
|
9
|
-
import {
|
|
9
|
+
import { useStartChatIcon } from '../../../../domains/config'
|
|
10
10
|
import { useVisibility } from '../../../../domains/visibility'
|
|
11
11
|
import Icon from '../../layout/icon'
|
|
12
12
|
import { useInterrupt } from '../../../../domains/interrupt'
|
|
@@ -16,15 +16,15 @@ import InOutTransition, {
|
|
|
16
16
|
import { useSeamlyHasConversation } from '../../../hooks/seamly-api-hooks'
|
|
17
17
|
|
|
18
18
|
const ButtonIcon = () => {
|
|
19
|
+
const startChatIcon = useStartChatIcon()
|
|
19
20
|
const currentAgent = useSeamlyCurrentAgent()
|
|
20
21
|
const { hasInterrupt } = useInterrupt()
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
return avatar || startChatIcon ? (
|
|
22
|
+
const isActiveConversation = currentAgent && !hasInterrupt
|
|
23
|
+
const src = isActiveConversation ? currentAgent.avatar : startChatIcon
|
|
24
|
+
return src ? (
|
|
25
25
|
<img
|
|
26
|
-
className={className(
|
|
27
|
-
src={
|
|
26
|
+
className={className(isActiveConversation ? 'avatar' : 'icon')}
|
|
27
|
+
src={src}
|
|
28
28
|
alt=""
|
|
29
29
|
/>
|
|
30
30
|
) : (
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import useSeamlyIdleDetachCountdown from '
|
|
4
|
-
import { useSkiplinkTargetFocusing } from '
|
|
5
|
-
import useSeamlyActivityEventHandler from '
|
|
6
|
-
import useSeamlyCommands from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
4
|
+
import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
5
|
+
import useSeamlyActivityEventHandler from 'ui/hooks/use-seamly-activity-event-handler'
|
|
6
|
+
import useSeamlyCommands from 'ui/hooks/use-seamly-commands'
|
|
7
7
|
import Prompt from './prompt'
|
|
8
8
|
|
|
9
9
|
const IdleDetachWarning = () => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useSkiplink, useGeneratedId } from '
|
|
1
|
+
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,9 +1,9 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
4
|
+
import useSeamlyActivityEventHandler from 'ui/hooks/use-seamly-activity-event-handler'
|
|
5
|
+
import { useSeamlyCurrentAgent } from 'ui/hooks/seamly-state-hooks'
|
|
3
6
|
import Prompt from './prompt'
|
|
4
|
-
import useSeamlyResumeConversationPrompt from '../../hooks/use-seamly-resume-conversation-prompt'
|
|
5
|
-
import useSeamlyActivityEventHandler from '../../hooks/use-seamly-activity-event-handler'
|
|
6
|
-
import { useSeamlyCurrentAgent } from '../../hooks/seamly-state-hooks'
|
|
7
7
|
|
|
8
8
|
const ResumeConversationPrompt = () => {
|
|
9
9
|
const { t } = useI18n()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { toChildArray, cloneElement } from 'preact'
|
|
2
2
|
import { useRef, useState, useEffect } from 'preact/hooks'
|
|
3
|
-
import { useStableCallback } from '
|
|
4
|
-
import { className } from '
|
|
5
|
-
import { defaultTransitionTimeMs } from '
|
|
3
|
+
import { useStableCallback } from 'ui/hooks/seamly-hooks'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
|
+
import { defaultTransitionTimeMs } from 'config'
|
|
6
6
|
|
|
7
7
|
const transitionClasses = {
|
|
8
8
|
visible: className('transition--visible'),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useRef } from 'preact/hooks'
|
|
2
|
-
import
|
|
3
|
-
import { useI18n } from '../../../domains/i18n'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
4
3
|
import {
|
|
5
4
|
useSeamlyActivityEventHandler,
|
|
6
5
|
useSeamlyAppContainerClassNames,
|
|
7
|
-
} from '
|
|
8
|
-
import { className } from '
|
|
9
|
-
import Icon from '
|
|
10
|
-
import { useConfig } from '
|
|
6
|
+
} from 'ui/hooks/seamly-hooks'
|
|
7
|
+
import { className } from 'lib/css'
|
|
8
|
+
import Icon from 'ui/components/layout/icon'
|
|
9
|
+
import { useConfig } from 'domains/config'
|
|
10
|
+
import Modal from './modal'
|
|
11
11
|
|
|
12
12
|
const Lightbox = ({ url, description, onClose: onCloseHandler }) => {
|
|
13
13
|
const { zIndex, layoutMode, namespace } = useConfig()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { render, toChildArray } from 'preact'
|
|
2
2
|
import { createFocusTrap } from 'focus-trap'
|
|
3
3
|
import { useLayoutEffect, useEffect, useRef, useState } from 'preact/hooks'
|
|
4
|
-
import { createAriaHider } from '
|
|
5
|
-
import { useGeneratedId } from '
|
|
4
|
+
import { createAriaHider } from 'ui/utils/general-utils'
|
|
5
|
+
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
6
6
|
|
|
7
7
|
const Modal = ({
|
|
8
8
|
children,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useFileUploads } from '
|
|
3
|
-
import { useI18n } from '
|
|
4
|
-
import Error from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useFileUploads } from 'ui/hooks/seamly-hooks'
|
|
3
|
+
import { useI18n } from 'domains/i18n'
|
|
4
|
+
import Error from 'ui/components/form-controls/error'
|
|
5
5
|
|
|
6
6
|
const UploadProgress = () => {
|
|
7
7
|
const { t } = useI18n()
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'preact/hooks'
|
|
2
|
+
import SeamlyFileUploadContext from 'ui/components/core/seamly-file-upload-context'
|
|
3
|
+
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
2
4
|
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
3
5
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
4
|
-
import SeamlyFileUploadContext from '../components/core/seamly-file-upload-context'
|
|
5
|
-
|
|
6
|
-
import { seamlyActions } from '../utils/seamly-utils'
|
|
7
6
|
|
|
8
7
|
const { CLEAR_ALL_UPLOADS } = seamlyActions
|
|
9
8
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCallback, useRef } from 'preact/hooks'
|
|
2
|
-
import { useSeamlyStateContext, useSkiplink } from './seamly-state-hooks'
|
|
3
2
|
import {
|
|
4
3
|
focusElement,
|
|
5
4
|
runIfElementContainsOrHasFocus,
|
|
6
|
-
} from '
|
|
5
|
+
} from 'ui/utils/general-utils'
|
|
6
|
+
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
7
|
+
import { useSeamlyStateContext, useSkiplink } from './seamly-state-hooks'
|
|
7
8
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
8
|
-
import { seamlyActions } from '../utils/seamly-utils'
|
|
9
9
|
|
|
10
10
|
const { SET_SEAMLY_CONTAINER_ELEMENT } = seamlyActions
|
|
11
11
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'preact/hooks'
|
|
2
|
-
import { SeamlyLiveRegionContext } from '
|
|
3
|
-
import { ariaLiveLevels } from '
|
|
2
|
+
import { SeamlyLiveRegionContext } from 'ui/components/core/seamly-live-region-context'
|
|
3
|
+
import { ariaLiveLevels } from 'ui/utils/seamly-utils'
|
|
4
4
|
|
|
5
5
|
export const useSeamlyLiveRegionContext = () =>
|
|
6
6
|
useContext(SeamlyLiveRegionContext)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useRef, useCallback, useEffect } from 'preact/hooks'
|
|
2
|
-
import { seamlyActions, actionTypes } from '
|
|
2
|
+
import { seamlyActions, actionTypes } from 'ui/utils/seamly-utils'
|
|
3
|
+
import { typingTimeout } from 'config'
|
|
3
4
|
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
4
5
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
5
6
|
import { useSeamlyOptions } from './seamly-option-hooks'
|
|
6
7
|
import useSeamlyCommands from './use-seamly-commands'
|
|
7
|
-
import { typingTimeout } from '../../config'
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
SET_BLOCK_AUTO_ENTRY_SWITCH,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
3
4
|
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
4
5
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
5
6
|
import { useSeamlyObjectStore } from './seamly-api-hooks'
|
|
6
7
|
import { useElementFocusingById } from './focus-helper-hooks'
|
|
7
|
-
import { seamlyActions } from '../utils/seamly-utils'
|
|
8
8
|
|
|
9
9
|
const {
|
|
10
10
|
SET_USER_SELECTED_OPTION,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createSelector } from 'reselect'
|
|
2
|
-
import { useSelector } from '
|
|
3
|
-
import { microsecondsToMilliseconds } from '
|
|
4
|
-
import * as ConfigSelectors from '
|
|
5
|
-
import * as AppSelectors from '
|
|
6
|
-
import { useConfig } from '
|
|
2
|
+
import { useSelector } from 'domains/redux'
|
|
3
|
+
import { microsecondsToMilliseconds } from 'ui/utils/general-utils'
|
|
4
|
+
import * as ConfigSelectors from 'domains/config/selectors'
|
|
5
|
+
import * as AppSelectors from 'domains/app/selectors'
|
|
6
|
+
import { useConfig } from 'domains/config/hooks'
|
|
7
7
|
|
|
8
8
|
export const selectState = (state) => state.state
|
|
9
9
|
export const useSeamlyStateContext = () => useSelector(selectState)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'preact/hooks'
|
|
2
|
-
import ComponentContext from '
|
|
3
|
-
import { payloadTypes } from '
|
|
2
|
+
import ComponentContext from 'ui/components/conversation/component-context'
|
|
3
|
+
import { payloadTypes } from 'ui/utils/seamly-utils'
|
|
4
4
|
|
|
5
5
|
const useEventComponentMapping = (event) => {
|
|
6
6
|
const components = useContext(ComponentContext)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from 'preact/hooks'
|
|
2
|
-
import SeamlyActivityEventContext from '
|
|
2
|
+
import SeamlyActivityEventContext from 'ui/components/core/seamly-activity-event-context'
|
|
3
3
|
|
|
4
4
|
const useSeamlyActivityEventHandler = () =>
|
|
5
5
|
useContext(SeamlyActivityEventContext)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
4
|
+
import { useVisibility, visibilityStates } from 'domains/visibility'
|
|
3
5
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
4
6
|
import { useEvents } from './seamly-state-hooks'
|
|
5
7
|
import useSeamlyCommands from './use-seamly-commands'
|
|
6
8
|
import { useSeamlyHasConversation } from './seamly-api-hooks'
|
|
7
9
|
import { useLiveRegion } from './live-region-hooks'
|
|
8
|
-
import { seamlyActions } from '../utils/seamly-utils'
|
|
9
|
-
import { useVisibility, visibilityStates } from '../../domains/visibility'
|
|
10
10
|
import { useConfig } from '../../domains/config'
|
|
11
11
|
|
|
12
12
|
const { SET_IS_LOADING } = seamlyActions
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useCallback, useContext } from 'preact/hooks'
|
|
2
|
+
import { SeamlyEventBusContext } from 'ui/components/core/seamly-api-context'
|
|
3
|
+
import { randomId } from 'lib/id'
|
|
4
|
+
import { userParticipantId } from 'config'
|
|
5
|
+
import { actionTypes, seamlyActions } from 'ui/utils/seamly-utils'
|
|
6
|
+
import { Actions as InterruptActions } from 'domains/interrupt'
|
|
7
|
+
import { useConfig } from 'domains/config'
|
|
8
|
+
import * as AppActions from 'domains/app/actions'
|
|
9
|
+
import { useUserHasResponded } from 'domains/app/hooks'
|
|
10
|
+
import { useVisibility } from 'domains/visibility'
|
|
11
|
+
import { useStableCallback } from './utility-hooks'
|
|
12
|
+
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
13
|
+
import { useSeamlyUnreadCount } from './seamly-state-hooks'
|
|
2
14
|
import {
|
|
3
15
|
useSeamlyApiContext,
|
|
4
16
|
useSeamlyHasConversation,
|
|
5
17
|
} from './seamly-api-hooks'
|
|
6
|
-
import { useSeamlyUnreadCount } from './seamly-state-hooks'
|
|
7
|
-
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
8
|
-
import { SeamlyEventBusContext } from '../components/core/seamly-api-context'
|
|
9
|
-
import { randomId } from '../../lib/id'
|
|
10
|
-
import { userParticipantId } from '../../config'
|
|
11
|
-
import { actionTypes, seamlyActions } from '../utils/seamly-utils'
|
|
12
|
-
import { useStableCallback } from './utility-hooks'
|
|
13
|
-
import { Actions as InterruptActions } from '../../domains/interrupt'
|
|
14
|
-
import { useConfig } from '../../domains/config'
|
|
15
|
-
import * as AppActions from '../../domains/app/actions'
|
|
16
|
-
import { useUserHasResponded } from '../../domains/app/hooks'
|
|
17
|
-
import { useVisibility } from '../../domains/visibility'
|
|
18
18
|
|
|
19
19
|
const { ADD_EVENT, SET_INITIAL_STATE } = seamlyActions
|
|
20
20
|
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { useCallback, useRef } from 'preact/hooks'
|
|
2
|
-
import
|
|
3
|
-
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
4
|
-
import useSeamlyCommands from './use-seamly-commands'
|
|
5
|
-
import { useI18n } from '../../domains/i18n'
|
|
6
|
-
import { useLiveRegion } from './live-region-hooks'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
7
3
|
import {
|
|
8
4
|
getTimeFromSeconds,
|
|
9
5
|
millisecondsToSeconds,
|
|
10
|
-
} from '
|
|
11
|
-
import { actionTypes, seamlyActions } from '
|
|
12
|
-
import { screenReaderDebounceDelaySeconds } from '
|
|
13
|
-
import { useVisibility } from '
|
|
6
|
+
} from 'ui/utils/general-utils'
|
|
7
|
+
import { actionTypes, seamlyActions } from 'ui/utils/seamly-utils'
|
|
8
|
+
import { screenReaderDebounceDelaySeconds } from 'config'
|
|
9
|
+
import { useVisibility } from 'domains/visibility'
|
|
10
|
+
import { useLiveRegion } from './live-region-hooks'
|
|
11
|
+
import useSeamlyCommands from './use-seamly-commands'
|
|
12
|
+
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
13
|
+
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
14
14
|
|
|
15
15
|
const {
|
|
16
16
|
CLEAR_IDLE_DETACH_COUNTDOWN,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import { actionTypes, dismissTypes, seamlyActions } from 'ui/utils/seamly-utils'
|
|
1
3
|
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
2
4
|
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
3
5
|
import useSeamlyCommands from './use-seamly-commands'
|
|
4
|
-
import { useI18n } from '../../domains/i18n'
|
|
5
6
|
import { useLiveRegion } from './live-region-hooks'
|
|
6
|
-
import { actionTypes, dismissTypes, seamlyActions } from '../utils/seamly-utils'
|
|
7
7
|
|
|
8
8
|
const { CLEAR_RESUME_CONVERSATION_PROMPT } = seamlyActions
|
|
9
9
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Selectors } from 'domains/forms'
|
|
2
|
+
import { useSelectorWithProps } from 'domains/redux'
|
|
1
3
|
import { useFileUploads } from './seamly-hooks'
|
|
2
|
-
import { useSelectorWithProps } from '../../domains/redux'
|
|
3
|
-
import { Selectors } from '../../domains/forms'
|
|
4
4
|
|
|
5
5
|
const useSingleFileUpload = (formId, name) => {
|
|
6
6
|
const fileList = useSelectorWithProps(
|