@wise/dynamic-flow-client 4.19.0 → 4.19.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/main.js
CHANGED
|
@@ -2308,6 +2308,10 @@ var createRootDomainComponent = (updateComponent) => {
|
|
|
2308
2308
|
getTrackEvent() {
|
|
2309
2309
|
return this.stepComponent ? this.stepComponent.trackEvent : null;
|
|
2310
2310
|
},
|
|
2311
|
+
isBusy() {
|
|
2312
|
+
const loadingState = this.getLoadingState();
|
|
2313
|
+
return loadingState === "submitting" || loadingState === "refreshing";
|
|
2314
|
+
},
|
|
2311
2315
|
hasStep() {
|
|
2312
2316
|
return Boolean(this.stepComponent);
|
|
2313
2317
|
},
|
|
@@ -7183,6 +7187,7 @@ function useDynamicFlowCore(props) {
|
|
|
7183
7187
|
(0, import_react3.useEffect)(() => {
|
|
7184
7188
|
trackCoreEvent("Initiated");
|
|
7185
7189
|
if (!initialStep && initialAction) {
|
|
7190
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7186
7191
|
void onAction(__spreadValues({ method: "GET" }, initialAction), null);
|
|
7187
7192
|
}
|
|
7188
7193
|
if (initialStep && !initialAction) {
|
|
@@ -7280,14 +7285,18 @@ function useDynamicFlowCore(props) {
|
|
|
7280
7285
|
const onBehavior = (0, import_react3.useCallback)(async (behavior) => {
|
|
7281
7286
|
switch (behavior.type) {
|
|
7282
7287
|
case "action": {
|
|
7283
|
-
rootComponentRef.current.
|
|
7288
|
+
if (rootComponentRef.current.isBusy()) {
|
|
7289
|
+
return { abort: () => {
|
|
7290
|
+
} };
|
|
7291
|
+
}
|
|
7284
7292
|
rootComponentRef.current.dismissAllModals();
|
|
7293
|
+
const { action } = behavior;
|
|
7294
|
+
const skipValidation = action.method === "GET" || Boolean(action.skipValidation);
|
|
7295
|
+
const canSubmit = skipValidation || rootComponentRef.current.validate();
|
|
7285
7296
|
try {
|
|
7286
|
-
const { action } = behavior;
|
|
7287
|
-
const model = await rootComponentRef.current.getSubmittableValue();
|
|
7288
|
-
const skipValidation = action.method === "GET" || Boolean(action.skipValidation);
|
|
7289
|
-
const canSubmit = skipValidation || rootComponentRef.current.validate();
|
|
7290
7297
|
if (canSubmit) {
|
|
7298
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7299
|
+
const model = await rootComponentRef.current.getSubmittableValue();
|
|
7291
7300
|
void onAction(action, model);
|
|
7292
7301
|
} else {
|
|
7293
7302
|
rootComponentRef.current.setLoadingState("idle");
|
|
@@ -7304,6 +7313,7 @@ function useDynamicFlowCore(props) {
|
|
|
7304
7313
|
case "non-merging-action": {
|
|
7305
7314
|
rootComponentRef.current.dismissAllModals();
|
|
7306
7315
|
const { action } = behavior;
|
|
7316
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7307
7317
|
void onAction(action, null);
|
|
7308
7318
|
break;
|
|
7309
7319
|
}
|
|
@@ -7348,7 +7358,6 @@ function useDynamicFlowCore(props) {
|
|
|
7348
7358
|
const onAction = (0, import_react3.useCallback)(async (action, model) => {
|
|
7349
7359
|
var _a2, _b, _c, _d, _e, _f;
|
|
7350
7360
|
try {
|
|
7351
|
-
rootComponentRef.current.setLoadingState("submitting");
|
|
7352
7361
|
const command = await executeSubmission({
|
|
7353
7362
|
action,
|
|
7354
7363
|
model,
|
package/build/main.mjs
CHANGED
|
@@ -2265,6 +2265,10 @@ var createRootDomainComponent = (updateComponent) => {
|
|
|
2265
2265
|
getTrackEvent() {
|
|
2266
2266
|
return this.stepComponent ? this.stepComponent.trackEvent : null;
|
|
2267
2267
|
},
|
|
2268
|
+
isBusy() {
|
|
2269
|
+
const loadingState = this.getLoadingState();
|
|
2270
|
+
return loadingState === "submitting" || loadingState === "refreshing";
|
|
2271
|
+
},
|
|
2268
2272
|
hasStep() {
|
|
2269
2273
|
return Boolean(this.stepComponent);
|
|
2270
2274
|
},
|
|
@@ -7140,6 +7144,7 @@ function useDynamicFlowCore(props) {
|
|
|
7140
7144
|
useEffect(() => {
|
|
7141
7145
|
trackCoreEvent("Initiated");
|
|
7142
7146
|
if (!initialStep && initialAction) {
|
|
7147
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7143
7148
|
void onAction(__spreadValues({ method: "GET" }, initialAction), null);
|
|
7144
7149
|
}
|
|
7145
7150
|
if (initialStep && !initialAction) {
|
|
@@ -7237,14 +7242,18 @@ function useDynamicFlowCore(props) {
|
|
|
7237
7242
|
const onBehavior = useCallback2(async (behavior) => {
|
|
7238
7243
|
switch (behavior.type) {
|
|
7239
7244
|
case "action": {
|
|
7240
|
-
rootComponentRef.current.
|
|
7245
|
+
if (rootComponentRef.current.isBusy()) {
|
|
7246
|
+
return { abort: () => {
|
|
7247
|
+
} };
|
|
7248
|
+
}
|
|
7241
7249
|
rootComponentRef.current.dismissAllModals();
|
|
7250
|
+
const { action } = behavior;
|
|
7251
|
+
const skipValidation = action.method === "GET" || Boolean(action.skipValidation);
|
|
7252
|
+
const canSubmit = skipValidation || rootComponentRef.current.validate();
|
|
7242
7253
|
try {
|
|
7243
|
-
const { action } = behavior;
|
|
7244
|
-
const model = await rootComponentRef.current.getSubmittableValue();
|
|
7245
|
-
const skipValidation = action.method === "GET" || Boolean(action.skipValidation);
|
|
7246
|
-
const canSubmit = skipValidation || rootComponentRef.current.validate();
|
|
7247
7254
|
if (canSubmit) {
|
|
7255
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7256
|
+
const model = await rootComponentRef.current.getSubmittableValue();
|
|
7248
7257
|
void onAction(action, model);
|
|
7249
7258
|
} else {
|
|
7250
7259
|
rootComponentRef.current.setLoadingState("idle");
|
|
@@ -7261,6 +7270,7 @@ function useDynamicFlowCore(props) {
|
|
|
7261
7270
|
case "non-merging-action": {
|
|
7262
7271
|
rootComponentRef.current.dismissAllModals();
|
|
7263
7272
|
const { action } = behavior;
|
|
7273
|
+
rootComponentRef.current.setLoadingState("submitting");
|
|
7264
7274
|
void onAction(action, null);
|
|
7265
7275
|
break;
|
|
7266
7276
|
}
|
|
@@ -7305,7 +7315,6 @@ function useDynamicFlowCore(props) {
|
|
|
7305
7315
|
const onAction = useCallback2(async (action, model) => {
|
|
7306
7316
|
var _a2, _b, _c, _d, _e, _f;
|
|
7307
7317
|
try {
|
|
7308
|
-
rootComponentRef.current.setLoadingState("submitting");
|
|
7309
7318
|
const command = await executeSubmission({
|
|
7310
7319
|
action,
|
|
7311
7320
|
model,
|
|
@@ -16,6 +16,7 @@ export type RootDomainComponent = BaseComponent & {
|
|
|
16
16
|
getSchemaComponents: () => SchemaComponent[];
|
|
17
17
|
getSubmittableValue: () => Promise<Model>;
|
|
18
18
|
getSubmittableValueSync: () => Model;
|
|
19
|
+
isBusy: () => boolean;
|
|
19
20
|
validate: () => boolean;
|
|
20
21
|
getTrackEvent: () => AnalyticsEventDispatcher<string> | null;
|
|
21
22
|
setLoadingState: (loadingState: LoadingState) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { getMockHttpClient, respondWith, respondWithEtag, respondWithEmptyOk, respondWithEmptyAndEtag, } from './fetch-utils';
|
|
1
|
+
export { getMockHttpClient, respondWith, respondWithDelay, respondWithEtag, respondWithEmptyOk, respondWithEmptyAndEtag, } from './fetch-utils';
|
|
2
2
|
export { renderWithProviders } from './rtl-utils';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wise/dynamic-flow-client",
|
|
3
|
-
"version": "4.19.
|
|
3
|
+
"version": "4.19.1",
|
|
4
4
|
"description": "Dynamic Flow web client",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/main.js",
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"@babel/preset-react": "7.27.1",
|
|
38
38
|
"@babel/preset-typescript": "7.27.1",
|
|
39
39
|
"@chromatic-com/storybook": "4.1.1",
|
|
40
|
-
"@formatjs/cli": "^6.7.
|
|
41
|
-
"@storybook/addon-a11y": "^9.1.
|
|
42
|
-
"@storybook/addon-docs": "^9.1.
|
|
43
|
-
"@storybook/addon-links": "^9.1.
|
|
44
|
-
"@storybook/react-vite": "9.1.
|
|
40
|
+
"@formatjs/cli": "^6.7.3",
|
|
41
|
+
"@storybook/addon-a11y": "^9.1.10",
|
|
42
|
+
"@storybook/addon-docs": "^9.1.10",
|
|
43
|
+
"@storybook/addon-links": "^9.1.10",
|
|
44
|
+
"@storybook/react-vite": "9.1.10",
|
|
45
45
|
"@testing-library/dom": "10.4.1",
|
|
46
|
-
"@testing-library/jest-dom": "6.
|
|
46
|
+
"@testing-library/jest-dom": "6.9.1",
|
|
47
47
|
"@testing-library/react": "16.3.0",
|
|
48
48
|
"@testing-library/user-event": "14.6.1",
|
|
49
49
|
"@transferwise/components": "46.111.0",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"@transferwise/icons": "3.22.4",
|
|
52
52
|
"@transferwise/neptune-css": "14.25.0",
|
|
53
53
|
"@types/jest": "30.0.0",
|
|
54
|
-
"@types/node": "22.18.
|
|
55
|
-
"@types/react": "18.3.
|
|
54
|
+
"@types/node": "22.18.8",
|
|
55
|
+
"@types/react": "18.3.25",
|
|
56
56
|
"@types/react-dom": "18.3.7",
|
|
57
57
|
"@types/react-intl": "3.0.0",
|
|
58
|
-
"@wise/art": "2.24.
|
|
58
|
+
"@wise/art": "2.24.7",
|
|
59
59
|
"@wise/components-theming": "^1.7.0",
|
|
60
|
-
"babel-jest": "30.
|
|
60
|
+
"babel-jest": "30.2.0",
|
|
61
61
|
"esbuild": "0.25.9",
|
|
62
|
-
"eslint-plugin-storybook": "9.1.
|
|
63
|
-
"jest": "30.
|
|
64
|
-
"jest-environment-jsdom": "30.
|
|
62
|
+
"eslint-plugin-storybook": "9.1.10",
|
|
63
|
+
"jest": "30.2.0",
|
|
64
|
+
"jest-environment-jsdom": "30.2.0",
|
|
65
65
|
"jest-fetch-mock": "^3.0.3",
|
|
66
66
|
"jest-watch-typeahead": "^3.0.1",
|
|
67
67
|
"npm-run-all2": "8.0.4",
|
|
@@ -71,15 +71,15 @@
|
|
|
71
71
|
"react": "18.3.1",
|
|
72
72
|
"react-dom": "18.3.1",
|
|
73
73
|
"react-intl": "6.8.9",
|
|
74
|
-
"storybook": "^9.1.
|
|
75
|
-
"stylelint": "16.
|
|
74
|
+
"storybook": "^9.1.10",
|
|
75
|
+
"stylelint": "16.25.0",
|
|
76
76
|
"stylelint-config-standard": "36.0.1",
|
|
77
77
|
"stylelint-no-unsupported-browser-features": "8.0.4",
|
|
78
78
|
"stylelint-value-no-unknown-custom-properties": "6.0.1",
|
|
79
79
|
"tsx": "4.20.6",
|
|
80
|
-
"typescript": "5.9.
|
|
81
|
-
"@wise/dynamic-flow-
|
|
82
|
-
"@wise/dynamic-flow-
|
|
80
|
+
"typescript": "5.9.3",
|
|
81
|
+
"@wise/dynamic-flow-fixtures": "0.0.1",
|
|
82
|
+
"@wise/dynamic-flow-renderers": "0.0.0"
|
|
83
83
|
},
|
|
84
84
|
"peerDependencies": {
|
|
85
85
|
"@transferwise/components": "^46.104.0",
|