@wise/dynamic-flow-client 3.16.7 → 3.17.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.mjs CHANGED
@@ -138,12 +138,12 @@ var init_clsx = __esm({
138
138
  }
139
139
  });
140
140
 
141
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
141
+ // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js
142
142
  import { useState as useState2, useEffect as useEffect2, forwardRef, Suspense, lazy } from "react";
143
143
  import { jsx as jsx17, jsxs as jsxs4, Fragment as Fragment3 } from "react/jsx-runtime";
144
144
  var unknownFlagName, Flag, Sizes, ImageSizes, imageSizes, Assets, RenderMode;
145
145
  var init_index_93a0c34e_esm = __esm({
146
- "../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
146
+ "../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-93a0c34e.esm.js"() {
147
147
  "use strict";
148
148
  init_clsx();
149
149
  unknownFlagName = "wise";
@@ -6863,10 +6863,11 @@ var getStepPolling = ({
6863
6863
  onFailure();
6864
6864
  }
6865
6865
  };
6866
+ poll();
6866
6867
  const intervalRef = setInterval(poll, delay * 1e3);
6867
6868
  const stop = () => {
6868
- abortController.abort();
6869
6869
  clearTimeout(intervalRef);
6870
+ abortController.abort();
6870
6871
  };
6871
6872
  return { stop };
6872
6873
  };
@@ -11285,7 +11286,7 @@ var DateInputRenderer_default = DateInputRenderer;
11285
11286
  // ../renderers/src/DecisionRenderer.tsx
11286
11287
  import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
11287
11288
 
11288
- // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11289
+ // ../../node_modules/.pnpm/@wise+art@2.14.0_@transferwise+neptune-css@14.15.0_@types+react@18.3.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11289
11290
  init_index_93a0c34e_esm();
11290
11291
  init_clsx();
11291
11292
  import "react";
@@ -14246,6 +14247,7 @@ function useExternal2(url) {
14246
14247
  // src/legacy/common/hooks/useExternalStepPolling/useExternalStepPolling.tsx
14247
14248
  import { useCallback as useCallback5, useMemo as useMemo11 } from "react";
14248
14249
  function useExternalStepPolling(polling, onAction) {
14250
+ var _a, _b;
14249
14251
  const httpClient = useHttpClient();
14250
14252
  const asyncFn = useMemo11(() => {
14251
14253
  if (polling) {
@@ -14288,7 +14290,7 @@ function useExternalStepPolling(polling, onAction) {
14288
14290
  );
14289
14291
  usePolling({
14290
14292
  asyncFn,
14291
- interval: (polling == null ? void 0 : polling.delay) || (polling == null ? void 0 : polling.interval) || 0,
14293
+ delay: (_b = (_a = polling == null ? void 0 : polling.delay) != null ? _a : polling == null ? void 0 : polling.interval) != null ? _b : 0,
14292
14294
  maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
14293
14295
  maxConsecutiveFails: (polling == null ? void 0 : polling.maxConsecutiveFails) || 0,
14294
14296
  onPollingResponse,
@@ -18417,7 +18419,7 @@ function hasStringMessage(value) {
18417
18419
  import { useEffect as useEffect19, useMemo as useMemo19, useRef as useRef5 } from "react";
18418
18420
  function usePolling({
18419
18421
  asyncFn,
18420
- interval,
18422
+ delay,
18421
18423
  maxAttempts,
18422
18424
  maxConsecutiveFails,
18423
18425
  onPollingResponse,
@@ -18436,13 +18438,14 @@ function usePolling({
18436
18438
  [asyncFn, maxAttempts, maxConsecutiveFails]
18437
18439
  );
18438
18440
  useEffect19(() => {
18439
- if (interval > 0) {
18441
+ if (delay > 0) {
18442
+ poll();
18440
18443
  const intervalReference = setInterval(() => {
18441
18444
  poll();
18442
- }, interval);
18445
+ }, delay);
18443
18446
  return () => clearInterval(intervalReference);
18444
18447
  }
18445
- }, [poll, interval]);
18448
+ }, [poll, delay]);
18446
18449
  useEffect19(() => {
18447
18450
  onPollingResponseReference.current = onPollingResponse;
18448
18451
  onFailureReference.current = onFailure;
@@ -18486,6 +18489,7 @@ var usePrevious = (value) => {
18486
18489
  // src/legacy/common/hooks/useStepPolling/useStepPolling.tsx
18487
18490
  import { useCallback as useCallback8, useMemo as useMemo20 } from "react";
18488
18491
  function useStepPolling(polling, onAction) {
18492
+ var _a, _b;
18489
18493
  const httpClient = useHttpClient();
18490
18494
  const asyncFn = useMemo20(() => {
18491
18495
  if (polling) {
@@ -18512,7 +18516,7 @@ function useStepPolling(polling, onAction) {
18512
18516
  );
18513
18517
  usePolling({
18514
18518
  asyncFn,
18515
- interval: 1e3 * ((polling == null ? void 0 : polling.interval) || 0),
18519
+ delay: 1e3 * ((_b = (_a = polling == null ? void 0 : polling.delay) != null ? _a : polling == null ? void 0 : polling.interval) != null ? _b : 0),
18516
18520
  maxAttempts: (polling == null ? void 0 : polling.maxAttempts) || 0,
18517
18521
  maxConsecutiveFails: 1,
18518
18522
  onPollingResponse,
@@ -1,11 +1,11 @@
1
1
  type PollingOptions<PR> = {
2
2
  asyncFn: (() => Promise<PR>) | undefined;
3
- interval: number;
3
+ delay: number;
4
4
  maxAttempts: number;
5
5
  maxConsecutiveFails: number;
6
6
  onPollingResponse: (pollingResponse: PR) => boolean;
7
7
  onFailure: () => void;
8
8
  };
9
- export declare function usePolling<PollingResponse>({ asyncFn, interval, maxAttempts, maxConsecutiveFails, onPollingResponse, onFailure, }: PollingOptions<PollingResponse>): void;
9
+ export declare function usePolling<PollingResponse>({ asyncFn, delay, maxAttempts, maxConsecutiveFails, onPollingResponse, onFailure, }: PollingOptions<PollingResponse>): void;
10
10
  export declare function createPollingClosure<PR>(asyncFn: (() => Promise<PR>) | undefined, maxAttempts: number, maxConsecutiveFails: number, onPollingResponse: (pollingResponse: PR) => boolean, onFailure: () => void): () => void;
11
11
  export {};
@@ -0,0 +1,2 @@
1
+ export { getMockHttpClient, respondWith, respondWithEtag, respondWithEmptyOk, respondWithEmptyAndEtag, } from './fetch-utils';
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": "3.16.7",
3
+ "version": "3.17.1",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -30,11 +30,11 @@
30
30
  "@babel/core": "7.25.2",
31
31
  "@babel/plugin-syntax-flow": "7.24.7",
32
32
  "@babel/plugin-transform-react-jsx": "7.25.2",
33
- "@babel/preset-env": "7.25.3",
33
+ "@babel/preset-env": "7.25.4",
34
34
  "@babel/preset-react": "7.24.7",
35
35
  "@babel/preset-typescript": "7.24.7",
36
36
  "@cfaester/enzyme-adapter-react-18": "0.8.0",
37
- "@chromatic-com/storybook": "1.6.1",
37
+ "@chromatic-com/storybook": "1.7.0",
38
38
  "@formatjs/cli": "^6.2.12",
39
39
  "@storybook/addon-a11y": "^8.2.9",
40
40
  "@storybook/addon-actions": "^8.2.9",
@@ -48,7 +48,7 @@
48
48
  "@storybook/test": "^8.2.9",
49
49
  "@storybook/types": "^8.2.9",
50
50
  "@testing-library/dom": "10.4.0",
51
- "@testing-library/jest-dom": "6.4.8",
51
+ "@testing-library/jest-dom": "6.5.0",
52
52
  "@testing-library/react": "16.0.0",
53
53
  "@testing-library/react-hooks": "8.0.1",
54
54
  "@testing-library/user-event": "14.5.2",
@@ -58,14 +58,14 @@
58
58
  "@transferwise/neptune-css": "14.15.0",
59
59
  "@types/enzyme": "^3.10.18",
60
60
  "@types/jest": "29.5.12",
61
- "@types/react": "18.3.3",
61
+ "@types/react": "18.3.4",
62
62
  "@types/react-dom": "18.3.0",
63
63
  "@types/react-intl": "3.0.0",
64
64
  "@wise/art": "2.14.0",
65
65
  "@wise/components-theming": "^1.6.0",
66
66
  "babel-jest": "29.7.0",
67
67
  "enzyme": "^3.11.0",
68
- "esbuild": "0.23.0",
68
+ "esbuild": "0.23.1",
69
69
  "jest": "29.7.0",
70
70
  "jest-environment-jsdom": "29.7.0",
71
71
  "jest-fetch-mock": "^3.0.3",
@@ -83,9 +83,9 @@
83
83
  "stylelint-config-standard": "36.0.1",
84
84
  "stylelint-no-unsupported-browser-features": "8.0.1",
85
85
  "stylelint-value-no-unknown-custom-properties": "6.0.1",
86
- "tsx": "4.17.0",
86
+ "tsx": "4.18.0",
87
87
  "typescript": "5.5.4",
88
- "webpack": "5.93.0",
88
+ "webpack": "5.94.0",
89
89
  "@wise/dynamic-flow-fixtures": "0.0.1",
90
90
  "@wise/dynamic-flow-renderers": "0.0.0"
91
91
  },
@@ -104,7 +104,7 @@
104
104
  "nanoid": "5.0.7",
105
105
  "react-webcam": "^7.2.0",
106
106
  "screenfull": "^5.2.0",
107
- "@wise/dynamic-flow-types": "2.20.0"
107
+ "@wise/dynamic-flow-types": "2.20.1"
108
108
  },
109
109
  "scripts": {
110
110
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",