@wise/dynamic-flow-client 3.8.0-experimental-c61d170 → 3.8.0-experimental-6700be9

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
@@ -11496,13 +11496,13 @@ var componentToRendererProps = (component, nestedContent) => {
11496
11496
 
11497
11497
  // src/revamp/renderers/getRenderFunction.tsx
11498
11498
  var import_jsx_runtime52 = require("react/jsx-runtime");
11499
- var getRenderFunction = (renderers) => {
11499
+ var getRenderFunction = (renderers2) => {
11500
11500
  function ComponentRenderer(props) {
11501
11501
  const { type } = props;
11502
11502
  if (type === "hidden") {
11503
11503
  return null;
11504
11504
  }
11505
- const renderer = renderers.find(
11505
+ const renderer = renderers2.find(
11506
11506
  ({ canRenderType, canRender = () => true }) => (
11507
11507
  // once the type is matched, we know the props are of the correct type
11508
11508
  canRenderType === type && canRender(props)
@@ -11880,7 +11880,7 @@ function useStableCallback(handler) {
11880
11880
  // src/revamp/DynamicFlowCore.tsx
11881
11881
  var import_jsx_runtime56 = require("react/jsx-runtime");
11882
11882
  function DynamicFlowCore(props) {
11883
- const _a = props, { flowId, initialAction, initialStep, renderers, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "renderers", "displayStepTitle"]);
11883
+ const _a = props, { flowId, initialAction, initialStep, renderers: renderers2, displayStepTitle = true } = _a, rest = __objRest(_a, ["flowId", "initialAction", "initialStep", "renderers", "displayStepTitle"]);
11884
11884
  const httpClient = useStableCallback(rest.httpClient);
11885
11885
  const onCompletion = useStableCallback(rest.onCompletion);
11886
11886
  const onError = useStableCallback(rest.onError);
@@ -12078,26 +12078,22 @@ function DynamicFlowCore(props) {
12078
12078
  []
12079
12079
  );
12080
12080
  const render = (0, import_react17.useMemo)(
12081
- () => getRenderFunction([CoreContainerRenderer, ...renderers, StepRenderer]),
12082
- [renderers]
12081
+ () => getRenderFunction([CoreContainerRenderer, ...renderers2, StepRenderer]),
12082
+ [renderers2]
12083
12083
  );
12084
12084
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(ErrorBoundary_default, { onError: closeWithError, children: stepComponent ? render(stepComponent) : null });
12085
12085
  }
12086
12086
 
12087
12087
  // src/revamp/DynamicFlowWise.tsx
12088
12088
  var import_jsx_runtime57 = require("react/jsx-runtime");
12089
- var wiseRenderers = getWiseRenderers();
12089
+ var renderers = getWiseRenderers();
12090
12090
  function DynamicFlowWise(props) {
12091
- const { httpClient, renderers: customRenderers } = props;
12091
+ const { httpClient } = props;
12092
12092
  const { locale } = (0, import_react_intl16.useIntl)();
12093
12093
  const wiseHttpClient = (0, import_react18.useMemo)(
12094
12094
  () => makeWiseHttpClient(httpClient, locale),
12095
12095
  [httpClient, locale]
12096
12096
  );
12097
- const renderers = (0, import_react18.useMemo)(
12098
- () => [...customRenderers != null ? customRenderers : [], ...wiseRenderers],
12099
- [customRenderers]
12100
- );
12101
12097
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(HttpClientProvider, { httpClient: wiseHttpClient, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DynamicFlowCore, __spreadProps(__spreadValues({}, props), { renderers })) });
12102
12098
  }
12103
12099
  var DynamicFlowWise_default = DynamicFlowWise;