@plurid/plurid-ui-state-react 0.0.0-7 → 0.0.0-9
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/index.es.js +8 -6
- package/distribution/index.es.js.map +1 -1
- package/distribution/index.js +8 -10
- package/distribution/index.js.map +1 -1
- package/distribution/modules/head/index.d.ts +1 -1
- package/distribution/modules/notifications/index.d.ts +13 -13
- package/distribution/modules/shortcuts/index.d.ts +1 -1
- package/distribution/modules/sitting/index.d.ts +1 -1
- package/distribution/modules/themes/index.d.ts +1 -1
- package/package.json +14 -14
package/distribution/index.es.js
CHANGED
|
@@ -67,7 +67,7 @@ const factory$3 = (state = initialState$3) => createSlice({
|
|
|
67
67
|
id: id,
|
|
68
68
|
text: text
|
|
69
69
|
};
|
|
70
|
-
|
|
70
|
+
return [ ...state, newNotification ];
|
|
71
71
|
},
|
|
72
72
|
add: (state, action) => {
|
|
73
73
|
const id = action.payload.id || Math.random() + "";
|
|
@@ -76,27 +76,29 @@ const factory$3 = (state = initialState$3) => createSlice({
|
|
|
76
76
|
});
|
|
77
77
|
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
78
78
|
if (existingNotification) {
|
|
79
|
-
|
|
79
|
+
const newState = state.map((notification => {
|
|
80
80
|
if (notification.id === newNotification.id) {
|
|
81
81
|
return newNotification;
|
|
82
82
|
}
|
|
83
83
|
return notification;
|
|
84
84
|
}));
|
|
85
|
-
return;
|
|
85
|
+
return newState;
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
return [ ...state, newNotification ];
|
|
88
88
|
},
|
|
89
89
|
update: (state, action) => {
|
|
90
|
-
|
|
90
|
+
const newState = state.map((message => {
|
|
91
91
|
if (message.id === action.payload.id) {
|
|
92
92
|
const newNotification = Object.assign({}, action.payload);
|
|
93
93
|
return newNotification;
|
|
94
94
|
}
|
|
95
95
|
return Object.assign({}, message);
|
|
96
96
|
}));
|
|
97
|
+
return newState;
|
|
97
98
|
},
|
|
98
99
|
remove: (state, action) => {
|
|
99
|
-
|
|
100
|
+
const newState = state.filter((message => message.id !== action.payload));
|
|
101
|
+
return newState;
|
|
100
102
|
}
|
|
101
103
|
}
|
|
102
104
|
});
|
|
@@ -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\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;IAC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QtC,MAAMsC;;;;;AAKzB,MAAM/B,UAAQR;;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;IAEPC,aAAW1C,OAAAC,OAAA,IACJwC;;;AAIJ,MAAMhD,OAAO;;AASb,MAAMC,UAAU,CACnBC,QAAqBZ,iBACpBa,YAAY;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;;;;;;;;;;;;;"}
|
|
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 return [\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 const newState = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return newState;\n }\n\n return [\n ...state,\n newNotification,\n ];\n },\n update: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n const newState = 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 return newState;\n },\n remove: (\n state,\n action: PayloadAction<string>,\n ) => {\n const newState = state.filter(\n message => message.id !== action.payload,\n );\n\n return newState;\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","newState","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;AACN;;;;AAKN,MAAMG,UAAQR;;AAMd,MAAMS,YAAUD,QAAMC;;AAGtB,MAAMC,UACTT,SACYA,MAAMU;;AAEf,MAAMC,cAAY;IACrBF;;;AAIG,MAAMG,YAAUL,QAAMK;;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AA,CAAA,GACJyC;;;AAIJ,MAAMjD,OAAO;;AASb,MAAMC,UAAU,CACnBC,QAAqBZ,iBACpBa,YAAY;IACbH;IACAV,cAAcY;IACdE,UAAU;QACN+C,UAAU,CACNjD,OACAI;YAEA,OAAM8C,MACFA,MAAIC,OACJA,SACA/C,OAAOc;YAEXlB,MAAMkD,QAAQC;AAAK;QAEvBC,iBAAiB,CACbpD,OACAI;YAEAJ,MAAM8C,UAAU1C,OAAOc;AAAO;QAElCmC,qBAAqB,CACjBrD,OACAI;YAEAJ,MAAMgD,cAAc5C,OAAOc;AAAO;;;;AAKvC,MAAMX,QAAQR;;AAMd,MAAMS,UAAUD,MAAMC;;AAG7B,MAAM8C,kBACFtD,SACCA,MAAMuD,OAAOT;;AAClB,MAAMU,sBACFxD,SACCA,MAAMuD,OAAOP;;AAEX,MAAMrC,YAAY;IACrB2C;IACAE;;;AAIG,MAAM5C,UAAUL,MAAMK;;;;;;;;;;;;;"}
|
package/distribution/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
3
|
require("immer");
|
|
8
4
|
|
|
9
5
|
var toolkit = require("@reduxjs/toolkit");
|
|
@@ -73,7 +69,7 @@ const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
|
73
69
|
id: id,
|
|
74
70
|
text: text
|
|
75
71
|
};
|
|
76
|
-
|
|
72
|
+
return [ ...state, newNotification ];
|
|
77
73
|
},
|
|
78
74
|
add: (state, action) => {
|
|
79
75
|
const id = action.payload.id || Math.random() + "";
|
|
@@ -82,27 +78,29 @@ const factory$3 = (state = initialState$3) => toolkit.createSlice({
|
|
|
82
78
|
});
|
|
83
79
|
const existingNotification = state.find((notification => notification.id === newNotification.id));
|
|
84
80
|
if (existingNotification) {
|
|
85
|
-
|
|
81
|
+
const newState = state.map((notification => {
|
|
86
82
|
if (notification.id === newNotification.id) {
|
|
87
83
|
return newNotification;
|
|
88
84
|
}
|
|
89
85
|
return notification;
|
|
90
86
|
}));
|
|
91
|
-
return;
|
|
87
|
+
return newState;
|
|
92
88
|
}
|
|
93
|
-
|
|
89
|
+
return [ ...state, newNotification ];
|
|
94
90
|
},
|
|
95
91
|
update: (state, action) => {
|
|
96
|
-
|
|
92
|
+
const newState = state.map((message => {
|
|
97
93
|
if (message.id === action.payload.id) {
|
|
98
94
|
const newNotification = Object.assign({}, action.payload);
|
|
99
95
|
return newNotification;
|
|
100
96
|
}
|
|
101
97
|
return Object.assign({}, message);
|
|
102
98
|
}));
|
|
99
|
+
return newState;
|
|
103
100
|
},
|
|
104
101
|
remove: (state, action) => {
|
|
105
|
-
|
|
102
|
+
const newState = state.filter((message => message.id !== action.payload));
|
|
103
|
+
return newState;
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
106
|
});
|
|
@@ -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\nexport const initialState: HeadState = {\n title: '',\n description: '',\n ogTitle: '',\n ogImage: '',\n ogURL: '',\n ogDescription: '',\n canonicalURL: '',\n styles: [],\n scripts: [],\n};\n\nexport const name = 'head' as const;\n\n\nexport const factory = (\n state: HeadState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n setHead: (\n state,\n action: PayloadAction<Partial<HeadState>>,\n ) => {\n state = {\n ...state,\n ...action,\n };\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nexport const getHead = (\n state: StateWithSlice<typeof name, HeadState>,\n): HeadState => state.head;\n\nexport const selectors = {\n getHead,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n Notification,\n AddNotificationPayload,\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport type NotificationsState = Notification[];\n\n\nexport const initialState: NotificationsState = [];\n\nexport const name = 'notifications' as const;\n\n\nexport const factory = (\n state: NotificationsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n new: (\n state,\n action: PayloadAction<string>,\n ) => {\n const id = Math.random() + '';\n const text = action.payload;\n\n const newNotification: Notification = {\n id,\n text,\n };\n\n state = [\n ...state,\n newNotification,\n ];\n },\n add: (\n state,\n action: PayloadAction<AddNotificationPayload>,\n ) => {\n const id = action.payload.id || Math.random() + '';\n\n const newNotification: Notification = {\n ...action.payload,\n id,\n };\n\n const existingNotification = state.find(\n notification => notification.id === newNotification.id,\n );\n\n if (existingNotification) {\n state = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return;\n }\n\n state = [\n ...state,\n newNotification,\n ];\n },\n update: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n state = state.map(message => {\n if (message.id === action.payload.id) {\n const newNotification: Notification = {\n ...action.payload,\n };\n return newNotification;\n }\n\n return {\n ...message,\n };\n });\n },\n remove: (\n state,\n action: PayloadAction<string>,\n ) => {\n state = state.filter(\n message => message.id !== action.payload,\n );\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getAll = (\n state: StateWithSlice<typeof name, NotificationsState>,\n) => state.notifications;\n\nexport const selectors = {\n getAll,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface ShortcutsState {\n global: boolean;\n}\n\n\nexport const initialState: ShortcutsState = {\n global: true,\n};\n\nexport const name = 'shortcuts' as const;\n\n\nexport const factory = (\n state: ShortcutsState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n setGlobalShortcuts: (\n state,\n action: PayloadAction<boolean>,\n ) => {\n state.global = action.payload;\n },\n toggleGlobalShortcuts: (\n state,\n _action: PayloadAction<void>,\n ) => {\n state.global = !state.global;\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getGlobal = (\n state: StateWithSlice<typeof name, ShortcutsState>,\n) => state.shortcuts.global;\n\nexport const selectors = {\n getGlobal,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface SittingState {\n currentLink: string;\n tray: boolean;\n}\n\n\nexport const initialState: SittingState = {\n currentLink: '',\n tray: false,\n};\n\nexport const name = 'sitting' as const;\n\n\nexport const factory = (\n state: SittingState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n setSittingCurrentLink: (\n state,\n action: PayloadAction<string>,\n ) => {\n const currentLink = action.payload;\n\n return {\n ...state,\n currentLink,\n };\n },\n setSittingTray: (\n state,\n action: PayloadAction<boolean>,\n ) => {\n state.tray = action.payload;\n },\n toggleSittingTray: (\n state,\n _action: PayloadAction<void>,\n ) => {\n state.tray = !state.tray;\n }\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getCurrentLink = (\n state: StateWithSlice<typeof name, SittingState>,\n) => state.sitting.currentLink;\nconst getTray = (\n state: StateWithSlice<typeof name, SittingState>,\n) => state.sitting.tray;\n\nexport const selectors = {\n getCurrentLink,\n getTray,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n","// #region imports\n // #region libraries\n import {\n createSlice,\n PayloadAction,\n } from '@reduxjs/toolkit';\n\n\n import {\n Theme,\n plurid,\n } from '@plurid/plurid-themes';\n // #endregion libraries\n\n\n // #region external\n import {\n StateWithSlice,\n } from '~data/interfaces';\n // #endregion external\n// #endregion imports\n\n\n\n// #region module\nexport interface ThemesState {\n general: Theme;\n interaction: Theme;\n}\n\n\nexport const initialState: ThemesState = {\n general: {\n ...plurid,\n },\n interaction: {\n ...plurid,\n },\n};\n\nexport const name = 'themes' as const;\n\n\nexport interface SetThemePayload {\n type: 'general' | 'interaction';\n theme: Theme;\n}\n\n\nexport const factory = (\n state: ThemesState = initialState,\n) => createSlice({\n name,\n initialState: state,\n reducers: {\n setTheme: (\n state,\n action: PayloadAction<SetThemePayload>,\n ) => {\n const {\n type,\n theme,\n } = action.payload;\n\n state[type] = theme;\n },\n setGeneralTheme: (\n state,\n action: PayloadAction<Theme>,\n ) => {\n state.general = action.payload;\n },\n setInteractionTheme: (\n state,\n action: PayloadAction<Theme>,\n ) => {\n state.interaction = action.payload;\n },\n },\n});\n\nexport const slice = factory();\n// #endregion module\n\n\n\n// #region exports\nexport const actions = slice.actions;\n\n\nconst getGeneralTheme = (\n state: StateWithSlice<typeof name, ThemesState>,\n) => state.themes.general;\nconst getInteractionTheme = (\n state: StateWithSlice<typeof name, ThemesState>,\n) => state.themes.interaction;\n\nexport const selectors = {\n getGeneralTheme,\n getInteractionTheme,\n};\n\n\nexport const reducer = slice.reducer;\n// #endregion exports\n"],"names":["initialState","title","description","ogTitle","ogImage","ogURL","ogDescription","canonicalURL","styles","scripts","name","factory","state","createSlice","reducers","setHead","action","Object","assign","slice","actions","getHead","head","selectors","reducer","new","id","Math","random","text","payload","newNotification","add","existingNotification","find","notification","map","update","message","remove","filter","getAll","notifications","global","setGlobalShortcuts","toggleGlobalShortcuts","_action","getGlobal","shortcuts","currentLink","tray","setSittingCurrentLink","setSittingTray","toggleSittingTray","getCurrentLink","sitting","getTray","general","plurid","interaction","setTheme","type","theme","setGeneralTheme","setInteractionTheme","getGeneralTheme","themes","getInteractionTheme"],"mappings":";;;;;;;;;;;;AAgCO,MAAMA,iBAA0B;IACnCC,OAAO;IACPC,aAAa;IACbC,SAAS;IACTC,SAAS;IACTC,OAAO;IACPC,eAAe;IACfC,cAAc;IACdC,QAAQ;IACRC,SAAS;;;AAGN,MAAMC,SAAO;;AAGb,MAAMC,YAAU,CACnBC,QAAmBZ,mBAClBa,oBAAY;UACbH;IACAV,cAAcY;IACdE,UAAU;QACNC,SAAS,CACLH,OACAI;YAEAJ,QACOK,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,oBAAY;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,OA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FrD,SACCA,MAAMsD,OAAOT;;AAClB,MAAMU,sBACFvD,SACCA,MAAMsD,OAAOP;;AAEX,MAAMpC,YAAY;IACrB0C,iBAAAA;IACAE,qBAAAA;;;AAIG,MAAM3C,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 return [\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 const newState = state.map(notification => {\n if (notification.id === newNotification.id) {\n return newNotification;\n }\n\n return notification;\n });\n\n return newState;\n }\n\n return [\n ...state,\n newNotification,\n ];\n },\n update: (\n state,\n action: PayloadAction<Notification>,\n ) => {\n const newState = 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 return newState;\n },\n remove: (\n state,\n action: PayloadAction<string>,\n ) => {\n const newState = state.filter(\n message => message.id !== action.payload,\n );\n\n return newState;\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","newState","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":";;;;;;;;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BAAAsC;;AACF;QAENG,gBAAgB,CACZzC,OACAI;YAEAJ,MAAMuC,OAAOnC,OAAOc;AAAO;QAE/BwB,mBAAmB,CACf1C,OACAmC;YAEAnC,MAAMuC,QAAQvC,MAAMuC;AAAI;;;;AAK7B,MAAMhC,UAAQR;;AAMd,MAAMS,YAAUD,QAAMC;;AAG7B,MAAMmC,iBACF3C,SACCA,MAAM4C,QAAQN;;AACnB,MAAMO,UACF7C,SACCA,MAAM4C,QAAQL;;AAEZ,MAAM5B,cAAY;IACrBgC;IACAE;;;AAIG,MAAMjC,YAAUL,QAAMK;;;;;;;;;;;;;ACxDtB,MAAMxB,eAA4B;IACrC0D,SAAOzC,OAAAC,OAAA,CAAA,GACAyC,aAAAA;IAEPC,aAAW3C,OAAAC,OAAA,CAAA,GACJyC,aAAAA;;;AAIJ,MAAMjD,OAAO;;AASb,MAAMC,UAAU,CACnBC,QAAqBZ,iBACpBa,oBAAY;IACbH;IACAV,cAAcY;IACdE,UAAU;QACN+C,UAAU,CACNjD,OACAI;YAEA,OAAM8C,MACFA,MAAIC,OACJA,SACA/C,OAAOc;YAEXlB,MAAMkD,QAAQC;AAAK;QAEvBC,iBAAiB,CACbpD,OACAI;YAEAJ,MAAM8C,UAAU1C,OAAOc;AAAO;QAElCmC,qBAAqB,CACjBrD,OACAI;YAEAJ,MAAMgD,cAAc5C,OAAOc;AAAO;;;;AAKvC,MAAMX,QAAQR;;AAMd,MAAMS,UAAUD,MAAMC;;AAG7B,MAAM8C,kBACFtD,SACCA,MAAMuD,OAAOT;;AAClB,MAAMU,sBACFxD,SACCA,MAAMuD,OAAOP;;AAEX,MAAMrC,YAAY;IACrB2C;IACAE;;;AAIG,MAAM5C,UAAUL,MAAMK;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -21,7 +21,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<HeadState, {
|
|
|
21
21
|
}, "head">;
|
|
22
22
|
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
23
23
|
setHead: (state: import("immer/dist/internal").WritableDraft<HeadState>, action: PayloadAction<Partial<HeadState>>) => void;
|
|
24
|
-
}>;
|
|
24
|
+
}, "head">;
|
|
25
25
|
export declare const getHead: (state: StateWithSlice<typeof name, HeadState>) => HeadState;
|
|
26
26
|
export declare const selectors: {
|
|
27
27
|
getHead: (state: StateWithSlice<typeof name, HeadState>) => HeadState;
|
|
@@ -4,23 +4,23 @@ export declare type NotificationsState = Notification[];
|
|
|
4
4
|
export declare const initialState: NotificationsState;
|
|
5
5
|
export declare const name: "notifications";
|
|
6
6
|
export declare const factory: (state?: NotificationsState) => import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
7
|
-
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
8
|
-
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) =>
|
|
9
|
-
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) =>
|
|
10
|
-
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
7
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => Notification[];
|
|
8
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => Notification[];
|
|
9
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => Notification[];
|
|
10
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => import("immer/dist/internal").WritableDraft<Notification>[];
|
|
11
11
|
}, "notifications">;
|
|
12
12
|
export declare const slice: import("@reduxjs/toolkit").Slice<NotificationsState, {
|
|
13
|
-
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
14
|
-
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) =>
|
|
15
|
-
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) =>
|
|
16
|
-
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
13
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => Notification[];
|
|
14
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => Notification[];
|
|
15
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => Notification[];
|
|
16
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => import("immer/dist/internal").WritableDraft<Notification>[];
|
|
17
17
|
}, "notifications">;
|
|
18
18
|
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
19
|
-
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
20
|
-
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) =>
|
|
21
|
-
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) =>
|
|
22
|
-
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) =>
|
|
23
|
-
}>;
|
|
19
|
+
new: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => Notification[];
|
|
20
|
+
add: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<AddNotificationPayload>) => Notification[];
|
|
21
|
+
update: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<Notification>) => Notification[];
|
|
22
|
+
remove: (state: import("immer/dist/internal").WritableDraft<Notification>[], action: PayloadAction<string>) => import("immer/dist/internal").WritableDraft<Notification>[];
|
|
23
|
+
}, "notifications">;
|
|
24
24
|
export declare const selectors: {
|
|
25
25
|
getAll: (state: StateWithSlice<typeof name, NotificationsState>) => NotificationsState;
|
|
26
26
|
};
|
|
@@ -16,7 +16,7 @@ export declare const slice: import("@reduxjs/toolkit").Slice<ShortcutsState, {
|
|
|
16
16
|
export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
17
17
|
setGlobalShortcuts: (state: import("immer/dist/internal").WritableDraft<ShortcutsState>, action: PayloadAction<boolean>) => void;
|
|
18
18
|
toggleGlobalShortcuts: (state: import("immer/dist/internal").WritableDraft<ShortcutsState>, _action: PayloadAction<void>) => void;
|
|
19
|
-
}>;
|
|
19
|
+
}, "shortcuts">;
|
|
20
20
|
export declare const selectors: {
|
|
21
21
|
getGlobal: (state: StateWithSlice<typeof name, ShortcutsState>) => boolean;
|
|
22
22
|
};
|
|
@@ -29,7 +29,7 @@ export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
|
29
29
|
};
|
|
30
30
|
setSittingTray: (state: import("immer/dist/internal").WritableDraft<SittingState>, action: PayloadAction<boolean>) => void;
|
|
31
31
|
toggleSittingTray: (state: import("immer/dist/internal").WritableDraft<SittingState>, _action: PayloadAction<void>) => void;
|
|
32
|
-
}>;
|
|
32
|
+
}, "sitting">;
|
|
33
33
|
export declare const selectors: {
|
|
34
34
|
getCurrentLink: (state: StateWithSlice<typeof name, SittingState>) => string;
|
|
35
35
|
getTray: (state: StateWithSlice<typeof name, SittingState>) => boolean;
|
|
@@ -25,7 +25,7 @@ export declare const actions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
|
25
25
|
setTheme: (state: import("immer/dist/internal").WritableDraft<ThemesState>, action: PayloadAction<SetThemePayload>) => void;
|
|
26
26
|
setGeneralTheme: (state: import("immer/dist/internal").WritableDraft<ThemesState>, action: PayloadAction<Theme>) => void;
|
|
27
27
|
setInteractionTheme: (state: import("immer/dist/internal").WritableDraft<ThemesState>, action: PayloadAction<Theme>) => void;
|
|
28
|
-
}>;
|
|
28
|
+
}, "themes">;
|
|
29
29
|
export declare const selectors: {
|
|
30
30
|
getGeneralTheme: (state: StateWithSlice<typeof name, ThemesState>) => Theme;
|
|
31
31
|
getInteractionTheme: (state: StateWithSlice<typeof name, ThemesState>) => Theme;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plurid/plurid-ui-state-react",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-9",
|
|
4
4
|
"description": "Plurid User Interface State for React",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"plurid",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"lint": "eslint -c ./configurations/.eslintrc.js ./source/index.ts",
|
|
39
39
|
"clean": "rm -rf ./distribution",
|
|
40
40
|
"build.clean": "rm -rf `find ./distribution/ -type d -name __tests__`",
|
|
41
|
-
"build.production": "rollup -c ./scripts/rollup.config.js --environment BUILD:production",
|
|
41
|
+
"build.production": "rollup -c ./scripts/rollup.config.js --environment BUILD:production --bundleConfigAsCjs",
|
|
42
42
|
"build": "pnpm clean && pnpm lint && pnpm test && pnpm build.production && pnpm build.clean",
|
|
43
43
|
"prepublishOnly": "pnpm build"
|
|
44
44
|
},
|
|
@@ -48,21 +48,21 @@
|
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@plurid/plurid-themes": "^0.0.0-2",
|
|
51
|
-
"@reduxjs/toolkit": "^1.
|
|
52
|
-
"@types/jest": "^
|
|
53
|
-
"@types/node": "^18.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
55
|
-
"@typescript-eslint/parser": "^5.
|
|
51
|
+
"@reduxjs/toolkit": "^1.9.0",
|
|
52
|
+
"@types/jest": "^29.2.2",
|
|
53
|
+
"@types/node": "^18.11.9",
|
|
54
|
+
"@typescript-eslint/eslint-plugin": "^5.42.1",
|
|
55
|
+
"@typescript-eslint/parser": "^5.42.1",
|
|
56
56
|
"@zerollup/ts-transform-paths": "^1.7.18",
|
|
57
|
-
"eslint": "^8.
|
|
58
|
-
"immer": "^9.0.
|
|
59
|
-
"jest": "^
|
|
60
|
-
"rollup": "^
|
|
57
|
+
"eslint": "^8.27.0",
|
|
58
|
+
"immer": "^9.0.16",
|
|
59
|
+
"jest": "^29.3.1",
|
|
60
|
+
"rollup": "^3.3.0",
|
|
61
61
|
"rollup-plugin-terser": "^7.0.2",
|
|
62
|
-
"rollup-plugin-typescript2": "^0.
|
|
63
|
-
"ts-jest": "^
|
|
62
|
+
"rollup-plugin-typescript2": "^0.34.1",
|
|
63
|
+
"ts-jest": "^29.0.3",
|
|
64
64
|
"ts-node": "^10.9.1",
|
|
65
65
|
"ttypescript": "^1.5.13",
|
|
66
|
-
"typescript": "^4.7.
|
|
66
|
+
"typescript": "^4.7.3"
|
|
67
67
|
}
|
|
68
68
|
}
|