@seamly/web-ui 24.5.0 → 25.1.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/build/dist/lib/index.debug.js +2129 -1810
  2. package/build/dist/lib/index.debug.js.map +1 -1
  3. package/build/dist/lib/index.debug.min.js +1 -1
  4. package/build/dist/lib/index.debug.min.js.LICENSE.txt +49 -7
  5. package/build/dist/lib/index.debug.min.js.map +1 -1
  6. package/build/dist/lib/index.js +732 -398
  7. package/build/dist/lib/index.js.map +1 -1
  8. package/build/dist/lib/index.min.js +1 -1
  9. package/build/dist/lib/index.min.js.LICENSE.txt +16 -1
  10. package/build/dist/lib/index.min.js.map +1 -1
  11. package/build/dist/lib/style-guide.js +305 -93
  12. package/build/dist/lib/style-guide.js.map +1 -1
  13. package/build/dist/lib/style-guide.min.js +1 -1
  14. package/build/dist/lib/style-guide.min.js.map +1 -1
  15. package/build/dist/lib/styles-default-implementation.css +1 -1
  16. package/build/dist/lib/styles.css +1 -1
  17. package/package.json +27 -38
  18. package/src/javascripts/core/api/api.types.ts +3 -0
  19. package/src/javascripts/core/api/asyncapi.types.ts +292 -69
  20. package/src/javascripts/core/api/channel.types.ts +301 -69
  21. package/src/javascripts/core/api/conversation-connector.ts +1 -3
  22. package/src/javascripts/core/api/errors/seamly-api-error.ts +0 -1
  23. package/src/javascripts/core/api/errors/seamly-base-error.ts +1 -1
  24. package/src/javascripts/core/api/index.ts +7 -7
  25. package/src/javascripts/core/api/utils.ts +0 -1
  26. package/src/javascripts/core/domains/app/actions.ts +1 -1
  27. package/src/javascripts/core/domains/app/hooks.ts +1 -1
  28. package/src/javascripts/core/domains/config/hooks.ts +1 -1
  29. package/src/javascripts/core/domains/config/selectors.ts +1 -1
  30. package/src/javascripts/core/domains/config/slice.ts +2 -2
  31. package/src/javascripts/core/domains/forms/context.ts +1 -1
  32. package/src/javascripts/core/domains/forms/hooks.ts +12 -12
  33. package/src/javascripts/core/domains/forms/provider.tsx +9 -9
  34. package/src/javascripts/core/domains/i18n/actions.ts +1 -1
  35. package/src/javascripts/core/domains/i18n/hooks.ts +3 -3
  36. package/src/javascripts/core/domains/interrupt/hooks.ts +1 -1
  37. package/src/javascripts/core/domains/store/index.ts +2 -2
  38. package/src/javascripts/core/domains/store/slice.ts +47 -34
  39. package/src/javascripts/core/domains/store/store.types.ts +3 -7
  40. package/src/javascripts/core/domains/translations/components/options-button.tsx +2 -2
  41. package/src/javascripts/core/domains/translations/components/options-dialog/index.tsx +1 -1
  42. package/src/javascripts/core/domains/translations/components/options-dialog/translation-option.tsx +1 -1
  43. package/src/javascripts/core/domains/translations/components/options-dialog/translation-options.tsx +2 -2
  44. package/src/javascripts/core/domains/translations/components/translation-status.tsx +1 -1
  45. package/src/javascripts/core/domains/translations/hooks.ts +2 -2
  46. package/src/javascripts/core/domains/translations/middleware.ts +4 -2
  47. package/src/javascripts/core/domains/visibility/actions.ts +2 -2
  48. package/src/javascripts/core/domains/visibility/hooks.ts +5 -5
  49. package/src/javascripts/core/lib/debug.ts +1 -1
  50. package/src/javascripts/core/lib/engine/index.tsx +5 -5
  51. package/src/javascripts/core/lib/external-api/index.ts +6 -6
  52. package/src/javascripts/core/lib/mutex.ts +0 -1
  53. package/src/javascripts/core/lib/split-url-params.ts +1 -1
  54. package/src/javascripts/core/lib/store/index.ts +0 -1
  55. package/src/javascripts/core/lib/store/providers/app-storage.js +4 -7
  56. package/src/javascripts/core/lib/store/providers/app-storage.ts +4 -6
  57. package/src/javascripts/core/ui/components/app-options/index.tsx +1 -1
  58. package/src/javascripts/core/ui/components/chat-status/index.tsx +1 -1
  59. package/src/javascripts/core/ui/components/conversation/component-filter.tsx +1 -3
  60. package/src/javascripts/core/ui/components/conversation/conversation.tsx +9 -11
  61. package/src/javascripts/core/ui/components/conversation/event/card-component.tsx +3 -3
  62. package/src/javascripts/core/ui/components/conversation/event/carousel-component/components/pagination.tsx +1 -1
  63. package/src/javascripts/core/ui/components/conversation/event/carousel-component/index.tsx +1 -1
  64. package/src/javascripts/core/ui/components/conversation/event/chat-scroll/chat-scroll-provider.tsx +1 -1
  65. package/src/javascripts/core/ui/components/conversation/event/choice-prompt.tsx +5 -5
  66. package/src/javascripts/core/ui/components/conversation/event/conversation-suggestions.tsx +1 -1
  67. package/src/javascripts/core/ui/components/conversation/event/divider/variants/new-translation.tsx +3 -3
  68. package/src/javascripts/core/ui/components/conversation/event/divider/variants/time-indicator.tsx +1 -1
  69. package/src/javascripts/core/ui/components/conversation/event/event-participant.tsx +1 -1
  70. package/src/javascripts/core/ui/components/conversation/event/event.tsx +1 -1
  71. package/src/javascripts/core/ui/components/conversation/event/image-lightbox.tsx +1 -1
  72. package/src/javascripts/core/ui/components/conversation/event/image.tsx +2 -2
  73. package/src/javascripts/core/ui/components/conversation/event/participant.tsx +1 -1
  74. package/src/javascripts/core/ui/components/conversation/event/splash.tsx +0 -1
  75. package/src/javascripts/core/ui/components/conversation/event/text.tsx +2 -2
  76. package/src/javascripts/core/ui/components/conversation/event/upload.tsx +3 -3
  77. package/src/javascripts/core/ui/components/conversation/event/video.tsx +2 -2
  78. package/src/javascripts/core/ui/components/conversation/event-divider.tsx +1 -1
  79. package/src/javascripts/core/ui/components/conversation/message-container.tsx +2 -4
  80. package/src/javascripts/core/ui/components/conversation/use-chat-scroll.ts +3 -3
  81. package/src/javascripts/core/ui/components/core/seamly-activity-monitor.tsx +1 -1
  82. package/src/javascripts/core/ui/components/core/seamly-api-context.ts +1 -1
  83. package/src/javascripts/core/ui/components/core/seamly-core.tsx +3 -3
  84. package/src/javascripts/core/ui/components/core/seamly-event-subscriber.ts +9 -7
  85. package/src/javascripts/core/ui/components/core/seamly-file-upload.tsx +2 -3
  86. package/src/javascripts/core/ui/components/core/seamly-initializer.tsx +1 -1
  87. package/src/javascripts/core/ui/components/core/seamly-instance-functions-loader.ts +3 -3
  88. package/src/javascripts/core/ui/components/core/seamly-live-region.tsx +1 -1
  89. package/src/javascripts/core/ui/components/core/seamly-new-notifications.ts +1 -1
  90. package/src/javascripts/core/ui/components/core/seamly-read-state.ts +1 -1
  91. package/src/javascripts/core/ui/components/entry/entry-container.tsx +8 -3
  92. package/src/javascripts/core/ui/components/entry/text-entry/hooks.ts +21 -14
  93. package/src/javascripts/core/ui/components/entry/text-entry/index.tsx +1 -1
  94. package/src/javascripts/core/ui/components/entry/text-entry/text-entry-form.tsx +1 -1
  95. package/src/javascripts/core/ui/components/entry/upload/file-upload-form.tsx +1 -1
  96. package/src/javascripts/core/ui/components/entry/upload/index.tsx +1 -1
  97. package/src/javascripts/core/ui/components/entry/upload-toggle.tsx +2 -1
  98. package/src/javascripts/core/ui/components/form-controls/error.tsx +1 -1
  99. package/src/javascripts/core/ui/components/form-controls/file-input.tsx +1 -1
  100. package/src/javascripts/core/ui/components/form-controls/input.tsx +1 -1
  101. package/src/javascripts/core/ui/components/form-controls/wrapper.tsx +1 -1
  102. package/src/javascripts/core/ui/components/layout/agent-info.tsx +1 -1
  103. package/src/javascripts/core/ui/components/layout/chat-frame.tsx +1 -1
  104. package/src/javascripts/core/ui/components/layout/chat.tsx +8 -6
  105. package/src/javascripts/core/ui/components/layout/continue-chat-messages.tsx +1 -1
  106. package/src/javascripts/core/ui/components/layout/header.tsx +1 -1
  107. package/src/javascripts/core/ui/components/layout/interrupt.tsx +1 -1
  108. package/src/javascripts/core/ui/components/layout/pre-chat-messages.tsx +1 -1
  109. package/src/javascripts/core/ui/components/options/options-button.tsx +1 -3
  110. package/src/javascripts/core/ui/components/options/options-frame.tsx +1 -1
  111. package/src/javascripts/core/ui/components/options/transcript/index.tsx +1 -1
  112. package/src/javascripts/core/ui/components/suggestions/index.tsx +2 -2
  113. package/src/javascripts/core/ui/components/suggestions/suggestions-list.tsx +1 -1
  114. package/src/javascripts/core/ui/components/view/index.tsx +3 -3
  115. package/src/javascripts/core/ui/components/view/window-view/collapse-button.tsx +10 -1
  116. package/src/javascripts/core/ui/components/view/window-view/window-open-button.tsx +9 -3
  117. package/src/javascripts/core/ui/components/widgets/in-out-transition.tsx +2 -2
  118. package/src/javascripts/core/ui/components/widgets/lightbox.tsx +1 -1
  119. package/src/javascripts/core/ui/hooks/file-upload-hooks.ts +1 -1
  120. package/src/javascripts/core/ui/hooks/focus-helper-hooks.ts +6 -1
  121. package/src/javascripts/core/ui/hooks/seamly-entry-hooks.ts +1 -1
  122. package/src/javascripts/core/ui/hooks/seamly-option-hooks.ts +1 -1
  123. package/src/javascripts/core/ui/hooks/seamly-state-hooks.ts +9 -4
  124. package/src/javascripts/core/ui/hooks/use-debounce.ts +1 -1
  125. package/src/javascripts/core/ui/hooks/use-interval.ts +0 -1
  126. package/src/javascripts/core/ui/hooks/use-notifications.ts +2 -3
  127. package/src/javascripts/core/ui/hooks/use-seamly-chat.ts +2 -2
  128. package/src/javascripts/core/ui/hooks/use-seamly-commands.ts +2 -2
  129. package/src/javascripts/core/ui/hooks/use-seamly-conversation.ts +1 -1
  130. package/src/javascripts/core/ui/hooks/use-seamly-idle-detach-countdown.ts +15 -10
  131. package/src/javascripts/core/ui/hooks/use-session-expired-command.ts +1 -1
  132. package/src/javascripts/core/ui/hooks/use-single-file-upload.ts +1 -1
  133. package/src/javascripts/core/ui/hooks/utility-hooks.ts +1 -2
  134. package/src/javascripts/core/ui/utils/seamly-utils.ts +0 -2
  135. package/src/javascripts/core/ui/utils/validations.ts +1 -2
  136. package/src/javascripts/style-guide/components/app.tsx +2 -2
  137. package/src/javascripts/style-guide/components/static-core.tsx +2 -2
  138. package/src/javascripts/style-guide/components/view.tsx +1 -1
  139. package/src/javascripts/style-guide/state-helpers/index.ts +0 -2
  140. package/src/javascripts/style-guide/states.ts +5 -42
  141. package/src/javascripts/style-guide/style-guide-engine.tsx +1 -1
  142. package/src/stylesheets/5-components/_message-body.scss +0 -10
  143. package/src/stylesheets/6-default-implementation/_hover.scss +0 -7
  144. package/src/stylesheets/styles.scss +0 -1
  145. package/webpack/config.common.js +4 -11
  146. package/webpack/config.dev.js +0 -1
  147. package/webpack/config.package.js +5 -7
  148. package/webpack/config.site.js +2 -4
  149. package/webpack/config.test.js +1 -2
  150. package/webpack/defaults.js +0 -1
  151. package/webpack/parts/babel-loader-browser-plugins.js +0 -1
  152. package/webpack/parts/dev-server.js +0 -1
  153. package/src/javascripts/core/ui/components/conversation/event/cta.tsx +0 -54
  154. package/src/stylesheets/5-components/_message-cta.scss +0 -17
@@ -1,4 +1,3 @@
1
- import { useCallback } from 'preact/hooks'
2
1
  import { screenReaderDebounceDelaySeconds } from 'config'
3
2
  import { useI18n } from 'domains/i18n/hooks'
4
3
  import { useAppDispatch } from 'domains/store'
@@ -9,6 +8,7 @@ import {
9
8
  stopIdleDetachCountdownCounter,
10
9
  } from 'domains/store/slice'
11
10
  import { useVisibility } from 'domains/visibility/hooks'
11
+ import { useCallback, useRef } from 'preact/hooks'
12
12
  import {
13
13
  getTimeFromSeconds,
14
14
  millisecondsToSeconds,
@@ -34,6 +34,18 @@ const useSeamlyIdleDetachCountdown = () => {
34
34
 
35
35
  const { isOpen } = useVisibility()
36
36
 
37
+ // We create a ref here, and explicitly overwrite the current values, because the
38
+ // `endCountdown` call initiated by the server has a different lifecycle from the
39
+ // `IdleDetachWarning` component.
40
+ const countdownState = useRef({
41
+ hasCountdown: false,
42
+ wasStopped: false,
43
+ })
44
+ countdownState.current = {
45
+ hasCountdown,
46
+ wasStopped: wasStopped || false,
47
+ }
48
+
37
49
  const { emitEvent, sendAction } = useSeamlyCommands()
38
50
  const { t } = useI18n()
39
51
  const { sendAssertive, sendPolite } = useLiveRegion()
@@ -81,6 +93,7 @@ const useSeamlyIdleDetachCountdown = () => {
81
93
  (_continueChat?: boolean | undefined, _isServerAction?: boolean) => void
82
94
  >(
83
95
  (continueChat = undefined, isServerAction = false) => {
96
+ const { hasCountdown, wasStopped } = countdownState.current
84
97
  if (!hasCountdown) {
85
98
  return
86
99
  }
@@ -98,15 +111,7 @@ const useSeamlyIdleDetachCountdown = () => {
98
111
 
99
112
  dispatch(clearIdleDetachCountdown())
100
113
  },
101
- [
102
- dispatch,
103
- emitEvent,
104
- hasCountdown,
105
- sendAction,
106
- sendAssertiveIfOpen,
107
- t,
108
- wasStopped,
109
- ],
114
+ [dispatch, emitEvent, sendAction, sendAssertiveIfOpen, t],
110
115
  )
111
116
 
112
117
  const decrementCountdown = useCallback(() => {
@@ -1,8 +1,8 @@
1
- import { useEffect, useRef } from 'preact/hooks'
2
1
  import SeamlyGeneralError from 'api/errors/seamly-general-error'
3
2
  import { useInterrupt } from 'domains/interrupt/hooks'
4
3
  import { setInterrupt } from 'domains/interrupt/slice'
5
4
  import { useAppDispatch } from 'domains/store'
5
+ import { useEffect, useRef } from 'preact/hooks'
6
6
  import useSeamlyCommands from './use-seamly-commands'
7
7
 
8
8
  export default function useSessionExpiredCommand() {
@@ -1,6 +1,6 @@
1
- import { useSelector } from 'react-redux'
2
1
  import { getControlValueByName } from 'domains/forms/selectors'
3
2
  import { CurrentUpload } from 'domains/store/store.types'
3
+ import { useSelector } from 'react-redux'
4
4
  import { useFileUploads } from './seamly-hooks'
5
5
 
6
6
  const useSingleFileUpload = (formId, name) => {
@@ -1,10 +1,9 @@
1
- import { useCallback, useReducer, useState } from 'preact/hooks'
2
1
  import { randomId } from 'lib/id'
2
+ import { useCallback, useReducer, useState } from 'preact/hooks'
3
3
 
4
4
  export const useForceUpdate = () => {
5
5
  // This is an escape hatch mentioned in the React docs:
6
6
  // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
7
- /* eslint-disable-next-line no-unused-vars */
8
7
  const [_, forceUpdate] = useReducer((x) => x + 1, 0)
9
8
 
10
9
  return useCallback(() => {
@@ -16,7 +16,6 @@ export const payloadTypes = {
16
16
  message: 'message',
17
17
  countdown: 'countdown',
18
18
  upload: 'upload',
19
- cta: 'cta',
20
19
  splash: 'splash',
21
20
  }
22
21
 
@@ -43,7 +42,6 @@ export const actionTypes = {
43
42
  setTopic: 'set_topic',
44
43
  setTranslation: 'set_translation',
45
44
  setContext: 'set_context',
46
- clickCta: 'click_cta',
47
45
  clickCard: 'click_card',
48
46
  }
49
47
 
@@ -11,13 +11,12 @@ export const validateFileSize = (fileList, maxSize) => {
11
11
 
12
12
  export const fileListObjectIsNotEmpty = (fileListObj) => !!fileListObj?.length
13
13
 
14
- /* eslint-disable no-control-regex */
15
14
  export const isEmailString = (val) => {
16
15
  const regex =
16
+ // eslint-disable-next-line no-control-regex
17
17
  /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i
18
18
  const trimmedVal = val && val.trim()
19
19
  return !!(trimmedVal && trimmedVal.match(regex))
20
20
  }
21
- /* eslint-enable no-control-regex */
22
21
 
23
22
  export const isNotEmptyString = (val) => !!val
@@ -1,10 +1,10 @@
1
- import { FC } from 'preact/compat'
2
- import { useCallback, useEffect, useState } from 'preact/hooks'
3
1
  import {
4
2
  randomId,
5
3
  getSearchParamsByKeys,
6
4
  getUrlSearchParams,
7
5
  } from '@seamly/web-ui'
6
+ import { FC } from 'preact/compat'
7
+ import { useCallback, useEffect, useState } from 'preact/hooks'
8
8
  import { getStateObj } from '../states'
9
9
  import StyleGuideLinks from './links'
10
10
  import StyleGuideView from './view'
@@ -1,6 +1,4 @@
1
1
  import { configureStore } from '@reduxjs/toolkit'
2
- import { FC } from 'preact/compat'
3
- import { useMemo, useRef } from 'preact/hooks'
4
2
  import {
5
3
  ComponentFilter,
6
4
  SeamlyApiContext,
@@ -28,6 +26,8 @@ import {
28
26
  visibilityReducer,
29
27
  SeamlyActivityEventContext,
30
28
  } from '@seamly/web-ui'
29
+ import { FC } from 'preact/compat'
30
+ import { useMemo, useRef } from 'preact/hooks'
31
31
 
32
32
  const bareApi = {
33
33
  send: () => {
@@ -1,5 +1,5 @@
1
- import { useEffect, useState } from 'preact/hooks'
2
1
  import { View, timeout } from '@seamly/web-ui'
2
+ import { useEffect, useState } from 'preact/hooks'
3
3
  import StyleGuideStaticCore from './static-core'
4
4
 
5
5
  const StyleGuideView = ({
@@ -9,7 +9,6 @@ export const payloadTypes = {
9
9
  message: 'message',
10
10
  countdown: 'countdown',
11
11
  upload: 'upload',
12
- cta: 'cta',
13
12
  }
14
13
  const defaultTranslatedBody = {
15
14
  direction: 'to_translation_locale',
@@ -20,7 +19,6 @@ const defaultTranslatedBody = {
20
19
 
21
20
  export function addTranslationData(event) {
22
21
  switch (event.payload.type) {
23
- case payloadTypes.cta:
24
22
  case payloadTypes.image:
25
23
  case payloadTypes.text:
26
24
  case payloadTypes.choicePrompt:
@@ -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 pre-chat messages',
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 pre-chat messages & suggestions',
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 pre-chat messages',
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 pre-chat messages',
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 pre-chat messages',
2256
+ headingText: 'Minimized with disabled collapsed chat messages',
2294
2257
  description: '',
2295
2258
  window: {
2296
2259
  ...baseState,
@@ -1,5 +1,5 @@
1
- import { render } from 'preact'
2
1
  import { Engine, API } from '@seamly/web-ui'
2
+ import { render } from 'preact'
3
3
  import StyleGuideApp from './components/app'
4
4
 
5
5
  class SeamlyStyleGuideInstance extends Engine {
@@ -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;
@@ -44,13 +44,6 @@
44
44
  }
45
45
  }
46
46
 
47
- .#{$n}-message--type-cta .#{$n}-button {
48
- &:hover {
49
- background-color: $white;
50
- color: $interaction-dark;
51
- }
52
- }
53
-
54
47
  .#{$n}-message__body :is(a, [role='button']) {
55
48
  transition:
56
49
  background-color $transition,
@@ -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';
@@ -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: {
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
1
  const site = require('@seamly/doc-site/lib/config/site')
3
2
  const webpackMerge = require('webpack-merge').merge
4
3
  const generateCommonConfig = require('./config.common')
@@ -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 = (env = {}, argv = {}, configOverrides = {}) => {
11
+ module.exports = (configOverrides = {}) => {
14
12
  const implConfig = {
15
13
  ...defaultConfig,
16
14
  ...configOverrides,
@@ -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, PUBLIC_STYLEGUIDE_ROOT } =
25
- implConfig
23
+ const { ROOT, PUBLIC_ROOT, PUBLIC_TEST_ROOT } = implConfig
26
24
 
27
25
  let config = {
28
26
  plugins: [
@@ -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,
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
1
  const path = require('path')
3
2
 
4
3
  const BABEL_TRANSPILE_MODULES = ['phoenix']
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
1
  const babelLoaderPlugins = require('./babel-loader-plugins')
3
2
 
4
3
  module.exports = (env, argv, config) => [
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
1
  const path = require('path')
3
2
 
4
3
  module.exports = (env, argv, { PUBLIC_PATH, SRC_ROOT }) => ({
@@ -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
- }