@wise/dynamic-flow-client-internal 3.12.0-experimental-kyc-camera-fae600d → 3.12.0-experimental-kyc-camera-ebd94d5

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.
@@ -45,22 +45,29 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
49
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
50
+ if (ar || !(i in from)) {
51
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
52
+ ar[i] = from[i];
53
+ }
54
+ }
55
+ return to.concat(ar || Array.prototype.slice.call(from));
56
+ };
48
57
  import { jsx as _jsx } from "react/jsx-runtime";
49
58
  import { forwardRef, useCallback } from 'react';
50
59
  import { useIntl } from 'react-intl';
51
60
  import { DynamicFlow as DynamicFlowCoreLegacy, DynamicFlowRevamp as DynamicFlowCoreRevamp, DynamicFragmentWise, } from '@wise/dynamic-flow-client';
52
- import { mergeRequestInit } from './utils/mergeRequestInit';
53
61
  export function DynamicFlowLegacy(props) {
54
62
  var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
55
- var httpClient = useWiseHttpClient(customFetch);
56
- var coreProps = __assign(__assign({}, props), { httpClient: httpClient });
57
- return _jsx(DynamicFlowCoreLegacy, __assign({}, coreProps));
63
+ var coreProps = __assign(__assign({}, props), { httpClient: customFetch });
64
+ return (_jsx("div", { id: "df-legacy", children: _jsx(DynamicFlowCoreLegacy, __assign({}, coreProps)) }));
58
65
  }
59
66
  export function DynamicFlowRevamp(props) {
60
67
  var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
61
68
  var httpClient = useWiseHttpClient(customFetch);
62
69
  var coreProps = __assign(__assign({}, props), { httpClient: httpClient });
63
- return _jsx(DynamicFlowCoreRevamp, __assign({}, coreProps));
70
+ return (_jsx("div", { id: "df-revamp", children: _jsx(DynamicFlowCoreRevamp, __assign({}, coreProps)) }));
64
71
  }
65
72
  /**
66
73
  * DynamicFragment is like DynamicFlowRevamp, but it also accepts a ForwardedRef.
@@ -75,12 +82,19 @@ export var DynamicFragment = forwardRef(function DynamicFragment(props, ref) {
75
82
  });
76
83
  var useWiseHttpClient = function (httpClient) {
77
84
  var locale = useIntl().locale;
78
- return useCallback(function (input, init) { return __awaiter(void 0, void 0, void 0, function () {
79
- return __generator(this, function (_a) {
80
- return [2 /*return*/, httpClient(input, mergeRequestInit(init, {
81
- credentials: 'include',
82
- headers: { 'accept-language': locale },
83
- }))];
85
+ return useCallback(function (input_1) {
86
+ var args_1 = [];
87
+ for (var _i = 1; _i < arguments.length; _i++) {
88
+ args_1[_i - 1] = arguments[_i];
89
+ }
90
+ return __awaiter(void 0, __spreadArray([input_1], args_1, true), void 0, function (input, init) {
91
+ var headers;
92
+ if (init === void 0) { init = {}; }
93
+ return __generator(this, function (_a) {
94
+ headers = new Headers(init.headers);
95
+ headers.set('accept-language', locale);
96
+ return [2 /*return*/, httpClient(input, __assign(__assign({}, init), { credentials: 'include', headers: headers }))];
97
+ });
84
98
  });
85
- }); }, [httpClient, locale]);
99
+ }, [httpClient, locale]);
86
100
  };
@@ -56,13 +56,12 @@ describe.each([
56
56
  ])('Wise-Specific Headers', function (_a) {
57
57
  var name = _a.name, DFComponent = _a.DFComponent;
58
58
  it("".concat(name, " - makes an initial request with additional RequestInit parameters, as specified in the wise-specific fetcher"), function () { return __awaiter(void 0, void 0, void 0, function () {
59
- var props, customFetch, requestInit, credentials;
59
+ var props, customFetch, requestInit, credentials, headers;
60
60
  return __generator(this, function (_a) {
61
61
  switch (_a.label) {
62
62
  case 0:
63
63
  props = {
64
64
  flowId: 'test',
65
- customFetch: jest.fn(),
66
65
  initialAction: { url: '/initial' },
67
66
  onCompletion: jest.fn(),
68
67
  onError: jest.fn(),
@@ -77,12 +76,41 @@ describe.each([
77
76
  requestInit = customFetch.mock.calls[0][1];
78
77
  credentials = requestInit === null || requestInit === void 0 ? void 0 : requestInit.credentials;
79
78
  expect(credentials).toBe('include');
80
- expect(requestInit === null || requestInit === void 0 ? void 0 : requestInit.headers).toEqual({
81
- 'content-type': 'application/json',
82
- 'accept-language': 'en-GB',
83
- });
79
+ headers = Array.from(new Headers(requestInit === null || requestInit === void 0 ? void 0 : requestInit.headers).entries());
80
+ expect(headers).toContainEqual(['accept-language', 'en-GB']);
81
+ expect(headers).toContainEqual(['content-type', 'application/json']);
84
82
  return [2 /*return*/];
85
83
  }
86
84
  });
87
85
  }); });
88
86
  });
87
+ describe('DynamicFlowLegacy', function () {
88
+ describe('when initialised with customFetch', function () {
89
+ it('uses the "correct" casing of Content-Type header', function () { return __awaiter(void 0, void 0, void 0, function () {
90
+ var props, customFetch, requestInit;
91
+ return __generator(this, function (_a) {
92
+ switch (_a.label) {
93
+ case 0:
94
+ props = {
95
+ flowId: 'test',
96
+ initialAction: { url: '/initial' },
97
+ onCompletion: jest.fn(),
98
+ onError: jest.fn(),
99
+ };
100
+ customFetch = jest.fn();
101
+ renderWithProviders(_jsx(DynamicFlowLegacy, __assign({}, props, { customFetch: customFetch })));
102
+ return [4 /*yield*/, waitFor(function () {
103
+ expect(customFetch).toHaveBeenCalledWith('/initial', expect.anything());
104
+ })];
105
+ case 1:
106
+ _a.sent();
107
+ requestInit = customFetch.mock.calls[0][1];
108
+ expect(requestInit === null || requestInit === void 0 ? void 0 : requestInit.headers).toMatchObject({
109
+ 'Content-Type': 'application/json',
110
+ });
111
+ return [2 /*return*/];
112
+ }
113
+ });
114
+ }); });
115
+ });
116
+ });
package/build/main.js CHANGED
@@ -54,29 +54,17 @@ var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
54
54
  var import_react = require("react");
55
55
  var import_react_intl = require("react-intl");
56
56
  var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
57
-
58
- // src/dynamicFlow/utils/mergeRequestInit.ts
59
- var mergeRequestInit = (init, additionalInit) => __spreadProps(__spreadValues(__spreadValues({}, init), additionalInit), {
60
- headers: mergeHeaders(init == null ? void 0 : init.headers, additionalInit == null ? void 0 : additionalInit.headers)
61
- });
62
- var mergeHeaders = (...headersInits) => headersInits.reduce(
63
- (acc, headers) => __spreadValues(__spreadValues({}, acc), Object.fromEntries(new Headers(headers).entries())),
64
- {}
65
- );
66
-
67
- // src/dynamicFlow/DynamicFlow.tsx
68
57
  var import_jsx_runtime = require("react/jsx-runtime");
69
58
  function DynamicFlowLegacy(props) {
70
59
  const { customFetch = globalThis.fetch } = props;
71
- const httpClient = useWiseHttpClient(customFetch);
72
- const coreProps = __spreadProps(__spreadValues({}, props), { httpClient });
73
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlow, __spreadValues({}, coreProps));
60
+ const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
61
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "df-legacy", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlow, __spreadValues({}, coreProps)) });
74
62
  }
75
63
  function DynamicFlowRevamp(props) {
76
64
  const { customFetch = globalThis.fetch } = props;
77
65
  const httpClient = useWiseHttpClient(customFetch);
78
66
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient });
79
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlowRevamp, __spreadValues({}, coreProps));
67
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { id: "df-revamp", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlowRevamp, __spreadValues({}, coreProps)) });
80
68
  }
81
69
  var DynamicFragment = (0, import_react.forwardRef)(function DynamicFragment2(props, ref) {
82
70
  const { customFetch = globalThis.fetch } = props;
@@ -87,13 +75,11 @@ var DynamicFragment = (0, import_react.forwardRef)(function DynamicFragment2(pro
87
75
  var useWiseHttpClient = (httpClient) => {
88
76
  const { locale } = (0, import_react_intl.useIntl)();
89
77
  return (0, import_react.useCallback)(
90
- async (input, init) => httpClient(
91
- input,
92
- mergeRequestInit(init, {
93
- credentials: "include",
94
- headers: { "accept-language": locale }
95
- })
96
- ),
78
+ async (input, init = {}) => {
79
+ const headers = new Headers(init.headers);
80
+ headers.set("accept-language", locale);
81
+ return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers }));
82
+ },
97
83
  [httpClient, locale]
98
84
  );
99
85
  };
package/build/main.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var s=Object.defineProperty,d=Object.defineProperties,v=Object.getOwnPropertyDescriptor,I=Object.getOwnPropertyDescriptors,W=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols;var h=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable;var D=(t,e,o)=>e in t?s(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o,n=(t,e)=>{for(var o in e||(e={}))h.call(e,o)&&D(t,o,e[o]);if(w)for(var o of w(e))x.call(e,o)&&D(t,o,e[o]);return t},r=(t,e)=>d(t,I(e));var L=(t,e)=>{for(var o in e)s(t,o,{get:e[o],enumerable:!0})},b=(t,e,o,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of W(e))!h.call(t,c)&&c!==o&&s(t,c,{get:()=>e[c],enumerable:!(a=v(e,c))||a.enumerable});return t};var S=t=>b(s({},"__esModule",{value:!0}),t);var H={};L(H,{DynamicFlow:()=>y,DynamicFlowLegacy:()=>y,DynamicFlowRevamp:()=>P,DynamicFragment:()=>u,JsonSchemaForm:()=>m.JsonSchemaForm,isValidSchema:()=>m.isValidSchema,makeCustomFetch:()=>A,translations:()=>m.translations});module.exports=S(H);var R=require("@wise/dynamic-flow-client"),m=require("@wise/dynamic-flow-client");var l=require("react"),f=require("react-intl"),i=require("@wise/dynamic-flow-client");var g=(t,e)=>r(n(n({},t),e),{headers:q(t==null?void 0:t.headers,e==null?void 0:e.headers)}),q=(...t)=>t.reduce((e,o)=>n(n({},e),Object.fromEntries(new Headers(o).entries())),{});var p=require("react/jsx-runtime");function y(t){let{customFetch:e=globalThis.fetch}=t,o=F(e),a=r(n({},t),{httpClient:o});return(0,p.jsx)(i.DynamicFlow,n({},a))}function P(t){let{customFetch:e=globalThis.fetch}=t,o=F(e),a=r(n({},t),{httpClient:o});return(0,p.jsx)(i.DynamicFlowRevamp,n({},a))}var u=(0,l.forwardRef)(function(e,o){let{customFetch:a=globalThis.fetch}=e,c=F(a),C=r(n({},e),{httpClient:c});return(0,p.jsx)(i.DynamicFragmentWise,r(n({},C),{ref:o}))}),F=t=>{let{locale:e}=(0,f.useIntl)();return(0,l.useCallback)(async(o,a)=>t(o,g(a,{credentials:"include",headers:{"accept-language":e}})),[t,e])};var A=R.makeHttpClient;
1
+ "use strict";var p=Object.defineProperty,C=Object.defineProperties,u=Object.getOwnPropertyDescriptor,R=Object.getOwnPropertyDescriptors,I=Object.getOwnPropertyNames,F=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var w=(t,o,e)=>o in t?p(t,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[o]=e,n=(t,o)=>{for(var e in o||(o={}))D.call(o,e)&&w(t,e,o[e]);if(F)for(var e of F(o))W.call(o,e)&&w(t,e,o[e]);return t},c=(t,o)=>C(t,R(o));var L=(t,o)=>{for(var e in o)p(t,e,{get:o[e],enumerable:!0})},x=(t,o,e,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of I(o))!D.call(t,a)&&a!==e&&p(t,a,{get:()=>o[a],enumerable:!(i=u(o,a))||i.enumerable});return t};var b=t=>x(p({},"__esModule",{value:!0}),t);var A={};L(A,{DynamicFlow:()=>s,DynamicFlowLegacy:()=>s,DynamicFlowRevamp:()=>f,DynamicFragment:()=>g,JsonSchemaForm:()=>l.JsonSchemaForm,isValidSchema:()=>l.isValidSchema,makeCustomFetch:()=>S,translations:()=>l.translations});module.exports=b(A);var d=require("@wise/dynamic-flow-client"),l=require("@wise/dynamic-flow-client");var y=require("react"),h=require("react-intl"),r=require("@wise/dynamic-flow-client");var m=require("react/jsx-runtime");function s(t){let{customFetch:o=globalThis.fetch}=t,e=c(n({},t),{httpClient:o});return(0,m.jsx)("div",{id:"df-legacy",children:(0,m.jsx)(r.DynamicFlow,n({},e))})}function f(t){let{customFetch:o=globalThis.fetch}=t,e=P(o),i=c(n({},t),{httpClient:e});return(0,m.jsx)("div",{id:"df-revamp",children:(0,m.jsx)(r.DynamicFlowRevamp,n({},i))})}var g=(0,y.forwardRef)(function(o,e){let{customFetch:i=globalThis.fetch}=o,a=P(i),v=c(n({},o),{httpClient:a});return(0,m.jsx)(r.DynamicFragmentWise,c(n({},v),{ref:e}))}),P=t=>{let{locale:o}=(0,h.useIntl)();return(0,y.useCallback)(async(e,i={})=>{let a=new Headers(i.headers);return a.set("accept-language",o),t(e,c(n({},i),{credentials:"include",headers:a}))},[t,o])};var S=d.makeHttpClient;
package/build/main.mjs CHANGED
@@ -30,29 +30,17 @@ import {
30
30
  DynamicFlowRevamp as DynamicFlowCoreRevamp,
31
31
  DynamicFragmentWise
32
32
  } from "@wise/dynamic-flow-client";
33
-
34
- // src/dynamicFlow/utils/mergeRequestInit.ts
35
- var mergeRequestInit = (init, additionalInit) => __spreadProps(__spreadValues(__spreadValues({}, init), additionalInit), {
36
- headers: mergeHeaders(init == null ? void 0 : init.headers, additionalInit == null ? void 0 : additionalInit.headers)
37
- });
38
- var mergeHeaders = (...headersInits) => headersInits.reduce(
39
- (acc, headers) => __spreadValues(__spreadValues({}, acc), Object.fromEntries(new Headers(headers).entries())),
40
- {}
41
- );
42
-
43
- // src/dynamicFlow/DynamicFlow.tsx
44
33
  import { jsx } from "react/jsx-runtime";
45
34
  function DynamicFlowLegacy(props) {
46
35
  const { customFetch = globalThis.fetch } = props;
47
- const httpClient = useWiseHttpClient(customFetch);
48
- const coreProps = __spreadProps(__spreadValues({}, props), { httpClient });
49
- return /* @__PURE__ */ jsx(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
36
+ const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
37
+ return /* @__PURE__ */ jsx("div", { id: "df-legacy", children: /* @__PURE__ */ jsx(DynamicFlowCoreLegacy, __spreadValues({}, coreProps)) });
50
38
  }
51
39
  function DynamicFlowRevamp(props) {
52
40
  const { customFetch = globalThis.fetch } = props;
53
41
  const httpClient = useWiseHttpClient(customFetch);
54
42
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient });
55
- return /* @__PURE__ */ jsx(DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
43
+ return /* @__PURE__ */ jsx("div", { id: "df-revamp", children: /* @__PURE__ */ jsx(DynamicFlowCoreRevamp, __spreadValues({}, coreProps)) });
56
44
  }
57
45
  var DynamicFragment = forwardRef(function DynamicFragment2(props, ref) {
58
46
  const { customFetch = globalThis.fetch } = props;
@@ -63,13 +51,11 @@ var DynamicFragment = forwardRef(function DynamicFragment2(props, ref) {
63
51
  var useWiseHttpClient = (httpClient) => {
64
52
  const { locale } = useIntl();
65
53
  return useCallback(
66
- async (input, init) => httpClient(
67
- input,
68
- mergeRequestInit(init, {
69
- credentials: "include",
70
- headers: { "accept-language": locale }
71
- })
72
- ),
54
+ async (input, init = {}) => {
55
+ const headers = new Headers(init.headers);
56
+ headers.set("accept-language", locale);
57
+ return httpClient(input, __spreadProps(__spreadValues({}, init), { credentials: "include", headers }));
58
+ },
73
59
  [httpClient, locale]
74
60
  );
75
61
  };
@@ -7,8 +7,8 @@ export type DynamicFlowLegacyProps = (Omit<DynamicFlowPropsWithInitialAction, 'h
7
7
  export type DynamicFlowRevampProps = (Omit<DynamicFlowRevampPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowRevampPropsWithInitialStep, 'httpClient'>) & {
8
8
  customFetch?: DynamicFlowCoreRevampProps['httpClient'];
9
9
  };
10
- export declare function DynamicFlowLegacy(props: DynamicFlowLegacyProps): JSX.Element;
11
- export declare function DynamicFlowRevamp(props: DynamicFlowRevampProps): JSX.Element;
10
+ export declare function DynamicFlowLegacy(props: DynamicFlowLegacyProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function DynamicFlowRevamp(props: DynamicFlowRevampProps): import("react/jsx-runtime").JSX.Element;
12
12
  /**
13
13
  * DynamicFragment is like DynamicFlowRevamp, but it also accepts a ForwardedRef.
14
14
  * This ref conforms to the DynamicFragmentController type, containing two functions: `getValue` and `validate`.
@@ -1,4 +1,4 @@
1
- export type { DynamicFlowProps, Step, InitialAction, DynamicFragmentController, } from '@wise/dynamic-flow-client';
1
+ export type { DynamicFlowProps, Step, InitialAction, InitialActionRevamp, DynamicFragmentController, } from '@wise/dynamic-flow-client';
2
2
  export { translations, JsonSchemaForm, isValidSchema } from '@wise/dynamic-flow-client';
3
3
  export type { DynamicFlowLegacyProps as WiseDynamicFlowProps, DynamicFlowLegacyProps, DynamicFlowRevampProps, } from './dynamicFlow/DynamicFlow';
4
4
  export { DynamicFlowLegacy as DynamicFlow, DynamicFlowLegacy, DynamicFlowRevamp, DynamicFragment, } from './dynamicFlow/DynamicFlow';
@@ -1,9 +1,8 @@
1
- /// <reference types="react" />
2
1
  import type { StoryObj, Meta } from '@storybook/react';
3
2
  declare function DynamicFlowRenderer({ initialStepName, revampEnabled, }: {
4
3
  initialStepName?: string;
5
4
  revampEnabled?: boolean;
6
- }): JSX.Element;
5
+ }): import("react/jsx-runtime").JSX.Element;
7
6
  declare const meta: Meta<typeof DynamicFlowRenderer>;
8
7
  export declare const AllFixtures: StoryObj<typeof DynamicFlowRenderer>;
9
8
  export default meta;
@@ -1,6 +1,5 @@
1
- /// <reference types="react" />
2
1
  import type { Meta, StoryObj } from '@storybook/react';
3
- declare function DynamicFragmentStory(): JSX.Element;
2
+ declare function DynamicFragmentStory(): import("react/jsx-runtime").JSX.Element;
4
3
  declare const meta: Meta<typeof DynamicFragmentStory>;
5
4
  export declare const AllFixtures: StoryObj<typeof DynamicFragmentStory>;
6
5
  export default meta;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  export declare function Editable({ initialStepName }: {
3
2
  initialStepName?: string;
4
- }): JSX.Element;
3
+ }): import("react/jsx-runtime").JSX.Element;
5
4
  declare const _default: {
6
5
  component: typeof Editable;
7
6
  title: string;
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type { Step } from '@wise/dynamic-flow-client';
3
2
  declare function DynamicFlowSideBySide({ key, initialStep }: {
4
3
  key: string;
5
4
  initialStep: Step;
6
- }): JSX.Element;
5
+ }): import("react/jsx-runtime").JSX.Element;
7
6
  export default DynamicFlowSideBySide;
@@ -1,5 +1,5 @@
1
1
  import type * as React from 'react';
2
2
  declare function NeptuneProviders({ children }: {
3
3
  children: React.ReactNode;
4
- }): JSX.Element;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
5
  export default NeptuneProviders;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "3.12.0-experimental-kyc-camera-fae600d",
3
+ "version": "3.12.0-experimental-kyc-camera-ebd94d5",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -19,36 +19,35 @@
19
19
  "url": "git+https://github.com/transferwise/dynamic-flow.git"
20
20
  },
21
21
  "devDependencies": {
22
- "@babel/core": "7.24.4",
23
- "@babel/plugin-syntax-flow": "7.24.1",
24
- "@babel/plugin-transform-react-jsx": "7.23.4",
25
- "@babel/preset-env": "7.24.4",
26
- "@babel/preset-react": "7.24.1",
27
- "@babel/preset-typescript": "7.24.1",
28
- "@formatjs/cli": "^6.2.9",
29
- "@storybook/addon-a11y": "7.6.17",
30
- "@storybook/addon-actions": "7.6.17",
31
- "@storybook/addon-essentials": "7.6.17",
32
- "@storybook/addon-interactions": "7.6.17",
33
- "@storybook/addon-links": "7.6.17",
34
- "@storybook/react": "7.6.17",
35
- "@storybook/react-webpack5": "7.6.17",
22
+ "@babel/core": "7.24.7",
23
+ "@babel/plugin-syntax-flow": "7.24.7",
24
+ "@babel/plugin-transform-react-jsx": "7.24.7",
25
+ "@babel/preset-env": "7.24.7",
26
+ "@babel/preset-react": "7.24.7",
27
+ "@babel/preset-typescript": "7.24.7",
28
+ "@formatjs/cli": "^6.2.12",
29
+ "@storybook/addon-a11y": "7.6.19",
30
+ "@storybook/addon-actions": "7.6.19",
31
+ "@storybook/addon-essentials": "7.6.19",
32
+ "@storybook/addon-interactions": "7.6.19",
33
+ "@storybook/addon-links": "7.6.19",
34
+ "@storybook/react": "7.6.19",
35
+ "@storybook/react-webpack5": "7.6.19",
36
36
  "@storybook/testing-library": "0.2.2",
37
37
  "@testing-library/dom": "9.3.4",
38
- "@testing-library/jest-dom": "6.4.2",
39
- "@testing-library/react": "14.3.0",
38
+ "@testing-library/jest-dom": "6.4.6",
39
+ "@testing-library/react": "14.3.1",
40
40
  "@testing-library/react-hooks": "8.0.1",
41
41
  "@testing-library/user-event": "14.5.2",
42
- "@transferwise/components": "46.35.0",
42
+ "@transferwise/components": "46.37.0",
43
43
  "@transferwise/formatting": "^2.13.0",
44
44
  "@transferwise/icons": "3.13.0",
45
45
  "@transferwise/neptune-css": "14.10.0",
46
46
  "@types/jest": "29.5.12",
47
- "@types/react": "18",
48
- "@types/react-dom": "18",
49
- "@types/testing-library__jest-dom": "5.14.9",
47
+ "@types/react": "18.3.3",
48
+ "@types/react-dom": "18.3.0",
50
49
  "@wise/art": "2.7.0",
51
- "@wise/components-theming": "^0.8.4",
50
+ "@wise/components-theming": "^1.3.0",
52
51
  "@wise/forms": "0.3.4",
53
52
  "babel-jest": "29.7.0",
54
53
  "currency-flags": "4.0.7",
@@ -61,18 +60,18 @@
61
60
  "postcss": "^8.4.38",
62
61
  "postcss-cli": "^10.1.0",
63
62
  "postcss-import": "^15.1.0",
64
- "react": "18.2.0",
65
- "react-dom": "18.2.0",
66
- "react-intl": "6.6.5",
67
- "storybook": "7.6.17",
68
- "stylelint": "16.3.1",
63
+ "react": "18.3.1",
64
+ "react-dom": "18.3.1",
65
+ "react-intl": "6.6.8",
66
+ "storybook": "7.6.19",
67
+ "stylelint": "16.6.1",
69
68
  "stylelint-config-standard": "36.0.0",
70
69
  "stylelint-no-unsupported-browser-features": "5.0.4",
71
70
  "stylelint-value-no-unknown-custom-properties": "6.0.1",
72
- "typescript": "5.1.6",
73
- "webpack": "5.91.0",
74
- "@wise/dynamic-flow-types": "2.15.0",
75
- "@wise/dynamic-flow-fixtures": "0.0.1"
71
+ "typescript": "5.4.5",
72
+ "webpack": "5.92.0",
73
+ "@wise/dynamic-flow-fixtures": "0.0.1",
74
+ "@wise/dynamic-flow-types": "2.15.2"
76
75
  },
77
76
  "peerDependencies": {
78
77
  "react": "^18",
@@ -80,7 +79,7 @@
80
79
  "react-intl": "^6"
81
80
  },
82
81
  "dependencies": {
83
- "@wise/dynamic-flow-client": "3.12.0-experimental-kyc-camera-fae600d"
82
+ "@wise/dynamic-flow-client": "3.12.0-experimental-kyc-camera-ebd94d5"
84
83
  },
85
84
  "scripts": {
86
85
  "dev": "storybook dev -p 3005",
@@ -1,19 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- export var mergeRequestInit = function (init, additionalInit) { return (__assign(__assign(__assign({}, init), additionalInit), { headers: mergeHeaders(init === null || init === void 0 ? void 0 : init.headers, additionalInit === null || additionalInit === void 0 ? void 0 : additionalInit.headers) })); };
13
- var mergeHeaders = function () {
14
- var headersInits = [];
15
- for (var _i = 0; _i < arguments.length; _i++) {
16
- headersInits[_i] = arguments[_i];
17
- }
18
- return headersInits.reduce(function (acc, headers) { return (__assign(__assign({}, acc), Object.fromEntries(new Headers(headers).entries()))); }, {});
19
- };
@@ -1,28 +0,0 @@
1
- import { mergeRequestInit } from './mergeRequestInit';
2
- describe('mergeRequestInit', function () {
3
- describe('when called with two RequestInit objects', function () {
4
- it('merges the two objects and the headers', function () {
5
- var result = mergeRequestInit({ credentials: 'include', headers: { 'X-DF-Response-Type': 'true' } }, { method: 'POST', headers: { 'X-Access-Token': 'QWERTYUIOP' } });
6
- expect(result).toMatchObject({
7
- credentials: 'include',
8
- method: 'POST',
9
- });
10
- expect(result.headers).toMatchObject({
11
- 'x-df-response-type': 'true',
12
- 'x-access-token': 'QWERTYUIOP',
13
- });
14
- });
15
- });
16
- describe('when called with undefined as a first argument', function () {
17
- it('returns the second argument and empty headers', function () {
18
- var result = mergeRequestInit(undefined, { method: 'POST' });
19
- expect(result).toEqual({ method: 'POST', headers: {} });
20
- });
21
- });
22
- describe('when called with null as a first argument', function () {
23
- it('returns the second argument and empty headers', function () {
24
- var result = mergeRequestInit(null, { method: 'POST' });
25
- expect(result).toEqual({ method: 'POST', headers: {} });
26
- });
27
- });
28
- });
@@ -1 +0,0 @@
1
- export declare const mergeRequestInit: (init?: RequestInit, additionalInit?: RequestInit) => RequestInit;