@seamly/web-ui 18.1.1 → 18.3.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 (165) hide show
  1. package/build/dist/lib/index.debug.js +286 -99
  2. package/build/dist/lib/index.debug.min.js +1 -1
  3. package/build/dist/lib/index.debug.min.js.LICENSE.txt +84 -16
  4. package/build/dist/lib/index.js +4104 -3887
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/standalone.js +4351 -4084
  7. package/build/dist/lib/standalone.min.js +1 -1
  8. package/build/dist/lib/style-guide.js +746 -641
  9. package/build/dist/lib/style-guide.min.js +1 -1
  10. package/build/dist/lib/styles.css +1 -1
  11. package/build/dist/lib/utils.js +0 -1
  12. package/build/dist/lib/utils.min.js +1 -1
  13. package/build/dist/translations/de-informal.js +0 -1
  14. package/build/dist/translations/de-informal.min.js +1 -1
  15. package/build/dist/translations/en.js +0 -1
  16. package/build/dist/translations/en.min.js +1 -1
  17. package/build/dist/translations/es-informal.js +0 -1
  18. package/build/dist/translations/es-informal.min.js +1 -1
  19. package/build/dist/translations/nl-formal.js +0 -1
  20. package/build/dist/translations/nl-formal.min.js +1 -1
  21. package/build/dist/translations/nl-informal.js +0 -1
  22. package/build/dist/translations/nl-informal.min.js +1 -1
  23. package/package.json +4 -2
  24. package/src/javascripts/api/index.js +9 -9
  25. package/src/javascripts/api/producer.js +8 -8
  26. package/src/javascripts/config.js +9 -11
  27. package/src/javascripts/domains/app/actions.js +25 -0
  28. package/src/javascripts/domains/app/index.js +3 -0
  29. package/src/javascripts/domains/config/actions.js +6 -0
  30. package/src/javascripts/domains/config/hooks.js +6 -0
  31. package/src/javascripts/domains/config/index.js +8 -0
  32. package/src/javascripts/domains/config/middleware.js +26 -0
  33. package/src/javascripts/domains/config/reducer.js +74 -0
  34. package/src/javascripts/domains/config/selectors.js +23 -0
  35. package/src/javascripts/domains/forms/actions.js +1 -1
  36. package/src/javascripts/domains/forms/hooks.js +10 -14
  37. package/src/javascripts/domains/forms/provider.js +4 -6
  38. package/src/javascripts/domains/forms/selectors.js +3 -3
  39. package/src/javascripts/domains/i18n/index.js +9 -5
  40. package/src/javascripts/domains/interrupt/actions.js +6 -0
  41. package/src/javascripts/domains/interrupt/hooks.js +29 -0
  42. package/src/javascripts/domains/interrupt/index.js +9 -0
  43. package/src/javascripts/domains/interrupt/middleware.js +30 -0
  44. package/src/javascripts/domains/interrupt/reducer.js +22 -0
  45. package/src/javascripts/domains/interrupt/selectors.js +5 -0
  46. package/src/javascripts/domains/options/index.js +1 -0
  47. package/src/javascripts/domains/options/middleware.js +35 -0
  48. package/src/javascripts/domains/redux/create-redux-store.js +14 -6
  49. package/src/javascripts/domains/redux/hooks.js +2 -2
  50. package/src/javascripts/domains/redux/index.js +2 -1
  51. package/src/javascripts/domains/redux/provider.js +5 -0
  52. package/src/javascripts/domains/store/index.js +38 -0
  53. package/src/javascripts/{ui → domains}/store/state-reducer.js +4 -7
  54. package/src/javascripts/domains/translations/actions.js +3 -3
  55. package/src/javascripts/domains/translations/components/chat-status.js +6 -12
  56. package/src/javascripts/domains/translations/components/options-button.js +3 -3
  57. package/src/javascripts/domains/translations/components/options-dialog/form.js +2 -2
  58. package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
  59. package/src/javascripts/domains/translations/hooks.js +1 -1
  60. package/src/javascripts/domains/translations/reducer.js +2 -2
  61. package/src/javascripts/domains/translations/selectors.js +2 -2
  62. package/src/javascripts/index.js +17 -5
  63. package/src/javascripts/lib/css.js +5 -5
  64. package/src/javascripts/lib/engine/index.js +38 -11
  65. package/src/javascripts/lib/external-api/index.js +6 -6
  66. package/src/javascripts/lib/i18n.js +2 -2
  67. package/src/javascripts/lib/parse-body.js +1 -1
  68. package/src/javascripts/lib/redux-helpers/index.js +18 -4
  69. package/src/javascripts/lib/split-url-params.js +2 -2
  70. package/src/javascripts/lib/store/providers/app-storage.js +1 -1
  71. package/src/javascripts/lib/store/providers/cookie-storage.js +1 -1
  72. package/src/javascripts/package/utils.js +0 -1
  73. package/src/javascripts/style-guide/components/app.js +5 -12
  74. package/src/javascripts/style-guide/components/links.js +6 -6
  75. package/src/javascripts/style-guide/components/static-core.js +23 -7
  76. package/src/javascripts/style-guide/state-helpers/index.js +1 -1
  77. package/src/javascripts/style-guide/states.js +27 -67
  78. package/src/javascripts/style-guide/style-guide-engine.js +1 -1
  79. package/src/javascripts/ui/components/chat-app.js +2 -2
  80. package/src/javascripts/ui/components/conversation/component-filter.js +2 -2
  81. package/src/javascripts/ui/components/conversation/conversation.js +2 -2
  82. package/src/javascripts/ui/components/conversation/event/card-component.js +29 -4
  83. package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +2 -2
  84. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +4 -3
  85. package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +2 -1
  86. package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +2 -2
  87. package/src/javascripts/ui/components/conversation/event/choice-prompt.js +11 -6
  88. package/src/javascripts/ui/components/conversation/event/cta.js +1 -6
  89. package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +1 -1
  90. package/src/javascripts/ui/components/conversation/event/event-participant.js +3 -5
  91. package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
  92. package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
  93. package/src/javascripts/ui/components/conversation/event/hooks/use-text-rendering.js +3 -3
  94. package/src/javascripts/ui/components/conversation/event/participant.js +2 -2
  95. package/src/javascripts/ui/components/conversation/event/upload.js +12 -27
  96. package/src/javascripts/ui/components/conversation/message-container.js +4 -6
  97. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -5
  98. package/src/javascripts/ui/components/core/seamly-core.js +6 -7
  99. package/src/javascripts/ui/components/core/seamly-event-subscriber.js +16 -17
  100. package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -6
  101. package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -6
  102. package/src/javascripts/ui/components/core/seamly-initializer.js +7 -60
  103. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +10 -10
  104. package/src/javascripts/ui/components/core/seamly-live-region.js +1 -1
  105. package/src/javascripts/ui/components/core/seamly-new-notifications.js +1 -1
  106. package/src/javascripts/ui/components/core/seamly-read-state.js +2 -2
  107. package/src/javascripts/ui/components/entry/entry-container.js +7 -10
  108. package/src/javascripts/ui/components/entry/toggle-button.js +24 -10
  109. package/src/javascripts/ui/components/entry/upload/index.js +4 -11
  110. package/src/javascripts/ui/components/faq/faq.js +4 -4
  111. package/src/javascripts/ui/components/form-controls/error.js +22 -0
  112. package/src/javascripts/ui/components/form-controls/file-input.js +3 -9
  113. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  114. package/src/javascripts/ui/components/form-controls/wrapper.js +2 -9
  115. package/src/javascripts/ui/components/layout/agent-info.js +4 -4
  116. package/src/javascripts/ui/components/layout/app-frame.js +5 -5
  117. package/src/javascripts/ui/components/layout/chat-frame.js +3 -5
  118. package/src/javascripts/ui/components/layout/header.js +4 -18
  119. package/src/javascripts/ui/components/layout/privacy-disclaimer.js +2 -2
  120. package/src/javascripts/ui/components/options/cobrowsing.js +3 -7
  121. package/src/javascripts/ui/components/options/options-button.js +9 -13
  122. package/src/javascripts/ui/components/options/options-frame.js +1 -1
  123. package/src/javascripts/ui/components/options/transcript/index.js +2 -2
  124. package/src/javascripts/ui/components/options/transcript/transcript-form.js +1 -1
  125. package/src/javascripts/ui/components/warnings/cobrowsing-active-frame.js +3 -6
  126. package/src/javascripts/ui/components/warnings/idle-detach-warning.js +2 -6
  127. package/src/javascripts/ui/components/widgets/in-out-transition.js +2 -2
  128. package/src/javascripts/ui/components/widgets/lightbox.js +4 -4
  129. package/src/javascripts/ui/components/widgets/modal.js +3 -3
  130. package/src/javascripts/ui/components/widgets/upload-progress.js +2 -13
  131. package/src/javascripts/ui/hooks/component-helper-hooks.js +4 -15
  132. package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -3
  133. package/src/javascripts/ui/hooks/focus-helper-hooks.js +4 -4
  134. package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
  135. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +7 -6
  136. package/src/javascripts/ui/hooks/seamly-hooks.js +3 -9
  137. package/src/javascripts/ui/hooks/seamly-option-hooks.js +4 -4
  138. package/src/javascripts/ui/hooks/seamly-state-hooks.js +8 -16
  139. package/src/javascripts/ui/hooks/use-event-component-mapping.js +1 -1
  140. package/src/javascripts/ui/hooks/use-seamly-chat.js +1 -0
  141. package/src/javascripts/ui/hooks/use-seamly-commands.js +27 -49
  142. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +3 -3
  143. package/src/javascripts/ui/hooks/use-seamly-stored-visibility.js +3 -3
  144. package/src/javascripts/ui/hooks/use-seamly-visibility.js +3 -3
  145. package/src/javascripts/ui/hooks/utility-hooks.js +2 -2
  146. package/src/javascripts/ui/utils/form-utils.js +3 -3
  147. package/src/javascripts/ui/utils/general-utils.js +17 -11
  148. package/src/javascripts/ui/utils/seamly-utils.js +15 -83
  149. package/src/javascripts/ui/utils/validations.js +10 -7
  150. package/src/stylesheets/5-components/_card.scss +0 -1
  151. package/src/stylesheets/5-components/_choice-prompt.scss +5 -0
  152. package/src/stylesheets/5-components/_message.scss +10 -0
  153. package/src/stylesheets/5-components/_options.scss +3 -2
  154. package/translations/de-informal.js +0 -2
  155. package/translations/en.js +0 -2
  156. package/translations/es-informal.js +0 -2
  157. package/translations/nl-formal.js +0 -2
  158. package/translations/nl-informal.js +0 -2
  159. package/webpack/config.common.js +3 -3
  160. package/webpack/config.package.js +4 -4
  161. package/webpack/config.site.js +8 -6
  162. package/CHANGELOG.md +0 -551
  163. package/src/javascripts/ui/components/core/seamly-api.js +0 -44
  164. package/src/javascripts/ui/hooks/use-seamly-interrupt.js +0 -62
  165. package/src/javascripts/ui/store/index.js +0 -37
@@ -1,9 +1,9 @@
1
1
  import { useCallback } from 'preact/hooks'
2
- import { useSeamlyConfig } from './seamly-state-hooks'
3
2
  import { useSeamlyObjectStore } from './seamly-api-hooks'
3
+ import { useConfig } from '../../domains/config'
4
4
 
5
5
  const useSeamlyStoredVisibility = () => {
6
- const { layoutMode } = useSeamlyConfig()
6
+ const { layoutMode } = useConfig()
7
7
  const key = 'visibility'
8
8
  const { get, set } = useSeamlyObjectStore()
9
9
 
@@ -15,7 +15,7 @@ const useSeamlyStoredVisibility = () => {
15
15
  }
16
16
 
17
17
  const setStoredVisibility = useCallback(
18
- state => {
18
+ (state) => {
19
19
  const saved = get ? get(key) : {}
20
20
  set(key, { ...saved, [layoutMode]: state })
21
21
  },
@@ -1,6 +1,5 @@
1
1
  import { useCallback } from 'preact/hooks'
2
2
  import {
3
- useSeamlyConfig,
4
3
  useSeamlyStateContext,
5
4
  useSeamlyUnreadCount,
6
5
  } from './seamly-state-hooks'
@@ -16,11 +15,12 @@ import {
16
15
  seamlyActions,
17
16
  visibilityStates,
18
17
  } from '../utils/seamly-utils'
18
+ import { useConfig } from '../../domains/config'
19
19
 
20
20
  const { SET_VISIBILITY } = seamlyActions
21
21
 
22
22
  const useSeamlyVisibility = () => {
23
- const config = useSeamlyConfig()
23
+ const config = useConfig()
24
24
  const { layoutMode, visibilityCallback } = config
25
25
  const { visible } = useSeamlyStateContext()
26
26
  const { emitEvent } = useSeamlyCommands()
@@ -38,7 +38,7 @@ const useSeamlyVisibility = () => {
38
38
  : false
39
39
 
40
40
  const setVisibility = useCallback(
41
- visibility => {
41
+ (visibility) => {
42
42
  const visibilityFn = visibilityCallback || calculateVisibility
43
43
  const requestedVisibility = visibilityFn({
44
44
  hasConversation,
@@ -11,7 +11,7 @@ export const useForceUpdate = () => {
11
11
  // This is an escape hatch mentioned in the React docs:
12
12
  // https://reactjs.org/docs/hooks-faq.html#is-there-something-like-forceupdate
13
13
  /* eslint-disable-next-line no-unused-vars */
14
- const [ignored, forceUpdate] = useReducer(x => x + 1, 0)
14
+ const [ignored, forceUpdate] = useReducer((x) => x + 1, 0)
15
15
 
16
16
  return useCallback(() => {
17
17
  setTimeout(() => {
@@ -25,7 +25,7 @@ export const useGeneratedId = () => {
25
25
  return id
26
26
  }
27
27
 
28
- export const useStableCallback = callback => {
28
+ export const useStableCallback = (callback) => {
29
29
  const callbackRef = useRef()
30
30
  callbackRef.current = callback
31
31
  const isFunction = typeof callback === 'function'
@@ -41,7 +41,7 @@ export const formReducer = (state, action) => {
41
41
  persistData,
42
42
  } = action
43
43
 
44
- const setControls = controls => ({
44
+ const setControls = (controls) => ({
45
45
  ...state,
46
46
  [formId]: {
47
47
  ...state[formId],
@@ -112,8 +112,8 @@ export const formReducer = (state, action) => {
112
112
  ...state[formId],
113
113
  controls: newControlValidities,
114
114
  validity: Object.keys(newControlValidities)
115
- .map(key => newControlValidities[key].validity)
116
- .every(v => v),
115
+ .map((key) => newControlValidities[key].validity)
116
+ .every((v) => v),
117
117
  },
118
118
  }
119
119
  case SET_STATE:
@@ -1,6 +1,6 @@
1
1
  export const debounce = (func, wait) => {
2
2
  let timeout
3
- return function(...args) {
3
+ return function (...args) {
4
4
  const context = this
5
5
  let isCancelled = false
6
6
  clearTimeout(timeout)
@@ -12,7 +12,7 @@ export const debounce = (func, wait) => {
12
12
  isCancelled = false
13
13
  }, wait)
14
14
 
15
- return runInstant => {
15
+ return (runInstant) => {
16
16
  isCancelled = true
17
17
  if (runInstant) {
18
18
  func.apply(context, args)
@@ -54,7 +54,7 @@ export const closestElement = (el, match) => {
54
54
  export const createAriaHider = () => {
55
55
  const originalValues = []
56
56
  const rootNodes = []
57
- document.querySelectorAll('body > *:not([role="dialog"])').forEach(node => {
57
+ document.querySelectorAll('body > *:not([role="dialog"])').forEach((node) => {
58
58
  const attr = node.getAttribute('aria-hidden')
59
59
  const alreadyHidden = attr !== null && attr !== 'false'
60
60
  if (alreadyHidden) {
@@ -77,17 +77,17 @@ export const createAriaHider = () => {
77
77
  }
78
78
  }
79
79
 
80
- export const propIsTrue = prop => prop === 'true' || prop === true
80
+ export const propIsTrue = (prop) => prop === 'true' || prop === true
81
81
 
82
- export const millisecondsToSeconds = milliseconds => {
82
+ export const millisecondsToSeconds = (milliseconds) => {
83
83
  return Math.ceil(milliseconds / 1000)
84
84
  }
85
85
 
86
- export const microsecondsToMilliseconds = microseconds => {
86
+ export const microsecondsToMilliseconds = (microseconds) => {
87
87
  return Math.ceil(microseconds / 1000)
88
88
  }
89
89
 
90
- export const sanitizeText = text =>
90
+ export const sanitizeText = (text) =>
91
91
  text
92
92
  .replace(/&/g, '&')
93
93
  .replace(/</g, '&lt;')
@@ -96,7 +96,7 @@ export const sanitizeText = text =>
96
96
  .replace(/'/g, '&#39;')
97
97
  .replace(/\//g, '&#x2F;')
98
98
 
99
- export const getTimeFromSeconds = seconds => {
99
+ export const getTimeFromSeconds = (seconds) => {
100
100
  const minutes = Math.floor(seconds / 60)
101
101
  const secondsPartial = seconds - minutes * 60
102
102
 
@@ -130,7 +130,7 @@ export const getUrlParams = () => {
130
130
  }, {})
131
131
  }
132
132
 
133
- export const getUrlSearchString = params => {
133
+ export const getUrlSearchString = (params) => {
134
134
  return Object.keys(params).reduce(
135
135
  (search, key) =>
136
136
  `${search}${search ? '&' : ''}${key}=${encodeURIComponent(params[key])}`,
@@ -158,9 +158,9 @@ export const keyNames = {
158
158
  ArrowDown: 'ArrowDown',
159
159
  }
160
160
 
161
- export const getKey = e => (e.code ? keyNames[e.code] : keyCodes[e.keyCode])
161
+ export const getKey = (e) => (e.code ? keyNames[e.code] : keyCodes[e.keyCode])
162
162
 
163
- export const focusElement = el => {
163
+ export const focusElement = (el) => {
164
164
  if (el) {
165
165
  el.focus()
166
166
  }
@@ -207,3 +207,9 @@ export const flattenObject = (obj, prefix = '') =>
207
207
  else acc[pre + k] = obj[k]
208
208
  return acc
209
209
  }, {})
210
+
211
+ export const pick = (obj, keys) =>
212
+ keys.reduce((accum, key) => {
213
+ if (key in obj) accum[key] = obj[key]
214
+ return accum
215
+ }, {})
@@ -1,9 +1,3 @@
1
- import {
2
- layoutMode as defaultLayoutmode,
3
- appContainerClassNames,
4
- defaultConfig,
5
- typing as defaultTyping,
6
- } from '../../config'
7
1
  import { getTimeFromSeconds } from './general-utils'
8
2
 
9
3
  export const eventTypes = {
@@ -91,12 +85,9 @@ export const seamlyActions = {
91
85
  SET_PARTICIPANT: 'SET_PARTICIPANT',
92
86
  SET_HEADER_TITLE: 'SET_HEADER_TITLE',
93
87
  SET_HEADER_SUB_TITLE: 'SET_HEADER_SUB_TITLE',
94
- SET_INTERRUPT: ' SET_INTERRUPT',
95
- CLEAR_INTERRUPT: 'CLEAR_INTERRUPT',
96
88
  SET_VISIBILITY: 'SET_VISIBILITY',
97
89
  RESET_HISTORY_LOADED_FLAG: 'RESET_HISTORY_LOADED_FLAG',
98
90
  SET_ACTIVE_SERVICE: 'SET_ACTIVE_SERVICE',
99
- SET_SHOW_DISCLAIMER: 'SET_SHOW_DISCLAIMER',
100
91
  INIT_IDLE_DETACH_COUNTDOWN: 'INIT_IDLE_DETACH_COUNTDOWN',
101
92
  DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER:
102
93
  'DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER',
@@ -105,7 +96,6 @@ export const seamlyActions = {
105
96
  INIT_RESUME_CONVERSATION_PROMPT: 'INIT_RESUME_CONVERSATION_PROMPT',
106
97
  CLEAR_RESUME_CONVERSATION_PROMPT: 'CLEAR_RESUME_CONVERSATION_PROMPT',
107
98
  SET_SERVICE_DATA_ITEM: 'SET_SERVICE_DATA_ITEM',
108
- UPDATE_CONFIG: 'UPDATE_CONFIG',
109
99
  SET_FEATURES: 'SET_FEATURES',
110
100
  SET_FEATURE_ENABLED_STATE: 'SET_FEATURE_ENABLED_STATE',
111
101
  CLEAR_FEATURES: 'CLEAR_FEATURES',
@@ -146,12 +136,9 @@ const {
146
136
  SET_PARTICIPANT,
147
137
  SET_HEADER_TITLE,
148
138
  SET_HEADER_SUB_TITLE,
149
- SET_INTERRUPT,
150
- CLEAR_INTERRUPT,
151
139
  SET_VISIBILITY,
152
140
  RESET_HISTORY_LOADED_FLAG,
153
141
  SET_ACTIVE_SERVICE,
154
- SET_SHOW_DISCLAIMER,
155
142
  INIT_IDLE_DETACH_COUNTDOWN,
156
143
  DECREMENT_IDLE_DETACH_COUNTDOWN_COUNTER,
157
144
  STOP_IDLE_DETACH_COUNTDOWN_COUNTER,
@@ -159,7 +146,6 @@ const {
159
146
  INIT_RESUME_CONVERSATION_PROMPT,
160
147
  CLEAR_RESUME_CONVERSATION_PROMPT,
161
148
  SET_SERVICE_DATA_ITEM,
162
- UPDATE_CONFIG,
163
149
  SET_FEATURES,
164
150
  SET_FEATURE_ENABLED_STATE,
165
151
  CLEAR_FEATURES,
@@ -187,7 +173,7 @@ export const isUnreadMessage = ({ type, payload }) =>
187
173
  (type === eventTypes.message && !payload.fromClient) ||
188
174
  (type === eventTypes.info && payload.type === payloadTypes.text)
189
175
 
190
- const orderHistory = events => {
176
+ const orderHistory = (events) => {
191
177
  return events.sort(
192
178
  (
193
179
  { payload: { occurredAt: occurredAtA } },
@@ -199,10 +185,10 @@ const orderHistory = events => {
199
185
  export const mergeHistory = (stateEvents, historyEvents) => {
200
186
  const newHistoryEvents = historyEvents
201
187
  .filter(
202
- historyEvent =>
188
+ (historyEvent) =>
203
189
  // Deduplicate the event streams
204
190
  !stateEvents.find(
205
- stateEvent => stateEvent.payload.id === historyEvent.payload.id,
191
+ (stateEvent) => stateEvent.payload.id === historyEvent.payload.id,
206
192
  ) &&
207
193
  // Remove all non displayable participant messages
208
194
  !(
@@ -274,27 +260,6 @@ const headerTitlesReducer = (state, action) => {
274
260
  }
275
261
  }
276
262
 
277
- const interruptReducer = (state, action) => {
278
- switch (action.type) {
279
- case SET_INTERRUPT:
280
- return {
281
- ...state,
282
- hasInterrupt: true,
283
- meta: {
284
- ...action.interrupt,
285
- },
286
- }
287
- case CLEAR_INTERRUPT:
288
- return {
289
- ...state,
290
- hasInterrupt: false,
291
- meta: {},
292
- }
293
- default:
294
- return state
295
- }
296
- }
297
-
298
263
  const calculateNewEntryMeta = (entryMeta, payload) => {
299
264
  const { entry } = payload
300
265
  const { blockAutoEntrySwitch } = entryMeta
@@ -360,7 +325,7 @@ export const seamlyStateReducer = (state, action) => {
360
325
  // We check for duplicated and ignore them as in some error of the websocket
361
326
  // a duplicate join can be active for a while until the server connection
362
327
  // times out.
363
- const eventExists = state.events.find(e => e.payload.id === payload.id)
328
+ const eventExists = state.events.find((e) => e.payload.id === payload.id)
364
329
  if (eventExists) {
365
330
  return state
366
331
  }
@@ -402,7 +367,7 @@ export const seamlyStateReducer = (state, action) => {
402
367
  }
403
368
 
404
369
  const matchedEvent = state.events.find(
405
- m => m.payload.transactionId === action.event.payload.transactionId,
370
+ (m) => m.payload.transactionId === action.event.payload.transactionId,
406
371
  )
407
372
 
408
373
  const { id, occurredAt } = action.event.payload
@@ -411,7 +376,7 @@ export const seamlyStateReducer = (state, action) => {
411
376
  ? {
412
377
  ...state,
413
378
  events: orderHistory(
414
- state.events.map(m =>
379
+ state.events.map((m) =>
415
380
  m.payload.id === matchedEvent.payload.id
416
381
  ? {
417
382
  ...m,
@@ -429,7 +394,7 @@ export const seamlyStateReducer = (state, action) => {
429
394
  return {
430
395
  ...state,
431
396
  unreadEvents: 0,
432
- events: state.events.map(event => {
397
+ events: state.events.map((event) => {
433
398
  if (action.ids.indexOf(event.payload.id) !== -1) {
434
399
  return {
435
400
  ...event,
@@ -465,7 +430,7 @@ export const seamlyStateReducer = (state, action) => {
465
430
  .slice()
466
431
  .reverse()
467
432
  .find(
468
- m =>
433
+ (m) =>
469
434
  (m.type === 'message' || m.type === 'participant') &&
470
435
  !m.payload.fromClient,
471
436
  )
@@ -525,12 +490,13 @@ export const seamlyStateReducer = (state, action) => {
525
490
  const returnState = {
526
491
  ...state,
527
492
  unreadEvents: events.filter(
528
- event =>
493
+ (event) =>
529
494
  event.type === 'message' &&
530
495
  event.payload.messageStatus === readStates.received,
531
496
  ).length,
532
497
  events: events.filter(
533
- e => e.type !== 'participant' || !!e.payload.participant.introduction,
498
+ (e) =>
499
+ e.type !== 'participant' || !!e.payload.participant.introduction,
534
500
  ),
535
501
  participantInfo: {
536
502
  ...state.participantInfo,
@@ -656,16 +622,6 @@ export const seamlyStateReducer = (state, action) => {
656
622
  ...state,
657
623
  headerTitles: headerTitlesReducer(state.headerTitles, action),
658
624
  }
659
- case SET_INTERRUPT:
660
- case CLEAR_INTERRUPT:
661
- return {
662
- ...state,
663
- interrupt: interruptReducer(state.interrupt, action),
664
- }
665
- case SET_SHOW_DISCLAIMER:
666
- return { ...state, showDisclaimer: action.showDisclaimer }
667
- case UPDATE_CONFIG:
668
- return { ...state, config: { ...state.config, ...action.config } }
669
625
  case SET_INITIAL_STATE:
670
626
  return { ...state, initialState: action.initialState }
671
627
  case SET_SERVICE_DATA_ITEM:
@@ -810,7 +766,7 @@ export const seamlyStateReducer = (state, action) => {
810
766
  case SET_UPLOAD_PROGRESS:
811
767
  return {
812
768
  ...state,
813
- currentUploads: state.currentUploads.map(fileUpload => {
769
+ currentUploads: state.currentUploads.map((fileUpload) => {
814
770
  if (fileUpload.id === action.fileId) {
815
771
  return {
816
772
  ...fileUpload,
@@ -826,7 +782,7 @@ export const seamlyStateReducer = (state, action) => {
826
782
  case SET_UPLOAD_ERROR:
827
783
  return {
828
784
  ...state,
829
- currentUploads: state.currentUploads.map(fileUpload => {
785
+ currentUploads: state.currentUploads.map((fileUpload) => {
830
786
  if (fileUpload.id === action.fileId) {
831
787
  return {
832
788
  ...fileUpload,
@@ -842,7 +798,7 @@ export const seamlyStateReducer = (state, action) => {
842
798
  case SET_UPLOAD_COMPLETE:
843
799
  return {
844
800
  ...state,
845
- currentUploads: state.currentUploads.map(fileUpload => {
801
+ currentUploads: state.currentUploads.map((fileUpload) => {
846
802
  if (fileUpload.id === action.fileId) {
847
803
  return {
848
804
  ...fileUpload,
@@ -856,7 +812,7 @@ export const seamlyStateReducer = (state, action) => {
856
812
  return {
857
813
  ...state,
858
814
  currentUploads: state.currentUploads.filter(
859
- fileUpload => fileUpload.id !== action.fileId,
815
+ (fileUpload) => fileUpload.id !== action.fileId,
860
816
  ),
861
817
  }
862
818
  case CLEAR_ALL_UPLOADS:
@@ -894,30 +850,6 @@ export const seamlyStateReducer = (state, action) => {
894
850
  }
895
851
  }
896
852
 
897
- export const getSeamlyConfig = config => {
898
- const { messages: messagesConfig, typing, ...rest } = config
899
- const { messages: defaultMessagesConfig, ...defaultRest } = defaultConfig
900
- return {
901
- ...defaultRest,
902
- namespace: 'default',
903
- visible:
904
- config.layoutMode && config.layoutMode === 'inline'
905
- ? visibilityStates.open
906
- : visibilityStates.minimized,
907
- layoutMode: defaultLayoutmode,
908
- appContainerClassNames,
909
- messages: {
910
- ...defaultMessagesConfig,
911
- ...messagesConfig,
912
- },
913
- typing: {
914
- ...defaultTyping,
915
- ...typing,
916
- },
917
- ...rest,
918
- }
919
- }
920
-
921
853
  export const calculateVisibility = ({
922
854
  hasResponded,
923
855
  previousVisibility,
@@ -9,13 +9,16 @@ export const validateFileSize = (fileList, maxSize) => {
9
9
  return isValid
10
10
  }
11
11
 
12
- export const fileListObjectIsNotEmpty = fileListObj => !!fileListObj?.length > 0
12
+ export const fileListObjectIsNotEmpty = (fileListObj) =>
13
+ !!fileListObj?.length > 0
13
14
 
14
- export const isEmailString = val => {
15
- /* eslint-disable-next-line no-control-regex */
16
- const regex = /^(?:[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
17
-
18
- return !!(val && val.match(regex))
15
+ /* eslint-disable no-control-regex */
16
+ export const isEmailString = (val) => {
17
+ const regex =
18
+ /^(?:[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
19
+ const trimmedVal = val && val.trim()
20
+ return !!(trimmedVal && trimmedVal.match(regex))
19
21
  }
22
+ /* eslint-enable no-control-regex */
20
23
 
21
- export const isNotEmptyString = val => !!val
24
+ export const isNotEmptyString = (val) => !!val
@@ -40,7 +40,6 @@
40
40
  display: block;
41
41
  width: 100%;
42
42
  margin-bottom: $spacer;
43
- font-size: $fontsize-medium;
44
43
 
45
44
  &:last-child {
46
45
  margin-bottom: 0;
@@ -20,3 +20,8 @@
20
20
  width: 100%;
21
21
  white-space: normal;
22
22
  }
23
+
24
+ .#{$n}-choice-prompt__item--secondary .#{$n}-button {
25
+ background-color: initial;
26
+ color: $interaction;
27
+ }
@@ -192,6 +192,12 @@ $avatar-size: $badge-touch-size;
192
192
  }
193
193
  }
194
194
  }
195
+
196
+ &.cvco-message--source-user .#{$n}-message__body {
197
+ a {
198
+ color: $white;
199
+ }
200
+ }
195
201
  }
196
202
 
197
203
  // Loading
@@ -294,6 +300,10 @@ $avatar-size: $badge-touch-size;
294
300
  color: inherit;
295
301
  text-align: left;
296
302
  word-break: break-all;
303
+
304
+ &:hover {
305
+ text-decoration: none;
306
+ }
297
307
  }
298
308
 
299
309
  .#{$n}-icon {
@@ -123,7 +123,6 @@
123
123
  flex-direction: column;
124
124
  width: calc(100% - #{$spacer});
125
125
  max-width: $spacer * 15;
126
- max-height: $spacer * 15;
127
126
  margin: 0;
128
127
  padding: 0;
129
128
  transform: scaleY(0) translateY($spacer * 5);
@@ -156,6 +155,9 @@
156
155
  }
157
156
 
158
157
  .#{$n}-options__body {
158
+ display: flex;
159
+ flex-direction: column;
160
+ max-height: $spacer * 15;
159
161
  transition: opacity 0.1s 0.1s ease;
160
162
  opacity: 0;
161
163
  }
@@ -206,7 +208,6 @@
206
208
  flex-wrap: wrap;
207
209
  align-items: flex-start;
208
210
  width: 100%;
209
- max-height: $spacer * 11; // IE11 FIX
210
211
  padding: 0 $spacer;
211
212
  overflow: auto;
212
213
 
@@ -66,8 +66,6 @@ export default {
66
66
  'fileUpload.srAvailableText':
67
67
  'Das Uploaden von Dateien im Chat ist jetzt möglich',
68
68
  'fileUpload.srCompleteText': 'Upload abgeschlossen.',
69
- 'fileUpload.srFileUnavailableText': fileName =>
70
- `Herunterladen von ${fileName} ist nicht mehr möglich.`,
71
69
  'fileUpload.srFileUploadedText': fileName =>
72
70
  `Hochgeladene Datei ${fileName}.`,
73
71
  'fileUpload.srFileDownloadText': fileName =>
@@ -67,8 +67,6 @@ export default {
67
67
  'fileUpload.srAvailableText': 'File uploads are now available in the chat.',
68
68
  'fileUpload.srCompleteText': 'Upload complete.',
69
69
  'fileUpload.srFileDownloadText': fileName => `Download file ${fileName}.`,
70
- 'fileUpload.srFileUnavailableText': fileName =>
71
- `Download for ${fileName} has expired.`,
72
70
  'fileUpload.srFileUploadedText': fileName => `Uploaded file ${fileName}.`,
73
71
  'fileUpload.srProgressLabel': fileName =>
74
72
  `${fileName} upload progress status`,
@@ -74,8 +74,6 @@ export default {
74
74
  'fileUpload.srAvailableText': 'Subir archivos ahora es posible en el chat',
75
75
  'fileUpload.srCompleteText': 'Subi completada.',
76
76
  'fileUpload.srFileDownloadText': fileName => `Descargar archivo ${fileName}.`,
77
- 'fileUpload.srFileUnavailableText': fileName =>
78
- `La descarga de ${fileName} ha expirado.`,
79
77
  'fileUpload.srFileUploadedText': fileName => `Archivo subido ${fileName}.`,
80
78
  'fileUpload.srProgressLabel': fileName =>
81
79
  `Subi estado de progreso de ${fileName}`,
@@ -67,8 +67,6 @@ export default {
67
67
  'fileUpload.srAvailableText':
68
68
  'Uploaden van bestanden in de chat is nu mogelijk.',
69
69
  'fileUpload.srCompleteText': 'Upload voltooid.',
70
- 'fileUpload.srFileUnavailableText': fileName =>
71
- `Download voor ${fileName} is verlopen`,
72
70
  'fileUpload.srFileUploadedText': fileName => `Geüpload bestand ${fileName}.`,
73
71
  'fileUpload.srFileDownloadText': fileName => `Download bestand ${fileName}.`,
74
72
  'fileUpload.srProgressLabel': fileName => `Uploadstatus ${fileName}`,
@@ -67,8 +67,6 @@ export default {
67
67
  'fileUpload.srAvailableText':
68
68
  'Uploaden van bestanden in de chat is nu mogelijk.',
69
69
  'fileUpload.srCompleteText': 'Upload voltooid.',
70
- 'fileUpload.srFileUnavailableText': fileName =>
71
- `Download voor ${fileName} is verlopen`,
72
70
  'fileUpload.srFileUploadedText': fileName => `Geüpload bestand ${fileName}.`,
73
71
  'fileUpload.srFileDownloadText': fileName => `Download bestand ${fileName}.`,
74
72
  'fileUpload.srProgressLabel': fileName => `Uploadvoortgang van ${fileName}`,
@@ -2,8 +2,8 @@
2
2
  const path = require('path')
3
3
  const webpackMerge = require('webpack-merge').merge
4
4
  const site = require('@seamly/doc-site/lib/config/site')
5
- const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
6
- .BundleAnalyzerPlugin
5
+ const BundleAnalyzerPlugin =
6
+ require('webpack-bundle-analyzer').BundleAnalyzerPlugin
7
7
 
8
8
  const generateBabelLoaderBrowserPluginsPart = require('./parts/babel-loader-browser-plugins')
9
9
  const generateDevServerPart = require('./parts/dev-server')
@@ -50,7 +50,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
50
50
  rules: [
51
51
  {
52
52
  test: /\.js$/,
53
- include: BABEL_TRANSPILE_MODULES.map(moduleName =>
53
+ include: BABEL_TRANSPILE_MODULES.map((moduleName) =>
54
54
  path.resolve('node_modules', moduleName),
55
55
  ),
56
56
  loader: 'babel-loader',
@@ -41,7 +41,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
41
41
  externals: [
42
42
  ...Object.keys(pkg.peerDependencies || {}),
43
43
  ...Object.keys(pkg.peerDependencies || {}).map(
44
- key => new RegExp(`^${key}(\\/.*)`, 'i'),
44
+ (key) => new RegExp(`^${key}(\\/.*)`, 'i'),
45
45
  ),
46
46
  /^@seamly\/web-ui\/translations(\/.*)?/i,
47
47
  ],
@@ -49,7 +49,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
49
49
  rules: [
50
50
  {
51
51
  test: /\.js$/,
52
- include: BABEL_TRANSPILE_MODULES.map(moduleName =>
52
+ include: BABEL_TRANSPILE_MODULES.map((moduleName) =>
53
53
  path.resolve('node_modules', moduleName),
54
54
  ),
55
55
  loader: 'babel-loader',
@@ -132,7 +132,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
132
132
  externals: {},
133
133
  module: {
134
134
  ...packageConfig.module,
135
- rules: packageConfig.module.rules.map(rule => {
135
+ rules: packageConfig.module.rules.map((rule) => {
136
136
  if (rule.loader === 'babel-loader') {
137
137
  rule = {
138
138
  ...rule,
@@ -196,7 +196,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
196
196
  translationsConfig,
197
197
  ]
198
198
 
199
- const configsMinimized = configs.map(config =>
199
+ const configsMinimized = configs.map((config) =>
200
200
  webpackMerge(config, {
201
201
  optimization: {
202
202
  minimize: true,
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable */
2
2
  const path = require('path')
3
3
  const site = require('@seamly/doc-site/lib/config/site')
4
+ const CopyPlugin = require('copy-webpack-plugin')
4
5
  const webpackMerge = require('webpack-merge').merge
5
6
  const defaultConfig = require('./defaults')
6
7
  const generateCommonConfig = require('./config.common')
@@ -20,14 +21,15 @@ module.exports = (env = {}, argv = {}, configOverrides = {}, options = {}) => {
20
21
  ...options,
21
22
  }
22
23
 
23
- const {
24
- ROOT,
25
- PUBLIC_ROOT,
26
- PUBLIC_TEST_ROOT,
27
- PUBLIC_STYLEGUIDE_ROOT,
28
- } = implConfig
24
+ const { ROOT, PUBLIC_ROOT, PUBLIC_TEST_ROOT, PUBLIC_STYLEGUIDE_ROOT } =
25
+ implConfig
29
26
 
30
27
  let config = {
28
+ plugins: [
29
+ new CopyPlugin({
30
+ patterns: [{ from: 'public/static', to: 'static' }],
31
+ }),
32
+ ],
31
33
  entry: {
32
34
  // Changelog
33
35
  changelog: path.join(ROOT, 'CHANGELOG.md'),