@plurid/plurid-ui-state-react 0.0.0-1

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 (46) hide show
  1. package/LICENSE +6 -0
  2. package/LICENSE.deon +8 -0
  3. package/README.md +62 -0
  4. package/distribution/data/interfaces/index.d.ts +3 -0
  5. package/distribution/index.d.ts +2 -0
  6. package/distribution/index.es.js +365 -0
  7. package/distribution/index.es.js.map +1 -0
  8. package/distribution/index.js +379 -0
  9. package/distribution/index.js.map +1 -0
  10. package/distribution/modules/head/actions/index.d.ts +5 -0
  11. package/distribution/modules/head/index.d.ts +6 -0
  12. package/distribution/modules/head/initial/index.d.ts +3 -0
  13. package/distribution/modules/head/reducer/index.d.ts +4 -0
  14. package/distribution/modules/head/resolvers/index.d.ts +5 -0
  15. package/distribution/modules/head/selectors/index.d.ts +6 -0
  16. package/distribution/modules/head/types/index.d.ts +21 -0
  17. package/distribution/modules/index.d.ts +6 -0
  18. package/distribution/modules/notifications/actions/index.d.ts +7 -0
  19. package/distribution/modules/notifications/index.d.ts +6 -0
  20. package/distribution/modules/notifications/initial/index.d.ts +3 -0
  21. package/distribution/modules/notifications/reducer/index.d.ts +3 -0
  22. package/distribution/modules/notifications/resolvers/index.d.ts +7 -0
  23. package/distribution/modules/notifications/selectors/index.d.ts +6 -0
  24. package/distribution/modules/notifications/types/index.d.ts +31 -0
  25. package/distribution/modules/shortcuts/actions/index.d.ts +5 -0
  26. package/distribution/modules/shortcuts/index.d.ts +6 -0
  27. package/distribution/modules/shortcuts/initial/index.d.ts +3 -0
  28. package/distribution/modules/shortcuts/reducer/index.d.ts +3 -0
  29. package/distribution/modules/shortcuts/resolvers/index.d.ts +7 -0
  30. package/distribution/modules/shortcuts/selectors/index.d.ts +6 -0
  31. package/distribution/modules/shortcuts/types/index.d.ts +9 -0
  32. package/distribution/modules/sitting/actions/index.d.ts +6 -0
  33. package/distribution/modules/sitting/index.d.ts +6 -0
  34. package/distribution/modules/sitting/initial/index.d.ts +3 -0
  35. package/distribution/modules/sitting/reducer/index.d.ts +4 -0
  36. package/distribution/modules/sitting/resolvers/index.d.ts +6 -0
  37. package/distribution/modules/sitting/selectors/index.d.ts +7 -0
  38. package/distribution/modules/sitting/types/index.d.ts +15 -0
  39. package/distribution/modules/themes/actions/index.d.ts +5 -0
  40. package/distribution/modules/themes/index.d.ts +6 -0
  41. package/distribution/modules/themes/initial/index.d.ts +3 -0
  42. package/distribution/modules/themes/reducer/index.d.ts +4 -0
  43. package/distribution/modules/themes/resolvers/index.d.ts +5 -0
  44. package/distribution/modules/themes/selectors/index.d.ts +7 -0
  45. package/distribution/modules/themes/types/index.d.ts +15 -0
  46. package/package.json +64 -0
package/LICENSE ADDED
@@ -0,0 +1,6 @@
1
+ delicense
2
+
3
+ Anyone interested in using the data associated to this delicense is free to do
4
+ anything with and to it.
5
+
6
+ The data stands 'as is', free of any warranty.
package/LICENSE.deon ADDED
@@ -0,0 +1,8 @@
1
+ inject text from LICENSE
2
+
3
+
4
+ {
5
+ owner 'Plurid, Inc.'
6
+ year 2019
7
+ #text
8
+ }
package/README.md ADDED
@@ -0,0 +1,62 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/plurid/plurid/master/about/identity/plurid-p-logo.png" height="250px">
3
+ <br />
4
+ <br />
5
+ <a target="_blank" href="https://github.com/plurid/plurid-ui/blob/master/LICENSE">
6
+ <img src="https://img.shields.io/badge/license-DEL-blue.svg?colorB=1380C3&style=for-the-badge" alt="License: DEL">
7
+ </a>
8
+ </p>
9
+
10
+
11
+
12
+ <h1 align="center">
13
+ plurid' user interface state for React
14
+ </h1>
15
+
16
+
17
+
18
+ ### Contents
19
+
20
+ + [About](#about)
21
+ + [Packages](#packages)
22
+ + [Codeophon](#codeophon)
23
+
24
+
25
+
26
+ ## About
27
+
28
+ The package contains state modules for:
29
+
30
+ + head
31
+ + notifications
32
+ + shortcuts
33
+ + sitting
34
+ + themes
35
+
36
+
37
+
38
+ ## Packages
39
+
40
+ <a target="_blank" href="https://www.npmjs.com/package/@plurid/plurid-ui-state-react">
41
+ <img src="https://img.shields.io/npm/v/@plurid/plurid-ui-state-react.svg?logo=npm&colorB=1380C3&style=for-the-badge" alt="Version">
42
+ </a>
43
+
44
+ [@plurid/plurid-ui-state-react][plurid-ui-state-react] • plurid' user interface state for `React`
45
+
46
+ [plurid-ui-state-react]: https://github.com/plurid/plurid-state/tree/master/packages/plurid-ui-state-react
47
+
48
+
49
+ <a target="_blank" href="https://www.npmjs.com/package/@plurid/plurid-ui-components-react">
50
+ <img src="https://img.shields.io/npm/v/@plurid/plurid-ui-components-react.svg?logo=npm&colorB=1380C3&style=for-the-badge" alt="Version">
51
+ </a>
52
+
53
+ [@plurid/plurid-ui-components-react][plurid-ui-components-react] • plurid' user interface components for `React`
54
+
55
+ [plurid-ui-components-react]: https://github.com/plurid/plurid-ui/tree/master/packages/plurid-ui-components-react
56
+
57
+
58
+
59
+ ## [Codeophon](https://github.com/ly3xqhl8g9/codeophon)
60
+
61
+ + licensing: [delicense](https://github.com/ly3xqhl8g9/delicense)
62
+ + versioning: [αver](https://github.com/ly3xqhl8g9/alpha-versioning)
@@ -0,0 +1,3 @@
1
+ export interface StateOfAny {
2
+ [key: string]: any;
3
+ }
@@ -0,0 +1,2 @@
1
+ export * from './data/interfaces';
2
+ export * from './modules';
@@ -0,0 +1,365 @@
1
+ import { plurid } from "@plurid/plurid-themes";
2
+
3
+ const SET_HEAD = "SET_HEAD";
4
+
5
+ var index$9 = Object.freeze({
6
+ __proto__: null,
7
+ SET_HEAD: SET_HEAD
8
+ });
9
+
10
+ const setHead$1 = payload => ({
11
+ type: SET_HEAD,
12
+ payload: payload
13
+ });
14
+
15
+ const actions$4 = {
16
+ setHead: setHead$1
17
+ };
18
+
19
+ const initialState$4 = {
20
+ title: "",
21
+ description: "",
22
+ ogTitle: "",
23
+ ogImage: "",
24
+ ogURL: "",
25
+ ogDescription: "",
26
+ canonicalURL: "",
27
+ styles: [],
28
+ scripts: []
29
+ };
30
+
31
+ const setHead = (state, action) => Object.assign(Object.assign({}, state), action.payload);
32
+
33
+ const resolvers$4 = {
34
+ setHead: setHead
35
+ };
36
+
37
+ const reducer$4 = (state = initialState$4, action) => {
38
+ switch (action.type) {
39
+ case SET_HEAD:
40
+ return resolvers$4.setHead(state, action);
41
+
42
+ default:
43
+ return Object.assign({}, state);
44
+ }
45
+ };
46
+
47
+ const metareducer$2 = initialState => (state = initialState, action) => reducer$4(state, action);
48
+
49
+ const getHeadData = state => state.head;
50
+
51
+ const selectors$4 = {
52
+ getHeadData: getHeadData
53
+ };
54
+
55
+ var index$8 = Object.freeze({
56
+ __proto__: null,
57
+ actions: actions$4,
58
+ initialState: initialState$4,
59
+ reducer: reducer$4,
60
+ metareducer: metareducer$2,
61
+ selectors: selectors$4,
62
+ Types: index$9
63
+ });
64
+
65
+ const ADD_NOTIFICATION = "ADD_NOTIFICATION";
66
+
67
+ const UPDATE_NOTIFICATION = "UPDATE_NOTIFICATION";
68
+
69
+ const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
70
+
71
+ var index$7 = Object.freeze({
72
+ __proto__: null,
73
+ ADD_NOTIFICATION: ADD_NOTIFICATION,
74
+ UPDATE_NOTIFICATION: UPDATE_NOTIFICATION,
75
+ REMOVE_NOTIFICATION: REMOVE_NOTIFICATION
76
+ });
77
+
78
+ const addNotification$1 = payload => ({
79
+ type: ADD_NOTIFICATION,
80
+ payload: payload
81
+ });
82
+
83
+ const updateNotification$1 = payload => ({
84
+ type: UPDATE_NOTIFICATION,
85
+ payload: payload
86
+ });
87
+
88
+ const removeNotification$1 = payload => ({
89
+ type: REMOVE_NOTIFICATION,
90
+ payload: payload
91
+ });
92
+
93
+ const actions$3 = {
94
+ addNotification: addNotification$1,
95
+ updateNotification: updateNotification$1,
96
+ removeNotification: removeNotification$1
97
+ };
98
+
99
+ const initialState$3 = [];
100
+
101
+ const addNotification = (state, action) => {
102
+ const newNotification = Object.assign({}, action.payload);
103
+ return [ ...state, newNotification ];
104
+ };
105
+
106
+ const updateNotification = (state, action) => {
107
+ const updatedState = state.map((notification => {
108
+ if (notification.id === action.payload.id) {
109
+ const newNotification = Object.assign({}, action.payload);
110
+ return newNotification;
111
+ }
112
+ return Object.assign({}, notification);
113
+ }));
114
+ return [ ...updatedState ];
115
+ };
116
+
117
+ const removeNotification = (state, action) => {
118
+ const updatedState = state.filter((notification => notification.id !== action.payload.id));
119
+ return [ ...updatedState ];
120
+ };
121
+
122
+ const resolvers$3 = {
123
+ addNotification: addNotification,
124
+ updateNotification: updateNotification,
125
+ removeNotification: removeNotification
126
+ };
127
+
128
+ const reducer$3 = (state = initialState$3, action) => {
129
+ switch (action.type) {
130
+ case ADD_NOTIFICATION:
131
+ return resolvers$3.addNotification(state, action);
132
+
133
+ case UPDATE_NOTIFICATION:
134
+ return resolvers$3.updateNotification(state, action);
135
+
136
+ case REMOVE_NOTIFICATION:
137
+ return resolvers$3.removeNotification(state, action);
138
+
139
+ default:
140
+ return [ ...state ];
141
+ }
142
+ };
143
+
144
+ const getAll = state => state.notifications;
145
+
146
+ const selectors$3 = {
147
+ getAll: getAll
148
+ };
149
+
150
+ var index$6 = Object.freeze({
151
+ __proto__: null,
152
+ actions: actions$3,
153
+ initialState: initialState$3,
154
+ reducer: reducer$3,
155
+ selectors: selectors$3,
156
+ Types: index$7
157
+ });
158
+
159
+ const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
160
+
161
+ var index$5 = Object.freeze({
162
+ __proto__: null,
163
+ TOGGLE_GLOBAL_SHORTCUTS: TOGGLE_GLOBAL_SHORTCUTS
164
+ });
165
+
166
+ const toggleGlobalShortcuts$1 = payload => ({
167
+ type: TOGGLE_GLOBAL_SHORTCUTS,
168
+ payload: payload
169
+ });
170
+
171
+ const actions$2 = {
172
+ toggleGlobalShortcuts: toggleGlobalShortcuts$1
173
+ };
174
+
175
+ const initialState$2 = {
176
+ global: true
177
+ };
178
+
179
+ const toggleGlobalShortcuts = (state, action) => {
180
+ const global = action.payload ? action.payload : !state.global;
181
+ return Object.assign(Object.assign({}, state), {
182
+ global: global
183
+ });
184
+ };
185
+
186
+ const resolvers$2 = {
187
+ toggleGlobalShortcuts: toggleGlobalShortcuts
188
+ };
189
+
190
+ const reducer$2 = (state = initialState$2, action) => {
191
+ switch (action.type) {
192
+ case TOGGLE_GLOBAL_SHORTCUTS:
193
+ return resolvers$2.toggleGlobalShortcuts(state, action);
194
+
195
+ default:
196
+ return Object.assign({}, state);
197
+ }
198
+ };
199
+
200
+ const getGlobal = state => state.shortcuts.global;
201
+
202
+ const selectors$2 = {
203
+ getGlobal: getGlobal
204
+ };
205
+
206
+ var index$4 = Object.freeze({
207
+ __proto__: null,
208
+ actions: actions$2,
209
+ initialState: initialState$2,
210
+ reducer: reducer$2,
211
+ selectors: selectors$2,
212
+ Types: index$5
213
+ });
214
+
215
+ const SET_SITTING_CURRENT_LINK = "SET_SITTING_CURRENT_LINK";
216
+
217
+ const TOGGLE_SITTING_TRAY = "TOGGLE_SITTING_TRAY";
218
+
219
+ var index$3 = Object.freeze({
220
+ __proto__: null,
221
+ SET_SITTING_CURRENT_LINK: SET_SITTING_CURRENT_LINK,
222
+ TOGGLE_SITTING_TRAY: TOGGLE_SITTING_TRAY
223
+ });
224
+
225
+ const setSittingCurrentLink$1 = link => ({
226
+ type: SET_SITTING_CURRENT_LINK,
227
+ payload: link
228
+ });
229
+
230
+ const toggleSittingTray$1 = () => ({
231
+ type: TOGGLE_SITTING_TRAY
232
+ });
233
+
234
+ const actions$1 = {
235
+ setSittingCurrentLink: setSittingCurrentLink$1,
236
+ toggleSittingTray: toggleSittingTray$1
237
+ };
238
+
239
+ const initialState$1 = {
240
+ currentLink: "",
241
+ tray: false
242
+ };
243
+
244
+ const setSittingCurrentLink = (state, action) => {
245
+ const currentLink = action.payload;
246
+ return Object.assign(Object.assign({}, state), {
247
+ currentLink: currentLink
248
+ });
249
+ };
250
+
251
+ const toggleSittingTray = (state, action) => {
252
+ if (typeof action.payload === "boolean") {
253
+ return Object.assign(Object.assign({}, state), {
254
+ tray: action.payload
255
+ });
256
+ }
257
+ return Object.assign(Object.assign({}, state), {
258
+ tray: !state.tray
259
+ });
260
+ };
261
+
262
+ const resolvers$1 = {
263
+ setSittingCurrentLink: setSittingCurrentLink,
264
+ toggleSittingTray: toggleSittingTray
265
+ };
266
+
267
+ const reducer$1 = (state = initialState$1, action) => {
268
+ switch (action.type) {
269
+ case SET_SITTING_CURRENT_LINK:
270
+ return resolvers$1.setSittingCurrentLink(state, action);
271
+
272
+ case TOGGLE_SITTING_TRAY:
273
+ return resolvers$1.toggleSittingTray(state, action);
274
+
275
+ default:
276
+ return Object.assign({}, state);
277
+ }
278
+ };
279
+
280
+ const metareducer$1 = initialState => (state = initialState, action) => reducer$1(state, action);
281
+
282
+ const getCurrentLink = state => state.sitting.currentLink;
283
+
284
+ const getTray = state => state.sitting.tray;
285
+
286
+ const selectors$1 = {
287
+ getCurrentLink: getCurrentLink,
288
+ getTray: getTray
289
+ };
290
+
291
+ var index$2 = Object.freeze({
292
+ __proto__: null,
293
+ actions: actions$1,
294
+ initialState: initialState$1,
295
+ reducer: reducer$1,
296
+ metareducer: metareducer$1,
297
+ selectors: selectors$1,
298
+ Types: index$3
299
+ });
300
+
301
+ const SET_THEME = "SET_THEME";
302
+
303
+ var index$1 = Object.freeze({
304
+ __proto__: null,
305
+ SET_THEME: SET_THEME
306
+ });
307
+
308
+ const setTheme$1 = payload => ({
309
+ type: SET_THEME,
310
+ payload: payload
311
+ });
312
+
313
+ const actions = {
314
+ setTheme: setTheme$1
315
+ };
316
+
317
+ const initialState = {
318
+ general: Object.assign({}, plurid),
319
+ interaction: Object.assign({}, plurid)
320
+ };
321
+
322
+ const setTheme = (state, action) => {
323
+ const {type: type, theme: theme} = action.payload;
324
+ const newState = Object.assign({}, state);
325
+ newState[type] = Object.assign({}, theme);
326
+ return newState;
327
+ };
328
+
329
+ const resolvers = {
330
+ setTheme: setTheme
331
+ };
332
+
333
+ const reducer = (state = initialState, action) => {
334
+ switch (action.type) {
335
+ case SET_THEME:
336
+ return resolvers.setTheme(state, action);
337
+
338
+ default:
339
+ return Object.assign({}, state);
340
+ }
341
+ };
342
+
343
+ const metareducer = initialState => (state = initialState, action) => reducer(state, action);
344
+
345
+ const getGeneralTheme = state => state.themes.general;
346
+
347
+ const getInteractionTheme = state => state.themes.interaction;
348
+
349
+ const selectors = {
350
+ getGeneralTheme: getGeneralTheme,
351
+ getInteractionTheme: getInteractionTheme
352
+ };
353
+
354
+ var index = Object.freeze({
355
+ __proto__: null,
356
+ actions: actions,
357
+ initialState: initialState,
358
+ reducer: reducer,
359
+ metareducer: metareducer,
360
+ selectors: selectors,
361
+ Types: index$1
362
+ });
363
+
364
+ export { index$8 as head, index$6 as notifications, index$4 as shortcuts, index$2 as sitting, index as themes };
365
+ //# sourceMappingURL=index.es.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es.js","sources":["../source/modules/head/types/index.ts","../source/modules/head/actions/index.ts","../source/modules/head/initial/index.ts","../source/modules/head/resolvers/index.ts","../source/modules/head/reducer/index.ts","../source/modules/head/selectors/index.ts","../source/modules/notifications/types/index.ts","../source/modules/notifications/actions/index.ts","../source/modules/notifications/initial/index.ts","../source/modules/notifications/resolvers/index.ts","../source/modules/notifications/reducer/index.ts","../source/modules/notifications/selectors/index.ts","../source/modules/shortcuts/types/index.ts","../source/modules/shortcuts/actions/index.ts","../source/modules/shortcuts/initial/index.ts","../source/modules/shortcuts/resolvers/index.ts","../source/modules/shortcuts/reducer/index.ts","../source/modules/shortcuts/selectors/index.ts","../source/modules/sitting/types/index.ts","../source/modules/sitting/actions/index.ts","../source/modules/sitting/initial/index.ts","../source/modules/sitting/resolvers/index.ts","../source/modules/sitting/reducer/index.ts","../source/modules/sitting/selectors/index.ts","../source/modules/themes/types/index.ts","../source/modules/themes/actions/index.ts","../source/modules/themes/initial/index.ts","../source/modules/themes/resolvers/index.ts","../source/modules/themes/reducer/index.ts","../source/modules/themes/selectors/index.ts"],"sourcesContent":["// #region module\nexport interface Head {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\nexport const SET_HEAD = 'SET_HEAD';\nexport interface SetHeadPayload extends Partial<Head> {}\nexport interface SetHeadAction {\n type: typeof SET_HEAD;\n payload: SetHeadPayload;\n}\n\n\n\nexport interface State extends Head {}\n\n\nexport type Actions =\n | SetHeadAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\n/**\n * Overwrite any property currently set in the `head`,\n * including `styles` and `scripts`, if any.\n *\n * @param payload\n */\nconst setHead = (\n payload: Types.SetHeadPayload,\n): Types.SetHeadAction => {\n return {\n type: Types.SET_HEAD,\n payload,\n };\n}\n\n\n\nconst actions = {\n setHead,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst setHead = (\n state: Types.State,\n action: Types.SetHeadAction,\n): Types.State => {\n return {\n ...state,\n ...action.payload,\n };\n}\n\n\n\nconst resolvers = {\n setHead,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default resolvers;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n\n import initialState from '../initial';\n\n import resolvers from '../resolvers';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst reducer = (\n state: Types.State = initialState,\n action: Types.Actions,\n): Types.State => {\n switch(action.type) {\n case Types.SET_HEAD:\n return resolvers.setHead(state, action);\n default:\n return {\n ...state,\n };\n }\n}\n\n\nconst metareducer = (\n initialState: Types.State,\n) => (\n state: Types.State = initialState,\n action: Types.Actions,\n) => reducer(\n state,\n action,\n);\n// #endregion module\n\n\n\n// #region exports\nexport {\n reducer,\n metareducer,\n};\n// #endregion exports\n","// #region imports\n // #region external\n import {\n StateOfAny,\n } from '#data/interfaces';\n\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst getHeadData = (\n state: StateOfAny & Record<'head', Types.State>,\n) => state.head;\n\n\n\nconst selectors = {\n getHeadData,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default selectors;\n// #endregion exports\n","// #region module\nexport interface Notification {\n id: string;\n text: string;\n html?: boolean;\n react?: boolean;\n timeout?: number;\n}\n\n\nexport const ADD_NOTIFICATION = 'ADD_NOTIFICATION';\nexport interface AddNotificationPayload extends Notification {}\nexport interface AddNotificationAction {\n type: typeof ADD_NOTIFICATION;\n payload: AddNotificationPayload;\n}\n\n\nexport const UPDATE_NOTIFICATION = 'UPDATE_NOTIFICATION';\nexport interface UpdateNotificationPayload extends Notification {}\nexport interface UpdateNotificationAction {\n type: typeof UPDATE_NOTIFICATION;\n payload: UpdateNotificationPayload;\n}\n\n\nexport const REMOVE_NOTIFICATION = 'REMOVE_NOTIFICATION';\nexport interface RemoveNotificationPayload {\n id: string;\n}\nexport interface RemoveNotificationAction {\n type: typeof REMOVE_NOTIFICATION;\n payload: RemoveNotificationPayload;\n}\n\n\n\nexport type State = Notification[];\n\n\nexport type Actions = AddNotificationAction\n | UpdateNotificationAction\n | RemoveNotificationAction;\n// #endregion module\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst addNotification = (\n payload: Types.AddNotificationPayload,\n): Types.AddNotificationAction => {\n return {\n type: Types.ADD_NOTIFICATION,\n payload,\n };\n}\n\n\nconst updateNotification = (\n payload: Types.UpdateNotificationPayload,\n): Types.UpdateNotificationAction => {\n return {\n type: Types.UPDATE_NOTIFICATION,\n payload,\n };\n}\n\n\nconst removeNotification = (\n payload: Types.RemoveNotificationPayload,\n): Types.RemoveNotificationAction => {\n return {\n type: Types.REMOVE_NOTIFICATION,\n payload,\n };\n}\n\n\n\nconst actions = {\n addNotification,\n updateNotification,\n removeNotification,\n};\n// #endregion module\n\n\n\n// #region exports\nexport default actions;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst initialState: Types.State = [];\n// #endregion module\n\n\n\n// #region exports\nexport default initialState;\n// #endregion exports\n","// #region imports\n // #region external\n import * as Types from '../types';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nconst addNotification = (\n state: Types.State,\n action: Types.AddNotificationAction,\n): Types.State => {\n const newNotification: Types.Notification = {\n ...action.payload,\n };\n\n 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","updatedState","map","notification","id","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","newState","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,2CAGOD,QACAC,OAAOf;;AAMlB,MAAMgB,cAAY;IACdjB,SAAAA;;;ACTJ,MAAMkB,YAAU,CACZH,QAAqBV,gBACrBW;IAEA,QAAOA,OAAOd;MACV,KAAKC;QACD,OAAOc,YAAUjB,QAAQe,OAAOC;;MACpC;QACI,yBACOD;;;;AAMnB,MAAMI,gBACFd,gBACC,CACDU,QAAqBV,cACrBW,WACCE,UACDH,OACAC;;ACtBJ,MAAMI,cACFL,SACCA,MAAMM;;AAIX,MAAMC,cAAY;IACdF,aAAAA;;;;;;;;;;;;;ACVG,MAAMG,mBAAmB;;AAQzB,MAAMC,sBAAsB;;AAQ5B,MAAMC,sBAAsB;;;;;;;;;ACjBnC,MAAMC,oBACFzB,YAEO;IACHC,MAAMyB;IACN1B,SAAAA;;;AAKR,MAAM2B,uBACF3B,YAEO;IACHC,MAAM2B;IACN5B,SAAAA;;;AAKR,MAAM6B,uBACF7B,YAEO;IACHC,MAAM6B;IACN9B,SAAAA;;;AAMR,MAAMG,YAAU;qBACZsB;wBACAE;wBACAE;;;AClCJ,MAAMzB,iBAA4B;;ACAlC,MAAMqB,kBAAkB,CACpBX,OACAC;IAEA,MAAMgB,oCACChB,OAAOf;IAGd,OAAO,KACAc,OACHiB;;;AAKR,MAAMJ,qBAAqB,CACvBb,OACA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