@plurid/plurid-ui-state-react 0.0.0-4 → 0.0.0-7

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.
Files changed (42) hide show
  1. package/distribution/data/interfaces/index.d.ts +15 -0
  2. package/distribution/index.d.ts +1 -0
  3. package/distribution/index.es.js +161 -264
  4. package/distribution/index.es.js.map +1 -1
  5. package/distribution/index.js +164 -267
  6. package/distribution/index.js.map +1 -1
  7. package/distribution/modules/head/index.d.ts +29 -6
  8. package/distribution/modules/notifications/index.d.ts +27 -6
  9. package/distribution/modules/shortcuts/index.d.ts +23 -6
  10. package/distribution/modules/sitting/index.d.ts +37 -6
  11. package/distribution/modules/themes/index.d.ts +33 -6
  12. package/package.json +9 -6
  13. package/distribution/modules/head/actions/index.d.ts +0 -5
  14. package/distribution/modules/head/initial/index.d.ts +0 -3
  15. package/distribution/modules/head/reducer/index.d.ts +0 -4
  16. package/distribution/modules/head/resolvers/index.d.ts +0 -5
  17. package/distribution/modules/head/selectors/index.d.ts +0 -6
  18. package/distribution/modules/head/types/index.d.ts +0 -21
  19. package/distribution/modules/notifications/actions/index.d.ts +0 -7
  20. package/distribution/modules/notifications/initial/index.d.ts +0 -3
  21. package/distribution/modules/notifications/reducer/index.d.ts +0 -3
  22. package/distribution/modules/notifications/resolvers/index.d.ts +0 -7
  23. package/distribution/modules/notifications/selectors/index.d.ts +0 -6
  24. package/distribution/modules/notifications/types/index.d.ts +0 -32
  25. package/distribution/modules/shortcuts/actions/index.d.ts +0 -5
  26. package/distribution/modules/shortcuts/initial/index.d.ts +0 -3
  27. package/distribution/modules/shortcuts/reducer/index.d.ts +0 -3
  28. package/distribution/modules/shortcuts/resolvers/index.d.ts +0 -7
  29. package/distribution/modules/shortcuts/selectors/index.d.ts +0 -6
  30. package/distribution/modules/shortcuts/types/index.d.ts +0 -9
  31. package/distribution/modules/sitting/actions/index.d.ts +0 -6
  32. package/distribution/modules/sitting/initial/index.d.ts +0 -3
  33. package/distribution/modules/sitting/reducer/index.d.ts +0 -4
  34. package/distribution/modules/sitting/resolvers/index.d.ts +0 -6
  35. package/distribution/modules/sitting/selectors/index.d.ts +0 -7
  36. package/distribution/modules/sitting/types/index.d.ts +0 -15
  37. package/distribution/modules/themes/actions/index.d.ts +0 -5
  38. package/distribution/modules/themes/initial/index.d.ts +0 -3
  39. package/distribution/modules/themes/reducer/index.d.ts +0 -4
  40. package/distribution/modules/themes/resolvers/index.d.ts +0 -5
  41. package/distribution/modules/themes/selectors/index.d.ts +0 -7
  42. package/distribution/modules/themes/types/index.d.ts +0 -15
@@ -4,23 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- var pluridThemes = require("@plurid/plurid-themes");
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
- const setHead$1 = payload => ({
17
- type: SET_HEAD,
18
- payload: payload
19
- });
9
+ var toolkit = require("@reduxjs/toolkit");
20
10
 
21
- const actions$4 = {
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,94 @@ const initialState$4 = {
34
22
  scripts: []
35
23
  };
36
24
 
37
- const setHead = (state, action) => Object.assign(Object.assign({}, state), action.payload);
25
+ const name$4 = "head";
38
26
 
39
- const resolvers$4 = {
40
- setHead: setHead
41
- };
42
-
43
- const reducer$4 = (state = initialState$4, action) => {
44
- switch (action.type) {
45
- case SET_HEAD:
46
- return resolvers$4.setHead(state, action);
47
-
48
- default:
49
- return Object.assign({}, state);
27
+ const factory$4 = (state = initialState$4) => toolkit.createSlice({
28
+ name: name$4,
29
+ initialState: state,
30
+ reducers: {
31
+ setHead: (state, action) => {
32
+ state = Object.assign(Object.assign({}, state), action);
33
+ }
50
34
  }
51
- };
35
+ });
52
36
 
53
- const metareducer$2 = initialState => (state = initialState, action) => reducer$4(state, action);
37
+ const slice$4 = factory$4();
54
38
 
55
- const getHeadData = state => state.head;
39
+ const actions$4 = slice$4.actions;
40
+
41
+ const getHead = state => state.head;
56
42
 
57
43
  const selectors$4 = {
58
- getHeadData: getHeadData
44
+ getHead: getHead
59
45
  };
60
46
 
61
- var index$8 = Object.freeze({
47
+ const reducer$4 = slice$4.reducer;
48
+
49
+ var index$4 = Object.freeze({
62
50
  __proto__: null,
63
- actions: actions$4,
64
51
  initialState: initialState$4,
65
- reducer: reducer$4,
66
- metareducer: metareducer$2,
52
+ name: name$4,
53
+ factory: factory$4,
54
+ slice: slice$4,
55
+ actions: actions$4,
56
+ getHead: getHead,
67
57
  selectors: selectors$4,
68
- Types: index$9
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
87
- });
88
-
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
58
+ reducer: reducer$4
97
59
  });
98
60
 
99
- const actions$3 = {
100
- addNotification: addNotification$1,
101
- updateNotification: updateNotification$1,
102
- removeNotification: removeNotification$1
103
- };
104
-
105
61
  const initialState$3 = [];
106
62
 
107
- const addNotification = (state, action) => {
108
- const newNotification = Object.assign({}, action.payload);
109
- const existingNotification = state.find((notification => notification.id === newNotification.id));
110
- if (existingNotification) {
111
- const newState = state.map((notification => {
112
- if (notification.id === newNotification.id) {
113
- return newNotification;
63
+ const name$3 = "notifications";
64
+
65
+ const factory$3 = (state = initialState$3) => toolkit.createSlice({
66
+ name: name$3,
67
+ initialState: state,
68
+ reducers: {
69
+ new: (state, action) => {
70
+ const id = Math.random() + "";
71
+ const text = action.payload;
72
+ const newNotification = {
73
+ id: id,
74
+ text: text
75
+ };
76
+ state = [ ...state, newNotification ];
77
+ },
78
+ add: (state, action) => {
79
+ const id = action.payload.id || Math.random() + "";
80
+ const newNotification = Object.assign(Object.assign({}, action.payload), {
81
+ id: id
82
+ });
83
+ const existingNotification = state.find((notification => notification.id === newNotification.id));
84
+ if (existingNotification) {
85
+ state = state.map((notification => {
86
+ if (notification.id === newNotification.id) {
87
+ return newNotification;
88
+ }
89
+ return notification;
90
+ }));
91
+ return;
114
92
  }
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) {
125
- const newNotification = Object.assign({}, action.payload);
126
- return newNotification;
93
+ state = [ ...state, newNotification ];
94
+ },
95
+ update: (state, action) => {
96
+ state = state.map((message => {
97
+ if (message.id === action.payload.id) {
98
+ const newNotification = Object.assign({}, action.payload);
99
+ return newNotification;
100
+ }
101
+ return Object.assign({}, message);
102
+ }));
103
+ },
104
+ remove: (state, action) => {
105
+ state = state.filter((message => message.id !== action.payload));
127
106
  }
128
- return Object.assign({}, notification);
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);
148
-
149
- case UPDATE_NOTIFICATION:
150
- return resolvers$3.updateNotification(state, action);
107
+ }
108
+ });
151
109
 
152
- case REMOVE_NOTIFICATION:
153
- return resolvers$3.removeNotification(state, action);
110
+ const slice$3 = factory$3();
154
111
 
155
- default:
156
- return [ ...state ];
157
- }
158
- };
112
+ const actions$3 = slice$3.actions;
159
113
 
160
114
  const getAll = state => state.notifications;
161
115
 
@@ -163,55 +117,41 @@ const selectors$3 = {
163
117
  getAll: getAll
164
118
  };
165
119
 
166
- var index$6 = Object.freeze({
120
+ const reducer$3 = slice$3.reducer;
121
+
122
+ var index$3 = Object.freeze({
167
123
  __proto__: null,
168
- actions: actions$3,
169
124
  initialState: initialState$3,
170
- reducer: reducer$3,
125
+ name: name$3,
126
+ factory: factory$3,
127
+ slice: slice$3,
128
+ actions: actions$3,
171
129
  selectors: selectors$3,
172
- Types: index$7
130
+ reducer: reducer$3
173
131
  });
174
132
 
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
133
  const initialState$2 = {
192
134
  global: true
193
135
  };
194
136
 
195
- const toggleGlobalShortcuts = (state, action) => {
196
- const global = action.payload ? action.payload : !state.global;
197
- return Object.assign(Object.assign({}, state), {
198
- global: global
199
- });
200
- };
201
-
202
- const resolvers$2 = {
203
- toggleGlobalShortcuts: toggleGlobalShortcuts
204
- };
137
+ const name$2 = "shortcuts";
138
+
139
+ const factory$2 = (state = initialState$2) => toolkit.createSlice({
140
+ name: name$2,
141
+ initialState: state,
142
+ reducers: {
143
+ setGlobalShortcuts: (state, action) => {
144
+ state.global = action.payload;
145
+ },
146
+ toggleGlobalShortcuts: (state, _action) => {
147
+ state.global = !state.global;
148
+ }
149
+ }
150
+ });
205
151
 
206
- const reducer$2 = (state = initialState$2, action) => {
207
- switch (action.type) {
208
- case TOGGLE_GLOBAL_SHORTCUTS:
209
- return resolvers$2.toggleGlobalShortcuts(state, action);
152
+ const slice$2 = factory$2();
210
153
 
211
- default:
212
- return Object.assign({}, state);
213
- }
214
- };
154
+ const actions$2 = slice$2.actions;
215
155
 
216
156
  const getGlobal = state => state.shortcuts.global;
217
157
 
@@ -219,81 +159,48 @@ const selectors$2 = {
219
159
  getGlobal: getGlobal
220
160
  };
221
161
 
222
- var index$4 = Object.freeze({
162
+ const reducer$2 = slice$2.reducer;
163
+
164
+ var index$2 = Object.freeze({
223
165
  __proto__: null,
224
- actions: actions$2,
225
166
  initialState: initialState$2,
226
- reducer: reducer$2,
167
+ name: name$2,
168
+ factory: factory$2,
169
+ slice: slice$2,
170
+ actions: actions$2,
227
171
  selectors: selectors$2,
228
- Types: index$5
229
- });
230
-
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
172
+ reducer: reducer$2
244
173
  });
245
174
 
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
175
  const initialState$1 = {
256
176
  currentLink: "",
257
177
  tray: false
258
178
  };
259
179
 
260
- const setSittingCurrentLink = (state, action) => {
261
- const currentLink = action.payload;
262
- return Object.assign(Object.assign({}, state), {
263
- currentLink: currentLink
264
- });
265
- };
266
-
267
- const toggleSittingTray = (state, action) => {
268
- if (typeof action.payload === "boolean") {
269
- return Object.assign(Object.assign({}, state), {
270
- tray: action.payload
271
- });
180
+ const name$1 = "sitting";
181
+
182
+ const factory$1 = (state = initialState$1) => toolkit.createSlice({
183
+ name: name$1,
184
+ initialState: state,
185
+ reducers: {
186
+ setSittingCurrentLink: (state, action) => {
187
+ const currentLink = action.payload;
188
+ return Object.assign(Object.assign({}, state), {
189
+ currentLink: currentLink
190
+ });
191
+ },
192
+ setSittingTray: (state, action) => {
193
+ state.tray = action.payload;
194
+ },
195
+ toggleSittingTray: (state, _action) => {
196
+ state.tray = !state.tray;
197
+ }
272
198
  }
273
- return Object.assign(Object.assign({}, state), {
274
- tray: !state.tray
275
- });
276
- };
277
-
278
- const resolvers$1 = {
279
- setSittingCurrentLink: setSittingCurrentLink,
280
- toggleSittingTray: toggleSittingTray
281
- };
282
-
283
- const reducer$1 = (state = initialState$1, action) => {
284
- switch (action.type) {
285
- case SET_SITTING_CURRENT_LINK:
286
- return resolvers$1.setSittingCurrentLink(state, action);
287
-
288
- case TOGGLE_SITTING_TRAY:
289
- return resolvers$1.toggleSittingTray(state, action);
199
+ });
290
200
 
291
- default:
292
- return Object.assign({}, state);
293
- }
294
- };
201
+ const slice$1 = factory$1();
295
202
 
296
- const metareducer$1 = initialState => (state = initialState, action) => reducer$1(state, action);
203
+ const actions$1 = slice$1.actions;
297
204
 
298
205
  const getCurrentLink = state => state.sitting.currentLink;
299
206
 
@@ -304,59 +211,46 @@ const selectors$1 = {
304
211
  getTray: getTray
305
212
  };
306
213
 
307
- var index$2 = Object.freeze({
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";
214
+ const reducer$1 = slice$1.reducer;
318
215
 
319
216
  var index$1 = Object.freeze({
320
217
  __proto__: null,
321
- SET_THEME: SET_THEME
322
- });
323
-
324
- const setTheme$1 = payload => ({
325
- type: SET_THEME,
326
- payload: payload
218
+ initialState: initialState$1,
219
+ name: name$1,
220
+ factory: factory$1,
221
+ slice: slice$1,
222
+ actions: actions$1,
223
+ selectors: selectors$1,
224
+ reducer: reducer$1
327
225
  });
328
226
 
329
- const actions = {
330
- setTheme: setTheme$1
331
- };
332
-
333
227
  const initialState = {
334
228
  general: Object.assign({}, pluridThemes.plurid),
335
229
  interaction: Object.assign({}, pluridThemes.plurid)
336
230
  };
337
231
 
338
- const setTheme = (state, action) => {
339
- const {type: type, theme: theme} = action.payload;
340
- const newState = Object.assign({}, state);
341
- newState[type] = Object.assign({}, theme);
342
- return newState;
343
- };
344
-
345
- const resolvers = {
346
- setTheme: setTheme
347
- };
348
-
349
- const reducer = (state = initialState, action) => {
350
- switch (action.type) {
351
- case SET_THEME:
352
- return resolvers.setTheme(state, action);
353
-
354
- default:
355
- return Object.assign({}, state);
232
+ const name = "themes";
233
+
234
+ const factory = (state = initialState) => toolkit.createSlice({
235
+ name: name,
236
+ initialState: state,
237
+ reducers: {
238
+ setTheme: (state, action) => {
239
+ const {type: type, theme: theme} = action.payload;
240
+ state[type] = theme;
241
+ },
242
+ setGeneralTheme: (state, action) => {
243
+ state.general = action.payload;
244
+ },
245
+ setInteractionTheme: (state, action) => {
246
+ state.interaction = action.payload;
247
+ }
356
248
  }
357
- };
249
+ });
250
+
251
+ const slice = factory();
358
252
 
359
- const metareducer = initialState => (state = initialState, action) => reducer(state, action);
253
+ const actions = slice.actions;
360
254
 
361
255
  const getGeneralTheme = state => state.themes.general;
362
256
 
@@ -367,23 +261,26 @@ const selectors = {
367
261
  getInteractionTheme: getInteractionTheme
368
262
  };
369
263
 
264
+ const reducer = slice.reducer;
265
+
370
266
  var index = Object.freeze({
371
267
  __proto__: null,
372
- actions: actions,
373
268
  initialState: initialState,
374
- reducer: reducer,
375
- metareducer: metareducer,
269
+ name: name,
270
+ factory: factory,
271
+ slice: slice,
272
+ actions: actions,
376
273
  selectors: selectors,
377
- Types: index$1
274
+ reducer: reducer
378
275
  });
379
276
 
380
- exports.head = index$8;
277
+ exports.head = index$4;
381
278
 
382
- exports.notifications = index$6;
279
+ exports.notifications = index$3;
383
280
 
384
- exports.shortcuts = index$4;
281
+ exports.shortcuts = index$2;
385
282
 
386
- exports.sitting = index$2;
283
+ exports.sitting = index$1;
387
284
 
388
285
  exports.themes = index;
389
286
  //# 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 wordBreak?: boolean;\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","Object","assign","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,OACAC,WAEAC,OAAAC,OAAAD,OAAAC,OAAA,IACOH,QACAC,OAAOf;;AAMlB,MAAMkB,cAAY;IACdnB,SAAAA;;;ACTJ,MAAMoB,YAAU,CACZL,QAAqBV,gBACrBW;IAEA,QAAOA,OAAOd;MACV,KAAKC;QACD,OAAOgB,YAAUnB,QAAQe,OAAOC;;MACpC;QACI,OAAAC,OAAAC,OAAA,IACOH;;;;AAMnB,MAAMM,gBACFhB,gBACC,CACDU,QAAqBV,cACrBW,WACCI,UACDL,OACAC;;ACtBJ,MAAMM,cACFP,SACCA,MAAMQ;;AAIX,MAAMC,cAAY;IACdF,aAAAA;;;;;;;;;;;;;ACTG,MAAMG,mBAAmB;;AAQzB,MAAMC,sBAAsB;;AAQ5B,MAAMC,sBAAsB;;;;;;;;;AClBnC,MAAMC,oBACF3B,YAEO;IACHC,MAAM2B;IACN5B,SAAAA;;;AAKR,MAAM6B,uBACF7B,YAEO;IACHC,MAAM6B;IACN9B,SAAAA;;;AAKR,MAAM+B,uBACF/B,YAEO;IACHC,MAAM+B;IACNhC,SAAAA;;;AAMR,MAAMG,YAAU;qBACZwB;wBACAE;wBACAE;;;AClCJ,MAAM3B,iBAA4B;;ACAlC,MAAMuB,kBAAkB,CACpBb,OACAC;IAEA,MAAMkB,kBACCjB,OAAAC,OAAA,IAAAF,OAAOf;IAG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ClD,KAAKyC;QACD,OAAOtC,YAAUqC,kBAAkBzC,OAAOC;;MAC9C;QACI,OAAAC,OAAAC,OAAA,IACOH;;;;AAMnB,MAAMM,gBACFhB,gBACC,CACDU,QAAqBV,cACrBW,WACCI,UACDL,OACAC;;ACxBJ,MAAM4C,iBACF7C,SACCA,MAAM8C,QAAQH;;AACnB,MAAMI,UACF/C,SACCA,MAAM8C,QAAQF;;AAInB,MAAMnC,cAAY;IACdoC,gBAAAA;IACAE,SAAAA;;;;;;;;;;;;;ACbG,MAAMC,YAAY;;;;;;;ACFzB,MAAMC,aACF/D,YAEO;IACHC,MAAM+D;IACNhE,SAAAA;;;AAMR,MAAMG,UAAU;cACZ4D;;;ACLJ,MAAM3D,eAA4B;IAC9B6D,SAAOjD,OAAAC,OAAA,IACAiD,aAAAA;IAEPC,aAAWnD,OAAAC,OAAA,IACJiD,aAAAA;;;ACZX,MAAMH,WAAW,CACbjD,OACAC;IAEA,OAAMd,MACFA,MAAImE,OACJA,SACArD,OAAOf;IAEX,MAAMsC,WAAQtB,OAAAC,OAAA,IACPH;IAGPwB,SAASrC,QACFe,OAAAC,OAAA,IAAAmD;IAGP,OAAO9B;;;AAKX,MAAMpB,YAAY;IACd6C,UAAAA;;;ACnBJ,MAAM5C,UAAU,CACZL,QAAqBV,cACrBW;IAEA,QAAOA,OAAOd;MACV,KAAK+D;QACD,OAAO9C,UAAU6C,SAASjD,OAAOC;;MACrC;QACI,OAAAC,OAAAC,OAAA,IACOH;;;;AAMnB,MAAMM,cACFhB,gBACC,CACDU,QAAqBV,cACrBW,WACCI,QACDL,OACAC;;ACtBJ,MAAMsD,kBACFvD,SACCA,MAAMwD,OAAOL;;AAClB,MAAMM,sBACFzD,SACCA,MAAMwD,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\nexport const initialState: HeadState = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n\nexport const name = 'head' as const;\n\n\nexport const factory = (\n state: HeadState = initialState,\n) => createSlice({\n name,\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<typeof name, 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 AddNotificationPayload,\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport type NotificationsState = Notification[];\n\n\nexport const initialState: NotificationsState = [];\n\nexport const name = 'notifications' as const;\n\n\nexport const factory = (\n state: NotificationsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n new: (\n state,\n action: PayloadAction<string>,\n ) => {\n const id = Math.random() + '';\n const text = action.payload;\n\n const newNotification: Notification = {\n id,\n text,\n };\n\n state = [\n ...state,\n newNotification,\n ];\n },\n add: (\n state,\n action: PayloadAction<AddNotificationPayload>,\n ) => {\n const id = action.payload.id || Math.random() + '';\n\n const newNotification: Notification = {\n ...action.payload,\n id,\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 update: (\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 remove: (\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<typeof name, 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\nexport const initialState: ShortcutsState = {\n global: true,\n};\n\nexport const name = 'shortcuts' as const;\n\n\nexport const factory = (\n state: ShortcutsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n setGlobalShortcuts: (\n state,\n action: PayloadAction<boolean>,\n ) => {\n state.global = action.payload;\n },\n toggleGlobalShortcuts: (\n state,\n _action: PayloadAction<void>,\n ) => {\n state.global = !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<typeof name, 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\nexport const initialState: SittingState = {\n currentLink: '',\n tray: false,\n};\n\nexport const name = 'sitting' as const;\n\n\nexport const factory = (\n state: SittingState = initialState,\n) => createSlice({\n name,\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 setSittingTray: (\n state,\n action: PayloadAction<boolean>,\n ) => {\n state.tray = action.payload;\n },\n toggleSittingTray: (\n state,\n _action: PayloadAction<void>,\n ) => {\n state.tray = !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<typeof name, SittingState>,\n) => state.sitting.currentLink;\nconst getTray = (\n state: StateWithSlice<typeof name, 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\nexport const initialState: ThemesState = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n\nexport const name = 'themes' as const;\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,\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<typeof name, ThemesState>,\n) => state.themes.general;\nconst getInteractionTheme = (\n state: StateWithSlice<typeof name, 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","name","factory","state","createSlice","reducers","setHead","action","Object","assign","slice","actions","getHead","head","selectors","reducer","new","id","Math","random","text","payload","newNotification","add","existingNotification","find","notification","map","update","message","remove","filter","getAll","notifications","global","setGlobalShortcuts","toggleGlobalShortcuts","_action","getGlobal","shortcuts","currentLink","tray","setSittingCurrentLink","setSittingTray","toggleSittingTray","getCurrentLink","sitting","getTray","general","plurid","interaction","setTheme","type","theme","setGeneralTheme","setInteractionTheme","getGeneralTheme","themes","getInteractionTheme"],"mappings":";;;;;;;;;;;;AAgCO,MAAMA,iBAA0B;IACnCC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SAAS;;;AAGN,MAAMC,SAAO;;AAGb,MAAMC,YAAU,CACnBC,QAAmBZ,mBAClBa,oBAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNC,SAAS,CACLH,OACAI;YAEAJ,QACOK,OAAA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