@frontegg/react-hooks 6.75.0-alpha.0 → 6.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.
@@ -0,0 +1,9 @@
1
+ import { GroupsState, GroupsActions, GroupsDialogsState, GroupsDialogsActions } from '@frontegg/redux-store';
2
+ export declare type GroupsStateMapper<S> = (state: GroupsState) => S;
3
+ export declare function useGroupsState(): GroupsState;
4
+ export declare function useGroupsState<S>(stateMapper: GroupsStateMapper<S>): S;
5
+ export declare const useGroupsActions: () => GroupsActions;
6
+ export declare type GroupsDialogsStateMapper<S> = (state: GroupsDialogsState) => S;
7
+ export declare function useGroupsDialogsState(): GroupsDialogsState;
8
+ export declare function useGroupsDialogsState<S>(stateMapper: GroupsDialogsStateMapper<S>): S;
9
+ export declare const useGroupsDialogsActions: () => GroupsDialogsActions;
package/auth/groups.js ADDED
@@ -0,0 +1,15 @@
1
+ import { groupsActions, groupsReducers, groupsDialogsActions, groupsDialogsReducers } from '@frontegg/redux-store';
2
+ import { reducerActionsGenerator, stateHookGenerator } from './hooks';
3
+ const defaultMapper = state => state;
4
+ export function useGroupsState(stateMapper = defaultMapper) {
5
+ return stateHookGenerator(stateMapper, 'groupsState');
6
+ }
7
+ export const useGroupsActions = () => reducerActionsGenerator(groupsActions, groupsReducers);
8
+
9
+ //dialogs
10
+
11
+ const defaultDialogsMapper = state => state;
12
+ export function useGroupsDialogsState(stateMapper = defaultDialogsMapper) {
13
+ return stateHookGenerator(stateMapper, 'groupsDialogsState');
14
+ }
15
+ export const useGroupsDialogsActions = () => reducerActionsGenerator(groupsDialogsActions, groupsDialogsReducers);
package/auth/index.d.ts CHANGED
@@ -19,3 +19,4 @@ export * from './sessionsPolicy';
19
19
  export * from './restrictions';
20
20
  export * from './provisioning';
21
21
  export * from './impersonate';
22
+ export * from './groups';
package/auth/index.js CHANGED
@@ -18,4 +18,5 @@ export * from './sessions';
18
18
  export * from './sessionsPolicy';
19
19
  export * from './restrictions';
20
20
  export * from './provisioning';
21
- export * from './impersonate';
21
+ export * from './impersonate';
22
+ export * from './groups';
@@ -1 +1 @@
1
- export declare const useFeatureFlags: (...flags: string[]) => boolean[];
1
+ export declare const useFeatureFlags: (flags: string[]) => boolean[];
@@ -1,9 +1,4 @@
1
- import { useShadowDom } from '../common';
2
- export const useFeatureFlags = (...flags) => {
3
- var _injector$flags;
4
- const {
5
- injector
6
- } = useShadowDom();
7
- const featureFlags = (_injector$flags = injector.flags) != null ? _injector$flags : {};
8
- return flags.map(flag => featureFlags[flag] === 'on');
1
+ import { useFeatureFlags as getFeatureFlags } from '@frontegg/redux-store';
2
+ export const useFeatureFlags = flags => {
3
+ return getFeatureFlags(flags);
9
4
  };
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.75.0-alpha.0
1
+ /** @license Frontegg v6.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.
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.useGroupsDialogsActions = exports.useGroupsActions = void 0;
7
+ exports.useGroupsDialogsState = useGroupsDialogsState;
8
+ exports.useGroupsState = useGroupsState;
9
+ var _reduxStore = require("@frontegg/redux-store");
10
+ var _hooks = require("./hooks");
11
+ const defaultMapper = state => state;
12
+ function useGroupsState(stateMapper = defaultMapper) {
13
+ return (0, _hooks.stateHookGenerator)(stateMapper, 'groupsState');
14
+ }
15
+ const useGroupsActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.groupsActions, _reduxStore.groupsReducers);
16
+
17
+ //dialogs
18
+ exports.useGroupsActions = useGroupsActions;
19
+ const defaultDialogsMapper = state => state;
20
+ function useGroupsDialogsState(stateMapper = defaultDialogsMapper) {
21
+ return (0, _hooks.stateHookGenerator)(stateMapper, 'groupsDialogsState');
22
+ }
23
+ const useGroupsDialogsActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.groupsDialogsActions, _reduxStore.groupsDialogsReducers);
24
+ exports.useGroupsDialogsActions = useGroupsDialogsActions;
@@ -301,4 +301,16 @@ Object.keys(_impersonate).forEach(function (key) {
301
301
  return _impersonate[key];
302
302
  }
303
303
  });
304
+ });
305
+ var _groups = require("./groups");
306
+ Object.keys(_groups).forEach(function (key) {
307
+ if (key === "default" || key === "__esModule") return;
308
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
309
+ if (key in exports && exports[key] === _groups[key]) return;
310
+ Object.defineProperty(exports, key, {
311
+ enumerable: true,
312
+ get: function () {
313
+ return _groups[key];
314
+ }
315
+ });
304
316
  });
@@ -4,13 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.useFeatureFlags = void 0;
7
- var _common = require("../common");
8
- const useFeatureFlags = (...flags) => {
9
- var _injector$flags;
10
- const {
11
- injector
12
- } = (0, _common.useShadowDom)();
13
- const featureFlags = (_injector$flags = injector.flags) != null ? _injector$flags : {};
14
- return flags.map(flag => featureFlags[flag] === 'on');
7
+ var _reduxStore = require("@frontegg/redux-store");
8
+ const useFeatureFlags = flags => {
9
+ return (0, _reduxStore.useFeatureFlags)(flags);
15
10
  };
16
11
  exports.useFeatureFlags = useFeatureFlags;
package/node/index.js CHANGED
@@ -1,4 +1,4 @@
1
- /** @license Frontegg v6.75.0-alpha.0
1
+ /** @license Frontegg v6.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": "6.75.0-alpha.0",
3
+ "version": "6.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": "6.75.0-alpha.0",
10
- "@frontegg/types": "6.75.0-alpha.0",
9
+ "@frontegg/redux-store": "6.75.0-alpha.2",
10
+ "@frontegg/types": "6.75.0-alpha.2",
11
11
  "@types/react": "*",
12
12
  "react-redux": "^7.x"
13
13
  },