authscape 1.0.438 → 1.0.442
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/index.js +14 -3
- package/package.json +3 -2
- package/src/components/AuthScapeApp.js +10 -4
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var _queryString = _interopRequireDefault(require("query-string"));
|
|
|
15
15
|
var _nookies = require("nookies");
|
|
16
16
|
var _router = _interopRequireDefault(require("next/router"));
|
|
17
17
|
var _ga4React = _interopRequireDefault(require("ga-4-react"));
|
|
18
|
+
var _zustand = require("zustand");
|
|
18
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
19
20
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20
21
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -38,6 +39,8 @@ function AuthScapeApp(_ref) {
|
|
|
38
39
|
pageProps = _ref.pageProps,
|
|
39
40
|
_ref$muiTheme = _ref.muiTheme,
|
|
40
41
|
muiTheme = _ref$muiTheme === void 0 ? {} : _ref$muiTheme,
|
|
42
|
+
_ref$store = _ref.store,
|
|
43
|
+
store = _ref$store === void 0 ? {} : _ref$store,
|
|
41
44
|
_ref$enforceLoggedIn = _ref.enforceLoggedIn,
|
|
42
45
|
enforceLoggedIn = _ref$enforceLoggedIn === void 0 ? false : _ref$enforceLoggedIn,
|
|
43
46
|
_ref$enableAuth = _ref.enableAuth,
|
|
@@ -304,6 +307,9 @@ function AuthScapeApp(_ref) {
|
|
|
304
307
|
});
|
|
305
308
|
}
|
|
306
309
|
};
|
|
310
|
+
var useStore = (0, _zustand.create)(function (set) {
|
|
311
|
+
return store;
|
|
312
|
+
});
|
|
307
313
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_head["default"], null, /*#__PURE__*/_react["default"].createElement("meta", {
|
|
308
314
|
name: "viewport",
|
|
309
315
|
content: "width=device-width, initial-scale=0.86, maximum-scale=5.0, minimum-scale=0.86"
|
|
@@ -318,17 +324,22 @@ function AuthScapeApp(_ref) {
|
|
|
318
324
|
toast: _reactToastify.toast,
|
|
319
325
|
setIsLoading: setIsLoading,
|
|
320
326
|
logEvent: logEvent,
|
|
321
|
-
logPurchase: logPurchase
|
|
327
|
+
logPurchase: logPurchase,
|
|
328
|
+
store: useStore
|
|
322
329
|
})),
|
|
323
330
|
currentUser: signedInUser.current,
|
|
324
|
-
logEvent: logEvent
|
|
331
|
+
logEvent: logEvent,
|
|
332
|
+
setIsLoading: setIsLoading,
|
|
333
|
+
toast: _reactToastify.toast,
|
|
334
|
+
store: useStore
|
|
325
335
|
}), layout == null && /*#__PURE__*/_react["default"].createElement(Component, _extends({}, pageProps, {
|
|
326
336
|
currentUser: signedInUser.current,
|
|
327
337
|
toast: _reactToastify.toast,
|
|
328
338
|
loadedUser: frontEndLoadedState,
|
|
329
339
|
setIsLoading: setIsLoading,
|
|
330
340
|
logEvent: logEvent,
|
|
331
|
-
logPurchase: logPurchase
|
|
341
|
+
logPurchase: logPurchase,
|
|
342
|
+
store: useStore
|
|
332
343
|
}))), /*#__PURE__*/_react["default"].createElement(_reactToastify.ToastContainer, null)), loadingLayout && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, loadingLayout(isLoadingShow)), frontEndLoaded.current && process.env.microsoftClarityTrackingCode != null && process.env.staging == "production" && /*#__PURE__*/_react["default"].createElement("script", {
|
|
333
344
|
dangerouslySetInnerHTML: {
|
|
334
345
|
__html: "\n (function(c,l,a,r,i,t,y){\n c[a] = c[a] || function () { (c[a].q = c[a].q || []).push(arguments) };\n t=l.createElement(r);\n t.async=1;\n t.src=\"https://www.clarity.ms/tag/\"+i;\n y=l.getElementsByTagName(r)[0];\n y.parentNode.insertBefore(t,y);\n })(window, document, \"clarity\", \"script\", \"" + process.env.microsoftClarityTrackingCode + "\");"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "authscape",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.442",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"react-hook-form": "^7.50.1",
|
|
57
57
|
"react-toastify": "^9.1.3",
|
|
58
58
|
"styled-components": "^5.3.6",
|
|
59
|
-
"use-places-autocomplete": "^4.0.0"
|
|
59
|
+
"use-places-autocomplete": "^4.0.0",
|
|
60
|
+
"zustand": "^4.5.2"
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -8,11 +8,12 @@ import querystring from "query-string";
|
|
|
8
8
|
import { setCookie } from 'nookies';
|
|
9
9
|
import Router from 'next/router';
|
|
10
10
|
import GA4React from 'ga-4-react';
|
|
11
|
+
import { create } from 'zustand'
|
|
11
12
|
|
|
12
13
|
// comment this out
|
|
13
14
|
// import { authService, apiService, setupOEMProps, OEMStyleSheet } from 'authscape';
|
|
14
15
|
|
|
15
|
-
export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiTheme = {}, enforceLoggedIn = false, enableAuth = true}) {
|
|
16
|
+
export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiTheme = {}, store={}, enforceLoggedIn = false, enableAuth = true}) {
|
|
16
17
|
|
|
17
18
|
const [frontEndLoadedState, setFrontEndLoadedState] = useState(false);
|
|
18
19
|
|
|
@@ -273,6 +274,8 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
273
274
|
}
|
|
274
275
|
}
|
|
275
276
|
|
|
277
|
+
const useStore = create((set) => (store));
|
|
278
|
+
|
|
276
279
|
return (
|
|
277
280
|
<>
|
|
278
281
|
<Head>
|
|
@@ -289,13 +292,16 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
|
|
|
289
292
|
{frontEndLoadedState != null && frontEndLoadedState && pathname != "/signin-oidc" &&
|
|
290
293
|
<>
|
|
291
294
|
{layout != null && layout({
|
|
292
|
-
children: <Component {...pageProps} currentUser={signedInUser.current} toast={toast} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} />,
|
|
295
|
+
children: <Component {...pageProps} currentUser={signedInUser.current} toast={toast} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} store={useStore} />,
|
|
293
296
|
currentUser: signedInUser.current,
|
|
294
|
-
logEvent: logEvent
|
|
297
|
+
logEvent: logEvent,
|
|
298
|
+
setIsLoading: setIsLoading,
|
|
299
|
+
toast: toast,
|
|
300
|
+
store: useStore
|
|
295
301
|
})}
|
|
296
302
|
|
|
297
303
|
{layout == null &&
|
|
298
|
-
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} />
|
|
304
|
+
<Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} store={useStore} />
|
|
299
305
|
}
|
|
300
306
|
</>
|
|
301
307
|
}
|