@wise/dynamic-flow-client-internal 5.28.1 → 5.28.2

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 (62) hide show
  1. package/build/dynamicFlow/DynamicFlow.js +11 -0
  2. package/build/dynamicFlow/DynamicFlowModal.js +21 -0
  3. package/build/dynamicFlow/DynamicFlowWiseProps.js +1 -0
  4. package/build/dynamicFlow/DynamicFlowWithRef.js +19 -0
  5. package/build/dynamicFlow/context-menu/useContextMenu.js +33 -0
  6. package/build/dynamicFlow/context-menu/useDFContextMenu.js +135 -0
  7. package/build/dynamicFlow/context-menu/useDFContextMenu.test.js +101 -0
  8. package/build/dynamicFlow/getMergedRenderers.js +36 -0
  9. package/build/dynamicFlow/messages.js +13 -0
  10. package/build/dynamicFlow/renderers.js +10 -0
  11. package/build/dynamicFlow/telemetry/app-version.js +4 -0
  12. package/build/dynamicFlow/telemetry/dispatchAnalyticsEvent.js +8 -0
  13. package/build/dynamicFlow/telemetry/getLogEvent.js +22 -0
  14. package/build/dynamicFlow/telemetry/getTrackEvent.js +39 -0
  15. package/build/dynamicFlow/telemetry/index.js +2 -0
  16. package/build/dynamicFlow/useCreateSnackBar.js +9 -0
  17. package/build/dynamicFlow/useOnCopy.js +16 -0
  18. package/build/dynamicFlow/useWiseHttpClient.js +24 -0
  19. package/build/dynamicFlow/useWiseToCoreProps.js +42 -0
  20. package/build/i18n/de.json +3 -3
  21. package/build/i18n/fr.json +1 -1
  22. package/build/i18n/hu.json +1 -1
  23. package/build/i18n/id.json +1 -1
  24. package/build/i18n/index.js +43 -0
  25. package/build/i18n/pt.json +1 -1
  26. package/build/i18n/ru.json +1 -1
  27. package/build/i18n/zh_HK.json +1 -1
  28. package/build/index.js +6 -0
  29. package/build/main.js +10 -10
  30. package/build/main.mjs +10 -10
  31. package/build/stories/ButtonLoader.story.js +109 -0
  32. package/build/stories/ContainerQueries.story.js +74 -0
  33. package/build/stories/DynamicFlow.story.js +37 -0
  34. package/build/stories/DynamicFlowWithRef.story.js +72 -0
  35. package/build/stories/Editable.story.js +58 -0
  36. package/build/stories/Initialisation.story.js +33 -0
  37. package/build/stories/PinnedButtons.story.js +94 -0
  38. package/build/stories/SCAIntegration.story.js +67 -0
  39. package/build/stories/utils/fixtureHttpClient.js +59 -0
  40. package/build/test-utils/NeptuneProviders.js +11 -0
  41. package/build/test-utils/index.js +4 -0
  42. package/build/test-utils/respond-with.js +6 -0
  43. package/build/test-utils/rtl-utils.js +7 -0
  44. package/build/test-utils/wait.js +3 -0
  45. package/build/tests/DynamicFlow.test.js +177 -0
  46. package/build/tests/HideStepTitle.test.js +58 -0
  47. package/build/tests/RequestCache.test.js +34 -0
  48. package/build/tests/SCARejectionHandling.test.js +71 -0
  49. package/build/tests/Subflow.Wise.test.js +650 -0
  50. package/build/tests/events.test.js +124 -0
  51. package/build/tests/logging.test.js +12 -0
  52. package/build/tests/onNotification.test.js +96 -0
  53. package/build/tests/renderers/ControlAndTags.test.js +225 -0
  54. package/build/tests/renderers/ImageRenderer.test.js +129 -0
  55. package/build/tests/renderers/RadioInputRendererComponent.test.js +89 -0
  56. package/build/tests/renderers/ReviewRenderer.test.js +41 -0
  57. package/build/tests/renderers/TextInputRenderer.test.js +44 -0
  58. package/build/tests/renderers/TimeZoneHeader.test.js +19 -0
  59. package/build/tests/renderers/UploadInputRenderer.maxSize.test.js +22 -0
  60. package/build/tests/renderers/value-utils.test.js +24 -0
  61. package/build/tsconfig.types.tsbuildinfo +1 -1
  62. package/package.json +4 -4
@@ -0,0 +1,43 @@
1
+ import { translations as coreTranslations } from '@wise/dynamic-flow-client';
2
+ import cs from './cs.json';
3
+ import de from './de.json';
4
+ import en from './en.json';
5
+ import es from './es.json';
6
+ import fr from './fr.json';
7
+ import hu from './hu.json';
8
+ import id from './id.json';
9
+ import it from './it.json';
10
+ import ja from './ja.json';
11
+ import nl from './nl.json';
12
+ import pl from './pl.json';
13
+ import pt from './pt.json';
14
+ import ro from './ro.json';
15
+ import ru from './ru.json';
16
+ import th from './th.json';
17
+ import tr from './tr.json';
18
+ import zhCN from './zh_CN.json';
19
+ import zhHK from './zh_HK.json';
20
+ const wiseTranslations = {
21
+ cs,
22
+ en,
23
+ de,
24
+ es,
25
+ fr,
26
+ hu,
27
+ id,
28
+ it,
29
+ ja,
30
+ nl,
31
+ pl,
32
+ pt,
33
+ ro,
34
+ ru,
35
+ th,
36
+ tr,
37
+ zh: zhCN,
38
+ 'zh-CN': zhCN,
39
+ 'zh-HK': zhHK,
40
+ };
41
+ const languages = Array.from(new Set([...Object.keys(coreTranslations), ...Object.keys(wiseTranslations)]));
42
+ const translations = languages.reduce((acc, lang) => (Object.assign(Object.assign({}, acc), { [lang]: Object.assign(Object.assign({}, coreTranslations[lang]), wiseTranslations[lang]) })), {});
43
+ export default translations;
@@ -20,7 +20,7 @@
20
20
  "df.wise.ControlFeedback.type": "Tipo incorreto",
21
21
  "df.wise.CopyFeedback.copy": "Copiado",
22
22
  "df.wise.CopyFeedback.copyFailed": "Falha ao copiar para área de transferência",
23
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
23
+ "df.wise.DateInput.unavailableDates": "Algumas datas estão indisponíveis.",
24
24
  "df.wise.DynamicParagraph.copied": "Copiado",
25
25
  "df.wise.DynamicParagraph.copy": "Copiar",
26
26
  "df.wise.ErrorBoundary.errorAlert": "Algo deu errado.",
@@ -20,7 +20,7 @@
20
20
  "df.wise.ControlFeedback.type": "Неверный тип",
21
21
  "df.wise.CopyFeedback.copy": "Скопировано в буфер обмена",
22
22
  "df.wise.CopyFeedback.copyFailed": "Не удалось скопировать в буфер обмена",
23
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
23
+ "df.wise.DateInput.unavailableDates": "Некоторые даты недоступны.",
24
24
  "df.wise.DynamicParagraph.copied": "Скопировано в буфер обмена",
25
25
  "df.wise.DynamicParagraph.copy": "Копировать",
26
26
  "df.wise.ErrorBoundary.errorAlert": "Что-то пошло не так.",
@@ -20,7 +20,7 @@
20
20
  "df.wise.ControlFeedback.type": "錯誤的類型",
21
21
  "df.wise.CopyFeedback.copy": "複製到剪貼板",
22
22
  "df.wise.CopyFeedback.copyFailed": "無法複製到剪貼板",
23
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
23
+ "df.wise.DateInput.unavailableDates": "部分日期不適用。",
24
24
  "df.wise.DynamicParagraph.copied": "複製到剪貼板",
25
25
  "df.wise.DynamicParagraph.copy": "複製",
26
26
  "df.wise.ErrorBoundary.errorAlert": "出了些問題。",
package/build/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export { makeHttpClient as makeCustomFetch } from '@wise/dynamic-flow-client';
2
+ export { DynamicFlow } from './dynamicFlow/DynamicFlow';
3
+ export { DynamicFlowWithRef } from './dynamicFlow/DynamicFlowWithRef';
4
+ export { findRendererPropsByType } from '@wise/dynamic-flow-client';
5
+ export { createCollectionRenderer, getMargin, Header, Media } from './dynamicFlow/renderers';
6
+ export { default as translations } from './i18n';
package/build/main.js CHANGED
@@ -146,7 +146,7 @@ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
146
146
  // src/dynamicFlow/telemetry/app-version.ts
147
147
  var appVersion = (
148
148
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
149
- typeof process !== "undefined" ? "5.28.1" : "0.0.0"
149
+ typeof process !== "undefined" ? "5.28.2" : "0.0.0"
150
150
  );
151
151
 
152
152
  // src/dynamicFlow/context-menu/useContextMenu.tsx
@@ -7353,7 +7353,7 @@ var de_default = {
7353
7353
  "df.wise.ControlFeedback.type": "Falscher Typ",
7354
7354
  "df.wise.CopyFeedback.copy": "In Zwischenablage kopiert",
7355
7355
  "df.wise.CopyFeedback.copyFailed": "Kopieren in Zwischenablage fehlgeschlagen",
7356
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7356
+ "df.wise.DateInput.unavailableDates": "Einige Daten sind nicht verf\xFCgbar.",
7357
7357
  "df.wise.DynamicParagraph.copied": "In Zwischenablage kopiert",
7358
7358
  "df.wise.DynamicParagraph.copy": "Kopieren",
7359
7359
  "df.wise.ErrorBoundary.errorAlert": "Da ist etwas schiefgegangen.",
@@ -7374,9 +7374,9 @@ var de_default = {
7374
7374
  "df.wise.filter.placeholder": "Gib etwas ein, um die Suche zu beginnen",
7375
7375
  "df.wise.filter.results": "Suchergebnisse",
7376
7376
  "df.wise.group.all": "Alle",
7377
- "df.wise.group.currencies-with-account-details": "Guthaben mit Bankverbindung",
7377
+ "df.wise.group.currencies-with-account-details": "W\xE4hrungen mit Bankverbindung",
7378
7378
  "df.wise.group.popular": "Beliebt",
7379
- "df.wise.group.recent": "Neu",
7379
+ "df.wise.group.recent": "K\xFCrzlich verwendet",
7380
7380
  "df.wise.step.scrollToBottom": "Nach unten scrollen"
7381
7381
  };
7382
7382
 
@@ -7503,7 +7503,7 @@ var fr_default = {
7503
7503
  "df.wise.ControlFeedback.type": "Type incorrect",
7504
7504
  "df.wise.CopyFeedback.copy": "Copi\xE9 dans le presse-papier",
7505
7505
  "df.wise.CopyFeedback.copyFailed": "Impossible de copier dans le presse-papier",
7506
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7506
+ "df.wise.DateInput.unavailableDates": "Certaines dates ne sont pas disponibles.",
7507
7507
  "df.wise.DynamicParagraph.copied": "Copi\xE9 dans le presse-papier",
7508
7508
  "df.wise.DynamicParagraph.copy": "Copier",
7509
7509
  "df.wise.ErrorBoundary.errorAlert": "Une erreur s'est produite.",
@@ -7553,7 +7553,7 @@ var hu_default = {
7553
7553
  "df.wise.ControlFeedback.type": "Helytelen t\xEDpus",
7554
7554
  "df.wise.CopyFeedback.copy": "V\xE1g\xF3lapra m\xE1solva",
7555
7555
  "df.wise.CopyFeedback.copyFailed": "Nem siker\xFClt a v\xE1g\xF3lapra m\xE1solni",
7556
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7556
+ "df.wise.DateInput.unavailableDates": "Egyes d\xE1tumok nem el\xE9rhet\u0151k.",
7557
7557
  "df.wise.DynamicParagraph.copied": "V\xE1g\xF3lapra m\xE1solva",
7558
7558
  "df.wise.DynamicParagraph.copy": "M\xE1sol\xE1s",
7559
7559
  "df.wise.ErrorBoundary.errorAlert": "Valami hiba t\xF6rt\xE9nt.",
@@ -7603,7 +7603,7 @@ var id_default = {
7603
7603
  "df.wise.ControlFeedback.type": "Tipe salah",
7604
7604
  "df.wise.CopyFeedback.copy": "Disalin ke clipboard",
7605
7605
  "df.wise.CopyFeedback.copyFailed": "Gagal menyalin ke clipboard",
7606
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7606
+ "df.wise.DateInput.unavailableDates": "Beberapa tanggal tidak tersedia.",
7607
7607
  "df.wise.DynamicParagraph.copied": "Disalin ke clipboard",
7608
7608
  "df.wise.DynamicParagraph.copy": "Salin",
7609
7609
  "df.wise.ErrorBoundary.errorAlert": "Terjadi kesalahan.",
@@ -7853,7 +7853,7 @@ var pt_default = {
7853
7853
  "df.wise.ControlFeedback.type": "Tipo incorreto",
7854
7854
  "df.wise.CopyFeedback.copy": "Copiado",
7855
7855
  "df.wise.CopyFeedback.copyFailed": "Falha ao copiar para \xE1rea de transfer\xEAncia",
7856
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7856
+ "df.wise.DateInput.unavailableDates": "Algumas datas est\xE3o indispon\xEDveis.",
7857
7857
  "df.wise.DynamicParagraph.copied": "Copiado",
7858
7858
  "df.wise.DynamicParagraph.copy": "Copiar",
7859
7859
  "df.wise.ErrorBoundary.errorAlert": "Algo deu errado.",
@@ -7953,7 +7953,7 @@ var ru_default = {
7953
7953
  "df.wise.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
7954
7954
  "df.wise.CopyFeedback.copy": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7955
7955
  "df.wise.CopyFeedback.copyFailed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7956
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7956
+ "df.wise.DateInput.unavailableDates": "\u041D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0434\u0430\u0442\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B.",
7957
7957
  "df.wise.DynamicParagraph.copied": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7958
7958
  "df.wise.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
7959
7959
  "df.wise.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
@@ -8153,7 +8153,7 @@ var zh_HK_default = {
8153
8153
  "df.wise.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B",
8154
8154
  "df.wise.CopyFeedback.copy": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8155
8155
  "df.wise.CopyFeedback.copyFailed": "\u7121\u6CD5\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8156
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
8156
+ "df.wise.DateInput.unavailableDates": "\u90E8\u5206\u65E5\u671F\u4E0D\u9069\u7528\u3002",
8157
8157
  "df.wise.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8158
8158
  "df.wise.DynamicParagraph.copy": "\u8907\u88FD",
8159
8159
  "df.wise.ErrorBoundary.errorAlert": "\u51FA\u4E86\u4E9B\u554F\u984C\u3002",
package/build/main.mjs CHANGED
@@ -127,7 +127,7 @@ import { useDynamicFlow } from "@wise/dynamic-flow-client";
127
127
  // src/dynamicFlow/telemetry/app-version.ts
128
128
  var appVersion = (
129
129
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
130
- typeof process !== "undefined" ? "5.28.1" : "0.0.0"
130
+ typeof process !== "undefined" ? "5.28.2" : "0.0.0"
131
131
  );
132
132
 
133
133
  // src/dynamicFlow/context-menu/useContextMenu.tsx
@@ -7351,7 +7351,7 @@ var de_default = {
7351
7351
  "df.wise.ControlFeedback.type": "Falscher Typ",
7352
7352
  "df.wise.CopyFeedback.copy": "In Zwischenablage kopiert",
7353
7353
  "df.wise.CopyFeedback.copyFailed": "Kopieren in Zwischenablage fehlgeschlagen",
7354
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7354
+ "df.wise.DateInput.unavailableDates": "Einige Daten sind nicht verf\xFCgbar.",
7355
7355
  "df.wise.DynamicParagraph.copied": "In Zwischenablage kopiert",
7356
7356
  "df.wise.DynamicParagraph.copy": "Kopieren",
7357
7357
  "df.wise.ErrorBoundary.errorAlert": "Da ist etwas schiefgegangen.",
@@ -7372,9 +7372,9 @@ var de_default = {
7372
7372
  "df.wise.filter.placeholder": "Gib etwas ein, um die Suche zu beginnen",
7373
7373
  "df.wise.filter.results": "Suchergebnisse",
7374
7374
  "df.wise.group.all": "Alle",
7375
- "df.wise.group.currencies-with-account-details": "Guthaben mit Bankverbindung",
7375
+ "df.wise.group.currencies-with-account-details": "W\xE4hrungen mit Bankverbindung",
7376
7376
  "df.wise.group.popular": "Beliebt",
7377
- "df.wise.group.recent": "Neu",
7377
+ "df.wise.group.recent": "K\xFCrzlich verwendet",
7378
7378
  "df.wise.step.scrollToBottom": "Nach unten scrollen"
7379
7379
  };
7380
7380
 
@@ -7501,7 +7501,7 @@ var fr_default = {
7501
7501
  "df.wise.ControlFeedback.type": "Type incorrect",
7502
7502
  "df.wise.CopyFeedback.copy": "Copi\xE9 dans le presse-papier",
7503
7503
  "df.wise.CopyFeedback.copyFailed": "Impossible de copier dans le presse-papier",
7504
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7504
+ "df.wise.DateInput.unavailableDates": "Certaines dates ne sont pas disponibles.",
7505
7505
  "df.wise.DynamicParagraph.copied": "Copi\xE9 dans le presse-papier",
7506
7506
  "df.wise.DynamicParagraph.copy": "Copier",
7507
7507
  "df.wise.ErrorBoundary.errorAlert": "Une erreur s'est produite.",
@@ -7551,7 +7551,7 @@ var hu_default = {
7551
7551
  "df.wise.ControlFeedback.type": "Helytelen t\xEDpus",
7552
7552
  "df.wise.CopyFeedback.copy": "V\xE1g\xF3lapra m\xE1solva",
7553
7553
  "df.wise.CopyFeedback.copyFailed": "Nem siker\xFClt a v\xE1g\xF3lapra m\xE1solni",
7554
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7554
+ "df.wise.DateInput.unavailableDates": "Egyes d\xE1tumok nem el\xE9rhet\u0151k.",
7555
7555
  "df.wise.DynamicParagraph.copied": "V\xE1g\xF3lapra m\xE1solva",
7556
7556
  "df.wise.DynamicParagraph.copy": "M\xE1sol\xE1s",
7557
7557
  "df.wise.ErrorBoundary.errorAlert": "Valami hiba t\xF6rt\xE9nt.",
@@ -7601,7 +7601,7 @@ var id_default = {
7601
7601
  "df.wise.ControlFeedback.type": "Tipe salah",
7602
7602
  "df.wise.CopyFeedback.copy": "Disalin ke clipboard",
7603
7603
  "df.wise.CopyFeedback.copyFailed": "Gagal menyalin ke clipboard",
7604
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7604
+ "df.wise.DateInput.unavailableDates": "Beberapa tanggal tidak tersedia.",
7605
7605
  "df.wise.DynamicParagraph.copied": "Disalin ke clipboard",
7606
7606
  "df.wise.DynamicParagraph.copy": "Salin",
7607
7607
  "df.wise.ErrorBoundary.errorAlert": "Terjadi kesalahan.",
@@ -7851,7 +7851,7 @@ var pt_default = {
7851
7851
  "df.wise.ControlFeedback.type": "Tipo incorreto",
7852
7852
  "df.wise.CopyFeedback.copy": "Copiado",
7853
7853
  "df.wise.CopyFeedback.copyFailed": "Falha ao copiar para \xE1rea de transfer\xEAncia",
7854
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7854
+ "df.wise.DateInput.unavailableDates": "Algumas datas est\xE3o indispon\xEDveis.",
7855
7855
  "df.wise.DynamicParagraph.copied": "Copiado",
7856
7856
  "df.wise.DynamicParagraph.copy": "Copiar",
7857
7857
  "df.wise.ErrorBoundary.errorAlert": "Algo deu errado.",
@@ -7951,7 +7951,7 @@ var ru_default = {
7951
7951
  "df.wise.ControlFeedback.type": "\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0442\u0438\u043F",
7952
7952
  "df.wise.CopyFeedback.copy": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7953
7953
  "df.wise.CopyFeedback.copyFailed": "\u041D\u0435 \u0443\u0434\u0430\u043B\u043E\u0441\u044C \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7954
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
7954
+ "df.wise.DateInput.unavailableDates": "\u041D\u0435\u043A\u043E\u0442\u043E\u0440\u044B\u0435 \u0434\u0430\u0442\u044B \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u043D\u044B.",
7955
7955
  "df.wise.DynamicParagraph.copied": "\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u043E \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430",
7956
7956
  "df.wise.DynamicParagraph.copy": "\u041A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C",
7957
7957
  "df.wise.ErrorBoundary.errorAlert": "\u0427\u0442\u043E-\u0442\u043E \u043F\u043E\u0448\u043B\u043E \u043D\u0435 \u0442\u0430\u043A.",
@@ -8151,7 +8151,7 @@ var zh_HK_default = {
8151
8151
  "df.wise.ControlFeedback.type": "\u932F\u8AA4\u7684\u985E\u578B",
8152
8152
  "df.wise.CopyFeedback.copy": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8153
8153
  "df.wise.CopyFeedback.copyFailed": "\u7121\u6CD5\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8154
- "df.wise.DateInput.unavailableDates": "Some dates are unavailable.",
8154
+ "df.wise.DateInput.unavailableDates": "\u90E8\u5206\u65E5\u671F\u4E0D\u9069\u7528\u3002",
8155
8155
  "df.wise.DynamicParagraph.copied": "\u8907\u88FD\u5230\u526A\u8CBC\u677F",
8156
8156
  "df.wise.DynamicParagraph.copy": "\u8907\u88FD",
8157
8157
  "df.wise.ErrorBoundary.errorAlert": "\u51FA\u4E86\u4E9B\u554F\u984C\u3002",
@@ -0,0 +1,109 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { DynamicFlow } from '../dynamicFlow/DynamicFlow';
4
+ import { fixtureHttpClient } from './utils/fixtureHttpClient';
5
+ export default {
6
+ title: 'Initialisation',
7
+ component: DynamicFlow,
8
+ };
9
+ const onCompletion = action('onCompletion');
10
+ const onError = action('onError');
11
+ const onEvent = action('onEvent');
12
+ const onLog = action('onLog');
13
+ export const ButtonLoader = {
14
+ render: () => (_jsx(DynamicFlow, { flowId: "initialisation-telemetry", customFetch: fixtureHttpClient, initialStep: step, onCompletion: onCompletion, onError: onError, onEvent: onEvent, onLog: onLog })),
15
+ };
16
+ const step = {
17
+ id: 'convert-review',
18
+ title: 'Does everything look right?',
19
+ schemas: [
20
+ {
21
+ properties: {
22
+ quoteId: {
23
+ const: '123',
24
+ },
25
+ profileId: {
26
+ const: 6666,
27
+ },
28
+ context: {
29
+ const: 'CONVERT',
30
+ },
31
+ },
32
+ displayOrder: ['quoteId', 'profileId', 'context'],
33
+ required: ['quoteId', 'profileId', 'context'],
34
+ hidden: true,
35
+ type: 'object',
36
+ },
37
+ ],
38
+ layout: [
39
+ {
40
+ components: [
41
+ {
42
+ fields: [
43
+ {
44
+ label: "You're converting",
45
+ value: '123 EUR',
46
+ },
47
+ {
48
+ label: 'To',
49
+ value: '101.61 GBP',
50
+ },
51
+ {
52
+ label: 'Our fee',
53
+ value: '6.15 EUR',
54
+ },
55
+ {
56
+ label: 'Rate',
57
+ value: '1 EUR = 0.8696 GBP',
58
+ },
59
+ ],
60
+ title: 'Conversion details',
61
+ callToAction: {
62
+ title: 'Edit',
63
+ behavior: {
64
+ action: {
65
+ exit: true,
66
+ result: {
67
+ action: 'EDIT',
68
+ },
69
+ },
70
+ type: 'action',
71
+ },
72
+ action: {
73
+ exit: true,
74
+ result: {
75
+ action: 'EDIT',
76
+ },
77
+ },
78
+ },
79
+ control: 'horizontal',
80
+ type: 'review',
81
+ },
82
+ {
83
+ title: 'Convert',
84
+ behavior: {
85
+ action: {
86
+ exit: true,
87
+ result: {
88
+ action: 'CONVERT',
89
+ },
90
+ },
91
+ type: 'action',
92
+ },
93
+ control: 'primary',
94
+ margin: 'xs',
95
+ type: 'button',
96
+ action: {
97
+ exit: true,
98
+ result: {
99
+ action: 'CONVERT',
100
+ },
101
+ },
102
+ },
103
+ ],
104
+ control: 'bordered',
105
+ type: 'box',
106
+ },
107
+ ],
108
+ refreshUrl: '/v1/convert/review?refresh=true',
109
+ };
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { DynamicFlow } from '../dynamicFlow/DynamicFlow';
4
+ import { Fragment } from 'react/jsx-runtime';
5
+ export default {
6
+ component: ImageLayoutWithSize,
7
+ title: 'Dev Tools/Container Queries',
8
+ argTypes: {
9
+ width: {
10
+ options: ['100%', '900px', '600px', '575px', '400px'],
11
+ control: { type: 'select' },
12
+ description: 'Width of the div containing the DynamicFlow component',
13
+ },
14
+ },
15
+ args: {
16
+ width: '575px',
17
+ },
18
+ };
19
+ export function ImageLayoutWithSize({ width }) {
20
+ return _jsx(Fragment, { children: renderWithStep(imageLayoutStep, width) }, width);
21
+ }
22
+ function renderWithStep(step, width) {
23
+ const getDF = () => (_jsx(DynamicFlow, { flowId: "new-df-flow-id", className: "df-prefer-container-queries", customFetch: async (input, init) => {
24
+ action('httpClient')(input, init === null || init === void 0 ? void 0 : init.body);
25
+ return fetch(input, init);
26
+ }, initialStep: Object.assign(Object.assign({}, step), { title: `Dynamic Flow Step - ${width}`, description: `This is a DynamicFlow component inside a ${width}-wide <div> container. You can change the width in the Storybook controls.` }), onCompletion: action('onCompletion'), onEvent: action('onEvent'), onLog: action('onLog'), onError: (error) => {
27
+ action('onError');
28
+ console.error(error);
29
+ } }));
30
+ return (_jsxs("div", { className: "d-flex", children: [_jsx("div", { style: { flexGrow: 1, backgroundColor: '#EEE', textAlign: 'center' }, children: " NOT-DF " }), _jsx("div", { style: { width, backgroundColor: 'white' }, children: getDF() }), _jsx("div", { style: { flexGrow: 1, backgroundColor: '#EEE', textAlign: 'center' }, children: " NOT-DF " })] }));
31
+ }
32
+ const imageLayoutStep = {
33
+ id: 'step-id',
34
+ title: 'Dynamic Flow Step',
35
+ description: 'This is a step in the dynamic flow.',
36
+ schemas: [],
37
+ layout: [
38
+ {
39
+ type: 'image',
40
+ size: 'xs',
41
+ content: {
42
+ uri: 'https://placehold.co/600x600?text=Cat',
43
+ },
44
+ },
45
+ {
46
+ type: 'image',
47
+ size: 'sm',
48
+ content: {
49
+ uri: 'https://placehold.co/600x600?text=Cat',
50
+ },
51
+ },
52
+ {
53
+ type: 'image',
54
+ size: 'md',
55
+ content: {
56
+ uri: 'https://placehold.co/600x600?text=Cat',
57
+ },
58
+ },
59
+ {
60
+ type: 'image',
61
+ size: 'lg',
62
+ content: {
63
+ uri: 'https://placehold.co/600x600?text=Cat',
64
+ },
65
+ },
66
+ {
67
+ type: 'image',
68
+ size: 'xl',
69
+ content: {
70
+ uri: 'https://placehold.co/600x600?text=Cat',
71
+ },
72
+ },
73
+ ],
74
+ };
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { layouts, schemas, misc, step } from '@wise/dynamic-flow-fixtures';
4
+ import { DynamicFlow } from '../index';
5
+ import { fixtureHttpClient } from './utils/fixtureHttpClient';
6
+ const fixtures = Object.assign(Object.assign(Object.assign(Object.assign({}, schemas), layouts), misc), step);
7
+ function DynamicFlowRenderer({ initialStepName = '', }) {
8
+ const selectedStep = fixtures[initialStepName] || {};
9
+ const parsedStep = typeof selectedStep === 'string' ? JSON.parse(selectedStep) : selectedStep;
10
+ const props = {
11
+ flowId: 'storybook',
12
+ customFetch: fixtureHttpClient,
13
+ onCompletion: action('onCompletion'),
14
+ onError: action('onError'),
15
+ onEvent: action('onEvent'),
16
+ onLog: action('onLog'),
17
+ };
18
+ return (_jsx(DynamicFlow, Object.assign({}, props, { initialAction: { method: 'GET', url: `/steps/${initialStepName}` } }), parsedStep.id));
19
+ }
20
+ const meta = {
21
+ title: 'Multi-fixture',
22
+ component: DynamicFlowRenderer,
23
+ };
24
+ export const AllFixtures = {
25
+ argTypes: {
26
+ initialStepName: {
27
+ label: 'Initial Step',
28
+ control: 'select',
29
+ options: Object.keys(fixtures),
30
+ },
31
+ },
32
+ args: { initialStepName: Object.keys(fixtures)[1], revampEnabled: false },
33
+ parameters: {
34
+ chromatic: { disableSnapshot: true },
35
+ },
36
+ };
37
+ export default meta;
@@ -0,0 +1,72 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { Button } from '@transferwise/components';
4
+ import { useRef, useState } from 'react';
5
+ import { DynamicFlowWithRef } from '..';
6
+ import { fixtureHttpClient } from './utils/fixtureHttpClient';
7
+ const step = {
8
+ id: 'dynamic-form-story',
9
+ title: 'Dynamic Form',
10
+ schemas: [
11
+ {
12
+ $id: '#form',
13
+ type: 'object',
14
+ displayOrder: ['name', 'city'],
15
+ required: ['name'],
16
+ properties: {
17
+ name: { type: 'string', title: 'Name', minLength: 2 },
18
+ city: {
19
+ title: 'City',
20
+ oneOf: [
21
+ { title: 'London', const: 'London', icon: { name: 'flag-gb' } },
22
+ { title: 'Paris', const: 'Paris', icon: { name: 'flag-fr' } },
23
+ { title: 'New York', const: 'New York', icon: { name: 'flag-us' } },
24
+ ],
25
+ },
26
+ },
27
+ },
28
+ ],
29
+ layout: [
30
+ {
31
+ type: 'form',
32
+ schemaId: '#form',
33
+ },
34
+ ],
35
+ };
36
+ function DynamicFlowWithRefStory() {
37
+ const ref = useRef(null);
38
+ const props = {
39
+ flowId: 'storybook',
40
+ analyticsId: 'storybook',
41
+ customFetch: fixtureHttpClient,
42
+ onValueChange: action('onValueChange'),
43
+ onError: action('onError'),
44
+ onEvent: action('onEvent'),
45
+ onLog: action('onLog'),
46
+ };
47
+ const [currentValue, setCurrentValue] = useState('');
48
+ const [isValid, setValid] = useState(null);
49
+ const backgroundColor = isValid === null ? '#eeeeee' : isValid ? '#eeffee' : '#ffeeee';
50
+ const validityText = isValid === null ? '' : isValid ? '✅ valid\n\n' : '❌ invalid\n\n';
51
+ return (_jsxs(_Fragment, { children: [_jsx(DynamicFlowWithRef, Object.assign({ ref: ref }, props, { initialStep: step, onValueChange: async () => {
52
+ var _a;
53
+ var _b;
54
+ const newValue = (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.getValue()) !== null && _b !== void 0 ? _b : null;
55
+ setCurrentValue(JSON.stringify(newValue, null, 2));
56
+ }, onCompletion: () => { } }), JSON.stringify(step)), _jsx(Button, { onClick: async () => {
57
+ var _a;
58
+ var _b;
59
+ const ok = (_b = (_a = ref.current) === null || _a === void 0 ? void 0 : _a.validate()) !== null && _b !== void 0 ? _b : false;
60
+ setValid(ok);
61
+ }, children: "validate()" }), _jsx("hr", {}), _jsxs("pre", { style: { backgroundColor }, children: [validityText, currentValue] })] }));
62
+ }
63
+ const meta = {
64
+ title: 'Dynamic Form',
65
+ component: DynamicFlowWithRefStory,
66
+ };
67
+ export const AllFixtures = {
68
+ parameters: {
69
+ chromatic: { disableSnapshot: true },
70
+ },
71
+ };
72
+ export default meta;
@@ -0,0 +1,58 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { layouts, schemas } from '@wise/dynamic-flow-fixtures';
4
+ import { useMemo, useState } from 'react';
5
+ import { DynamicFlow } from '../dynamicFlow/DynamicFlow';
6
+ const fixtures = Object.assign(Object.assign({}, schemas), layouts);
7
+ export function Editable({ initialStepName = '' }) {
8
+ const selectedStep = fixtures[initialStepName] || {};
9
+ const selectedInitialStep = JSON.stringify(selectedStep, null, 2);
10
+ return _jsx(InteractiveDemo, { selectedInitialStep: selectedInitialStep }, selectedInitialStep);
11
+ }
12
+ function InteractiveDemo({ selectedInitialStep }) {
13
+ const [initialStatusCode, setInitialStatusCode] = useState(200);
14
+ const [initialStep, setInitialStep] = useState(selectedInitialStep);
15
+ const onTextAreaChange = (event) => {
16
+ setInitialStep(event.target.value);
17
+ };
18
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { children: [_jsx("h3", { children: "Editable Demo" }), _jsx("p", { children: "You can specify a response status code and body, and DF will load your step below." }), _jsxs("fieldset", { children: [_jsx("label", { htmlFor: "status-code", children: "Response Status code: " }), _jsx(StatusCodeSelect, { id: "status-code", state: [initialStatusCode, setInitialStatusCode] })] }), _jsxs("fieldset", { children: [_jsx("label", { htmlFor: "textarea", children: "Response Body:" }), _jsx(InvalidJsonWarning, { initialStep: initialStep }), _jsx("textarea", { id: "textarea", wrap: "off", rows: 40, style: {
19
+ fontFamily: 'monospace',
20
+ fontSize: '0.9em',
21
+ width: '100%',
22
+ maxHeight: '200px',
23
+ }, value: initialStep, onChange: onTextAreaChange })] })] }), isValidJson(initialStep) ? (_jsx(DynamicFlow, { flowId: "storybook", customFetch: fetch, initialStep: JSON.parse(initialStep), onCompletion: action('onCompletion'), onError: (error) => {
24
+ action('onError')(error);
25
+ console.error(error);
26
+ } }, `${initialStep}-${initialStatusCode}`)) : null] }));
27
+ }
28
+ function InvalidJsonWarning({ initialStep }) {
29
+ const validJson = useMemo(() => isValidJson(initialStep), [initialStep]);
30
+ return !validJson ? (_jsx("p", { children: "\u274C Invalid syntax or missing elements are preventing the JSON code you entered from being parsed." })) : null;
31
+ }
32
+ const isValidJson = (value) => {
33
+ try {
34
+ JSON.parse(value);
35
+ return true;
36
+ }
37
+ catch (_a) {
38
+ return false;
39
+ }
40
+ };
41
+ function StatusCodeSelect({ id, state: [value, setValue], }) {
42
+ return (_jsxs("select", { id: id, value: value, onChange: (event) => setValue(Number.parseInt(event.target.value, 10)), children: [_jsx("option", { children: "200" }), _jsx("option", { children: "400" }), _jsx("option", { children: "500" })] }));
43
+ }
44
+ export default {
45
+ component: Editable,
46
+ title: 'Multi-fixture',
47
+ parameters: {
48
+ chromatic: { disableSnapshot: true },
49
+ },
50
+ argTypes: {
51
+ initialStepName: {
52
+ label: 'Initial Step',
53
+ control: 'select',
54
+ options: Object.keys(fixtures),
55
+ },
56
+ },
57
+ args: { initialStepName: Object.keys(fixtures)[0] },
58
+ };
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { action } from 'storybook/actions';
3
+ import { DynamicFlow } from '../dynamicFlow/DynamicFlow';
4
+ export default {
5
+ title: 'Initialisation',
6
+ component: DynamicFlow,
7
+ };
8
+ const mockFetch = async (url, init) => {
9
+ action('mockFetch')(url, init);
10
+ switch (url) {
11
+ case '/first-step':
12
+ return new Response(JSON.stringify({
13
+ id: 'first-step',
14
+ title: 'First Step',
15
+ layout: [],
16
+ schemas: [],
17
+ }));
18
+ default:
19
+ return new Response(null, { status: 404 });
20
+ }
21
+ };
22
+ const onCompletion = action('onCompletion');
23
+ const onError = action('onError');
24
+ const onEvent = action('onEvent');
25
+ const onLog = action('onLog');
26
+ const initialActionValid = { method: 'GET', url: '/first-step' };
27
+ export const InitialisationWithSuccessfulStep = {
28
+ render: () => (_jsx(DynamicFlow, { flowId: "initialisation-telemetry", customFetch: mockFetch, initialAction: initialActionValid, onCompletion: onCompletion, onError: onError, onEvent: onEvent, onLog: onLog })),
29
+ };
30
+ const initialActionInvalid = { method: 'GET', url: '/invalid-step' };
31
+ export const InitialisationWith404Step = {
32
+ render: () => (_jsx(DynamicFlow, { flowId: "initialisation-telemetry", customFetch: mockFetch, initialAction: initialActionInvalid, onCompletion: onCompletion, onError: onError, onEvent: onEvent, onLog: onLog })),
33
+ };