@dr.pogodin/react-utils 1.35.2 → 1.35.5

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.
@@ -8,7 +8,7 @@ export type OptionT<NameT> = {
8
8
  name?: NameT | null;
9
9
  value: ValueT;
10
10
  };
11
- export type OptionsT<NameT> = Array<OptionT<NameT> | ValueT>;
11
+ export type OptionsT<NameT> = Readonly<Array<OptionT<NameT> | ValueT>>;
12
12
  export type PropsT<NameT, OnChangeT = React.ChangeEventHandler<HTMLSelectElement>> = {
13
13
  filter?: (item: OptionT<NameT> | ValueT) => boolean;
14
14
  label?: React.ReactNode;
@@ -11,6 +11,11 @@ export type InjT = {
11
11
  };
12
12
  ISTATE?: unknown;
13
13
  };
14
+ declare global {
15
+ interface Window {
16
+ REACT_UTILS_INJECTION?: InjT;
17
+ }
18
+ }
14
19
  export interface SsrContextT<StateT> extends SsrContext<StateT> {
15
20
  chunkGroups: ChunkGroupsT;
16
21
  chunks: string[];
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.35.2",
2
+ "version": "1.35.5",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"
@@ -8,8 +8,8 @@
8
8
  "url": "https://github.com/birdofpreyru/react-utils/issues"
9
9
  },
10
10
  "dependencies": {
11
- "@babel/runtime": "^7.24.6",
12
- "@dr.pogodin/babel-plugin-react-css-modules": "^6.13.1",
11
+ "@babel/runtime": "^7.24.7",
12
+ "@dr.pogodin/babel-plugin-react-css-modules": "^6.13.2",
13
13
  "@dr.pogodin/csurf": "^1.13.0",
14
14
  "@dr.pogodin/js-utils": "^0.0.12",
15
15
  "@dr.pogodin/react-global-state": "^0.14.2",
@@ -42,20 +42,20 @@
42
42
  "serialize-javascript": "^6.0.2",
43
43
  "serve-favicon": "^2.5.0",
44
44
  "source-map-support": "^0.5.21",
45
- "uuid": "^9.0.1",
45
+ "uuid": "^10.0.0",
46
46
  "winston": "^3.13.0"
47
47
  },
48
48
  "description": "Collection of generic ReactJS components and utils",
49
49
  "devDependencies": {
50
- "@babel/cli": "^7.24.6",
51
- "@babel/core": "^7.24.6",
52
- "@babel/eslint-parser": "^7.24.6",
53
- "@babel/eslint-plugin": "^7.24.6",
54
- "@babel/node": "^7.24.6",
55
- "@babel/plugin-transform-runtime": "^7.24.6",
56
- "@babel/preset-env": "^7.24.6",
57
- "@babel/preset-react": "^7.24.6",
58
- "@babel/preset-typescript": "^7.24.6",
50
+ "@babel/cli": "^7.24.7",
51
+ "@babel/core": "^7.24.7",
52
+ "@babel/eslint-parser": "^7.24.7",
53
+ "@babel/eslint-plugin": "^7.24.7",
54
+ "@babel/node": "^7.24.7",
55
+ "@babel/plugin-transform-runtime": "^7.24.7",
56
+ "@babel/preset-env": "^7.24.7",
57
+ "@babel/preset-react": "^7.24.7",
58
+ "@babel/preset-typescript": "^7.24.7",
59
59
  "@babel/register": "^7.24.6",
60
60
  "@dr.pogodin/babel-plugin-transform-assets": "^1.2.2",
61
61
  "@dr.pogodin/babel-preset-svgr": "^1.8.0",
@@ -71,7 +71,7 @@
71
71
  "@types/csurf": "^1.11.5",
72
72
  "@types/express": "^4.17.21",
73
73
  "@types/jest": "^29.5.12",
74
- "@types/lodash": "^4.17.4",
74
+ "@types/lodash": "^4.17.5",
75
75
  "@types/morgan": "^1.9.9",
76
76
  "@types/node-forge": "^1.3.11",
77
77
  "@types/pretty": "^2.0.3",
@@ -96,7 +96,7 @@
96
96
  "eslint-config-airbnb-typescript": "^18.0.0",
97
97
  "eslint-import-resolver-babel-module": "^5.3.2",
98
98
  "eslint-plugin-import": "^2.29.1",
99
- "eslint-plugin-jest": "^28.5.0",
99
+ "eslint-plugin-jest": "^28.6.0",
100
100
  "eslint-plugin-jsx-a11y": "^6.8.0",
101
101
  "eslint-plugin-react": "^7.34.2",
102
102
  "eslint-plugin-react-hooks": "^4.6.2",
@@ -31,6 +31,9 @@ if (metaElement) {
31
31
 
32
32
  data = forge.util.decodeUtf8(d.output.data);
33
33
  inj = eval(`(${data})`); // eslint-disable-line no-eval
34
+ } else if (typeof window !== 'undefined' && window.REACT_UTILS_INJECTION) {
35
+ inj = window.REACT_UTILS_INJECTION;
36
+ delete window.REACT_UTILS_INJECTION;
34
37
  } else {
35
38
  // Otherwise, a bunch of dependent stuff will easily fail in non-standard
36
39
  // environments, where no client-side initialization is performed. Like tests,
@@ -31,7 +31,7 @@ export type OptionT<NameT> = {
31
31
  value: ValueT;
32
32
  };
33
33
 
34
- export type OptionsT<NameT> = Array<OptionT<NameT> | ValueT>;
34
+ export type OptionsT<NameT> = Readonly<Array<OptionT<NameT> | ValueT>>;
35
35
 
36
36
  export type PropsT<
37
37
  NameT,
@@ -13,6 +13,12 @@ export type InjT = {
13
13
  ISTATE?: unknown;
14
14
  };
15
15
 
16
+ declare global {
17
+ interface Window {
18
+ REACT_UTILS_INJECTION?: InjT;
19
+ }
20
+ }
21
+
16
22
  export interface SsrContextT<StateT> extends SsrContext<StateT> {
17
23
  chunkGroups: ChunkGroupsT;
18
24
  chunks: string[];