@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.js CHANGED
@@ -127,21 +127,15 @@ var require_classnames = __commonJS({
127
127
  // ../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
128
128
  function r(e) {
129
129
  var t, f, n = "";
130
- if ("string" == typeof e || "number" == typeof e)
131
- n += e;
132
- else if ("object" == typeof e)
133
- if (Array.isArray(e)) {
134
- var o = e.length;
135
- for (t = 0; t < o; t++)
136
- e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
137
- } else
138
- for (f in e)
139
- e[f] && (n && (n += " "), n += f);
130
+ if ("string" == typeof e || "number" == typeof e) n += e;
131
+ else if ("object" == typeof e) if (Array.isArray(e)) {
132
+ var o = e.length;
133
+ for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
134
+ } else for (f in e) e[f] && (n && (n += " "), n += f);
140
135
  return n;
141
136
  }
142
137
  function clsx() {
143
- for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
144
- (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
138
+ for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
145
139
  return n;
146
140
  }
147
141
  var init_clsx = __esm({
@@ -2494,19 +2488,14 @@ var isDirty = (x) => x.status === "dirty";
2494
2488
  var isValid = (x) => x.status === "valid";
2495
2489
  var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
2496
2490
  function __classPrivateFieldGet(receiver, state, kind, f) {
2497
- if (kind === "a" && !f)
2498
- throw new TypeError("Private accessor was defined without a getter");
2499
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2500
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
2491
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2492
+ 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");
2501
2493
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2502
2494
  }
2503
2495
  function __classPrivateFieldSet(receiver, state, value, kind, f) {
2504
- if (kind === "m")
2505
- throw new TypeError("Private method is not writable");
2506
- if (kind === "a" && !f)
2507
- throw new TypeError("Private accessor was defined without a setter");
2508
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
2509
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
2496
+ if (kind === "m") throw new TypeError("Private method is not writable");
2497
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
2498
+ 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");
2510
2499
  return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
2511
2500
  }
2512
2501
  var errorUtil;
@@ -4182,8 +4171,7 @@ var ZodObject = class _ZodObject extends ZodType {
4182
4171
  });
4183
4172
  status.dirty();
4184
4173
  }
4185
- } else if (unknownKeys === "strip")
4186
- ;
4174
+ } else if (unknownKeys === "strip") ;
4187
4175
  else {
4188
4176
  throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
4189
4177
  }
@@ -13362,7 +13350,7 @@ function isReference(block) {
13362
13350
 
13363
13351
  // src/legacy/dynamicFlow/DynamicFlow.tsx
13364
13352
  var import_react67 = require("react");
13365
- var import_react_intl48 = require("react-intl");
13353
+ var import_react_intl49 = require("react-intl");
13366
13354
 
13367
13355
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
13368
13356
  var import_react25 = require("react");
@@ -14283,11 +14271,11 @@ function useExternalStepPolling(polling, onAction) {
14283
14271
 
14284
14272
  // src/legacy/common/hooks/usePersistAsync/usePersistAsync.ts
14285
14273
  var import_react55 = require("react");
14286
- var import_react_intl39 = require("react-intl");
14274
+ var import_react_intl40 = require("react-intl");
14287
14275
 
14288
14276
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBasicSchema/PersistAsyncBasicSchema.tsx
14289
14277
  var import_react54 = require("react");
14290
- var import_react_intl38 = require("react-intl");
14278
+ var import_react_intl39 = require("react-intl");
14291
14279
 
14292
14280
  // src/legacy/common/constants/DateMode.ts
14293
14281
  var DateMode = {
@@ -16164,6 +16152,12 @@ var _FormControl = class _FormControl extends import_react39.PureComponent {
16164
16152
  radios: options.map(this.mapOption),
16165
16153
  name,
16166
16154
  selectedValue: getSafeStringOrNumberValue(value, { coerceValue: true }),
16155
+ UNSAFE_inputAttributes: {
16156
+ id,
16157
+ "aria-invalid": invalid,
16158
+ "aria-labelledby": void 0,
16159
+ "aria-describedby": describedBy
16160
+ },
16167
16161
  onChange: this.handleOnChange
16168
16162
  }
16169
16163
  );
@@ -17921,10 +17915,12 @@ var addQueryParameter2 = (url, key, value) => {
17921
17915
  // src/legacy/layout/search/DynamicSearch.tsx
17922
17916
  var import_components71 = require("@transferwise/components");
17923
17917
  var import_classnames14 = __toESM(require_classnames());
17918
+ var import_react_intl38 = require("react-intl");
17924
17919
  var import_jsx_runtime115 = require("react/jsx-runtime");
17925
17920
  var DEBOUNCE_TIME2 = 400;
17926
17921
  function DynamicSearch({ component, onAction }) {
17927
17922
  const [query, setQuery] = (0, import_react51.useState)("");
17923
+ const intl = (0, import_react_intl38.useIntl)();
17928
17924
  const { control, title, margin, url, method, param, emptyMessage } = component;
17929
17925
  const { status, results, search } = useSearch({ url, method, param });
17930
17926
  const onEvent = useEventDispatcher();
@@ -17963,6 +17959,7 @@ function DynamicSearch({ component, onAction }) {
17963
17959
  import_components71.Typeahead,
17964
17960
  {
17965
17961
  id: "typeahead-input-id",
17962
+ intl,
17966
17963
  name: "typeahead-input-name",
17967
17964
  size: "md",
17968
17965
  maxHeight: 100,
@@ -18200,7 +18197,7 @@ var controlTypesWithPersistOnChange = /* @__PURE__ */ new Set([
18200
18197
  ]);
18201
18198
  function PersistAsyncBasicSchema(props) {
18202
18199
  const { schema, required, submitted, errors, onChange, onPersistAsync } = props;
18203
- const intl = (0, import_react_intl38.useIntl)();
18200
+ const intl = (0, import_react_intl39.useIntl)();
18204
18201
  const httpClient = useHttpClient();
18205
18202
  const onEvent = useEventDispatcher();
18206
18203
  const [persistAsyncModel, setPersistAsyncModel] = (0, import_react54.useState)(null);
@@ -18298,7 +18295,7 @@ var PersistAsyncBasicSchema_default = PersistAsyncBasicSchema;
18298
18295
  var usePersistAsync = (persistAsync) => {
18299
18296
  const [abortController, setAbortController] = (0, import_react55.useState)(null);
18300
18297
  const httpClient = useHttpClient();
18301
- const intl = (0, import_react_intl39.useIntl)();
18298
+ const intl = (0, import_react_intl40.useIntl)();
18302
18299
  const { schema } = persistAsync;
18303
18300
  async function handlePersistAsync(model) {
18304
18301
  const isInvalidSchema = model instanceof Blob ? !isBlobSchema2(schema) : !isValidSchema(model, schema);
@@ -18529,12 +18526,12 @@ var import_react63 = require("react");
18529
18526
 
18530
18527
  // src/common/cameraCapture/CameraCapture.tsx
18531
18528
  var import_react62 = require("react");
18532
- var import_react_intl44 = require("react-intl");
18529
+ var import_react_intl45 = require("react-intl");
18533
18530
  var import_react_webcam = __toESM(require("react-webcam"));
18534
18531
 
18535
18532
  // src/common/cameraCapture/CameraCapture.messages.ts
18536
- var import_react_intl40 = require("react-intl");
18537
- var CameraCapture_messages_default = (0, import_react_intl40.defineMessages)({
18533
+ var import_react_intl41 = require("react-intl");
18534
+ var CameraCapture_messages_default = (0, import_react_intl41.defineMessages)({
18538
18535
  reviewSubmit: {
18539
18536
  id: "dynamicFlows.CameraCapture.reviewSubmit",
18540
18537
  defaultMessage: "Yes, submit",
@@ -18594,14 +18591,14 @@ var CameraCapture_messages_default = (0, import_react_intl40.defineMessages)({
18594
18591
 
18595
18592
  // src/common/cameraCapture/components/bottomBar/BottomBar.tsx
18596
18593
  var import_components73 = require("@transferwise/components");
18597
- var import_react_intl41 = require("react-intl");
18594
+ var import_react_intl42 = require("react-intl");
18598
18595
  var import_jsx_runtime120 = require("react/jsx-runtime");
18599
18596
  var CaptureBottomBar = ({ onCapture }) => /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(CaptureButton, { onClick: onCapture }) });
18600
18597
  var ReviewBottomBar = ({
18601
18598
  onSubmit,
18602
18599
  onRetry
18603
18600
  }) => {
18604
- const intl = (0, import_react_intl41.useIntl)();
18601
+ const intl = (0, import_react_intl42.useIntl)();
18605
18602
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "bottom-bar p-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsx)("div", { className: "row", children: /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)("div", { className: "col-xs-12 col-md-6 col-md-offset-3", children: [
18606
18603
  /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(
18607
18604
  import_components73.Button,
@@ -18640,11 +18637,11 @@ var CaptureButton = ({ onClick }) => /* @__PURE__ */ (0, import_jsx_runtime120.j
18640
18637
  );
18641
18638
 
18642
18639
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18643
- var import_react_intl43 = require("react-intl");
18640
+ var import_react_intl44 = require("react-intl");
18644
18641
 
18645
18642
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.messages.ts
18646
- var import_react_intl42 = require("react-intl");
18647
- var OrientationLockOverlay_messages_default = (0, import_react_intl42.defineMessages)({
18643
+ var import_react_intl43 = require("react-intl");
18644
+ var OrientationLockOverlay_messages_default = (0, import_react_intl43.defineMessages)({
18648
18645
  text: {
18649
18646
  id: "dynamicFlows.CameraCapture.rotatePhone.text",
18650
18647
  defaultMessage: "Rotate your phone to portrait view to take a photo",
@@ -18655,7 +18652,7 @@ var OrientationLockOverlay_messages_default = (0, import_react_intl42.defineMess
18655
18652
  // src/common/cameraCapture/components/orientationLockOverlay/OrientationLockOverlay.tsx
18656
18653
  var import_jsx_runtime121 = require("react/jsx-runtime");
18657
18654
  function OrientationLockOverlay() {
18658
- const intl = (0, import_react_intl43.useIntl)();
18655
+ const intl = (0, import_react_intl44.useIntl)();
18659
18656
  return /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { className: "orientation-lock-overlay", children: [
18660
18657
  /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
18661
18658
  "img",
@@ -18945,7 +18942,7 @@ function CameraCapture({
18945
18942
  shouldLockOrientation,
18946
18943
  onEvent
18947
18944
  );
18948
- const intl = (0, import_react_intl44.useIntl)();
18945
+ const intl = (0, import_react_intl45.useIntl)();
18949
18946
  const handleCapture = (0, import_react62.useCallback)(async () => {
18950
18947
  var _a, _b, _c, _d, _e, _f;
18951
18948
  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) {
@@ -19168,11 +19165,11 @@ function getFirstAction(step) {
19168
19165
  }
19169
19166
 
19170
19167
  // src/legacy/step/externalConfirmationStep/ExternalConfirmationStep.tsx
19171
- var import_react_intl46 = require("react-intl");
19168
+ var import_react_intl47 = require("react-intl");
19172
19169
 
19173
19170
  // src/common/messages/external-confirmation.messages.ts
19174
- var import_react_intl45 = require("react-intl");
19175
- var external_confirmation_messages_default2 = (0, import_react_intl45.defineMessages)({
19171
+ var import_react_intl46 = require("react-intl");
19172
+ var external_confirmation_messages_default2 = (0, import_react_intl46.defineMessages)({
19176
19173
  title: {
19177
19174
  id: "dynamicFlows.ExternalConfirmation.title",
19178
19175
  defaultMessage: "Please confirm",
@@ -19200,7 +19197,7 @@ var import_jsx_runtime126 = require("react/jsx-runtime");
19200
19197
  var noop6 = () => {
19201
19198
  };
19202
19199
  function ExternalConfirmationStep({ url, onClose }) {
19203
- const { formatMessage } = (0, import_react_intl46.useIntl)();
19200
+ const { formatMessage } = (0, import_react_intl47.useIntl)();
19204
19201
  return /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
19205
19202
  DynamicLayout_default,
19206
19203
  {
@@ -19573,9 +19570,9 @@ var assertResponseIsValid2 = (response) => {
19573
19570
  var isResponse2 = (response) => typeof response === "object" && response !== null && "clone" in response && "bodyUsed" in response;
19574
19571
 
19575
19572
  // src/legacy/dynamicFlow/utils/useErrorResponse.tsx
19576
- var import_react_intl47 = require("react-intl");
19573
+ var import_react_intl48 = require("react-intl");
19577
19574
  var useErrorResponse = () => {
19578
- const { formatMessage } = (0, import_react_intl47.useIntl)();
19575
+ const { formatMessage } = (0, import_react_intl48.useIntl)();
19579
19576
  return async (response, fetchType, isInitialRequest) => {
19580
19577
  try {
19581
19578
  const errorResponse = await parseErrorResponse(response);
@@ -19619,7 +19616,7 @@ var DynamicFlowComponent = ({
19619
19616
  setSchemaModel
19620
19617
  } = useDynamicFlowState(initialStep);
19621
19618
  const [submitted, setSubmitted] = (0, import_react67.useState)(false);
19622
- const { locale } = (0, import_react_intl48.useIntl)();
19619
+ const { locale } = (0, import_react_intl49.useIntl)();
19623
19620
  const { isLoading, loader, setLoadingState } = useLoader(
19624
19621
  loaderConfig,
19625
19622
  initialStep ? "idle" : "initial"