@seamly/web-ui 22.3.0-beta.1 → 22.3.0-beta.3
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 +342 -314
- package/build/dist/lib/components.js.map +1 -1
- package/build/dist/lib/components.min.js +1 -1
- package/build/dist/lib/components.min.js.map +1 -1
- package/build/dist/lib/hooks.js +312 -297
- package/build/dist/lib/hooks.js.map +1 -1
- package/build/dist/lib/hooks.min.js +1 -1
- package/build/dist/lib/hooks.min.js.map +1 -1
- package/build/dist/lib/index.debug.js +192 -120
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +4 -4
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +433 -250
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/standalone.js +849 -262
- package/build/dist/lib/standalone.js.map +1 -1
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.map +1 -1
- package/build/dist/lib/storage.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +293 -248
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/utils.js +381 -341
- package/build/dist/lib/utils.js.map +1 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/build/dist/lib/utils.min.js.map +1 -1
- package/package.json +1 -1
- package/src/javascripts/api/conversation-connector.ts +6 -9
- package/src/javascripts/domains/translations/components/options-dialog/translation-option.tsx +1 -1
- package/src/javascripts/style-guide/states.js +8 -0
- package/src/javascripts/ui/components/chat-status/chat-status-action.tsx +2 -2
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +2 -2
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +1 -1
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +1 -1
- package/src/javascripts/ui/components/conversation/event-divider.js +6 -1
- package/src/javascripts/ui/components/core/seamly-event-subscriber.ts +20 -15
- package/src/javascripts/ui/components/form-controls/error.js +1 -1
- package/src/javascripts/ui/components/form-controls/file-input.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +1 -1
- package/src/javascripts/ui/components/layout/{icon.js → icon.tsx} +74 -37
- package/src/javascripts/ui/components/options/options-button.js +1 -1
- package/src/javascripts/ui/components/suggestions/suggestions-item.js +1 -1
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +1 -1
- package/src/javascripts/ui/components/widgets/lightbox.js +1 -1
- package/src/stylesheets/5-components/_message-card.scss +4 -3
package/package.json
CHANGED
|
@@ -46,11 +46,12 @@ export default class ConversationConnector {
|
|
|
46
46
|
this.channelTopic = channelTopic
|
|
47
47
|
const { url: splittedUrl, params } = splitUrlParams(this.url)
|
|
48
48
|
|
|
49
|
-
this.socket
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
if (!this.socket) {
|
|
50
|
+
this.socket = new Socket(splittedUrl, {
|
|
51
|
+
params: { ...params, v: apiVersion },
|
|
52
|
+
})
|
|
53
|
+
this.socket.connect()
|
|
54
|
+
}
|
|
54
55
|
|
|
55
56
|
this.channel = this.socket.channel(this.channelTopic, {
|
|
56
57
|
authorization: `Bearer ${this.accessToken}`,
|
|
@@ -138,8 +139,6 @@ export default class ConversationConnector {
|
|
|
138
139
|
ready: false,
|
|
139
140
|
currentState: 'join_channel_erred',
|
|
140
141
|
})
|
|
141
|
-
// @ts-ignore
|
|
142
|
-
this.channel.socket.disconnect()
|
|
143
142
|
})
|
|
144
143
|
.receive('timeout', () => {
|
|
145
144
|
log('[CHANEL][JOIN] Networking issue. Still waiting...')
|
|
@@ -149,8 +148,6 @@ export default class ConversationConnector {
|
|
|
149
148
|
disconnect() {
|
|
150
149
|
this.channel?.leave().receive('ok', () => {
|
|
151
150
|
log('[CHANNEL][LEAVE] OK')
|
|
152
|
-
this.socket?.remove(this.channel)
|
|
153
|
-
this.socket?.disconnect()
|
|
154
151
|
this.#connectionListeners = []
|
|
155
152
|
})
|
|
156
153
|
}
|
|
@@ -1280,6 +1280,7 @@ const standardState = {
|
|
|
1280
1280
|
cardAskText.payload.body,
|
|
1281
1281
|
cardNavigate.payload.body,
|
|
1282
1282
|
cardTopic.payload.body,
|
|
1283
|
+
cardNoImage.payload.body,
|
|
1283
1284
|
],
|
|
1284
1285
|
},
|
|
1285
1286
|
},
|
|
@@ -1612,6 +1613,13 @@ const standardState = {
|
|
|
1612
1613
|
sendTranscript: { enabled: true },
|
|
1613
1614
|
},
|
|
1614
1615
|
},
|
|
1616
|
+
config: {
|
|
1617
|
+
...baseState.config,
|
|
1618
|
+
context: {
|
|
1619
|
+
...baseState.context,
|
|
1620
|
+
locale: 'nl',
|
|
1621
|
+
},
|
|
1622
|
+
},
|
|
1615
1623
|
translations: {
|
|
1616
1624
|
...translationsSlice,
|
|
1617
1625
|
isAvailable: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Icon from 'ui/components/layout/icon'
|
|
1
|
+
import Icon, { IconProps } from 'ui/components/layout/icon'
|
|
2
2
|
import { className } from 'lib/css'
|
|
3
3
|
|
|
4
4
|
type ChatStatusActionProps = {
|
|
5
5
|
handleClick: () => void
|
|
6
|
-
icon:
|
|
6
|
+
icon: IconProps['name']
|
|
7
7
|
title: string
|
|
8
8
|
srButtonText?: string
|
|
9
9
|
}
|
package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
CHANGED
|
@@ -24,7 +24,7 @@ export default function CarouselControls({
|
|
|
24
24
|
aria-label={t('carousel.controls.previous')}
|
|
25
25
|
onClick={handlePrevious}
|
|
26
26
|
>
|
|
27
|
-
<Icon name="arrowLeft" size="16" />
|
|
27
|
+
<Icon name="arrowLeft" size="16" alt="" />
|
|
28
28
|
</button>
|
|
29
29
|
{children}
|
|
30
30
|
<button
|
|
@@ -32,7 +32,7 @@ export default function CarouselControls({
|
|
|
32
32
|
aria-label={t('carousel.controls.next')}
|
|
33
33
|
onClick={handleNext}
|
|
34
34
|
>
|
|
35
|
-
<Icon name="arrowRight" size="16" />
|
|
35
|
+
<Icon name="arrowRight" size="16" alt="" />
|
|
36
36
|
</button>
|
|
37
37
|
</div>
|
|
38
38
|
)
|
|
@@ -119,7 +119,7 @@ const ChoicePrompt = ({ event, children, ...props }) => {
|
|
|
119
119
|
{showOptions
|
|
120
120
|
? t('message.choicePrompts.cancelChooseAgain')
|
|
121
121
|
: t('message.choicePrompts.chooseAgain')}
|
|
122
|
-
<Icon name="chevronDown" size="8" />
|
|
122
|
+
<Icon name="chevronDown" size="8" alt="" />
|
|
123
123
|
</button>
|
|
124
124
|
)}
|
|
125
125
|
{showOptions && (
|
|
@@ -24,7 +24,7 @@ const ImageLightbox = ({ description, url }) => {
|
|
|
24
24
|
onClick={onOpenLightboxHandler}
|
|
25
25
|
>
|
|
26
26
|
{t('message.image.srTextEnlargeButtonLabel', { description })}
|
|
27
|
-
<Icon name="enlarge" size="32" />
|
|
27
|
+
<Icon name="enlarge" size="32" alt="" />
|
|
28
28
|
</button>
|
|
29
29
|
{showLightBox && (
|
|
30
30
|
<Lightbox
|
|
@@ -31,7 +31,12 @@ export default function EventDivider({
|
|
|
31
31
|
{hasGraphic && (
|
|
32
32
|
<span className={className('divider__graphic')}>
|
|
33
33
|
{iconName ? (
|
|
34
|
-
<Icon
|
|
34
|
+
<Icon
|
|
35
|
+
name={iconName}
|
|
36
|
+
size={iconSize}
|
|
37
|
+
className={iconClassName}
|
|
38
|
+
alt=""
|
|
39
|
+
/>
|
|
35
40
|
) : (
|
|
36
41
|
<img
|
|
37
42
|
src={graphicSrc}
|
|
@@ -71,21 +71,26 @@ const SeamlyEventSubscriber = () => {
|
|
|
71
71
|
}, [api, api.connectionInfo, api.conversation.socket, dispatch])
|
|
72
72
|
|
|
73
73
|
useEffect(() => {
|
|
74
|
-
api.conversation.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
74
|
+
if (api.connectionInfo && api.conversation.socket) {
|
|
75
|
+
api.conversation.onConnection(({ currentState }) => {
|
|
76
|
+
if (currentState === 'join_channel_erred') {
|
|
77
|
+
const seamlyGeneralError = new SeamlyGeneralError()
|
|
78
|
+
dispatch(
|
|
79
|
+
setInterrupt({
|
|
80
|
+
name: seamlyGeneralError.name,
|
|
81
|
+
message: seamlyGeneralError.message,
|
|
82
|
+
langKey: seamlyGeneralError.langKey,
|
|
83
|
+
originalEvent: seamlyGeneralError.originalEvent,
|
|
84
|
+
originalError: seamlyGeneralError.originalError,
|
|
85
|
+
action: seamlyGeneralError.action,
|
|
86
|
+
}),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
return true
|
|
90
|
+
}
|
|
91
|
+
return false
|
|
92
|
+
})
|
|
93
|
+
}
|
|
89
94
|
}, [api, api.connectionInfo, api.conversation.channel, dispatch])
|
|
90
95
|
|
|
91
96
|
useEffect(() => {
|
|
@@ -66,7 +66,7 @@ export default function FileInput({
|
|
|
66
66
|
])}
|
|
67
67
|
>
|
|
68
68
|
<label htmlFor={id} className={className('upload__label')}>
|
|
69
|
-
<Icon name="upload" size="32" />
|
|
69
|
+
<Icon name="upload" size="32" alt="" />
|
|
70
70
|
<div>
|
|
71
71
|
<span className={className(['upload__label--text'])}>
|
|
72
72
|
{labelText}
|
|
@@ -27,44 +27,81 @@ import { className as classNameFn } from 'lib/css'
|
|
|
27
27
|
|
|
28
28
|
/* eslint-enable import/no-webpack-loader-syntax */
|
|
29
29
|
|
|
30
|
-
const ICONS = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
30
|
+
export const ICONS = {
|
|
31
|
+
send: {
|
|
32
|
+
32: iconSend32,
|
|
33
|
+
},
|
|
34
|
+
balloon: {
|
|
35
|
+
32: iconBalloon32,
|
|
36
|
+
},
|
|
37
|
+
newTopic: {
|
|
38
|
+
32: iconNewTopic32,
|
|
39
|
+
},
|
|
40
|
+
newTranslation: {
|
|
41
|
+
16: iconNewTranslation16,
|
|
42
|
+
32: iconNewTranslation32,
|
|
43
|
+
},
|
|
44
|
+
avatar: {
|
|
45
|
+
32: iconAvatar32,
|
|
46
|
+
},
|
|
47
|
+
chevronDown: {
|
|
48
|
+
8: iconChevronDown8,
|
|
49
|
+
32: iconChevronDown32,
|
|
50
|
+
},
|
|
51
|
+
chevronRight: {
|
|
52
|
+
8: iconChevronRight8,
|
|
53
|
+
16: iconChevronRight16,
|
|
54
|
+
},
|
|
55
|
+
close: {
|
|
56
|
+
8: iconClose8,
|
|
57
|
+
16: iconClose16,
|
|
58
|
+
},
|
|
59
|
+
enlarge: {
|
|
60
|
+
32: iconEnlarge32,
|
|
61
|
+
},
|
|
62
|
+
options: {
|
|
63
|
+
32: iconOptions32,
|
|
64
|
+
},
|
|
65
|
+
file: {
|
|
66
|
+
32: iconFile32,
|
|
67
|
+
},
|
|
68
|
+
upload: {
|
|
69
|
+
32: iconUpload32,
|
|
70
|
+
},
|
|
71
|
+
download: {
|
|
72
|
+
16: iconDownload16,
|
|
73
|
+
},
|
|
74
|
+
error: {
|
|
75
|
+
16: iconError16,
|
|
76
|
+
},
|
|
77
|
+
arrowLeft: {
|
|
78
|
+
16: iconArrowLeft16,
|
|
79
|
+
},
|
|
80
|
+
arrowRight: {
|
|
81
|
+
16: iconArrowRight16,
|
|
82
|
+
},
|
|
83
|
+
check: {
|
|
84
|
+
16: iconCheck16,
|
|
85
|
+
32: iconCheck32,
|
|
86
|
+
},
|
|
87
|
+
} as const
|
|
57
88
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
dangerouslySetInnerHTML={{ __html: ICONS[iconName] }}
|
|
64
|
-
/>
|
|
65
|
-
{alt && <span className={classNameFn('visually-hidden')}>{alt}</span>}
|
|
66
|
-
</>
|
|
67
|
-
)
|
|
89
|
+
export type IconProps = {
|
|
90
|
+
name: keyof typeof ICONS
|
|
91
|
+
size?: '8' | '16' | '32'
|
|
92
|
+
className?: string
|
|
93
|
+
alt: string
|
|
68
94
|
}
|
|
69
95
|
|
|
96
|
+
const Icon = ({ name, size = '32', className, alt }: IconProps) => (
|
|
97
|
+
<>
|
|
98
|
+
<div
|
|
99
|
+
aria-hidden="true"
|
|
100
|
+
className={className || classNameFn('icon')}
|
|
101
|
+
dangerouslySetInnerHTML={{ __html: ICONS[name][size] }}
|
|
102
|
+
/>
|
|
103
|
+
{alt && <span className={classNameFn('visually-hidden')}>{alt}</span>}
|
|
104
|
+
</>
|
|
105
|
+
)
|
|
106
|
+
|
|
70
107
|
export default Icon
|
|
@@ -236,7 +236,7 @@ const OptionsButton = () => {
|
|
|
236
236
|
aria-expanded={multiMenu ? menuIsOpen.toString() : null}
|
|
237
237
|
aria-disabled={!multiMenu && !firstOption.available ? 'true' : null}
|
|
238
238
|
>
|
|
239
|
-
{multiMenu && <Icon name="options" size="32" />}
|
|
239
|
+
{multiMenu && <Icon name="options" size="32" alt="" />}
|
|
240
240
|
<span className={className('button__text')}>
|
|
241
241
|
{multiMenu
|
|
242
242
|
? t('options.openButtonText')
|
|
@@ -30,7 +30,7 @@ const SuggestionsItem = ({
|
|
|
30
30
|
onClick={handleClick}
|
|
31
31
|
className={className('button', 'button--primary')}
|
|
32
32
|
>
|
|
33
|
-
{hasIcon && <Icon name="chevronRight" size="8" />}
|
|
33
|
+
{hasIcon && <Icon name="chevronRight" size="8" alt="" />}
|
|
34
34
|
{question}
|
|
35
35
|
</button>
|
|
36
36
|
</li>
|
|
@@ -66,7 +66,7 @@ const Lightbox = ({ url, description, onClose: onCloseHandler }) => {
|
|
|
66
66
|
className={className('modal__close')}
|
|
67
67
|
onClick={onClose}
|
|
68
68
|
>
|
|
69
|
-
<Icon name="close" size="16" />
|
|
69
|
+
<Icon name="close" size="16" alt="" />
|
|
70
70
|
{t('lightbox.closeLabel')}
|
|
71
71
|
</button>
|
|
72
72
|
</div>
|
|
@@ -18,15 +18,15 @@
|
|
|
18
18
|
.#{$n}-card__content {
|
|
19
19
|
display: flex;
|
|
20
20
|
flex: 1 1 auto;
|
|
21
|
-
flex-
|
|
21
|
+
flex-direction: column;
|
|
22
22
|
gap: $spacer * 0.5;
|
|
23
23
|
padding: $spacer * 0.5 $spacer * 0.75 $spacer * 0.75;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
.#{$n}-card__title {
|
|
27
27
|
display: block;
|
|
28
|
-
flex: 0 0 100%;
|
|
29
28
|
width: 100%;
|
|
29
|
+
height: fit-content;
|
|
30
30
|
margin: 0;
|
|
31
31
|
padding: 0;
|
|
32
32
|
font-size: $fontsize-default;
|
|
@@ -36,12 +36,13 @@
|
|
|
36
36
|
.#{$n}-card__description {
|
|
37
37
|
display: block;
|
|
38
38
|
width: 100%;
|
|
39
|
+
height: fit-content;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
.#{$n}-card__content .#{$n}-button {
|
|
42
43
|
display: block;
|
|
43
|
-
align-self: flex-end;
|
|
44
44
|
width: 100%;
|
|
45
|
+
margin-top: auto;
|
|
45
46
|
font-weight: $fontweight-bold;
|
|
46
47
|
text-decoration: none;
|
|
47
48
|
}
|