@wise/dynamic-flow-client 5.18.0-exp-scroll-to-errors-d7a48a2 → 5.18.0

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
@@ -7476,20 +7476,11 @@ var createFlowController = (props) => {
7476
7476
  };
7477
7477
 
7478
7478
  // src/domain/mappers/utils/FeatureFlags.ts
7479
- var defaultFeatures = {
7480
- pinnedButtons: false,
7481
- nativeBack: false,
7482
- hideStepTitle: false,
7483
- strictButtonOperations: false,
7484
- continueAfterCompletion: false,
7485
- validateUnreferencedSchemas: false,
7486
- scrollToErrors: true
7487
- };
7488
7479
  var _features;
7489
7480
  var FeatureFlags = class {
7490
7481
  constructor(features) {
7491
7482
  __privateAdd(this, _features);
7492
- __privateSet(this, _features, __spreadValues(__spreadValues({}, defaultFeatures), features));
7483
+ __privateSet(this, _features, features);
7493
7484
  }
7494
7485
  isEnabled(featureName) {
7495
7486
  return __privateGet(this, _features)[featureName] != null && __privateGet(this, _features)[featureName] !== false;
@@ -8679,7 +8670,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
8679
8670
  toolbar: getToolbarProps(component.toolbar, restMapperProps),
8680
8671
  error,
8681
8672
  __rawStep: step,
8682
- title: restMapperProps.features.isEnabled("hideStepTitle") ? "" : title,
8673
+ title: restMapperProps.features.hideStepTitle === true ? "" : title,
8683
8674
  tags,
8684
8675
  children: childrenProps.map(rendererMapperProps.render),
8685
8676
  childrenProps,
@@ -8834,7 +8825,7 @@ function useStableCallback(handler) {
8834
8825
  var import_jsx_runtime8 = require("react/jsx-runtime");
8835
8826
  var className = "dynamic-flow";
8836
8827
  function useDynamicFlow(props) {
8837
- var _a, _b;
8828
+ var _a, _b, _c;
8838
8829
  const { flowId, renderers } = props;
8839
8830
  const normalisedFlowId = normaliseFlowId(flowId);
8840
8831
  const scrollToTop = (0, import_react3.useMemo)(
@@ -8897,15 +8888,14 @@ function useDynamicFlow(props) {
8897
8888
  const tree = rootComponentToProps(
8898
8889
  rootComponent,
8899
8890
  {
8900
- features,
8891
+ features: (_a = props.features) != null ? _a : {},
8901
8892
  render,
8902
8893
  httpClient,
8903
- trackEvent: (_a = rootComponent.getTrackEvent()) != null ? _a : (() => {
8894
+ trackEvent: (_b = rootComponent.getTrackEvent()) != null ? _b : (() => {
8904
8895
  }),
8905
- stepLoadingState: rootComponent.getLoadingState(),
8906
- isFeatureEnabled: features.isEnabled.bind(features)
8896
+ stepLoadingState: rootComponent.getLoadingState()
8907
8897
  },
8908
- (_b = props.nativeSubflowHandlers) != null ? _b : []
8898
+ (_c = props.nativeSubflowHandlers) != null ? _c : []
8909
8899
  );
8910
8900
  return {
8911
8901
  controller: {
package/build/main.mjs CHANGED
@@ -7445,20 +7445,11 @@ var createFlowController = (props) => {
7445
7445
  };
7446
7446
 
7447
7447
  // src/domain/mappers/utils/FeatureFlags.ts
7448
- var defaultFeatures = {
7449
- pinnedButtons: false,
7450
- nativeBack: false,
7451
- hideStepTitle: false,
7452
- strictButtonOperations: false,
7453
- continueAfterCompletion: false,
7454
- validateUnreferencedSchemas: false,
7455
- scrollToErrors: true
7456
- };
7457
7448
  var _features;
7458
7449
  var FeatureFlags = class {
7459
7450
  constructor(features) {
7460
7451
  __privateAdd(this, _features);
7461
- __privateSet(this, _features, __spreadValues(__spreadValues({}, defaultFeatures), features));
7452
+ __privateSet(this, _features, features);
7462
7453
  }
7463
7454
  isEnabled(featureName) {
7464
7455
  return __privateGet(this, _features)[featureName] != null && __privateGet(this, _features)[featureName] !== false;
@@ -8648,7 +8639,7 @@ var stepComponentToProps = (component, rendererMapperProps) => {
8648
8639
  toolbar: getToolbarProps(component.toolbar, restMapperProps),
8649
8640
  error,
8650
8641
  __rawStep: step,
8651
- title: restMapperProps.features.isEnabled("hideStepTitle") ? "" : title,
8642
+ title: restMapperProps.features.hideStepTitle === true ? "" : title,
8652
8643
  tags,
8653
8644
  children: childrenProps.map(rendererMapperProps.render),
8654
8645
  childrenProps,
@@ -8803,7 +8794,7 @@ function useStableCallback(handler) {
8803
8794
  import { jsx as jsx8 } from "react/jsx-runtime";
8804
8795
  var className = "dynamic-flow";
8805
8796
  function useDynamicFlow(props) {
8806
- var _a, _b;
8797
+ var _a, _b, _c;
8807
8798
  const { flowId, renderers } = props;
8808
8799
  const normalisedFlowId = normaliseFlowId(flowId);
8809
8800
  const scrollToTop = useMemo(
@@ -8866,15 +8857,14 @@ function useDynamicFlow(props) {
8866
8857
  const tree = rootComponentToProps(
8867
8858
  rootComponent,
8868
8859
  {
8869
- features,
8860
+ features: (_a = props.features) != null ? _a : {},
8870
8861
  render,
8871
8862
  httpClient,
8872
- trackEvent: (_a = rootComponent.getTrackEvent()) != null ? _a : (() => {
8863
+ trackEvent: (_b = rootComponent.getTrackEvent()) != null ? _b : (() => {
8873
8864
  }),
8874
- stepLoadingState: rootComponent.getLoadingState(),
8875
- isFeatureEnabled: features.isEnabled.bind(features)
8865
+ stepLoadingState: rootComponent.getLoadingState()
8876
8866
  },
8877
- (_b = props.nativeSubflowHandlers) != null ? _b : []
8867
+ (_c = props.nativeSubflowHandlers) != null ? _c : []
8878
8868
  );
8879
8869
  return {
8880
8870
  controller: {