@mxenabled/connect-widget 1.0.0 → 1.2.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
  });
@@ -69363,15 +69381,23 @@ const ConnectLogoHeader = (props) => {
69363
69381
  const tokens = useTokens();
69364
69382
  const styles = getStyles$M();
69365
69383
  const defaultInstitutionImage = () => colorScheme === COLOR_SCHEME.LIGHT ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { borderRadius: tokens.BorderRadius.Large }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderInstitutionLight, {}) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { borderRadius: tokens.BorderRadius.Large }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderInstitutionDark, {}) });
69384
+ const defaultAggregatorLogo = () => colorScheme === COLOR_SCHEME.LIGHT ? /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderBackdropLight, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderBackdropDark, {});
69366
69385
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "aria-hidden": true, style: styles.container, children: [
69367
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-test": "mxLogo", style: styles.backdropImage, children: colorScheme === COLOR_SCHEME.LIGHT ? /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderBackdropLight, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(SvgConnectHeaderBackdropDark, {}) }),
69386
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-test": "mxLogo", style: styles.backdropImage, children: props?.institution?.aggregator_logo_url ? /* @__PURE__ */ jsxRuntimeExports.jsx(
69387
+ "img",
69388
+ {
69389
+ alt: "aggregator logo",
69390
+ src: props.institution.aggregator_logo_url,
69391
+ style: styles.aggregatorLogo
69392
+ }
69393
+ ) : defaultAggregatorLogo() }),
69368
69394
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.clientLogo, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ClientLogo, { alt: "Client logo", clientGuid, size: 64 }) }),
69369
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.institutionLogo, children: props.institutionGuid ? /* @__PURE__ */ jsxRuntimeExports.jsx(
69395
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.institutionLogo, children: props?.institution?.guid ? /* @__PURE__ */ jsxRuntimeExports.jsx(
69370
69396
  De,
69371
69397
  {
69372
69398
  alt: "Institution logo",
69373
- institutionGuid: props.institutionGuid,
69374
- logoUrl: props.institutionLogo,
69399
+ institutionGuid: props.institution.guid,
69400
+ logoUrl: props.institution.logo_url,
69375
69401
  size: 64,
69376
69402
  style: { borderRadius: tokens.BorderRadius.Large }
69377
69403
  }
@@ -69411,6 +69437,12 @@ const getStyles$M = () => {
69411
69437
  width: maxHeight,
69412
69438
  marginLeft: "80px",
69413
69439
  zIndex: 20
69440
+ },
69441
+ aggregatorLogo: {
69442
+ width: "88px",
69443
+ height: "80px",
69444
+ zIndex: 10,
69445
+ position: "relative"
69414
69446
  }
69415
69447
  };
69416
69448
  };
@@ -69740,7 +69772,7 @@ const DisclosureInterstitial = React__default.forwardRef((props, interstitialNav
69740
69772
  return /* @__PURE__ */ jsxRuntimeExports.jsx(DataAvailable, {});
69741
69773
  }
69742
69774
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
69743
- /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectLogoHeader, { institutionGuid: institution.guid }) }) }),
69775
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectLogoHeader, { institution }) }) }),
69744
69776
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
69745
69777
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.flexGroup, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
69746
69778
  x,
@@ -71554,13 +71586,7 @@ const Connecting = (props) => {
71554
71586
  }
71555
71587
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { ref: connectingRef, style: styles.container, children: [
71556
71588
  /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
71557
- /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
71558
- ConnectLogoHeader,
71559
- {
71560
- institutionGuid: institution.guid,
71561
- institutionLogo: institution.logo_url
71562
- }
71563
- ) }),
71589
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectLogoHeader, { institution }) }),
71564
71590
  /* @__PURE__ */ jsxRuntimeExports.jsx(x, { component: "h2", style: styles.subHeader, truncate: false, variant: "H2", children: __("Connecting to %1", institution.name) })
71565
71591
  ] }),
71566
71592
  /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ProgressBar, { jobSchedule }) }),
@@ -76826,6 +76852,7 @@ const AdditionalProductStep = React__default.forwardRef(
76826
76852
  }
76827
76853
  }, navigationRef) => {
76828
76854
  const selectedInstitution = useSelector(getSelectedInstitution);
76855
+ const { add_aggregation = {}, add_verification = {} } = useSelector(selectLocalizedContent)?.connect?.additional_product_screen || {};
76829
76856
  useImperativeHandle(navigationRef, () => {
76830
76857
  return {
76831
76858
  showBackButton() {
@@ -76835,20 +76862,20 @@ const AdditionalProductStep = React__default.forwardRef(
76835
76862
  }, []);
76836
76863
  const getNextDelay = getDelay();
76837
76864
  const addAggregationText = {
76838
- title: __("Add financial management?"),
76839
- body: __(
76865
+ title: add_aggregation?.title || __("Add financial management?"),
76866
+ body: add_aggregation?.body || __(
76840
76867
  "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
76868
  ),
76842
- acceptButtonText: __("Yes, add financial management"),
76843
- rejectButtonText: __("No, only add transfers and payments")
76869
+ acceptButtonText: add_aggregation?.button_1 || __("Yes, add financial management"),
76870
+ rejectButtonText: add_aggregation?.button_2 || __("No, only add transfers and payments")
76844
76871
  };
76845
76872
  const addVerificationText = {
76846
- title: __("Add transfers and payments?"),
76847
- body: __(
76873
+ title: add_verification?.title || __("Add transfers and payments?"),
76874
+ body: add_verification?.body || __(
76848
76875
  "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
76876
  ),
76850
- acceptButtonText: __("Yes, add transfers and payments"),
76851
- rejectButtonText: __("No, only add financial management")
76877
+ acceptButtonText: add_verification?.button_1 || __("Yes, add transfers and payments"),
76878
+ rejectButtonText: add_verification?.button_2 || __("No, only add financial management")
76852
76879
  };
76853
76880
  const componentText = additionalProductName === COMBO_JOB_DATA_TYPES.TRANSACTIONS ? addAggregationText : addVerificationText;
76854
76881
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(SlideDown, { delay: getNextDelay(), children: [
@@ -77200,7 +77227,7 @@ const DynamicDisclosure = React__default.forwardRef(
77200
77227
  }
77201
77228
  );
77202
77229
  return /* @__PURE__ */ jsxRuntimeExports.jsx(StickyComponentContainer, { footer, footerStyle: { borderTop: "" }, ref: containerRef, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Fragment, { children: [
77203
- /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectLogoHeader, { institutionGuid: institution.guid }) }) }),
77230
+ /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: styles.logoHeader, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectLogoHeader, { institution }) }) }),
77204
77231
  /* @__PURE__ */ jsxRuntimeExports.jsx(SlideDown, { delay: getNextDelay(), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
77205
77232
  x,
77206
77233
  {
@@ -81254,6 +81281,9 @@ const reducer = (state, action) => {
81254
81281
 
81255
81282
  const PostMessageContext = createContext({ onPostMessage: () => {
81256
81283
  } });
81284
+ function setupLocalizedContent(localizedContent) {
81285
+ Store.dispatch(setLocalizedContent(localizedContent));
81286
+ }
81257
81287
  const ConnectWidget = ({
81258
81288
  onPostMessage = () => {
81259
81289
  },
@@ -81264,6 +81294,9 @@ const ConnectWidget = ({
81264
81294
  ...props
81265
81295
  }) => {
81266
81296
  initGettextLocaleData(props.language);
81297
+ useEffect(() => {
81298
+ setupLocalizedContent(props?.language?.localizedContent || {});
81299
+ }, []);
81267
81300
  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
81301
  showTooSmallDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(TooSmallDialog, { onAnalyticPageview }),
81269
81302
  /* @__PURE__ */ jsxRuntimeExports.jsx(Connect$2, { onAnalyticPageview, ...props })