@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
@@ -0,0 +1,379 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
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
+ });
15
+
16
+ const setHead$1 = payload => ({
17
+ type: SET_HEAD,
18
+ payload: payload
19
+ });
20
+
21
+ const actions$4 = {
22
+ setHead: setHead$1
23
+ };
24
+
25
+ const initialState$4 = {
26
+ title: "",
27
+ description: "",
28
+ ogTitle: "",
29
+ ogImage: "",
30
+ ogURL: "",
31
+ ogDescription: "",
32
+ canonicalURL: "",
33
+ styles: [],
34
+ scripts: []
35
+ };
36
+
37
+ const setHead = (state, action) => Object.assign(Object.assign({}, state), action.payload);
38
+
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);
50
+ }
51
+ };
52
+
53
+ const metareducer$2 = initialState => (state = initialState, action) => reducer$4(state, action);
54
+
55
+ const getHeadData = state => state.head;
56
+
57
+ const selectors$4 = {
58
+ getHeadData: getHeadData
59
+ };
60
+
61
+ var index$8 = Object.freeze({
62
+ __proto__: null,
63
+ actions: actions$4,
64
+ initialState: initialState$4,
65
+ reducer: reducer$4,
66
+ metareducer: metareducer$2,
67
+ 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
97
+ });
98
+
99
+ const actions$3 = {
100
+ addNotification: addNotification$1,
101
+ updateNotification: updateNotification$1,
102
+ removeNotification: removeNotification$1
103
+ };
104
+
105
+ const initialState$3 = [];
106
+
107
+ const addNotification = (state, action) => {
108
+ const newNotification = Object.assign({}, action.payload);
109
+ return [ ...state, newNotification ];
110
+ };
111
+
112
+ const updateNotification = (state, action) => {
113
+ const updatedState = state.map((notification => {
114
+ if (notification.id === action.payload.id) {
115
+ const newNotification = Object.assign({}, action.payload);
116
+ return newNotification;
117
+ }
118
+ return Object.assign({}, notification);
119
+ }));
120
+ return [ ...updatedState ];
121
+ };
122
+
123
+ const removeNotification = (state, action) => {
124
+ const updatedState = state.filter((notification => notification.id !== action.payload.id));
125
+ return [ ...updatedState ];
126
+ };
127
+
128
+ const resolvers$3 = {
129
+ addNotification: addNotification,
130
+ updateNotification: updateNotification,
131
+ removeNotification: removeNotification
132
+ };
133
+
134
+ const reducer$3 = (state = initialState$3, action) => {
135
+ switch (action.type) {
136
+ case ADD_NOTIFICATION:
137
+ return resolvers$3.addNotification(state, action);
138
+
139
+ case UPDATE_NOTIFICATION:
140
+ return resolvers$3.updateNotification(state, action);
141
+
142
+ case REMOVE_NOTIFICATION:
143
+ return resolvers$3.removeNotification(state, action);
144
+
145
+ default:
146
+ return [ ...state ];
147
+ }
148
+ };
149
+
150
+ const getAll = state => state.notifications;
151
+
152
+ const selectors$3 = {
153
+ getAll: getAll
154
+ };
155
+
156
+ var index$6 = Object.freeze({
157
+ __proto__: null,
158
+ actions: actions$3,
159
+ initialState: initialState$3,
160
+ reducer: reducer$3,
161
+ selectors: selectors$3,
162
+ Types: index$7
163
+ });
164
+
165
+ const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
166
+
167
+ var index$5 = Object.freeze({
168
+ __proto__: null,
169
+ TOGGLE_GLOBAL_SHORTCUTS: TOGGLE_GLOBAL_SHORTCUTS
170
+ });
171
+
172
+ const toggleGlobalShortcuts$1 = payload => ({
173
+ type: TOGGLE_GLOBAL_SHORTCUTS,
174
+ payload: payload
175
+ });
176
+
177
+ const actions$2 = {
178
+ toggleGlobalShortcuts: toggleGlobalShortcuts$1
179
+ };
180
+
181
+ const initialState$2 = {
182
+ global: true
183
+ };
184
+
185
+ const toggleGlobalShortcuts = (state, action) => {
186
+ const global = action.payload ? action.payload : !state.global;
187
+ return Object.assign(Object.assign({}, state), {
188
+ global: global
189
+ });
190
+ };
191
+
192
+ const resolvers$2 = {
193
+ toggleGlobalShortcuts: toggleGlobalShortcuts
194
+ };
195
+
196
+ const reducer$2 = (state = initialState$2, action) => {
197
+ switch (action.type) {
198
+ case TOGGLE_GLOBAL_SHORTCUTS:
199
+ return resolvers$2.toggleGlobalShortcuts(state, action);
200
+
201
+ default:
202
+ return Object.assign({}, state);
203
+ }
204
+ };
205
+
206
+ const getGlobal = state => state.shortcuts.global;
207
+
208
+ const selectors$2 = {
209
+ getGlobal: getGlobal
210
+ };
211
+
212
+ var index$4 = Object.freeze({
213
+ __proto__: null,
214
+ actions: actions$2,
215
+ initialState: initialState$2,
216
+ reducer: reducer$2,
217
+ selectors: selectors$2,
218
+ Types: index$5
219
+ });
220
+
221
+ const SET_SITTING_CURRENT_LINK = "SET_SITTING_CURRENT_LINK";
222
+
223
+ const TOGGLE_SITTING_TRAY = "TOGGLE_SITTING_TRAY";
224
+
225
+ var index$3 = Object.freeze({
226
+ __proto__: null,
227
+ SET_SITTING_CURRENT_LINK: SET_SITTING_CURRENT_LINK,
228
+ TOGGLE_SITTING_TRAY: TOGGLE_SITTING_TRAY
229
+ });
230
+
231
+ const setSittingCurrentLink$1 = link => ({
232
+ type: SET_SITTING_CURRENT_LINK,
233
+ payload: link
234
+ });
235
+
236
+ const toggleSittingTray$1 = () => ({
237
+ type: TOGGLE_SITTING_TRAY
238
+ });
239
+
240
+ const actions$1 = {
241
+ setSittingCurrentLink: setSittingCurrentLink$1,
242
+ toggleSittingTray: toggleSittingTray$1
243
+ };
244
+
245
+ const initialState$1 = {
246
+ currentLink: "",
247
+ tray: false
248
+ };
249
+
250
+ const setSittingCurrentLink = (state, action) => {
251
+ const currentLink = action.payload;
252
+ return Object.assign(Object.assign({}, state), {
253
+ currentLink: currentLink
254
+ });
255
+ };
256
+
257
+ const toggleSittingTray = (state, action) => {
258
+ if (typeof action.payload === "boolean") {
259
+ return Object.assign(Object.assign({}, state), {
260
+ tray: action.payload
261
+ });
262
+ }
263
+ return Object.assign(Object.assign({}, state), {
264
+ tray: !state.tray
265
+ });
266
+ };
267
+
268
+ const resolvers$1 = {
269
+ setSittingCurrentLink: setSittingCurrentLink,
270
+ toggleSittingTray: toggleSittingTray
271
+ };
272
+
273
+ const reducer$1 = (state = initialState$1, action) => {
274
+ switch (action.type) {
275
+ case SET_SITTING_CURRENT_LINK:
276
+ return resolvers$1.setSittingCurrentLink(state, action);
277
+
278
+ case TOGGLE_SITTING_TRAY:
279
+ return resolvers$1.toggleSittingTray(state, action);
280
+
281
+ default:
282
+ return Object.assign({}, state);
283
+ }
284
+ };
285
+
286
+ const metareducer$1 = initialState => (state = initialState, action) => reducer$1(state, action);
287
+
288
+ const getCurrentLink = state => state.sitting.currentLink;
289
+
290
+ const getTray = state => state.sitting.tray;
291
+
292
+ const selectors$1 = {
293
+ getCurrentLink: getCurrentLink,
294
+ getTray: getTray
295
+ };
296
+
297
+ var index$2 = Object.freeze({
298
+ __proto__: null,
299
+ actions: actions$1,
300
+ initialState: initialState$1,
301
+ reducer: reducer$1,
302
+ metareducer: metareducer$1,
303
+ selectors: selectors$1,
304
+ Types: index$3
305
+ });
306
+
307
+ const SET_THEME = "SET_THEME";
308
+
309
+ var index$1 = Object.freeze({
310
+ __proto__: null,
311
+ SET_THEME: SET_THEME
312
+ });
313
+
314
+ const setTheme$1 = payload => ({
315
+ type: SET_THEME,
316
+ payload: payload
317
+ });
318
+
319
+ const actions = {
320
+ setTheme: setTheme$1
321
+ };
322
+
323
+ const initialState = {
324
+ general: Object.assign({}, pluridThemes.plurid),
325
+ interaction: Object.assign({}, pluridThemes.plurid)
326
+ };
327
+
328
+ const setTheme = (state, action) => {
329
+ const {type: type, theme: theme} = action.payload;
330
+ const newState = Object.assign({}, state);
331
+ newState[type] = Object.assign({}, theme);
332
+ return newState;
333
+ };
334
+
335
+ const resolvers = {
336
+ setTheme: setTheme
337
+ };
338
+
339
+ const reducer = (state = initialState, action) => {
340
+ switch (action.type) {
341
+ case SET_THEME:
342
+ return resolvers.setTheme(state, action);
343
+
344
+ default:
345
+ return Object.assign({}, state);
346
+ }
347
+ };
348
+
349
+ const metareducer = initialState => (state = initialState, action) => reducer(state, action);
350
+
351
+ const getGeneralTheme = state => state.themes.general;
352
+
353
+ const getInteractionTheme = state => state.themes.interaction;
354
+
355
+ const selectors = {
356
+ getGeneralTheme: getGeneralTheme,
357
+ getInteractionTheme: getInteractionTheme
358
+ };
359
+
360
+ var index = Object.freeze({
361
+ __proto__: null,
362
+ actions: actions,
363
+ initialState: initialState,
364
+ reducer: reducer,
365
+ metareducer: metareducer,
366
+ selectors: selectors,
367
+ Types: index$1
368
+ });
369
+
370
+ exports.head = index$8;
371
+
372
+ exports.notifications = index$6;
373
+
374
+ exports.shortcuts = index$4;
375
+
376
+ exports.sitting = index$2;
377
+
378
+ exports.themes = index;
379
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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 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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AOC;;MACrC;QACI,yBACOD;;;;AAMnB,MAAMI,cACFd,gBACC,CACDU,QAAqBV,cACrBW,WACCE,QACDH,OACAC;;ACtBJ,MAAMkD,kBACFnD,SACCA,MAAMoD,OAAON;;AAClB,MAAMO,sBACFrD,SACCA,MAAMoD,OAAOJ;;AAIlB,MAAMzC,YAAY;IACd4C,iBAAAA;IACAE,qBAAAA;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,5 @@
1
+ import * as Types from '../types';
2
+ declare const actions: {
3
+ setHead: (payload: Types.SetHeadPayload) => Types.SetHeadAction;
4
+ };
5
+ export default actions;
@@ -0,0 +1,6 @@
1
+ import actions from './actions';
2
+ import initialState from './initial';
3
+ import { reducer, metareducer } from './reducer';
4
+ import selectors from './selectors';
5
+ import * as Types from './types';
6
+ export { actions, initialState, reducer, metareducer, selectors, Types, };
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const initialState: Types.State;
3
+ export default initialState;
@@ -0,0 +1,4 @@
1
+ import * as Types from '../types';
2
+ declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
+ declare const metareducer: (initialState: Types.State) => (state: Types.State | undefined, action: Types.Actions) => Types.State;
4
+ export { reducer, metareducer, };
@@ -0,0 +1,5 @@
1
+ import * as Types from '../types';
2
+ declare const resolvers: {
3
+ setHead: (state: Types.State, action: Types.SetHeadAction) => Types.State;
4
+ };
5
+ export default resolvers;
@@ -0,0 +1,6 @@
1
+ import { StateOfAny } from "../../../data/interfaces";
2
+ import * as Types from '../types';
3
+ declare const selectors: {
4
+ getHeadData: (state: StateOfAny & Record<'head', Types.State>) => Types.State;
5
+ };
6
+ export default selectors;
@@ -0,0 +1,21 @@
1
+ export interface Head {
2
+ title: string;
3
+ description: string;
4
+ canonicalURL: string;
5
+ ogTitle: string;
6
+ ogImage: string;
7
+ ogURL: string;
8
+ ogDescription: string;
9
+ styles: string[];
10
+ scripts: string[];
11
+ }
12
+ export declare const SET_HEAD = "SET_HEAD";
13
+ export interface SetHeadPayload extends Partial<Head> {
14
+ }
15
+ export interface SetHeadAction {
16
+ type: typeof SET_HEAD;
17
+ payload: SetHeadPayload;
18
+ }
19
+ export interface State extends Head {
20
+ }
21
+ export declare type Actions = SetHeadAction;
@@ -0,0 +1,6 @@
1
+ import * as head from './head';
2
+ import * as notifications from './notifications';
3
+ import * as shortcuts from './shortcuts';
4
+ import * as sitting from './sitting';
5
+ import * as themes from './themes';
6
+ export { head, notifications, shortcuts, sitting, themes, };
@@ -0,0 +1,7 @@
1
+ import * as Types from '../types';
2
+ declare const actions: {
3
+ addNotification: (payload: Types.AddNotificationPayload) => Types.AddNotificationAction;
4
+ updateNotification: (payload: Types.UpdateNotificationPayload) => Types.UpdateNotificationAction;
5
+ removeNotification: (payload: Types.RemoveNotificationPayload) => Types.RemoveNotificationAction;
6
+ };
7
+ export default actions;
@@ -0,0 +1,6 @@
1
+ import actions from './actions';
2
+ import initialState from './initial';
3
+ import { reducer } from './reducer';
4
+ import selectors from './selectors';
5
+ import * as Types from './types';
6
+ export { actions, initialState, reducer, selectors, Types, };
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const initialState: Types.State;
3
+ export default initialState;
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
+ export { reducer, };
@@ -0,0 +1,7 @@
1
+ import * as Types from '../types';
2
+ declare const resolvers: {
3
+ addNotification: (state: Types.State, action: Types.AddNotificationAction) => Types.State;
4
+ updateNotification: (state: Types.State, action: Types.UpdateNotificationAction) => Types.State;
5
+ removeNotification: (state: Types.State, action: Types.RemoveNotificationAction) => Types.State;
6
+ };
7
+ export default resolvers;
@@ -0,0 +1,6 @@
1
+ import { StateOfAny } from "../../../data/interfaces";
2
+ import * as Types from '../types';
3
+ declare const selectors: {
4
+ getAll: (state: StateOfAny & Record<'notifications', Types.State>) => Types.State;
5
+ };
6
+ export default selectors;
@@ -0,0 +1,31 @@
1
+ export interface Notification {
2
+ id: string;
3
+ text: string;
4
+ html?: boolean;
5
+ react?: boolean;
6
+ timeout?: number;
7
+ }
8
+ export declare const ADD_NOTIFICATION = "ADD_NOTIFICATION";
9
+ export interface AddNotificationPayload extends Notification {
10
+ }
11
+ export interface AddNotificationAction {
12
+ type: typeof ADD_NOTIFICATION;
13
+ payload: AddNotificationPayload;
14
+ }
15
+ export declare const UPDATE_NOTIFICATION = "UPDATE_NOTIFICATION";
16
+ export interface UpdateNotificationPayload extends Notification {
17
+ }
18
+ export interface UpdateNotificationAction {
19
+ type: typeof UPDATE_NOTIFICATION;
20
+ payload: UpdateNotificationPayload;
21
+ }
22
+ export declare const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
23
+ export interface RemoveNotificationPayload {
24
+ id: string;
25
+ }
26
+ export interface RemoveNotificationAction {
27
+ type: typeof REMOVE_NOTIFICATION;
28
+ payload: RemoveNotificationPayload;
29
+ }
30
+ export declare type State = Notification[];
31
+ export declare type Actions = AddNotificationAction | UpdateNotificationAction | RemoveNotificationAction;
@@ -0,0 +1,5 @@
1
+ import * as Types from '../types';
2
+ declare const actions: {
3
+ toggleGlobalShortcuts: (payload?: boolean | undefined) => Types.ToggleGlobalShortcutsAction;
4
+ };
5
+ export default actions;
@@ -0,0 +1,6 @@
1
+ import actions from './actions';
2
+ import initialState from './initial';
3
+ import { reducer } from './reducer';
4
+ import selectors from './selectors';
5
+ import * as Types from './types';
6
+ export { actions, initialState, reducer, selectors, Types, };
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const initialState: Types.State;
3
+ export default initialState;
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
+ export { reducer, };
@@ -0,0 +1,7 @@
1
+ import * as Types from '../types';
2
+ declare const resolvers: {
3
+ toggleGlobalShortcuts: (state: Types.State, action: Types.ToggleGlobalShortcutsAction) => {
4
+ global: boolean;
5
+ };
6
+ };
7
+ export default resolvers;
@@ -0,0 +1,6 @@
1
+ import { StateOfAny } from "../../../data/interfaces";
2
+ import * as Types from '../types';
3
+ declare const selectors: {
4
+ getGlobal: (state: StateOfAny & Record<'shortcuts', Types.State>) => boolean;
5
+ };
6
+ export default selectors;
@@ -0,0 +1,9 @@
1
+ export declare const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
2
+ export interface ToggleGlobalShortcutsAction {
3
+ type: typeof TOGGLE_GLOBAL_SHORTCUTS;
4
+ payload?: boolean;
5
+ }
6
+ export interface State {
7
+ global: boolean;
8
+ }
9
+ export declare type Actions = ToggleGlobalShortcutsAction;
@@ -0,0 +1,6 @@
1
+ import * as Types from '../types';
2
+ declare const actions: {
3
+ setSittingCurrentLink: (link: string) => Types.SetSittingCurrentLinkAction;
4
+ toggleSittingTray: () => Types.ToggleSittingTrayAction;
5
+ };
6
+ export default actions;
@@ -0,0 +1,6 @@
1
+ import actions from './actions';
2
+ import initialState from './initial';
3
+ import { reducer, metareducer } from './reducer';
4
+ import selectors from './selectors';
5
+ import * as Types from './types';
6
+ export { actions, initialState, reducer, metareducer, selectors, Types, };
@@ -0,0 +1,3 @@
1
+ import * as Types from '../types';
2
+ declare const initialState: Types.State;
3
+ export default initialState;