@wise/dynamic-flow-client-internal 5.8.1 → 5.9.0-experimental-rendererprops-9c9a4b8

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,16 +127,18 @@ __export(index_exports, {
127
127
  DynamicFlowWithRef: () => DynamicFlowWithRef,
128
128
  Header: () => Header11,
129
129
  Media: () => Media2,
130
- findRendererPropsByType: () => import_dynamic_flow_client7.findRendererPropsByType,
130
+ findRendererPropsByType: () => import_dynamic_flow_client5.findRendererPropsByType,
131
131
  getMargin: () => getMargin2,
132
- makeCustomFetch: () => import_dynamic_flow_client6.makeHttpClient,
133
- translations: () => i18n_default
132
+ makeCustomFetch: () => import_dynamic_flow_client4.makeHttpClient,
133
+ translations: () => i18n_default,
134
+ useDynamicFlowModalWise: () => useDynamicFlowModalWise,
135
+ useDynamicFlowWise: () => useDynamicFlowWise
134
136
  });
135
137
  module.exports = __toCommonJS(index_exports);
136
- var import_dynamic_flow_client6 = require("@wise/dynamic-flow-client");
138
+ var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
137
139
 
138
- // src/dynamicFlow/DynamicFlow.tsx
139
- var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
140
+ // src/dynamicFlow/useDynamicFlowWise.tsx
141
+ var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
140
142
 
141
143
  // src/dynamicFlow/useWiseToCoreProps.tsx
142
144
  var import_react22 = require("react");
@@ -4008,8 +4010,24 @@ var getWiseRenderers = () => [
4008
4010
  ReviewLegacyRenderer_default
4009
4011
  ];
4010
4012
 
4011
- // ../renderers/src/subflow/getSubflowRenderer.tsx
4013
+ // ../renderers/src/InitialLoadingStateRenderer.tsx
4014
+ var import_components61 = require("@transferwise/components");
4012
4015
  var import_jsx_runtime86 = require("react/jsx-runtime");
4016
+ var InitialLoadingStateRenderer = {
4017
+ canRenderType: "loading-state",
4018
+ canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
4019
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
4020
+ import_components61.Loader,
4021
+ {
4022
+ size: "md",
4023
+ classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
4024
+ "data-testid": "loading-state"
4025
+ }
4026
+ )
4027
+ };
4028
+
4029
+ // ../renderers/src/subflow/getSubflowRenderer.tsx
4030
+ var import_jsx_runtime87 = require("react/jsx-runtime");
4013
4031
  var getSubflowRenderer = ({
4014
4032
  Component: Component2,
4015
4033
  canRender
@@ -4018,7 +4036,7 @@ var getSubflowRenderer = ({
4018
4036
  canRenderType: "subflow",
4019
4037
  canRender,
4020
4038
  render: (props) => {
4021
- return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
4039
+ return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
4022
4040
  Component2,
4023
4041
  {
4024
4042
  presentation: props.presentation,
@@ -4096,29 +4114,27 @@ var handleRejection = (error) => {
4096
4114
  };
4097
4115
 
4098
4116
  // src/dynamicFlow/DynamicFlowModal.tsx
4099
- var import_dynamic_flow_client2 = require("@wise/dynamic-flow-client");
4100
- var import_components61 = require("@transferwise/components");
4101
- var import_jsx_runtime87 = require("react/jsx-runtime");
4117
+ var import_components62 = require("@transferwise/components");
4118
+ var import_jsx_runtime88 = require("react/jsx-runtime");
4102
4119
  function DynamicFlowModal(props) {
4103
4120
  const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
4104
- const dfProps = useWiseToCoreProps(rest);
4105
- const df = (0, import_dynamic_flow_client2.useDynamicFlowModal)(dfProps);
4106
- return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
4107
- import_components61.Modal,
4121
+ const df = useDynamicFlowModalWise(rest);
4122
+ return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
4123
+ import_components62.Modal,
4108
4124
  __spreadProps(__spreadValues({
4109
4125
  className: `dynamic-flow-modal ${className}`,
4110
4126
  disableDimmerClickToClose: true
4111
4127
  }, df.modal), {
4112
- body: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
4128
+ body: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("div", { className: "dynamic-flow-modal", children: df.modal.body })
4113
4129
  })
4114
4130
  );
4115
4131
  }
4116
4132
 
4117
4133
  // src/dynamicFlow/getMergedRenderers.tsx
4118
- var import_jsx_runtime88 = require("react/jsx-runtime");
4134
+ var import_jsx_runtime89 = require("react/jsx-runtime");
4119
4135
  var wiseRenderers = getWiseRenderers();
4120
4136
  var getMergedRenderers = (props) => {
4121
- var _d;
4137
+ var _d, _e;
4122
4138
  const _a = props, { initialAction, initialStep } = _a, restProps = __objRest(_a, ["initialAction", "initialStep"]);
4123
4139
  const subflowFeatures = __spreadProps(__spreadValues({}, props.features), { nativeBack: true });
4124
4140
  const subflowRenderer = getSubflowRenderer({
@@ -4129,7 +4145,7 @@ var getMergedRenderers = (props) => {
4129
4145
  method: initialRequest.method,
4130
4146
  data: initialRequest.body
4131
4147
  };
4132
- return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
4148
+ return presentation.type === "push" ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
4133
4149
  DynamicFlowModal,
4134
4150
  __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
4135
4151
  features: subflowFeatures,
@@ -4138,7 +4154,8 @@ var getMergedRenderers = (props) => {
4138
4154
  );
4139
4155
  }
4140
4156
  });
4141
- return [...(_d = props.renderers) != null ? _d : [], subflowRenderer, ...wiseRenderers];
4157
+ const loadingStateRenderer = ((_d = props.features) == null ? void 0 : _d.initialLoader) ? [InitialLoadingStateRenderer] : [];
4158
+ return [...(_e = props.renderers) != null ? _e : [], subflowRenderer, ...loadingStateRenderer, ...wiseRenderers];
4142
4159
  };
4143
4160
 
4144
4161
  // src/dynamicFlow/useWiseToCoreProps.tsx
@@ -4178,23 +4195,30 @@ var openLinkInNewTab = (url) => {
4178
4195
  }
4179
4196
  };
4180
4197
 
4198
+ // src/dynamicFlow/useDynamicFlowWise.tsx
4199
+ var useDynamicFlowWise = (props) => {
4200
+ const dfProps = useWiseToCoreProps(props);
4201
+ return (0, import_dynamic_flow_client2.useDynamicFlow)(dfProps);
4202
+ };
4203
+ var useDynamicFlowModalWise = (props) => {
4204
+ const dfProps = useWiseToCoreProps(props);
4205
+ return (0, import_dynamic_flow_client2.useDynamicFlowModal)(dfProps);
4206
+ };
4207
+
4181
4208
  // src/dynamicFlow/DynamicFlow.tsx
4182
- var import_jsx_runtime89 = require("react/jsx-runtime");
4209
+ var import_jsx_runtime90 = require("react/jsx-runtime");
4183
4210
  function DynamicFlow(props) {
4184
4211
  const { className = "" } = props;
4185
- const dfProps = useWiseToCoreProps(props);
4186
- const df = (0, import_dynamic_flow_client3.useDynamicFlow)(dfProps);
4187
- return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className, children: df.view });
4212
+ const df = useDynamicFlowWise(props);
4213
+ return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className, children: df.view });
4188
4214
  }
4189
4215
 
4190
4216
  // src/dynamicFlow/DynamicFlowWithRef.tsx
4191
4217
  var import_react23 = require("react");
4192
- var import_dynamic_flow_client4 = require("@wise/dynamic-flow-client");
4193
- var import_jsx_runtime90 = require("react/jsx-runtime");
4218
+ var import_jsx_runtime91 = require("react/jsx-runtime");
4194
4219
  var DynamicFlowWithRef = (0, import_react23.forwardRef)(function DynamicFlowWithRef2(props, ref) {
4195
4220
  const { className = "" } = props;
4196
- const dfProps = useWiseToCoreProps(props);
4197
- const df = (0, import_dynamic_flow_client4.useDynamicFlow)(dfProps);
4221
+ const df = useDynamicFlowWise(props);
4198
4222
  (0, import_react23.useImperativeHandle)(
4199
4223
  ref,
4200
4224
  () => ({
@@ -4206,11 +4230,11 @@ var DynamicFlowWithRef = (0, import_react23.forwardRef)(function DynamicFlowWith
4206
4230
  }),
4207
4231
  [df]
4208
4232
  );
4209
- return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className, children: df.view });
4233
+ return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className, children: df.view });
4210
4234
  });
4211
4235
 
4212
4236
  // src/index.ts
4213
- var import_dynamic_flow_client7 = require("@wise/dynamic-flow-client");
4237
+ var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
4214
4238
 
4215
4239
  // src/dynamicFlow/renderers.tsx
4216
4240
  var Header11 = Header5;
@@ -4218,7 +4242,7 @@ var Media2 = Media;
4218
4242
  var getMargin2 = getMargin;
4219
4243
 
4220
4244
  // src/i18n/index.ts
4221
- var import_dynamic_flow_client5 = require("@wise/dynamic-flow-client");
4245
+ var import_dynamic_flow_client3 = require("@wise/dynamic-flow-client");
4222
4246
 
4223
4247
  // src/i18n/cs.json
4224
4248
  var cs_default = {
@@ -5071,10 +5095,10 @@ var wiseTranslations = {
5071
5095
  "zh-HK": zh_HK_default
5072
5096
  };
5073
5097
  var languages = Array.from(
5074
- /* @__PURE__ */ new Set([...Object.keys(import_dynamic_flow_client5.translations), ...Object.keys(wiseTranslations)])
5098
+ /* @__PURE__ */ new Set([...Object.keys(import_dynamic_flow_client3.translations), ...Object.keys(wiseTranslations)])
5075
5099
  );
5076
5100
  var translations = languages.reduce(
5077
- (acc, lang) => __spreadProps(__spreadValues({}, acc), { [lang]: __spreadValues(__spreadValues({}, import_dynamic_flow_client5.translations[lang]), wiseTranslations[lang]) }),
5101
+ (acc, lang) => __spreadProps(__spreadValues({}, acc), { [lang]: __spreadValues(__spreadValues({}, import_dynamic_flow_client3.translations[lang]), wiseTranslations[lang]) }),
5078
5102
  {}
5079
5103
  );
5080
5104
  var i18n_default = translations;
package/build/main.mjs CHANGED
@@ -117,8 +117,8 @@ var require_classnames = __commonJS({
117
117
  // src/index.ts
118
118
  import { makeHttpClient } from "@wise/dynamic-flow-client";
119
119
 
120
- // src/dynamicFlow/DynamicFlow.tsx
121
- import { useDynamicFlow } from "@wise/dynamic-flow-client";
120
+ // src/dynamicFlow/useDynamicFlowWise.tsx
121
+ import { useDynamicFlow, useDynamicFlowModal } from "@wise/dynamic-flow-client";
122
122
 
123
123
  // src/dynamicFlow/useWiseToCoreProps.tsx
124
124
  import { useMemo as useMemo2 } from "react";
@@ -3999,8 +3999,24 @@ var getWiseRenderers = () => [
3999
3999
  ReviewLegacyRenderer_default
4000
4000
  ];
4001
4001
 
4002
- // ../renderers/src/subflow/getSubflowRenderer.tsx
4002
+ // ../renderers/src/InitialLoadingStateRenderer.tsx
4003
+ import { Loader as Loader2 } from "@transferwise/components";
4003
4004
  import { jsx as jsx86 } from "react/jsx-runtime";
4005
+ var InitialLoadingStateRenderer = {
4006
+ canRenderType: "loading-state",
4007
+ canRender: ({ stepLoadingState }) => stepLoadingState === "initial",
4008
+ render: () => /* @__PURE__ */ jsx86(
4009
+ Loader2,
4010
+ {
4011
+ size: "md",
4012
+ classNames: { "tw-loader": `tw-loader m-x-auto ${getMargin("md")}` },
4013
+ "data-testid": "loading-state"
4014
+ }
4015
+ )
4016
+ };
4017
+
4018
+ // ../renderers/src/subflow/getSubflowRenderer.tsx
4019
+ import { jsx as jsx87 } from "react/jsx-runtime";
4004
4020
  var getSubflowRenderer = ({
4005
4021
  Component: Component2,
4006
4022
  canRender
@@ -4009,7 +4025,7 @@ var getSubflowRenderer = ({
4009
4025
  canRenderType: "subflow",
4010
4026
  canRender,
4011
4027
  render: (props) => {
4012
- return /* @__PURE__ */ jsx86(
4028
+ return /* @__PURE__ */ jsx87(
4013
4029
  Component2,
4014
4030
  {
4015
4031
  presentation: props.presentation,
@@ -4087,29 +4103,27 @@ var handleRejection = (error) => {
4087
4103
  };
4088
4104
 
4089
4105
  // src/dynamicFlow/DynamicFlowModal.tsx
4090
- import { useDynamicFlowModal } from "@wise/dynamic-flow-client";
4091
4106
  import { Modal as Modal5 } from "@transferwise/components";
4092
- import { jsx as jsx87 } from "react/jsx-runtime";
4107
+ import { jsx as jsx88 } from "react/jsx-runtime";
4093
4108
  function DynamicFlowModal(props) {
4094
4109
  const _a = props, { className = "" } = _a, rest = __objRest(_a, ["className"]);
4095
- const dfProps = useWiseToCoreProps(rest);
4096
- const df = useDynamicFlowModal(dfProps);
4097
- return /* @__PURE__ */ jsx87(
4110
+ const df = useDynamicFlowModalWise(rest);
4111
+ return /* @__PURE__ */ jsx88(
4098
4112
  Modal5,
4099
4113
  __spreadProps(__spreadValues({
4100
4114
  className: `dynamic-flow-modal ${className}`,
4101
4115
  disableDimmerClickToClose: true
4102
4116
  }, df.modal), {
4103
- body: /* @__PURE__ */ jsx87("div", { className: "dynamic-flow-modal", children: df.modal.body })
4117
+ body: /* @__PURE__ */ jsx88("div", { className: "dynamic-flow-modal", children: df.modal.body })
4104
4118
  })
4105
4119
  );
4106
4120
  }
4107
4121
 
4108
4122
  // src/dynamicFlow/getMergedRenderers.tsx
4109
- import { jsx as jsx88 } from "react/jsx-runtime";
4123
+ import { jsx as jsx89 } from "react/jsx-runtime";
4110
4124
  var wiseRenderers = getWiseRenderers();
4111
4125
  var getMergedRenderers = (props) => {
4112
- var _d;
4126
+ var _d, _e;
4113
4127
  const _a = props, { initialAction, initialStep } = _a, restProps = __objRest(_a, ["initialAction", "initialStep"]);
4114
4128
  const subflowFeatures = __spreadProps(__spreadValues({}, props.features), { nativeBack: true });
4115
4129
  const subflowRenderer = getSubflowRenderer({
@@ -4120,7 +4134,7 @@ var getMergedRenderers = (props) => {
4120
4134
  method: initialRequest.method,
4121
4135
  data: initialRequest.body
4122
4136
  };
4123
- return presentation.type === "push" ? /* @__PURE__ */ jsx88(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx88(
4137
+ return presentation.type === "push" ? /* @__PURE__ */ jsx89(DynamicFlow, __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), { features: subflowFeatures, initialAction: action })) : /* @__PURE__ */ jsx89(
4124
4138
  DynamicFlowModal,
4125
4139
  __spreadProps(__spreadValues(__spreadValues({}, restProps), rest), {
4126
4140
  features: subflowFeatures,
@@ -4129,7 +4143,8 @@ var getMergedRenderers = (props) => {
4129
4143
  );
4130
4144
  }
4131
4145
  });
4132
- return [...(_d = props.renderers) != null ? _d : [], subflowRenderer, ...wiseRenderers];
4146
+ const loadingStateRenderer = ((_d = props.features) == null ? void 0 : _d.initialLoader) ? [InitialLoadingStateRenderer] : [];
4147
+ return [...(_e = props.renderers) != null ? _e : [], subflowRenderer, ...loadingStateRenderer, ...wiseRenderers];
4133
4148
  };
4134
4149
 
4135
4150
  // src/dynamicFlow/useWiseToCoreProps.tsx
@@ -4169,13 +4184,22 @@ var openLinkInNewTab = (url) => {
4169
4184
  }
4170
4185
  };
4171
4186
 
4187
+ // src/dynamicFlow/useDynamicFlowWise.tsx
4188
+ var useDynamicFlowWise = (props) => {
4189
+ const dfProps = useWiseToCoreProps(props);
4190
+ return useDynamicFlow(dfProps);
4191
+ };
4192
+ var useDynamicFlowModalWise = (props) => {
4193
+ const dfProps = useWiseToCoreProps(props);
4194
+ return useDynamicFlowModal(dfProps);
4195
+ };
4196
+
4172
4197
  // src/dynamicFlow/DynamicFlow.tsx
4173
- import { jsx as jsx89 } from "react/jsx-runtime";
4198
+ import { jsx as jsx90 } from "react/jsx-runtime";
4174
4199
  function DynamicFlow(props) {
4175
4200
  const { className = "" } = props;
4176
- const dfProps = useWiseToCoreProps(props);
4177
- const df = useDynamicFlow(dfProps);
4178
- return /* @__PURE__ */ jsx89("div", { className, children: df.view });
4201
+ const df = useDynamicFlowWise(props);
4202
+ return /* @__PURE__ */ jsx90("div", { className, children: df.view });
4179
4203
  }
4180
4204
 
4181
4205
  // src/dynamicFlow/DynamicFlowWithRef.tsx
@@ -4183,12 +4207,10 @@ import {
4183
4207
  forwardRef,
4184
4208
  useImperativeHandle
4185
4209
  } from "react";
4186
- import { useDynamicFlow as useDynamicFlow2 } from "@wise/dynamic-flow-client";
4187
- import { jsx as jsx90 } from "react/jsx-runtime";
4210
+ import { jsx as jsx91 } from "react/jsx-runtime";
4188
4211
  var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
4189
4212
  const { className = "" } = props;
4190
- const dfProps = useWiseToCoreProps(props);
4191
- const df = useDynamicFlow2(dfProps);
4213
+ const df = useDynamicFlowWise(props);
4192
4214
  useImperativeHandle(
4193
4215
  ref,
4194
4216
  () => ({
@@ -4200,7 +4222,7 @@ var DynamicFlowWithRef = forwardRef(function DynamicFlowWithRef2(props, ref) {
4200
4222
  }),
4201
4223
  [df]
4202
4224
  );
4203
- return /* @__PURE__ */ jsx90("div", { className, children: df.view });
4225
+ return /* @__PURE__ */ jsx91("div", { className, children: df.view });
4204
4226
  });
4205
4227
 
4206
4228
  // src/index.ts
@@ -5080,7 +5102,9 @@ export {
5080
5102
  findRendererPropsByType,
5081
5103
  getMargin2 as getMargin,
5082
5104
  makeHttpClient as makeCustomFetch,
5083
- i18n_default as translations
5105
+ i18n_default as translations,
5106
+ useDynamicFlowModalWise,
5107
+ useDynamicFlowWise
5084
5108
  };
5085
5109
  /*! Bundled license information:
5086
5110
 
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFlow.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAElF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC;AAEP,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,2CAKtD"}
1
+ {"version":3,"file":"DynamicFlow.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,MAAM,YAAY,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAElF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI;KACvB,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CACrB,GAAG,EAAE,CAAC;AAEP,wBAAgB,WAAW,CAAC,KAAK,EAAE,oBAAoB,2CAItD"}
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFlowModal.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlowModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,2CAa3D"}
1
+ {"version":3,"file":"DynamicFlowModal.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlowModal.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,oBAAoB,2CAY3D"}
@@ -1 +1 @@
1
- {"version":3,"file":"DynamicFlowWithRef.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlowWithRef.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,KAAK,yBAAyB,EAE9B,KAAK,aAAa,EAGnB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAInE,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE5F,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AACF;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CACxD,uBAAuB,GAAG,aAAa,CAAC,cAAc,CAAC,CAmBvD,CAAC"}
1
+ {"version":3,"file":"DynamicFlowWithRef.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/DynamicFlowWithRef.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACL,KAAK,yBAAyB,EAE9B,KAAK,aAAa,EAGnB,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG;IAAE,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAE5F,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC;;OAEG;IACH,QAAQ,EAAE,MAAM,OAAO,CAAC;CACzB,CAAC;AACF;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CACxD,uBAAuB,GAAG,aAAa,CAAC,cAAc,CAAC,CAiBvD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getMergedRenderers.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/getMergedRenderers.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,eAAO,MAAM,kBAAkB,GAAI,OAAO,oBAAoB,KAAG,SAwBhE,CAAC"}
1
+ {"version":3,"file":"getMergedRenderers.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/getMergedRenderers.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAEpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAK9D,eAAO,MAAM,kBAAkB,GAAI,OAAO,oBAAoB,KAAG,SA0BhE,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { DynamicFlowWiseProps } from './DynamicFlowWiseProps';
2
+ /**
3
+ * @experimental This hook may be changed or removed in the future without notice.
4
+ */
5
+ export declare const useDynamicFlowWise: (props: DynamicFlowWiseProps) => {
6
+ controller: {
7
+ getSubmittableValue: () => Promise<import("@wise/dynamic-flow-types/spec").JsonElement>;
8
+ validate: () => boolean;
9
+ rendererProps: import("@wise/dynamic-flow-types/renderers").RendererProps;
10
+ cancel: () => void;
11
+ };
12
+ view: import("react/jsx-runtime").JSX.Element;
13
+ };
14
+ /**
15
+ * @experimental This hook may be changed or removed in the future without notice.
16
+ */
17
+ export declare const useDynamicFlowModalWise: (props: DynamicFlowWiseProps) => {
18
+ modal: {
19
+ body: import("react/jsx-runtime").JSX.Element;
20
+ open: boolean;
21
+ onClose: () => void;
22
+ onUnmount: () => void;
23
+ };
24
+ controller: {
25
+ getSubmittableValue: () => Promise<import("@wise/dynamic-flow-types/spec").JsonElement>;
26
+ validate: () => boolean;
27
+ rendererProps: import("@wise/dynamic-flow-types/renderers").RendererProps;
28
+ cancel: () => void;
29
+ };
30
+ view: import("react/jsx-runtime").JSX.Element;
31
+ };
32
+ //# sourceMappingURL=useDynamicFlowWise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDynamicFlowWise.d.ts","sourceRoot":"","sources":["../../../src/dynamicFlow/useDynamicFlowWise.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnE;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,OAAO,oBAAoB;;;;;;;;CAG7D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,oBAAoB;;;;;;;;;;;;;;CAGlE,CAAC"}
@@ -2,6 +2,7 @@ export { makeHttpClient as makeCustomFetch } from '@wise/dynamic-flow-client';
2
2
  export type { DynamicFlowWiseProps as DynamicFlowProps } from './dynamicFlow/DynamicFlowWiseProps';
3
3
  export { DynamicFlow } from './dynamicFlow/DynamicFlow';
4
4
  export { DynamicFlowWithRef, type DynamicFlowRef } from './dynamicFlow/DynamicFlowWithRef';
5
+ export { useDynamicFlowWise, useDynamicFlowModalWise } from './dynamicFlow/useDynamicFlowWise';
5
6
  export { findRendererPropsByType } from '@wise/dynamic-flow-client';
6
7
  export { getMargin, Header, Media } from './dynamicFlow/renderers';
7
8
  export { default as translations } from './i18n';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9E,YAAY,EAAE,oBAAoB,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAE3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,IAAI,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9E,YAAY,EAAE,oBAAoB,IAAI,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAEnG,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,KAAK,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAE/F,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client-internal",
3
- "version": "5.8.1",
3
+ "version": "5.9.0-experimental-rendererprops-9c9a4b8",
4
4
  "description": "Dynamic Flow web client for Wise",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.js",
@@ -49,7 +49,6 @@
49
49
  "@types/react-dom": "18.3.7",
50
50
  "@wise/art": "2.27.0",
51
51
  "@wise/components-theming": "^1.10.0",
52
- "currency-flags": "4.0.7",
53
52
  "esbuild": "0.27.0",
54
53
  "eslint-plugin-storybook": "10.2.7",
55
54
  "framer-motion": "^12.33.0",
@@ -70,8 +69,8 @@
70
69
  "vitest": "4.0.18",
71
70
  "vitest-fetch-mock": "0.4.5",
72
71
  "@wise/dynamic-flow-fixtures": "0.0.1",
73
- "@wise/dynamic-flow-types": "4.8.1",
74
- "@wise/dynamic-flow-renderers": "0.0.0"
72
+ "@wise/dynamic-flow-renderers": "0.0.0",
73
+ "@wise/dynamic-flow-types": "4.9.0-experimental-rendererprops-9c9a4b8"
75
74
  },
76
75
  "peerDependencies": {
77
76
  "@transferwise/components": "^46.104.0",
@@ -85,8 +84,8 @@
85
84
  "react-intl": "^6 || ^7"
86
85
  },
87
86
  "dependencies": {
88
- "@wise/dynamic-flow-client": "5.8.1",
89
- "@wise/dynamic-flow-types": "4.8.1"
87
+ "@wise/dynamic-flow-client": "5.9.0-experimental-rendererprops-9c9a4b8",
88
+ "@wise/dynamic-flow-types": "4.9.0-experimental-rendererprops-9c9a4b8"
90
89
  },
91
90
  "scripts": {
92
91
  "dev": "pnpm build:visual-tests && storybook dev -p 3005",