@frontegg/react-hooks 7.75.0-alpha.1 → 7.75.0-alpha.2

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/auth/index.d.ts CHANGED
@@ -26,4 +26,5 @@ export * from './stepUp';
26
26
  export * from './team';
27
27
  export * from './security';
28
28
  export * from './tenants';
29
+ export * from './usersEmailsPolicyState';
29
30
  export * from './applications';
package/auth/index.js CHANGED
@@ -26,4 +26,5 @@ export * from './stepUp';
26
26
  export * from './team';
27
27
  export * from './security';
28
28
  export * from './tenants';
29
+ export * from './usersEmailsPolicyState';
29
30
  export * from './applications';
@@ -0,0 +1,5 @@
1
+ import { UserEmailPolicyState, UsersEmailPolicyActions } from '@frontegg/redux-store';
2
+ export type UserEmailPolicyStateMapper<S> = (state: UserEmailPolicyState) => S;
3
+ export declare function useUsersEmailsPolicyState(): UserEmailPolicyState;
4
+ export declare function useUsersEmailsPolicyState<S>(stateMapper: UserEmailPolicyStateMapper<S>): S;
5
+ export declare const useUsersEmailsPolicyActions: () => UsersEmailPolicyActions;
@@ -0,0 +1,10 @@
1
+ import { useStore } from '../FronteggStoreContext';
2
+ import { useSnapshot } from '../useSnapshot';
3
+ const defaultMapper = state => state;
4
+ export function useUsersEmailsPolicyState(stateMapper = defaultMapper) {
5
+ const state = useStore().store.auth.userEmailPolicyState;
6
+ return stateMapper(useSnapshot(state));
7
+ }
8
+ export const useUsersEmailsPolicyActions = () => {
9
+ return useStore().stateActions.auth.usersEmailsPolicyActions;
10
+ };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.75.0-alpha.1
1
+ /** @license Frontegg v7.75.0-alpha.2
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
@@ -407,6 +407,18 @@ Object.keys(_tenants).forEach(function (key) {
407
407
  }
408
408
  });
409
409
  });
410
+ var _usersEmailsPolicyState = require("./usersEmailsPolicyState");
411
+ Object.keys(_usersEmailsPolicyState).forEach(function (key) {
412
+ if (key === "default" || key === "__esModule") return;
413
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
414
+ if (key in exports && exports[key] === _usersEmailsPolicyState[key]) return;
415
+ Object.defineProperty(exports, key, {
416
+ enumerable: true,
417
+ get: function () {
418
+ return _usersEmailsPolicyState[key];
419
+ }
420
+ });
421
+ });
410
422
  var _applications = require("./applications");
411
423
  Object.keys(_applications).forEach(function (key) {
412
424
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useUsersEmailsPolicyActions = void 0;
7
+ exports.useUsersEmailsPolicyState = useUsersEmailsPolicyState;
8
+ var _FronteggStoreContext = require("../FronteggStoreContext");
9
+ var _useSnapshot = require("../useSnapshot");
10
+ const defaultMapper = state => state;
11
+ function useUsersEmailsPolicyState(stateMapper = defaultMapper) {
12
+ const state = (0, _FronteggStoreContext.useStore)().store.auth.userEmailPolicyState;
13
+ return stateMapper((0, _useSnapshot.useSnapshot)(state));
14
+ }
15
+ const useUsersEmailsPolicyActions = () => {
16
+ return (0, _FronteggStoreContext.useStore)().stateActions.auth.usersEmailsPolicyActions;
17
+ };
18
+ exports.useUsersEmailsPolicyActions = useUsersEmailsPolicyActions;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v7.75.0-alpha.1
1
+ /** @license Frontegg v7.75.0-alpha.2
2
2
  *
3
3
  * This source code is licensed under the MIT license found in the
4
4
  * LICENSE file in the root directory of this source tree.
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@frontegg/react-hooks",
3
- "version": "7.75.0-alpha.1",
3
+ "version": "7.75.0-alpha.2",
4
4
  "main": "./node/index.js",
5
5
  "license": "MIT",
6
6
  "author": "Frontegg LTD",
7
7
  "dependencies": {
8
8
  "@babel/runtime": "^7.18.6",
9
- "@frontegg/redux-store": "7.75.0-alpha.1",
10
- "@frontegg/types": "7.75.0-alpha.1",
9
+ "@frontegg/redux-store": "7.75.0-alpha.2",
10
+ "@frontegg/types": "7.75.0-alpha.2",
11
11
  "@types/react": "*",
12
12
  "@types/react-is": "^17.0.7",
13
13
  "get-value": "^3.0.1",