@plurid/plurid-ui-state-react 0.0.0-2 → 0.0.0-5
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/distribution/data/interfaces/index.d.ts +9 -0
- package/distribution/index.d.ts +1 -0
- package/distribution/index.es.js +124 -265
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +127 -268
- package/distribution/index.js.map +1 -1
- package/distribution/modules/head/index.d.ts +27 -6
- package/distribution/modules/notifications/index.d.ts +22 -6
- package/distribution/modules/shortcuts/index.d.ts +18 -6
- package/distribution/modules/sitting/index.d.ts +32 -6
- package/distribution/modules/themes/index.d.ts +31 -6
- package/package.json +20 -16
- package/distribution/modules/head/actions/index.d.ts +0 -5
- package/distribution/modules/head/initial/index.d.ts +0 -3
- package/distribution/modules/head/reducer/index.d.ts +0 -4
- package/distribution/modules/head/resolvers/index.d.ts +0 -5
- package/distribution/modules/head/selectors/index.d.ts +0 -6
- package/distribution/modules/head/types/index.d.ts +0 -21
- package/distribution/modules/notifications/actions/index.d.ts +0 -7
- package/distribution/modules/notifications/initial/index.d.ts +0 -3
- package/distribution/modules/notifications/reducer/index.d.ts +0 -3
- package/distribution/modules/notifications/resolvers/index.d.ts +0 -7
- package/distribution/modules/notifications/selectors/index.d.ts +0 -6
- package/distribution/modules/notifications/types/index.d.ts +0 -31
- package/distribution/modules/shortcuts/actions/index.d.ts +0 -5
- package/distribution/modules/shortcuts/initial/index.d.ts +0 -3
- package/distribution/modules/shortcuts/reducer/index.d.ts +0 -3
- package/distribution/modules/shortcuts/resolvers/index.d.ts +0 -7
- package/distribution/modules/shortcuts/selectors/index.d.ts +0 -6
- package/distribution/modules/shortcuts/types/index.d.ts +0 -9
- package/distribution/modules/sitting/actions/index.d.ts +0 -6
- package/distribution/modules/sitting/initial/index.d.ts +0 -3
- package/distribution/modules/sitting/reducer/index.d.ts +0 -4
- package/distribution/modules/sitting/resolvers/index.d.ts +0 -6
- package/distribution/modules/sitting/selectors/index.d.ts +0 -7
- package/distribution/modules/sitting/types/index.d.ts +0 -15
- package/distribution/modules/themes/actions/index.d.ts +0 -5
- package/distribution/modules/themes/initial/index.d.ts +0 -3
- package/distribution/modules/themes/reducer/index.d.ts +0 -4
- package/distribution/modules/themes/resolvers/index.d.ts +0 -5
- package/distribution/modules/themes/selectors/index.d.ts +0 -7
- package/distribution/modules/themes/types/index.d.ts +0 -15
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
export interface StateOfAny {
|
|
2
2
|
[key: string]: any;
|
|
3
3
|
}
|
|
4
|
+
export declare type StateWithSlice<Key extends string, State = any> = StateOfAny & Record<Key, State>;
|
|
5
|
+
export interface Notification {
|
|
6
|
+
id: string;
|
|
7
|
+
text: string;
|
|
8
|
+
html?: boolean;
|
|
9
|
+
react?: boolean;
|
|
10
|
+
timeout?: number;
|
|
11
|
+
wordBreak?: boolean;
|
|
12
|
+
}
|
package/distribution/index.d.ts
CHANGED
package/distribution/index.es.js
CHANGED
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const SET_HEAD = "SET_HEAD";
|
|
4
|
-
|
|
5
|
-
var index$9 = Object.freeze({
|
|
6
|
-
__proto__: null,
|
|
7
|
-
SET_HEAD: SET_HEAD
|
|
8
|
-
});
|
|
1
|
+
import "immer";
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
type: SET_HEAD,
|
|
12
|
-
payload: payload
|
|
13
|
-
});
|
|
3
|
+
import { createSlice } from "@reduxjs/toolkit";
|
|
14
4
|
|
|
15
|
-
|
|
16
|
-
setHead: setHead$1
|
|
17
|
-
};
|
|
5
|
+
import { plurid } from "@plurid/plurid-themes";
|
|
18
6
|
|
|
19
7
|
const initialState$4 = {
|
|
20
8
|
title: "",
|
|
@@ -28,128 +16,76 @@ const initialState$4 = {
|
|
|
28
16
|
scripts: []
|
|
29
17
|
};
|
|
30
18
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
switch (action.type) {
|
|
39
|
-
case SET_HEAD:
|
|
40
|
-
return resolvers$4.setHead(state, action);
|
|
41
|
-
|
|
42
|
-
default:
|
|
43
|
-
return Object.assign({}, state);
|
|
19
|
+
const factory$4 = (state = initialState$4) => createSlice({
|
|
20
|
+
name: "head",
|
|
21
|
+
initialState: state,
|
|
22
|
+
reducers: {
|
|
23
|
+
setHead: (state, action) => {
|
|
24
|
+
state = Object.assign(Object.assign({}, state), action);
|
|
25
|
+
}
|
|
44
26
|
}
|
|
45
|
-
};
|
|
27
|
+
});
|
|
46
28
|
|
|
47
|
-
const
|
|
29
|
+
const slice$4 = factory$4();
|
|
48
30
|
|
|
49
|
-
const
|
|
31
|
+
const actions$4 = slice$4.actions;
|
|
32
|
+
|
|
33
|
+
const getHead = state => state.head;
|
|
50
34
|
|
|
51
35
|
const selectors$4 = {
|
|
52
|
-
|
|
36
|
+
getHead: getHead
|
|
53
37
|
};
|
|
54
38
|
|
|
55
|
-
|
|
39
|
+
const reducer$4 = slice$4.reducer;
|
|
40
|
+
|
|
41
|
+
var index$4 = Object.freeze({
|
|
56
42
|
__proto__: null,
|
|
43
|
+
factory: factory$4,
|
|
44
|
+
slice: slice$4,
|
|
57
45
|
actions: actions$4,
|
|
58
|
-
|
|
59
|
-
reducer: reducer$4,
|
|
60
|
-
metareducer: metareducer$2,
|
|
46
|
+
getHead: getHead,
|
|
61
47
|
selectors: selectors$4,
|
|
62
|
-
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const ADD_NOTIFICATION = "ADD_NOTIFICATION";
|
|
66
|
-
|
|
67
|
-
const UPDATE_NOTIFICATION = "UPDATE_NOTIFICATION";
|
|
68
|
-
|
|
69
|
-
const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
|
|
70
|
-
|
|
71
|
-
var index$7 = Object.freeze({
|
|
72
|
-
__proto__: null,
|
|
73
|
-
ADD_NOTIFICATION: ADD_NOTIFICATION,
|
|
74
|
-
UPDATE_NOTIFICATION: UPDATE_NOTIFICATION,
|
|
75
|
-
REMOVE_NOTIFICATION: REMOVE_NOTIFICATION
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const addNotification$1 = payload => ({
|
|
79
|
-
type: ADD_NOTIFICATION,
|
|
80
|
-
payload: payload
|
|
48
|
+
reducer: reducer$4
|
|
81
49
|
});
|
|
82
50
|
|
|
83
|
-
const updateNotification$1 = payload => ({
|
|
84
|
-
type: UPDATE_NOTIFICATION,
|
|
85
|
-
payload: payload
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
const removeNotification$1 = payload => ({
|
|
89
|
-
type: REMOVE_NOTIFICATION,
|
|
90
|
-
payload: payload
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
const actions$3 = {
|
|
94
|
-
addNotification: addNotification$1,
|
|
95
|
-
updateNotification: updateNotification$1,
|
|
96
|
-
removeNotification: removeNotification$1
|
|
97
|
-
};
|
|
98
|
-
|
|
99
51
|
const initialState$3 = [];
|
|
100
52
|
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (notification.id === newNotification.id) {
|
|
107
|
-
return newNotification;
|
|
108
|
-
}
|
|
109
|
-
return notification;
|
|
110
|
-
}));
|
|
111
|
-
return newState;
|
|
112
|
-
}
|
|
113
|
-
return [ ...state, newNotification ];
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const updateNotification = (state, action) => {
|
|
117
|
-
const updatedState = state.map((notification => {
|
|
118
|
-
if (notification.id === action.payload.id) {
|
|
53
|
+
const factory$3 = (state = initialState$3) => createSlice({
|
|
54
|
+
name: "notifications",
|
|
55
|
+
initialState: state,
|
|
56
|
+
reducers: {
|
|
57
|
+
addNotification: (state, action) => {
|
|
119
58
|
const newNotification = Object.assign({}, action.payload);
|
|
120
|
-
|
|
59
|
+
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
60
|
+
if (existingNotification) {
|
|
61
|
+
state = state.map((notification => {
|
|
62
|
+
if (notification.id === newNotification.id) {
|
|
63
|
+
return newNotification;
|
|
64
|
+
}
|
|
65
|
+
return notification;
|
|
66
|
+
}));
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
state = [ ...state, newNotification ];
|
|
70
|
+
},
|
|
71
|
+
updateNotification: (state, action) => {
|
|
72
|
+
state = state.map((message => {
|
|
73
|
+
if (message.id === action.payload.id) {
|
|
74
|
+
const newNotification = Object.assign({}, action.payload);
|
|
75
|
+
return newNotification;
|
|
76
|
+
}
|
|
77
|
+
return Object.assign({}, message);
|
|
78
|
+
}));
|
|
79
|
+
},
|
|
80
|
+
removeNotification: (state, action) => {
|
|
81
|
+
state = state.filter((message => message.id !== action.payload));
|
|
121
82
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
return [ ...updatedState ];
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const removeNotification = (state, action) => {
|
|
128
|
-
const updatedState = state.filter((notification => notification.id !== action.payload.id));
|
|
129
|
-
return [ ...updatedState ];
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
const resolvers$3 = {
|
|
133
|
-
addNotification: addNotification,
|
|
134
|
-
updateNotification: updateNotification,
|
|
135
|
-
removeNotification: removeNotification
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const reducer$3 = (state = initialState$3, action) => {
|
|
139
|
-
switch (action.type) {
|
|
140
|
-
case ADD_NOTIFICATION:
|
|
141
|
-
return resolvers$3.addNotification(state, action);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
142
85
|
|
|
143
|
-
|
|
144
|
-
return resolvers$3.updateNotification(state, action);
|
|
86
|
+
const slice$3 = factory$3();
|
|
145
87
|
|
|
146
|
-
|
|
147
|
-
return resolvers$3.removeNotification(state, action);
|
|
148
|
-
|
|
149
|
-
default:
|
|
150
|
-
return [ ...state ];
|
|
151
|
-
}
|
|
152
|
-
};
|
|
88
|
+
const actions$3 = slice$3.actions;
|
|
153
89
|
|
|
154
90
|
const getAll = state => state.notifications;
|
|
155
91
|
|
|
@@ -157,55 +93,34 @@ const selectors$3 = {
|
|
|
157
93
|
getAll: getAll
|
|
158
94
|
};
|
|
159
95
|
|
|
160
|
-
|
|
96
|
+
const reducer$3 = slice$3.reducer;
|
|
97
|
+
|
|
98
|
+
var index$3 = Object.freeze({
|
|
161
99
|
__proto__: null,
|
|
100
|
+
factory: factory$3,
|
|
101
|
+
slice: slice$3,
|
|
162
102
|
actions: actions$3,
|
|
163
|
-
initialState: initialState$3,
|
|
164
|
-
reducer: reducer$3,
|
|
165
103
|
selectors: selectors$3,
|
|
166
|
-
|
|
104
|
+
reducer: reducer$3
|
|
167
105
|
});
|
|
168
106
|
|
|
169
|
-
const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
|
|
170
|
-
|
|
171
|
-
var index$5 = Object.freeze({
|
|
172
|
-
__proto__: null,
|
|
173
|
-
TOGGLE_GLOBAL_SHORTCUTS: TOGGLE_GLOBAL_SHORTCUTS
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
const toggleGlobalShortcuts$1 = payload => ({
|
|
177
|
-
type: TOGGLE_GLOBAL_SHORTCUTS,
|
|
178
|
-
payload: payload
|
|
179
|
-
});
|
|
180
|
-
|
|
181
|
-
const actions$2 = {
|
|
182
|
-
toggleGlobalShortcuts: toggleGlobalShortcuts$1
|
|
183
|
-
};
|
|
184
|
-
|
|
185
107
|
const initialState$2 = {
|
|
186
108
|
global: true
|
|
187
109
|
};
|
|
188
110
|
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
111
|
+
const factory$2 = (state = initialState$2) => createSlice({
|
|
112
|
+
name: "shortcuts",
|
|
113
|
+
initialState: state,
|
|
114
|
+
reducers: {
|
|
115
|
+
toggleGlobalShortcuts: (state, action) => {
|
|
116
|
+
state.global = typeof action.payload === "boolean" ? action.payload : !state.global;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
195
120
|
|
|
196
|
-
const
|
|
197
|
-
toggleGlobalShortcuts: toggleGlobalShortcuts
|
|
198
|
-
};
|
|
121
|
+
const slice$2 = factory$2();
|
|
199
122
|
|
|
200
|
-
const
|
|
201
|
-
switch (action.type) {
|
|
202
|
-
case TOGGLE_GLOBAL_SHORTCUTS:
|
|
203
|
-
return resolvers$2.toggleGlobalShortcuts(state, action);
|
|
204
|
-
|
|
205
|
-
default:
|
|
206
|
-
return Object.assign({}, state);
|
|
207
|
-
}
|
|
208
|
-
};
|
|
123
|
+
const actions$2 = slice$2.actions;
|
|
209
124
|
|
|
210
125
|
const getGlobal = state => state.shortcuts.global;
|
|
211
126
|
|
|
@@ -213,81 +128,41 @@ const selectors$2 = {
|
|
|
213
128
|
getGlobal: getGlobal
|
|
214
129
|
};
|
|
215
130
|
|
|
216
|
-
|
|
131
|
+
const reducer$2 = slice$2.reducer;
|
|
132
|
+
|
|
133
|
+
var index$2 = Object.freeze({
|
|
217
134
|
__proto__: null,
|
|
135
|
+
factory: factory$2,
|
|
136
|
+
slice: slice$2,
|
|
218
137
|
actions: actions$2,
|
|
219
|
-
initialState: initialState$2,
|
|
220
|
-
reducer: reducer$2,
|
|
221
138
|
selectors: selectors$2,
|
|
222
|
-
|
|
139
|
+
reducer: reducer$2
|
|
223
140
|
});
|
|
224
141
|
|
|
225
|
-
const SET_SITTING_CURRENT_LINK = "SET_SITTING_CURRENT_LINK";
|
|
226
|
-
|
|
227
|
-
const TOGGLE_SITTING_TRAY = "TOGGLE_SITTING_TRAY";
|
|
228
|
-
|
|
229
|
-
var index$3 = Object.freeze({
|
|
230
|
-
__proto__: null,
|
|
231
|
-
SET_SITTING_CURRENT_LINK: SET_SITTING_CURRENT_LINK,
|
|
232
|
-
TOGGLE_SITTING_TRAY: TOGGLE_SITTING_TRAY
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
const setSittingCurrentLink$1 = link => ({
|
|
236
|
-
type: SET_SITTING_CURRENT_LINK,
|
|
237
|
-
payload: link
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
const toggleSittingTray$1 = () => ({
|
|
241
|
-
type: TOGGLE_SITTING_TRAY
|
|
242
|
-
});
|
|
243
|
-
|
|
244
|
-
const actions$1 = {
|
|
245
|
-
setSittingCurrentLink: setSittingCurrentLink$1,
|
|
246
|
-
toggleSittingTray: toggleSittingTray$1
|
|
247
|
-
};
|
|
248
|
-
|
|
249
142
|
const initialState$1 = {
|
|
250
143
|
currentLink: "",
|
|
251
144
|
tray: false
|
|
252
145
|
};
|
|
253
146
|
|
|
254
|
-
const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
147
|
+
const factory$1 = (state = initialState$1) => createSlice({
|
|
148
|
+
name: "sitting",
|
|
149
|
+
initialState: state,
|
|
150
|
+
reducers: {
|
|
151
|
+
setSittingCurrentLink: (state, action) => {
|
|
152
|
+
const currentLink = action.payload;
|
|
153
|
+
return Object.assign(Object.assign({}, state), {
|
|
154
|
+
currentLink: currentLink
|
|
155
|
+
});
|
|
156
|
+
},
|
|
157
|
+
toggleSittingTray: (state, action) => {
|
|
158
|
+
state.tray = typeof action.payload === "boolean" ? action.payload : !state.tray;
|
|
159
|
+
}
|
|
266
160
|
}
|
|
267
|
-
|
|
268
|
-
tray: !state.tray
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
const resolvers$1 = {
|
|
273
|
-
setSittingCurrentLink: setSittingCurrentLink,
|
|
274
|
-
toggleSittingTray: toggleSittingTray
|
|
275
|
-
};
|
|
161
|
+
});
|
|
276
162
|
|
|
277
|
-
const
|
|
278
|
-
switch (action.type) {
|
|
279
|
-
case SET_SITTING_CURRENT_LINK:
|
|
280
|
-
return resolvers$1.setSittingCurrentLink(state, action);
|
|
163
|
+
const slice$1 = factory$1();
|
|
281
164
|
|
|
282
|
-
|
|
283
|
-
return resolvers$1.toggleSittingTray(state, action);
|
|
284
|
-
|
|
285
|
-
default:
|
|
286
|
-
return Object.assign({}, state);
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
const metareducer$1 = initialState => (state = initialState, action) => reducer$1(state, action);
|
|
165
|
+
const actions$1 = slice$1.actions;
|
|
291
166
|
|
|
292
167
|
const getCurrentLink = state => state.sitting.currentLink;
|
|
293
168
|
|
|
@@ -298,59 +173,42 @@ const selectors$1 = {
|
|
|
298
173
|
getTray: getTray
|
|
299
174
|
};
|
|
300
175
|
|
|
301
|
-
|
|
302
|
-
__proto__: null,
|
|
303
|
-
actions: actions$1,
|
|
304
|
-
initialState: initialState$1,
|
|
305
|
-
reducer: reducer$1,
|
|
306
|
-
metareducer: metareducer$1,
|
|
307
|
-
selectors: selectors$1,
|
|
308
|
-
Types: index$3
|
|
309
|
-
});
|
|
310
|
-
|
|
311
|
-
const SET_THEME = "SET_THEME";
|
|
176
|
+
const reducer$1 = slice$1.reducer;
|
|
312
177
|
|
|
313
178
|
var index$1 = Object.freeze({
|
|
314
179
|
__proto__: null,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
payload: payload
|
|
180
|
+
factory: factory$1,
|
|
181
|
+
slice: slice$1,
|
|
182
|
+
actions: actions$1,
|
|
183
|
+
selectors: selectors$1,
|
|
184
|
+
reducer: reducer$1
|
|
321
185
|
});
|
|
322
186
|
|
|
323
|
-
const actions = {
|
|
324
|
-
setTheme: setTheme$1
|
|
325
|
-
};
|
|
326
|
-
|
|
327
187
|
const initialState = {
|
|
328
188
|
general: Object.assign({}, plurid),
|
|
329
189
|
interaction: Object.assign({}, plurid)
|
|
330
190
|
};
|
|
331
191
|
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
return resolvers.setTheme(state, action);
|
|
347
|
-
|
|
348
|
-
default:
|
|
349
|
-
return Object.assign({}, state);
|
|
192
|
+
const factory = (state = initialState) => createSlice({
|
|
193
|
+
name: "themes",
|
|
194
|
+
initialState: state,
|
|
195
|
+
reducers: {
|
|
196
|
+
setTheme: (state, action) => {
|
|
197
|
+
const {type: type, theme: theme} = action.payload;
|
|
198
|
+
state[type] = theme;
|
|
199
|
+
},
|
|
200
|
+
setGeneralTheme: (state, action) => {
|
|
201
|
+
state.general = action.payload;
|
|
202
|
+
},
|
|
203
|
+
setInteractionTheme: (state, action) => {
|
|
204
|
+
state.interaction = action.payload;
|
|
205
|
+
}
|
|
350
206
|
}
|
|
351
|
-
};
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
const slice = factory();
|
|
352
210
|
|
|
353
|
-
const
|
|
211
|
+
const actions = slice.actions;
|
|
354
212
|
|
|
355
213
|
const getGeneralTheme = state => state.themes.general;
|
|
356
214
|
|
|
@@ -361,15 +219,16 @@ const selectors = {
|
|
|
361
219
|
getInteractionTheme: getInteractionTheme
|
|
362
220
|
};
|
|
363
221
|
|
|
222
|
+
const reducer = slice.reducer;
|
|
223
|
+
|
|
364
224
|
var index = Object.freeze({
|
|
365
225
|
__proto__: null,
|
|
226
|
+
factory: factory,
|
|
227
|
+
slice: slice,
|
|
366
228
|
actions: actions,
|
|
367
|
-
initialState: initialState,
|
|
368
|
-
reducer: reducer,
|
|
369
|
-
metareducer: metareducer,
|
|
370
229
|
selectors: selectors,
|
|
371
|
-
|
|
230
|
+
reducer: reducer
|
|
372
231
|
});
|
|
373
232
|
|
|
374
|
-
export { index$
|
|
233
|
+
export { index$4 as head, index$3 as notifications, index$2 as shortcuts, index$1 as sitting, index as themes };
|
|
375
234
|
//# sourceMappingURL=index.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../source/modules/head/types/index.ts","../source/modules/head/actions/index.ts","../source/modules/head/initial/index.ts","../source/modules/head/resolvers/index.ts","../source/modules/head/reducer/index.ts","../source/modules/head/selectors/index.ts","../source/modules/notifications/types/index.ts","../source/modules/notifications/actions/index.ts","../source/modules/notifications/initial/index.ts","../source/modules/notifications/resolvers/index.ts","../source/modules/notifications/reducer/index.ts","../source/modules/notifications/selectors/index.ts","../source/modules/shortcuts/types/index.ts","../source/modules/shortcuts/actions/index.ts","../source/modules/shortcuts/initial/index.ts","../source/modules/shortcuts/resolvers/index.ts","../source/modules/shortcuts/reducer/index.ts","../source/modules/shortcuts/selectors/index.ts","../source/modules/sitting/types/index.ts","../source/modules/sitting/actions/index.ts","../source/modules/sitting/initial/index.ts","../source/modules/sitting/resolvers/index.ts","../source/modules/sitting/reducer/index.ts","../source/modules/sitting/selectors/index.ts","../source/modules/themes/types/index.ts","../source/modules/themes/actions/index.ts","../source/modules/themes/initial/index.ts","../source/modules/themes/resolvers/index.ts","../source/modules/themes/reducer/index.ts","../source/modules/themes/selectors/index.ts"],"sourcesContent":["// #region module\nexport interface Head {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\nexport const SET_HEAD = 'SET_HEAD';\nexport interface SetHeadPayload extends Partial<Head> {}\nexport interface SetHeadAction {\n type: typeof SET_HEAD;\n payload: SetHeadPayload;\n}\n\n\n\nexport interface State extends Head {}\n\n\nexport type Actions =\n | SetHeadAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\n/**\n * Overwrite any property currently set in the `head`,\n * including `styles` and `scripts`, if any.\n *\n * @param payload\n */\nconst setHead = (\n payload: Types.SetHeadPayload,\n): Types.SetHeadAction => {\n return {\n type: Types.SET_HEAD,\n payload,\n };\n}\n\n\n\nconst actions = {\n setHead,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setHead = (\n state: Types.State,\n action: Types.SetHeadAction,\n): Types.State => {\n return {\n ...state,\n ...action.payload,\n };\n}\n\n\n\nconst resolvers = {\n setHead,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.SET_HEAD:\n return resolvers.setHead(state, action);\n default:\n return {\n ...state,\n };\n }\n}\n\n\nconst metareducer = (\n initialState: Types.State,\n) => (\n state: Types.State = initialState,\n action: Types.Actions,\n) => reducer(\n state,\n action,\n);\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n metareducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getHeadData = (\n state: StateOfAny & Record<'head', Types.State>,\n) => state.head;\n\n\n\nconst selectors = {\n getHeadData,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n","// #region module\nexport interface Notification {\n id: string;\n text: string;\n html?: boolean;\n react?: boolean;\n timeout?: number;\n}\n\n\nexport const ADD_NOTIFICATION = 'ADD_NOTIFICATION';\nexport interface AddNotificationPayload extends Notification {}\nexport interface AddNotificationAction {\n type: typeof ADD_NOTIFICATION;\n payload: AddNotificationPayload;\n}\n\n\nexport const UPDATE_NOTIFICATION = 'UPDATE_NOTIFICATION';\nexport interface UpdateNotificationPayload extends Notification {}\nexport interface UpdateNotificationAction {\n type: typeof UPDATE_NOTIFICATION;\n payload: UpdateNotificationPayload;\n}\n\n\nexport const REMOVE_NOTIFICATION = 'REMOVE_NOTIFICATION';\nexport interface RemoveNotificationPayload {\n id: string;\n}\nexport interface RemoveNotificationAction {\n type: typeof REMOVE_NOTIFICATION;\n payload: RemoveNotificationPayload;\n}\n\n\n\nexport type State = Notification[];\n\n\nexport type Actions = AddNotificationAction\n | UpdateNotificationAction\n | RemoveNotificationAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst addNotification = (\n payload: Types.AddNotificationPayload,\n): Types.AddNotificationAction => {\n return {\n type: Types.ADD_NOTIFICATION,\n payload,\n };\n}\n\n\nconst updateNotification = (\n payload: Types.UpdateNotificationPayload,\n): Types.UpdateNotificationAction => {\n return {\n type: Types.UPDATE_NOTIFICATION,\n payload,\n };\n}\n\n\nconst removeNotification = (\n payload: Types.RemoveNotificationPayload,\n): Types.RemoveNotificationAction => {\n return {\n type: Types.REMOVE_NOTIFICATION,\n payload,\n };\n}\n\n\n\nconst actions = {\n addNotification,\n updateNotification,\n removeNotification,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = [];\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst addNotification = (\n state: Types.State,\n action: Types.AddNotificationAction,\n): Types.State => {\n const newNotification: Types.Notification = {\n ...action.payload,\n };\n\n const existingNotification = state.find(\n notification => notification.id === newNotification.id,\n );\n\n if (existingNotification) {\n const newState = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return newState;\n }\n\n return [\n ...state,\n newNotification,\n ];\n}\n\n\nconst updateNotification = (\n state: Types.State,\n action: Types.UpdateNotificationAction,\n): Types.State => {\n const updatedState = state.map(notification => {\n if (notification.id === action.payload.id) {\n const newNotification: Types.Notification = {\n ...action.payload,\n };\n return newNotification;\n }\n\n return {\n ...notification,\n };\n });\n\n return [\n ...updatedState,\n ];\n}\n\n\nconst removeNotification = (\n state: Types.State,\n action: Types.RemoveNotificationAction,\n): Types.State => {\n const updatedState = state.filter(\n notification => notification.id !== action.payload.id\n );\n\n return [\n ...updatedState,\n ];\n}\n\n\n\nconst resolvers = {\n addNotification,\n updateNotification,\n removeNotification,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.ADD_NOTIFICATION:\n return resolvers.addNotification(state, action);\n case Types.UPDATE_NOTIFICATION:\n return resolvers.updateNotification(state, action);\n case Types.REMOVE_NOTIFICATION:\n return resolvers.removeNotification(state, action);\n default:\n return [\n ...state,\n ];\n }\n}\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getAll = (\n state: StateOfAny & Record<'notifications', Types.State>,\n) => state.notifications;\n\n\n\nconst selectors = {\n getAll,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n","// #region module\nexport const TOGGLE_GLOBAL_SHORTCUTS = 'TOGGLE_GLOBAL_SHORTCUTS';\nexport interface ToggleGlobalShortcutsAction {\n type: typeof TOGGLE_GLOBAL_SHORTCUTS;\n payload?: boolean;\n}\n\n\n\nexport interface State {\n global: boolean;\n}\n\n\nexport type Actions =\n | ToggleGlobalShortcutsAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst toggleGlobalShortcuts = (\n payload?: boolean,\n): Types.ToggleGlobalShortcutsAction => {\n return {\n type: Types.TOGGLE_GLOBAL_SHORTCUTS,\n payload,\n };\n}\n\n\n\nconst actions = {\n toggleGlobalShortcuts,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = {\n global: true,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst toggleGlobalShortcuts = (\n state: Types.State,\n action: Types.ToggleGlobalShortcutsAction,\n) => {\n const global = action.payload\n ? action.payload\n : !state.global;\n\n return {\n ...state,\n global,\n };\n}\n\n\nconst resolvers = {\n toggleGlobalShortcuts,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.TOGGLE_GLOBAL_SHORTCUTS:\n return resolvers.toggleGlobalShortcuts(state, action);\n default:\n return {\n ...state,\n };\n }\n}\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getGlobal = (\n state: StateOfAny & Record<'shortcuts', Types.State>,\n) => state.shortcuts.global;\n\n\n\nconst selectors = {\n getGlobal,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n","// #region module\nexport const SET_SITTING_CURRENT_LINK = 'SET_SITTING_CURRENT_LINK';\nexport interface SetSittingCurrentLinkAction {\n type: typeof SET_SITTING_CURRENT_LINK;\n payload: string;\n}\n\n\nexport const TOGGLE_SITTING_TRAY = 'TOGGLE_SITTING_TRAY';\nexport interface ToggleSittingTrayAction {\n type: typeof TOGGLE_SITTING_TRAY;\n payload?: boolean;\n}\n\n\n\nexport interface State {\n currentLink: string;\n tray: boolean;\n}\n\n\nexport type Actions =\n | SetSittingCurrentLinkAction\n | ToggleSittingTrayAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setSittingCurrentLink = (\n link: string,\n): Types.SetSittingCurrentLinkAction => {\n return {\n type: Types.SET_SITTING_CURRENT_LINK,\n payload: link,\n };\n}\n\n\nconst toggleSittingTray = (): Types.ToggleSittingTrayAction => {\n return {\n type: Types.TOGGLE_SITTING_TRAY,\n };\n}\n\n\n\nconst actions = {\n setSittingCurrentLink,\n toggleSittingTray,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = {\n currentLink: '',\n tray: false,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setSittingCurrentLink = (\n state: Types.State,\n action: Types.SetSittingCurrentLinkAction,\n): Types.State => {\n const currentLink = action.payload;\n\n return {\n ...state,\n currentLink,\n };\n}\n\n\nconst toggleSittingTray = (\n state: Types.State,\n action: Types.ToggleSittingTrayAction,\n): Types.State => {\n if (typeof action.payload === 'boolean') {\n return {\n ...state,\n tray: action.payload,\n };\n }\n\n return {\n ...state,\n tray: !state.tray,\n };\n}\n\n\n\nconst resolvers = {\n setSittingCurrentLink,\n toggleSittingTray,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.SET_SITTING_CURRENT_LINK:\n return resolvers.setSittingCurrentLink(state, action);\n case Types.TOGGLE_SITTING_TRAY:\n return resolvers.toggleSittingTray(state, action);\n default:\n return {\n ...state,\n };\n }\n}\n\n\nconst metareducer = (\n initialState: Types.State,\n) => (\n state: Types.State = initialState,\n action: Types.Actions,\n) => reducer(\n state,\n action,\n);\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n metareducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getCurrentLink = (\n state: StateOfAny & Record<'sitting', Types.State>,\n) => state.sitting.currentLink;\nconst getTray = (\n state: StateOfAny & Record<'sitting', Types.State>,\n) => state.sitting.tray;\n\n\n\nconst selectors = {\n getCurrentLink,\n getTray,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n Theme,\n } from '@plurid/plurid-themes';\n // #endregion libraries\n// #endregion imports\n\n\n\n// #region module\nexport const SET_THEME = 'SET_THEME';\nexport interface SetThemePayload {\n type: 'general' | 'interaction';\n theme: Theme;\n}\nexport interface SetThemeAction {\n type: typeof SET_THEME;\n payload: SetThemePayload;\n}\n\n\n\nexport interface State {\n general: Theme,\n interaction: Theme,\n}\n\n\nexport type Actions =\n | SetThemeAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setTheme = (\n payload: Types.SetThemePayload,\n): Types.SetThemeAction => {\n return {\n type: Types.SET_THEME,\n payload,\n };\n}\n\n\n\nconst actions = {\n setTheme,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n plurid,\n } from '@plurid/plurid-themes';\n // #endregion libraries\n\n\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setTheme = (\n state: Types.State,\n action: Types.SetThemeAction,\n): Types.State => {\n const {\n type,\n theme,\n } = action.payload;\n\n const newState = {\n ...state,\n };\n\n newState[type] = {\n ...theme,\n };\n\n return newState;\n}\n\n\n\nconst resolvers = {\n setTheme,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.SET_THEME:\n return resolvers.setTheme(state, action);\n default:\n return {\n ...state,\n };\n }\n}\n\n\nconst metareducer = (\n initialState: Types.State,\n) => (\n state: Types.State = initialState,\n action: Types.Actions,\n) => reducer(\n state,\n action,\n);\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n metareducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getGeneralTheme = (\n state: StateOfAny & Record<'themes', Types.State>,\n) => state.themes.general;\nconst getInteractionTheme = (\n state: StateOfAny & Record<'themes', Types.State>,\n) => state.themes.interaction;\n\n\n\nconst selectors = {\n getGeneralTheme,\n getInteractionTheme,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n"],"names":["SET_HEAD","setHead","payload","type","Types.SET_HEAD","actions","initialState","title","description","ogTitle","ogImage","ogURL","ogDescription","canonicalURL","styles","scripts","state","action","resolvers","reducer","metareducer","getHeadData","head","selectors","ADD_NOTIFICATION","UPDATE_NOTIFICATION","REMOVE_NOTIFICATION","addNotification","Types.ADD_NOTIFICATION","updateNotification","Types.UPDATE_NOTIFICATION","removeNotification","Types.REMOVE_NOTIFICATION","newNotification","existingNotification","find","notification","id","newState","map","updatedState","filter","getAll","notifications","TOGGLE_GLOBAL_SHORTCUTS","toggleGlobalShortcuts","Types.TOGGLE_GLOBAL_SHORTCUTS","global","getGlobal","shortcuts","SET_SITTING_CURRENT_LINK","TOGGLE_SITTING_TRAY","setSittingCurrentLink","link","Types.SET_SITTING_CURRENT_LINK","toggleSittingTray","Types.TOGGLE_SITTING_TRAY","currentLink","tray","getCurrentLink","sitting","getTray","SET_THEME","setTheme","Types.SET_THEME","general","plurid","interaction","theme","getGeneralTheme","themes","getInteractionTheme"],"mappings":";;AAcO,MAAMA,WAAW;;;;;;;ACCxB,MAAMC,YACFC,YAEO;IACHC,MAAMC;IACNF,SAAAA;;;AAMR,MAAMG,YAAU;aACZJ;;;AClBJ,MAAMK,iBAA4B;IAC9BC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SA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,UAAU,CACZH,QAAqBV,cACrBW;IAEA,QAAOA,OAAOd;MACV,KAAK6D;QACD,OAAO9C,UAAU6C,SAAS/C,OAAOC;;MACrC;QACI,yBACOD;;;;AAMnB,MAAMI,cACFd,gBACC,CACDU,QAAqBV,cACrBW,WACCE,QACDH,OACAC;;ACtBJ,MAAMoD,kBACFrD,SACCA,MAAMsD,OAAOL;;AAClB,MAAMM,sBACFvD,SACCA,MAAMsD,OAAOH;;AAIlB,MAAM5C,YAAY;IACd8C,iBAAAA;IACAE,qBAAAA;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../source/modules/head/index.ts","../source/modules/notifications/index.ts","../source/modules/shortcuts/index.ts","../source/modules/sitting/index.ts","../source/modules/themes/index.ts"],"sourcesContent":["// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface HeadState {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\nconst initialState: HeadState = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n\n\nexport const factory = (\n state: HeadState = initialState,\n) => createSlice({\n name: 'head',\n initialState: state,\n reducers: {\n setHead: (\n state,\n action: PayloadAction<Partial<HeadState>>,\n ) => {\n state = {\n ...state,\n ...action,\n };\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nexport const getHead = (\n state: StateWithSlice<'head', HeadState>,\n): HeadState => state.head;\n\nexport const selectors = {\n getHead,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n Notification,\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport type NotificationsState = Notification[];\n\n\nconst initialState: NotificationsState = [];\n\n\nexport const factory = (\n state: NotificationsState = initialState,\n) => createSlice({\n name: 'notifications',\n initialState: state,\n reducers: {\n addNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n const newNotification: Notification = {\n ...action.payload,\n };\n\n const existingNotification = state.find(\n notification => notification.id === newNotification.id,\n );\n\n if (existingNotification) {\n state = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return;\n }\n\n state = [\n ...state,\n newNotification,\n ];\n },\n updateNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n state = state.map(message => {\n if (message.id === action.payload.id) {\n const newNotification: Notification = {\n ...action.payload,\n };\n return newNotification;\n }\n\n return {\n ...message,\n };\n });\n },\n removeNotification: (\n state,\n action: PayloadAction<string>,\n ) => {\n state = state.filter(\n message => message.id !== action.payload,\n );\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getAll = (\n state: StateWithSlice<'notifications', NotificationsState>,\n) => state.notifications;\n\nexport const selectors = {\n getAll,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface ShortcutsState {\n global: boolean;\n}\n\n\nconst initialState: ShortcutsState = {\n global: true,\n};\n\n\nexport const factory = (\n state: ShortcutsState = initialState,\n) => createSlice({\n name: 'shortcuts',\n initialState: state,\n reducers: {\n toggleGlobalShortcuts: (\n state,\n action: PayloadAction<boolean> | PayloadAction<void>,\n ) => {\n state.global = typeof action.payload === 'boolean'\n ? action.payload\n : !state.global;\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getGlobal = (\n state: StateWithSlice<'shortcuts', ShortcutsState>,\n) => state.shortcuts.global;\n\nexport const selectors = {\n getGlobal,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface SittingState {\n currentLink: string;\n tray: boolean;\n}\n\n\nconst initialState: SittingState = {\n currentLink: '',\n tray: false,\n};\n\n\nexport const factory = (\n state: SittingState = initialState,\n) => createSlice({\n name: 'sitting',\n initialState: state,\n reducers: {\n setSittingCurrentLink: (\n state,\n action: PayloadAction<string>,\n ) => {\n const currentLink = action.payload;\n\n return {\n ...state,\n currentLink,\n };\n },\n toggleSittingTray: (\n state,\n action: PayloadAction<boolean> | PayloadAction<void>,\n ) => {\n state.tray = typeof action.payload === 'boolean'\n ? action.payload\n : !state.tray;\n }\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getCurrentLink = (\n state: StateWithSlice<'sitting', SittingState>,\n) => state.sitting.currentLink;\nconst getTray = (\n state: StateWithSlice<'sitting', SittingState>,\n) => state.sitting.tray;\n\nexport const selectors = {\n getCurrentLink,\n getTray,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n\n\n import {\n Theme,\n plurid,\n } from '@plurid/plurid-themes';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface ThemesState {\n general: Theme;\n interaction: Theme;\n}\n\n\nconst initialState: ThemesState = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n\n\nexport interface SetThemePayload {\n type: 'general' | 'interaction';\n theme: Theme;\n}\n\n\nexport const factory = (\n state: ThemesState = initialState,\n) => createSlice({\n name: 'themes',\n initialState: state,\n reducers: {\n setTheme: (\n state,\n action: PayloadAction<SetThemePayload>,\n ) => {\n const {\n type,\n theme,\n } = action.payload;\n\n state[type] = theme;\n },\n setGeneralTheme: (\n state,\n action: PayloadAction<Theme>,\n ) => {\n state.general = action.payload;\n },\n setInteractionTheme: (\n state,\n action: PayloadAction<Theme>,\n ) => {\n state.interaction = action.payload;\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getGeneralTheme = (\n state: StateWithSlice<'themes', ThemesState>,\n) => state.themes.general;\nconst getInteractionTheme = (\n state: StateWithSlice<'themes', ThemesState>,\n) => state.themes.interaction;\n\nexport const selectors = {\n getGeneralTheme,\n getInteractionTheme,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n"],"names":["initialState","title","description","ogTitle","ogImage","ogURL","ogDescription","canonicalURL","styles","scripts","factory","state","createSlice","name","reducers","setHead","action","Object","assign","slice","actions","getHead","head","selectors","reducer","addNotification","newNotification","payload","existingNotification","find","notification","id","map","updateNotification","message","removeNotification","filter","getAll","notifications","global","toggleGlobalShortcuts","getGlobal","shortcuts","currentLink","tray","setSittingCurrentLink","toggleSittingTray","getCurrentLink","sitting","getTray","general","plurid","interaction","setTheme","type","theme","setGeneralTheme","setInteractionTheme","getGeneralTheme","themes","getInteractionTheme"],"mappings":";;;;;;AAgCA,MAAMA,iBAA0B;IAC5BC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SAAS;;;AAIN,MAAMC,YAAU,CACnBC,QAAmBX,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