@frontegg/react-hooks 6.75.0-alpha.1 → 6.75.0-alpha.3
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/groups.d.ts +9 -0
- package/auth/groups.js +15 -0
- package/auth/index.d.ts +2 -0
- package/auth/index.js +3 -1
- package/auth/passkeys.d.ts +7 -0
- package/auth/passkeys.js +7 -0
- package/flags/useFeatureFlags.d.ts +1 -1
- package/flags/useFeatureFlags.js +3 -8
- package/index.js +1 -1
- package/node/auth/groups.js +24 -0
- package/node/auth/index.js +24 -0
- package/node/auth/passkeys.js +15 -0
- package/node/flags/useFeatureFlags.js +3 -8
- package/node/index.js +1 -1
- package/package.json +3 -3
package/auth/groups.d.ts
ADDED
|
@@ -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
package/auth/index.js
CHANGED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PasskeysState } from '@frontegg/redux-store';
|
|
2
|
+
import { PasskeysActions } from '@frontegg/redux-store';
|
|
3
|
+
declare type AuthPasskeysStateMapper<S> = (state: PasskeysState) => S;
|
|
4
|
+
export declare function usePasskeysState(): PasskeysState;
|
|
5
|
+
export declare function usePasskeysState<S>(stateMapper: AuthPasskeysStateMapper<S>): S;
|
|
6
|
+
export declare const usePasskeysActions: () => PasskeysActions;
|
|
7
|
+
export {};
|
package/auth/passkeys.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { passkeysActions, passkeysReducers } from '@frontegg/redux-store';
|
|
2
|
+
import { reducerActionsGenerator, stateHookGenerator } from './hooks';
|
|
3
|
+
const defaultMapper = state => state;
|
|
4
|
+
export function usePasskeysState(stateMapper = defaultMapper) {
|
|
5
|
+
return stateHookGenerator(stateMapper, 'passkeysState');
|
|
6
|
+
}
|
|
7
|
+
export const usePasskeysActions = () => reducerActionsGenerator(passkeysActions, passkeysReducers);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useFeatureFlags: (
|
|
1
|
+
export declare const useFeatureFlags: (flags: string[]) => boolean[];
|
package/flags/useFeatureFlags.js
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const useFeatureFlags =
|
|
3
|
-
|
|
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
|
@@ -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;
|
package/node/auth/index.js
CHANGED
|
@@ -301,4 +301,28 @@ Object.keys(_impersonate).forEach(function (key) {
|
|
|
301
301
|
return _impersonate[key];
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
|
+
});
|
|
305
|
+
var _passkeys = require("./passkeys");
|
|
306
|
+
Object.keys(_passkeys).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] === _passkeys[key]) return;
|
|
310
|
+
Object.defineProperty(exports, key, {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function () {
|
|
313
|
+
return _passkeys[key];
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
var _groups = require("./groups");
|
|
318
|
+
Object.keys(_groups).forEach(function (key) {
|
|
319
|
+
if (key === "default" || key === "__esModule") return;
|
|
320
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
321
|
+
if (key in exports && exports[key] === _groups[key]) return;
|
|
322
|
+
Object.defineProperty(exports, key, {
|
|
323
|
+
enumerable: true,
|
|
324
|
+
get: function () {
|
|
325
|
+
return _groups[key];
|
|
326
|
+
}
|
|
327
|
+
});
|
|
304
328
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.usePasskeysActions = void 0;
|
|
7
|
+
exports.usePasskeysState = usePasskeysState;
|
|
8
|
+
var _reduxStore = require("@frontegg/redux-store");
|
|
9
|
+
var _hooks = require("./hooks");
|
|
10
|
+
const defaultMapper = state => state;
|
|
11
|
+
function usePasskeysState(stateMapper = defaultMapper) {
|
|
12
|
+
return (0, _hooks.stateHookGenerator)(stateMapper, 'passkeysState');
|
|
13
|
+
}
|
|
14
|
+
const usePasskeysActions = () => (0, _hooks.reducerActionsGenerator)(_reduxStore.passkeysActions, _reduxStore.passkeysReducers);
|
|
15
|
+
exports.usePasskeysActions = usePasskeysActions;
|
|
@@ -4,13 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.useFeatureFlags = void 0;
|
|
7
|
-
var
|
|
8
|
-
const useFeatureFlags =
|
|
9
|
-
|
|
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
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontegg/react-hooks",
|
|
3
|
-
"version": "6.75.0-alpha.
|
|
3
|
+
"version": "6.75.0-alpha.3",
|
|
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.
|
|
10
|
-
"@frontegg/types": "6.75.0-alpha.
|
|
9
|
+
"@frontegg/redux-store": "6.75.0-alpha.3",
|
|
10
|
+
"@frontegg/types": "6.75.0-alpha.3",
|
|
11
11
|
"@types/react": "*",
|
|
12
12
|
"react-redux": "^7.x"
|
|
13
13
|
},
|