@mxenabled/connect-widget 0.0.2 → 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 +6 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +40 -21
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install @mxenabled/connect-widget
|
|
|
19
19
|
3. Pass applicable props to widget and your API to the provider.
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
22
|
-
import ConnectWidget, { ApiProvider } from 'connect-widget'
|
|
22
|
+
import ConnectWidget, { ApiProvider } from '@mxenabled/connect-widget'
|
|
23
23
|
import apiService from './apiService' // You custom api service
|
|
24
24
|
|
|
25
25
|
const App = () => {
|
|
@@ -66,7 +66,7 @@ You need to pass an object containing API endpoint callbacks as the `apiValue` p
|
|
|
66
66
|
For developing this package locally, we suggest you use npm link to connect your local version of the package to your client app using the package.
|
|
67
67
|
|
|
68
68
|
1. In the npm package root, run `npm link`.
|
|
69
|
-
2. Then in your consumer project, run `npm link connect-widget`.
|
|
69
|
+
2. Then in your consumer project, run `npm link @mxenabled/connect-widget`.
|
|
70
70
|
|
|
71
71
|
This will link the local package to your project in the node modules. Unlink the package when you are finished or if you run into issues.
|
|
72
72
|
|
|
@@ -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)
|
package/dist/index.d.ts
ADDED
|
@@ -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(
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
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 = (
|
|
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 (
|
|
49962
|
-
|
|
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
|
|
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
|
|
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
|
|
50046
|
-
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
|
-
|
|
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
|
|
50098
|
+
availableAccountTypes,
|
|
50081
50099
|
handleAddManualAccountClick: _handleAddManualAccountClick,
|
|
50082
50100
|
handleCredentialsGoBack: _handleCredentialsGoBack,
|
|
50083
50101
|
handleOAuthGoBack: _handleOAuthGoBack,
|
|
50084
50102
|
navigationRef: _handleStepDOMChange,
|
|
50085
|
-
onManualAccountAdded
|
|
50086
|
-
onSuccessfulAggregation
|
|
50087
|
-
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(
|
|
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 })
|