@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.
- package/build/dist/lib/index.debug.js +598 -136
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +190 -22
- package/build/dist/lib/index.js +4745 -4468
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/standalone.js +4839 -4465
- package/build/dist/lib/standalone.min.js +1 -1
- package/build/dist/lib/standalone.min.js.LICENSE.txt +1 -1
- package/build/dist/lib/style-guide.js +1770 -980
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/build/dist/lib/utils.js +0 -1
- package/build/dist/lib/utils.min.js +1 -1
- package/package.json +29 -29
- package/src/javascripts/api/index.js +33 -48
- package/src/javascripts/api/producer.js +9 -12
- package/src/javascripts/config.js +9 -11
- package/src/javascripts/domains/app/actions.js +43 -0
- package/src/javascripts/domains/app/hooks.js +6 -0
- package/src/javascripts/domains/app/index.js +6 -0
- package/src/javascripts/domains/app/reducer.js +16 -0
- package/src/javascripts/domains/app/selectors.js +8 -0
- package/src/javascripts/domains/app/utils.js +4 -0
- package/src/javascripts/domains/config/actions.js +4 -0
- package/src/javascripts/domains/config/hooks.js +6 -0
- package/src/javascripts/domains/config/index.js +8 -0
- package/src/javascripts/domains/config/middleware.js +22 -0
- package/src/javascripts/domains/config/reducer.js +63 -0
- package/src/javascripts/domains/config/selectors.js +23 -0
- package/src/javascripts/domains/config/utils.js +4 -0
- package/src/javascripts/domains/forms/actions.js +2 -4
- package/src/javascripts/domains/forms/hooks.js +10 -14
- package/src/javascripts/domains/forms/provider.js +4 -6
- package/src/javascripts/domains/forms/reducer.js +1 -2
- package/src/javascripts/domains/forms/selectors.js +4 -4
- package/src/javascripts/domains/forms/utils.js +5 -0
- package/src/javascripts/domains/i18n/actions.js +35 -0
- package/src/javascripts/domains/i18n/hooks.js +38 -0
- package/src/javascripts/domains/i18n/index.js +5 -80
- package/src/javascripts/domains/i18n/reducer.js +58 -0
- package/src/javascripts/domains/i18n/selectors.js +15 -0
- package/src/javascripts/domains/i18n/utils.js +9 -0
- package/src/javascripts/domains/interrupt/actions.js +4 -0
- package/src/javascripts/domains/interrupt/hooks.js +29 -0
- package/src/javascripts/domains/interrupt/index.js +9 -0
- package/src/javascripts/domains/interrupt/middleware.js +30 -0
- package/src/javascripts/domains/interrupt/reducer.js +21 -0
- package/src/javascripts/domains/interrupt/selectors.js +6 -0
- package/src/javascripts/domains/interrupt/utils.js +4 -0
- package/src/javascripts/domains/options/index.js +1 -0
- package/src/javascripts/domains/options/middleware.js +35 -0
- package/src/javascripts/domains/redux/create-redux-store.js +14 -6
- package/src/javascripts/domains/redux/hooks.js +3 -2
- package/src/javascripts/domains/redux/index.js +2 -1
- package/src/javascripts/domains/redux/provider.js +5 -0
- package/src/javascripts/domains/store/index.js +44 -0
- package/src/javascripts/{ui → domains}/store/state-reducer.js +4 -7
- package/src/javascripts/domains/translations/actions.js +4 -6
- package/src/javascripts/domains/translations/components/chat-status.js +7 -13
- package/src/javascripts/domains/translations/components/options-button.js +3 -3
- package/src/javascripts/domains/translations/components/options-dialog/form.js +12 -7
- package/src/javascripts/domains/translations/components/options-dialog/index.js +2 -5
- package/src/javascripts/domains/translations/hooks.js +1 -1
- package/src/javascripts/domains/translations/index.js +1 -0
- package/src/javascripts/domains/translations/middleware.js +43 -0
- package/src/javascripts/domains/translations/reducer.js +4 -11
- package/src/javascripts/domains/translations/selectors.js +3 -3
- package/src/javascripts/domains/translations/utils.js +4 -0
- package/src/javascripts/index.js +20 -5
- package/src/javascripts/lib/css.js +5 -5
- package/src/javascripts/lib/engine/index.js +39 -11
- package/src/javascripts/lib/external-api/index.js +6 -6
- package/src/javascripts/lib/mutex.js +30 -0
- package/src/javascripts/lib/parse-body.js +1 -1
- package/src/javascripts/lib/redux-helpers/index.js +25 -8
- package/src/javascripts/lib/split-url-params.js +2 -2
- package/src/javascripts/lib/store/providers/app-storage.js +1 -1
- package/src/javascripts/lib/store/providers/cookie-storage.js +1 -1
- package/src/javascripts/package/utils.js +0 -1
- package/src/javascripts/style-guide/components/app.js +12 -14
- package/src/javascripts/style-guide/components/links.js +6 -6
- package/src/javascripts/style-guide/components/static-core.js +32 -10
- package/src/javascripts/style-guide/state-helpers/index.js +1 -1
- package/src/javascripts/style-guide/states.js +29 -71
- package/src/javascripts/style-guide/style-guide-engine.js +13 -12
- package/src/javascripts/ui/components/chat-app.js +2 -2
- package/src/javascripts/ui/components/conversation/component-filter.js +2 -2
- package/src/javascripts/ui/components/conversation/conversation.js +2 -2
- package/src/javascripts/ui/components/conversation/event/card-component.js +24 -3
- package/src/javascripts/ui/components/conversation/event/carousel-component/components/pagination.js +2 -2
- package/src/javascripts/ui/components/conversation/event/carousel-component/index.js +4 -3
- package/src/javascripts/ui/components/conversation/event/carousel-message/components/slide.js +2 -1
- package/src/javascripts/ui/components/conversation/event/carousel-message/index.js +2 -2
- package/src/javascripts/ui/components/conversation/event/choice-prompt.js +5 -5
- package/src/javascripts/ui/components/conversation/event/divider/variants/new-translation.js +2 -2
- package/src/javascripts/ui/components/conversation/event/event-participant.js +3 -5
- 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/hooks/use-text-rendering.js +3 -3
- package/src/javascripts/ui/components/conversation/event/participant.js +2 -2
- package/src/javascripts/ui/components/conversation/event/upload.js +12 -27
- package/src/javascripts/ui/components/conversation/message-container.js +4 -6
- package/src/javascripts/ui/components/core/seamly-activity-monitor.js +4 -5
- package/src/javascripts/ui/components/core/seamly-core.js +6 -7
- package/src/javascripts/ui/components/core/seamly-event-subscriber.js +18 -17
- package/src/javascripts/ui/components/core/seamly-file-upload.js +5 -6
- package/src/javascripts/ui/components/core/seamly-idle-detach-counter.js +2 -6
- package/src/javascripts/ui/components/core/seamly-initializer.js +7 -60
- package/src/javascripts/ui/components/core/seamly-instance-functions-loader.js +10 -16
- package/src/javascripts/ui/components/core/seamly-live-region.js +1 -1
- package/src/javascripts/ui/components/core/seamly-new-notifications.js +5 -6
- package/src/javascripts/ui/components/core/seamly-read-state.js +8 -6
- package/src/javascripts/ui/components/entry/entry-container.js +7 -10
- package/src/javascripts/ui/components/entry/text-entry/hooks.js +6 -4
- package/src/javascripts/ui/components/entry/text-entry/text-entry-form.js +10 -3
- package/src/javascripts/ui/components/entry/toggle-button.js +24 -10
- package/src/javascripts/ui/components/entry/upload/file-upload-form.js +6 -3
- package/src/javascripts/ui/components/entry/upload/index.js +11 -13
- package/src/javascripts/ui/components/faq/faq.js +6 -6
- package/src/javascripts/ui/components/form-controls/error.js +22 -0
- package/src/javascripts/ui/components/form-controls/file-input.js +3 -9
- package/src/javascripts/ui/components/form-controls/select.js +1 -1
- package/src/javascripts/ui/components/form-controls/wrapper.js +2 -9
- package/src/javascripts/ui/components/layout/agent-info.js +4 -4
- package/src/javascripts/ui/components/layout/app-frame.js +15 -12
- package/src/javascripts/ui/components/layout/chat-frame.js +3 -5
- package/src/javascripts/ui/components/layout/header.js +4 -18
- package/src/javascripts/ui/components/layout/interrupt.js +6 -2
- package/src/javascripts/ui/components/layout/privacy-disclaimer.js +2 -2
- package/src/javascripts/ui/components/options/cobrowsing.js +3 -7
- package/src/javascripts/ui/components/options/options-button.js +9 -13
- package/src/javascripts/ui/components/options/options-frame.js +1 -1
- package/src/javascripts/ui/components/options/transcript/index.js +2 -2
- package/src/javascripts/ui/components/options/transcript/transcript-form.js +1 -1
- package/src/javascripts/ui/components/warnings/cobrowsing-active-frame.js +3 -6
- package/src/javascripts/ui/components/warnings/idle-detach-warning.js +2 -6
- package/src/javascripts/ui/components/warnings/resume-conversation-prompt.js +1 -1
- package/src/javascripts/ui/components/widgets/in-out-transition.js +2 -2
- package/src/javascripts/ui/components/widgets/lightbox.js +4 -4
- package/src/javascripts/ui/components/widgets/modal.js +3 -3
- package/src/javascripts/ui/components/widgets/upload-progress.js +3 -14
- package/src/javascripts/ui/hooks/component-helper-hooks.js +4 -15
- package/src/javascripts/ui/hooks/file-upload-hooks.js +3 -3
- package/src/javascripts/ui/hooks/focus-helper-hooks.js +4 -4
- package/src/javascripts/ui/hooks/live-region-hooks.js +2 -2
- package/src/javascripts/ui/hooks/seamly-api-hooks.js +0 -6
- package/src/javascripts/ui/hooks/seamly-entry-hooks.js +22 -25
- package/src/javascripts/ui/hooks/seamly-hooks.js +3 -10
- package/src/javascripts/ui/hooks/seamly-option-hooks.js +4 -4
- package/src/javascripts/ui/hooks/seamly-state-hooks.js +8 -16
- package/src/javascripts/ui/hooks/use-event-component-mapping.js +1 -1
- package/src/javascripts/ui/hooks/use-seamly-chat.js +1 -0
- package/src/javascripts/ui/hooks/use-seamly-commands.js +31 -54
- package/src/javascripts/ui/hooks/use-seamly-idle-detach-countdown.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-stored-visibility.js +3 -3
- package/src/javascripts/ui/hooks/use-seamly-visibility.js +6 -8
- package/src/javascripts/ui/hooks/use-single-file-upload.js +4 -1
- package/src/javascripts/ui/hooks/utility-hooks.js +2 -2
- package/src/javascripts/ui/utils/form-utils.js +3 -3
- package/src/javascripts/ui/utils/general-utils.js +21 -22
- package/src/javascripts/ui/utils/seamly-utils.js +15 -83
- package/src/javascripts/ui/utils/validations.js +10 -7
- package/src/stylesheets/1-settings/_config.scss +2 -1
- package/src/stylesheets/3-app/_app.scss +3 -4
- package/src/stylesheets/5-components/_card.scss +0 -1
- package/src/stylesheets/5-components/_faq.scss +3 -8
- package/src/stylesheets/5-components/_message.scss +10 -0
- package/src/stylesheets/5-components/_modal.scss +3 -3
- package/src/stylesheets/5-components/_options.scss +3 -2
- package/webpack/config.common.js +3 -3
- package/webpack/config.package.js +4 -22
- package/webpack/config.site.js +8 -6
- package/webpack/defaults.js +0 -3
- package/CHANGELOG.md +0 -561
- package/build/dist/translations/de-informal.js +0 -275
- package/build/dist/translations/de-informal.min.js +0 -1
- package/build/dist/translations/en.js +0 -275
- package/build/dist/translations/en.min.js +0 -1
- package/build/dist/translations/es-informal.js +0 -281
- package/build/dist/translations/es-informal.min.js +0 -1
- package/build/dist/translations/nl-formal.js +0 -275
- package/build/dist/translations/nl-formal.min.js +0 -1
- package/build/dist/translations/nl-informal.js +0 -275
- package/build/dist/translations/nl-informal.min.js +0 -1
- package/src/javascripts/lib/i18n.js +0 -46
- package/src/javascripts/ui/components/core/seamly-api.js +0 -44
- package/src/javascripts/ui/hooks/use-seamly-interrupt.js +0 -62
- package/src/javascripts/ui/store/index.js +0 -37
- package/translations/de-informal.js +0 -237
- package/translations/en.js +0 -234
- package/translations/es-informal.js +0 -243
- package/translations/nl-formal.js +0 -230
- package/translations/nl-informal.js +0 -230
|
@@ -1,275 +0,0 @@
|
|
|
1
|
-
/******/ (() => { // webpackBootstrap
|
|
2
|
-
/******/ "use strict";
|
|
3
|
-
/******/ // The require scope
|
|
4
|
-
/******/ var __webpack_require__ = {};
|
|
5
|
-
/******/
|
|
6
|
-
/************************************************************************/
|
|
7
|
-
/******/ /* webpack/runtime/define property getters */
|
|
8
|
-
/******/ (() => {
|
|
9
|
-
/******/ // define getter functions for harmony exports
|
|
10
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
|
11
|
-
/******/ for(var key in definition) {
|
|
12
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
13
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
14
|
-
/******/ }
|
|
15
|
-
/******/ }
|
|
16
|
-
/******/ };
|
|
17
|
-
/******/ })();
|
|
18
|
-
/******/
|
|
19
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
20
|
-
/******/ (() => {
|
|
21
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
22
|
-
/******/ })();
|
|
23
|
-
/******/
|
|
24
|
-
/******/ /* webpack/runtime/make namespace object */
|
|
25
|
-
/******/ (() => {
|
|
26
|
-
/******/ // define __esModule on exports
|
|
27
|
-
/******/ __webpack_require__.r = (exports) => {
|
|
28
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
29
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
30
|
-
/******/ }
|
|
31
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
32
|
-
/******/ };
|
|
33
|
-
/******/ })();
|
|
34
|
-
/******/
|
|
35
|
-
/************************************************************************/
|
|
36
|
-
var __webpack_exports__ = {};
|
|
37
|
-
__webpack_require__.r(__webpack_exports__);
|
|
38
|
-
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
39
|
-
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
|
40
|
-
/* harmony export */ });
|
|
41
|
-
// Please note: All texts containing the string 'srText' are short for
|
|
42
|
-
// Screen Reader Text. These texts are invisible on screen but broadcast
|
|
43
|
-
// to screen readers. Avoid undue verbosity, but ensure that a user who cannot
|
|
44
|
-
// see the screen will get both the message content as well as the context
|
|
45
|
-
// in which the message occurred if not already clear from the current
|
|
46
|
-
// position of the keyboard focus.
|
|
47
|
-
// Example: An error occurs in the chat window and this error has an 'srText'
|
|
48
|
-
// entry. Because the error could occur while the user is NOT chatting in the window,
|
|
49
|
-
// add context such as "Something went wrong with the chat session" as just saying
|
|
50
|
-
// "Something went wrong" would not be clear enough for users who cannot see the
|
|
51
|
-
// source of the error on screen.
|
|
52
|
-
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
|
|
53
|
-
'carousel.controls.next': 'Volgende',
|
|
54
|
-
'carousel.controls.previous': 'Vorige',
|
|
55
|
-
'carousel.slide.label': ({
|
|
56
|
-
index,
|
|
57
|
-
total
|
|
58
|
-
}) => `${index} van ${total}`,
|
|
59
|
-
'dateTime.srText': ({
|
|
60
|
-
date,
|
|
61
|
-
time
|
|
62
|
-
}) => `Berichten vanaf ${date} om ${time}:`,
|
|
63
|
-
'dateTime.today': 'Vandaag',
|
|
64
|
-
'dateTime.yesterday': 'Gisteren',
|
|
65
|
-
'disclaimer.content': 'Deze chatsessie wordt opgeslagen ter verbetering van onze dienstverlening.',
|
|
66
|
-
'disclaimer.title': 'Privacy disclaimer',
|
|
67
|
-
'dividerKeys.newTopic': 'Nieuw onderwerp gestart.',
|
|
68
|
-
'errors.configError.message': 'Het spijt ons dat dit is gebeurd. Probeer het later opnieuw.',
|
|
69
|
-
'errors.configError.srText': 'Er vond een chat configuratiefout plaats. Onze excuses, probeer het later nogmaals.',
|
|
70
|
-
'errors.configError.title': 'Chat configuratiefout.',
|
|
71
|
-
'errors.general.buttonText': 'Herstart chat',
|
|
72
|
-
'errors.general.message': 'Wil je een nieuwe chatsessie starten?',
|
|
73
|
-
'errors.general.srText': 'Er is iets mis gegaan met de chatsessie. Je kunt de chat herstarten.',
|
|
74
|
-
'errors.general.title': 'Er ging iets mis...',
|
|
75
|
-
'errors.seamlyOffline.message': 'Er is mogelijk een probleem met je internetverbinding. De chatsessie wordt hervat als de verbinding weer beschikbaar is.',
|
|
76
|
-
'errors.seamlyOffline.srText': 'De chat heeft verbindingsproblemen. Er is mogelijk een probleem met je internetverbinding. De chatsessie wordt hervat als de verbinding weer beschikbaar is.',
|
|
77
|
-
'errors.seamlyOffline.title': 'Verbindingsproblemen',
|
|
78
|
-
'faq.headingText': 'Onderwerpsuggesties',
|
|
79
|
-
'faq.srAvailableText': 'Onderwerpsuggesties zijn beschikbaar in de chat.',
|
|
80
|
-
'faq.srUnavailableText': 'Onderwerpsuggesties zijn niet meer beschikbaar in de chat',
|
|
81
|
-
'faq.srUpdatedText': 'Er zijn nieuwe onderwerpsuggesties in de chat.',
|
|
82
|
-
'fileUpload.cancelButtonText': 'Uploaden annuleren',
|
|
83
|
-
'fileUpload.contentHint': size => `Selecteer een bestand van maximaal ${size}`,
|
|
84
|
-
'fileUpload.errors.general': 'Er is iets foutgegaan met het uploaden. Annuleer de upload en probeer het opnieuw.',
|
|
85
|
-
'fileUpload.errors.noFile': 'Kies een bestand om te uploaden',
|
|
86
|
-
'fileUpload.errors.tooLarge': 'Het gekozen bestand is te groot, kies een kleiner bestand',
|
|
87
|
-
'fileUpload.errors.unavailable': 'Bestanden uploaden is op dit moment niet mogelijk. Annuleer de upload en probeer het later opnieuw.',
|
|
88
|
-
'fileUpload.errors.virusFound': 'Het gekozen bestand is onveilig, kies een ander bestand.',
|
|
89
|
-
'fileUpload.errors.wrongType': 'Het geselecteerde bestandstype wordt niet ondersteund. Annuleer de upload en selecteer een ander bestand.',
|
|
90
|
-
'fileUpload.fileUnavailableText': 'Deze downloadlink is verlopen',
|
|
91
|
-
'fileUpload.labelText': 'Kies een bestand',
|
|
92
|
-
'fileUpload.selectedText': fileName => {
|
|
93
|
-
if (fileName) {
|
|
94
|
-
return fileName;
|
|
95
|
-
} else {
|
|
96
|
-
return 'Geen bestand geselecteerd';
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
'fileUpload.srAvailableText': 'Uploaden van bestanden in de chat is nu mogelijk.',
|
|
100
|
-
'fileUpload.srCompleteText': 'Upload voltooid.',
|
|
101
|
-
'fileUpload.srFileUnavailableText': fileName => `Download voor ${fileName} is verlopen`,
|
|
102
|
-
'fileUpload.srFileUploadedText': fileName => `Geüpload bestand ${fileName}.`,
|
|
103
|
-
'fileUpload.srFileDownloadText': fileName => `Download bestand ${fileName}.`,
|
|
104
|
-
'fileUpload.srProgressLabel': fileName => `Uploadvoortgang van ${fileName}`,
|
|
105
|
-
'fileUpload.srStartedText': 'Upload begonnen.',
|
|
106
|
-
'fileUpload.srUnavailableText': 'Uploaden van bestanden in de chat is nu niet meer mogelijk.',
|
|
107
|
-
'fileUpload.toggleButtonText': 'Bestanden uploaden',
|
|
108
|
-
'fileUpload.uploadButtonText': 'Bestand uploaden',
|
|
109
|
-
'header.collapseApp': 'Klap chat in',
|
|
110
|
-
'header.title': 'Je spreekt nu met',
|
|
111
|
-
'idleDetachWarning.continueButton': 'Doorgaan met gesprek',
|
|
112
|
-
'idleDetachWarning.countdownText': 'Het gesprek wordt beëindigd over:',
|
|
113
|
-
'idleDetachWarning.countdownTimer': ({
|
|
114
|
-
minutes,
|
|
115
|
-
seconds
|
|
116
|
-
}) => {
|
|
117
|
-
switch (minutes) {
|
|
118
|
-
case 1:
|
|
119
|
-
switch (seconds) {
|
|
120
|
-
case 1:
|
|
121
|
-
return '1 minuut, 1 seconde';
|
|
122
|
-
|
|
123
|
-
case 0:
|
|
124
|
-
return '1 minuut';
|
|
125
|
-
|
|
126
|
-
default:
|
|
127
|
-
return `1 minuut, ${seconds} seconden`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
case 0:
|
|
131
|
-
switch (seconds) {
|
|
132
|
-
case 1:
|
|
133
|
-
return '1 seconde';
|
|
134
|
-
|
|
135
|
-
case 0:
|
|
136
|
-
default:
|
|
137
|
-
return `${seconds} seconden`;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
default:
|
|
141
|
-
switch (seconds) {
|
|
142
|
-
case 1:
|
|
143
|
-
return `${minutes} minuten, 1 seconde`;
|
|
144
|
-
|
|
145
|
-
case 0:
|
|
146
|
-
return `${minutes} minuten`;
|
|
147
|
-
|
|
148
|
-
default:
|
|
149
|
-
return `${minutes} minuten, ${seconds} seconden`;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
'idleDetachWarning.countdownTitle': 'Ben je er nog?',
|
|
155
|
-
'idleDetachWarning.detachButton': 'Gesprek beëindigen',
|
|
156
|
-
'idleDetachWarning.notifyTransferText': 'Het gesprek wordt beëindigd.',
|
|
157
|
-
'idleDetachWarning.srCountDownStoppedText': 'Automatische gespreks beëindiging geannuleerd. Welkom terug!',
|
|
158
|
-
'info.cobrowsing.cobrowsingEnded': 'Scherm delen is beëindigd',
|
|
159
|
-
'info.cobrowsing.cobrowsingStarted': 'Scherm delen is nu ingeschakeld. De medewerker kan de pagina zien waarop je je momenteel bevindt',
|
|
160
|
-
'info.sendTranscript.accepted': ({
|
|
161
|
-
emailAddress
|
|
162
|
-
}) => `Het chatgesprek wordt per e-mail verstuurd naar ${emailAddress}`,
|
|
163
|
-
'input.inputLabel': limit => {
|
|
164
|
-
if (limit) {
|
|
165
|
-
return `Jouw bericht (max. ${limit} tekens)`;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
return 'Jouw bericht';
|
|
169
|
-
},
|
|
170
|
-
'input.inputPlaceholder': limit => {
|
|
171
|
-
if (limit) {
|
|
172
|
-
return `Jouw bericht (max. ${limit} tekens)`;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return 'Jouw bericht';
|
|
176
|
-
},
|
|
177
|
-
'input.sendMessage': 'Stuur',
|
|
178
|
-
'input.srCharacterLimitText': limit => {
|
|
179
|
-
switch (limit) {
|
|
180
|
-
case 1:
|
|
181
|
-
return '1 teken resterend.';
|
|
182
|
-
|
|
183
|
-
case 0:
|
|
184
|
-
default:
|
|
185
|
-
return `${limit} tekens resterend.`;
|
|
186
|
-
}
|
|
187
|
-
},
|
|
188
|
-
'lightbox.closeLabel': 'Sluiten',
|
|
189
|
-
'lightbox.heading': 'Vergrote chatafbeelding',
|
|
190
|
-
'message.choicePrompts.cancelChooseAgain': 'Kies opnieuw annuleren',
|
|
191
|
-
'message.choicePrompts.chooseAgain': 'Kies opnieuw',
|
|
192
|
-
'message.image.srTextEnlargeButtonLabel': ({
|
|
193
|
-
description
|
|
194
|
-
}) => `Vergroot ${description}`,
|
|
195
|
-
'message.srNewEventCount': ({
|
|
196
|
-
newCount
|
|
197
|
-
}) => {
|
|
198
|
-
switch (newCount) {
|
|
199
|
-
case 1:
|
|
200
|
-
return `Er is 1 nieuw chatbericht.`;
|
|
201
|
-
|
|
202
|
-
case 0:
|
|
203
|
-
default:
|
|
204
|
-
return `Er zijn ${newCount} nieuwe chatberichten.`;
|
|
205
|
-
}
|
|
206
|
-
},
|
|
207
|
-
'message.srTextUnreadCount': ({
|
|
208
|
-
unreadCount
|
|
209
|
-
}) => {
|
|
210
|
-
switch (unreadCount) {
|
|
211
|
-
case 1:
|
|
212
|
-
return `Er is 1 nieuw ongelezen chatbericht.`;
|
|
213
|
-
|
|
214
|
-
case 0:
|
|
215
|
-
default:
|
|
216
|
-
return `Er zijn ${unreadCount} nieuwe ongelezen chatberichten.`;
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
'options.cancelButtonText': 'Annuleren',
|
|
220
|
-
'options.cobrowsing.cobrowsingActiveText': 'Scherm delen actief',
|
|
221
|
-
'options.cobrowsing.cobrowsingUnavailable': 'Het delen van je scherm is nu niet mogelijk.',
|
|
222
|
-
'options.cobrowsing.description': 'Dit zorgt ervoor dat de medewerker je huidige pagina kan zien. Er wordt verder niks gedeeld',
|
|
223
|
-
'options.cobrowsing.labelTurnOff': 'Scherm delen uitzetten',
|
|
224
|
-
'options.cobrowsing.labelTurnOn': 'Scherm delen aanzetten',
|
|
225
|
-
'options.cobrowsing.menuTitle': 'Scherm delen',
|
|
226
|
-
'options.cobrowsing.srCobrowsingAvailable': 'Je kan je scherm nu delen.',
|
|
227
|
-
'options.cobrowsing.srStartedCobrowsingText': 'Scherm delen is aangezet.',
|
|
228
|
-
'options.cobrowsing.srStopCobrowsingText': 'Stop scherm delen',
|
|
229
|
-
'options.cobrowsing.srStoppedCobrowsingText': 'Scherm delen is gestopt',
|
|
230
|
-
'options.cobrowsing.stopCobrowsingText': 'Stop',
|
|
231
|
-
'options.cobrowsing.title': 'Scherm delen',
|
|
232
|
-
'options.openButtonText': 'Opties',
|
|
233
|
-
'options.saveButtonText': 'Opslaan',
|
|
234
|
-
'options.sendTranscript.description': 'Voer het e-mailadres in waarop je het chatgesprek wilt ontvangen.',
|
|
235
|
-
'options.sendTranscript.invalidEmailText': 'Voer een geldig e-mailadres in',
|
|
236
|
-
'options.sendTranscript.label': 'E-mailadres',
|
|
237
|
-
'options.sendTranscript.menuTitle': 'Verstuur gesprek',
|
|
238
|
-
'options.sendTranscript.noEmailText': 'Voer een e-mailadres in',
|
|
239
|
-
'options.sendTranscript.sendButtonText': 'Verstuur',
|
|
240
|
-
'options.sendTranscript.title': 'Verstuur chatgesprek',
|
|
241
|
-
'options.unavailableText': 'niet beschikbaar',
|
|
242
|
-
'resumeConversationPrompt.continueButton': 'Doorgaan met gesprek',
|
|
243
|
-
'resumeConversationPrompt.detachButton': 'Stel een nieuwe vraag',
|
|
244
|
-
'resumeConversationPrompt.title': name => `Wil je doorgaan met het gesprek met ${name}?`,
|
|
245
|
-
skiplinkText: 'Naar invoerbalk',
|
|
246
|
-
'toggleButton.resumeTitle': 'Hervat chat met',
|
|
247
|
-
'toggleButton.subtitle': 'Start een chat met ons',
|
|
248
|
-
'toggleButton.title': 'Heb je een vraag?',
|
|
249
|
-
'translations.divider.restartButtonText': 'Start opnieuw',
|
|
250
|
-
'translations.divider.startText': language => `Vertaling naar ${language}`,
|
|
251
|
-
'translations.divider.stopText': language => `Vertaling naar ${language} beëindigd`,
|
|
252
|
-
'translations.settings.cancelButtonText': 'Annuleren',
|
|
253
|
-
'translations.settings.currentTranslationLabel': 'Momenteel wordt vertaald naar',
|
|
254
|
-
'translations.settings.defaultOptionLabel': 'Kies een taal',
|
|
255
|
-
'translations.settings.description': 'Automatische vertalingen kunnen fouten bevatten.',
|
|
256
|
-
'translations.settings.endButtonText': 'Stop vertaling',
|
|
257
|
-
'translations.settings.inputLabel': 'Vertalen naar',
|
|
258
|
-
'translations.settings.noLocaleText': 'Kies een taal om naar te vertalen',
|
|
259
|
-
'translations.settings.openButtonText': 'Vertaling',
|
|
260
|
-
'translations.settings.startButtonText': 'Start vertaling',
|
|
261
|
-
'translations.settings.title': 'Vertaling',
|
|
262
|
-
'translations.status.label': language => `Vertaling naar ${language}`,
|
|
263
|
-
'translations.status.srStopText': 'Stop vertaling',
|
|
264
|
-
'translations.status.stopText': 'Stop',
|
|
265
|
-
'translations.toggle.hideButtonText': 'Toon origineel',
|
|
266
|
-
'translations.toggle.showButtonText': 'Toon vertaling',
|
|
267
|
-
'window.srModalLayoutLabel': 'Chatvenster',
|
|
268
|
-
'window.srTexts.onClose': 'De chat is gesloten.',
|
|
269
|
-
'window.srTexts.onHistoryLoad': 'Chat geschiedenis is geladen.',
|
|
270
|
-
'window.srTexts.onLoad': 'Chat is beschikbaar op deze pagina.',
|
|
271
|
-
'window.srTexts.onOpen': 'De chat is geopend.'
|
|
272
|
-
});
|
|
273
|
-
module.exports = __webpack_exports__;
|
|
274
|
-
/******/ })()
|
|
275
|
-
;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e={d:(t,n)=>{for(var r in n)e.o(n,r)&&!e.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:n[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{default:()=>n});const n={"carousel.controls.next":"Volgende","carousel.controls.previous":"Vorige","carousel.slide.label":({index:e,total:t})=>`${e} van ${t}`,"dateTime.srText":({date:e,time:t})=>`Berichten vanaf ${e} om ${t}:`,"dateTime.today":"Vandaag","dateTime.yesterday":"Gisteren","disclaimer.content":"Deze chatsessie wordt opgeslagen ter verbetering van onze dienstverlening.","disclaimer.title":"Privacy disclaimer","dividerKeys.newTopic":"Nieuw onderwerp gestart.","errors.configError.message":"Het spijt ons dat dit is gebeurd. Probeer het later opnieuw.","errors.configError.srText":"Er vond een chat configuratiefout plaats. Onze excuses, probeer het later nogmaals.","errors.configError.title":"Chat configuratiefout.","errors.general.buttonText":"Herstart chat","errors.general.message":"Wil je een nieuwe chatsessie starten?","errors.general.srText":"Er is iets mis gegaan met de chatsessie. Je kunt de chat herstarten.","errors.general.title":"Er ging iets mis...","errors.seamlyOffline.message":"Er is mogelijk een probleem met je internetverbinding. De chatsessie wordt hervat als de verbinding weer beschikbaar is.","errors.seamlyOffline.srText":"De chat heeft verbindingsproblemen. Er is mogelijk een probleem met je internetverbinding. De chatsessie wordt hervat als de verbinding weer beschikbaar is.","errors.seamlyOffline.title":"Verbindingsproblemen","faq.headingText":"Onderwerpsuggesties","faq.srAvailableText":"Onderwerpsuggesties zijn beschikbaar in de chat.","faq.srUnavailableText":"Onderwerpsuggesties zijn niet meer beschikbaar in de chat","faq.srUpdatedText":"Er zijn nieuwe onderwerpsuggesties in de chat.","fileUpload.cancelButtonText":"Uploaden annuleren","fileUpload.contentHint":e=>`Selecteer een bestand van maximaal ${e}`,"fileUpload.errors.general":"Er is iets foutgegaan met het uploaden. Annuleer de upload en probeer het opnieuw.","fileUpload.errors.noFile":"Kies een bestand om te uploaden","fileUpload.errors.tooLarge":"Het gekozen bestand is te groot, kies een kleiner bestand","fileUpload.errors.unavailable":"Bestanden uploaden is op dit moment niet mogelijk. Annuleer de upload en probeer het later opnieuw.","fileUpload.errors.virusFound":"Het gekozen bestand is onveilig, kies een ander bestand.","fileUpload.errors.wrongType":"Het geselecteerde bestandstype wordt niet ondersteund. Annuleer de upload en selecteer een ander bestand.","fileUpload.fileUnavailableText":"Deze downloadlink is verlopen","fileUpload.labelText":"Kies een bestand","fileUpload.selectedText":e=>e||"Geen bestand geselecteerd","fileUpload.srAvailableText":"Uploaden van bestanden in de chat is nu mogelijk.","fileUpload.srCompleteText":"Upload voltooid.","fileUpload.srFileUnavailableText":e=>`Download voor ${e} is verlopen`,"fileUpload.srFileUploadedText":e=>`Geüpload bestand ${e}.`,"fileUpload.srFileDownloadText":e=>`Download bestand ${e}.`,"fileUpload.srProgressLabel":e=>`Uploadvoortgang van ${e}`,"fileUpload.srStartedText":"Upload begonnen.","fileUpload.srUnavailableText":"Uploaden van bestanden in de chat is nu niet meer mogelijk.","fileUpload.toggleButtonText":"Bestanden uploaden","fileUpload.uploadButtonText":"Bestand uploaden","header.collapseApp":"Klap chat in","header.title":"Je spreekt nu met","idleDetachWarning.continueButton":"Doorgaan met gesprek","idleDetachWarning.countdownText":"Het gesprek wordt beëindigd over:","idleDetachWarning.countdownTimer":({minutes:e,seconds:t})=>{switch(e){case 1:switch(t){case 1:return"1 minuut, 1 seconde";case 0:return"1 minuut";default:return`1 minuut, ${t} seconden`}case 0:switch(t){case 1:return"1 seconde";case 0:default:return`${t} seconden`}default:switch(t){case 1:return`${e} minuten, 1 seconde`;case 0:return`${e} minuten`;default:return`${e} minuten, ${t} seconden`}}},"idleDetachWarning.countdownTitle":"Ben je er nog?","idleDetachWarning.detachButton":"Gesprek beëindigen","idleDetachWarning.notifyTransferText":"Het gesprek wordt beëindigd.","idleDetachWarning.srCountDownStoppedText":"Automatische gespreks beëindiging geannuleerd. Welkom terug!","info.cobrowsing.cobrowsingEnded":"Scherm delen is beëindigd","info.cobrowsing.cobrowsingStarted":"Scherm delen is nu ingeschakeld. De medewerker kan de pagina zien waarop je je momenteel bevindt","info.sendTranscript.accepted":({emailAddress:e})=>`Het chatgesprek wordt per e-mail verstuurd naar ${e}`,"input.inputLabel":e=>e?`Jouw bericht (max. ${e} tekens)`:"Jouw bericht","input.inputPlaceholder":e=>e?`Jouw bericht (max. ${e} tekens)`:"Jouw bericht","input.sendMessage":"Stuur","input.srCharacterLimitText":e=>{switch(e){case 1:return"1 teken resterend.";case 0:default:return`${e} tekens resterend.`}},"lightbox.closeLabel":"Sluiten","lightbox.heading":"Vergrote chatafbeelding","message.choicePrompts.cancelChooseAgain":"Kies opnieuw annuleren","message.choicePrompts.chooseAgain":"Kies opnieuw","message.image.srTextEnlargeButtonLabel":({description:e})=>`Vergroot ${e}`,"message.srNewEventCount":({newCount:e})=>{switch(e){case 1:return"Er is 1 nieuw chatbericht.";case 0:default:return`Er zijn ${e} nieuwe chatberichten.`}},"message.srTextUnreadCount":({unreadCount:e})=>{switch(e){case 1:return"Er is 1 nieuw ongelezen chatbericht.";case 0:default:return`Er zijn ${e} nieuwe ongelezen chatberichten.`}},"options.cancelButtonText":"Annuleren","options.cobrowsing.cobrowsingActiveText":"Scherm delen actief","options.cobrowsing.cobrowsingUnavailable":"Het delen van je scherm is nu niet mogelijk.","options.cobrowsing.description":"Dit zorgt ervoor dat de medewerker je huidige pagina kan zien. Er wordt verder niks gedeeld","options.cobrowsing.labelTurnOff":"Scherm delen uitzetten","options.cobrowsing.labelTurnOn":"Scherm delen aanzetten","options.cobrowsing.menuTitle":"Scherm delen","options.cobrowsing.srCobrowsingAvailable":"Je kan je scherm nu delen.","options.cobrowsing.srStartedCobrowsingText":"Scherm delen is aangezet.","options.cobrowsing.srStopCobrowsingText":"Stop scherm delen","options.cobrowsing.srStoppedCobrowsingText":"Scherm delen is gestopt","options.cobrowsing.stopCobrowsingText":"Stop","options.cobrowsing.title":"Scherm delen","options.openButtonText":"Opties","options.saveButtonText":"Opslaan","options.sendTranscript.description":"Voer het e-mailadres in waarop je het chatgesprek wilt ontvangen.","options.sendTranscript.invalidEmailText":"Voer een geldig e-mailadres in","options.sendTranscript.label":"E-mailadres","options.sendTranscript.menuTitle":"Verstuur gesprek","options.sendTranscript.noEmailText":"Voer een e-mailadres in","options.sendTranscript.sendButtonText":"Verstuur","options.sendTranscript.title":"Verstuur chatgesprek","options.unavailableText":"niet beschikbaar","resumeConversationPrompt.continueButton":"Doorgaan met gesprek","resumeConversationPrompt.detachButton":"Stel een nieuwe vraag","resumeConversationPrompt.title":e=>`Wil je doorgaan met het gesprek met ${e}?`,skiplinkText:"Naar invoerbalk","toggleButton.resumeTitle":"Hervat chat met","toggleButton.subtitle":"Start een chat met ons","toggleButton.title":"Heb je een vraag?","translations.divider.restartButtonText":"Start opnieuw","translations.divider.startText":e=>`Vertaling naar ${e}`,"translations.divider.stopText":e=>`Vertaling naar ${e} beëindigd`,"translations.settings.cancelButtonText":"Annuleren","translations.settings.currentTranslationLabel":"Momenteel wordt vertaald naar","translations.settings.defaultOptionLabel":"Kies een taal","translations.settings.description":"Automatische vertalingen kunnen fouten bevatten.","translations.settings.endButtonText":"Stop vertaling","translations.settings.inputLabel":"Vertalen naar","translations.settings.noLocaleText":"Kies een taal om naar te vertalen","translations.settings.openButtonText":"Vertaling","translations.settings.startButtonText":"Start vertaling","translations.settings.title":"Vertaling","translations.status.label":e=>`Vertaling naar ${e}`,"translations.status.srStopText":"Stop vertaling","translations.status.stopText":"Stop","translations.toggle.hideButtonText":"Toon origineel","translations.toggle.showButtonText":"Toon vertaling","window.srModalLayoutLabel":"Chatvenster","window.srTexts.onClose":"De chat is gesloten.","window.srTexts.onHistoryLoad":"Chat geschiedenis is geladen.","window.srTexts.onLoad":"Chat is beschikbaar op deze pagina.","window.srTexts.onOpen":"De chat is geopend."};module.exports=t})();
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import deepKeys from 'deep-keys'
|
|
2
|
-
import en from '@seamly/web-ui/translations/en'
|
|
3
|
-
|
|
4
|
-
export const translate = translations => {
|
|
5
|
-
let translationSet
|
|
6
|
-
if (translations) {
|
|
7
|
-
const standardKeys = deepKeys(en)
|
|
8
|
-
const customKeys = deepKeys(translations)
|
|
9
|
-
standardKeys.forEach(key => {
|
|
10
|
-
if (customKeys.indexOf(key) === -1) {
|
|
11
|
-
console.error('Seamly: Missing translation key:', key)
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
translationSet = translations
|
|
15
|
-
} else {
|
|
16
|
-
translationSet = en
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
return (key, values = {}) => {
|
|
20
|
-
let keyParts
|
|
21
|
-
|
|
22
|
-
if (typeof key === 'string') {
|
|
23
|
-
keyParts = key.split('.')
|
|
24
|
-
} else {
|
|
25
|
-
keyParts = key
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const translation = keyParts.reduce((trs, keyPart) => {
|
|
29
|
-
if (!trs || !trs.hasOwnProperty(keyPart)) {
|
|
30
|
-
return null
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return trs[keyPart]
|
|
34
|
-
}, translationSet)
|
|
35
|
-
|
|
36
|
-
if (!translation) {
|
|
37
|
-
return ''
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (typeof translation === 'function') {
|
|
41
|
-
return translation(values)
|
|
42
|
-
} else {
|
|
43
|
-
return translation
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from 'preact/hooks'
|
|
2
|
-
import { SeamlyApiContext } from './seamly-api-context'
|
|
3
|
-
import {
|
|
4
|
-
useSeamlyConfig,
|
|
5
|
-
useSeamlyDispatchContext,
|
|
6
|
-
} from '../../hooks/seamly-hooks'
|
|
7
|
-
import { useI18n } from '../../../domains/i18n'
|
|
8
|
-
|
|
9
|
-
import { API } from '../../../api'
|
|
10
|
-
|
|
11
|
-
const SeamlyApi = ({ children }) => {
|
|
12
|
-
const { t } = useI18n()
|
|
13
|
-
const [seamlyApi, setSeamlyApi] = useState({})
|
|
14
|
-
const { namespace, api: apiConfig } = useSeamlyConfig()
|
|
15
|
-
const dispatch = useSeamlyDispatchContext()
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
const bootStrap = async () => {
|
|
19
|
-
const api = new API({ namespace, config: apiConfig })
|
|
20
|
-
|
|
21
|
-
setSeamlyApi(api)
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (namespace && apiConfig.key) {
|
|
25
|
-
bootStrap()
|
|
26
|
-
}
|
|
27
|
-
}, [dispatch, apiConfig, namespace, t])
|
|
28
|
-
|
|
29
|
-
useEffect(() => {
|
|
30
|
-
return () => {
|
|
31
|
-
if (seamlyApi.disconnect) {
|
|
32
|
-
seamlyApi.disconnect()
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}, [seamlyApi])
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<SeamlyApiContext.Provider value={seamlyApi}>
|
|
39
|
-
{children}
|
|
40
|
-
</SeamlyApiContext.Provider>
|
|
41
|
-
)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export default SeamlyApi
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'preact/hooks'
|
|
2
|
-
import { useI18n } from '../../domains/i18n'
|
|
3
|
-
import { useSeamlyStateContext } from './seamly-state-hooks'
|
|
4
|
-
import useSeamlyDispatchContext from './use-seamly-dispatch'
|
|
5
|
-
import { useSeamlyOptions } from './seamly-option-hooks'
|
|
6
|
-
import { featureKeys, seamlyActions } from '../utils/seamly-utils'
|
|
7
|
-
import SeamlyOfflineError from '../../api/errors/seamly-offline-error'
|
|
8
|
-
import SeamlyGeneralError from '../../api/errors/seamly-general-error'
|
|
9
|
-
import SeamlyConfigurationError from '../../api/errors/seamly-configuration-error'
|
|
10
|
-
import SeamlySessionExpiredError from '../../api/errors/seamly-session-expired-error'
|
|
11
|
-
import SeamlyUnauthorizedError from '../../api/errors/seamly-unauthorized-error'
|
|
12
|
-
|
|
13
|
-
const { SET_INTERRUPT } = seamlyActions
|
|
14
|
-
|
|
15
|
-
const useSeamlyInterrupt = () => {
|
|
16
|
-
const { t } = useI18n()
|
|
17
|
-
const { hasInterrupt, meta } = useSeamlyStateContext().interrupt
|
|
18
|
-
const dispatch = useSeamlyDispatchContext()
|
|
19
|
-
const { setUserSelectedOption } = useSeamlyOptions()
|
|
20
|
-
|
|
21
|
-
const setInterrupt = useCallback(
|
|
22
|
-
error => {
|
|
23
|
-
if (!(error instanceof SeamlyOfflineError)) {
|
|
24
|
-
setUserSelectedOption(featureKeys.cobrowsing, false)
|
|
25
|
-
}
|
|
26
|
-
if (
|
|
27
|
-
error instanceof SeamlyGeneralError ||
|
|
28
|
-
error instanceof SeamlyConfigurationError ||
|
|
29
|
-
error instanceof SeamlySessionExpiredError ||
|
|
30
|
-
error instanceof SeamlyOfflineError ||
|
|
31
|
-
error instanceof SeamlyUnauthorizedError
|
|
32
|
-
) {
|
|
33
|
-
const { langKey, action } = error
|
|
34
|
-
const title = t(`${langKey}.title`)
|
|
35
|
-
const message = t(`${langKey}.message`)
|
|
36
|
-
const srText = t(`${langKey}.srText`)
|
|
37
|
-
const buttonText = t(`${langKey}.buttonText`)
|
|
38
|
-
|
|
39
|
-
dispatch({
|
|
40
|
-
type: SET_INTERRUPT,
|
|
41
|
-
interrupt: {
|
|
42
|
-
...(langKey ? { title, message, srText } : {}),
|
|
43
|
-
...(action ? { action } : {}),
|
|
44
|
-
...(action && langKey ? { buttonText } : {}),
|
|
45
|
-
originalError: error,
|
|
46
|
-
},
|
|
47
|
-
})
|
|
48
|
-
} else {
|
|
49
|
-
throw error
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
[dispatch, t, setUserSelectedOption],
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
return {
|
|
56
|
-
hasInterrupt,
|
|
57
|
-
meta,
|
|
58
|
-
setInterrupt,
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export default useSeamlyInterrupt
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'preact/hooks'
|
|
2
|
-
import { createReduxStore, StoreProvider } from '../../domains/redux'
|
|
3
|
-
import { Reducer as formReducer } from '../../domains/forms'
|
|
4
|
-
import { Reducer as translationsReducer } from '../../domains/translations'
|
|
5
|
-
import { initI18n, Reducer as i18nReducer } from '../../domains/i18n'
|
|
6
|
-
import stateReducer from './state-reducer'
|
|
7
|
-
|
|
8
|
-
export default function Provider({
|
|
9
|
-
store: providedStore,
|
|
10
|
-
children,
|
|
11
|
-
translations: overrides,
|
|
12
|
-
}) {
|
|
13
|
-
/* eslint-disable react-hooks/exhaustive-deps */
|
|
14
|
-
const store = useMemo(() => {
|
|
15
|
-
// if a store is provided, we use that
|
|
16
|
-
if (providedStore) {
|
|
17
|
-
return providedStore
|
|
18
|
-
}
|
|
19
|
-
// initialization code fore store
|
|
20
|
-
// ideally, this gets lifted outside of the rendering context
|
|
21
|
-
// as the provide the "store" from app-initialization
|
|
22
|
-
// for now, we provide a fallback
|
|
23
|
-
const newStore = createReduxStore({
|
|
24
|
-
state: stateReducer,
|
|
25
|
-
[String(formReducer)]: formReducer,
|
|
26
|
-
[String(translationsReducer)]: translationsReducer,
|
|
27
|
-
[String(i18nReducer)]: i18nReducer,
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
newStore.dispatch(initI18n(overrides))
|
|
31
|
-
|
|
32
|
-
return newStore
|
|
33
|
-
}, [providedStore])
|
|
34
|
-
/* eslint-enable react-hooks/exhaustive-deps */
|
|
35
|
-
|
|
36
|
-
return <StoreProvider value={store}>{children}</StoreProvider>
|
|
37
|
-
}
|