@seamly/web-ui 18.2.0 → 19.0.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 (194) hide show
  1. package/build/dist/lib/index.debug.js +598 -136
  2. package/build/dist/lib/index.debug.min.js +1 -1
  3. package/build/dist/lib/index.debug.min.js.LICENSE.txt +190 -22
  4. package/build/dist/lib/index.js +4745 -4468
  5. package/build/dist/lib/index.min.js +1 -1
  6. package/build/dist/lib/index.min.js.LICENSE.txt +1 -1
  7. package/build/dist/lib/standalone.js +4839 -4465
  8. package/build/dist/lib/standalone.min.js +1 -1
  9. package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
  10. package/build/dist/lib/style-guide.js +1770 -980
  11. package/build/dist/lib/style-guide.min.js +1 -1
  12. package/build/dist/lib/styles.css +1 -1
  13. package/build/dist/lib/utils.js +0 -1
  14. package/build/dist/lib/utils.min.js +1 -1
  15. package/package.json +29 -29
  16. package/src/javascripts/api/index.js +33 -48
  17. package/src/javascripts/api/producer.js +9 -12
  18. package/src/javascripts/config.js +9 -11
  19. package/src/javascripts/domains/app/actions.js +43 -0
  20. package/src/javascripts/domains/app/hooks.js +6 -0
  21. package/src/javascripts/domains/app/index.js +6 -0
  22. package/src/javascripts/domains/app/reducer.js +16 -0
  23. package/src/javascripts/domains/app/selectors.js +8 -0
  24. package/src/javascripts/domains/app/utils.js +4 -0
  25. package/src/javascripts/domains/config/actions.js +4 -0
  26. package/src/javascripts/domains/config/hooks.js +6 -0
  27. package/src/javascripts/domains/config/index.js +8 -0
  28. package/src/javascripts/domains/config/middleware.js +22 -0
  29. package/src/javascripts/domains/config/reducer.js +63 -0
  30. package/src/javascripts/domains/config/selectors.js +23 -0
  31. package/src/javascripts/domains/config/utils.js +4 -0
  32. package/src/javascripts/domains/forms/actions.js +2 -4
  33. package/src/javascripts/domains/forms/hooks.js +10 -14
  34. package/src/javascripts/domains/forms/provider.js +4 -6
  35. package/src/javascripts/domains/forms/reducer.js +1 -2
  36. package/src/javascripts/domains/forms/selectors.js +4 -4
  37. package/src/javascripts/domains/forms/utils.js +5 -0
  38. package/src/javascripts/domains/i18n/actions.js +35 -0
  39. package/src/javascripts/domains/i18n/hooks.js +38 -0
  40. package/src/javascripts/domains/i18n/index.js +5 -80
  41. package/src/javascripts/domains/i18n/reducer.js +58 -0
  42. package/src/javascripts/domains/i18n/selectors.js +15 -0
  43. package/src/javascripts/domains/i18n/utils.js +9 -0
  44. package/src/javascripts/domains/interrupt/actions.js +4 -0
  45. package/src/javascripts/domains/interrupt/hooks.js +29 -0
  46. package/src/javascripts/domains/interrupt/index.js +9 -0
  47. package/src/javascripts/domains/interrupt/middleware.js +30 -0
  48. package/src/javascripts/domains/interrupt/reducer.js +21 -0
  49. package/src/javascripts/domains/interrupt/selectors.js +6 -0
  50. package/src/javascripts/domains/interrupt/utils.js +4 -0
  51. package/src/javascripts/domains/options/index.js +1 -0
  52. package/src/javascripts/domains/options/middleware.js +35 -0
  53. package/src/javascripts/domains/redux/create-redux-store.js +14 -6
  54. package/src/javascripts/domains/redux/hooks.js +3 -2
  55. package/src/javascripts/domains/redux/index.js +2 -1
  56. package/src/javascripts/domains/redux/provider.js +5 -0
  57. package/src/javascripts/domains/store/index.js +44 -0
  58. package/src/javascripts/{ui → domains}/store/state-reducer.js +4 -7
  59. package/src/javascripts/domains/translations/actions.js +4 -6
  60. package/src/javascripts/domains/translations/components/chat-status.js +7 -13
  61. package/src/javascripts/domains/translations/components/options-button.js +3 -3
  62. package/src/javascripts/domains/translations/components/options-dialog/form.js +12 -7
  63. package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
  64. package/src/javascripts/domains/translations/hooks.js +1 -1
  65. package/src/javascripts/domains/translations/index.js +1 -0
  66. package/src/javascripts/domains/translations/middleware.js +43 -0
  67. package/src/javascripts/domains/translations/reducer.js +4 -11
  68. package/src/javascripts/domains/translations/selectors.js +3 -3
  69. package/src/javascripts/domains/translations/utils.js +4 -0
  70. package/src/javascripts/index.js +20 -5
  71. package/src/javascripts/lib/css.js +5 -5
  72. package/src/javascripts/lib/engine/index.js +39 -11
  73. package/src/javascripts/lib/external-api/index.js +6 -6
  74. package/src/javascripts/lib/mutex.js +30 -0
  75. package/src/javascripts/lib/parse-body.js +1 -1
  76. package/src/javascripts/lib/redux-helpers/index.js +25 -8
  77. package/src/javascripts/lib/split-url-params.js +2 -2
  78. package/src/javascripts/lib/store/providers/app-storage.js +1 -1
  79. package/src/javascripts/lib/store/providers/cookie-storage.js +1 -1
  80. package/src/javascripts/package/utils.js +0 -1
  81. package/src/javascripts/style-guide/components/app.js +12 -14
  82. package/src/javascripts/style-guide/components/links.js +6 -6
  83. package/src/javascripts/style-guide/components/static-core.js +32 -10
  84. package/src/javascripts/style-guide/state-helpers/index.js +1 -1
  85. package/src/javascripts/style-guide/states.js +29 -71
  86. package/src/javascripts/style-guide/style-guide-engine.js +13 -12
  87. package/src/javascripts/ui/components/chat-app.js +2 -2
  88. package/src/javascripts/ui/components/conversation/component-filter.js +2 -2
  89. package/src/javascripts/ui/components/conversation/conversation.js +2 -2
  90. package/src/javascripts/ui/components/conversation/event/card-component.js +24 -3
  91. package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +2 -2
  92. package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +4 -3
  93. package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +2 -1
  94. package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +2 -2
  95. package/src/javascripts/ui/components/conversation/event/choice-prompt.js +5 -5
  96. package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +2 -2
  97. package/src/javascripts/ui/components/conversation/event/event-participant.js +3 -5
  98. package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
  99. package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
  100. package/src/javascripts/ui/components/conversation/event/hooks/use-text-rendering.js +3 -3
  101. package/src/javascripts/ui/components/conversation/event/participant.js +2 -2
  102. package/src/javascripts/ui/components/conversation/event/upload.js +12 -27
  103. package/src/javascripts/ui/components/conversation/message-container.js +4 -6
  104. package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -5
  105. package/src/javascripts/ui/components/core/seamly-core.js +6 -7
  106. package/src/javascripts/ui/components/core/seamly-event-subscriber.js +18 -17
  107. package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -6
  108. package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -6
  109. package/src/javascripts/ui/components/core/seamly-initializer.js +7 -60
  110. package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +10 -16
  111. package/src/javascripts/ui/components/core/seamly-live-region.js +1 -1
  112. package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -6
  113. package/src/javascripts/ui/components/core/seamly-read-state.js +8 -6
  114. package/src/javascripts/ui/components/entry/entry-container.js +7 -10
  115. package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -4
  116. package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +10 -3
  117. package/src/javascripts/ui/components/entry/toggle-button.js +24 -10
  118. package/src/javascripts/ui/components/entry/upload/file-upload-form.js +6 -3
  119. package/src/javascripts/ui/components/entry/upload/index.js +11 -13
  120. package/src/javascripts/ui/components/faq/faq.js +6 -6
  121. package/src/javascripts/ui/components/form-controls/error.js +22 -0
  122. package/src/javascripts/ui/components/form-controls/file-input.js +3 -9
  123. package/src/javascripts/ui/components/form-controls/select.js +1 -1
  124. package/src/javascripts/ui/components/form-controls/wrapper.js +2 -9
  125. package/src/javascripts/ui/components/layout/agent-info.js +4 -4
  126. package/src/javascripts/ui/components/layout/app-frame.js +15 -12
  127. package/src/javascripts/ui/components/layout/chat-frame.js +3 -5
  128. package/src/javascripts/ui/components/layout/header.js +4 -18
  129. package/src/javascripts/ui/components/layout/interrupt.js +6 -2
  130. package/src/javascripts/ui/components/layout/privacy-disclaimer.js +2 -2
  131. package/src/javascripts/ui/components/options/cobrowsing.js +3 -7
  132. package/src/javascripts/ui/components/options/options-button.js +9 -13
  133. package/src/javascripts/ui/components/options/options-frame.js +1 -1
  134. package/src/javascripts/ui/components/options/transcript/index.js +2 -2
  135. package/src/javascripts/ui/components/options/transcript/transcript-form.js +1 -1
  136. package/src/javascripts/ui/components/warnings/cobrowsing-active-frame.js +3 -6
  137. package/src/javascripts/ui/components/warnings/idle-detach-warning.js +2 -6
  138. package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
  139. package/src/javascripts/ui/components/widgets/in-out-transition.js +2 -2
  140. package/src/javascripts/ui/components/widgets/lightbox.js +4 -4
  141. package/src/javascripts/ui/components/widgets/modal.js +3 -3
  142. package/src/javascripts/ui/components/widgets/upload-progress.js +3 -14
  143. package/src/javascripts/ui/hooks/component-helper-hooks.js +4 -15
  144. package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -3
  145. package/src/javascripts/ui/hooks/focus-helper-hooks.js +4 -4
  146. package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
  147. package/src/javascripts/ui/hooks/seamly-api-hooks.js +0 -6
  148. package/src/javascripts/ui/hooks/seamly-entry-hooks.js +22 -25
  149. package/src/javascripts/ui/hooks/seamly-hooks.js +3 -10
  150. package/src/javascripts/ui/hooks/seamly-option-hooks.js +4 -4
  151. package/src/javascripts/ui/hooks/seamly-state-hooks.js +8 -16
  152. package/src/javascripts/ui/hooks/use-event-component-mapping.js +1 -1
  153. package/src/javascripts/ui/hooks/use-seamly-chat.js +1 -0
  154. package/src/javascripts/ui/hooks/use-seamly-commands.js +31 -54
  155. package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +3 -3
  156. package/src/javascripts/ui/hooks/use-seamly-stored-visibility.js +3 -3
  157. package/src/javascripts/ui/hooks/use-seamly-visibility.js +6 -8
  158. package/src/javascripts/ui/hooks/use-single-file-upload.js +4 -1
  159. package/src/javascripts/ui/hooks/utility-hooks.js +2 -2
  160. package/src/javascripts/ui/utils/form-utils.js +3 -3
  161. package/src/javascripts/ui/utils/general-utils.js +21 -22
  162. package/src/javascripts/ui/utils/seamly-utils.js +15 -83
  163. package/src/javascripts/ui/utils/validations.js +10 -7
  164. package/src/stylesheets/1-settings/_config.scss +2 -1
  165. package/src/stylesheets/3-app/_app.scss +3 -4
  166. package/src/stylesheets/5-components/_card.scss +0 -1
  167. package/src/stylesheets/5-components/_faq.scss +3 -8
  168. package/src/stylesheets/5-components/_message.scss +10 -0
  169. package/src/stylesheets/5-components/_modal.scss +3 -3
  170. package/src/stylesheets/5-components/_options.scss +3 -2
  171. package/webpack/config.common.js +3 -3
  172. package/webpack/config.package.js +4 -22
  173. package/webpack/config.site.js +8 -6
  174. package/webpack/defaults.js +0 -3
  175. package/CHANGELOG.md +0 -561
  176. package/build/dist/translations/de-informal.js +0 -275
  177. package/build/dist/translations/de-informal.min.js +0 -1
  178. package/build/dist/translations/en.js +0 -275
  179. package/build/dist/translations/en.min.js +0 -1
  180. package/build/dist/translations/es-informal.js +0 -281
  181. package/build/dist/translations/es-informal.min.js +0 -1
  182. package/build/dist/translations/nl-formal.js +0 -275
  183. package/build/dist/translations/nl-formal.min.js +0 -1
  184. package/build/dist/translations/nl-informal.js +0 -275
  185. package/build/dist/translations/nl-informal.min.js +0 -1
  186. package/src/javascripts/lib/i18n.js +0 -46
  187. package/src/javascripts/ui/components/core/seamly-api.js +0 -44
  188. package/src/javascripts/ui/hooks/use-seamly-interrupt.js +0 -62
  189. package/src/javascripts/ui/store/index.js +0 -37
  190. package/translations/de-informal.js +0 -237
  191. package/translations/en.js +0 -234
  192. package/translations/es-informal.js +0 -243
  193. package/translations/nl-formal.js +0 -230
  194. package/translations/nl-informal.js +0 -230
@@ -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
@@ -81,7 +81,8 @@ $app-started-width: 375px !default;
81
81
  $app-full-height: 720px !default;
82
82
  $app-collapsed-height: 54px !default;
83
83
 
84
- $app-inline-height: 480px !default;
84
+ $app-inline-min-height: 480px !default;
85
+ $app-inline-max-height: 720px !default;
85
86
 
86
87
  $post-full-height: 170px !default;
87
88
  $post-collapsed-height: 65px !default;
@@ -31,16 +31,15 @@ $app-header-bgcolor: $brand3;
31
31
  right: auto;
32
32
  bottom: auto;
33
33
  width: auto;
34
- height: 100vh;
35
- min-height: $spacer * 24;
36
- max-height: $spacer * 32;
34
+ height: 90vh;
35
+ min-height: $app-inline-min-height;
36
+ max-height: $app-inline-max-height;
37
37
  transition: height $transition, width $transition;
38
38
  background-color: initial;
39
39
  box-shadow: none;
40
40
 
41
41
  @include media('>phablet-l') {
42
42
  display: block;
43
- height: $app-inline-height;
44
43
  border: 0 none;
45
44
  }
46
45
  }
@@ -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;
@@ -9,8 +9,6 @@
9
9
 
10
10
  &.#{$n}-app--layout-window .#{$n}-faqs {
11
11
  overscroll-behavior: contain;
12
- /* stylelint-disable-next-line property-no-vendor-prefix */
13
- -ms-scroll-chaining: none;
14
12
  }
15
13
 
16
14
  &.#{$n}-app--layout-inline .#{$n}-faqs {
@@ -20,9 +18,9 @@
20
18
  left: 50%;
21
19
  flex-direction: column;
22
20
  width: 50%;
23
- height: $app-inline-height;
24
- min-height: $spacer * 24;
25
- max-height: 100%;
21
+ height: 100%;
22
+ min-height: 100%;
23
+ overflow: hidden;
26
24
  transform: translateX(-100%);
27
25
  border: $thin-border solid set-border-color($app-bg);
28
26
  border-left: 0;
@@ -59,9 +57,6 @@
59
57
 
60
58
  &.#{$n}-app--layout-inline .#{$n}-faqs.#{$n}-transition--in {
61
59
  @include media('>phablet-l') {
62
- height: $app-inline-height;
63
- min-height: $spacer * 24;
64
- max-height: 100%;
65
60
  overflow-y: initial;
66
61
  transform: translateX(0%);
67
62
  }
@@ -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 {
@@ -130,9 +130,9 @@ $button-transition: $transition;
130
130
 
131
131
  &:hover {
132
132
  background-color: $brand3;
133
+ }
133
134
 
134
- svg path {
135
- fill: $app-bg;
136
- }
135
+ &:hover .cvco-icon svg path {
136
+ fill: $white;
137
137
  }
138
138
  }
@@ -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
 
@@ -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',
@@ -16,7 +16,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
16
16
  const {
17
17
  BUILD_ROOT,
18
18
  SRC_ROOT,
19
- TRANSLATIONS_ROOT,
20
19
 
21
20
  ROOT,
22
21
 
@@ -41,15 +40,14 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
41
40
  externals: [
42
41
  ...Object.keys(pkg.peerDependencies || {}),
43
42
  ...Object.keys(pkg.peerDependencies || {}).map(
44
- key => new RegExp(`^${key}(\\/.*)`, 'i'),
43
+ (key) => new RegExp(`^${key}(\\/.*)`, 'i'),
45
44
  ),
46
- /^@seamly\/web-ui\/translations(\/.*)?/i,
47
45
  ],
48
46
  module: {
49
47
  rules: [
50
48
  {
51
49
  test: /\.js$/,
52
- include: BABEL_TRANSPILE_MODULES.map(moduleName =>
50
+ include: BABEL_TRANSPILE_MODULES.map((moduleName) =>
53
51
  path.resolve('node_modules', moduleName),
54
52
  ),
55
53
  loader: 'babel-loader',
@@ -101,21 +99,6 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
101
99
  externals: [/^@seamly\/web-ui(\/.*)?/i],
102
100
  })
103
101
 
104
- const translationFiles = glob.sync(path.join(TRANSLATIONS_ROOT, '*.js'))
105
- const translationEntries = translationFiles.reduce((entries, file) => {
106
- const fileName = path.parse(file).name
107
- return {
108
- ...entries,
109
- [fileName]: file,
110
- }
111
- }, {})
112
- const translationsConfig = webpackMerge(baseConfig, {
113
- entry: translationEntries,
114
- output: {
115
- path: path.join(BUILD_ROOT, '/dist/translations'),
116
- },
117
- })
118
-
119
102
  const standalonePackageConfig = {
120
103
  ...packageConfig,
121
104
  output: {
@@ -132,7 +115,7 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
132
115
  externals: {},
133
116
  module: {
134
117
  ...packageConfig.module,
135
- rules: packageConfig.module.rules.map(rule => {
118
+ rules: packageConfig.module.rules.map((rule) => {
136
119
  if (rule.loader === 'babel-loader') {
137
120
  rule = {
138
121
  ...rule,
@@ -193,10 +176,9 @@ module.exports = (env = {}, argv = {}, configOverrides = {}) => {
193
176
  standalonePackageConfig,
194
177
  styleguideConfig,
195
178
  externalsConfig,
196
- translationsConfig,
197
179
  ]
198
180
 
199
- const configsMinimized = configs.map(config =>
181
+ const configsMinimized = configs.map((config) =>
200
182
  webpackMerge(config, {
201
183
  optimization: {
202
184
  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'),
@@ -6,7 +6,6 @@ const BROWSERS = 'last 1 version, > 1%, not dead, not ie 11, not ie_mob 11'
6
6
  const ROOT = path.resolve(__dirname, '..')
7
7
  const BUILD_ROOT = path.join(ROOT, 'build')
8
8
  const SRC_ROOT = path.join(ROOT, 'src')
9
- const TRANSLATIONS_ROOT = path.join(ROOT, 'translations')
10
9
  const PUBLIC_ROOT = path.join(ROOT, 'public')
11
10
  const PUBLIC_TEST_ROOT = path.join(PUBLIC_ROOT, 'test')
12
11
  const PUBLIC_STYLEGUIDE_ROOT = path.join(PUBLIC_ROOT, 'style-guide')
@@ -43,7 +42,6 @@ const ALIASSES = {
43
42
  SRC_ROOT,
44
43
  'javascripts/style-guide.js',
45
44
  ),
46
- '@seamly/web-ui/translations': TRANSLATIONS_ROOT,
47
45
  '@seamly/web-ui/src/stylesheets/styles.scss': path.resolve(
48
46
  SRC_ROOT,
49
47
  'stylesheets',
@@ -64,7 +62,6 @@ module.exports = {
64
62
  ROOT,
65
63
  BUILD_ROOT,
66
64
  SRC_ROOT,
67
- TRANSLATIONS_ROOT,
68
65
  PUBLIC_ROOT,
69
66
 
70
67
  PUBLIC_TEST_ROOT,