@plurid/plurid-ui-state-react 0.0.0-6 → 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.
- package/distribution/data/interfaces/index.d.ts +3 -0
- package/distribution/index.es.js +26 -4
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +26 -4
- package/distribution/index.js.map +1 -1
- package/distribution/modules/head/index.d.ts +2 -2
- package/distribution/modules/notifications/index.d.ts +15 -12
- package/distribution/modules/shortcuts/index.d.ts +2 -2
- package/distribution/modules/sitting/index.d.ts +2 -2
- package/distribution/modules/themes/index.d.ts +2 -2
- package/package.json +1 -1
package/distribution/index.es.js
CHANGED
|
@@ -42,6 +42,8 @@ const reducer$4 = slice$4.reducer;
|
|
|
42
42
|
|
|
43
43
|
var index$4 = Object.freeze({
|
|
44
44
|
__proto__: null,
|
|
45
|
+
initialState: initialState$4,
|
|
46
|
+
name: name$4,
|
|
45
47
|
factory: factory$4,
|
|
46
48
|
slice: slice$4,
|
|
47
49
|
actions: actions$4,
|
|
@@ -58,8 +60,20 @@ const factory$3 = (state = initialState$3) => createSlice({
|
|
|
58
60
|
name: name$3,
|
|
59
61
|
initialState: state,
|
|
60
62
|
reducers: {
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
+
new: (state, action) => {
|
|
64
|
+
const id = Math.random() + "";
|
|
65
|
+
const text = action.payload;
|
|
66
|
+
const newNotification = {
|
|
67
|
+
id: id,
|
|
68
|
+
text: text
|
|
69
|
+
};
|
|
70
|
+
state = [ ...state, newNotification ];
|
|
71
|
+
},
|
|
72
|
+
add: (state, action) => {
|
|
73
|
+
const id = action.payload.id || Math.random() + "";
|
|
74
|
+
const newNotification = Object.assign(Object.assign({}, action.payload), {
|
|
75
|
+
id: id
|
|
76
|
+
});
|
|
63
77
|
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
64
78
|
if (existingNotification) {
|
|
65
79
|
state = state.map((notification => {
|
|
@@ -72,7 +86,7 @@ const factory$3 = (state = initialState$3) => createSlice({
|
|
|
72
86
|
}
|
|
73
87
|
state = [ ...state, newNotification ];
|
|
74
88
|
},
|
|
75
|
-
|
|
89
|
+
update: (state, action) => {
|
|
76
90
|
state = state.map((message => {
|
|
77
91
|
if (message.id === action.payload.id) {
|
|
78
92
|
const newNotification = Object.assign({}, action.payload);
|
|
@@ -81,7 +95,7 @@ const factory$3 = (state = initialState$3) => createSlice({
|
|
|
81
95
|
return Object.assign({}, message);
|
|
82
96
|
}));
|
|
83
97
|
},
|
|
84
|
-
|
|
98
|
+
remove: (state, action) => {
|
|
85
99
|
state = state.filter((message => message.id !== action.payload));
|
|
86
100
|
}
|
|
87
101
|
}
|
|
@@ -101,6 +115,8 @@ const reducer$3 = slice$3.reducer;
|
|
|
101
115
|
|
|
102
116
|
var index$3 = Object.freeze({
|
|
103
117
|
__proto__: null,
|
|
118
|
+
initialState: initialState$3,
|
|
119
|
+
name: name$3,
|
|
104
120
|
factory: factory$3,
|
|
105
121
|
slice: slice$3,
|
|
106
122
|
actions: actions$3,
|
|
@@ -141,6 +157,8 @@ const reducer$2 = slice$2.reducer;
|
|
|
141
157
|
|
|
142
158
|
var index$2 = Object.freeze({
|
|
143
159
|
__proto__: null,
|
|
160
|
+
initialState: initialState$2,
|
|
161
|
+
name: name$2,
|
|
144
162
|
factory: factory$2,
|
|
145
163
|
slice: slice$2,
|
|
146
164
|
actions: actions$2,
|
|
@@ -191,6 +209,8 @@ const reducer$1 = slice$1.reducer;
|
|
|
191
209
|
|
|
192
210
|
var index$1 = Object.freeze({
|
|
193
211
|
__proto__: null,
|
|
212
|
+
initialState: initialState$1,
|
|
213
|
+
name: name$1,
|
|
194
214
|
factory: factory$1,
|
|
195
215
|
slice: slice$1,
|
|
196
216
|
actions: actions$1,
|
|
@@ -239,6 +259,8 @@ const reducer = slice.reducer;
|
|
|
239
259
|
|
|
240
260
|
var index = Object.freeze({
|
|
241
261
|
__proto__: null,
|
|
262
|
+
initialState: initialState,
|
|
263
|
+
name: name,
|
|
242
264
|
factory: factory,
|
|
243
265
|
slice: slice,
|
|
244
266
|
actions: actions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.es.js","sources":["../source/modules/head/index.ts","../source/modules/notifications/index.ts","../source/modules/shortcuts/index.ts","../source/modules/sitting/index.ts","../source/modules/themes/index.ts"],"sourcesContent":["// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface HeadState {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\nconst initialState: HeadState = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n\nconst 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 StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport type NotificationsState = Notification[];\n\n\nconst initialState: NotificationsState = [];\n\nconst name = 'notifications' as const;\n\n\nexport const factory = (\n state: NotificationsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n addNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n const newNotification: Notification = {\n ...action.payload,\n };\n\n const existingNotification = state.find(\n notification => notification.id === newNotification.id,\n );\n\n if (existingNotification) {\n state = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return;\n }\n\n state = [\n ...state,\n newNotification,\n ];\n },\n updateNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n state = state.map(message => {\n if (message.id === action.payload.id) {\n const newNotification: Notification = {\n ...action.payload,\n };\n return newNotification;\n }\n\n return {\n ...message,\n };\n });\n },\n removeNotification: (\n state,\n action: PayloadAction<string>,\n ) => {\n state = state.filter(\n message => message.id !== action.payload,\n );\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getAll = (\n state: StateWithSlice<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\nconst initialState: ShortcutsState = {\n global: true,\n};\n\nconst 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\nconst initialState: SittingState = {\n currentLink: '',\n tray: false,\n};\n\nconst 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\nconst initialState: ThemesState = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n\nconst 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","addNotification","newNotification","payload","existingNotification","find","notification","id","map","updateNotification","message","removeNotification","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":";;;;;;AAgCA,MAAMA,iBAA0B;IAC5BC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SAAS;;;AAGb,MAAMC,SAAO;;AAGN,MAAMC,YAAU,CACnBC,QAAmBZ,mBAClBa,YAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNC,SAAS,CACLH,OACAI;YAEAJ,QACOK,OAAAC,OAA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,CACN5C,OACAI;YAEA,OAAMyC,MACFA,MAAIC,OACJA,SACA1C,OAAOW;YAEXf,MAAM6C,QAAQC;;QAElBC,iBAAiB,CACb/C,OACAI;YAEAJ,MAAMyC,UAAUrC,OAAOW;;QAE3BiC,qBAAqB,CACjBhD,OACAI;YAEAJ,MAAM2C,cAAcvC,OAAOW;;;;;AAKhC,MAAMR,QAAQR;;AAMd,MAAMS,UAAUD,MAAMC;;AAG7B,MAAMyC,kBACFjD,SACCA,MAAMkD,OAAOT;;AAClB,MAAMU,sBACFnD,SACCA,MAAMkD,OAAOP;;AAEX,MAAMhC,YAAY;IACrBsC,iBAAAA;IACAE,qBAAAA;;;AAIG,MAAMvC,UAAUL,MAAMK;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.es.js","sources":["../source/modules/head/index.ts","../source/modules/notifications/index.ts","../source/modules/shortcuts/index.ts","../source/modules/sitting/index.ts","../source/modules/themes/index.ts"],"sourcesContent":["// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface HeadState {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\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,YAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNC,SAAS,CACLH,OACAI;YAEAJ,QACOK,OAAAC,OAAAD,OAAAC,OAAA,IAAAN,QACAI;;;;;AAMZ,MAAMG,UAAQR;;AAMd,MAAMS,YAAUD,QAAMC;;AAGtB,MAAMC,UACTT,SACYA,MAAMU;;AAEf,MAAMC,cAAY;IACrBF,SAAAA;;;AAIG,MAAMG,YAAUL,QAAMK;;;;;;;;;;;;;;AC3DtB,MAAMxB,iBAAmC;;AAEzC,MAAMU,SAAO;;AAGb,MAAMC,YAAU,CACnBC,QAA4BZ,mBAC3Ba,YAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNW,KAAK,CACDb,OACAI;YAEA,MAAMU,KAAKC,KAAKC,WAAW;YAC3B,MAAMC,OAAOb,OAAOc;YAEpB,MAAMC,kBAAgC;gBAClCL,IAAAA;gBACAG,MAAAA;;YAGJjB,QAAQ,KACDA,OACHmB;;QAGRC,KAAK,CACDpB,OACAI;YAEA,MAAMU,KAAKV,OAAOc,QAAQJ,MAAMC,KAAKC,WAAW;YAEhD,MAAMG,kDACCf,OAAOc,UACV;gBAAAJ,IAAAA;;YAGJ,MAAMO,uBAAuBrB,MAAMsB,MAC/BC,gBAAgBA,aAAaT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;;;;;;;"}
|
package/distribution/index.js
CHANGED
|
@@ -48,6 +48,8 @@ const reducer$4 = slice$4.reducer;
|
|
|
48
48
|
|
|
49
49
|
var index$4 = Object.freeze({
|
|
50
50
|
__proto__: null,
|
|
51
|
+
initialState: initialState$4,
|
|
52
|
+
name: name$4,
|
|
51
53
|
factory: factory$4,
|
|
52
54
|
slice: slice$4,
|
|
53
55
|
actions: actions$4,
|
|
@@ -64,8 +66,20 @@ const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
|
64
66
|
name: name$3,
|
|
65
67
|
initialState: state,
|
|
66
68
|
reducers: {
|
|
67
|
-
|
|
68
|
-
const
|
|
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
|
+
});
|
|
69
83
|
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
70
84
|
if (existingNotification) {
|
|
71
85
|
state = state.map((notification => {
|
|
@@ -78,7 +92,7 @@ const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
|
78
92
|
}
|
|
79
93
|
state = [ ...state, newNotification ];
|
|
80
94
|
},
|
|
81
|
-
|
|
95
|
+
update: (state, action) => {
|
|
82
96
|
state = state.map((message => {
|
|
83
97
|
if (message.id === action.payload.id) {
|
|
84
98
|
const newNotification = Object.assign({}, action.payload);
|
|
@@ -87,7 +101,7 @@ const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
|
87
101
|
return Object.assign({}, message);
|
|
88
102
|
}));
|
|
89
103
|
},
|
|
90
|
-
|
|
104
|
+
remove: (state, action) => {
|
|
91
105
|
state = state.filter((message => message.id !== action.payload));
|
|
92
106
|
}
|
|
93
107
|
}
|
|
@@ -107,6 +121,8 @@ const reducer$3 = slice$3.reducer;
|
|
|
107
121
|
|
|
108
122
|
var index$3 = Object.freeze({
|
|
109
123
|
__proto__: null,
|
|
124
|
+
initialState: initialState$3,
|
|
125
|
+
name: name$3,
|
|
110
126
|
factory: factory$3,
|
|
111
127
|
slice: slice$3,
|
|
112
128
|
actions: actions$3,
|
|
@@ -147,6 +163,8 @@ const reducer$2 = slice$2.reducer;
|
|
|
147
163
|
|
|
148
164
|
var index$2 = Object.freeze({
|
|
149
165
|
__proto__: null,
|
|
166
|
+
initialState: initialState$2,
|
|
167
|
+
name: name$2,
|
|
150
168
|
factory: factory$2,
|
|
151
169
|
slice: slice$2,
|
|
152
170
|
actions: actions$2,
|
|
@@ -197,6 +215,8 @@ const reducer$1 = slice$1.reducer;
|
|
|
197
215
|
|
|
198
216
|
var index$1 = Object.freeze({
|
|
199
217
|
__proto__: null,
|
|
218
|
+
initialState: initialState$1,
|
|
219
|
+
name: name$1,
|
|
200
220
|
factory: factory$1,
|
|
201
221
|
slice: slice$1,
|
|
202
222
|
actions: actions$1,
|
|
@@ -245,6 +265,8 @@ const reducer = slice.reducer;
|
|
|
245
265
|
|
|
246
266
|
var index = Object.freeze({
|
|
247
267
|
__proto__: null,
|
|
268
|
+
initialState: initialState,
|
|
269
|
+
name: name,
|
|
248
270
|
factory: factory,
|
|
249
271
|
slice: slice,
|
|
250
272
|
actions: actions,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../source/modules/head/index.ts","../source/modules/notifications/index.ts","../source/modules/shortcuts/index.ts","../source/modules/sitting/index.ts","../source/modules/themes/index.ts"],"sourcesContent":["// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface HeadState {\n title: string;\n description: string;\n canonicalURL: string;\n ogTitle: string;\n ogImage: string;\n ogURL: string;\n ogDescription: string;\n styles: string[];\n scripts: string[];\n}\n\n\nconst initialState: HeadState = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n\nconst 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 StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport type NotificationsState = Notification[];\n\n\nconst initialState: NotificationsState = [];\n\nconst name = 'notifications' as const;\n\n\nexport const factory = (\n state: NotificationsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n addNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n const newNotification: Notification = {\n ...action.payload,\n };\n\n const existingNotification = state.find(\n notification => notification.id === newNotification.id,\n );\n\n if (existingNotification) {\n state = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return;\n }\n\n state = [\n ...state,\n newNotification,\n ];\n },\n updateNotification: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n state = state.map(message => {\n if (message.id === action.payload.id) {\n const newNotification: Notification = {\n ...action.payload,\n };\n return newNotification;\n }\n\n return {\n ...message,\n };\n });\n },\n removeNotification: (\n state,\n action: PayloadAction<string>,\n ) => {\n state = state.filter(\n message => message.id !== action.payload,\n );\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getAll = (\n state: StateWithSlice<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\nconst initialState: ShortcutsState = {\n global: true,\n};\n\nconst 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\nconst initialState: SittingState = {\n currentLink: '',\n tray: false,\n};\n\nconst 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\nconst initialState: ThemesState = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n\nconst 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","addNotification","newNotification","payload","existingNotification","find","notification","id","map","updateNotification","message","removeNotification","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":";;;;;;;;;;;;AAgCA,MAAMA,iBAA0B;IAC5BC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SAAS;;;AAGb,MAAMC,SAAO;;AAGN,MAAMC,YAAU,CACnBC,QAAmBZ,mBAClBa,oBAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNC,SAAS,CACLH,OACAI;YAEAJ,QACOK,OAAAC,OAAAD,OAAAC,OAAA,IAAAN,QACAI;;;;;AAMZ,MAAMG,UAAQR;;AAMd,MAAMS,YAAUD,QAAMC;;AAGtB,MAAMC,UACTT,SACYA,MAAMU;;AAEf,MAAMC,cAAY;IACrBF,SAAAA;;;AAIG,MAAMG,YAAUL,QAAMK;;;;;;;;;;;;AC5D7B,MAAMxB,iBAAmC;;AAEzC,MAAMU,SAAO;;AAGN,MAAMC,YAAU,CACnBC,QAA4BZ,mBAC3Ba,oBAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNW,iBAAiB,CACbb,OACAI;YAEA,MAAMU,kBAC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AOP;;AAEX,MAAMhC,YAAY;IACrBsC,iBAAAA;IACAE,qBAAAA;;;AAIG,MAAMvC,UAAUL,MAAMK;;;;;;;;;;;;;;;;;;;"}
|
|
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,eAA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R;;AAMd,MAAMS,YAAUD,QAAMC;;AAG7B,MAAMkC,iBACF1C,SACCA,MAAM2C,QAAQN;;AACnB,MAAMO,UACF5C,SACCA,MAAM2C,QAAQL;;AAEZ,MAAM3B,cAAY;IACrB+B,gBAAAA;IACAE,SAAAA;;;AAIG,MAAMhC,YAAUL,QAAMK;;;;;;;;;;;;;ACxDtB,MAAMxB,eAA4B;IACrCyD,SAAOxC,OAAAC,OAAA,IACAwC,aAAAA;IAEPC,aAAW1C,OAAAC,OAAA,IACJwC,aAAAA;;;AAIJ,MAAMhD,OAAO;;AASb,MAAMC,UAAU,CACnBC,QAAqBZ,iBACpBa,oBAAY;IACbH,MAAAA;IACAV,cAAcY;IACdE,UAAU;QACN8C,UAAU,CACNhD,OACAI;YAEA,OAAM6C,MACFA,MAAIC,OACJA,SACA9C,OAAOc;YAEXlB,MAAMiD,QAAQC;;QAElBC,iBAAiB,CACbnD,OACAI;YAEAJ,MAAM6C,UAAUzC,OAAOc;;QAE3BkC,qBAAqB,CACjBpD,OACAI;YAEAJ,MAAM+C,cAAc3C,OAAOc;;;;;AAKhC,MAAMX,QAAQR;;AAMd,MAAMS,UAAUD,MAAMC;;AAG7B,MAAM6C,kBACFrD,SACCA,MAAMsD,OAAOT;;AAClB,MAAMU,sBACFvD,SACCA,MAAMsD,OAAOP;;AAEX,MAAMpC,YAAY;IACrB0C,iBAAAA;IACAE,qBAAAA;;;AAIG,MAAM3C,UAAUL,MAAMK;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -11,7 +11,8 @@ export interface HeadState {
|
|
|
11
11
|
styles: string[];
|
|
12
12
|
scripts: string[];
|
|
13
13
|
}
|
|
14
|
-
declare const
|
|
14
|
+
export declare const initialState: HeadState;
|
|
15
|
+
export declare const name: "head";
|
|
15
16
|
export declare const factory: (state?: HeadState) => import("@reduxjs/toolkit").Slice<HeadState, {
|
|
16
17
|
setHead: (state: import("immer/dist/internal").WritableDraft<HeadState>, action: PayloadAction<Partial<HeadState>>) => void;
|
|
17
18
|
}, "head">;
|
|
@@ -26,4 +27,3 @@ export declare const selectors: {
|
|
|
26
27
|
getHead: (state: StateWithSlice<typeof name, HeadState>) => HeadState;
|
|
27
28
|
};
|
|
28
29
|
export declare const reducer: import("@reduxjs/toolkit").Reducer<HeadState, import("@reduxjs/toolkit").AnyAction>;
|
|
29
|
-
export {};
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import { PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
-
import { Notification, StateWithSlice } from "../../data/interfaces";
|
|
2
|
+
import { Notification, AddNotificationPayload, StateWithSlice } from "../../data/interfaces";
|
|
3
3
|
export declare type NotificationsState = Notification[];
|
|
4
|
-
declare const
|
|
4
|
+
export declare const initialState: NotificationsState;
|
|
5
|
+
export declare const name: "notifications";
|
|
5
6
|
export declare const factory: (state?: NotificationsState) => import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
8
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => void;
|
|
9
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => void;
|
|
10
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
9
11
|
}, "notifications">;
|
|
10
12
|
export declare const slice: import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
14
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => void;
|
|
15
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => void;
|
|
16
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
14
17
|
}, "notifications">;
|
|
15
18
|
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
20
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => void;
|
|
21
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => void;
|
|
22
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => void;
|
|
19
23
|
}>;
|
|
20
24
|
export declare const selectors: {
|
|
21
25
|
getAll: (state: StateWithSlice<typeof name, NotificationsState>) => NotificationsState;
|
|
22
26
|
};
|
|
23
27
|
export declare const reducer: import("@reduxjs/toolkit").Reducer<NotificationsState, import("@reduxjs/toolkit").AnyAction>;
|
|
24
|
-
export {};
|
|
@@ -3,7 +3,8 @@ import { StateWithSlice } from "../../data/interfaces";
|
|
|
3
3
|
export interface ShortcutsState {
|
|
4
4
|
global: boolean;
|
|
5
5
|
}
|
|
6
|
-
declare const
|
|
6
|
+
export declare const initialState: ShortcutsState;
|
|
7
|
+
export declare const name: "shortcuts";
|
|
7
8
|
export declare const factory: (state?: ShortcutsState) => import("@reduxjs/toolkit").Slice<ShortcutsState, {
|
|
8
9
|
setGlobalShortcuts: (state: import("immer/dist/internal").WritableDraft<ShortcutsState>, action: PayloadAction<boolean>) => void;
|
|
9
10
|
toggleGlobalShortcuts: (state: import("immer/dist/internal").WritableDraft<ShortcutsState>, _action: PayloadAction<void>) => void;
|
|
@@ -20,4 +21,3 @@ export declare const selectors: {
|
|
|
20
21
|
getGlobal: (state: StateWithSlice<typeof name, ShortcutsState>) => boolean;
|
|
21
22
|
};
|
|
22
23
|
export declare const reducer: import("@reduxjs/toolkit").Reducer<ShortcutsState, import("@reduxjs/toolkit").AnyAction>;
|
|
23
|
-
export {};
|
|
@@ -4,7 +4,8 @@ export interface SittingState {
|
|
|
4
4
|
currentLink: string;
|
|
5
5
|
tray: boolean;
|
|
6
6
|
}
|
|
7
|
-
declare const
|
|
7
|
+
export declare const initialState: SittingState;
|
|
8
|
+
export declare const name: "sitting";
|
|
8
9
|
export declare const factory: (state?: SittingState) => import("@reduxjs/toolkit").Slice<SittingState, {
|
|
9
10
|
setSittingCurrentLink: (state: import("immer/dist/internal").WritableDraft<SittingState>, action: PayloadAction<string>) => {
|
|
10
11
|
currentLink: string;
|
|
@@ -34,4 +35,3 @@ export declare const selectors: {
|
|
|
34
35
|
getTray: (state: StateWithSlice<typeof name, SittingState>) => boolean;
|
|
35
36
|
};
|
|
36
37
|
export declare const reducer: import("@reduxjs/toolkit").Reducer<SittingState, import("@reduxjs/toolkit").AnyAction>;
|
|
37
|
-
export {};
|
|
@@ -5,7 +5,8 @@ export interface ThemesState {
|
|
|
5
5
|
general: Theme;
|
|
6
6
|
interaction: Theme;
|
|
7
7
|
}
|
|
8
|
-
declare const
|
|
8
|
+
export declare const initialState: ThemesState;
|
|
9
|
+
export declare const name: "themes";
|
|
9
10
|
export interface SetThemePayload {
|
|
10
11
|
type: 'general' | 'interaction';
|
|
11
12
|
theme: Theme;
|
|
@@ -30,4 +31,3 @@ export declare const selectors: {
|
|
|
30
31
|
getInteractionTheme: (state: StateWithSlice<typeof name, ThemesState>) => Theme;
|
|
31
32
|
};
|
|
32
33
|
export declare const reducer: import("@reduxjs/toolkit").Reducer<ThemesState, import("@reduxjs/toolkit").AnyAction>;
|
|
33
|
-
export {};
|