@fluxo-dev/state 0.0.25 → 0.0.26
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.esm.js +8 -26
- package/package.json +1 -1
- package/src/index.d.ts +0 -1
- package/src/lib/store.d.ts +0 -2
- package/src/lib/route-rule/route-rule-slice.d.ts +0 -6
package/index.esm.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createSlice, createAsyncThunk, configureStore } from '@reduxjs/toolkit';
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
|
|
4
|
-
const initialState$
|
|
4
|
+
const initialState$2 = {
|
|
5
5
|
fluxoClientConfig: null
|
|
6
6
|
};
|
|
7
7
|
const fluxoClientSlice = createSlice({
|
|
8
8
|
name: 'fluxoClient',
|
|
9
|
-
initialState: initialState$
|
|
9
|
+
initialState: initialState$2,
|
|
10
10
|
reducers: {
|
|
11
11
|
setFluxoClientConfiguration(state, action) {
|
|
12
12
|
state.fluxoClientConfig = action.payload;
|
|
@@ -79,7 +79,7 @@ const LocalStorageConstants = {
|
|
|
79
79
|
};
|
|
80
80
|
|
|
81
81
|
var _a, _b;
|
|
82
|
-
const initialState$
|
|
82
|
+
const initialState$1 = {
|
|
83
83
|
loading: false,
|
|
84
84
|
userInfo: JSON.parse((_a = localStorage.getItem(LocalStorageConstants.userData)) !== null && _a !== void 0 ? _a : '{}'),
|
|
85
85
|
accessToken: localStorage.getItem((_b = LocalStorageConstants.accessToken) !== null && _b !== void 0 ? _b : ''),
|
|
@@ -92,7 +92,7 @@ const initialState$2 = {
|
|
|
92
92
|
};
|
|
93
93
|
const userSlice = createSlice({
|
|
94
94
|
name: 'user',
|
|
95
|
-
initialState: initialState$
|
|
95
|
+
initialState: initialState$1,
|
|
96
96
|
reducers: {
|
|
97
97
|
autoLoginSucceded: (state, action) => {
|
|
98
98
|
state.loading = false;
|
|
@@ -145,7 +145,7 @@ const {
|
|
|
145
145
|
} = userSlice.actions;
|
|
146
146
|
var userReducer = userSlice.reducer;
|
|
147
147
|
|
|
148
|
-
const initialState
|
|
148
|
+
const initialState = {
|
|
149
149
|
loading: false,
|
|
150
150
|
searchPanelOpened: false,
|
|
151
151
|
userIdle: false,
|
|
@@ -161,7 +161,7 @@ const initialState$1 = {
|
|
|
161
161
|
};
|
|
162
162
|
const layoutSlice = createSlice({
|
|
163
163
|
name: 'layout',
|
|
164
|
-
initialState
|
|
164
|
+
initialState,
|
|
165
165
|
reducers: {
|
|
166
166
|
openSearchPanel(state, action) {
|
|
167
167
|
state.searchPanelOpened = true;
|
|
@@ -226,29 +226,11 @@ const {
|
|
|
226
226
|
var layoutReducer = layoutSlice.reducer;
|
|
227
227
|
class toggleUserIdle {}
|
|
228
228
|
|
|
229
|
-
const initialState = {
|
|
230
|
-
routeRules: null
|
|
231
|
-
};
|
|
232
|
-
const fluxoRouteSlice = createSlice({
|
|
233
|
-
name: 'fluxoRouteRule',
|
|
234
|
-
initialState,
|
|
235
|
-
reducers: {
|
|
236
|
-
setRouteRules(state, action) {
|
|
237
|
-
state.routeRules = action.payload;
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
});
|
|
241
|
-
const {
|
|
242
|
-
setRouteRules
|
|
243
|
-
} = fluxoRouteSlice.actions;
|
|
244
|
-
var fluxoRouteRuleReducer = fluxoRouteSlice.reducer;
|
|
245
|
-
|
|
246
229
|
const store = configureStore({
|
|
247
230
|
reducer: {
|
|
248
231
|
user: userReducer,
|
|
249
232
|
layout: layoutReducer,
|
|
250
|
-
client: fluxoClientReducer
|
|
251
|
-
routeRules: fluxoRouteRuleReducer
|
|
233
|
+
client: fluxoClientReducer
|
|
252
234
|
}
|
|
253
235
|
});
|
|
254
236
|
// Use throughout your app instead of plain `useDispatch` and `useSelector`
|
|
@@ -261,4 +243,4 @@ var AuthenticationType;
|
|
|
261
243
|
AuthenticationType[AuthenticationType["ApiKey"] = 1] = "ApiKey";
|
|
262
244
|
})(AuthenticationType || (AuthenticationType = {}));
|
|
263
245
|
|
|
264
|
-
export { AuthenticationType, autoLoginSucceded, closeNavbar, closeSearchPanel, openNavbar, openSearchPanel, setAllowedFrontends, setAppMenu, setConfiguration, setCurrentFrontend, setFluxoClientConfiguration, setFrontends, setHasAdminAccess, setJitAppsFeatures,
|
|
246
|
+
export { AuthenticationType, autoLoginSucceded, closeNavbar, closeSearchPanel, openNavbar, openSearchPanel, setAllowedFrontends, setAppMenu, setConfiguration, setCurrentFrontend, setFluxoClientConfiguration, setFrontends, setHasAdminAccess, setJitAppsFeatures, setSysFeatures, setUserDomainRoles, setUserIdle, setUserPermissions, store, toggleUserIdle, unsetUserIdle, useAppDispatch, useAppSelector, userLogin, userLogout };
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
package/src/lib/store.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import userReducer from './user/userSlice';
|
|
2
2
|
import layoutReducer from './layout/layoutSlice';
|
|
3
3
|
import fluxoClientReducer from './fluxo-client/fluxoClientSlice';
|
|
4
|
-
import fluxoRouteRuleReducer from './route-rule/route-rule-slice';
|
|
5
4
|
import { TypedUseSelectorHook } from "react-redux";
|
|
6
5
|
export interface IFluxoRootState {
|
|
7
6
|
user: ReturnType<typeof userReducer>;
|
|
8
7
|
layout: ReturnType<typeof layoutReducer>;
|
|
9
8
|
client: ReturnType<typeof fluxoClientReducer>;
|
|
10
|
-
routeRules: ReturnType<typeof fluxoRouteRuleReducer>;
|
|
11
9
|
}
|
|
12
10
|
export declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<IFluxoRootState, import("redux").AnyAction, [import("@reduxjs/toolkit").ThunkMiddleware<IFluxoRootState, import("redux").AnyAction>]>;
|
|
13
11
|
type AppDispatch = typeof store.dispatch;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface IFluxoRouteRuleSliceState {
|
|
2
|
-
routeRules: any[] | null;
|
|
3
|
-
}
|
|
4
|
-
export declare const setRouteRules: import("@reduxjs/toolkit").ActionCreatorWithPayload<any, "fluxoRouteRule/setRouteRules">;
|
|
5
|
-
declare const _default: import("redux").Reducer<IFluxoRouteRuleSliceState>;
|
|
6
|
-
export default _default;
|