authscape 1.0.436 → 1.0.440

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 CHANGED
@@ -38,6 +38,8 @@ function AuthScapeApp(_ref) {
38
38
  pageProps = _ref.pageProps,
39
39
  _ref$muiTheme = _ref.muiTheme,
40
40
  muiTheme = _ref$muiTheme === void 0 ? {} : _ref$muiTheme,
41
+ _ref$store = _ref.store,
42
+ store = _ref$store === void 0 ? {} : _ref$store,
41
43
  _ref$enforceLoggedIn = _ref.enforceLoggedIn,
42
44
  enforceLoggedIn = _ref$enforceLoggedIn === void 0 ? false : _ref$enforceLoggedIn,
43
45
  _ref$enableAuth = _ref.enableAuth,
@@ -304,6 +306,9 @@ function AuthScapeApp(_ref) {
304
306
  });
305
307
  }
306
308
  };
309
+ var useStore = create(function (set) {
310
+ return store;
311
+ });
307
312
  return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_head["default"], null, /*#__PURE__*/_react["default"].createElement("meta", {
308
313
  name: "viewport",
309
314
  content: "width=device-width, initial-scale=0.86, maximum-scale=5.0, minimum-scale=0.86"
@@ -318,16 +323,22 @@ function AuthScapeApp(_ref) {
318
323
  toast: _reactToastify.toast,
319
324
  setIsLoading: setIsLoading,
320
325
  logEvent: logEvent,
321
- logPurchase: logPurchase
326
+ logPurchase: logPurchase,
327
+ store: useStore
322
328
  })),
323
- currentUser: signedInUser.current
329
+ currentUser: signedInUser.current,
330
+ logEvent: logEvent,
331
+ setIsLoading: setIsLoading,
332
+ toast: _reactToastify.toast,
333
+ store: useStore
324
334
  }), layout == null && /*#__PURE__*/_react["default"].createElement(Component, _extends({}, pageProps, {
325
335
  currentUser: signedInUser.current,
326
336
  toast: _reactToastify.toast,
327
337
  loadedUser: frontEndLoadedState,
328
338
  setIsLoading: setIsLoading,
329
339
  logEvent: logEvent,
330
- logPurchase: logPurchase
340
+ logPurchase: logPurchase,
341
+ store: useStore
331
342
  }))), /*#__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", {
332
343
  dangerouslySetInnerHTML: {
333
344
  __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.436",
3
+ "version": "1.0.440",
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
  }
@@ -12,7 +12,7 @@ import GA4React from 'ga-4-react';
12
12
  // comment this out
13
13
  // import { authService, apiService, setupOEMProps, OEMStyleSheet } from 'authscape';
14
14
 
15
- export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiTheme = {}, enforceLoggedIn = false, enableAuth = true}) {
15
+ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiTheme = {}, store={}, enforceLoggedIn = false, enableAuth = true}) {
16
16
 
17
17
  const [frontEndLoadedState, setFrontEndLoadedState] = useState(false);
18
18
 
@@ -273,6 +273,8 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
273
273
  }
274
274
  }
275
275
 
276
+ const useStore = create((set) => (store));
277
+
276
278
  return (
277
279
  <>
278
280
  <Head>
@@ -289,12 +291,16 @@ export function AuthScapeApp ({Component, layout, loadingLayout, pageProps, muiT
289
291
  {frontEndLoadedState != null && frontEndLoadedState && pathname != "/signin-oidc" &&
290
292
  <>
291
293
  {layout != null && layout({
292
- children: <Component {...pageProps} currentUser={signedInUser.current} toast={toast} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} />,
293
- currentUser: signedInUser.current
294
+ children: <Component {...pageProps} currentUser={signedInUser.current} toast={toast} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} store={useStore} />,
295
+ currentUser: signedInUser.current,
296
+ logEvent: logEvent,
297
+ setIsLoading: setIsLoading,
298
+ toast: toast,
299
+ store: useStore
294
300
  })}
295
301
 
296
302
  {layout == null &&
297
- <Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} />
303
+ <Component {...pageProps} currentUser={signedInUser.current} toast={toast} loadedUser={frontEndLoadedState} setIsLoading={setIsLoading} logEvent={logEvent} logPurchase={logPurchase} store={useStore} />
298
304
  }
299
305
  </>
300
306
  }