@seamly/web-ui 20.0.0-beta.6 → 20.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/dist/lib/deprecated-view.css +1 -1
- package/build/dist/lib/index.debug.js +138 -149
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +0 -4
- package/build/dist/lib/index.js +669 -655
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/standalone.js +702 -688
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/style-guide.js +7288 -7266
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles-default-implementation.css +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +1 -2
- package/src/javascripts/api/errors/seamly-base-error.js +1 -0
- package/src/javascripts/api/index.js +24 -19
- package/src/javascripts/api/producer.js +3 -3
- package/src/javascripts/domains/app/actions.js +30 -8
- package/src/javascripts/domains/app/hooks.js +1 -1
- package/src/javascripts/domains/app/utils.js +1 -1
- package/src/javascripts/domains/config/hooks.js +18 -1
- package/src/javascripts/domains/config/index.js +0 -1
- package/src/javascripts/domains/config/reducer.js +7 -3
- package/src/javascripts/domains/config/selectors.js +1 -1
- package/src/javascripts/domains/config/utils.js +1 -1
- package/src/javascripts/domains/errors/index.js +2 -2
- package/src/javascripts/domains/forms/hooks.js +1 -1
- package/src/javascripts/domains/forms/provider.js +5 -3
- package/src/javascripts/domains/forms/reducer.js +1 -1
- package/src/javascripts/domains/forms/selectors.js +1 -1
- package/src/javascripts/domains/forms/utils.js +1 -1
- package/src/javascripts/domains/i18n/actions.js +1 -1
- package/src/javascripts/domains/i18n/hooks.js +1 -1
- package/src/javascripts/domains/i18n/reducer.js +1 -1
- package/src/javascripts/domains/i18n/utils.js +1 -1
- package/src/javascripts/domains/interrupt/hooks.js +2 -2
- package/src/javascripts/domains/interrupt/middleware.js +6 -6
- package/src/javascripts/domains/interrupt/reducer.js +1 -1
- package/src/javascripts/domains/interrupt/utils.js +1 -1
- package/src/javascripts/domains/options/middleware.js +1 -1
- package/src/javascripts/domains/store/index.js +10 -14
- package/src/javascripts/domains/store/state-reducer.js +3 -3
- package/src/javascripts/domains/translations/components/chat-status.js +8 -5
- package/src/javascripts/domains/translations/components/options-button.js +6 -6
- package/src/javascripts/domains/translations/components/options-dialog/form.js +5 -5
- package/src/javascripts/domains/translations/components/options-dialog/index.js +10 -7
- package/src/javascripts/domains/translations/hooks.js +7 -3
- package/src/javascripts/domains/translations/middleware.js +5 -2
- package/src/javascripts/domains/translations/reducer.js +4 -4
- package/src/javascripts/domains/translations/selectors.js +1 -1
- package/src/javascripts/domains/translations/utils.js +1 -1
- package/src/javascripts/domains/visibility/actions.js +3 -3
- package/src/javascripts/domains/visibility/hooks.js +1 -1
- package/src/javascripts/domains/visibility/utils.js +1 -1
- package/src/javascripts/lib/css.js +1 -1
- package/src/javascripts/lib/engine/index.js +6 -5
- package/src/javascripts/lib/external-api/index.js +1 -1
- package/src/javascripts/lib/redux-helpers/index.js +1 -1
- package/src/javascripts/style-guide/components/app.js +9 -5
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +27 -13
- package/src/javascripts/style-guide/components/view.js +16 -3
- package/src/javascripts/style-guide/states.js +23 -41
- package/src/javascripts/style-guide/style-guide-engine.js +13 -1
- package/src/javascripts/style-guide.js +2 -0
- package/src/javascripts/ui/components/app-options/index.js +4 -4
- package/src/javascripts/ui/components/chat-status/index.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +1 -1
- package/src/javascripts/ui/components/conversation/conversation.js +6 -6
- package/src/javascripts/ui/components/conversation/event/card-component.js +4 -4
- package/src/javascripts/ui/components/conversation/event/card-message.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +1 -1
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +3 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +3 -3
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +7 -7
- package/src/javascripts/ui/components/conversation/event/cta.js +6 -6
- package/src/javascripts/ui/components/conversation/event/divider/index.js +1 -1
- package/src/javascripts/ui/components/conversation/event/divider/variants/default.js +3 -3
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +4 -4
- package/src/javascripts/ui/components/conversation/event/divider/variants/time-indicator.js +5 -5
- package/src/javascripts/ui/components/conversation/event/event-participant.js +13 -10
- package/src/javascripts/ui/components/conversation/event/event.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js +2 -2
- package/src/javascripts/ui/components/conversation/event/hooks/use-formatted-date.js +3 -3
- package/src/javascripts/ui/components/conversation/event/image-lightbox.js +4 -4
- package/src/javascripts/ui/components/conversation/event/image.js +2 -2
- package/src/javascripts/ui/components/conversation/event/participant.js +6 -6
- package/src/javascripts/ui/components/conversation/event/text.js +3 -3
- package/src/javascripts/ui/components/conversation/event/translation.js +3 -3
- package/src/javascripts/ui/components/conversation/event/upload.js +18 -15
- package/src/javascripts/ui/components/conversation/event/video.js +4 -4
- package/src/javascripts/ui/components/conversation/event-divider.js +2 -2
- package/src/javascripts/ui/components/conversation/loader.js +2 -2
- package/src/javascripts/ui/components/conversation/message-container.js +4 -4
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -4
- package/src/javascripts/ui/components/core/seamly-core.js +2 -2
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +8 -8
- package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -5
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -2
- package/src/javascripts/ui/components/core/seamly-initializer.js +2 -2
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +5 -5
- package/src/javascripts/ui/components/core/seamly-live-region.js +2 -2
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -5
- package/src/javascripts/ui/components/core/seamly-read-state.js +6 -6
- package/src/javascripts/ui/components/entry/deprecated-toggle-button.js +5 -5
- package/src/javascripts/ui/components/entry/entry-container.js +8 -8
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -9
- package/src/javascripts/ui/components/entry/text-entry/index.js +2 -2
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +8 -8
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +5 -5
- package/src/javascripts/ui/components/entry/upload/index.js +10 -10
- package/src/javascripts/ui/components/entry/upload-toggle.js +9 -9
- package/src/javascripts/ui/components/faq/faq.js +16 -16
- package/src/javascripts/ui/components/form-controls/error.js +2 -2
- package/src/javascripts/ui/components/form-controls/file-input.js +4 -4
- package/src/javascripts/ui/components/form-controls/form.js +2 -2
- package/src/javascripts/ui/components/form-controls/input.js +1 -1
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/form-controls/wrapper.js +1 -1
- package/src/javascripts/ui/components/layout/agent-info.js +13 -17
- package/src/javascripts/ui/components/layout/chat-frame.js +6 -6
- package/src/javascripts/ui/components/layout/deprecated-app-frame.js +7 -7
- package/src/javascripts/ui/components/layout/header.js +3 -3
- package/src/javascripts/ui/components/layout/icon.js +1 -1
- package/src/javascripts/ui/components/layout/interrupt.js +3 -3
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +3 -3
- package/src/javascripts/ui/components/options/options-button.js +8 -13
- package/src/javascripts/ui/components/options/options-frame.js +4 -4
- package/src/javascripts/ui/components/options/options.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +8 -8
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +4 -4
- package/src/javascripts/ui/components/view/window-view/window-open-button.js +7 -7
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +6 -6
- package/src/javascripts/ui/components/warnings/prompt.js +2 -2
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +5 -5
- package/src/javascripts/ui/components/widgets/in-out-transition.js +3 -3
- package/src/javascripts/ui/components/widgets/lightbox.js +6 -6
- package/src/javascripts/ui/components/widgets/modal.js +2 -2
- package/src/javascripts/ui/components/widgets/upload-progress.js +4 -4
- package/src/javascripts/ui/hooks/component-helper-hooks.js +1 -1
- package/src/javascripts/ui/hooks/file-upload-hooks.js +2 -3
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +3 -3
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +1 -1
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +5 -5
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +2 -2
- package/src/javascripts/ui/hooks/use-seamly-activity-event-handler.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-commands.js +12 -12
- package/src/javascripts/ui/hooks/use-seamly-dispatch.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +9 -9
- package/src/javascripts/ui/hooks/use-seamly-resume-conversation-prompt.js +2 -2
- package/src/javascripts/ui/hooks/use-single-file-upload.js +2 -2
- package/src/javascripts/ui/hooks/utility-hooks.js +1 -1
- package/src/javascripts/ui/utils/seamly-utils.js +9 -2
- package/src/stylesheets/4-base/_formelements.scss +3 -3
- package/src/stylesheets/5-components/_buttons.scss +1 -1
- package/src/stylesheets/5-components/_input.scss +2 -2
- package/src/stylesheets/5-components/_message-body.scss +19 -12
- package/src/stylesheets/6-default-implementation/_hover.scss +24 -12
- package/src/stylesheets/7-deprecated/4-base/_formelements.scss +4 -4
- package/src/stylesheets/7-deprecated/5-components/_buttons.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_input.scss +1 -1
- package/src/stylesheets/7-deprecated/5-components/_message.scss +4 -3
- package/src/stylesheets/7-deprecated/5-components/_options.scss +2 -2
- package/webpack/config.common.js +5 -0
- package/webpack/config.package.js +3 -0
- package/src/javascripts/domains/config/middleware.js +0 -22
|
@@ -62,23 +62,8 @@ const avatar =
|
|
|
62
62
|
|
|
63
63
|
const participantInfo = {
|
|
64
64
|
participants: {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
id: 'e65fa8dc-97ab-4711-8fec-82bae6461aa2',
|
|
68
|
-
introduction: "You're now talking to {{name}} gimme a minit",
|
|
69
|
-
name: 'Mrs. Bot',
|
|
70
|
-
service: {
|
|
71
|
-
expose: { map: {}, version: 2 },
|
|
72
|
-
meta: {},
|
|
73
|
-
name: null,
|
|
74
|
-
service_session_id: null,
|
|
75
|
-
settings: {},
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
'e65fa8dc-97ab-4711-8fec-82bae6461aa3': {
|
|
79
|
-
id: 'e65fa8dc-97ab-4711-8fec-82bae6461aa3',
|
|
80
|
-
introduction: "You're now talking to {{name}} gimme a minit",
|
|
81
|
-
name: 'Mrs. Bot',
|
|
65
|
+
agent: {
|
|
66
|
+
id: 'agent',
|
|
82
67
|
service: {
|
|
83
68
|
expose: { map: {}, version: 2 },
|
|
84
69
|
meta: {},
|
|
@@ -87,11 +72,8 @@ const participantInfo = {
|
|
|
87
72
|
settings: {},
|
|
88
73
|
},
|
|
89
74
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
id: 'seamly-client-participant',
|
|
93
|
-
introduction: null,
|
|
94
|
-
name: 'User',
|
|
75
|
+
user: {
|
|
76
|
+
id: 'user',
|
|
95
77
|
service: {
|
|
96
78
|
expose: { map: {}, version: 2 },
|
|
97
79
|
meta: {},
|
|
@@ -101,7 +83,7 @@ const participantInfo = {
|
|
|
101
83
|
},
|
|
102
84
|
},
|
|
103
85
|
},
|
|
104
|
-
currentAgent: '
|
|
86
|
+
currentAgent: 'agent',
|
|
105
87
|
}
|
|
106
88
|
|
|
107
89
|
const newTopicDivider = {
|
|
@@ -215,7 +197,7 @@ const participantMessage = {
|
|
|
215
197
|
messageStatus: 'received',
|
|
216
198
|
participant: {
|
|
217
199
|
avatar,
|
|
218
|
-
id: '
|
|
200
|
+
id: 'agent',
|
|
219
201
|
introduction: "You're now talking to {{name}} gimme a minit",
|
|
220
202
|
name: 'Mrs. Bot',
|
|
221
203
|
service: {
|
|
@@ -239,7 +221,7 @@ const participantMessageDefaultIcon = {
|
|
|
239
221
|
id: randomId(),
|
|
240
222
|
messageStatus: 'received',
|
|
241
223
|
participant: {
|
|
242
|
-
id: '
|
|
224
|
+
id: 'user',
|
|
243
225
|
introduction: "You're now talking to {{name}} gimme a minit",
|
|
244
226
|
name: 'Mrs. Bot',
|
|
245
227
|
service: {
|
|
@@ -264,7 +246,7 @@ const getCustomMessage = ({ type, data, text }) => ({
|
|
|
264
246
|
data,
|
|
265
247
|
variables: {},
|
|
266
248
|
},
|
|
267
|
-
participant: '
|
|
249
|
+
participant: 'agent',
|
|
268
250
|
service: {
|
|
269
251
|
meta: { additions: {} },
|
|
270
252
|
name: 'bot',
|
|
@@ -292,7 +274,7 @@ const shortTextMessage = {
|
|
|
292
274
|
fromHistory: true,
|
|
293
275
|
id: randomId(),
|
|
294
276
|
messageStatus: 'read',
|
|
295
|
-
participant: '
|
|
277
|
+
participant: 'agent',
|
|
296
278
|
service: {
|
|
297
279
|
meta: { additions: {} },
|
|
298
280
|
name: 'bot',
|
|
@@ -331,7 +313,7 @@ const ctaMessage = {
|
|
|
331
313
|
fromHistory: true,
|
|
332
314
|
id: 'f5351010-0def-452d-818f-ca22ac61792z',
|
|
333
315
|
messageStatus: 'read',
|
|
334
|
-
participant: '
|
|
316
|
+
participant: 'agent',
|
|
335
317
|
service: {
|
|
336
318
|
meta: { additions: { hideFeedback: 'true' } },
|
|
337
319
|
name: 'bot',
|
|
@@ -354,7 +336,7 @@ const longTextMessage = {
|
|
|
354
336
|
fromHistory: true,
|
|
355
337
|
id: randomId(),
|
|
356
338
|
messageStatus: 'read',
|
|
357
|
-
participant: '
|
|
339
|
+
participant: 'agent',
|
|
358
340
|
service: {
|
|
359
341
|
meta: { additions: {} },
|
|
360
342
|
name: 'bot',
|
|
@@ -378,7 +360,7 @@ const textMessageBoldItalicUnderline = {
|
|
|
378
360
|
fromHistory: true,
|
|
379
361
|
id: randomId(),
|
|
380
362
|
messageStatus: 'read',
|
|
381
|
-
participant: '
|
|
363
|
+
participant: 'agent',
|
|
382
364
|
service: {
|
|
383
365
|
meta: { additions: { hideFeedback: 'true' } },
|
|
384
366
|
name: 'bot',
|
|
@@ -417,7 +399,7 @@ const textMessageWithLinks = {
|
|
|
417
399
|
fromHistory: true,
|
|
418
400
|
id: randomId(),
|
|
419
401
|
messageStatus: 'read',
|
|
420
|
-
participant: '
|
|
402
|
+
participant: 'agent',
|
|
421
403
|
service: {
|
|
422
404
|
meta: { additions: { hideFeedback: 'true' } },
|
|
423
405
|
name: 'bot',
|
|
@@ -449,7 +431,7 @@ const textMessageWithLongLink = {
|
|
|
449
431
|
fromHistory: true,
|
|
450
432
|
id: 'a964e54e-ea98-46ff-a952-979a47f162c0',
|
|
451
433
|
messageStatus: 'read',
|
|
452
|
-
participant: '
|
|
434
|
+
participant: 'agent',
|
|
453
435
|
service: {
|
|
454
436
|
meta: { additions: { hideFeedback: 'true' } },
|
|
455
437
|
name: 'bot',
|
|
@@ -473,7 +455,7 @@ const textMesageWithBullets = {
|
|
|
473
455
|
fromHistory: true,
|
|
474
456
|
id: 'f5351010-0def-452d-818f-ca22ac61792a',
|
|
475
457
|
messageStatus: 'read',
|
|
476
|
-
participant: '
|
|
458
|
+
participant: 'agent',
|
|
477
459
|
service: {
|
|
478
460
|
meta: { additions: { hideFeedback: 'true' } },
|
|
479
461
|
name: 'bot',
|
|
@@ -498,7 +480,7 @@ const imageMessage = {
|
|
|
498
480
|
fromHistory: true,
|
|
499
481
|
id: 'b44ef42c-880c-43ff-b067-499e7f2e81f7',
|
|
500
482
|
messageStatus: 'read',
|
|
501
|
-
participant: '
|
|
483
|
+
participant: 'agent',
|
|
502
484
|
service: {
|
|
503
485
|
meta: { additions: { hideFeedback: 'true' } },
|
|
504
486
|
name: 'bot',
|
|
@@ -523,7 +505,7 @@ const imageMessageWithLightbox = {
|
|
|
523
505
|
fromHistory: true,
|
|
524
506
|
id: 'b44ef42c-880c-43ff-b067-499e7f2e81f8',
|
|
525
507
|
messageStatus: 'read',
|
|
526
|
-
participant: '
|
|
508
|
+
participant: 'agent',
|
|
527
509
|
service: {
|
|
528
510
|
meta: { additions: { hideFeedback: 'true' } },
|
|
529
511
|
name: 'bot',
|
|
@@ -548,7 +530,7 @@ const videoMessage = {
|
|
|
548
530
|
fromHistory: true,
|
|
549
531
|
id: randomId(),
|
|
550
532
|
messageStatus: 'read',
|
|
551
|
-
participant: '
|
|
533
|
+
participant: 'agent',
|
|
552
534
|
service: {
|
|
553
535
|
meta: { additions: { hideFeedback: 'true' } },
|
|
554
536
|
name: 'bot',
|
|
@@ -604,7 +586,7 @@ const choicePromptMessage = {
|
|
|
604
586
|
fromHistory: true,
|
|
605
587
|
id: randomId(),
|
|
606
588
|
messageStatus: 'read',
|
|
607
|
-
participant: '
|
|
589
|
+
participant: 'agent',
|
|
608
590
|
service: {
|
|
609
591
|
meta: { additions: {} },
|
|
610
592
|
name: 'bot',
|
|
@@ -628,7 +610,7 @@ const userMessage = {
|
|
|
628
610
|
fromHistory: true,
|
|
629
611
|
id: randomId(),
|
|
630
612
|
messageStatus: 'read',
|
|
631
|
-
participant: '
|
|
613
|
+
participant: 'user',
|
|
632
614
|
transactionId: '1cdefea9-7437-4672-bcf8-2c75dc99244c',
|
|
633
615
|
transactionLast: null,
|
|
634
616
|
type: 'text',
|
|
@@ -647,7 +629,7 @@ const userMessageLong = {
|
|
|
647
629
|
fromHistory: true,
|
|
648
630
|
id: randomId(),
|
|
649
631
|
messageStatus: 'read',
|
|
650
|
-
participant: '
|
|
632
|
+
participant: 'user',
|
|
651
633
|
transactionId: '1cdefea9-7437-4672-bcf8-2c75dc99244c',
|
|
652
634
|
transactionLast: null,
|
|
653
635
|
type: 'text',
|
|
@@ -671,7 +653,7 @@ const fileDownloadAgentMessage = {
|
|
|
671
653
|
payload: {
|
|
672
654
|
...fileDownloadPayload,
|
|
673
655
|
fromClient: false,
|
|
674
|
-
participant: '
|
|
656
|
+
participant: 'agent',
|
|
675
657
|
id: randomId(),
|
|
676
658
|
},
|
|
677
659
|
}
|
|
@@ -692,7 +674,7 @@ const fileDownloadUserMessage = {
|
|
|
692
674
|
payload: {
|
|
693
675
|
...fileDownloadPayload,
|
|
694
676
|
fromClient: true,
|
|
695
|
-
participant: '
|
|
677
|
+
participant: 'user',
|
|
696
678
|
id: randomId(),
|
|
697
679
|
},
|
|
698
680
|
}
|
|
@@ -25,7 +25,18 @@ class SeamlyStyleGuideInstance extends Engine {
|
|
|
25
25
|
const translations = await api.getTranslations(
|
|
26
26
|
this.config.context.locale || 'en-GB',
|
|
27
27
|
)
|
|
28
|
-
|
|
28
|
+
const { agentParticipant, userParticipant } = await api.getConfig()
|
|
29
|
+
const participants = [
|
|
30
|
+
{
|
|
31
|
+
id: 'user',
|
|
32
|
+
...userParticipant,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: 'agent',
|
|
36
|
+
introduction: 'I am {{name}}',
|
|
37
|
+
...agentParticipant,
|
|
38
|
+
},
|
|
39
|
+
]
|
|
29
40
|
const renderConfig = {
|
|
30
41
|
...this.config,
|
|
31
42
|
customComponents: Object.keys(restComponents).length
|
|
@@ -38,6 +49,7 @@ class SeamlyStyleGuideInstance extends Engine {
|
|
|
38
49
|
config={renderConfig}
|
|
39
50
|
styleGuideConfig={this.styleGuideConfig}
|
|
40
51
|
translations={translations}
|
|
52
|
+
participants={participants}
|
|
41
53
|
/>,
|
|
42
54
|
this.parentElement,
|
|
43
55
|
)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useSeamlyOptions } from '
|
|
2
|
-
import { className } from '
|
|
3
|
-
import OptionsButton from '
|
|
1
|
+
import { useSeamlyOptions } from 'ui/hooks/seamly-hooks'
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import OptionsButton from 'ui/components/options/options-button'
|
|
4
4
|
import {
|
|
5
5
|
useTranslations,
|
|
6
6
|
OptionsButton as TranslationsOptionsButton,
|
|
7
|
-
} from '
|
|
7
|
+
} from 'domains/translations'
|
|
8
8
|
|
|
9
9
|
export default function AppOptions() {
|
|
10
10
|
const { menuOptions, allowOptionSelection } = useSeamlyOptions()
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import { useConfig } from '
|
|
2
|
+
import { useConfig } from 'domains/config'
|
|
3
3
|
import ComponentContext from './component-context'
|
|
4
4
|
import ChoicePrompt from './event/choice-prompt'
|
|
5
5
|
import Text from './event/text'
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useRef, useEffect } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import { useI18n } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import { useI18n } from 'domains/i18n'
|
|
4
4
|
import {
|
|
5
5
|
useSeamlyIsLoading,
|
|
6
6
|
useSkiplink,
|
|
7
7
|
useSkiplinkTargetFocusing,
|
|
8
|
-
} from '
|
|
9
|
-
import { useEvents } from '
|
|
8
|
+
} from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import { useEvents } from 'ui/hooks/seamly-state-hooks'
|
|
10
|
+
import PrivacyDisclaimer from 'ui/components/layout/privacy-disclaimer'
|
|
11
|
+
import { useVisibility } from 'domains/visibility'
|
|
10
12
|
import Event from './event/event'
|
|
11
13
|
import Loader from './loader'
|
|
12
14
|
import ComponentFilter from './component-filter'
|
|
13
|
-
import PrivacyDisclaimer from '../layout/privacy-disclaimer'
|
|
14
|
-
import { useVisibility } from '../../../domains/visibility'
|
|
15
15
|
|
|
16
16
|
const Conversation = () => {
|
|
17
17
|
const { t } = useI18n()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useCallback, useEffect, useMemo, useRef } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import parseBody from '
|
|
4
|
-
import { useGeneratedId, useSeamlyCommands } from '
|
|
5
|
-
import { cardTypes, actionTypes } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import parseBody from 'lib/parse-body'
|
|
4
|
+
import { useGeneratedId, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
5
|
+
import { cardTypes, actionTypes } from 'ui/utils/seamly-utils'
|
|
6
6
|
|
|
7
7
|
const CardComponent = ({
|
|
8
8
|
id,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useGeneratedId } from '
|
|
2
|
-
import MessageContainer from '
|
|
3
|
-
import { useTranslatedEventData } from '
|
|
1
|
+
import { useGeneratedId } from 'ui/hooks/seamly-hooks'
|
|
2
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
4
4
|
import CardComponent from './card-component'
|
|
5
5
|
|
|
6
6
|
const CardMessage = ({ event }) => {
|
package/src/javascripts/ui/components/conversation/event/carousel-component/components/controls.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import Icon from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import Icon from 'ui/components/layout/icon'
|
|
4
4
|
|
|
5
5
|
export default function CarouselControls({
|
|
6
6
|
items,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRef } from 'preact'
|
|
2
2
|
import { useState, useEffect, useRef, useMemo } from 'preact/hooks'
|
|
3
|
-
import { className } from '
|
|
4
|
-
import { useGeneratedId } from '
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
|
+
import { useGeneratedId } from 'ui/hooks/utility-hooks'
|
|
5
|
+
import CarouselMessageSlide from 'ui/components/conversation/event/carousel-message/components/slide'
|
|
5
6
|
import CarouselPagination from './components/pagination'
|
|
6
7
|
import CarouselControls from './components/controls'
|
|
7
|
-
import CarouselMessageSlide from '../carousel-message/components/slide'
|
|
8
8
|
|
|
9
9
|
const defaultGetItemKey = (item, idx, prefix) => `${prefix}${idx}`
|
|
10
10
|
const defaultGetItemLabel = (item) => item.label
|
package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import CardComponent from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import CardComponent from 'ui/components/conversation/event/card-component'
|
|
4
4
|
|
|
5
5
|
export default function CarouselMessageSlide({
|
|
6
6
|
item: slide,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import MessageContainer from '
|
|
2
|
-
import CarouselComponent from '
|
|
3
|
-
import { useTranslatedEventData } from '
|
|
1
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
2
|
+
import CarouselComponent from 'ui/components/conversation/event/carousel-component'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
4
4
|
import CarouselMessageSlide from './components/slide'
|
|
5
5
|
|
|
6
6
|
const getItemKey = (item, idx, prefix = '') => `${prefix}${item.title}:${idx}`
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
useSeamlyServiceInfo,
|
|
6
6
|
useLastMessageEventId,
|
|
7
7
|
useGeneratedId,
|
|
8
|
-
} from '
|
|
9
|
-
import { className } from '
|
|
10
|
-
import { actionTypes } from '
|
|
11
|
-
import Icon from '
|
|
12
|
-
import { useI18n } from '
|
|
13
|
-
import { useTranslatedEventData } from '
|
|
14
|
-
import MessageContainer from '
|
|
8
|
+
} from 'ui/hooks/seamly-hooks'
|
|
9
|
+
import { className } from 'lib/css'
|
|
10
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
11
|
+
import Icon from 'ui/components/layout/icon'
|
|
12
|
+
import { useI18n } from 'domains/i18n'
|
|
13
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
14
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
15
15
|
|
|
16
16
|
export const useChoicePrompt = (event) => {
|
|
17
17
|
const { payload } = event
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useCallback } from 'preact/hooks'
|
|
2
|
-
import { className } from '
|
|
3
|
-
import parseBody from '
|
|
4
|
-
import { useGeneratedId, useSeamlyCommands } from '
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import parseBody from 'lib/parse-body'
|
|
4
|
+
import { useGeneratedId, useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
5
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
6
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
7
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
5
8
|
import useEventLinkClickHandler from './hooks/use-event-link-click-handler'
|
|
6
|
-
import { actionTypes } from '../../../utils/seamly-utils'
|
|
7
|
-
import MessageContainer from '../message-container'
|
|
8
|
-
import { useTranslatedEventData } from '../../../../domains/translations'
|
|
9
9
|
|
|
10
10
|
const Cta = ({ event }) => {
|
|
11
11
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { dividerKeys } from '
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import EventDivider from '
|
|
1
|
+
import { dividerKeys } from 'ui/utils/seamly-utils'
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import EventDivider from 'ui/components/conversation/event-divider'
|
|
4
4
|
|
|
5
5
|
const dividerTypes = {
|
|
6
6
|
[dividerKeys.new_topic]: 'newtopic',
|
package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '
|
|
3
|
-
import EventDivider from '
|
|
4
|
-
import { className } from '
|
|
5
|
-
import { useTranslations } from '
|
|
2
|
+
import { useI18n } from 'domains/i18n'
|
|
3
|
+
import EventDivider from 'ui/components/conversation/event-divider'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
|
+
import { useTranslations } from 'domains/translations'
|
|
6
6
|
|
|
7
7
|
const NewTranslationDivider = ({ event }) => {
|
|
8
8
|
const { t } = useI18n()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useEffect } from 'preact/hooks'
|
|
2
|
-
import EventDivider from '
|
|
3
|
-
import { className } from '
|
|
4
|
-
import { microsecondsToMilliseconds } from '
|
|
5
|
-
import { useFormattedDate } from '
|
|
6
|
-
import { useForceUpdate } from '
|
|
2
|
+
import EventDivider from 'ui/components/conversation/event-divider'
|
|
3
|
+
import { className } from 'lib/css'
|
|
4
|
+
import { microsecondsToMilliseconds } from 'ui/utils/general-utils'
|
|
5
|
+
import { useFormattedDate } from 'ui/components/conversation/event/hooks/use-formatted-date'
|
|
6
|
+
import { useForceUpdate } from 'ui/hooks/utility-hooks'
|
|
7
7
|
|
|
8
8
|
const TimeIndicator = ({ event }) => {
|
|
9
9
|
const forceUpdate = useForceUpdate()
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { useSeamlyParticipant } from '
|
|
2
|
-
import { className } from '
|
|
3
|
-
import { useConfig } from '
|
|
1
|
+
import { useSeamlyParticipant } from 'ui/hooks/seamly-hooks'
|
|
2
|
+
import { className } from 'lib/css'
|
|
3
|
+
import { useConfig } from 'domains/config'
|
|
4
|
+
import { useI18n } from 'domains/i18n'
|
|
4
5
|
|
|
5
6
|
const EventParticipant = ({ eventPayload }) => {
|
|
7
|
+
const { t } = useI18n()
|
|
6
8
|
const { fromClient, participant: participantId } = eventPayload
|
|
7
9
|
const participant = useSeamlyParticipant(participantId) || {}
|
|
8
|
-
const { messages
|
|
10
|
+
const { messages } = useConfig()
|
|
9
11
|
|
|
10
|
-
const participantName =
|
|
12
|
+
const participantName = fromClient
|
|
13
|
+
? t('participants.user.name')
|
|
14
|
+
: participant && participant.name
|
|
11
15
|
const { showAvatar, showName } = messages[fromClient ? 'user' : 'agent'] || {}
|
|
12
|
-
const { userName } = defaults || {}
|
|
13
16
|
|
|
14
17
|
if (!showAvatar && !showName) {
|
|
15
18
|
return null
|
|
@@ -25,11 +28,11 @@ const EventParticipant = ({ eventPayload }) => {
|
|
|
25
28
|
)
|
|
26
29
|
}
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
if (showName && authorName) {
|
|
31
|
+
if (showName) {
|
|
31
32
|
authorInfo.push(
|
|
32
|
-
<span className={className('message__author-name')}>
|
|
33
|
+
<span className={className('message__author-name')}>
|
|
34
|
+
{participantName}
|
|
35
|
+
</span>,
|
|
33
36
|
)
|
|
34
37
|
}
|
|
35
38
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { className } from '
|
|
2
|
-
import useEventComponentMapping from '
|
|
1
|
+
import { className } from 'lib/css'
|
|
2
|
+
import useEventComponentMapping from 'ui/hooks/use-event-component-mapping'
|
|
3
3
|
import TimeIndicator from './divider/variants/time-indicator'
|
|
4
4
|
|
|
5
5
|
const Event = ({ event, newParticipant }) => {
|
package/src/javascripts/ui/components/conversation/event/hooks/use-event-link-click-handler.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { actionTypes } from '
|
|
2
|
-
import { useSeamlyCommands } from '
|
|
1
|
+
import { actionTypes } from 'ui/utils/seamly-utils'
|
|
2
|
+
import { useSeamlyCommands } from 'ui/hooks/seamly-hooks'
|
|
3
3
|
|
|
4
4
|
const useEventLinkClickHandler = (eventId) => {
|
|
5
5
|
const { sendAction } = useSeamlyCommands()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useI18n } from '
|
|
2
|
-
import { getRelativeDate } from '
|
|
3
|
-
import { useConfig } from '
|
|
1
|
+
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import { getRelativeDate } from 'ui/utils/general-utils'
|
|
3
|
+
import { useConfig } from 'domains/config'
|
|
4
4
|
|
|
5
5
|
const dateFormatOptions = { month: 'long', day: 'numeric', year: 'numeric' }
|
|
6
6
|
const timeFormatOptions = { hour: 'numeric', minute: 'numeric' }
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks'
|
|
2
|
-
import Lightbox from '
|
|
3
|
-
import { useI18n } from '
|
|
4
|
-
import { className } from '
|
|
5
|
-
import Icon from '
|
|
2
|
+
import Lightbox from 'ui/components/widgets/lightbox'
|
|
3
|
+
import { useI18n } from 'domains/i18n'
|
|
4
|
+
import { className } from 'lib/css'
|
|
5
|
+
import Icon from 'ui/components/layout/icon'
|
|
6
6
|
|
|
7
7
|
const ImageLightbox = ({ description, url }) => {
|
|
8
8
|
const { t } = useI18n()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'preact/hooks'
|
|
2
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
2
4
|
import ImageLightbox from './image-lightbox'
|
|
3
|
-
import MessageContainer from '../message-container'
|
|
4
|
-
import { useTranslatedEventData } from '../../../../domains/translations'
|
|
5
5
|
|
|
6
6
|
const Image = ({ event, descriptorId, ...props }) => {
|
|
7
7
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
2
|
import Mustache from 'mustache'
|
|
3
|
-
import parseBody from '
|
|
4
|
-
import EventDivider from '
|
|
5
|
-
import { useTranslatedEventData } from '
|
|
6
|
-
import {
|
|
3
|
+
import parseBody from 'lib/parse-body'
|
|
4
|
+
import EventDivider from 'ui/components/conversation/event-divider'
|
|
5
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
6
|
+
import { useParticipants } from 'domains/config'
|
|
7
7
|
|
|
8
8
|
const Participant = ({ event }) => {
|
|
9
|
-
const {
|
|
9
|
+
const { agent } = useParticipants()
|
|
10
10
|
|
|
11
11
|
const { participant } = event.payload
|
|
12
12
|
const [introduction] = useTranslatedEventData(event)
|
|
@@ -21,7 +21,7 @@ const Participant = ({ event }) => {
|
|
|
21
21
|
return null
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
const avatar = participant.avatar ||
|
|
24
|
+
const avatar = participant.avatar || agent?.avatar
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<EventDivider
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import parseBody from '
|
|
2
|
+
import parseBody from 'lib/parse-body'
|
|
3
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
4
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
3
5
|
import useEventLinkClickHandler from './hooks/use-event-link-click-handler'
|
|
4
6
|
import { parseRichText } from './hooks/use-text-rendering'
|
|
5
|
-
import MessageContainer from '../message-container'
|
|
6
|
-
import { useTranslatedEventData } from '../../../../domains/translations'
|
|
7
7
|
|
|
8
8
|
const Text = ({ event, ...props }) => {
|
|
9
9
|
const [body] = useTranslatedEventData(event)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useI18n } from '
|
|
2
|
-
import MessageContainer from '
|
|
3
|
-
import { useTranslatedEventData } from '
|
|
1
|
+
import { useI18n } from 'domains/i18n'
|
|
2
|
+
import MessageContainer from 'ui/components/conversation/message-container'
|
|
3
|
+
import { useTranslatedEventData } from 'domains/translations'
|
|
4
4
|
|
|
5
5
|
const Translation = ({ event, ...props }) => {
|
|
6
6
|
const { t } = useI18n()
|