@wise/dynamic-flow-client-internal 3.7.2-experimental-1ba6fef → 3.8.0-experimental-da4e1e5

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.
@@ -10,14 +10,14 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import { DynamicFlowRevamp, DynamicFlow as DynamicFlowLegacy, } from '@wise/dynamic-flow-client';
14
- export function DynamicFlow(props) {
15
- var _a;
16
- var _b = props.customFetch, customFetch = _b === void 0 ? globalThis.fetch : _b, features = props.features;
13
+ import { DynamicFlowRevamp as DynamicFlowCoreRevamp, DynamicFlow as DynamicFlowCoreLegacy, } from '@wise/dynamic-flow-client';
14
+ export function DynamicFlowLegacy(props) {
15
+ var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
17
16
  var coreProps = __assign(__assign({}, props), { httpClient: customFetch });
18
- var revampEnabled = (_a = features === null || features === void 0 ? void 0 : features.some(function (_a) {
19
- var featureName = _a.featureName, variant = _a.variant;
20
- return featureName === 'df-revamp' && variant && variant > 0;
21
- })) !== null && _a !== void 0 ? _a : false;
22
- return revampEnabled ? (_jsx(DynamicFlowRevamp, __assign({}, coreProps))) : (_jsx(DynamicFlowLegacy, __assign({}, coreProps)));
17
+ return _jsx(DynamicFlowCoreLegacy, __assign({}, coreProps));
18
+ }
19
+ export function DynamicFlowRevamp(props) {
20
+ var _a = props.customFetch, customFetch = _a === void 0 ? globalThis.fetch : _a;
21
+ var coreProps = __assign(__assign({}, props), { httpClient: customFetch });
22
+ return _jsx(DynamicFlowCoreRevamp, __assign({}, coreProps));
23
23
  }
package/build/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { makeHttpClient } from '@wise/dynamic-flow-client';
2
2
  export { translations, JsonSchemaForm, isValidSchema } from '@wise/dynamic-flow-client';
3
- export { DynamicFlow } from './dynamicFlow/DynamicFlow';
3
+ export { DynamicFlowLegacy as DynamicFlow, DynamicFlowLegacy, DynamicFlowRevamp, } from './dynamicFlow/DynamicFlow';
4
4
  export var makeCustomFetch = makeHttpClient;
package/build/main.js CHANGED
@@ -37,7 +37,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
37
37
  // src/index.ts
38
38
  var src_exports = {};
39
39
  __export(src_exports, {
40
- DynamicFlow: () => DynamicFlow,
40
+ DynamicFlow: () => DynamicFlowLegacy,
41
+ DynamicFlowLegacy: () => DynamicFlowLegacy,
42
+ DynamicFlowRevamp: () => DynamicFlowRevamp,
41
43
  JsonSchemaForm: () => import_dynamic_flow_client3.JsonSchemaForm,
42
44
  isValidSchema: () => import_dynamic_flow_client3.isValidSchema,
43
45
  makeCustomFetch: () => makeCustomFetch,
@@ -50,14 +52,15 @@ var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
50
52
  // src/dynamicFlow/DynamicFlow.tsx
51
53
  var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
52
54
  var import_jsx_runtime = require("react/jsx-runtime");
53
- function DynamicFlow(props) {
54
- var _a;
55
- const { customFetch = globalThis.fetch, features } = props;
55
+ function DynamicFlowLegacy(props) {
56
+ const { customFetch = globalThis.fetch } = props;
56
57
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
57
- const revampEnabled = (_a = features == null ? void 0 : features.some(
58
- ({ featureName, variant }) => featureName === "df-revamp" && variant && variant > 0
59
- )) != null ? _a : false;
60
- return revampEnabled ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlowRevamp, __spreadValues({}, coreProps)) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlow, __spreadValues({}, coreProps));
58
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlow, __spreadValues({}, coreProps));
59
+ }
60
+ function DynamicFlowRevamp(props) {
61
+ const { customFetch = globalThis.fetch } = props;
62
+ const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
63
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dynamic_flow_client.DynamicFlowRevamp, __spreadValues({}, coreProps));
61
64
  }
62
65
 
63
66
  // src/index.ts
package/build/main.min.js CHANGED
@@ -1 +1 @@
1
- "use strict";var n=Object.defineProperty,d=Object.defineProperties,W=Object.getOwnPropertyDescriptor,u=Object.getOwnPropertyDescriptors,x=Object.getOwnPropertyNames,y=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var F=(t,o,i)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,c=(t,o)=>{for(var i in o||(o={}))w.call(o,i)&&F(t,i,o[i]);if(y)for(var i of y(o))C.call(o,i)&&F(t,i,o[i]);return t},D=(t,o)=>d(t,u(o));var g=(t,o)=>{for(var i in o)n(t,i,{get:o[i],enumerable:!0})},v=(t,o,i,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of x(o))!w.call(t,e)&&e!==i&&n(t,e,{get:()=>o[e],enumerable:!(m=W(o,e))||m.enumerable});return t};var I=t=>v(n({},"__esModule",{value:!0}),t);var b={};g(b,{DynamicFlow:()=>h,JsonSchemaForm:()=>a.JsonSchemaForm,isValidSchema:()=>a.isValidSchema,makeCustomFetch:()=>S,translations:()=>a.translations});module.exports=I(b);var P=require("@wise/dynamic-flow-client"),a=require("@wise/dynamic-flow-client");var l=require("@wise/dynamic-flow-client");var p=require("react/jsx-runtime");function h(t){var r;let{customFetch:o=globalThis.fetch,features:i}=t,m=D(c({},t),{httpClient:o});return((r=i==null?void 0:i.some(({featureName:f,variant:s})=>f==="df-revamp"&&s&&s>0))!=null?r:!1)?(0,p.jsx)(l.DynamicFlowRevamp,c({},m)):(0,p.jsx)(l.DynamicFlow,c({},m))}var S=P.makeHttpClient;
1
+ "use strict";var n=Object.defineProperty,P=Object.defineProperties,C=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable;var F=(t,o,i)=>o in t?n(t,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[o]=i,c=(t,o)=>{for(var i in o||(o={}))w.call(o,i)&&F(t,i,o[i]);if(s)for(var i of s(o))R.call(o,i)&&F(t,i,o[i]);return t},p=(t,o)=>P(t,f(o));var g=(t,o)=>{for(var i in o)n(t,i,{get:o[i],enumerable:!0})},L=(t,o,i,r)=>{if(o&&typeof o=="object"||typeof o=="function")for(let e of v(o))!w.call(t,e)&&e!==i&&n(t,e,{get:()=>o[e],enumerable:!(r=C(o,e))||r.enumerable});return t};var u=t=>L(n({},"__esModule",{value:!0}),t);var W={};g(W,{DynamicFlow:()=>l,DynamicFlowLegacy:()=>l,DynamicFlowRevamp:()=>D,JsonSchemaForm:()=>a.JsonSchemaForm,isValidSchema:()=>a.isValidSchema,makeCustomFetch:()=>I,translations:()=>a.translations});module.exports=u(W);var h=require("@wise/dynamic-flow-client"),a=require("@wise/dynamic-flow-client");var m=require("@wise/dynamic-flow-client");var y=require("react/jsx-runtime");function l(t){let{customFetch:o=globalThis.fetch}=t,i=p(c({},t),{httpClient:o});return(0,y.jsx)(m.DynamicFlow,c({},i))}function D(t){let{customFetch:o=globalThis.fetch}=t,i=p(c({},t),{httpClient:o});return(0,y.jsx)(m.DynamicFlowRevamp,c({},i))}var I=h.makeHttpClient;
package/build/main.mjs CHANGED
@@ -24,24 +24,27 @@ import { translations, JsonSchemaForm, isValidSchema } from "@wise/dynamic-flow-
24
24
 
25
25
  // src/dynamicFlow/DynamicFlow.tsx
26
26
  import {
27
- DynamicFlowRevamp,
28
- DynamicFlow as DynamicFlowLegacy
27
+ DynamicFlowRevamp as DynamicFlowCoreRevamp,
28
+ DynamicFlow as DynamicFlowCoreLegacy
29
29
  } from "@wise/dynamic-flow-client";
30
30
  import { jsx } from "react/jsx-runtime";
31
- function DynamicFlow(props) {
32
- var _a;
33
- const { customFetch = globalThis.fetch, features } = props;
31
+ function DynamicFlowLegacy(props) {
32
+ const { customFetch = globalThis.fetch } = props;
33
+ const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
34
+ return /* @__PURE__ */ jsx(DynamicFlowCoreLegacy, __spreadValues({}, coreProps));
35
+ }
36
+ function DynamicFlowRevamp(props) {
37
+ const { customFetch = globalThis.fetch } = props;
34
38
  const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
35
- const revampEnabled = (_a = features == null ? void 0 : features.some(
36
- ({ featureName, variant }) => featureName === "df-revamp" && variant && variant > 0
37
- )) != null ? _a : false;
38
- return revampEnabled ? /* @__PURE__ */ jsx(DynamicFlowRevamp, __spreadValues({}, coreProps)) : /* @__PURE__ */ jsx(DynamicFlowLegacy, __spreadValues({}, coreProps));
39
+ return /* @__PURE__ */ jsx(DynamicFlowCoreRevamp, __spreadValues({}, coreProps));
39
40
  }
40
41
 
41
42
  // src/index.ts
42
43
  var makeCustomFetch = makeHttpClient;
43
44
  export {
44
- DynamicFlow,
45
+ DynamicFlowLegacy as DynamicFlow,
46
+ DynamicFlowLegacy,
47
+ DynamicFlowRevamp,
45
48
  JsonSchemaForm,
46
49
  isValidSchema,
47
50
  makeCustomFetch,
@@ -12,22 +12,21 @@ var __assign = (this && this.__assign) || function () {
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import { action } from '@storybook/addon-actions';
14
14
  import { layouts, features, examples, schemas } from '@wise/dynamic-flow-fixtures';
15
- import { DynamicFlow } from '../index';
15
+ import { DynamicFlowLegacy, DynamicFlowRevamp } from '../index';
16
16
  import { fixtureHttpClient } from './utils/fixtureHttpClient';
17
17
  var fixtures = __assign(__assign(__assign(__assign({}, examples), schemas), layouts), features);
18
18
  function DynamicFlowRenderer(_a) {
19
19
  var _b = _a.initialStepName, initialStepName = _b === void 0 ? '' : _b, _c = _a.revampEnabled, revampEnabled = _c === void 0 ? false : _c;
20
20
  var selectedStep = fixtures[initialStepName] || {};
21
- return (_jsx(DynamicFlow, { flowId: "storybook", initialAction: { method: 'GET', url: "/steps/".concat(initialStepName) }, customFetch: fixtureHttpClient, loaderConfig: { size: 'xl', initial: true, submission: false }, features: revampEnabled
22
- ? [
23
- {
24
- featureName: 'dynamic-flow-revamp',
25
- enabled: true,
26
- variant: 1,
27
- initiation: 'DEFAULT',
28
- },
29
- ]
30
- : [], onCompletion: action('onCompletion'), onError: action('onError'), onEvent: action('onEvent'), onLog: action('onLog') }, selectedStep.id));
21
+ var props = {
22
+ flowId: 'storybook',
23
+ customFetch: fixtureHttpClient,
24
+ onCompletion: action('onCompletion'),
25
+ onError: action('onError'),
26
+ onEvent: action('onEvent'),
27
+ onLog: action('onLog'),
28
+ };
29
+ return revampEnabled ? (_jsx(DynamicFlowRevamp, __assign({}, props, { initialAction: { method: 'GET', url: "/steps/".concat(initialStepName) } }), selectedStep.id)) : (_jsx(DynamicFlowLegacy, __assign({}, props, { initialAction: { method: 'GET', url: "/steps/".concat(initialStepName) }, loaderConfig: { size: 'xl', initial: true, submission: false } }), selectedStep.id));
31
30
  }
32
31
  var meta = {
33
32
  title: 'Multi-fixture',
@@ -11,28 +11,20 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import { action } from '@storybook/addon-actions';
14
- import { DynamicFlow } from '../../dynamicFlow/DynamicFlow';
14
+ import { DynamicFlowRevamp } from '../../dynamicFlow/DynamicFlow';
15
15
  import { fixtureHttpClient } from './fixtureHttpClient';
16
+ import { DynamicFlowLegacy } from '../..';
16
17
  function DynamicFlowSideBySide(_a) {
17
18
  var key = _a.key, initialStep = _a.initialStep;
18
19
  var props = {
19
20
  flowId: 'storybook',
20
- initialStep: initialStep,
21
21
  customFetch: fixtureHttpClient,
22
- loaderConfig: { size: 'xl', initial: true, submission: false },
23
22
  features: [],
24
23
  onCompletion: action('onCompletion'),
25
24
  onError: action('onError'),
26
25
  onEvent: action('onEvent'),
27
26
  onLog: action('onLog'),
28
27
  };
29
- return (_jsxs("div", { className: "df-side-by-side-container", children: [_jsx("div", { className: "df-side-by-side-column", children: _jsx(DynamicFlow, __assign({}, props), "".concat(key, "-original")) }), _jsx("div", { className: "df-side-by-side-column", children: _jsx(DynamicFlow, __assign({}, props, { features: [
30
- {
31
- featureName: 'dynamic-flow-revamp',
32
- enabled: true,
33
- variant: 1,
34
- initiation: 'DEFAULT',
35
- },
36
- ] }), "".concat(key, "-revamp")) })] }));
28
+ return (_jsxs("div", { className: "df-side-by-side-container", children: [_jsx("div", { className: "df-side-by-side-column", children: _jsx(DynamicFlowLegacy, __assign({}, props, { loaderConfig: { size: 'xl', initial: true, submission: false }, initialStep: initialStep }), "".concat(key, "-original")) }), _jsx("div", { className: "df-side-by-side-column", children: _jsx(DynamicFlowRevamp, __assign({}, props, { initialStep: initialStep }), "".concat(key, "-revamp")) })] }));
37
29
  }
38
30
  export default DynamicFlowSideBySide;
@@ -1,7 +1,11 @@
1
1
  /// <reference types="react" />
2
- import { type DynamicFlowProps as DynamicFlowLegacyProps } from '@wise/dynamic-flow-client';
2
+ import { type DynamicFlowProps as DynamicFlowCoreLegacyProps, type DynamicFlowRevampProps as DynamicFlowCoreRevampProps, type DynamicFlowRevampPropsWithInitialAction, type DynamicFlowRevampPropsWithInitialStep } from '@wise/dynamic-flow-client';
3
3
  import type { DynamicFlowPropsWithInitialAction, DynamicFlowPropsWithInitialStep } from '@wise/dynamic-flow-client/build/types/legacy/dynamic-flow-types';
4
- export type WiseDynamicFlowProps = (Omit<DynamicFlowPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowPropsWithInitialStep, 'httpClient'>) & {
5
- customFetch?: DynamicFlowLegacyProps['httpClient'];
4
+ export type DynamicFlowLegacyProps = (Omit<DynamicFlowPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowPropsWithInitialStep, 'httpClient'>) & {
5
+ customFetch?: DynamicFlowCoreLegacyProps['httpClient'];
6
6
  };
7
- export declare function DynamicFlow(props: WiseDynamicFlowProps): JSX.Element;
7
+ export type DynamicFlowRevampProps = (Omit<DynamicFlowRevampPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowRevampPropsWithInitialStep, 'httpClient'>) & {
8
+ customFetch?: DynamicFlowCoreRevampProps['httpClient'];
9
+ };
10
+ export declare function DynamicFlowLegacy(props: DynamicFlowLegacyProps): JSX.Element;
11
+ export declare function DynamicFlowRevamp(props: DynamicFlowRevampProps): JSX.Element;
@@ -1,5 +1,5 @@
1
1
  export type { DynamicFlowProps, Step, InitialAction } from '@wise/dynamic-flow-client';
2
2
  export { translations, JsonSchemaForm, isValidSchema } from '@wise/dynamic-flow-client';
3
- export type { WiseDynamicFlowProps } from './dynamicFlow/DynamicFlow';
4
- export { DynamicFlow } from './dynamicFlow/DynamicFlow';
3
+ export type { DynamicFlowLegacyProps as WiseDynamicFlowProps, DynamicFlowLegacyProps, DynamicFlowRevampProps, } from './dynamicFlow/DynamicFlow';
4
+ export { DynamicFlowLegacy as DynamicFlow, DynamicFlowLegacy, DynamicFlowRevamp, } from './dynamicFlow/DynamicFlow';
5
5
  export declare const makeCustomFetch: (baseUrl: string, additionalHeaders?: HeadersInit | undefined) => typeof fetch;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "3.7.2-experimental-1ba6fef",
3
+ "version": "3.8.0-experimental-da4e1e5",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -80,7 +80,7 @@
80
80
  "react-intl": "^6"
81
81
  },
82
82
  "dependencies": {
83
- "@wise/dynamic-flow-client": "3.7.2-experimental-1ba6fef"
83
+ "@wise/dynamic-flow-client": "3.8.0-experimental-da4e1e5"
84
84
  },
85
85
  "scripts": {
86
86
  "dev": "storybook dev -p 3005",