@wise/dynamic-flow-client 5.6.1 → 5.6.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.
package/build/i18n/ja.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "大変申し訳ございませんが、ファイルが大きすぎます。これより小さいファイルをアップロードしてください。",
|
|
27
27
|
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "そのファイル形式はサポートされていません。別のファイルをアップロードしてください。",
|
|
28
28
|
"dynamicFlows.Help.ariaLabel": "詳細はこちらをクリックしてください。",
|
|
29
|
-
"dynamicFlows.MultiSelect.summary": "{first}とその他{count}",
|
|
29
|
+
"dynamicFlows.MultiSelect.summary": "{first}とその他{count}オプション",
|
|
30
30
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "大変申し訳ございませんが、ファイルが大きすぎます。これより小さいファイルをアップロードしてください。",
|
|
31
31
|
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "{maxItems}個以下のファイルをアップロードしてください。",
|
|
32
32
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "{minItems}個以上のファイルをアップロードしてください。",
|
package/build/main.js
CHANGED
|
@@ -416,7 +416,7 @@ var ja_default = {
|
|
|
416
416
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "\u5927\u5909\u7533\u3057\u8A33\u3054\u3056\u3044\u307E\u305B\u3093\u304C\u3001\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002\u3053\u308C\u3088\u308A\u5C0F\u3055\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
417
417
|
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u305D\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
418
418
|
"dynamicFlows.Help.ariaLabel": "\u8A73\u7D30\u306F\u3053\u3061\u3089\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
419
|
-
"dynamicFlows.MultiSelect.summary": "{first}\u3068\u305D\u306E\u4ED6{count}",
|
|
419
|
+
"dynamicFlows.MultiSelect.summary": "{first}\u3068\u305D\u306E\u4ED6{count}\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
420
420
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u5927\u5909\u7533\u3057\u8A33\u3054\u3056\u3044\u307E\u305B\u3093\u304C\u3001\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002\u3053\u308C\u3088\u308A\u5C0F\u3055\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
421
421
|
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "{maxItems}\u500B\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
422
422
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "{minItems}\u500B\u4EE5\u4E0A\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
@@ -5407,6 +5407,7 @@ var mapStringSchemaSuggestions = (suggestions, logEvent) => {
|
|
|
5407
5407
|
|
|
5408
5408
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.ts
|
|
5409
5409
|
var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
5410
|
+
var _a;
|
|
5410
5411
|
const { schema, localValue, model, required = false, onPersistAsync } = schemaMapperProps;
|
|
5411
5412
|
const {
|
|
5412
5413
|
autocompleteHint,
|
|
@@ -5422,7 +5423,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5422
5423
|
mapperProps
|
|
5423
5424
|
);
|
|
5424
5425
|
const validLocalValue = isString(localValue) ? localValue : null;
|
|
5425
|
-
const validModel =
|
|
5426
|
+
const validModel = (_a = getValidDate(model)) != null ? _a : getValidDate(defaultValue != null ? defaultValue : null);
|
|
5426
5427
|
const value = onPersistAsync ? validLocalValue : validModel;
|
|
5427
5428
|
return createDateInputComponent(
|
|
5428
5429
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
@@ -5445,6 +5446,21 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5445
5446
|
onComponentUpdate
|
|
5446
5447
|
);
|
|
5447
5448
|
};
|
|
5449
|
+
var getValidDate = (model) => {
|
|
5450
|
+
if (!isString(model)) {
|
|
5451
|
+
return null;
|
|
5452
|
+
}
|
|
5453
|
+
if (/^\d{4}-\d{2}$/.test(model)) {
|
|
5454
|
+
return model;
|
|
5455
|
+
}
|
|
5456
|
+
try {
|
|
5457
|
+
const date = new Date(model);
|
|
5458
|
+
const stringDate = date.toISOString();
|
|
5459
|
+
return stringDate.split("T")[0];
|
|
5460
|
+
} catch (e) {
|
|
5461
|
+
return null;
|
|
5462
|
+
}
|
|
5463
|
+
};
|
|
5448
5464
|
|
|
5449
5465
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.ts
|
|
5450
5466
|
var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
@@ -6021,13 +6037,13 @@ var makeRequestCacheWithParent = (parent) => {
|
|
|
6021
6037
|
const cache = {
|
|
6022
6038
|
get: (requestParams) => {
|
|
6023
6039
|
var _a;
|
|
6024
|
-
const key =
|
|
6040
|
+
const key = makeRequestCacheKey(requestParams);
|
|
6025
6041
|
const promise = (_a = map.get(key)) != null ? _a : parent == null ? void 0 : parent.get(requestParams);
|
|
6026
6042
|
map.delete(key);
|
|
6027
6043
|
return promise;
|
|
6028
6044
|
},
|
|
6029
6045
|
set: (requestParams, responsePromise) => {
|
|
6030
|
-
return map.set(
|
|
6046
|
+
return map.set(makeRequestCacheKey(requestParams), responsePromise);
|
|
6031
6047
|
}
|
|
6032
6048
|
};
|
|
6033
6049
|
return cache;
|
|
@@ -6051,7 +6067,7 @@ var normaliseRequestCache = (cache) => {
|
|
|
6051
6067
|
var isRequestCacheInstance = (cache) => {
|
|
6052
6068
|
return !cache || !Array.isArray(cache);
|
|
6053
6069
|
};
|
|
6054
|
-
var
|
|
6070
|
+
var makeRequestCacheKey = (requestParams) => {
|
|
6055
6071
|
var _a, _b;
|
|
6056
6072
|
const [input, init] = requestParams;
|
|
6057
6073
|
const url = typeof input === "string" || input instanceof URL ? input.toString() : input.url;
|
|
@@ -6067,7 +6083,11 @@ var makeKey = (requestParams) => {
|
|
|
6067
6083
|
// src/domain/features/prefetch/getStepPrefetch.ts
|
|
6068
6084
|
var getStepPrefetch = (httpClient, flowRequestCache, submissionBehaviors) => {
|
|
6069
6085
|
const requestCache = makeRequestCacheWithParent(flowRequestCache);
|
|
6086
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6070
6087
|
const start = (model) => {
|
|
6088
|
+
if (keys.size > 0) {
|
|
6089
|
+
return;
|
|
6090
|
+
}
|
|
6071
6091
|
submissionBehaviors.forEach((behavior) => {
|
|
6072
6092
|
const request = behavior.type === "action" ? createRequestFromAction(behavior.action, model) : behavior.launchConfig.request;
|
|
6073
6093
|
const requestParams = [
|
|
@@ -6079,8 +6099,13 @@ var getStepPrefetch = (httpClient, flowRequestCache, submissionBehaviors) => {
|
|
|
6079
6099
|
}
|
|
6080
6100
|
];
|
|
6081
6101
|
try {
|
|
6102
|
+
const key = makeRequestCacheKey(requestParams);
|
|
6103
|
+
if (keys.has(key)) {
|
|
6104
|
+
return;
|
|
6105
|
+
}
|
|
6082
6106
|
const responsePromise = httpClient(...requestParams).catch(() => null);
|
|
6083
6107
|
requestCache.set(requestParams, responsePromise);
|
|
6108
|
+
keys.add(key);
|
|
6084
6109
|
} catch (e) {
|
|
6085
6110
|
}
|
|
6086
6111
|
});
|
package/build/main.mjs
CHANGED
|
@@ -386,7 +386,7 @@ var ja_default = {
|
|
|
386
386
|
"dynamicFlows.FileUploadSchema.maxFileSizeError": "\u5927\u5909\u7533\u3057\u8A33\u3054\u3056\u3044\u307E\u305B\u3093\u304C\u3001\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002\u3053\u308C\u3088\u308A\u5C0F\u3055\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
387
387
|
"dynamicFlows.FileUploadSchema.wrongFileTypeError": "\u305D\u306E\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u306F\u30B5\u30DD\u30FC\u30C8\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u5225\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
388
388
|
"dynamicFlows.Help.ariaLabel": "\u8A73\u7D30\u306F\u3053\u3061\u3089\u3092\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
389
|
-
"dynamicFlows.MultiSelect.summary": "{first}\u3068\u305D\u306E\u4ED6{count}",
|
|
389
|
+
"dynamicFlows.MultiSelect.summary": "{first}\u3068\u305D\u306E\u4ED6{count}\u30AA\u30D7\u30B7\u30E7\u30F3",
|
|
390
390
|
"dynamicFlows.MultipleFileUploadSchema.maxFileSizeError": "\u5927\u5909\u7533\u3057\u8A33\u3054\u3056\u3044\u307E\u305B\u3093\u304C\u3001\u30D5\u30A1\u30A4\u30EB\u304C\u5927\u304D\u3059\u304E\u307E\u3059\u3002\u3053\u308C\u3088\u308A\u5C0F\u3055\u3044\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
391
391
|
"dynamicFlows.MultipleFileUploadSchema.maxItemsError": "{maxItems}\u500B\u4EE5\u4E0B\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
392
392
|
"dynamicFlows.MultipleFileUploadSchema.minItemsError": "{minItems}\u500B\u4EE5\u4E0A\u306E\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",
|
|
@@ -5377,6 +5377,7 @@ var mapStringSchemaSuggestions = (suggestions, logEvent) => {
|
|
|
5377
5377
|
|
|
5378
5378
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToDateInputComponent.ts
|
|
5379
5379
|
var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
5380
|
+
var _a;
|
|
5380
5381
|
const { schema, localValue, model, required = false, onPersistAsync } = schemaMapperProps;
|
|
5381
5382
|
const {
|
|
5382
5383
|
autocompleteHint,
|
|
@@ -5392,7 +5393,7 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5392
5393
|
mapperProps
|
|
5393
5394
|
);
|
|
5394
5395
|
const validLocalValue = isString(localValue) ? localValue : null;
|
|
5395
|
-
const validModel =
|
|
5396
|
+
const validModel = (_a = getValidDate(model)) != null ? _a : getValidDate(defaultValue != null ? defaultValue : null);
|
|
5396
5397
|
const value = onPersistAsync ? validLocalValue : validModel;
|
|
5397
5398
|
return createDateInputComponent(
|
|
5398
5399
|
__spreadProps(__spreadValues({}, mapCommonSchemaProps(schemaMapperProps)), {
|
|
@@ -5415,6 +5416,21 @@ var stringSchemaToDateInputComponent = (schemaMapperProps, mapperProps) => {
|
|
|
5415
5416
|
onComponentUpdate
|
|
5416
5417
|
);
|
|
5417
5418
|
};
|
|
5419
|
+
var getValidDate = (model) => {
|
|
5420
|
+
if (!isString(model)) {
|
|
5421
|
+
return null;
|
|
5422
|
+
}
|
|
5423
|
+
if (/^\d{4}-\d{2}$/.test(model)) {
|
|
5424
|
+
return model;
|
|
5425
|
+
}
|
|
5426
|
+
try {
|
|
5427
|
+
const date = new Date(model);
|
|
5428
|
+
const stringDate = date.toISOString();
|
|
5429
|
+
return stringDate.split("T")[0];
|
|
5430
|
+
} catch (e) {
|
|
5431
|
+
return null;
|
|
5432
|
+
}
|
|
5433
|
+
};
|
|
5418
5434
|
|
|
5419
5435
|
// src/domain/mappers/schema/stringSchemaToComponent/stringSchemaToUploadInputComponent.ts
|
|
5420
5436
|
var stringSchemaToUploadInputComponent = (schemaMapperProps, mapperProps) => {
|
|
@@ -5991,13 +6007,13 @@ var makeRequestCacheWithParent = (parent) => {
|
|
|
5991
6007
|
const cache = {
|
|
5992
6008
|
get: (requestParams) => {
|
|
5993
6009
|
var _a;
|
|
5994
|
-
const key =
|
|
6010
|
+
const key = makeRequestCacheKey(requestParams);
|
|
5995
6011
|
const promise = (_a = map.get(key)) != null ? _a : parent == null ? void 0 : parent.get(requestParams);
|
|
5996
6012
|
map.delete(key);
|
|
5997
6013
|
return promise;
|
|
5998
6014
|
},
|
|
5999
6015
|
set: (requestParams, responsePromise) => {
|
|
6000
|
-
return map.set(
|
|
6016
|
+
return map.set(makeRequestCacheKey(requestParams), responsePromise);
|
|
6001
6017
|
}
|
|
6002
6018
|
};
|
|
6003
6019
|
return cache;
|
|
@@ -6021,7 +6037,7 @@ var normaliseRequestCache = (cache) => {
|
|
|
6021
6037
|
var isRequestCacheInstance = (cache) => {
|
|
6022
6038
|
return !cache || !Array.isArray(cache);
|
|
6023
6039
|
};
|
|
6024
|
-
var
|
|
6040
|
+
var makeRequestCacheKey = (requestParams) => {
|
|
6025
6041
|
var _a, _b;
|
|
6026
6042
|
const [input, init] = requestParams;
|
|
6027
6043
|
const url = typeof input === "string" || input instanceof URL ? input.toString() : input.url;
|
|
@@ -6037,7 +6053,11 @@ var makeKey = (requestParams) => {
|
|
|
6037
6053
|
// src/domain/features/prefetch/getStepPrefetch.ts
|
|
6038
6054
|
var getStepPrefetch = (httpClient, flowRequestCache, submissionBehaviors) => {
|
|
6039
6055
|
const requestCache = makeRequestCacheWithParent(flowRequestCache);
|
|
6056
|
+
const keys = /* @__PURE__ */ new Set();
|
|
6040
6057
|
const start = (model) => {
|
|
6058
|
+
if (keys.size > 0) {
|
|
6059
|
+
return;
|
|
6060
|
+
}
|
|
6041
6061
|
submissionBehaviors.forEach((behavior) => {
|
|
6042
6062
|
const request = behavior.type === "action" ? createRequestFromAction(behavior.action, model) : behavior.launchConfig.request;
|
|
6043
6063
|
const requestParams = [
|
|
@@ -6049,8 +6069,13 @@ var getStepPrefetch = (httpClient, flowRequestCache, submissionBehaviors) => {
|
|
|
6049
6069
|
}
|
|
6050
6070
|
];
|
|
6051
6071
|
try {
|
|
6072
|
+
const key = makeRequestCacheKey(requestParams);
|
|
6073
|
+
if (keys.has(key)) {
|
|
6074
|
+
return;
|
|
6075
|
+
}
|
|
6052
6076
|
const responsePromise = httpClient(...requestParams).catch(() => null);
|
|
6053
6077
|
requestCache.set(requestParams, responsePromise);
|
|
6078
|
+
keys.add(key);
|
|
6054
6079
|
} catch (e) {
|
|
6055
6080
|
}
|
|
6056
6081
|
});
|
|
@@ -7,3 +7,4 @@ export type RequestCacheEntries = readonly [Parameters<HttpClient>, Promise<Resp
|
|
|
7
7
|
export declare const makeRequestCacheWithParent: (parent: RequestCache | undefined) => RequestCache;
|
|
8
8
|
export declare const makeRequestCache: (initialValues?: RequestCacheEntries) => RequestCache;
|
|
9
9
|
export declare const normaliseRequestCache: (cache: RequestCache | RequestCacheEntries | undefined) => RequestCache;
|
|
10
|
+
export declare const makeRequestCacheKey: (requestParams: Parameters<HttpClient>) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.2",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@chromatic-com/storybook": "4.1.3",
|
|
35
35
|
"@formatjs/cli": "^6.12.0",
|
|
36
|
-
"@storybook/addon-a11y": "^10.2.
|
|
37
|
-
"@storybook/addon-docs": "^10.2.
|
|
38
|
-
"@storybook/addon-links": "^10.2.
|
|
39
|
-
"@storybook/react-vite": "10.2.
|
|
36
|
+
"@storybook/addon-a11y": "^10.2.3",
|
|
37
|
+
"@storybook/addon-docs": "^10.2.3",
|
|
38
|
+
"@storybook/addon-links": "^10.2.3",
|
|
39
|
+
"@storybook/react-vite": "10.2.3",
|
|
40
40
|
"@testing-library/dom": "10.4.1",
|
|
41
41
|
"@testing-library/jest-dom": "6.9.1",
|
|
42
42
|
"@testing-library/react": "16.3.2",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"@transferwise/components": "^46.122.1",
|
|
45
45
|
"@transferwise/formatting": "^2.13.4",
|
|
46
46
|
"@transferwise/icons": "4.0.2",
|
|
47
|
-
"@transferwise/navigation-ui": "4.
|
|
47
|
+
"@transferwise/navigation-ui": "4.42.0",
|
|
48
48
|
"@transferwise/neptune-css": "14.26.1",
|
|
49
49
|
"@types/node": "22.19.7",
|
|
50
50
|
"@types/react": "18.3.27",
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
"@wise/art": "2.26.0",
|
|
55
55
|
"@wise/components-theming": "^1.10.0",
|
|
56
56
|
"esbuild": "0.27.0",
|
|
57
|
-
"eslint-plugin-storybook": "10.2.
|
|
58
|
-
"framer-motion": "^12.29.
|
|
57
|
+
"eslint-plugin-storybook": "10.2.3",
|
|
58
|
+
"framer-motion": "^12.29.2",
|
|
59
59
|
"npm-run-all2": "8.0.4",
|
|
60
60
|
"postcss": "^8.5.6",
|
|
61
61
|
"postcss-cli": "^11.0.1",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react": "18.3.1",
|
|
64
64
|
"react-dom": "18.3.1",
|
|
65
65
|
"react-intl": "6.8.9",
|
|
66
|
-
"storybook": "^10.2.
|
|
66
|
+
"storybook": "^10.2.3",
|
|
67
67
|
"stylelint": "16.26.1",
|
|
68
68
|
"stylelint-config-standard": "36.0.1",
|
|
69
69
|
"stylelint-no-unsupported-browser-features": "8.0.5",
|