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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/distribution/data/interfaces/index.d.ts +15 -0
  2. package/distribution/index.d.ts +1 -0
  3. package/distribution/index.es.js +154 -245
  4. package/distribution/index.es.js.map +1 -1
  5. package/distribution/index.js +157 -252
  6. package/distribution/index.js.map +1 -1
  7. package/distribution/modules/head/index.d.ts +59 -6
  8. package/distribution/modules/notifications/index.d.ts +132 -6
  9. package/distribution/modules/shortcuts/index.d.ts +35 -6
  10. package/distribution/modules/sitting/index.d.ts +64 -6
  11. package/distribution/modules/themes/index.d.ts +726 -6
  12. package/package.json +24 -20
  13. package/distribution/modules/head/actions/index.d.ts +0 -5
  14. package/distribution/modules/head/initial/index.d.ts +0 -3
  15. package/distribution/modules/head/reducer/index.d.ts +0 -4
  16. package/distribution/modules/head/resolvers/index.d.ts +0 -5
  17. package/distribution/modules/head/selectors/index.d.ts +0 -6
  18. package/distribution/modules/head/types/index.d.ts +0 -21
  19. package/distribution/modules/notifications/actions/index.d.ts +0 -7
  20. package/distribution/modules/notifications/initial/index.d.ts +0 -3
  21. package/distribution/modules/notifications/reducer/index.d.ts +0 -3
  22. package/distribution/modules/notifications/resolvers/index.d.ts +0 -7
  23. package/distribution/modules/notifications/selectors/index.d.ts +0 -6
  24. package/distribution/modules/notifications/types/index.d.ts +0 -31
  25. package/distribution/modules/shortcuts/actions/index.d.ts +0 -5
  26. package/distribution/modules/shortcuts/initial/index.d.ts +0 -3
  27. package/distribution/modules/shortcuts/reducer/index.d.ts +0 -3
  28. package/distribution/modules/shortcuts/resolvers/index.d.ts +0 -7
  29. package/distribution/modules/shortcuts/selectors/index.d.ts +0 -6
  30. package/distribution/modules/shortcuts/types/index.d.ts +0 -9
  31. package/distribution/modules/sitting/actions/index.d.ts +0 -6
  32. package/distribution/modules/sitting/initial/index.d.ts +0 -3
  33. package/distribution/modules/sitting/reducer/index.d.ts +0 -4
  34. package/distribution/modules/sitting/resolvers/index.d.ts +0 -6
  35. package/distribution/modules/sitting/selectors/index.d.ts +0 -7
  36. package/distribution/modules/sitting/types/index.d.ts +0 -15
  37. package/distribution/modules/themes/actions/index.d.ts +0 -5
  38. package/distribution/modules/themes/initial/index.d.ts +0 -3
  39. package/distribution/modules/themes/reducer/index.d.ts +0 -4
  40. package/distribution/modules/themes/resolvers/index.d.ts +0 -5
  41. package/distribution/modules/themes/selectors/index.d.ts +0 -7
  42. package/distribution/modules/themes/types/index.d.ts +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plurid/plurid-ui-state-react",
3
- "version": "0.0.0-1",
3
+ "version": "0.0.0-11",
4
4
  "description": "Plurid User Interface State for React",
5
5
  "keywords": [
6
6
  "plurid",
@@ -30,35 +30,39 @@
30
30
  "module": "distribution/index.es.js",
31
31
  "types": "distribution/index.d.ts",
32
32
  "engines": {
33
- "node": ">=12",
34
- "npm": ">=6"
33
+ "node": ">=18",
34
+ "npm": ">=8"
35
35
  },
36
36
  "scripts": {
37
37
  "test": "jest -c ./configurations/jest.config.js",
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",
42
- "build": "yarn clean && yarn lint && yarn test && yarn build.production && yarn build.clean",
43
- "prepublishOnly": "yarn build"
41
+ "build.production": "rollup -c ./scripts/rollup.config.js --environment BUILD:production --bundleConfigAsCjs",
42
+ "build": "pnpm clean && pnpm lint && pnpm test && pnpm build.production && pnpm build.clean",
43
+ "prepublishOnly": "pnpm build"
44
44
  },
45
45
  "peerDependencies": {
46
- "@plurid/plurid-themes": "*"
46
+ "@plurid/plurid-themes": "*",
47
+ "@reduxjs/toolkit": ">=1.9"
47
48
  },
48
49
  "devDependencies": {
49
- "@plurid/plurid-themes": "^0.0.0-0",
50
- "@types/jest": "^27.0.2",
51
- "@typescript-eslint/eslint-plugin": "^4.31.2",
52
- "@typescript-eslint/parser": "^4.31.2",
50
+ "@plurid/plurid-themes": "^0.0.0-2",
51
+ "@reduxjs/toolkit": "^1.9.5",
52
+ "@rollup/plugin-terser": "^0.4.1",
53
+ "@types/jest": "^29.5.1",
54
+ "@types/node": "^18.16.3",
55
+ "@typescript-eslint/eslint-plugin": "^5.59.1",
56
+ "@typescript-eslint/parser": "^5.59.1",
53
57
  "@zerollup/ts-transform-paths": "^1.7.18",
54
- "eslint": "^7.32.0",
55
- "jest": "^27.2.1",
56
- "rollup": "^2.57.0",
57
- "rollup-plugin-terser": "^7.0.2",
58
- "rollup-plugin-typescript2": "^0.30.0",
59
- "ts-jest": "^27.0.5",
60
- "ts-node": "^10.2.1",
61
- "ttypescript": "^1.5.12",
62
- "typescript": "^4.4.3"
58
+ "eslint": "^8.39.0",
59
+ "immer": "^10.0.1",
60
+ "jest": "^29.5.0",
61
+ "rollup": "^3.21.2",
62
+ "rollup-plugin-typescript2": "^0.34.1",
63
+ "ts-jest": "^29.1.0",
64
+ "ts-node": "^10.9.1",
65
+ "ttypescript": "^1.5.15",
66
+ "typescript": "==4.7.3"
63
67
  }
64
68
  }
@@ -1,5 +0,0 @@
1
- import * as Types from '../types';
2
- declare const actions: {
3
- setHead: (payload: Types.SetHeadPayload) => Types.SetHeadAction;
4
- };
5
- export default actions;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const initialState: Types.State;
3
- export default initialState;
@@ -1,4 +0,0 @@
1
- import * as Types from '../types';
2
- declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
- declare const metareducer: (initialState: Types.State) => (state: Types.State | undefined, action: Types.Actions) => Types.State;
4
- export { reducer, metareducer, };
@@ -1,5 +0,0 @@
1
- import * as Types from '../types';
2
- declare const resolvers: {
3
- setHead: (state: Types.State, action: Types.SetHeadAction) => Types.State;
4
- };
5
- export default resolvers;
@@ -1,6 +0,0 @@
1
- import { StateOfAny } from "../../../data/interfaces";
2
- import * as Types from '../types';
3
- declare const selectors: {
4
- getHeadData: (state: StateOfAny & Record<'head', Types.State>) => Types.State;
5
- };
6
- export default selectors;
@@ -1,21 +0,0 @@
1
- export interface Head {
2
- title: string;
3
- description: string;
4
- canonicalURL: string;
5
- ogTitle: string;
6
- ogImage: string;
7
- ogURL: string;
8
- ogDescription: string;
9
- styles: string[];
10
- scripts: string[];
11
- }
12
- export declare const SET_HEAD = "SET_HEAD";
13
- export interface SetHeadPayload extends Partial<Head> {
14
- }
15
- export interface SetHeadAction {
16
- type: typeof SET_HEAD;
17
- payload: SetHeadPayload;
18
- }
19
- export interface State extends Head {
20
- }
21
- export declare type Actions = SetHeadAction;
@@ -1,7 +0,0 @@
1
- import * as Types from '../types';
2
- declare const actions: {
3
- addNotification: (payload: Types.AddNotificationPayload) => Types.AddNotificationAction;
4
- updateNotification: (payload: Types.UpdateNotificationPayload) => Types.UpdateNotificationAction;
5
- removeNotification: (payload: Types.RemoveNotificationPayload) => Types.RemoveNotificationAction;
6
- };
7
- export default actions;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const initialState: Types.State;
3
- export default initialState;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
- export { reducer, };
@@ -1,7 +0,0 @@
1
- import * as Types from '../types';
2
- declare const resolvers: {
3
- addNotification: (state: Types.State, action: Types.AddNotificationAction) => Types.State;
4
- updateNotification: (state: Types.State, action: Types.UpdateNotificationAction) => Types.State;
5
- removeNotification: (state: Types.State, action: Types.RemoveNotificationAction) => Types.State;
6
- };
7
- export default resolvers;
@@ -1,6 +0,0 @@
1
- import { StateOfAny } from "../../../data/interfaces";
2
- import * as Types from '../types';
3
- declare const selectors: {
4
- getAll: (state: StateOfAny & Record<'notifications', Types.State>) => Types.State;
5
- };
6
- export default selectors;
@@ -1,31 +0,0 @@
1
- export interface Notification {
2
- id: string;
3
- text: string;
4
- html?: boolean;
5
- react?: boolean;
6
- timeout?: number;
7
- }
8
- export declare const ADD_NOTIFICATION = "ADD_NOTIFICATION";
9
- export interface AddNotificationPayload extends Notification {
10
- }
11
- export interface AddNotificationAction {
12
- type: typeof ADD_NOTIFICATION;
13
- payload: AddNotificationPayload;
14
- }
15
- export declare const UPDATE_NOTIFICATION = "UPDATE_NOTIFICATION";
16
- export interface UpdateNotificationPayload extends Notification {
17
- }
18
- export interface UpdateNotificationAction {
19
- type: typeof UPDATE_NOTIFICATION;
20
- payload: UpdateNotificationPayload;
21
- }
22
- export declare const REMOVE_NOTIFICATION = "REMOVE_NOTIFICATION";
23
- export interface RemoveNotificationPayload {
24
- id: string;
25
- }
26
- export interface RemoveNotificationAction {
27
- type: typeof REMOVE_NOTIFICATION;
28
- payload: RemoveNotificationPayload;
29
- }
30
- export declare type State = Notification[];
31
- export declare type Actions = AddNotificationAction | UpdateNotificationAction | RemoveNotificationAction;
@@ -1,5 +0,0 @@
1
- import * as Types from '../types';
2
- declare const actions: {
3
- toggleGlobalShortcuts: (payload?: boolean | undefined) => Types.ToggleGlobalShortcutsAction;
4
- };
5
- export default actions;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const initialState: Types.State;
3
- export default initialState;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
- export { reducer, };
@@ -1,7 +0,0 @@
1
- import * as Types from '../types';
2
- declare const resolvers: {
3
- toggleGlobalShortcuts: (state: Types.State, action: Types.ToggleGlobalShortcutsAction) => {
4
- global: boolean;
5
- };
6
- };
7
- export default resolvers;
@@ -1,6 +0,0 @@
1
- import { StateOfAny } from "../../../data/interfaces";
2
- import * as Types from '../types';
3
- declare const selectors: {
4
- getGlobal: (state: StateOfAny & Record<'shortcuts', Types.State>) => boolean;
5
- };
6
- export default selectors;
@@ -1,9 +0,0 @@
1
- export declare const TOGGLE_GLOBAL_SHORTCUTS = "TOGGLE_GLOBAL_SHORTCUTS";
2
- export interface ToggleGlobalShortcutsAction {
3
- type: typeof TOGGLE_GLOBAL_SHORTCUTS;
4
- payload?: boolean;
5
- }
6
- export interface State {
7
- global: boolean;
8
- }
9
- export declare type Actions = ToggleGlobalShortcutsAction;
@@ -1,6 +0,0 @@
1
- import * as Types from '../types';
2
- declare const actions: {
3
- setSittingCurrentLink: (link: string) => Types.SetSittingCurrentLinkAction;
4
- toggleSittingTray: () => Types.ToggleSittingTrayAction;
5
- };
6
- export default actions;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const initialState: Types.State;
3
- export default initialState;
@@ -1,4 +0,0 @@
1
- import * as Types from '../types';
2
- declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
- declare const metareducer: (initialState: Types.State) => (state: Types.State | undefined, action: Types.Actions) => Types.State;
4
- export { reducer, metareducer, };
@@ -1,6 +0,0 @@
1
- import * as Types from '../types';
2
- declare const resolvers: {
3
- setSittingCurrentLink: (state: Types.State, action: Types.SetSittingCurrentLinkAction) => Types.State;
4
- toggleSittingTray: (state: Types.State, action: Types.ToggleSittingTrayAction) => Types.State;
5
- };
6
- export default resolvers;
@@ -1,7 +0,0 @@
1
- import { StateOfAny } from "../../../data/interfaces";
2
- import * as Types from '../types';
3
- declare const selectors: {
4
- getCurrentLink: (state: StateOfAny & Record<'sitting', Types.State>) => string;
5
- getTray: (state: StateOfAny & Record<'sitting', Types.State>) => boolean;
6
- };
7
- export default selectors;
@@ -1,15 +0,0 @@
1
- export declare const SET_SITTING_CURRENT_LINK = "SET_SITTING_CURRENT_LINK";
2
- export interface SetSittingCurrentLinkAction {
3
- type: typeof SET_SITTING_CURRENT_LINK;
4
- payload: string;
5
- }
6
- export declare const TOGGLE_SITTING_TRAY = "TOGGLE_SITTING_TRAY";
7
- export interface ToggleSittingTrayAction {
8
- type: typeof TOGGLE_SITTING_TRAY;
9
- payload?: boolean;
10
- }
11
- export interface State {
12
- currentLink: string;
13
- tray: boolean;
14
- }
15
- export declare type Actions = SetSittingCurrentLinkAction | ToggleSittingTrayAction;
@@ -1,5 +0,0 @@
1
- import * as Types from '../types';
2
- declare const actions: {
3
- setTheme: (payload: Types.SetThemePayload) => Types.SetThemeAction;
4
- };
5
- export default actions;
@@ -1,3 +0,0 @@
1
- import * as Types from '../types';
2
- declare const initialState: Types.State;
3
- export default initialState;
@@ -1,4 +0,0 @@
1
- import * as Types from '../types';
2
- declare const reducer: (state: Types.State | undefined, action: Types.Actions) => Types.State;
3
- declare const metareducer: (initialState: Types.State) => (state: Types.State | undefined, action: Types.Actions) => Types.State;
4
- export { reducer, metareducer, };
@@ -1,5 +0,0 @@
1
- import * as Types from '../types';
2
- declare const resolvers: {
3
- setTheme: (state: Types.State, action: Types.SetThemeAction) => Types.State;
4
- };
5
- export default resolvers;
@@ -1,7 +0,0 @@
1
- import { StateOfAny } from "../../../data/interfaces";
2
- import * as Types from '../types';
3
- declare const selectors: {
4
- getGeneralTheme: (state: StateOfAny & Record<'themes', Types.State>) => import("@plurid/plurid-themes/distribution").Theme;
5
- getInteractionTheme: (state: StateOfAny & Record<'themes', Types.State>) => import("@plurid/plurid-themes/distribution").Theme;
6
- };
7
- export default selectors;
@@ -1,15 +0,0 @@
1
- import { Theme } from '@plurid/plurid-themes';
2
- export declare const SET_THEME = "SET_THEME";
3
- export interface SetThemePayload {
4
- type: 'general' | 'interaction';
5
- theme: Theme;
6
- }
7
- export interface SetThemeAction {
8
- type: typeof SET_THEME;
9
- payload: SetThemePayload;
10
- }
11
- export interface State {
12
- general: Theme;
13
- interaction: Theme;
14
- }
15
- export declare type Actions = SetThemeAction;