@wise/dynamic-flow-client 3.16.2 → 3.16.3

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
@@ -121,21 +121,15 @@ var require_classnames = __commonJS({
121
121
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
122
122
  function r(e) {
123
123
  var t, f, n = "";
124
- if ("string" == typeof e || "number" == typeof e)
125
- n += e;
126
- else if ("object" == typeof e)
127
- if (Array.isArray(e)) {
128
- var o = e.length;
129
- for (t = 0; t < o; t++)
130
- e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
131
- } else
132
- for (f in e)
133
- e[f] && (n && (n += " "), n += f);
124
+ if ("string" == typeof e || "number" == typeof e) n += e;
125
+ else if ("object" == typeof e) if (Array.isArray(e)) {
126
+ var o = e.length;
127
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
128
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
134
129
  return n;
135
130
  }
136
131
  function clsx() {
137
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
138
- (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
132
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
139
133
  return n;
140
134
  }
141
135
  var init_clsx = __esm({
@@ -2470,19 +2464,14 @@ var isDirty = (x) => x.status === "dirty";
2470
2464
  var isValid = (x) => x.status === "valid";
2471
2465
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
2472
2466
  function __classPrivateFieldGet(receiver, state, kind, f) {
2473
- if (kind === "a" && !f)
2474
- throw new TypeError("Private accessor was defined without a getter");
2475
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2476
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
2467
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2468
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
2477
2469
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2478
2470
  }
2479
2471
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
2480
- if (kind === "m")
2481
- throw new TypeError("Private method is not writable");
2482
- if (kind === "a" && !f)
2483
- throw new TypeError("Private accessor was defined without a setter");
2484
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2485
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
2472
+ if (kind === "m") throw new TypeError("Private method is not writable");
2473
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
2474
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
2486
2475
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
2487
2476
  }
2488
2477
  var errorUtil;
@@ -4158,8 +4147,7 @@ var ZodObject = class _ZodObject extends ZodType {
4158
4147
  });
4159
4148
  status.dirty();
4160
4149
  }
4161
- } else if (unknownKeys === "strip")
4162
- ;
4150
+ } else if (unknownKeys === "strip") ;
4163
4151
  else {
4164
4152
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
4165
4153
  }
@@ -13344,7 +13332,7 @@ function isReference(block) {
13344
13332
 
13345
13333
  // src/legacy/dynamicFlow/DynamicFlow.tsx
13346
13334
  import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo23, useState as useState34 } from "react";
13347
- import { useIntl as useIntl28 } from "react-intl";
13335
+ import { useIntl as useIntl29 } from "react-intl";
13348
13336
 
13349
13337
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
13350
13338
  import { createContext as createContext4, useContext as useContext5, useMemo as useMemo8 } from "react";
@@ -14265,11 +14253,11 @@ function useExternalStepPolling(polling, onAction) {
14265
14253
 
14266
14254
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
14267
14255
  import { useState as useState28 } from "react";
14268
- import { useIntl as useIntl22 } from "react-intl";
14256
+ import { useIntl as useIntl23 } from "react-intl";
14269
14257
 
14270
14258
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
14271
14259
  import { useEffect as useEffect18, useState as useState27 } from "react";
14272
- import { useIntl as useIntl21 } from "react-intl";
14260
+ import { useIntl as useIntl22 } from "react-intl";
14273
14261
 
14274
14262
  // src/legacy/common/constants/DateMode.ts
14275
14263
  var DateMode = {
@@ -16161,6 +16149,12 @@ var _FormControl = class _FormControl extends PureComponent {
16161
16149
  radios: options.map(this.mapOption),
16162
16150
  name,
16163
16151
  selectedValue: getSafeStringOrNumberValue(value, { coerceValue: true }),
16152
+ UNSAFE_inputAttributes: {
16153
+ id,
16154
+ "aria-invalid": invalid,
16155
+ "aria-labelledby": void 0,
16156
+ "aria-describedby": describedBy
16157
+ },
16164
16158
  onChange: this.handleOnChange
16165
16159
  }
16166
16160
  );
@@ -17918,10 +17912,12 @@ var addQueryParameter2 = (url, key, value) => {
17918
17912
  // src/legacy/layout/search/DynamicSearch.tsx
17919
17913
  var import_classnames14 = __toESM(require_classnames());
17920
17914
  import { Markdown as Markdown8, Typeahead as Typeahead2 } from "@transferwise/components";
17915
+ import { useIntl as useIntl21 } from "react-intl";
17921
17916
  import { jsx as jsx114, jsxs as jsxs43 } from "react/jsx-runtime";
17922
17917
  var DEBOUNCE_TIME2 = 400;
17923
17918
  function DynamicSearch({ component, onAction }) {
17924
17919
  const [query, setQuery] = useState24("");
17920
+ const intl = useIntl21();
17925
17921
  const { control, title, margin, url, method, param, emptyMessage } = component;
17926
17922
  const { status, results, search } = useSearch({ url, method, param });
17927
17923
  const onEvent = useEventDispatcher();
@@ -17960,6 +17956,7 @@ function DynamicSearch({ component, onAction }) {
17960
17956
  Typeahead2,
17961
17957
  {
17962
17958
  id: "typeahead-input-id",
17959
+ intl,
17963
17960
  name: "typeahead-input-name",
17964
17961
  size: "md",
17965
17962
  maxHeight: 100,
@@ -18197,7 +18194,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
18197
18194
  ]);
18198
18195
  function PersistAsyncBasicSchema(props) {
18199
18196
  const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
18200
- const intl = useIntl21();
18197
+ const intl = useIntl22();
18201
18198
  const httpClient = useHttpClient();
18202
18199
  const onEvent = useEventDispatcher();
18203
18200
  const [persistAsyncModel, setPersistAsyncModel] = useState27(null);
@@ -18295,7 +18292,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
18295
18292
  var usePersistAsync = (persistAsync) => {
18296
18293
  const [abortController, setAbortController] = useState28(null);
18297
18294
  const httpClient = useHttpClient();
18298
- const intl = useIntl22();
18295
+ const intl = useIntl23();
18299
18296
  const { schema } = persistAsync;
18300
18297
  async function handlePersistAsync(model) {
18301
18298
  const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
@@ -18526,7 +18523,7 @@ import { useEffect as useEffect25, useState as useState31 } from "react";
18526
18523
 
18527
18524
  // src/common/cameraCapture/CameraCapture.tsx
18528
18525
  import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo21, useRef as useRef8, useState as useState30 } from "react";
18529
- import { useIntl as useIntl25 } from "react-intl";
18526
+ import { useIntl as useIntl26 } from "react-intl";
18530
18527
  import Webcam from "react-webcam";
18531
18528
 
18532
18529
  // src/common/cameraCapture/CameraCapture.messages.ts
@@ -18591,14 +18588,14 @@ var CameraCapture_messages_default = defineMessages18({
18591
18588
 
18592
18589
  // src/common/cameraCapture/components/bottomBar/BottomBar.tsx
18593
18590
  import { Button as Button10, ControlType, Priority, Size as Size3 } from "@transferwise/components";
18594
- import { useIntl as useIntl23 } from "react-intl";
18591
+ import { useIntl as useIntl24 } from "react-intl";
18595
18592
  import { jsx as jsx119, jsxs as jsxs46 } from "react/jsx-runtime";
18596
18593
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ jsx119("div", { className: "bottom-bar", children: /* @__PURE__ */ jsx119(CaptureButton, { onClick: onCapture }) });
18597
18594
  var ReviewBottomBar = ({
18598
18595
  onSubmit,
18599
18596
  onRetry
18600
18597
  }) => {
18601
- const intl = useIntl23();
18598
+ const intl = useIntl24();
18602
18599
  return /* @__PURE__ */ jsx119("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ jsx119("div", { className: "row", children: /* @__PURE__ */ jsxs46("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
18603
18600
  /* @__PURE__ */ jsx119(
18604
18601
  Button10,
@@ -18637,7 +18634,7 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ jsx119(
18637
18634
  );
18638
18635
 
18639
18636
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18640
- import { useIntl as useIntl24 } from "react-intl";
18637
+ import { useIntl as useIntl25 } from "react-intl";
18641
18638
 
18642
18639
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
18643
18640
  import { defineMessages as defineMessages19 } from "react-intl";
@@ -18652,7 +18649,7 @@ var OrientationLockOverlay_messages_default = defineMessages19({
18652
18649
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18653
18650
  import { jsx as jsx120, jsxs as jsxs47 } from "react/jsx-runtime";
18654
18651
  function OrientationLockOverlay() {
18655
- const intl = useIntl24();
18652
+ const intl = useIntl25();
18656
18653
  return /* @__PURE__ */ jsxs47("div", { className: "orientation-lock-overlay", children: [
18657
18654
  /* @__PURE__ */ jsx120(
18658
18655
  "img",
@@ -18942,7 +18939,7 @@ function CameraCapture({
18942
18939
  shouldLockOrientation,
18943
18940
  onEvent
18944
18941
  );
18945
- const intl = useIntl25();
18942
+ const intl = useIntl26();
18946
18943
  const handleCapture = useCallback10(async () => {
18947
18944
  var _a, _b, _c, _d, _e, _f;
18948
18945
  if (((_a = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _a.video) && ((_c = (_b = webcamReference == null ? void 0 : webcamReference.current) == null ? void 0 : _b.video) == null ? void 0 : _c.readyState) >= 3) {
@@ -19165,7 +19162,7 @@ function getFirstAction(step) {
19165
19162
  }
19166
19163
 
19167
19164
  // src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
19168
- import { useIntl as useIntl26 } from "react-intl";
19165
+ import { useIntl as useIntl27 } from "react-intl";
19169
19166
 
19170
19167
  // src/common/messages/external-confirmation.messages.ts
19171
19168
  import { defineMessages as defineMessages20 } from "react-intl";
@@ -19197,7 +19194,7 @@ import { jsx as jsx125 } from "react/jsx-runtime";
19197
19194
  var noop6 = () => {
19198
19195
  };
19199
19196
  function ExternalConfirmationStep({ url, onClose }) {
19200
- const { formatMessage } = useIntl26();
19197
+ const { formatMessage } = useIntl27();
19201
19198
  return /* @__PURE__ */ jsx125(
19202
19199
  DynamicLayout_default,
19203
19200
  {
@@ -19570,9 +19567,9 @@ var assertResponseIsValid2 = (response) => {
19570
19567
  var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
19571
19568
 
19572
19569
  // src/legacy/dynamicFlow/utils/useErrorResponse.tsx
19573
- import { useIntl as useIntl27 } from "react-intl";
19570
+ import { useIntl as useIntl28 } from "react-intl";
19574
19571
  var useErrorResponse = () => {
19575
- const { formatMessage } = useIntl27();
19572
+ const { formatMessage } = useIntl28();
19576
19573
  return async (response, fetchType, isInitialRequest) => {
19577
19574
  try {
19578
19575
  const errorResponse = await parseErrorResponse(response);
@@ -19616,7 +19613,7 @@ var DynamicFlowComponent = ({
19616
19613
  setSchemaModel
19617
19614
  } = useDynamicFlowState(initialStep);
19618
19615
  const [submitted, setSubmitted] = useState34(false);
19619
- const { locale } = useIntl28();
19616
+ const { locale } = useIntl29();
19620
19617
  const { isLoading, loader, setLoadingState } = useLoader(
19621
19618
  loaderConfig,
19622
19619
  initialStep ? "idle" : "initial"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.16.2",
3
+ "version": "3.16.3",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -47,12 +47,12 @@
47
47
  "@storybook/react-webpack5": "^8.1.10",
48
48
  "@storybook/test": "^8.1.10",
49
49
  "@storybook/types": "^8.1.10",
50
- "@testing-library/dom": "9.3.4",
50
+ "@testing-library/dom": "10.4.0",
51
51
  "@testing-library/jest-dom": "6.4.6",
52
- "@testing-library/react": "14.3.1",
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",
55
- "@transferwise/components": "46.51.0",
55
+ "@transferwise/components": "46.59.0",
56
56
  "@transferwise/formatting": "^2.13.0",
57
57
  "@transferwise/icons": "3.13.0",
58
58
  "@transferwise/neptune-css": "14.12.1",
@@ -65,7 +65,7 @@
65
65
  "@wise/components-theming": "^1.5.0",
66
66
  "babel-jest": "29.7.0",
67
67
  "enzyme": "^3.11.0",
68
- "esbuild": "0.20.2",
68
+ "esbuild": "0.23.0",
69
69
  "jest": "29.7.0",
70
70
  "jest-environment-jsdom": "29.7.0",
71
71
  "jest-fetch-mock": "^3.0.3",
@@ -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.18.2"
107
+ "@wise/dynamic-flow-types": "2.18.3"
108
108
  },
109
109
  "scripts": {
110
110
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",