@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
package/distribution/index.js
CHANGED
|
@@ -4,23 +4,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const SET_HEAD = "SET_HEAD";
|
|
10
|
-
|
|
11
|
-
var index$9 = Object.freeze({
|
|
12
|
-
__proto__: null,
|
|
13
|
-
SET_HEAD: SET_HEAD
|
|
14
|
-
});
|
|
7
|
+
require("immer");
|
|
15
8
|
|
|
16
|
-
|
|
17
|
-
type: SET_HEAD,
|
|
18
|
-
payload: payload
|
|
19
|
-
});
|
|
9
|
+
var toolkit = require("@reduxjs/toolkit");
|
|
20
10
|
|
|
21
|
-
|
|
22
|
-
setHead: setHead$1
|
|
23
|
-
};
|
|
11
|
+
var pluridThemes = require("@plurid/plurid-themes");
|
|
24
12
|
|
|
25
13
|
const initialState$4 = {
|
|
26
14
|
title: "",
|
|
@@ -34,128 +22,76 @@ const initialState$4 = {
|
|
|
34
22
|
scripts: []
|
|
35
23
|
};
|
|
36
24
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
switch (action.type) {
|
|
45
|
-
case SET_HEAD:
|
|
46
|
-
return resolvers$4.setHead(state, action);
|
|
47
|
-
|
|
48
|
-
default:
|
|
49
|
-
return Object.assign({}, state);
|
|
25
|
+
const factory$4 = (state = initialState$4) => toolkit.createSlice({
|
|
26
|
+
name: "head",
|
|
27
|
+
initialState: state,
|
|
28
|
+
reducers: {
|
|
29
|
+
setHead: (state, action) => {
|
|
30
|
+
state = Object.assign(Object.assign({}, state), action);
|
|
31
|
+
}
|
|
50
32
|
}
|
|
51
|
-
};
|
|
33
|
+
});
|
|
52
34
|
|
|
53
|
-
const
|
|
35
|
+
const slice$4 = factory$4();
|
|
54
36
|
|
|
55
|
-
const
|
|
37
|
+
const actions$4 = slice$4.actions;
|
|
38
|
+
|
|
39
|
+
const getHead = state => state.head;
|
|
56
40
|
|
|
57
41
|
const selectors$4 = {
|
|
58
|
-
|
|
42
|
+
getHead: getHead
|
|
59
43
|
};
|
|
60
44
|
|
|
61
|
-
|
|
45
|
+
const reducer$4 = slice$4.reducer;
|
|
46
|
+
|
|
47
|
+
var index$4 = Object.freeze({
|
|
62
48
|
__proto__: null,
|
|
49
|
+
factory: factory$4,
|
|
50
|
+
slice: slice$4,
|
|
63
51
|
actions: actions$4,
|
|
64
|
-
|
|
65
|
-
reducer: reducer$4,
|
|
66
|
-
metareducer: metareducer$2,
|
|
52
|
+
getHead: getHead,
|
|
67
53
|
selectors: selectors$4,
|
|
68
|
-
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
const ADD_NOTIFICATION = "ADD_NOTIFICATION";
|
|
72
|
-
|
|
73
|
-
const UPDATE_NOTIFICATION = "UPDATE_NOTIFICATION";
|
|
74
|
-
|
|
75
|
-
const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
|
|
76
|
-
|
|
77
|
-
var index$7 = Object.freeze({
|
|
78
|
-
__proto__: null,
|
|
79
|
-
ADD_NOTIFICATION: ADD_NOTIFICATION,
|
|
80
|
-
UPDATE_NOTIFICATION: UPDATE_NOTIFICATION,
|
|
81
|
-
REMOVE_NOTIFICATION: REMOVE_NOTIFICATION
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
const addNotification$1 = payload => ({
|
|
85
|
-
type: ADD_NOTIFICATION,
|
|
86
|
-
payload: payload
|
|
54
|
+
reducer: reducer$4
|
|
87
55
|
});
|
|
88
56
|
|
|
89
|
-
const updateNotification$1 = payload => ({
|
|
90
|
-
type: UPDATE_NOTIFICATION,
|
|
91
|
-
payload: payload
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
const removeNotification$1 = payload => ({
|
|
95
|
-
type: REMOVE_NOTIFICATION,
|
|
96
|
-
payload: payload
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const actions$3 = {
|
|
100
|
-
addNotification: addNotification$1,
|
|
101
|
-
updateNotification: updateNotification$1,
|
|
102
|
-
removeNotification: removeNotification$1
|
|
103
|
-
};
|
|
104
|
-
|
|
105
57
|
const initialState$3 = [];
|
|
106
58
|
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (notification.id === newNotification.id) {
|
|
113
|
-
return newNotification;
|
|
114
|
-
}
|
|
115
|
-
return notification;
|
|
116
|
-
}));
|
|
117
|
-
return newState;
|
|
118
|
-
}
|
|
119
|
-
return [ ...state, newNotification ];
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
const updateNotification = (state, action) => {
|
|
123
|
-
const updatedState = state.map((notification => {
|
|
124
|
-
if (notification.id === action.payload.id) {
|
|
59
|
+
const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
60
|
+
name: "notifications",
|
|
61
|
+
initialState: state,
|
|
62
|
+
reducers: {
|
|
63
|
+
addNotification: (state, action) => {
|
|
125
64
|
const newNotification = Object.assign({}, action.payload);
|
|
126
|
-
|
|
65
|
+
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
66
|
+
if (existingNotification) {
|
|
67
|
+
state = state.map((notification => {
|
|
68
|
+
if (notification.id === newNotification.id) {
|
|
69
|
+
return newNotification;
|
|
70
|
+
}
|
|
71
|
+
return notification;
|
|
72
|
+
}));
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
state = [ ...state, newNotification ];
|
|
76
|
+
},
|
|
77
|
+
updateNotification: (state, action) => {
|
|
78
|
+
state = state.map((message => {
|
|
79
|
+
if (message.id === action.payload.id) {
|
|
80
|
+
const newNotification = Object.assign({}, action.payload);
|
|
81
|
+
return newNotification;
|
|
82
|
+
}
|
|
83
|
+
return Object.assign({}, message);
|
|
84
|
+
}));
|
|
85
|
+
},
|
|
86
|
+
removeNotification: (state, action) => {
|
|
87
|
+
state = state.filter((message => message.id !== action.payload));
|
|
127
88
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return [ ...updatedState ];
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const removeNotification = (state, action) => {
|
|
134
|
-
const updatedState = state.filter((notification => notification.id !== action.payload.id));
|
|
135
|
-
return [ ...updatedState ];
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
const resolvers$3 = {
|
|
139
|
-
addNotification: addNotification,
|
|
140
|
-
updateNotification: updateNotification,
|
|
141
|
-
removeNotification: removeNotification
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
const reducer$3 = (state = initialState$3, action) => {
|
|
145
|
-
switch (action.type) {
|
|
146
|
-
case ADD_NOTIFICATION:
|
|
147
|
-
return resolvers$3.addNotification(state, action);
|
|
89
|
+
}
|
|
90
|
+
});
|
|
148
91
|
|
|
149
|
-
|
|
150
|
-
return resolvers$3.updateNotification(state, action);
|
|
92
|
+
const slice$3 = factory$3();
|
|
151
93
|
|
|
152
|
-
|
|
153
|
-
return resolvers$3.removeNotification(state, action);
|
|
154
|
-
|
|
155
|
-
default:
|
|
156
|
-
return [ ...state ];
|
|
157
|
-
}
|
|
158
|
-
};
|
|
94
|
+
const actions$3 = slice$3.actions;
|
|
159
95
|
|
|
160
96
|
const getAll = state => state.notifications;
|
|
161
97
|
|
|
@@ -163,55 +99,34 @@ const selectors$3 = {
|
|
|
163
99
|
getAll: getAll
|
|
164
100
|
};
|
|
165
101
|
|
|
166
|
-
|
|
102
|
+
const reducer$3 = slice$3.reducer;
|
|
103
|
+
|
|
104
|
+
var index$3 = Object.freeze({
|
|
167
105
|
__proto__: null,
|
|
106
|
+
factory: factory$3,
|
|
107
|
+
slice: slice$3,
|
|
168
108
|
actions: actions$3,
|
|
169
|
-
initialState: initialState$3,
|
|
170
|
-
reducer: reducer$3,
|
|
171
109
|
selectors: selectors$3,
|
|
172
|
-
|
|
110
|
+
reducer: reducer$3
|
|
173
111
|
});
|
|
174
112
|
|
|
175
|
-
const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
|
|
176
|
-
|
|
177
|
-
var index$5 = Object.freeze({
|
|
178
|
-
__proto__: null,
|
|
179
|
-
TOGGLE_GLOBAL_SHORTCUTS: TOGGLE_GLOBAL_SHORTCUTS
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
const toggleGlobalShortcuts$1 = payload => ({
|
|
183
|
-
type: TOGGLE_GLOBAL_SHORTCUTS,
|
|
184
|
-
payload: payload
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
const actions$2 = {
|
|
188
|
-
toggleGlobalShortcuts: toggleGlobalShortcuts$1
|
|
189
|
-
};
|
|
190
|
-
|
|
191
113
|
const initialState$2 = {
|
|
192
114
|
global: true
|
|
193
115
|
};
|
|
194
116
|
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
117
|
+
const factory$2 = (state = initialState$2) => toolkit.createSlice({
|
|
118
|
+
name: "shortcuts",
|
|
119
|
+
initialState: state,
|
|
120
|
+
reducers: {
|
|
121
|
+
toggleGlobalShortcuts: (state, action) => {
|
|
122
|
+
state.global = typeof action.payload === "boolean" ? action.payload : !state.global;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
});
|
|
201
126
|
|
|
202
|
-
const
|
|
203
|
-
toggleGlobalShortcuts: toggleGlobalShortcuts
|
|
204
|
-
};
|
|
127
|
+
const slice$2 = factory$2();
|
|
205
128
|
|
|
206
|
-
const
|
|
207
|
-
switch (action.type) {
|
|
208
|
-
case TOGGLE_GLOBAL_SHORTCUTS:
|
|
209
|
-
return resolvers$2.toggleGlobalShortcuts(state, action);
|
|
210
|
-
|
|
211
|
-
default:
|
|
212
|
-
return Object.assign({}, state);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
129
|
+
const actions$2 = slice$2.actions;
|
|
215
130
|
|
|
216
131
|
const getGlobal = state => state.shortcuts.global;
|
|
217
132
|
|
|
@@ -219,81 +134,41 @@ const selectors$2 = {
|
|
|
219
134
|
getGlobal: getGlobal
|
|
220
135
|
};
|
|
221
136
|
|
|
222
|
-
|
|
137
|
+
const reducer$2 = slice$2.reducer;
|
|
138
|
+
|
|
139
|
+
var index$2 = Object.freeze({
|
|
223
140
|
__proto__: null,
|
|
141
|
+
factory: factory$2,
|
|
142
|
+
slice: slice$2,
|
|
224
143
|
actions: actions$2,
|
|
225
|
-
initialState: initialState$2,
|
|
226
|
-
reducer: reducer$2,
|
|
227
144
|
selectors: selectors$2,
|
|
228
|
-
|
|
145
|
+
reducer: reducer$2
|
|
229
146
|
});
|
|
230
147
|
|
|
231
|
-
const SET_SITTING_CURRENT_LINK = "SET_SITTING_CURRENT_LINK";
|
|
232
|
-
|
|
233
|
-
const TOGGLE_SITTING_TRAY = "TOGGLE_SITTING_TRAY";
|
|
234
|
-
|
|
235
|
-
var index$3 = Object.freeze({
|
|
236
|
-
__proto__: null,
|
|
237
|
-
SET_SITTING_CURRENT_LINK: SET_SITTING_CURRENT_LINK,
|
|
238
|
-
TOGGLE_SITTING_TRAY: TOGGLE_SITTING_TRAY
|
|
239
|
-
});
|
|
240
|
-
|
|
241
|
-
const setSittingCurrentLink$1 = link => ({
|
|
242
|
-
type: SET_SITTING_CURRENT_LINK,
|
|
243
|
-
payload: link
|
|
244
|
-
});
|
|
245
|
-
|
|
246
|
-
const toggleSittingTray$1 = () => ({
|
|
247
|
-
type: TOGGLE_SITTING_TRAY
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
const actions$1 = {
|
|
251
|
-
setSittingCurrentLink: setSittingCurrentLink$1,
|
|
252
|
-
toggleSittingTray: toggleSittingTray$1
|
|
253
|
-
};
|
|
254
|
-
|
|
255
148
|
const initialState$1 = {
|
|
256
149
|
currentLink: "",
|
|
257
150
|
tray: false
|
|
258
151
|
};
|
|
259
152
|
|
|
260
|
-
const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
153
|
+
const factory$1 = (state = initialState$1) => toolkit.createSlice({
|
|
154
|
+
name: "sitting",
|
|
155
|
+
initialState: state,
|
|
156
|
+
reducers: {
|
|
157
|
+
setSittingCurrentLink: (state, action) => {
|
|
158
|
+
const currentLink = action.payload;
|
|
159
|
+
return Object.assign(Object.assign({}, state), {
|
|
160
|
+
currentLink: currentLink
|
|
161
|
+
});
|
|
162
|
+
},
|
|
163
|
+
toggleSittingTray: (state, action) => {
|
|
164
|
+
state.tray = typeof action.payload === "boolean" ? action.payload : !state.tray;
|
|
165
|
+
}
|
|
272
166
|
}
|
|
273
|
-
|
|
274
|
-
tray: !state.tray
|
|
275
|
-
});
|
|
276
|
-
};
|
|
277
|
-
|
|
278
|
-
const resolvers$1 = {
|
|
279
|
-
setSittingCurrentLink: setSittingCurrentLink,
|
|
280
|
-
toggleSittingTray: toggleSittingTray
|
|
281
|
-
};
|
|
167
|
+
});
|
|
282
168
|
|
|
283
|
-
const
|
|
284
|
-
switch (action.type) {
|
|
285
|
-
case SET_SITTING_CURRENT_LINK:
|
|
286
|
-
return resolvers$1.setSittingCurrentLink(state, action);
|
|
169
|
+
const slice$1 = factory$1();
|
|
287
170
|
|
|
288
|
-
|
|
289
|
-
return resolvers$1.toggleSittingTray(state, action);
|
|
290
|
-
|
|
291
|
-
default:
|
|
292
|
-
return Object.assign({}, state);
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
const metareducer$1 = initialState => (state = initialState, action) => reducer$1(state, action);
|
|
171
|
+
const actions$1 = slice$1.actions;
|
|
297
172
|
|
|
298
173
|
const getCurrentLink = state => state.sitting.currentLink;
|
|
299
174
|
|
|
@@ -304,59 +179,42 @@ const selectors$1 = {
|
|
|
304
179
|
getTray: getTray
|
|
305
180
|
};
|
|
306
181
|
|
|
307
|
-
|
|
308
|
-
__proto__: null,
|
|
309
|
-
actions: actions$1,
|
|
310
|
-
initialState: initialState$1,
|
|
311
|
-
reducer: reducer$1,
|
|
312
|
-
metareducer: metareducer$1,
|
|
313
|
-
selectors: selectors$1,
|
|
314
|
-
Types: index$3
|
|
315
|
-
});
|
|
316
|
-
|
|
317
|
-
const SET_THEME = "SET_THEME";
|
|
182
|
+
const reducer$1 = slice$1.reducer;
|
|
318
183
|
|
|
319
184
|
var index$1 = Object.freeze({
|
|
320
185
|
__proto__: null,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
payload: payload
|
|
186
|
+
factory: factory$1,
|
|
187
|
+
slice: slice$1,
|
|
188
|
+
actions: actions$1,
|
|
189
|
+
selectors: selectors$1,
|
|
190
|
+
reducer: reducer$1
|
|
327
191
|
});
|
|
328
192
|
|
|
329
|
-
const actions = {
|
|
330
|
-
setTheme: setTheme$1
|
|
331
|
-
};
|
|
332
|
-
|
|
333
193
|
const initialState = {
|
|
334
194
|
general: Object.assign({}, pluridThemes.plurid),
|
|
335
195
|
interaction: Object.assign({}, pluridThemes.plurid)
|
|
336
196
|
};
|
|
337
197
|
|
|
338
|
-
const
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
};
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return resolvers.setTheme(state, action);
|
|
353
|
-
|
|
354
|
-
default:
|
|
355
|
-
return Object.assign({}, state);
|
|
198
|
+
const factory = (state = initialState) => toolkit.createSlice({
|
|
199
|
+
name: "themes",
|
|
200
|
+
initialState: state,
|
|
201
|
+
reducers: {
|
|
202
|
+
setTheme: (state, action) => {
|
|
203
|
+
const {type: type, theme: theme} = action.payload;
|
|
204
|
+
state[type] = theme;
|
|
205
|
+
},
|
|
206
|
+
setGeneralTheme: (state, action) => {
|
|
207
|
+
state.general = action.payload;
|
|
208
|
+
},
|
|
209
|
+
setInteractionTheme: (state, action) => {
|
|
210
|
+
state.interaction = action.payload;
|
|
211
|
+
}
|
|
356
212
|
}
|
|
357
|
-
};
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
const slice = factory();
|
|
358
216
|
|
|
359
|
-
const
|
|
217
|
+
const actions = slice.actions;
|
|
360
218
|
|
|
361
219
|
const getGeneralTheme = state => state.themes.general;
|
|
362
220
|
|
|
@@ -367,23 +225,24 @@ const selectors = {
|
|
|
367
225
|
getInteractionTheme: getInteractionTheme
|
|
368
226
|
};
|
|
369
227
|
|
|
228
|
+
const reducer = slice.reducer;
|
|
229
|
+
|
|
370
230
|
var index = Object.freeze({
|
|
371
231
|
__proto__: null,
|
|
232
|
+
factory: factory,
|
|
233
|
+
slice: slice,
|
|
372
234
|
actions: actions,
|
|
373
|
-
initialState: initialState,
|
|
374
|
-
reducer: reducer,
|
|
375
|
-
metareducer: metareducer,
|
|
376
235
|
selectors: selectors,
|
|
377
|
-
|
|
236
|
+
reducer: reducer
|
|
378
237
|
});
|
|
379
238
|
|
|
380
|
-
exports.head = index$
|
|
239
|
+
exports.head = index$4;
|
|
381
240
|
|
|
382
|
-
exports.notifications = index$
|
|
241
|
+
exports.notifications = index$3;
|
|
383
242
|
|
|
384
|
-
exports.shortcuts = index$
|
|
243
|
+
exports.shortcuts = index$2;
|
|
385
244
|
|
|
386
|
-
exports.sitting = index$
|
|
245
|
+
exports.sitting = index$1;
|
|
387
246
|
|
|
388
247
|
exports.themes = index;
|
|
389
248
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.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,SAAS;;;ACTb,MAAMd,UAAU,CACZe,O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A,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.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,mBAClBY,oBAAY;IAC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ACFA,MAAIC,OACJA,SACAvC,OAAOW;YAEXhB,MAAM2C,QAAQC;;QAElBC,iBAAiB,CACb7C,OACAK;YAEAL,MAAMuC,UAAUlC,OAAOW;;QAE3B8B,qBAAqB,CACjB9C,OACAK;YAEAL,MAAMyC,cAAcpC,OAAOW;;;;;AAKhC,MAAMR,QAAQT;;AAMd,MAAMU,UAAUD,MAAMC;;AAG7B,MAAMsC,kBACF/C,SACCA,MAAMgD,OAAOT;;AAClB,MAAMU,sBACFjD,SACCA,MAAMgD,OAAOP;;AAEX,MAAM7B,YAAY;IACrBmC,iBAAAA;IACAE,qBAAAA;;;AAIG,MAAMpC,UAAUL,MAAMK;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { StateWithSlice } from "../../data/interfaces";
|
|
3
|
+
export interface HeadState {
|
|
4
|
+
title: string;
|
|
5
|
+
description: string;
|
|
6
|
+
canonicalURL: string;
|
|
7
|
+
ogTitle: string;
|
|
8
|
+
ogImage: string;
|
|
9
|
+
ogURL: string;
|
|
10
|
+
ogDescription: string;
|
|
11
|
+
styles: string[];
|
|
12
|
+
scripts: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare const factory: (state?: HeadState) => import("@reduxjs/toolkit").Slice<HeadState, {
|
|
15
|
+
setHead: (state: import("immer/dist/internal").WritableDraft<HeadState>, action: PayloadAction<Partial<HeadState>>) => void;
|
|
16
|
+
}, "head">;
|
|
17
|
+
export declare const slice: import("@reduxjs/toolkit").Slice<HeadState, {
|
|
18
|
+
setHead: (state: import("immer/dist/internal").WritableDraft<HeadState>, action: PayloadAction<Partial<HeadState>>) => void;
|
|
19
|
+
}, "head">;
|
|
20
|
+
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
21
|
+
setHead: (state: import("immer/dist/internal").WritableDraft<HeadState>, action: PayloadAction<Partial<HeadState>>) => void;
|
|
22
|
+
}>;
|
|
23
|
+
export declare const getHead: (state: StateWithSlice<'head', HeadState>) => HeadState;
|
|
24
|
+
export declare const selectors: {
|
|
25
|
+
getHead: (state: StateWithSlice<'head', HeadState>) => HeadState;
|
|
26
|
+
};
|
|
27
|
+
export declare const reducer: import("@reduxjs/toolkit").Reducer<HeadState, import("@reduxjs/toolkit").AnyAction>;
|