@seamly/web-ui 24.5.0-beta.1 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/index.debug.js +2077 -1786
- 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 +49 -7
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +695 -384
- 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.LICENSE.txt +16 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +305 -93
- 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/package.json +27 -38
- package/src/javascripts/core/api/api.types.ts +3 -0
- package/src/javascripts/core/api/asyncapi.types.ts +292 -69
- package/src/javascripts/core/api/channel.types.ts +301 -69
- package/src/javascripts/core/api/conversation-connector.ts +1 -3
- package/src/javascripts/core/api/errors/seamly-api-error.ts +0 -1
- package/src/javascripts/core/api/errors/seamly-base-error.ts +1 -1
- package/src/javascripts/core/api/index.ts +7 -7
- package/src/javascripts/core/api/utils.ts +0 -1
- package/src/javascripts/core/domains/app/actions.ts +1 -1
- package/src/javascripts/core/domains/app/hooks.ts +1 -1
- package/src/javascripts/core/domains/config/hooks.ts +1 -1
- package/src/javascripts/core/domains/config/selectors.ts +1 -1
- package/src/javascripts/core/domains/config/slice.ts +2 -2
- package/src/javascripts/core/domains/forms/context.ts +1 -1
- package/src/javascripts/core/domains/forms/hooks.ts +12 -12
- package/src/javascripts/core/domains/forms/provider.tsx +9 -9
- package/src/javascripts/core/domains/i18n/actions.ts +1 -1
- package/src/javascripts/core/domains/i18n/hooks.ts +3 -3
- package/src/javascripts/core/domains/interrupt/hooks.ts +1 -1
- package/src/javascripts/core/domains/store/index.ts +2 -2
- package/src/javascripts/core/domains/store/slice.ts +46 -34
- package/src/javascripts/core/domains/store/store.types.ts +2 -7
- package/src/javascripts/core/domains/translations/components/options-button.tsx +2 -2
- package/src/javascripts/core/domains/translations/components/options-dialog/index.tsx +1 -1
- package/src/javascripts/core/domains/translations/components/options-dialog/translation-option.tsx +1 -1
- package/src/javascripts/core/domains/translations/components/options-dialog/translation-options.tsx +2 -2
- package/src/javascripts/core/domains/translations/components/translation-status.tsx +1 -1
- package/src/javascripts/core/domains/translations/hooks.ts +2 -2
- package/src/javascripts/core/domains/translations/middleware.ts +4 -2
- package/src/javascripts/core/domains/visibility/actions.ts +2 -2
- package/src/javascripts/core/domains/visibility/hooks.ts +5 -5
- package/src/javascripts/core/lib/debug.ts +1 -1
- package/src/javascripts/core/lib/engine/index.tsx +5 -5
- package/src/javascripts/core/lib/external-api/index.ts +6 -6
- package/src/javascripts/core/lib/mutex.ts +0 -1
- package/src/javascripts/core/lib/split-url-params.ts +1 -1
- package/src/javascripts/core/lib/store/index.ts +0 -1
- package/src/javascripts/core/lib/store/providers/app-storage.js +4 -7
- package/src/javascripts/core/lib/store/providers/app-storage.ts +4 -6
- package/src/javascripts/core/ui/components/app-options/index.tsx +1 -1
- package/src/javascripts/core/ui/components/chat-status/index.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/component-filter.tsx +1 -3
- package/src/javascripts/core/ui/components/conversation/event/card-component.tsx +3 -3
- package/src/javascripts/core/ui/components/conversation/event/carousel-component/components/pagination.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/carousel-component/index.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/chat-scroll/chat-scroll-provider.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/choice-prompt.tsx +4 -4
- package/src/javascripts/core/ui/components/conversation/event/conversation-suggestions.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/divider/variants/new-translation.tsx +3 -3
- package/src/javascripts/core/ui/components/conversation/event/divider/variants/time-indicator.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/event-participant.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/event.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/image-lightbox.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/image.tsx +2 -2
- package/src/javascripts/core/ui/components/conversation/event/participant.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/event/splash.tsx +0 -1
- package/src/javascripts/core/ui/components/conversation/event/text.tsx +2 -2
- package/src/javascripts/core/ui/components/conversation/event/upload.tsx +3 -3
- package/src/javascripts/core/ui/components/conversation/event/video.tsx +2 -2
- package/src/javascripts/core/ui/components/conversation/event-divider.tsx +1 -1
- package/src/javascripts/core/ui/components/conversation/message-container.tsx +2 -4
- package/src/javascripts/core/ui/components/conversation/use-chat-scroll.ts +3 -3
- package/src/javascripts/core/ui/components/core/seamly-activity-monitor.tsx +1 -1
- package/src/javascripts/core/ui/components/core/seamly-api-context.ts +1 -1
- package/src/javascripts/core/ui/components/core/seamly-core.tsx +3 -3
- package/src/javascripts/core/ui/components/core/seamly-event-subscriber.ts +9 -7
- package/src/javascripts/core/ui/components/core/seamly-file-upload.tsx +2 -3
- package/src/javascripts/core/ui/components/core/seamly-initializer.tsx +1 -1
- package/src/javascripts/core/ui/components/core/seamly-instance-functions-loader.ts +3 -3
- package/src/javascripts/core/ui/components/core/seamly-live-region.tsx +1 -1
- package/src/javascripts/core/ui/components/core/seamly-new-notifications.ts +1 -1
- package/src/javascripts/core/ui/components/core/seamly-read-state.ts +1 -1
- package/src/javascripts/core/ui/components/entry/entry-container.tsx +8 -3
- package/src/javascripts/core/ui/components/entry/text-entry/hooks.ts +21 -14
- package/src/javascripts/core/ui/components/entry/text-entry/index.tsx +1 -1
- package/src/javascripts/core/ui/components/entry/text-entry/text-entry-form.tsx +1 -1
- package/src/javascripts/core/ui/components/entry/upload/file-upload-form.tsx +1 -1
- package/src/javascripts/core/ui/components/entry/upload/index.tsx +1 -1
- package/src/javascripts/core/ui/components/entry/upload-toggle.tsx +1 -1
- package/src/javascripts/core/ui/components/form-controls/error.tsx +1 -1
- package/src/javascripts/core/ui/components/form-controls/file-input.tsx +1 -1
- package/src/javascripts/core/ui/components/form-controls/input.tsx +1 -1
- package/src/javascripts/core/ui/components/form-controls/wrapper.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/agent-info.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/chat-frame.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/chat.tsx +2 -2
- package/src/javascripts/core/ui/components/layout/continue-chat-messages.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/header.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/interrupt.tsx +1 -1
- package/src/javascripts/core/ui/components/layout/pre-chat-messages.tsx +1 -1
- package/src/javascripts/core/ui/components/options/options-button.tsx +1 -3
- package/src/javascripts/core/ui/components/options/options-frame.tsx +1 -1
- package/src/javascripts/core/ui/components/options/transcript/index.tsx +1 -1
- package/src/javascripts/core/ui/components/suggestions/index.tsx +2 -2
- package/src/javascripts/core/ui/components/suggestions/suggestions-list.tsx +1 -1
- package/src/javascripts/core/ui/components/view/index.tsx +3 -3
- package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +2 -2
- package/src/javascripts/core/ui/components/widgets/in-out-transition.tsx +2 -2
- package/src/javascripts/core/ui/components/widgets/lightbox.tsx +1 -1
- package/src/javascripts/core/ui/hooks/file-upload-hooks.ts +1 -1
- package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +1 -1
- package/src/javascripts/core/ui/hooks/seamly-entry-hooks.ts +1 -1
- package/src/javascripts/core/ui/hooks/seamly-option-hooks.ts +1 -1
- package/src/javascripts/core/ui/hooks/seamly-state-hooks.ts +9 -4
- package/src/javascripts/core/ui/hooks/use-debounce.ts +1 -1
- package/src/javascripts/core/ui/hooks/use-interval.ts +0 -1
- package/src/javascripts/core/ui/hooks/use-notifications.ts +2 -3
- package/src/javascripts/core/ui/hooks/use-seamly-chat.ts +2 -2
- package/src/javascripts/core/ui/hooks/use-seamly-commands.ts +2 -2
- package/src/javascripts/core/ui/hooks/use-seamly-conversation.ts +1 -1
- package/src/javascripts/core/ui/hooks/use-seamly-idle-detach-countdown.ts +15 -10
- package/src/javascripts/core/ui/hooks/use-session-expired-command.ts +1 -1
- package/src/javascripts/core/ui/hooks/use-single-file-upload.ts +1 -1
- package/src/javascripts/core/ui/hooks/utility-hooks.ts +1 -2
- package/src/javascripts/core/ui/utils/seamly-utils.ts +0 -2
- package/src/javascripts/core/ui/utils/validations.ts +1 -2
- package/src/javascripts/style-guide/components/app.tsx +2 -2
- package/src/javascripts/style-guide/components/static-core.tsx +2 -2
- package/src/javascripts/style-guide/components/view.tsx +1 -1
- package/src/javascripts/style-guide/state-helpers/index.ts +0 -2
- package/src/javascripts/style-guide/states.ts +5 -42
- package/src/javascripts/style-guide/style-guide-engine.tsx +1 -1
- package/src/stylesheets/5-components/_message-body.scss +0 -10
- package/src/stylesheets/6-default-implementation/_hover.scss +0 -7
- package/src/stylesheets/styles.scss +0 -1
- package/webpack/config.common.js +4 -11
- package/webpack/config.dev.js +0 -1
- package/webpack/config.package.js +5 -7
- package/webpack/config.site.js +2 -4
- package/webpack/config.test.js +1 -2
- package/webpack/defaults.js +0 -1
- package/webpack/parts/babel-loader-browser-plugins.js +0 -1
- package/webpack/parts/dev-server.js +0 -1
- package/src/javascripts/core/ui/components/conversation/event/cta.tsx +0 -54
- package/src/stylesheets/5-components/_message-cta.scss +0 -17
|
@@ -359,32 +359,6 @@ const splashMessage = {
|
|
|
359
359
|
},
|
|
360
360
|
}
|
|
361
361
|
|
|
362
|
-
const ctaMessage = {
|
|
363
|
-
type: 'message',
|
|
364
|
-
payload: {
|
|
365
|
-
body: {
|
|
366
|
-
description:
|
|
367
|
-
'Thanks for chatting!\n\nMore info about our <strong>products</strong>?',
|
|
368
|
-
buttonLink: 'https://seamly.ai',
|
|
369
|
-
buttonText: 'View website',
|
|
370
|
-
buttonNewTab: true,
|
|
371
|
-
},
|
|
372
|
-
type: 'cta',
|
|
373
|
-
fromClient: false,
|
|
374
|
-
fromHistory: true,
|
|
375
|
-
id: 'f5351010-0def-452d-818f-ca22ac61792z',
|
|
376
|
-
messageStatus: 'read',
|
|
377
|
-
participant: 'agent',
|
|
378
|
-
service: {
|
|
379
|
-
meta: { additions: { hideFeedback: 'true' } },
|
|
380
|
-
name: 'bot',
|
|
381
|
-
serviceSessionId: '3942159e-9878-469e-9120-f44fd6be0f35',
|
|
382
|
-
},
|
|
383
|
-
transactionId: 'd0cc13da-337a-4108-9db1-cb8a3b3a1446',
|
|
384
|
-
transactionLast: false,
|
|
385
|
-
},
|
|
386
|
-
}
|
|
387
|
-
|
|
388
362
|
const longTextMessage = {
|
|
389
363
|
type: 'message',
|
|
390
364
|
payload: {
|
|
@@ -1103,7 +1077,6 @@ const standardState = {
|
|
|
1103
1077
|
textMesageWithBullets,
|
|
1104
1078
|
textMesageWithOrderedList,
|
|
1105
1079
|
choicePromptMessage,
|
|
1106
|
-
ctaMessage,
|
|
1107
1080
|
],
|
|
1108
1081
|
},
|
|
1109
1082
|
userMessages: {
|
|
@@ -1151,14 +1124,6 @@ const standardState = {
|
|
|
1151
1124
|
textMesageWithOrderedList,
|
|
1152
1125
|
],
|
|
1153
1126
|
},
|
|
1154
|
-
ctaMessages: {
|
|
1155
|
-
category: categoryKeys.messages,
|
|
1156
|
-
headingText: 'CTA (call to action) messages',
|
|
1157
|
-
description: '',
|
|
1158
|
-
...baseState,
|
|
1159
|
-
participantInfo,
|
|
1160
|
-
events: [ctaMessage],
|
|
1161
|
-
},
|
|
1162
1127
|
imageVideoMessages: {
|
|
1163
1128
|
category: categoryKeys.messages,
|
|
1164
1129
|
headingText: 'Download, image and video messages',
|
|
@@ -1888,7 +1853,6 @@ const standardState = {
|
|
|
1888
1853
|
textMesageWithBullets,
|
|
1889
1854
|
textMesageWithOrderedList,
|
|
1890
1855
|
choicePromptMessage,
|
|
1891
|
-
ctaMessage,
|
|
1892
1856
|
newTranslationDividerStop,
|
|
1893
1857
|
].map(addTranslationData),
|
|
1894
1858
|
translations: {
|
|
@@ -1928,7 +1892,6 @@ const standardState = {
|
|
|
1928
1892
|
textMesageWithBullets,
|
|
1929
1893
|
textMesageWithOrderedList,
|
|
1930
1894
|
choicePromptMessage,
|
|
1931
|
-
ctaMessage,
|
|
1932
1895
|
].map((p) => p.payload.id),
|
|
1933
1896
|
},
|
|
1934
1897
|
languages: [
|
|
@@ -2041,7 +2004,7 @@ const inlineInterface = {
|
|
|
2041
2004
|
},
|
|
2042
2005
|
minimizedInlinePrechat: {
|
|
2043
2006
|
category: categoryKeys.minimizedInline,
|
|
2044
|
-
headingText: 'Inline minimized with
|
|
2007
|
+
headingText: 'Inline minimized with collapsed chat messages',
|
|
2045
2008
|
description: '',
|
|
2046
2009
|
inline: {
|
|
2047
2010
|
...baseState,
|
|
@@ -2058,7 +2021,7 @@ const inlineInterface = {
|
|
|
2058
2021
|
},
|
|
2059
2022
|
minimizedInlinePrechatSuggestions: {
|
|
2060
2023
|
category: categoryKeys.minimizedInline,
|
|
2061
|
-
headingText: 'Inline minimized with
|
|
2024
|
+
headingText: 'Inline minimized with collapsed chat messages & suggestions',
|
|
2062
2025
|
description: '',
|
|
2063
2026
|
inline: {
|
|
2064
2027
|
...baseState,
|
|
@@ -2248,7 +2211,7 @@ export const getStateObj = (layoutModes, customComponentEventBodies) => {
|
|
|
2248
2211
|
...standardWindowStates,
|
|
2249
2212
|
minimizedWindowPrechat: {
|
|
2250
2213
|
category: categoryKeys.minimizedWindow,
|
|
2251
|
-
headingText: 'Minimized with
|
|
2214
|
+
headingText: 'Minimized with collapsed chat messages',
|
|
2252
2215
|
description: '',
|
|
2253
2216
|
window: {
|
|
2254
2217
|
...baseState,
|
|
@@ -2267,7 +2230,7 @@ export const getStateObj = (layoutModes, customComponentEventBodies) => {
|
|
|
2267
2230
|
},
|
|
2268
2231
|
minimizedWindowPrechatDelayed: {
|
|
2269
2232
|
category: categoryKeys.minimizedWindow,
|
|
2270
|
-
headingText: 'Minimized with delayed
|
|
2233
|
+
headingText: 'Minimized with delayed collapsed chat messages',
|
|
2271
2234
|
description: '',
|
|
2272
2235
|
window: {
|
|
2273
2236
|
...baseState,
|
|
@@ -2290,7 +2253,7 @@ export const getStateObj = (layoutModes, customComponentEventBodies) => {
|
|
|
2290
2253
|
},
|
|
2291
2254
|
minimizedWindowPrechatDisabled: {
|
|
2292
2255
|
category: categoryKeys.minimizedWindow,
|
|
2293
|
-
headingText: 'Minimized with disabled
|
|
2256
|
+
headingText: 'Minimized with disabled collapsed chat messages',
|
|
2294
2257
|
description: '',
|
|
2295
2258
|
window: {
|
|
2296
2259
|
...baseState,
|
|
@@ -212,16 +212,6 @@
|
|
|
212
212
|
line-height: 1.35;
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
// CTA
|
|
216
|
-
.#{$n}-message--type-cta .#{$n}-message__body {
|
|
217
|
-
display: flex;
|
|
218
|
-
flex-direction: column;
|
|
219
|
-
gap: $spacer * 0.5;
|
|
220
|
-
width: 100%;
|
|
221
|
-
padding: $spacer * 0.75;
|
|
222
|
-
background-color: $brand2;
|
|
223
|
-
}
|
|
224
|
-
|
|
225
215
|
// Cards
|
|
226
216
|
.#{$n}-message--type-card .#{$n}-message__body {
|
|
227
217
|
display: flex;
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
@import '5-components/message-translation-info';
|
|
22
22
|
@import '5-components/message-card';
|
|
23
23
|
@import '5-components/message-carousel';
|
|
24
|
-
@import '5-components/message-cta';
|
|
25
24
|
@import '5-components/icon';
|
|
26
25
|
@import '5-components/form';
|
|
27
26
|
@import '5-components/input';
|
package/webpack/config.common.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
const path = require('path')
|
|
3
|
-
const webpack = require('webpack')
|
|
4
|
-
const webpackMerge = require('webpack-merge').merge
|
|
5
2
|
const { styleScssLoaders } = require('@seamly/doc-site/lib/config/site')
|
|
6
|
-
const BundleAnalyzerPlugin =
|
|
7
|
-
require('webpack-bundle-analyzer').BundleAnalyzerPlugin
|
|
8
3
|
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
|
4
|
+
const webpack = require('webpack')
|
|
5
|
+
const webpackMerge = require('webpack-merge').merge
|
|
9
6
|
|
|
7
|
+
const defaultConfig = require('./defaults')
|
|
10
8
|
const generateBabelLoaderBrowserPluginsPart = require('./parts/babel-loader-browser-plugins')
|
|
9
|
+
const babelLoaderPresets = require('./parts/babel-loader-presets')
|
|
11
10
|
const generateDevServerPart = require('./parts/dev-server')
|
|
12
11
|
// Paths
|
|
13
|
-
const defaultConfig = require('./defaults')
|
|
14
|
-
const babelLoaderPresets = require('./parts/babel-loader-presets')
|
|
15
12
|
|
|
16
13
|
module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
17
14
|
const implConfig = {
|
|
@@ -48,10 +45,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
|
|
|
48
45
|
new ForkTsCheckerWebpackPlugin(),
|
|
49
46
|
]
|
|
50
47
|
|
|
51
|
-
if (env.analyze) {
|
|
52
|
-
plugins.push(new BundleAnalyzerPlugin())
|
|
53
|
-
}
|
|
54
|
-
|
|
55
48
|
let config = {
|
|
56
49
|
plugins,
|
|
57
50
|
output: {
|
package/webpack/config.dev.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
const webpackDefinePlugin = require('webpack').DefinePlugin
|
|
3
|
-
const webpackMerge = require('webpack-merge').merge
|
|
4
|
-
const SourceMapDevToolPlugin = require('webpack').SourceMapDevToolPlugin
|
|
5
1
|
const path = require('path')
|
|
6
2
|
const { assetScssLoaders } = require('@seamly/doc-site/lib/config/site')
|
|
3
|
+
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
|
4
|
+
const webpackDefinePlugin = require('webpack').DefinePlugin
|
|
5
|
+
const SourceMapDevToolPlugin = require('webpack').SourceMapDevToolPlugin
|
|
6
|
+
const webpackMerge = require('webpack-merge').merge
|
|
7
7
|
const defaultConfig = require('./defaults')
|
|
8
8
|
const generateBabelLoaderPluginsPart = require('./parts/babel-loader-plugins')
|
|
9
|
-
const generateBabelLoaderBrowserPluginsPart = require('./parts/babel-loader-browser-plugins')
|
|
10
|
-
const ForkTsCheckerWebpackPlugin = require('fork-ts-checker-webpack-plugin')
|
|
11
9
|
const babelLoaderPresets = require('./parts/babel-loader-presets')
|
|
12
10
|
|
|
13
|
-
module.exports = (
|
|
11
|
+
module.exports = (configOverrides = {}) => {
|
|
14
12
|
const implConfig = {
|
|
15
13
|
...defaultConfig,
|
|
16
14
|
...configOverrides,
|
package/webpack/config.site.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
const path = require('path')
|
|
3
2
|
const site = require('@seamly/doc-site/lib/config/site')
|
|
4
3
|
const CopyPlugin = require('copy-webpack-plugin')
|
|
5
4
|
const webpackMerge = require('webpack-merge').merge
|
|
6
|
-
const defaultConfig = require('./defaults')
|
|
7
5
|
const generateCommonConfig = require('./config.common')
|
|
6
|
+
const defaultConfig = require('./defaults')
|
|
8
7
|
|
|
9
8
|
const defaultOptions = {
|
|
10
9
|
mergeCommon: true,
|
|
@@ -21,8 +20,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}, options = {}) => {
|
|
|
21
20
|
...options,
|
|
22
21
|
}
|
|
23
22
|
|
|
24
|
-
const { ROOT, PUBLIC_ROOT, PUBLIC_TEST_ROOT
|
|
25
|
-
implConfig
|
|
23
|
+
const { ROOT, PUBLIC_ROOT, PUBLIC_TEST_ROOT } = implConfig
|
|
26
24
|
|
|
27
25
|
let config = {
|
|
28
26
|
plugins: [
|
package/webpack/config.test.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
1
|
const path = require('path')
|
|
3
2
|
const site = require('@seamly/doc-site/lib/config/site')
|
|
4
3
|
const webpackMerge = require('webpack-merge').merge
|
|
5
|
-
const defaultConfig = require('./defaults')
|
|
6
4
|
const generateCommonConfig = require('./config.common')
|
|
5
|
+
const defaultConfig = require('./defaults')
|
|
7
6
|
|
|
8
7
|
const defaultOptions = {
|
|
9
8
|
mergeCommon: true,
|
package/webpack/defaults.js
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'preact/hooks'
|
|
2
|
-
import { MessageCTA } from 'domains/store/store.types'
|
|
3
|
-
import { useTranslatedEventData } from 'domains/translations/hooks'
|
|
4
|
-
import { className } from 'lib/css'
|
|
5
|
-
import MessageContainer from 'ui/components/conversation/message-container'
|
|
6
|
-
import { useGeneratedId, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
7
|
-
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
8
|
-
import useEventLinkClickHandler from './hooks/use-event-link-click-handler'
|
|
9
|
-
|
|
10
|
-
const Cta = ({ event }: { event: MessageCTA }) => {
|
|
11
|
-
const { body } = useTranslatedEventData(event)
|
|
12
|
-
const eventClick = useEventLinkClickHandler({
|
|
13
|
-
originMessage: event.payload.id,
|
|
14
|
-
transactionId: event.payload.transactionId,
|
|
15
|
-
})
|
|
16
|
-
const { emitEvent } = useSeamlyCommands()
|
|
17
|
-
|
|
18
|
-
const descriptionId = useGeneratedId()
|
|
19
|
-
const onClickHandler = useCallback(
|
|
20
|
-
() =>
|
|
21
|
-
emitEvent(`action.${actionTypes.clickCta}`, {
|
|
22
|
-
type: actionTypes.clickCta,
|
|
23
|
-
originMessage: event.payload.id,
|
|
24
|
-
link: {
|
|
25
|
-
url: body?.buttonLink,
|
|
26
|
-
},
|
|
27
|
-
}),
|
|
28
|
-
[emitEvent, body, event],
|
|
29
|
-
)
|
|
30
|
-
return (
|
|
31
|
-
<MessageContainer type="cta" event={event}>
|
|
32
|
-
<div
|
|
33
|
-
className={className('cta__content')}
|
|
34
|
-
id={descriptionId}
|
|
35
|
-
dangerouslySetInnerHTML={
|
|
36
|
-
body?.description ? { __html: body.description } : undefined
|
|
37
|
-
}
|
|
38
|
-
onClick={eventClick}
|
|
39
|
-
/>
|
|
40
|
-
<a
|
|
41
|
-
className={className('button', 'button--primary')}
|
|
42
|
-
aria-describedby={descriptionId}
|
|
43
|
-
href={body?.buttonLink}
|
|
44
|
-
rel="noreferrer"
|
|
45
|
-
target={body?.buttonNewTab ? '_blank' : '_self'}
|
|
46
|
-
onClick={onClickHandler}
|
|
47
|
-
>
|
|
48
|
-
{body?.buttonText}
|
|
49
|
-
</a>
|
|
50
|
-
</MessageContainer>
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export default Cta
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.#{$n}-cta__content {
|
|
2
|
-
color: $white;
|
|
3
|
-
font-size: $fontsize-medium;
|
|
4
|
-
line-height: 1.5;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
.#{$n}-cta__content p {
|
|
8
|
-
color: inherit;
|
|
9
|
-
font-family: inherit;
|
|
10
|
-
font-size: inherit;
|
|
11
|
-
font-weight: inherit;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.#{$n}-message--type-cta .#{$n}-button {
|
|
15
|
-
line-height: 2;
|
|
16
|
-
text-decoration: none;
|
|
17
|
-
}
|