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

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';
13
+ import { DynamicFlowRevamp as DynamicFlowCore, DynamicFlow as DynamicFlowLegacy, } from '@wise/dynamic-flow-client';
14
14
  export function DynamicFlow(props) {
15
- var _a;
16
- var _b = props.customFetch, customFetch = _b === void 0 ? globalThis.fetch : _b, features = props.features;
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(DynamicFlowLegacy, __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(DynamicFlowCore, __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 { DynamicFlow, DynamicFlow as DynamicFlowLegacy, DynamicFlowRevamp, } from './dynamicFlow/DynamicFlow';
4
4
  export var makeCustomFetch = makeHttpClient;
package/build/main.js CHANGED
@@ -38,6 +38,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
38
38
  var src_exports = {};
39
39
  __export(src_exports, {
40
40
  DynamicFlow: () => DynamicFlow,
41
+ DynamicFlowLegacy: () => DynamicFlow,
42
+ DynamicFlowRevamp: () => DynamicFlowRevamp,
41
43
  JsonSchemaForm: () => import_dynamic_flow_client3.JsonSchemaForm,
42
44
  isValidSchema: () => import_dynamic_flow_client3.isValidSchema,
43
45
  makeCustomFetch: () => makeCustomFetch,
@@ -51,13 +53,14 @@ var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
51
53
  var import_dynamic_flow_client = require("@wise/dynamic-flow-client");
52
54
  var import_jsx_runtime = require("react/jsx-runtime");
53
55
  function DynamicFlow(props) {
54
- var _a;
55
- const { customFetch = globalThis.fetch, features } = 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 c=Object.defineProperty,P=Object.defineProperties,W=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,C=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,v=Object.prototype.propertyIsEnumerable;var F=(i,t,o)=>t in i?c(i,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):i[t]=o,n=(i,t)=>{for(var o in t||(t={}))w.call(t,o)&&F(i,o,t[o]);if(r)for(var o of r(t))v.call(t,o)&&F(i,o,t[o]);return i},p=(i,t)=>P(i,f(t));var R=(i,t)=>{for(var o in t)c(i,o,{get:t[o],enumerable:!0})},g=(i,t,o,y)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of C(t))!w.call(i,a)&&a!==o&&c(i,a,{get:()=>t[a],enumerable:!(y=W(t,a))||y.enumerable});return i};var u=i=>g(c({},"__esModule",{value:!0}),i);var x={};R(x,{DynamicFlow:()=>l,DynamicFlowLegacy:()=>l,DynamicFlowRevamp:()=>D,JsonSchemaForm:()=>e.JsonSchemaForm,isValidSchema:()=>e.isValidSchema,makeCustomFetch:()=>I,translations:()=>e.translations});module.exports=u(x);var h=require("@wise/dynamic-flow-client"),e=require("@wise/dynamic-flow-client");var m=require("@wise/dynamic-flow-client");var s=require("react/jsx-runtime");function l(i){let{customFetch:t=globalThis.fetch}=i,o=p(n({},i),{httpClient:t});return(0,s.jsx)(m.DynamicFlow,n({},o))}function D(i){let{customFetch:t=globalThis.fetch}=i,o=p(n({},i),{httpClient:t});return(0,s.jsx)(m.DynamicFlowRevamp,n({},o))}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,
27
+ DynamicFlowRevamp as DynamicFlowCore,
28
28
  DynamicFlow as DynamicFlowLegacy
29
29
  } from "@wise/dynamic-flow-client";
30
30
  import { jsx } from "react/jsx-runtime";
31
31
  function DynamicFlow(props) {
32
- var _a;
33
- const { customFetch = globalThis.fetch, features } = props;
32
+ const { customFetch = globalThis.fetch } = props;
33
+ const coreProps = __spreadProps(__spreadValues({}, props), { httpClient: customFetch });
34
+ return /* @__PURE__ */ jsx(DynamicFlowLegacy, __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(DynamicFlowCore, __spreadValues({}, coreProps));
39
40
  }
40
41
 
41
42
  // src/index.ts
42
43
  var makeCustomFetch = makeHttpClient;
43
44
  export {
44
45
  DynamicFlow,
46
+ DynamicFlow as 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 DynamicFlowLegacyProps, 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
4
  export type WiseDynamicFlowProps = (Omit<DynamicFlowPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowPropsWithInitialStep, 'httpClient'>) & {
5
5
  customFetch?: DynamicFlowLegacyProps['httpClient'];
6
6
  };
7
+ export type WiseRevampDynamicFlowProps = (Omit<DynamicFlowRevampPropsWithInitialAction, 'httpClient'> | Omit<DynamicFlowRevampPropsWithInitialStep, 'httpClient'>) & {
8
+ customFetch?: DynamicFlowLegacyProps['httpClient'];
9
+ };
7
10
  export declare function DynamicFlow(props: WiseDynamicFlowProps): JSX.Element;
11
+ export declare function DynamicFlowRevamp(props: WiseRevampDynamicFlowProps): 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 { WiseDynamicFlowProps, WiseDynamicFlowProps as WiseLegacyDynamicFlowProps, WiseRevampDynamicFlowProps, } from './dynamicFlow/DynamicFlow';
4
+ export { DynamicFlow, DynamicFlow as 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-beta-ba9b66e",
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-beta-ba9b66e"
84
84
  },
85
85
  "scripts": {
86
86
  "dev": "storybook dev -p 3005",