@mxenabled/connect-widget 0.0.3 → 0.0.4

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/README.md CHANGED
@@ -75,3 +75,7 @@ This will link the local package to your project in the node modules. Unlink the
75
75
  Pull requests are welcome. Please open an issue first to discuss what you would like to change.
76
76
 
77
77
  Make sure to add/update tests, translations, and documentation as appropriate.
78
+
79
+ ## Changelog
80
+
81
+ View our changelog [here](./CHANGELOG.md)
@@ -0,0 +1 @@
1
+ export { }
package/dist/index.es.js CHANGED
@@ -9573,14 +9573,17 @@ const configSlice = createSlice({
9573
9573
  initialState: initialState$5,
9574
9574
  reducers: {},
9575
9575
  extraReducers(builder) {
9576
- builder.addCase(ActionTypes$4.LOAD_CONNECT, (state, action) => {
9577
- const productDetermineMode = getProductDeterminedMode(action.payload);
9578
- return {
9579
- ...state,
9580
- ...action.payload,
9581
- mode: productDetermineMode !== null ? productDetermineMode : action.payload.mode || state.mode
9582
- };
9583
- });
9576
+ builder.addCase(
9577
+ ActionTypes$4.LOAD_CONNECT,
9578
+ (state, action) => {
9579
+ const productDetermineMode = getProductDeterminedMode(action.payload);
9580
+ return {
9581
+ ...state,
9582
+ ...action.payload,
9583
+ mode: productDetermineMode !== null ? productDetermineMode : action.payload.mode || state.mode
9584
+ };
9585
+ }
9586
+ );
9584
9587
  }
9585
9588
  });
9586
9589
  const selectConfig = (state) => state.config;
@@ -49876,7 +49879,22 @@ const AnalyticContext = createContext({
49876
49879
  onAnalyticPageview: () => {
49877
49880
  }
49878
49881
  });
49879
- const Connect$2 = (props) => {
49882
+ const Connect$2 = ({
49883
+ availableAccountTypes = [],
49884
+ onManualAccountAdded = () => {
49885
+ },
49886
+ onMemberDeleted = () => {
49887
+ },
49888
+ onSuccessfulAggregation = () => {
49889
+ },
49890
+ onUpsertMember = () => {
49891
+ },
49892
+ onAnalyticEvent = () => {
49893
+ },
49894
+ onAnalyticPageview = () => {
49895
+ },
49896
+ ...props
49897
+ }) => {
49880
49898
  const connectConfig = useSelector(selectConnectConfig);
49881
49899
  const experimentDetails = getActiveABExperimentDetails(
49882
49900
  useSelector(getExperimentNamesToUserVariantMap),
@@ -49958,8 +49976,8 @@ const Connect$2 = (props) => {
49958
49976
  metadata.current_institution_guid = config.current_institution_guid;
49959
49977
  if (!_isNil(config.current_institution_code))
49960
49978
  metadata.current_institution_code = config.current_institution_code;
49961
- if (props.onAnalyticEvent) {
49962
- props.onAnalyticEvent(`connect_${AnalyticEvents.WIDGET_LOAD}`, {
49979
+ if (onAnalyticEvent) {
49980
+ onAnalyticEvent(`connect_${AnalyticEvents.WIDGET_LOAD}`, {
49963
49981
  ...defaultEventMetadata,
49964
49982
  ...metadata
49965
49983
  });
@@ -50023,7 +50041,7 @@ const Connect$2 = (props) => {
50023
50041
  const invalidVerifyMode = IS_IN_VERIFY_MODE && !isVerificationEnabled;
50024
50042
  if (invalidVerifyMode || invalidTaxMode) {
50025
50043
  const title = IS_IN_TAX_MODE ? __("Oops! Tax statements must be enabled to use this feature.") : __("Oops! Verification must be enabled to use this feature.");
50026
- return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericError, { onAnalyticPageview: props.onAnalyticPageview, title });
50044
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(GenericError, { onAnalyticPageview, title });
50027
50045
  }
50028
50046
  if (isLoading) {
50029
50047
  return /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingSpinner, { showText: true });
@@ -50033,7 +50051,7 @@ const Connect$2 = (props) => {
50033
50051
  GenericError,
50034
50052
  {
50035
50053
  loadError,
50036
- onAnalyticPageview: props.onAnalyticPageview,
50054
+ onAnalyticPageview,
50037
50055
  title: loadError.message
50038
50056
  }
50039
50057
  );
@@ -50042,8 +50060,8 @@ const Connect$2 = (props) => {
50042
50060
  AnalyticContext.Provider,
50043
50061
  {
50044
50062
  value: {
50045
- onAnalyticEvent: props.onAnalyticEvent,
50046
- onAnalyticPageview: props.onAnalyticPageview
50063
+ onAnalyticEvent,
50064
+ onAnalyticPageview
50047
50065
  },
50048
50066
  children: /* @__PURE__ */ jsxRuntimeExports.jsx(TokenContext.Consumer, { children: (tokens) => {
50049
50067
  const styles = getStyles$1(tokens);
@@ -50059,7 +50077,7 @@ const Connect$2 = (props) => {
50059
50077
  postMessageFunctions.onPostMessage("connect/memberDeleted", {
50060
50078
  member_guid: deletedMember.guid
50061
50079
  });
50062
- props.onMemberDeleted(deletedMember.guid);
50080
+ onMemberDeleted(deletedMember.guid);
50063
50081
  setState((prevState) => {
50064
50082
  dispatch(stepToDeleteMemberSuccess$1(deletedMember.guid));
50065
50083
  return { ...prevState, memberToDelete: null };
@@ -50077,14 +50095,14 @@ const Connect$2 = (props) => {
50077
50095
  /* @__PURE__ */ jsxRuntimeExports.jsx(
50078
50096
  RenderConnectStep,
50079
50097
  {
50080
- availableAccountTypes: props.availableAccountTypes,
50098
+ availableAccountTypes,
50081
50099
  handleAddManualAccountClick: _handleAddManualAccountClick,
50082
50100
  handleCredentialsGoBack: _handleCredentialsGoBack,
50083
50101
  handleOAuthGoBack: _handleOAuthGoBack,
50084
50102
  navigationRef: _handleStepDOMChange,
50085
- onManualAccountAdded: props.onManualAccountAdded,
50086
- onSuccessfulAggregation: props.onSuccessfulAggregation,
50087
- onUpsertMember: props.onUpsertMember,
50103
+ onManualAccountAdded,
50104
+ onSuccessfulAggregation,
50105
+ onUpsertMember,
50088
50106
  setConnectLocalState: setState
50089
50107
  }
50090
50108
  )
@@ -53343,12 +53361,13 @@ const PostMessageContext = createContext({ onPostMessage: () => {
53343
53361
  const ConnectWidget = ({
53344
53362
  onPostMessage = () => {
53345
53363
  },
53364
+ language = { locale: "en", custom_copy_namespace: "" },
53346
53365
  onAnalyticPageview = () => {
53347
53366
  },
53348
53367
  showTooSmallDialog = true,
53349
53368
  ...props
53350
53369
  }) => {
53351
- initGettextLocaleData(props.language);
53370
+ initGettextLocaleData(language);
53352
53371
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider_default, { store: Store, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ConnectedTokenProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(PostMessageContext.Provider, { value: { onPostMessage }, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(WidgetDimensionObserver, { heightOffset: 0, children: [
53353
53372
  showTooSmallDialog && /* @__PURE__ */ jsxRuntimeExports.jsx(TooSmallDialog, { onAnalyticPageview }),
53354
53373
  /* @__PURE__ */ jsxRuntimeExports.jsx(Connect$2, { onAnalyticPageview, ...props })