@plurid/plurid-ui-state-react 0.0.0-11 → 0.0.0-12
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.d.mts +201 -0
- package/distribution/index.d.ts +201 -3
- package/distribution/index.js +279 -258
- package/distribution/index.js.map +1 -1
- package/distribution/index.mjs +292 -0
- package/distribution/index.mjs.map +1 -0
- package/package.json +65 -66
- package/distribution/data/interfaces/index.d.ts +0 -18
- package/distribution/index.es.js +0 -274
- package/distribution/index.es.js.map +0 -1
- package/distribution/modules/head/index.d.ts +0 -59
- package/distribution/modules/index.d.ts +0 -6
- package/distribution/modules/notifications/index.d.ts +0 -132
- package/distribution/modules/shortcuts/index.d.ts +0 -35
- package/distribution/modules/sitting/index.d.ts +0 -64
- package/distribution/modules/themes/index.d.ts +0 -726
package/distribution/index.js
CHANGED
|
@@ -1,284 +1,305 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
const initialState$4 = {
|
|
10
|
-
title: "",
|
|
11
|
-
description: "",
|
|
12
|
-
ogTitle: "",
|
|
13
|
-
ogImage: "",
|
|
14
|
-
ogURL: "",
|
|
15
|
-
ogDescription: "",
|
|
16
|
-
canonicalURL: "",
|
|
17
|
-
styles: [],
|
|
18
|
-
scripts: []
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name6 in all)
|
|
8
|
+
__defProp(target, name6, { get: all[name6], enumerable: true });
|
|
19
9
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// source/index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
head: () => head_exports,
|
|
24
|
+
notifications: () => notifications_exports,
|
|
25
|
+
shortcuts: () => shortcuts_exports,
|
|
26
|
+
sitting: () => sitting_exports,
|
|
27
|
+
themes: () => themes_exports
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(index_exports);
|
|
30
|
+
|
|
31
|
+
// source/modules/head/index.ts
|
|
32
|
+
var head_exports = {};
|
|
33
|
+
__export(head_exports, {
|
|
34
|
+
actions: () => actions,
|
|
35
|
+
factory: () => factory,
|
|
36
|
+
getHead: () => getHead,
|
|
37
|
+
initialState: () => initialState,
|
|
38
|
+
name: () => name,
|
|
39
|
+
reducer: () => reducer,
|
|
40
|
+
selectors: () => selectors,
|
|
41
|
+
slice: () => slice
|
|
42
|
+
});
|
|
43
|
+
var import_toolkit = require("@reduxjs/toolkit");
|
|
44
|
+
var initialState = {
|
|
45
|
+
title: "",
|
|
46
|
+
description: "",
|
|
47
|
+
ogTitle: "",
|
|
48
|
+
ogImage: "",
|
|
49
|
+
ogURL: "",
|
|
50
|
+
ogDescription: "",
|
|
51
|
+
canonicalURL: "",
|
|
52
|
+
styles: [],
|
|
53
|
+
scripts: []
|
|
54
|
+
};
|
|
55
|
+
var name = "head";
|
|
56
|
+
var factory = (state = initialState) => (0, import_toolkit.createSlice)({
|
|
57
|
+
name,
|
|
58
|
+
initialState: state,
|
|
59
|
+
reducers: {
|
|
60
|
+
setHead: (state2, action) => {
|
|
61
|
+
Object.assign(state2, action.payload);
|
|
30
62
|
}
|
|
63
|
+
}
|
|
31
64
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const getHead = state => state.head;
|
|
38
|
-
|
|
39
|
-
const selectors$4 = {
|
|
40
|
-
getHead: getHead
|
|
65
|
+
var slice = factory();
|
|
66
|
+
var actions = slice.actions;
|
|
67
|
+
var getHead = (state) => state.head;
|
|
68
|
+
var selectors = {
|
|
69
|
+
getHead
|
|
41
70
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
slice: slice$4
|
|
71
|
+
var reducer = slice.reducer;
|
|
72
|
+
|
|
73
|
+
// source/modules/notifications/index.ts
|
|
74
|
+
var notifications_exports = {};
|
|
75
|
+
__export(notifications_exports, {
|
|
76
|
+
actions: () => actions2,
|
|
77
|
+
factory: () => factory2,
|
|
78
|
+
initialState: () => initialState2,
|
|
79
|
+
name: () => name2,
|
|
80
|
+
reducer: () => reducer2,
|
|
81
|
+
selectors: () => selectors2,
|
|
82
|
+
slice: () => slice2
|
|
55
83
|
});
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
84
|
+
var import_toolkit2 = require("@reduxjs/toolkit");
|
|
85
|
+
var initialState2 = [];
|
|
86
|
+
var name2 = "notifications";
|
|
87
|
+
var notificationCounter = 0;
|
|
88
|
+
var generateNotificationID = () => {
|
|
89
|
+
const cryptoApi = globalThis.crypto;
|
|
90
|
+
if (cryptoApi && typeof cryptoApi.randomUUID === "function") {
|
|
91
|
+
return cryptoApi.randomUUID();
|
|
92
|
+
}
|
|
93
|
+
notificationCounter += 1;
|
|
94
|
+
return `notification-${Date.now().toString(36)}-${notificationCounter}`;
|
|
95
|
+
};
|
|
96
|
+
var factory2 = (state = initialState2) => (0, import_toolkit2.createSlice)({
|
|
97
|
+
name: name2,
|
|
98
|
+
initialState: state,
|
|
99
|
+
reducers: {
|
|
100
|
+
new: (state2, action) => {
|
|
101
|
+
const id = generateNotificationID();
|
|
102
|
+
const text = action.payload;
|
|
103
|
+
const newNotification = {
|
|
104
|
+
id,
|
|
105
|
+
text
|
|
106
|
+
};
|
|
107
|
+
return [
|
|
108
|
+
...state2,
|
|
109
|
+
newNotification
|
|
110
|
+
];
|
|
111
|
+
},
|
|
112
|
+
add: (state2, action) => {
|
|
113
|
+
const id = action.payload.id || generateNotificationID();
|
|
114
|
+
const newNotification = {
|
|
115
|
+
...action.payload,
|
|
116
|
+
id
|
|
117
|
+
};
|
|
118
|
+
const existingNotification = state2.find(
|
|
119
|
+
(notification) => notification.id === newNotification.id
|
|
120
|
+
);
|
|
121
|
+
if (existingNotification) {
|
|
122
|
+
const newState = state2.map((notification) => {
|
|
123
|
+
if (notification.id === newNotification.id) {
|
|
124
|
+
return newNotification;
|
|
125
|
+
}
|
|
126
|
+
return notification;
|
|
127
|
+
});
|
|
128
|
+
return newState;
|
|
129
|
+
}
|
|
130
|
+
return [
|
|
131
|
+
...state2,
|
|
132
|
+
newNotification
|
|
133
|
+
];
|
|
134
|
+
},
|
|
135
|
+
update: (state2, action) => {
|
|
136
|
+
const newState = state2.map((message) => {
|
|
137
|
+
if (message.id === action.payload.id) {
|
|
138
|
+
const newNotification = {
|
|
139
|
+
...action.payload
|
|
140
|
+
};
|
|
141
|
+
return newNotification;
|
|
104
142
|
}
|
|
143
|
+
return {
|
|
144
|
+
...message
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
return newState;
|
|
148
|
+
},
|
|
149
|
+
remove: (state2, action) => {
|
|
150
|
+
const newState = state2.filter(
|
|
151
|
+
(message) => message.id !== action.payload
|
|
152
|
+
);
|
|
153
|
+
return newState;
|
|
105
154
|
}
|
|
155
|
+
}
|
|
106
156
|
});
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
const getAll = state => state.notifications;
|
|
113
|
-
|
|
114
|
-
const selectors$3 = {
|
|
115
|
-
getAll: getAll
|
|
157
|
+
var slice2 = factory2();
|
|
158
|
+
var actions2 = slice2.actions;
|
|
159
|
+
var getAll = (state) => state.notifications;
|
|
160
|
+
var selectors2 = {
|
|
161
|
+
getAll
|
|
116
162
|
};
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
var
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
163
|
+
var reducer2 = slice2.reducer;
|
|
164
|
+
|
|
165
|
+
// source/modules/shortcuts/index.ts
|
|
166
|
+
var shortcuts_exports = {};
|
|
167
|
+
__export(shortcuts_exports, {
|
|
168
|
+
actions: () => actions3,
|
|
169
|
+
factory: () => factory3,
|
|
170
|
+
initialState: () => initialState3,
|
|
171
|
+
name: () => name3,
|
|
172
|
+
reducer: () => reducer3,
|
|
173
|
+
selectors: () => selectors3,
|
|
174
|
+
slice: () => slice3
|
|
129
175
|
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
176
|
+
var import_toolkit3 = require("@reduxjs/toolkit");
|
|
177
|
+
var initialState3 = {
|
|
178
|
+
global: true
|
|
133
179
|
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
toggleGlobalShortcuts: (state, _action) => {
|
|
145
|
-
state.global = !state.global;
|
|
146
|
-
}
|
|
180
|
+
var name3 = "shortcuts";
|
|
181
|
+
var factory3 = (state = initialState3) => (0, import_toolkit3.createSlice)({
|
|
182
|
+
name: name3,
|
|
183
|
+
initialState: state,
|
|
184
|
+
reducers: {
|
|
185
|
+
setGlobalShortcuts: (state2, action) => {
|
|
186
|
+
state2.global = action.payload;
|
|
187
|
+
},
|
|
188
|
+
toggleGlobalShortcuts: (state2, _action) => {
|
|
189
|
+
state2.global = !state2.global;
|
|
147
190
|
}
|
|
191
|
+
}
|
|
148
192
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
const getGlobal = state => state.shortcuts.global;
|
|
155
|
-
|
|
156
|
-
const selectors$2 = {
|
|
157
|
-
getGlobal: getGlobal
|
|
193
|
+
var slice3 = factory3();
|
|
194
|
+
var actions3 = slice3.actions;
|
|
195
|
+
var getGlobal = (state) => state.shortcuts.global;
|
|
196
|
+
var selectors3 = {
|
|
197
|
+
getGlobal
|
|
158
198
|
};
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
199
|
+
var reducer3 = slice3.reducer;
|
|
200
|
+
|
|
201
|
+
// source/modules/sitting/index.ts
|
|
202
|
+
var sitting_exports = {};
|
|
203
|
+
__export(sitting_exports, {
|
|
204
|
+
actions: () => actions4,
|
|
205
|
+
factory: () => factory4,
|
|
206
|
+
initialState: () => initialState4,
|
|
207
|
+
name: () => name4,
|
|
208
|
+
reducer: () => reducer4,
|
|
209
|
+
selectors: () => selectors4,
|
|
210
|
+
slice: () => slice4
|
|
171
211
|
});
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
212
|
+
var import_toolkit4 = require("@reduxjs/toolkit");
|
|
213
|
+
var initialState4 = {
|
|
214
|
+
currentLink: "",
|
|
215
|
+
tray: false
|
|
176
216
|
};
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
state.tray = !state.tray;
|
|
195
|
-
}
|
|
217
|
+
var name4 = "sitting";
|
|
218
|
+
var factory4 = (state = initialState4) => (0, import_toolkit4.createSlice)({
|
|
219
|
+
name: name4,
|
|
220
|
+
initialState: state,
|
|
221
|
+
reducers: {
|
|
222
|
+
setSittingCurrentLink: (state2, action) => {
|
|
223
|
+
const currentLink = action.payload;
|
|
224
|
+
return {
|
|
225
|
+
...state2,
|
|
226
|
+
currentLink
|
|
227
|
+
};
|
|
228
|
+
},
|
|
229
|
+
setSittingTray: (state2, action) => {
|
|
230
|
+
state2.tray = action.payload;
|
|
231
|
+
},
|
|
232
|
+
toggleSittingTray: (state2, _action) => {
|
|
233
|
+
state2.tray = !state2.tray;
|
|
196
234
|
}
|
|
235
|
+
}
|
|
197
236
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
const getTray = state => state.sitting.tray;
|
|
206
|
-
|
|
207
|
-
const selectors$1 = {
|
|
208
|
-
getCurrentLink: getCurrentLink,
|
|
209
|
-
getTray: getTray
|
|
237
|
+
var slice4 = factory4();
|
|
238
|
+
var actions4 = slice4.actions;
|
|
239
|
+
var getCurrentLink = (state) => state.sitting.currentLink;
|
|
240
|
+
var getTray = (state) => state.sitting.tray;
|
|
241
|
+
var selectors4 = {
|
|
242
|
+
getCurrentLink,
|
|
243
|
+
getTray
|
|
210
244
|
};
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
var
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
245
|
+
var reducer4 = slice4.reducer;
|
|
246
|
+
|
|
247
|
+
// source/modules/themes/index.ts
|
|
248
|
+
var themes_exports = {};
|
|
249
|
+
__export(themes_exports, {
|
|
250
|
+
actions: () => actions5,
|
|
251
|
+
factory: () => factory5,
|
|
252
|
+
initialState: () => initialState5,
|
|
253
|
+
name: () => name5,
|
|
254
|
+
reducer: () => reducer5,
|
|
255
|
+
selectors: () => selectors5,
|
|
256
|
+
slice: () => slice5
|
|
223
257
|
});
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
258
|
+
var import_toolkit5 = require("@reduxjs/toolkit");
|
|
259
|
+
var import_plurid_themes = require("@plurid/plurid-themes");
|
|
260
|
+
var initialState5 = {
|
|
261
|
+
general: {
|
|
262
|
+
...import_plurid_themes.plurid
|
|
263
|
+
},
|
|
264
|
+
interaction: {
|
|
265
|
+
...import_plurid_themes.plurid
|
|
266
|
+
}
|
|
228
267
|
};
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
268
|
+
var name5 = "themes";
|
|
269
|
+
var factory5 = (state = initialState5) => (0, import_toolkit5.createSlice)({
|
|
270
|
+
name: name5,
|
|
271
|
+
initialState: state,
|
|
272
|
+
reducers: {
|
|
273
|
+
setTheme: (state2, action) => {
|
|
274
|
+
const {
|
|
275
|
+
type,
|
|
276
|
+
theme
|
|
277
|
+
} = action.payload;
|
|
278
|
+
state2[type] = theme;
|
|
279
|
+
},
|
|
280
|
+
setGeneralTheme: (state2, action) => {
|
|
281
|
+
state2.general = action.payload;
|
|
282
|
+
},
|
|
283
|
+
setInteractionTheme: (state2, action) => {
|
|
284
|
+
state2.interaction = action.payload;
|
|
246
285
|
}
|
|
286
|
+
}
|
|
247
287
|
});
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
const getInteractionTheme = state => state.themes.interaction;
|
|
256
|
-
|
|
257
|
-
const selectors = {
|
|
258
|
-
getGeneralTheme: getGeneralTheme,
|
|
259
|
-
getInteractionTheme: getInteractionTheme
|
|
288
|
+
var slice5 = factory5();
|
|
289
|
+
var actions5 = slice5.actions;
|
|
290
|
+
var getGeneralTheme = (state) => state.themes.general;
|
|
291
|
+
var getInteractionTheme = (state) => state.themes.interaction;
|
|
292
|
+
var selectors5 = {
|
|
293
|
+
getGeneralTheme,
|
|
294
|
+
getInteractionTheme
|
|
260
295
|
};
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
name: name,
|
|
270
|
-
reducer: reducer,
|
|
271
|
-
selectors: selectors,
|
|
272
|
-
slice: slice
|
|
296
|
+
var reducer5 = slice5.reducer;
|
|
297
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
298
|
+
0 && (module.exports = {
|
|
299
|
+
head,
|
|
300
|
+
notifications,
|
|
301
|
+
shortcuts,
|
|
302
|
+
sitting,
|
|
303
|
+
themes
|
|
273
304
|
});
|
|
274
|
-
|
|
275
|
-
exports.head = index$4;
|
|
276
|
-
|
|
277
|
-
exports.notifications = index$3;
|
|
278
|
-
|
|
279
|
-
exports.shortcuts = index$2;
|
|
280
|
-
|
|
281
|
-
exports.sitting = index$1;
|
|
282
|
-
|
|
283
|
-
exports.themes = index;
|
|
284
|
-
//# sourceMappingURL=index.js.map
|
|
305
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -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 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,oBAAY;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;;;;;;;;;;;;;;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;gBACAG;;YAGJ,OAAO,KACAjB,OACHmB;AACH;QAELC,KAAK,CACDpB,OACAI;YAEA,MAAMU,KAAKV,OAAOc,QAAQJ,MAAMC,KAAKC,WAAW;YAEhD,MAAMG,kDACCf,OAAOc,UACV;gBAAAJ;;YAGJ,MAAMO,uBAAuBrB,MAAMsB,MAC/BC,gBAAgBA,aAAaT,O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MAAMU,sBACFxD,SACCA,MAAMuD,OAAOP;;AAEX,MAAMrC,YAAY;IACrB2C;IACAE;;;AAIG,MAAM5C,UAAUL,MAAMK;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"sources":["../source/index.ts","../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":["/// <reference types=\"immer\" />\n// ^ Type-only reference (NOT a runtime `import 'immer'`): this package exports its RTK\n// `createSlice` factories directly, whose inferred types reference immer's `WritableDraft`.\n// Without immer in the program TS can't name those types in the emitted `.d.ts` (TS2742).\n// A reference directive pulls in the types with zero runtime footprint — unlike the old\n// `import 'immer'` side-effect import, it's safe under `\"sideEffects\": false`.\n\n// #region exports\nexport * from './data/interfaces';\n\nexport * from './modules';\n\n// Re-export the per-slice State types at the top level so downstream packages\n// (e.g. plurid-ui-components-react) can NAME them when re-exporting values typed\n// by them — otherwise they're only reachable via the namespace (e.g. head.HeadState)\n// and TS can't emit the declaration (TS4023 / TS4082).\nexport type { HeadState } from './modules/head';\nexport type { ThemesState } from './modules/themes';\nexport type { NotificationsState } from './modules/notifications';\nexport type { ShortcutsState } from './modules/shortcuts';\nexport type { SittingState } from './modules/sitting';\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 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 // Mutate the Immer draft (reassigning the local `state` was a no-op Immer ignores)\n // and merge `action.payload` — the old `...action` spread the whole action object\n // (including `type`), not the payload.\n Object.assign(state, 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\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\n// `Math.random() + ''` collides under rapid/concurrent notifications. Prefer the platform UUID\n// (browsers + Node ≥ 19) and fall back to a monotonic counter so IDs stay unique even without it.\nlet notificationCounter = 0;\nconst generateNotificationID = (): string => {\n const cryptoApi = (globalThis as any).crypto;\n if (cryptoApi && typeof cryptoApi.randomUUID === 'function') {\n return cryptoApi.randomUUID();\n }\n notificationCounter += 1;\n return `notification-${Date.now().toString(36)}-${notificationCounter}`;\n};\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 = generateNotificationID();\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 || generateNotificationID();\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEI,qBAGO;AA2BJ,IAAM,eAA0B;AAAA,EACnC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AAAA,EACP,eAAe;AAAA,EACf,cAAc;AAAA,EACd,QAAQ,CAAC;AAAA,EACT,SAAS,CAAC;AACd;AAEO,IAAM,OAAO;AAGb,IAAM,UAAU,CACnB,QAAmB,qBAClB,4BAAY;AAAA,EACb;AAAA,EACA,cAAc;AAAA,EACd,UAAU;AAAA,IACN,SAAS,CACLA,QACA,WACC;AAID,aAAO,OAAOA,QAAO,OAAO,OAAO;AAAA,IACvC;AAAA,EACJ;AACJ,CAAC;AAEM,IAAM,QAAQ,QAAQ;AAMtB,IAAM,UAAU,MAAM;AAGtB,IAAM,UAAU,CACnB,UACY,MAAM;AAEf,IAAM,YAAY;AAAA,EACrB;AACJ;AAGO,IAAM,UAAU,MAAM;;;ACnF7B;AAAA;AAAA,iBAAAC;A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ASb,IAAMF,WAAU,CACnB,QAAqBC,sBACpB,6BAAY;AAAA,EACb,MAAAC;AAAA,EACA,cAAc;AAAA,EACd,UAAU;AAAA,IACN,UAAU,CACNK,QACA,WACC;AACD,YAAM;AAAA,QACF;AAAA,QACA;AAAA,MACJ,IAAI,OAAO;AAEX,MAAAA,OAAM,IAAI,IAAI;AAAA,IAClB;AAAA,IACA,iBAAiB,CACbA,QACA,WACC;AACD,MAAAA,OAAM,UAAU,OAAO;AAAA,IAC3B;AAAA,IACA,qBAAqB,CACjBA,QACA,WACC;AACD,MAAAA,OAAM,cAAc,OAAO;AAAA,IAC/B;AAAA,EACJ;AACJ,CAAC;AAEM,IAAMF,SAAQL,SAAQ;AAMtB,IAAMD,WAAUM,OAAM;AAG7B,IAAM,kBAAkB,CACpB,UACC,MAAM,OAAO;AAClB,IAAM,sBAAsB,CACxB,UACC,MAAM,OAAO;AAEX,IAAMD,aAAY;AAAA,EACrB;AAAA,EACA;AACJ;AAGO,IAAMD,WAAUE,OAAM;","names":["state","actions","factory","initialState","name","reducer","selectors","slice","import_toolkit","state","actions","factory","initialState","name","reducer","selectors","slice","import_toolkit","state","actions","factory","initialState","name","reducer","selectors","slice","import_toolkit","state","actions","factory","initialState","name","reducer","selectors","slice","import_toolkit","state"]}
|