@mxenabled/connect-widget 1.0.0 → 1.1.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/dist/index.es.js CHANGED
@@ -8983,7 +8983,7 @@ const COMBO_JOB_DATA_TYPES = {
8983
8983
  TRANSACTIONS: "transactions",
8984
8984
  REWARDS: "rewards"};
8985
8985
 
8986
- const initialState$5 = {
8986
+ const initialState$6 = {
8987
8987
  _initialValues: "",
8988
8988
  is_mobile_webview: false,
8989
8989
  target_origin_referrer: null,
@@ -9011,7 +9011,7 @@ const initialState$5 = {
9011
9011
  };
9012
9012
  const configSlice = createSlice({
9013
9013
  name: "config",
9014
- initialState: initialState$5,
9014
+ initialState: initialState$6,
9015
9015
  reducers: {
9016
9016
  addVerificationData: (state) => {
9017
9017
  if (state.mode === AGG_MODE) {
@@ -9138,9 +9138,9 @@ function _additionalProductReset(state) {
9138
9138
  const initialValuesObject = convertInitialValuesToObject(state._initialValues);
9139
9139
  return {
9140
9140
  ...state,
9141
- include_transactions: initialValuesObject?.include_transactions ?? initialState$5.include_transactions,
9142
- mode: initialValuesObject?.mode ?? initialState$5.mode,
9143
- use_cases: initialValuesObject?.use_cases ?? initialState$5.use_cases
9141
+ include_transactions: initialValuesObject?.include_transactions ?? initialState$6.include_transactions,
9142
+ mode: initialValuesObject?.mode ?? initialState$6.mode,
9143
+ use_cases: initialValuesObject?.use_cases ?? initialState$6.use_cases
9144
9144
  };
9145
9145
  }
9146
9146
  const { addVerificationData, addAggregationData, additionalProductReset } = configSlice.actions;
@@ -9654,7 +9654,7 @@ const connect = createReducer(defaultState$1, {
9654
9654
  [addAggregationData().type]: continueAfterAdditionalProduct
9655
9655
  });
9656
9656
 
9657
- const initialState$4 = {
9657
+ const initialState$5 = {
9658
9658
  loading: true,
9659
9659
  client: {},
9660
9660
  clientColorScheme: {
@@ -9673,7 +9673,7 @@ const initialState$4 = {
9673
9673
  };
9674
9674
  const profilesSlice = createSlice({
9675
9675
  name: "profiles",
9676
- initialState: initialState$4,
9676
+ initialState: initialState$5,
9677
9677
  reducers: {
9678
9678
  loadProfiles: (state, action) => {
9679
9679
  const {
@@ -9716,12 +9716,12 @@ const isFeatureEnabled = (userFeatures, featureName) => {
9716
9716
  const CONNECT_COMBO_JOBS = "CONNECT_COMBO_JOBS";
9717
9717
  const CONNECT_CONSENT = "CONNECT_CONSENT";
9718
9718
 
9719
- const initialState$3 = {
9719
+ const initialState$4 = {
9720
9720
  items: []
9721
9721
  };
9722
9722
  const userFeaturesSlice = createSlice({
9723
9723
  name: "userFeatures",
9724
- initialState: initialState$3,
9724
+ initialState: initialState$4,
9725
9725
  reducers: {
9726
9726
  loadUserFeatures(state, action) {
9727
9727
  state.items = action.payload;
@@ -13024,7 +13024,7 @@ const browser = (state = { height: 0, isMobile: false, isTablet: false, size: ""
13024
13024
  }
13025
13025
  };
13026
13026
 
13027
- const initialState$2 = {
13027
+ const initialState$3 = {
13028
13028
  currentSession: {},
13029
13029
  featureVisit: {},
13030
13030
  path: [],
@@ -13032,7 +13032,7 @@ const initialState$2 = {
13032
13032
  };
13033
13033
  const analyticsSlice = createSlice({
13034
13034
  name: "analytics",
13035
- initialState: initialState$2,
13035
+ initialState: initialState$3,
13036
13036
  reducers: {
13037
13037
  analyticsSessionInitialized: (state, action) => {
13038
13038
  state.currentSession = action.payload;
@@ -13056,12 +13056,30 @@ const {
13056
13056
  } = analyticsSlice.actions;
13057
13057
  const analyticsSlice$1 = analyticsSlice.reducer;
13058
13058
 
13059
+ const initialState$2 = {};
13060
+ const localizedContentSlice = createSlice({
13061
+ name: "localizedContent",
13062
+ initialState: initialState$2,
13063
+ reducers: {
13064
+ setLocalizedContent(_state, action) {
13065
+ return action.payload;
13066
+ }
13067
+ }
13068
+ });
13069
+ const { setLocalizedContent } = localizedContentSlice.actions;
13070
+ const localizedContentSlice$1 = localizedContentSlice.reducer;
13071
+ const selectLocalizedContent = createSelector(
13072
+ (state) => state.localizedContent,
13073
+ (localizedContent) => localizedContent
13074
+ );
13075
+
13059
13076
  const rootReducer = combineReducers({
13060
13077
  analytics: analyticsSlice$1,
13061
13078
  app,
13062
13079
  browser,
13063
13080
  config: configSlice$1,
13064
13081
  connect,
13082
+ localizedContent: localizedContentSlice$1,
13065
13083
  profiles: profilesSlice$1,
13066
13084
  userFeatures: userFeaturesSlice$1
13067
13085
  });
@@ -76826,6 +76844,7 @@ const AdditionalProductStep = React__default.forwardRef(
76826
76844
  }
76827
76845
  }, navigationRef) => {
76828
76846
  const selectedInstitution = useSelector(getSelectedInstitution);
76847
+ const { add_aggregation = {}, add_verification = {} } = useSelector(selectLocalizedContent)?.connect?.additional_product_screen || {};
76829
76848
  useImperativeHandle(navigationRef, () => {
76830
76849
  return {
76831
76850
  showBackButton() {
@@ -76835,20 +76854,20 @@ const AdditionalProductStep = React__default.forwardRef(
76835
76854
  }, []);
76836
76855
  const getNextDelay = getDelay();
76837
76856
  const addAggregationText = {
76838
- title: __("Add financial management?"),
76839
- body: __(
76857
+ title: add_aggregation?.title || __("Add financial management?"),
76858
+ body: add_aggregation?.body || __(
76840
76859
  "You're connecting this account for payments and transfers. Would you like to also enable financial management so you can track your income and spending?"
76841
76860
  ),
76842
- acceptButtonText: __("Yes, add financial management"),
76843
- rejectButtonText: __("No, only add transfers and payments")
76861
+ acceptButtonText: add_aggregation?.button_1 || __("Yes, add financial management"),
76862
+ rejectButtonText: add_aggregation?.button_2 || __("No, only add transfers and payments")
76844
76863
  };
76845
76864
  const addVerificationText = {
76846
- title: __("Add transfers and payments?"),
76847
- body: __(
76865
+ title: add_verification?.title || __("Add transfers and payments?"),
76866
+ body: add_verification?.body || __(
76848
76867
  "You're connecting this account for financial management. Would you like to also enable transfers and payments so you can quickly move money to and from this institution?"
76849
76868
  ),
76850
- acceptButtonText: __("Yes, add transfers and payments"),
76851
- rejectButtonText: __("No, only add financial management")
76869
+ acceptButtonText: add_verification?.button_1 || __("Yes, add transfers and payments"),
76870
+ rejectButtonText: add_verification?.button_2 || __("No, only add financial management")
76852
76871
  };
76853
76872
  const componentText = additionalProductName === COMBO_JOB_DATA_TYPES.TRANSACTIONS ? addAggregationText : addVerificationText;
76854
76873
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
@@ -81254,6 +81273,9 @@ const reducer = (state, action) => {
81254
81273
 
81255
81274
  const PostMessageContext = createContext({ onPostMessage: () => {
81256
81275
  } });
81276
+ function setupLocalizedContent(localizedContent) {
81277
+ Store.dispatch(setLocalizedContent(localizedContent));
81278
+ }
81257
81279
  const ConnectWidget = ({
81258
81280
  onPostMessage = () => {
81259
81281
  },
@@ -81264,6 +81286,9 @@ const ConnectWidget = ({
81264
81286
  ...props
81265
81287
  }) => {
81266
81288
  initGettextLocaleData(props.language);
81289
+ useEffect(() => {
81290
+ setupLocalizedContent(props?.language?.localizedContent || {});
81291
+ }, []);
81267
81292
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider_default, { store: Store, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectedTokenProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PostMessageContext.Provider, { value: { onPostMessage, postMessageEventOverrides }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(WidgetDimensionObserver, { heightOffset: 0, children: [
81268
81293
  showTooSmallDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(TooSmallDialog, { onAnalyticPageview }),
81269
81294
  /* @__PURE__ */ jsxRuntimeExports.jsx(Connect$2, { onAnalyticPageview, ...props })