@nibssplc/cams-sdk-react 0.0.1-beta.53 → 0.0.1-beta.54
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.cjs.js +13 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +12 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -17391,7 +17391,7 @@ if (process.env.NODE_ENV === 'production') {
|
|
|
17391
17391
|
var jsxRuntimeExports = jsxRuntime.exports;
|
|
17392
17392
|
|
|
17393
17393
|
var CAMSContext$1 = React__default.createContext(null);
|
|
17394
|
-
function useCAMSContext() {
|
|
17394
|
+
function useCAMSContext$1() {
|
|
17395
17395
|
var context = React__default.useContext(CAMSContext$1);
|
|
17396
17396
|
if (!context) {
|
|
17397
17397
|
throw new Error('useCAMSContext must be used within a CAMSProvider');
|
|
@@ -17401,7 +17401,7 @@ function useCAMSContext() {
|
|
|
17401
17401
|
|
|
17402
17402
|
function ProtectedRoute(_a) {
|
|
17403
17403
|
var children = _a.children, fallback = _a.fallback, redirectTo = _a.redirectTo;
|
|
17404
|
-
var _b = useCAMSContext(), isAuthenticated = _b.isAuthenticated, isLoading = _b.isLoading;
|
|
17404
|
+
var _b = useCAMSContext$1(), isAuthenticated = _b.isAuthenticated, isLoading = _b.isLoading;
|
|
17405
17405
|
if (isLoading) {
|
|
17406
17406
|
return fallback || jsxRuntimeExports.jsx("div", { children: "Loading..." });
|
|
17407
17407
|
}
|
|
@@ -19320,12 +19320,23 @@ function UnifiedCAMSProvider(props) {
|
|
|
19320
19320
|
}
|
|
19321
19321
|
return jsxRuntimeExports.jsx(CAMSProviderInner, __assign({}, props));
|
|
19322
19322
|
}
|
|
19323
|
+
function useCAMSContext() {
|
|
19324
|
+
var context = React__default.useContext(CAMSContext);
|
|
19325
|
+
if (!context) {
|
|
19326
|
+
throw new Error("useCAMSContext must be used within a UnifiedCAMSProvider");
|
|
19327
|
+
}
|
|
19328
|
+
return context;
|
|
19329
|
+
}
|
|
19330
|
+
// Backward compatibility exports
|
|
19331
|
+
var CAMSProvider = function (props) { return (jsxRuntimeExports.jsx(UnifiedCAMSProvider, __assign({}, props, { mode: "REGULAR" }))); };
|
|
19323
19332
|
|
|
19324
19333
|
exports.CAMSMSALProvider = CAMSMSALProvider;
|
|
19334
|
+
exports.CAMSProvider = CAMSProvider;
|
|
19325
19335
|
exports.ClientOnly = ClientOnly;
|
|
19326
19336
|
exports.ProtectedRoute = ProtectedRoute;
|
|
19327
19337
|
exports.UnifiedCAMSProvider = UnifiedCAMSProvider;
|
|
19328
19338
|
exports.useCAMSAuth = useCAMSAuth;
|
|
19339
|
+
exports.useCAMSContext = useCAMSContext;
|
|
19329
19340
|
exports.useCAMSMSALAuth = useCAMSMSALAuth;
|
|
19330
19341
|
exports.useCAMSMSALContext = useCAMSMSALContext;
|
|
19331
19342
|
Object.keys(camsSdk).forEach(function (k) {
|