@wise/dynamic-flow-client 3.23.0 → 3.23.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.16.1_@transferwise+neptune-css@14.19.0_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js
141
+ // ../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-c8ed1f53.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
- var init_index_a91e5689_esm = __esm({
146
- "../../node_modules/.pnpm/@wise+art@2.16.1_@transferwise+neptune-css@14.19.0_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-a91e5689.esm.js"() {
145
+ var init_index_c8ed1f53_esm = __esm({
146
+ "../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index-c8ed1f53.esm.js"() {
147
147
  "use strict";
148
148
  init_clsx();
149
149
  unknownFlagName = "wise";
@@ -159,16 +159,18 @@ var init_index_a91e5689_esm = __esm({
159
159
  }, [code]);
160
160
  const detailed = intrinsicSize >= 150;
161
161
  const name = fallback !== "unknown" ? `${code.toLowerCase()}${fallback == null && detailed ? "-detailed" : ""}` : unknownFlagName;
162
- return /* @__PURE__ */ jsx17("img", {
162
+ return /* @__PURE__ */ jsx17("span", {
163
163
  className: clsx(`wds-flag wds-flag-${name}`, className),
164
- src: `https://wise.com/web-art/assets/flags/${name}.svg`,
165
- loading,
166
- alt: "",
167
- width: intrinsicSize,
168
- height: intrinsicSize,
169
- onError: () => {
170
- setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
171
- }
164
+ children: /* @__PURE__ */ jsx17("img", {
165
+ src: `https://wise.com/web-art/assets/flags/${name}.svg`,
166
+ loading,
167
+ alt: "",
168
+ width: intrinsicSize,
169
+ height: intrinsicSize,
170
+ onError: () => {
171
+ setFallback((prev) => prev == null && detailed ? "simple" : "unknown");
172
+ }
173
+ })
172
174
  });
173
175
  };
174
176
  (function(Sizes2) {
@@ -11582,8 +11584,8 @@ var DateInputRenderer_default = DateInputRenderer;
11582
11584
  // ../renderers/src/DecisionRenderer.tsx
11583
11585
  import { NavigationOptionsList, NavigationOption, Header } from "@transferwise/components";
11584
11586
 
11585
- // ../../node_modules/.pnpm/@wise+art@2.16.1_@transferwise+neptune-css@14.19.0_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11586
- init_index_a91e5689_esm();
11587
+ // ../../node_modules/.pnpm/@wise+art@2.16.2_@transferwise+neptune-css@14.19.1_@types+react@18.3.11_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@wise/art/dist/index.esm.js
11588
+ init_index_c8ed1f53_esm();
11587
11589
  init_clsx();
11588
11590
  import "react";
11589
11591
  import "react/jsx-runtime";
@@ -13845,7 +13847,7 @@ function isReference(block) {
13845
13847
  }
13846
13848
 
13847
13849
  // src/legacy/dynamicFlow/DynamicFlow.tsx
13848
- import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo23, useState as useState34 } from "react";
13850
+ import { useCallback as useCallback11, useEffect as useEffect26, useMemo as useMemo24, useState as useState34 } from "react";
13849
13851
  import { useIntl as useIntl31 } from "react-intl";
13850
13852
 
13851
13853
  // src/legacy/common/contexts/dynamicFlowContexts/DynamicFlowContexts.tsx
@@ -14820,7 +14822,7 @@ var Size = {
14820
14822
 
14821
14823
  // src/legacy/jsonSchemaForm/basicTypeSchema/BasicTypeSchema.tsx
14822
14824
  var import_classnames15 = __toESM(require_classnames());
14823
- import { useEffect as useEffect17, useMemo as useMemo18, useState as useState26 } from "react";
14825
+ import { useEffect as useEffect17, useMemo as useMemo19, useState as useState26 } from "react";
14824
14826
 
14825
14827
  // src/legacy/layout/alert/DynamicAlert.tsx
14826
14828
  import { Alert as Alert4 } from "@transferwise/components";
@@ -15234,7 +15236,7 @@ var DynamicDivider_default = DynamicDivider;
15234
15236
 
15235
15237
  // src/legacy/layout/external/DynamicExternal.tsx
15236
15238
  import { Button as Button8, Loader as Loader2, Size as Size2 } from "@transferwise/components";
15237
- import { useCallback as useCallback6, useEffect as useEffect8 } from "react";
15239
+ import { useCallback as useCallback6, useEffect as useEffect8, useMemo as useMemo12 } from "react";
15238
15240
  import { useIntl as useIntl11 } from "react-intl";
15239
15241
 
15240
15242
  // src/legacy/layout/external/DynamicExternal.messages.ts
@@ -15259,9 +15261,11 @@ var DynamicExternal = ({ component, onAction }) => {
15259
15261
  useEffect8(() => {
15260
15262
  openExternalUrl();
15261
15263
  }, [openExternalUrl]);
15262
- const pollingConfiguration = polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
15263
- responseHandlers
15264
- }) : void 0;
15264
+ const pollingConfiguration = useMemo12(() => {
15265
+ return polling && responseHandlers ? __spreadProps(__spreadValues({}, polling), {
15266
+ responseHandlers
15267
+ }) : void 0;
15268
+ }, [polling, responseHandlers]);
15265
15269
  useExternalStepPolling(pollingConfiguration, onAction);
15266
15270
  return /* @__PURE__ */ jsxs25(Fragment11, { children: [
15267
15271
  /* @__PURE__ */ jsx76(Loader2, { size: Size2.LARGE, classNames: { "tw-loader": "tw-loader m-x-auto" } }),
@@ -15326,7 +15330,7 @@ import {
15326
15330
  Status,
15327
15331
  UploadInput as UploadInput3
15328
15332
  } from "@transferwise/components";
15329
- import { useMemo as useMemo12, useState as useState13 } from "react";
15333
+ import { useMemo as useMemo13, useState as useState13 } from "react";
15330
15334
 
15331
15335
  // src/legacy/jsonSchemaForm/controlFeedback/ControlFeedback.tsx
15332
15336
  import { InlineAlert as InlineAlert3 } from "@transferwise/components";
@@ -15472,7 +15476,7 @@ function MultipleFileUploadSchema(props) {
15472
15476
  const { onChange, errors = null, schema, required = false } = props;
15473
15477
  const onEvent = useEventDispatcher();
15474
15478
  const defaultErrorMessages = useFormattedDefaultErrorMessages(schema);
15475
- const uid = useMemo12(() => schema.$id || generateRandomId(), [schema.$id]);
15479
+ const uid = useMemo13(() => schema.$id || generateRandomId(), [schema.$id]);
15476
15480
  const [inputChanged, setInputChanged] = useState13(false);
15477
15481
  const [files, setFiles] = useState13(() => convertFileIdsToComponentFileObjects(props.model || []));
15478
15482
  const performPersistAsync = usePersistAsync(schema.items.persistAsync);
@@ -15565,7 +15569,7 @@ function getValidationMessages(schema, required, defaultErrorMessages) {
15565
15569
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/multiSelectSchema/MultiSelectSchema.tsx
15566
15570
  var import_classnames8 = __toESM(require_classnames());
15567
15571
  import { SelectInput as SelectInput3, SelectInputOptionContent as SelectInputOptionContent3 } from "@transferwise/components";
15568
- import { useEffect as useEffect9, useMemo as useMemo13, useState as useState14 } from "react";
15572
+ import { useEffect as useEffect9, useMemo as useMemo14, useState as useState14 } from "react";
15569
15573
  import { useIntl as useIntl14 } from "react-intl";
15570
15574
 
15571
15575
  // src/legacy/jsonSchemaForm/schemaFormControl/utils/mapping-utils.tsx
@@ -15682,7 +15686,7 @@ function MultiSelectSchema({
15682
15686
  const { formatMessage, locale } = useIntl14();
15683
15687
  const { disabled, items, validationMessages, placeholder } = schema;
15684
15688
  const options = items.oneOf.map((item) => mapConstSchemaToOption(item, "select"));
15685
- const id = useMemo13(() => schema.$id || generateRandomId(), [schema.$id]);
15689
+ const id = useMemo14(() => schema.$id || generateRandomId(), [schema.$id]);
15686
15690
  const [changed, setChanged] = useState14(false);
15687
15691
  const [selected, setSelected] = useState14(getInitialModelIndices2(model, options));
15688
15692
  useEffect9(
@@ -15782,7 +15786,7 @@ var getInitialModelIndices2 = (model, options) => {
15782
15786
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/RepeatableSchema.tsx
15783
15787
  import { Header as Header9, Modal as Modal3, NavigationOption as NavigationOption6 } from "@transferwise/components";
15784
15788
  import { Plus as Plus2 } from "@transferwise/icons";
15785
- import { useMemo as useMemo14, useState as useState16 } from "react";
15789
+ import { useMemo as useMemo15, useState as useState16 } from "react";
15786
15790
  import { useIntl as useIntl16 } from "react-intl";
15787
15791
 
15788
15792
  // src/legacy/jsonSchemaForm/arrayTypeSchema/arrayListSchema/repeatableSchema/ItemSummary.tsx
@@ -16104,7 +16108,7 @@ function RepeatableSchema({
16104
16108
  return model ? model.map((item) => getItemSummaryFromSchema(schema.items, item, schema == null ? void 0 : schema.summary)) : null;
16105
16109
  });
16106
16110
  const [editableItem, setEditableItem] = useState16({ item: null, model: null });
16107
- const id = useMemo14(() => schema.$id || generateRandomId(), [schema.$id]);
16111
+ const id = useMemo15(() => schema.$id || generateRandomId(), [schema.$id]);
16108
16112
  const broadcastModelChange = (updatedItems) => {
16109
16113
  const updatedModel = updatedItems ? updatedItems.map(({ value }) => value) : null;
16110
16114
  onChange({
@@ -16348,7 +16352,7 @@ var ObjectSchema_default = ObjectSchema;
16348
16352
  // src/legacy/jsonSchemaForm/oneOfSchema/OneOfSchema.tsx
16349
16353
  var import_classnames11 = __toESM(require_classnames());
16350
16354
  import { Header as Header11 } from "@transferwise/components";
16351
- import { useEffect as useEffect12, useMemo as useMemo15, useState as useState18 } from "react";
16355
+ import { useEffect as useEffect12, useMemo as useMemo16, useState as useState18 } from "react";
16352
16356
 
16353
16357
  // src/legacy/jsonSchemaForm/help/Help.tsx
16354
16358
  import { Markdown as Markdown6, Info as Info2 } from "@transferwise/components";
@@ -17167,7 +17171,7 @@ function OneOfSchema(props) {
17167
17171
  const [focused, setFocused] = useState18(false);
17168
17172
  const [blurred, setBlurred] = useState18(false);
17169
17173
  const { disabled = false, required = false } = props;
17170
- const id = useMemo15(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
17174
+ const id = useMemo16(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
17171
17175
  const [schemaIndex, setSchemaIndex] = useState18(
17172
17176
  getActiveSchemaIndex(props.schema, props.model)
17173
17177
  );
@@ -17342,7 +17346,7 @@ import { useIntl as useIntl19 } from "react-intl";
17342
17346
 
17343
17347
  // src/legacy/jsonSchemaForm/persistAsyncSchema/persistAsyncBlobSchema/UploadInputAdapter.tsx
17344
17348
  import { Status as Status2, UploadInput as UploadInput4 } from "@transferwise/components";
17345
- import { useMemo as useMemo16 } from "react";
17349
+ import { useMemo as useMemo17 } from "react";
17346
17350
  import { jsx as jsx92 } from "react/jsx-runtime";
17347
17351
  function UploadInputAdapter(props) {
17348
17352
  const {
@@ -17359,7 +17363,7 @@ function UploadInputAdapter(props) {
17359
17363
  onCancel
17360
17364
  } = props;
17361
17365
  const onEvent = useEventDispatcher();
17362
- const files = useMemo16(() => fileId ? [{ id: fileId, status: Status2.SUCCEEDED }] : [], [fileId]);
17366
+ const files = useMemo17(() => fileId ? [{ id: fileId, status: Status2.SUCCEEDED }] : [], [fileId]);
17363
17367
  const uploadFile = (formData) => {
17364
17368
  onEvent("Dynamic Flow - PersistAsync", { status: "pending", schemaId: id });
17365
17369
  return httpClient(String(httpOptions.url), {
@@ -18320,7 +18324,7 @@ function DynamicReview(props) {
18320
18324
  var DynamicReview_default = DynamicReview;
18321
18325
 
18322
18326
  // src/legacy/layout/search/DynamicSearch.tsx
18323
- import { useMemo as useMemo17, useState as useState24 } from "react";
18327
+ import { useMemo as useMemo18, useState as useState24 } from "react";
18324
18328
  import { Search as Search2 } from "@transferwise/icons";
18325
18329
 
18326
18330
  // src/legacy/layout/search/SearchInput.tsx
@@ -18475,7 +18479,7 @@ function DynamicSearch({ component, onAction }) {
18475
18479
  const { control, title, margin, url, method, param, emptyMessage } = component;
18476
18480
  const { status, results, search } = useSearch({ url, method, param });
18477
18481
  const onEvent = useEventDispatcher();
18478
- const debouncedSearch = useMemo17(() => debounce2(search, DEBOUNCE_TIME2), [search]);
18482
+ const debouncedSearch = useMemo18(() => debounce2(search, DEBOUNCE_TIME2), [search]);
18479
18483
  const onSearchStart = () => {
18480
18484
  onEvent("Dynamic Flow - Search Started", {});
18481
18485
  };
@@ -18658,7 +18662,7 @@ var BasicTypeSchema = (props) => {
18658
18662
  const [focused, setFocused] = useState26(false);
18659
18663
  const [blurred, setBlurred] = useState26(false);
18660
18664
  const [validations, setValidations] = useState26([]);
18661
- const id = useMemo18(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
18665
+ const id = useMemo19(() => props.schema.$id || generateRandomId(), [props.schema.$id]);
18662
18666
  const onSchemaChange = () => {
18663
18667
  const defaultValue = getDefaultValue(props.schema);
18664
18668
  if (isNullish3(model) && !isNullish3(defaultValue)) {
@@ -18920,7 +18924,7 @@ function hasStringMessage(value) {
18920
18924
  }
18921
18925
 
18922
18926
  // src/legacy/common/hooks/usePolling/usePolling.tsx
18923
- import { useEffect as useEffect19, useMemo as useMemo19, useRef as useRef5 } from "react";
18927
+ import { useEffect as useEffect19, useMemo as useMemo20, useRef as useRef5 } from "react";
18924
18928
  function usePolling({
18925
18929
  asyncFn,
18926
18930
  delay,
@@ -18931,7 +18935,7 @@ function usePolling({
18931
18935
  }) {
18932
18936
  const onPollingResponseReference = useRef5(onPollingResponse);
18933
18937
  const onFailureReference = useRef5(onFailure);
18934
- const poll = useMemo19(
18938
+ const poll = useMemo20(
18935
18939
  () => createPollingClosure(
18936
18940
  asyncFn,
18937
18941
  maxAttempts,
@@ -18991,11 +18995,11 @@ var usePrevious = (value) => {
18991
18995
  };
18992
18996
 
18993
18997
  // src/legacy/common/hooks/useStepPolling/useStepPolling.tsx
18994
- import { useCallback as useCallback8, useMemo as useMemo20 } from "react";
18998
+ import { useCallback as useCallback8, useMemo as useMemo21 } from "react";
18995
18999
  function useStepPolling(polling, onAction) {
18996
19000
  var _a, _b;
18997
19001
  const httpClient = useHttpClient();
18998
- const asyncFn = useMemo20(() => {
19002
+ const asyncFn = useMemo21(() => {
18999
19003
  if (polling) {
19000
19004
  return () => httpClient(polling.url).then((response) => {
19001
19005
  if (response.ok) {
@@ -19075,7 +19079,7 @@ var LayoutStep_default = LayoutStep;
19075
19079
  import { useEffect as useEffect25, useState as useState31 } from "react";
19076
19080
 
19077
19081
  // src/common/cameraCapture/CameraCapture.tsx
19078
- import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo21, useRef as useRef8, useState as useState30 } from "react";
19082
+ import { useCallback as useCallback10, useEffect as useEffect24, useMemo as useMemo22, useRef as useRef8, useState as useState30 } from "react";
19079
19083
  import { useIntl as useIntl28 } from "react-intl";
19080
19084
  import Webcam from "react-webcam";
19081
19085
 
@@ -19484,7 +19488,7 @@ function CameraCapture({
19484
19488
  const [reviewImage, setReviewImage] = useState30();
19485
19489
  const webcamReference = useRef8(null);
19486
19490
  const { videoConstraints } = useVideoConstraints(direction);
19487
- const shouldLockOrientation = useMemo21(
19491
+ const shouldLockOrientation = useMemo22(
19488
19492
  () => !!(isMobile() && mode === "CAPTURE" /* CAPTURE */),
19489
19493
  [mode]
19490
19494
  );
@@ -19899,7 +19903,7 @@ function useDebouncedRefresh(fetchRefresh) {
19899
19903
  var shouldDebounceSchema = (schema) => getSchemaType(schema) === "basic" && schema.type !== "boolean" && schema.format !== "base64url";
19900
19904
 
19901
19905
  // src/legacy/dynamicFlow/utils/useDynamicFlowState.ts
19902
- import { useMemo as useMemo22, useState as useState32 } from "react";
19906
+ import { useMemo as useMemo23, useState as useState32 } from "react";
19903
19907
  var useDynamicFlowState = (initialStep) => {
19904
19908
  var _a, _b;
19905
19909
  const [formErrors, setFormErrors] = useState32((_a = initialStep == null ? void 0 : initialStep.errors) == null ? void 0 : _a.validation);
@@ -19934,7 +19938,7 @@ var useDynamicFlowState = (initialStep) => {
19934
19938
  return updatedState;
19935
19939
  });
19936
19940
  };
19937
- const modelIsValid = useMemo22(
19941
+ const modelIsValid = useMemo23(
19938
19942
  () => areModelsValid(models, getAllValidatableSchemas(step)),
19939
19943
  [models, step]
19940
19944
  );
@@ -20184,14 +20188,14 @@ var DynamicFlowComponent = ({
20184
20188
  );
20185
20189
  }
20186
20190
  };
20187
- const analyticsMetadata = useMemo23(
20191
+ const analyticsMetadata = useMemo24(
20188
20192
  () => {
20189
20193
  var _a;
20190
20194
  return __spreadValues({ flowId, stepId: (step == null ? void 0 : step.id) || (step == null ? void 0 : step.key) }, (_a = step == null ? void 0 : step.analytics) != null ? _a : {});
20191
20195
  },
20192
20196
  [flowId, step]
20193
20197
  );
20194
- const dispatchEvent = useMemo23(
20198
+ const dispatchEvent = useMemo24(
20195
20199
  () => getEventDispatcher(onEvent, analyticsMetadata),
20196
20200
  [onEvent, analyticsMetadata]
20197
20201
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.23.0",
3
+ "version": "3.23.1",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -50,17 +50,17 @@
50
50
  "@testing-library/jest-dom": "6.6.2",
51
51
  "@testing-library/react": "16.0.1",
52
52
  "@testing-library/user-event": "14.5.2",
53
- "@transferwise/components": "46.71.3",
53
+ "@transferwise/components": "46.71.6",
54
54
  "@transferwise/formatting": "^2.13.0",
55
55
  "@transferwise/icons": "3.13.1",
56
- "@transferwise/neptune-css": "14.19.0",
56
+ "@transferwise/neptune-css": "14.19.1",
57
57
  "@types/node": "22.7.7",
58
58
  "@types/jest": "29.5.13",
59
59
  "@types/react": "18.3.11",
60
60
  "@types/react-dom": "18.3.1",
61
61
  "@types/react-intl": "3.0.0",
62
- "@wise/art": "2.16.1",
63
- "@wise/components-theming": "^1.6.0",
62
+ "@wise/art": "2.16.2",
63
+ "@wise/components-theming": "^1.6.1",
64
64
  "babel-jest": "29.7.0",
65
65
  "esbuild": "0.24.0",
66
66
  "jest": "29.7.0",
@@ -83,8 +83,8 @@
83
83
  "tsx": "4.19.1",
84
84
  "typescript": "5.6.3",
85
85
  "webpack": "5.95.0",
86
- "@wise/dynamic-flow-fixtures": "0.0.1",
87
- "@wise/dynamic-flow-renderers": "0.0.0"
86
+ "@wise/dynamic-flow-renderers": "0.0.0",
87
+ "@wise/dynamic-flow-fixtures": "0.0.1"
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@transferwise/components": "^46.31",