@mxenabled/connect-widget 2.10.0 → 2.11.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 +63 -35
- package/dist/index.es.js.map +1 -1
- package/dist/lastBuild.txt +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -5099,23 +5099,39 @@ function baseFindIndex$2(array, predicate, fromIndex, fromRight) {
|
|
|
5099
5099
|
}
|
|
5100
5100
|
var _baseFindIndex = baseFindIndex$2;
|
|
5101
5101
|
|
|
5102
|
-
var
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5102
|
+
var _trimmedEndIndex;
|
|
5103
|
+
var hasRequired_trimmedEndIndex;
|
|
5104
|
+
|
|
5105
|
+
function require_trimmedEndIndex () {
|
|
5106
|
+
if (hasRequired_trimmedEndIndex) return _trimmedEndIndex;
|
|
5107
|
+
hasRequired_trimmedEndIndex = 1;
|
|
5108
|
+
var reWhitespace = /\s/;
|
|
5109
|
+
function trimmedEndIndex(string) {
|
|
5110
|
+
var index = string.length;
|
|
5111
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {
|
|
5112
|
+
}
|
|
5113
|
+
return index;
|
|
5114
|
+
}
|
|
5115
|
+
_trimmedEndIndex = trimmedEndIndex;
|
|
5116
|
+
return _trimmedEndIndex;
|
|
5108
5117
|
}
|
|
5109
|
-
var _trimmedEndIndex = trimmedEndIndex$1;
|
|
5110
5118
|
|
|
5111
|
-
var
|
|
5112
|
-
var
|
|
5113
|
-
|
|
5114
|
-
|
|
5119
|
+
var _baseTrim;
|
|
5120
|
+
var hasRequired_baseTrim;
|
|
5121
|
+
|
|
5122
|
+
function require_baseTrim () {
|
|
5123
|
+
if (hasRequired_baseTrim) return _baseTrim;
|
|
5124
|
+
hasRequired_baseTrim = 1;
|
|
5125
|
+
var trimmedEndIndex = require_trimmedEndIndex();
|
|
5126
|
+
var reTrimStart = /^\s+/;
|
|
5127
|
+
function baseTrim(string) {
|
|
5128
|
+
return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string;
|
|
5129
|
+
}
|
|
5130
|
+
_baseTrim = baseTrim;
|
|
5131
|
+
return _baseTrim;
|
|
5115
5132
|
}
|
|
5116
|
-
var _baseTrim = baseTrim$1;
|
|
5117
5133
|
|
|
5118
|
-
var baseTrim =
|
|
5134
|
+
var baseTrim = require_baseTrim(), isObject$7 = isObject_1, isSymbol$1 = isSymbol_1;
|
|
5119
5135
|
var NAN = 0 / 0;
|
|
5120
5136
|
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
5121
5137
|
var reIsBinary = /^0b[01]+$/i;
|
|
@@ -8597,7 +8613,7 @@ var hasRequiredTrim;
|
|
|
8597
8613
|
function requireTrim () {
|
|
8598
8614
|
if (hasRequiredTrim) return trim_1;
|
|
8599
8615
|
hasRequiredTrim = 1;
|
|
8600
|
-
var baseToString = _baseToString, baseTrim =
|
|
8616
|
+
var baseToString = _baseToString, baseTrim = require_baseTrim(), castSlice = require_castSlice(), charsEndIndex = require_charsEndIndex(), charsStartIndex = require_charsStartIndex(), stringToArray = require_stringToArray(), toString = toString_1;
|
|
8601
8617
|
function trim(string, chars, guard) {
|
|
8602
8618
|
string = toString(string);
|
|
8603
8619
|
if (string && (guard || chars === void 0)) {
|
|
@@ -71567,7 +71583,6 @@ const defaultApiValue = {
|
|
|
71567
71583
|
//OAuth
|
|
71568
71584
|
loadOAuthState: () => Promise.resolve({}),
|
|
71569
71585
|
loadOAuthStates: () => Promise.resolve([]),
|
|
71570
|
-
getOAuthWindowURI: () => Promise.resolve({}),
|
|
71571
71586
|
oAuthStart: () => Promise.resolve(),
|
|
71572
71587
|
// Support
|
|
71573
71588
|
createSupportTicket: () => Promise.resolve(),
|
|
@@ -76686,7 +76701,7 @@ const OAuthStep = React__default.forwardRef((props, navigationRef) => {
|
|
|
76686
76701
|
if (!isStartingOauth) return () => {
|
|
76687
76702
|
};
|
|
76688
76703
|
let member$;
|
|
76689
|
-
if (member && member.is_oauth) {
|
|
76704
|
+
if (member && member.is_oauth && api.getOAuthWindowURI) {
|
|
76690
76705
|
member$ = of(member);
|
|
76691
76706
|
} else if (pendingOauthMember) {
|
|
76692
76707
|
member$ = of(pendingOauthMember);
|
|
@@ -86600,6 +86615,37 @@ class InstitutionConfigNotEnabled extends Error {
|
|
|
86600
86615
|
}
|
|
86601
86616
|
}
|
|
86602
86617
|
|
|
86618
|
+
const useNavigationPostMessage = () => {
|
|
86619
|
+
const postMessageFunctions = useContext(PostMessageContext);
|
|
86620
|
+
const dispatch = useDispatch();
|
|
86621
|
+
const connectConfig = useSelector(selectConnectConfig);
|
|
86622
|
+
const initialConfig = useSelector(selectInitialConfig);
|
|
86623
|
+
const step = useSelector(
|
|
86624
|
+
(state) => state.connect.location[state.connect.location.length - 1]?.step ?? STEPS.SEARCH
|
|
86625
|
+
);
|
|
86626
|
+
useEffect(() => {
|
|
86627
|
+
window.addEventListener("message", _handleNavigationPostMessage);
|
|
86628
|
+
return () => window.removeEventListener("message", _handleNavigationPostMessage);
|
|
86629
|
+
}, []);
|
|
86630
|
+
const _handleNavigationPostMessage = (event) => {
|
|
86631
|
+
const eventData = PostMessage.parse(event.data);
|
|
86632
|
+
if (eventData.type === "mx/navigation") {
|
|
86633
|
+
if (eventData.payload.action === "back") {
|
|
86634
|
+
const dontChangeConnectStep = step === STEPS.SEARCH || step === STEPS.DISCLOSURE || step === STEPS.VERIFY_EXISTING_MEMBER || connectConfig.disable_institution_search;
|
|
86635
|
+
if (dontChangeConnectStep) {
|
|
86636
|
+
postMessageFunctions.onPostMessage("navigation", { did_go_back: false });
|
|
86637
|
+
} else {
|
|
86638
|
+
dispatch({
|
|
86639
|
+
type: ActionTypes$2.GO_BACK_POST_MESSAGE,
|
|
86640
|
+
payload: initialConfig
|
|
86641
|
+
});
|
|
86642
|
+
postMessageFunctions.onPostMessage("navigation", { did_go_back: true });
|
|
86643
|
+
}
|
|
86644
|
+
}
|
|
86645
|
+
}
|
|
86646
|
+
};
|
|
86647
|
+
};
|
|
86648
|
+
|
|
86603
86649
|
const AnalyticContext = createContext({
|
|
86604
86650
|
onAnalyticEvent: () => {
|
|
86605
86651
|
},
|
|
@@ -86628,6 +86674,7 @@ const Connect$2 = ({
|
|
|
86628
86674
|
},
|
|
86629
86675
|
...props
|
|
86630
86676
|
}) => {
|
|
86677
|
+
useNavigationPostMessage();
|
|
86631
86678
|
const connectConfig = useSelector(selectConnectConfig);
|
|
86632
86679
|
const initialConfig = useSelector(selectInitialConfig);
|
|
86633
86680
|
const loadError = useSelector((state2) => state2.connect.loadError);
|
|
@@ -86674,7 +86721,6 @@ const Connect$2 = ({
|
|
|
86674
86721
|
};
|
|
86675
86722
|
}, []);
|
|
86676
86723
|
useEffect(() => {
|
|
86677
|
-
window.addEventListener("message", _handleNavigationPostMessage);
|
|
86678
86724
|
loadConnect(props.clientConfig);
|
|
86679
86725
|
dispatch(loadProfiles(props.profiles));
|
|
86680
86726
|
dispatch(loadUserFeatures(props.userFeatures));
|
|
@@ -86685,7 +86731,6 @@ const Connect$2 = ({
|
|
|
86685
86731
|
}
|
|
86686
86732
|
return () => {
|
|
86687
86733
|
dispatch(resetConnect$1());
|
|
86688
|
-
window.removeEventListener("message", _handleNavigationPostMessage);
|
|
86689
86734
|
};
|
|
86690
86735
|
}, []);
|
|
86691
86736
|
useEffect(() => {
|
|
@@ -86730,23 +86775,6 @@ const Connect$2 = ({
|
|
|
86730
86775
|
loadConnect(props.clientConfig);
|
|
86731
86776
|
}
|
|
86732
86777
|
}, [isLoading, step, props.clientConfig]);
|
|
86733
|
-
const _handleNavigationPostMessage = (event) => {
|
|
86734
|
-
const eventData = PostMessage.parse(event.data);
|
|
86735
|
-
if (eventData.type === "mx/navigation") {
|
|
86736
|
-
if (eventData.payload.action === "back") {
|
|
86737
|
-
const dontChangeConnectStep = step === STEPS.SEARCH || step === STEPS.DISCLOSURE || step === STEPS.VERIFY_EXISTING_MEMBER || connectConfig.disable_institution_search;
|
|
86738
|
-
if (dontChangeConnectStep) {
|
|
86739
|
-
postMessageFunctions.onPostMessage("navigation", { did_go_back: false });
|
|
86740
|
-
} else {
|
|
86741
|
-
dispatch({
|
|
86742
|
-
type: ActionTypes$2.GO_BACK_POST_MESSAGE,
|
|
86743
|
-
payload: initialConfig
|
|
86744
|
-
});
|
|
86745
|
-
postMessageFunctions.onPostMessage("navigation", { did_go_back: true });
|
|
86746
|
-
}
|
|
86747
|
-
}
|
|
86748
|
-
}
|
|
86749
|
-
};
|
|
86750
86778
|
const _handleAddManualAccountClick = () => {
|
|
86751
86779
|
dispatch(stepToAddManualAccount$1());
|
|
86752
86780
|
};
|