@seamly/web-ui 20.0.0 → 20.2.0-alpha.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/deprecated-view.css +1 -1
- package/build/dist/lib/index.debug.js +135 -135
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.js +86 -59
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +86 -59
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +45 -31
- 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 -1
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +33 -21
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +12 -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 +1 -1
- package/src/javascripts/domains/config/reducer.js +3 -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 -10
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +5 -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 +7 -7
- package/src/javascripts/domains/translations/hooks.js +3 -3
- package/src/javascripts/domains/translations/middleware.js +2 -2
- package/src/javascripts/domains/translations/reducer.js +3 -3
- 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 +1 -1
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +8 -8
- 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 +4 -4
- 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 +4 -4
- 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 +3 -3
- 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 +4 -4
- 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 -6
- 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 +6 -6
- package/src/javascripts/ui/components/layout/chat-frame.js +5 -5
- 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 +7 -12
- 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/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 +5 -5
- 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 -2
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +2 -2
- 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 +9 -9
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +5 -5
- 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/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_chat-status.scss +4 -0
- 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 +10 -0
- package/src/.DS_Store +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks'
|
|
2
2
|
import ImageLightbox from './image-lightbox'
|
|
3
|
-
import MessageContainer from '
|
|
4
|
-
import { useTranslatedEventData } from '
|
|
3
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
4
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
5
5
|
|
|
6
6
|
const Image = ({ event, descriptorId, ...props }) => {
|
|
7
7
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
2
|
import Mustache from 'mustache'
|
|
3
|
-
import parseBody from '
|
|
4
|
-
import EventDivider from '
|
|
5
|
-
import { useTranslatedEventData } from '
|
|
6
|
-
import { useParticipants } from '
|
|
3
|
+
import parseBody from 'lib/parse-body'
|
|
4
|
+
import EventDivider from 'ui/components/conversation/event-divider'
|
|
5
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
6
|
+
import { useParticipants } from 'domains/config'
|
|
7
7
|
|
|
8
8
|
const Participant = ({ event }) => {
|
|
9
9
|
const { agent } = useParticipants()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import parseBody from '
|
|
2
|
+
import parseBody from 'lib/parse-body'
|
|
3
3
|
import useEventLinkClickHandler from './hooks/use-event-link-click-handler'
|
|
4
4
|
import { parseRichText } from './hooks/use-text-rendering'
|
|
5
|
-
import MessageContainer from '
|
|
6
|
-
import { useTranslatedEventData } from '
|
|
5
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
6
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
7
7
|
|
|
8
8
|
const Text = ({ event, ...props }) => {
|
|
9
9
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useI18n } from '
|
|
2
|
-
import MessageContainer from '
|
|
3
|
-
import { useTranslatedEventData } from '
|
|
1
|
+
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
4
4
|
|
|
5
5
|
const Translation = ({ event, ...props }) => {
|
|
6
6
|
const { t } = useI18n()
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import Icon from '
|
|
4
|
-
import { useI18n } from '
|
|
5
|
-
import MessageContainer from '
|
|
6
|
-
import { useTranslatedEventData } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import Icon from 'ui/components/layout/icon'
|
|
4
|
+
import { useI18n } from 'domains/i18n'
|
|
5
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
6
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
7
7
|
|
|
8
8
|
const UploadContent = ({ children, url, target }) =>
|
|
9
9
|
url ? (
|
|
10
|
-
<a
|
|
10
|
+
<a
|
|
11
|
+
href={url}
|
|
12
|
+
download
|
|
13
|
+
target={target || undefined}
|
|
14
|
+
className={className(['download', 'download-link'])}
|
|
15
|
+
>
|
|
11
16
|
{children}
|
|
12
17
|
</a>
|
|
13
18
|
) : (
|
|
14
|
-
<span>{children}</span>
|
|
19
|
+
<span className={className('download')}>{children}</span>
|
|
15
20
|
)
|
|
16
21
|
|
|
17
22
|
const Upload = ({ event, ...props }) => {
|
|
@@ -30,15 +35,13 @@ const Upload = ({ event, ...props }) => {
|
|
|
30
35
|
|
|
31
36
|
return (
|
|
32
37
|
<MessageContainer event={event} type="upload" {...props}>
|
|
33
|
-
<
|
|
38
|
+
<UploadContent url={url} target={!fromClient ? '_blank' : undefined}>
|
|
34
39
|
<Icon name="download" size="16" />
|
|
35
|
-
<
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
</UploadContent>
|
|
41
|
-
</div>
|
|
40
|
+
<span aria-hidden="true" className={className('file-download')}>
|
|
41
|
+
{filename}
|
|
42
|
+
</span>
|
|
43
|
+
<span className={className('visually-hidden')}>{srText}</span>
|
|
44
|
+
</UploadContent>
|
|
42
45
|
</MessageContainer>
|
|
43
46
|
)
|
|
44
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useSeamlyMessageContainerClassNames } from '
|
|
3
|
-
import { useTranslatedEventData } from '
|
|
4
|
-
import MessageContainer from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useSeamlyMessageContainerClassNames } from 'ui/hooks/seamly-hooks'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
4
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
5
5
|
|
|
6
6
|
const Video = ({ event, descriptorId, ...props }) => {
|
|
7
7
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import EventParticipant from './event/event-participant'
|
|
2
|
-
import { useSeamlyCurrentAgent } from '
|
|
3
|
-
import { className } from '
|
|
2
|
+
import { useSeamlyCurrentAgent } from 'ui/hooks/seamly-hooks'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
4
|
|
|
5
5
|
const Loader = () => {
|
|
6
6
|
const { id } = useSeamlyCurrentAgent() || {}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { className } from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
2
|
import EventParticipant from './event/event-participant'
|
|
3
|
-
import { useSeamlyMessageContainerClassNames } from '
|
|
4
|
-
import { useTranslatedEventData } from '
|
|
5
|
-
import { useI18n } from '
|
|
3
|
+
import { useSeamlyMessageContainerClassNames } from 'ui/hooks/component-helper-hooks'
|
|
4
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
5
|
+
import { useI18n } from 'domains/i18n'
|
|
6
6
|
|
|
7
7
|
function MessageContainer({
|
|
8
8
|
showParticipant = true,
|
|
@@ -3,9 +3,9 @@ import SeamlyActivityEventContext from './seamly-activity-event-context'
|
|
|
3
3
|
import {
|
|
4
4
|
useSeamlyCommands,
|
|
5
5
|
useSeamlyIdleDetachCountdown,
|
|
6
|
-
} from '
|
|
7
|
-
import { activitySendDelay } from '
|
|
8
|
-
import { className } from '
|
|
6
|
+
} from 'ui/hooks/seamly-hooks'
|
|
7
|
+
import { activitySendDelay } from 'config'
|
|
8
|
+
import { className } from 'lib/css'
|
|
9
9
|
|
|
10
10
|
const SeamlyActivityMonitor = ({ children }) => {
|
|
11
11
|
const prevSendTimestamp = useRef(0)
|
|
@@ -9,8 +9,8 @@ import SeamlyInitializer from './seamly-initializer'
|
|
|
9
9
|
import SeamlyEventSubscriber from './seamly-event-subscriber'
|
|
10
10
|
import SeamlyFileUpload from './seamly-file-upload'
|
|
11
11
|
import { SeamlyEventBusContext, SeamlyApiContext } from './seamly-api-context'
|
|
12
|
-
import { StoreProvider } from '
|
|
13
|
-
import { catchError } from '
|
|
12
|
+
import { StoreProvider } from 'domains/redux'
|
|
13
|
+
import { catchError } from 'domains/errors'
|
|
14
14
|
import ComponentFilter from '../conversation/component-filter'
|
|
15
15
|
|
|
16
16
|
const SeamlyCore = ({ store, children, config, eventBus, api }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { seamlyActions, featureKeys } from '
|
|
3
|
-
import { useI18n } from '
|
|
2
|
+
import { seamlyActions, featureKeys } from 'ui/utils/seamly-utils'
|
|
3
|
+
import { useI18n } from 'domains/i18n'
|
|
4
4
|
import {
|
|
5
5
|
useSeamlyOptions,
|
|
6
6
|
useEvents,
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
useSeamlyDispatchContext,
|
|
9
9
|
useSeamlyIdleDetachCountdown,
|
|
10
10
|
useSeamlyCommands,
|
|
11
|
-
} from '
|
|
12
|
-
import SeamlyGeneralError from '
|
|
13
|
-
import SeamlySessionExpiredError from '
|
|
14
|
-
import SeamlyOfflineError from '
|
|
15
|
-
import * as InterruptActions from '
|
|
16
|
-
import * as AppActions from '
|
|
11
|
+
} from 'ui/hooks/seamly-hooks'
|
|
12
|
+
import SeamlyGeneralError from 'api/errors/seamly-general-error'
|
|
13
|
+
import SeamlySessionExpiredError from 'api/errors/seamly-session-expired-error'
|
|
14
|
+
import SeamlyOfflineError from 'api/errors/seamly-offline-error'
|
|
15
|
+
import * as InterruptActions from 'domains/interrupt/actions'
|
|
16
|
+
import * as AppActions from 'domains/app/actions'
|
|
17
17
|
|
|
18
18
|
const {
|
|
19
19
|
ADD_EVENT,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import SeamlyFileUploadContext from './seamly-file-upload-context'
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import { randomId } from '
|
|
4
|
-
import { seamlyActions } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { randomId } from 'lib/id'
|
|
4
|
+
import { seamlyActions } from 'ui/utils/seamly-utils'
|
|
5
5
|
import {
|
|
6
6
|
useSeamlyCommands,
|
|
7
7
|
useSeamlyApiContext,
|
|
8
8
|
useSeamlyDispatchContext,
|
|
9
|
-
} from '
|
|
9
|
+
} from 'ui/hooks/seamly-hooks'
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
REGISTER_UPLOAD,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import useSeamlyIdleDetachCountdown from '
|
|
2
|
-
import useInterval from '
|
|
1
|
+
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
2
|
+
import useInterval from 'ui/hooks/use-interval'
|
|
3
3
|
|
|
4
4
|
const SeamlyIdleDetachCounter = () => {
|
|
5
5
|
const { hasCountdown, isActive, remaining, decrementCountdown } =
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { useSeamlyOptions } from '
|
|
3
|
-
import { useConfig } from '
|
|
2
|
+
import { useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
3
|
+
import { useConfig } from 'domains/config'
|
|
4
4
|
|
|
5
5
|
const SeamlyInitializer = () => {
|
|
6
6
|
const { initUserSelectedOptions } = useSeamlyOptions()
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
useSeamlyConversationUrl,
|
|
7
7
|
useSeamlyActivityEventHandler,
|
|
8
8
|
useSeamlyApiContext,
|
|
9
|
-
} from '
|
|
9
|
+
} from 'ui/hooks/seamly-hooks'
|
|
10
10
|
import { SeamlyEventBusContext } from './seamly-api-context'
|
|
11
|
-
import { useTranslations } from '
|
|
12
|
-
import { useInterrupt } from '
|
|
13
|
-
import { useConfig } from '
|
|
14
|
-
import { visibilityStates, useVisibility } from '
|
|
11
|
+
import { useTranslations } from 'domains/translations'
|
|
12
|
+
import { useInterrupt } from 'domains/interrupt'
|
|
13
|
+
import { useConfig } from 'domains/config'
|
|
14
|
+
import { visibilityStates, useVisibility } from 'domains/visibility'
|
|
15
15
|
|
|
16
16
|
function useSeamlyInstanceFunction(functionName, fn, deps = []) {
|
|
17
17
|
const eventBus = useContext(SeamlyEventBusContext)
|
|
@@ -7,8 +7,8 @@ import {
|
|
|
7
7
|
} from 'preact/hooks'
|
|
8
8
|
import { SeamlyLiveRegionContext } from './seamly-live-region-context'
|
|
9
9
|
import { SeamlyEventBusContext } from './seamly-api-context'
|
|
10
|
-
import { ariaLiveLevels } from '
|
|
11
|
-
import { className } from '
|
|
10
|
+
import { ariaLiveLevels } from 'ui/utils/seamly-utils'
|
|
11
|
+
import { className } from 'lib/css'
|
|
12
12
|
|
|
13
13
|
const SeamlyLiveRegion = ({ children }) => {
|
|
14
14
|
const eventBus = useContext(SeamlyEventBusContext)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useEffect, useRef, useMemo } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
3
|
import {
|
|
4
4
|
useEvents,
|
|
5
5
|
useLiveRegion,
|
|
6
6
|
useSeamlyIsHistoryLoaded,
|
|
7
|
-
} from '
|
|
8
|
-
import { newMessageScreenReaderWait } from '
|
|
9
|
-
import { debounce } from '
|
|
10
|
-
import { useVisibility } from '
|
|
7
|
+
} from 'ui/hooks/seamly-hooks'
|
|
8
|
+
import { newMessageScreenReaderWait } from 'config'
|
|
9
|
+
import { debounce } from 'ui/utils/general-utils'
|
|
10
|
+
import { useVisibility } from 'domains/visibility'
|
|
11
11
|
|
|
12
12
|
const SeamlyNewNotifications = () => {
|
|
13
13
|
const { t } = useI18n()
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
useLiveRegion,
|
|
7
7
|
useSeamlyUnreadCount,
|
|
8
8
|
useSeamlyDispatchContext,
|
|
9
|
-
} from '
|
|
10
|
-
import { useI18n } from '
|
|
9
|
+
} from 'ui/hooks/seamly-hooks'
|
|
10
|
+
import { useI18n } from 'domains/i18n'
|
|
11
11
|
import {
|
|
12
12
|
seamlyActions,
|
|
13
13
|
readStates,
|
|
14
14
|
actionTypes,
|
|
15
15
|
isUnreadMessage,
|
|
16
|
-
} from '
|
|
17
|
-
import { debounce } from '
|
|
18
|
-
import { unreadScreenReaderWait } from '
|
|
19
|
-
import { useVisibility } from '
|
|
16
|
+
} from 'ui/utils/seamly-utils'
|
|
17
|
+
import { debounce } from 'ui/utils/general-utils'
|
|
18
|
+
import { unreadScreenReaderWait } from 'config'
|
|
19
|
+
import { useVisibility } from 'domains/visibility'
|
|
20
20
|
|
|
21
21
|
const { SET_EVENTS_READ } = seamlyActions
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useLayoutEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import { className } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
4
|
import {
|
|
5
5
|
useSkiplinkTargetFocusing,
|
|
6
6
|
useFocusIfSeamlyContainedFocus,
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
useSeamlyHeaderData,
|
|
9
9
|
useGeneratedId,
|
|
10
10
|
useSeamlyStateContext,
|
|
11
|
-
} from '
|
|
12
|
-
import { useInterrupt } from '
|
|
13
|
-
import { useVisibility } from '
|
|
11
|
+
} from 'ui/hooks/seamly-hooks'
|
|
12
|
+
import { useInterrupt } from 'domains/interrupt'
|
|
13
|
+
import { useVisibility } from 'domains/visibility'
|
|
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
1
|
import { useEffect, useRef, useState, useCallback } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
3
|
import {
|
|
4
4
|
useSeamlyIdleDetachCountdown,
|
|
5
5
|
useSeamlyResumeConversationPrompt,
|
|
6
6
|
useSkiplinkTargetFocusing,
|
|
7
7
|
useSeamlyEntry,
|
|
8
8
|
useFileUploadMeta,
|
|
9
|
-
} from '
|
|
10
|
-
import { entryTypes } from '
|
|
11
|
-
import { runIfElementContainsOrHasFocus } from '
|
|
12
|
-
import IdleDetachWarning from '
|
|
13
|
-
import ResumeConversationPrompt from '
|
|
9
|
+
} from 'ui/hooks/seamly-hooks'
|
|
10
|
+
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
11
|
+
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
12
|
+
import IdleDetachWarning from 'ui/components/warnings/idle-detach-warning'
|
|
13
|
+
import ResumeConversationPrompt from 'ui/components/warnings/resume-conversation-prompt'
|
|
14
14
|
import TextEntry from './text-entry'
|
|
15
15
|
import UploadToggle from './upload-toggle'
|
|
16
16
|
import Upload from './upload'
|
|
17
|
-
import { useConfig } from '
|
|
18
|
-
import { useVisibility } from '
|
|
17
|
+
import { useConfig } from 'domains/config'
|
|
18
|
+
import { useVisibility } from 'domains/visibility'
|
|
19
19
|
|
|
20
20
|
const EntryContainer = () => {
|
|
21
21
|
const { isOpen } = useVisibility()
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { useEffect, useMemo } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import { useLiveRegion } from '
|
|
4
|
-
import { useEntryTextLimit } from '
|
|
5
|
-
import { debounce } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
4
|
+
import { useEntryTextLimit } from 'ui/hooks/seamly-state-hooks'
|
|
5
|
+
import { debounce } from 'ui/utils/general-utils'
|
|
6
6
|
import {
|
|
7
7
|
maxCharacterSrDebounceDelay,
|
|
8
8
|
maxCharacterWarningLimit,
|
|
9
|
-
} from '
|
|
10
|
-
import { useFormControl } from '
|
|
9
|
+
} from 'config'
|
|
10
|
+
import { useFormControl } from 'domains/forms'
|
|
11
11
|
|
|
12
12
|
export function useCharacterLimit(controlName) {
|
|
13
13
|
const { t } = useI18n()
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
useSeamlyCommands,
|
|
4
4
|
useSkiplink,
|
|
5
5
|
useSkiplinkTargetFocusing,
|
|
6
|
-
} from '
|
|
7
|
-
import { FormProvider } from '
|
|
6
|
+
} from 'ui/hooks/seamly-hooks'
|
|
7
|
+
import { FormProvider } from 'domains/forms'
|
|
8
8
|
import TextEntryForm from './text-entry-form'
|
|
9
9
|
import { useVisibility, visibilityStates } from '../../../../domains/visibility'
|
|
10
10
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useCallback, useLayoutEffect, useMemo } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
3
|
import {
|
|
4
4
|
useLiveRegion,
|
|
5
5
|
useSeamlyCommands,
|
|
6
6
|
useSeamlyEntry,
|
|
7
7
|
useSeamlyTyping,
|
|
8
|
-
} from '
|
|
9
|
-
import Icon from '
|
|
10
|
-
import { useFormControl } from '
|
|
11
|
-
import Form from '
|
|
12
|
-
import Input from '
|
|
8
|
+
} from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import Icon from 'ui/components/layout/icon'
|
|
10
|
+
import { useFormControl } from 'domains/forms'
|
|
11
|
+
import Form from 'ui/components/form-controls/form'
|
|
12
|
+
import Input from 'ui/components/form-controls/input'
|
|
13
13
|
import { useCharacterLimit } from './hooks'
|
|
14
|
-
import { useI18n } from '
|
|
14
|
+
import { useI18n } from 'domains/i18n'
|
|
15
15
|
|
|
16
16
|
export default function TextEntryForm({ controlName, skipLinkId }) {
|
|
17
17
|
const { t } = useI18n()
|
|
@@ -99,7 +99,7 @@ export default function TextEntryForm({ controlName, skipLinkId }) {
|
|
|
99
99
|
<button
|
|
100
100
|
className={className('button', 'input__submit')}
|
|
101
101
|
type="submit"
|
|
102
|
-
disabled={!hasValue || reachedCharacterLimit}
|
|
102
|
+
aria-disabled={!hasValue || reachedCharacterLimit ? 'true' : null}
|
|
103
103
|
>
|
|
104
104
|
<Icon name="send" size="32" alt={t('input.sendMessage')} />
|
|
105
105
|
</button>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import Form from '
|
|
3
|
-
import FileInput from '
|
|
4
|
-
import { useI18n } from '
|
|
5
|
-
import { useFormControl } from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import Form from 'ui/components/form-controls/form'
|
|
3
|
+
import FileInput from 'ui/components/form-controls/file-input'
|
|
4
|
+
import { useI18n } from 'domains/i18n'
|
|
5
|
+
import { useFormControl } from 'domains/forms'
|
|
6
6
|
|
|
7
7
|
export default function FileInputForm({
|
|
8
8
|
skiplinkId,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
3
|
import {
|
|
4
4
|
useSkiplink,
|
|
5
5
|
useFileUploadMeta,
|
|
@@ -8,18 +8,18 @@ import {
|
|
|
8
8
|
useLiveRegion,
|
|
9
9
|
useGeneratedId,
|
|
10
10
|
useSeamlyEntry,
|
|
11
|
-
} from '
|
|
12
|
-
import useSingleFileUpload from '
|
|
13
|
-
import { useI18n } from '
|
|
14
|
-
import { formatBytes } from '
|
|
15
|
-
import UploadProgress from '
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import { getValidator } from '../../../utils/form-utils'
|
|
11
|
+
} from 'ui/hooks/seamly-hooks'
|
|
12
|
+
import useSingleFileUpload from 'ui/hooks/use-single-file-upload'
|
|
13
|
+
import { useI18n } from 'domains/i18n'
|
|
14
|
+
import { formatBytes } from 'ui/utils/general-utils'
|
|
15
|
+
import UploadProgress from 'ui/components/widgets/upload-progress'
|
|
16
|
+
import { FormProvider } from 'domains/forms'
|
|
17
|
+
import { getValidator } from 'ui/utils/form-utils'
|
|
19
18
|
import {
|
|
20
19
|
fileListObjectIsNotEmpty,
|
|
21
20
|
validateFileSize,
|
|
22
|
-
} from '
|
|
21
|
+
} from 'ui/utils/validations'
|
|
22
|
+
import FileInputForm from './file-upload-form'
|
|
23
23
|
|
|
24
24
|
const formName = 'fileListForm'
|
|
25
25
|
const fileInputName = 'fileList'
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { useState, useEffect, useRef } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import Icon from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import Icon from 'ui/components/layout/icon'
|
|
4
4
|
import InOutTransition, {
|
|
5
5
|
transitionStartStates,
|
|
6
|
-
} from '
|
|
6
|
+
} from 'ui/components/widgets/in-out-transition'
|
|
7
7
|
import {
|
|
8
8
|
useFileUploadMeta,
|
|
9
9
|
useSkiplinkTargetFocusing,
|
|
10
10
|
useSeamlyEntry,
|
|
11
11
|
useLiveRegion,
|
|
12
12
|
useSeamlyCurrentAgent,
|
|
13
|
-
} from '
|
|
14
|
-
import { useI18n } from '
|
|
15
|
-
import { entryTypes } from '
|
|
16
|
-
import { runIfElementContainsOrHasFocus } from '
|
|
13
|
+
} from 'ui/hooks/seamly-hooks'
|
|
14
|
+
import { useI18n } from 'domains/i18n'
|
|
15
|
+
import { entryTypes } from 'ui/utils/seamly-utils'
|
|
16
|
+
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
17
17
|
|
|
18
18
|
const UploadToggle = () => {
|
|
19
19
|
const { t } = useI18n()
|
|
@@ -77,9 +77,9 @@ const UploadToggle = () => {
|
|
|
77
77
|
'upload-toggle',
|
|
78
78
|
])}
|
|
79
79
|
ref={uploadButton}
|
|
80
|
-
disabled={!showUploadButton ? 'true' : null}
|
|
80
|
+
aria-disabled={!showUploadButton ? 'true' : null}
|
|
81
81
|
type="button"
|
|
82
|
-
onClick={onClickHandler}
|
|
82
|
+
onClick={showUploadButton ? onClickHandler : null}
|
|
83
83
|
>
|
|
84
84
|
<Icon
|
|
85
85
|
name="file"
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { useEffect, useRef, useMemo } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import Icon from '
|
|
4
|
-
import { actionTypes } from '
|
|
5
|
-
import { runIfElementContainsOrHasFocus } from '
|
|
6
|
-
import useSeamlyCommands from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import Icon from 'ui/components/layout/icon'
|
|
4
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
5
|
+
import { runIfElementContainsOrHasFocus } from 'ui/utils/general-utils'
|
|
6
|
+
import useSeamlyCommands from 'ui/hooks/use-seamly-commands'
|
|
7
7
|
import {
|
|
8
8
|
useSeamlyServiceData,
|
|
9
9
|
useSeamlyLayoutMode,
|
|
10
|
-
} from '
|
|
11
|
-
import { useGeneratedId } from '
|
|
12
|
-
import { useSkiplinkTargetFocusing } from '
|
|
13
|
-
import { useLiveRegion } from '
|
|
14
|
-
import useSeamlyIdleDetachCountdown from '
|
|
15
|
-
import useSeamlyResumeConversationPrompt from '
|
|
16
|
-
import { useI18n } from '
|
|
10
|
+
} from 'ui/hooks/seamly-state-hooks'
|
|
11
|
+
import { useGeneratedId } from 'ui/hooks/utility-hooks'
|
|
12
|
+
import { useSkiplinkTargetFocusing } from 'ui/hooks/focus-helper-hooks'
|
|
13
|
+
import { useLiveRegion } from 'ui/hooks/live-region-hooks'
|
|
14
|
+
import useSeamlyIdleDetachCountdown from 'ui/hooks/use-seamly-idle-detach-countdown'
|
|
15
|
+
import useSeamlyResumeConversationPrompt from 'ui/hooks/use-seamly-resume-conversation-prompt'
|
|
16
|
+
import { useI18n } from 'domains/i18n'
|
|
17
17
|
import InOutTransition, {
|
|
18
18
|
transitionStartStates,
|
|
19
|
-
} from '
|
|
20
|
-
import { useTranslatedEventData } from '
|
|
21
|
-
import { useInterrupt } from '
|
|
22
|
-
import { useUserHasResponded } from '
|
|
19
|
+
} from 'ui/components/widgets/in-out-transition'
|
|
20
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
21
|
+
import { useInterrupt } from 'domains/interrupt'
|
|
22
|
+
import { useUserHasResponded } from 'domains/app'
|
|
23
23
|
|
|
24
24
|
const Faq = () => {
|
|
25
25
|
const { t } = useI18n()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState, useEffect } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import Icon from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import Icon from 'ui/components/layout/icon'
|
|
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 '
|
|
3
|
-
import { useGeneratedId } from '
|
|
4
|
-
import { useFormControl, useFormContext } from '
|
|
5
|
-
import Icon from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
4
|
+
import { useFormControl, useFormContext } from 'domains/forms'
|
|
5
|
+
import Icon from 'ui/components/layout/icon'
|
|
6
6
|
import Error from './error'
|
|
7
7
|
|
|
8
8
|
export default function FileInput({
|