@dr.pogodin/react-utils 1.43.12 → 1.43.14

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 (41) hide show
  1. package/build/development/server/renderer.js.map +1 -1
  2. package/build/development/server/server.js +1 -1
  3. package/build/development/server/server.js.map +1 -1
  4. package/build/development/shared/components/Button/index.js +4 -1
  5. package/build/development/shared/components/Button/index.js.map +1 -1
  6. package/build/development/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  7. package/build/development/shared/components/selectors/CustomDropdown/index.js +1 -1
  8. package/build/development/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  9. package/build/development/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  10. package/build/development/shared/utils/index.js.map +1 -1
  11. package/build/development/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  12. package/build/development/shared/utils/splitComponent.js.map +1 -1
  13. package/build/development/web.bundle.js +5 -5
  14. package/build/production/server/renderer.js.map +1 -1
  15. package/build/production/server/server.js +1 -1
  16. package/build/production/server/server.js.map +1 -1
  17. package/build/production/shared/components/Button/index.js +2 -2
  18. package/build/production/shared/components/Button/index.js.map +1 -1
  19. package/build/production/shared/components/selectors/CustomDropdown/Options/index.js.map +1 -1
  20. package/build/production/shared/components/selectors/CustomDropdown/index.js +1 -1
  21. package/build/production/shared/components/selectors/CustomDropdown/index.js.map +1 -1
  22. package/build/production/shared/components/selectors/NativeDropdown/index.js.map +1 -1
  23. package/build/production/shared/utils/index.js.map +1 -1
  24. package/build/production/shared/utils/jest/E2eSsrEnv.js.map +1 -1
  25. package/build/production/shared/utils/splitComponent.js.map +1 -1
  26. package/build/production/web.bundle.js +1 -1
  27. package/build/production/web.bundle.js.map +1 -1
  28. package/build/types-code/server/renderer.d.ts +1 -1
  29. package/build/types-code/server/server.d.ts +1 -0
  30. package/build/types-code/shared/components/Button/index.d.ts +4 -3
  31. package/build/types-code/shared/utils/index.d.ts +1 -1
  32. package/package.json +15 -15
  33. package/src/server/renderer.tsx +5 -6
  34. package/src/server/server.ts +2 -1
  35. package/src/shared/components/Button/index.tsx +15 -5
  36. package/src/shared/components/selectors/CustomDropdown/Options/index.tsx +2 -2
  37. package/src/shared/components/selectors/CustomDropdown/index.tsx +2 -2
  38. package/src/shared/components/selectors/NativeDropdown/index.tsx +2 -2
  39. package/src/shared/utils/index.ts +1 -1
  40. package/src/shared/utils/jest/E2eSsrEnv.ts +3 -3
  41. package/src/shared/utils/splitComponent.tsx +1 -1
@@ -3,11 +3,11 @@
3
3
  */
4
4
  import type { Request, RequestHandler } from 'express';
5
5
  import type { ComponentType } from 'react';
6
+ import type { Configuration } from 'webpack';
6
7
  import winston from 'winston';
7
8
  import { SsrContext } from '@dr.pogodin/react-global-state';
8
9
  import { type BuildInfoT } from '../shared/utils/isomorphy/buildInfo';
9
10
  import type { ChunkGroupsT, SsrContextT } from '../shared/utils/globalState';
10
- import type { Configuration } from 'webpack';
11
11
  interface LogMethodI {
12
12
  (level: string, message: string, ...meta: unknown[]): void;
13
13
  }
@@ -30,6 +30,7 @@ export type ServerT = Express & {
30
30
  export type OptionsT = RendererOptionsT & {
31
31
  beforeExpressJsError?: (server: ServerT) => boolean | Promise<boolean>;
32
32
  beforeExpressJsSetup?: (server: ServerT) => Promise<void> | void;
33
+ cookieSignatureSecret?: string;
33
34
  cspSettingsHook?: (defaultOptions: CspOptionsT, req: Request) => CspOptionsT;
34
35
  devMode?: boolean;
35
36
  httpsRedirect?: boolean;
@@ -1,12 +1,13 @@
1
- import type { FunctionComponent, PointerEventHandler, ReactNode } from 'react';
1
+ import type { FunctionComponent, KeyboardEventHandler, MouseEventHandler, PointerEventHandler, ReactNode } from 'react';
2
2
  import { type Theme } from '@dr.pogodin/react-themes';
3
3
  type PropsT = {
4
4
  active?: boolean;
5
5
  children?: ReactNode;
6
6
  disabled?: boolean;
7
7
  enforceA?: boolean;
8
- onClick?: React.MouseEventHandler & React.KeyboardEventHandler;
9
- onMouseDown?: React.MouseEventHandler;
8
+ onClick?: MouseEventHandler & KeyboardEventHandler;
9
+ onMouseDown?: MouseEventHandler;
10
+ onMouseUp?: MouseEventHandler;
10
11
  onPointerDown?: PointerEventHandler;
11
12
  openNewTab?: boolean;
12
13
  replace?: boolean;
@@ -1,4 +1,4 @@
1
- import themedImpl, { type Theme, COMPOSE, PRIORITY, ThemeProvider } from '@dr.pogodin/react-themes';
1
+ import themedImpl, { COMPOSE, PRIORITY, type Theme, ThemeProvider } from '@dr.pogodin/react-themes';
2
2
  import config from './config';
3
3
  import * as isomorphy from './isomorphy';
4
4
  import time from './time';
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.43.12",
2
+ "version": "1.43.14",
3
3
  "bin": {
4
4
  "react-utils-build": "bin/build.js",
5
5
  "react-utils-setup": "bin/setup.js"
@@ -9,15 +9,15 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@babel/runtime": "^7.27.1",
12
- "@dr.pogodin/babel-plugin-react-css-modules": "^6.13.5",
13
- "@dr.pogodin/csurf": "^1.16.2",
12
+ "@dr.pogodin/babel-plugin-react-css-modules": "^6.13.6",
13
+ "@dr.pogodin/csurf": "^1.16.4",
14
14
  "@dr.pogodin/js-utils": "^0.0.18",
15
15
  "@dr.pogodin/react-global-state": "^0.19.2",
16
16
  "@dr.pogodin/react-helmet": "^3.0.2",
17
17
  "@dr.pogodin/react-themes": "^1.9.0",
18
18
  "@jest/environment": "^29.7.0",
19
19
  "axios": "^1.9.0",
20
- "commander": "^13.1.0",
20
+ "commander": "^14.0.0",
21
21
  "compression": "^1.8.0",
22
22
  "config": "^4.0.0",
23
23
  "cookie": "^1.0.2",
@@ -54,25 +54,25 @@
54
54
  "@babel/preset-react": "^7.27.1",
55
55
  "@babel/preset-typescript": "^7.27.1",
56
56
  "@babel/register": "^7.27.1",
57
- "@dr.pogodin/babel-plugin-transform-assets": "^1.2.4",
58
- "@dr.pogodin/babel-preset-svgr": "^1.9.0",
59
- "@dr.pogodin/eslint-configs": "^0.0.6",
57
+ "@dr.pogodin/babel-plugin-transform-assets": "^1.2.5",
58
+ "@dr.pogodin/babel-preset-svgr": "^1.9.1",
59
+ "@dr.pogodin/eslint-configs": "^0.0.7",
60
60
  "@pmmmwh/react-refresh-webpack-plugin": "^0.6.0",
61
61
  "@testing-library/dom": "^10.4.0",
62
62
  "@testing-library/react": "^16.3.0",
63
63
  "@testing-library/user-event": "^14.6.1",
64
64
  "@tsconfig/recommended": "^1.0.8",
65
- "@types/compression": "^1.7.5",
65
+ "@types/compression": "^1.8.0",
66
66
  "@types/config": "^3.3.5",
67
67
  "@types/cookie": "^0.6.0",
68
68
  "@types/cookie-parser": "^1.4.8",
69
- "@types/express": "^5.0.1",
69
+ "@types/express": "^5.0.2",
70
70
  "@types/jest": "^29.5.14",
71
- "@types/lodash": "^4.17.16",
71
+ "@types/lodash": "^4.17.17",
72
72
  "@types/morgan": "^1.9.9",
73
73
  "@types/node-forge": "^1.3.11",
74
74
  "@types/pretty": "^2.0.3",
75
- "@types/react": "^19.1.4",
75
+ "@types/react": "^19.1.5",
76
76
  "@types/react-dom": "^19.1.5",
77
77
  "@types/request-ip": "^0.0.41",
78
78
  "@types/serialize-javascript": "^5.0.4",
@@ -90,7 +90,7 @@
90
90
  "identity-obj-proxy": "^3.0.0",
91
91
  "jest": "^29.7.0",
92
92
  "jest-environment-jsdom": "^29.7.0",
93
- "memfs": "^4.17.1",
93
+ "memfs": "^4.17.2",
94
94
  "mini-css-extract-plugin": "^2.9.2",
95
95
  "mockdate": "^3.0.5",
96
96
  "nodelist-foreach-polyfill": "^1.2.0",
@@ -101,18 +101,18 @@
101
101
  "react-refresh": "^0.17.0",
102
102
  "regenerator-runtime": "^0.14.1",
103
103
  "resolve-url-loader": "^5.0.0",
104
- "sass": "^1.88.0",
104
+ "sass": "^1.89.0",
105
105
  "sass-loader": "^16.0.5",
106
106
  "sitemap": "^8.0.0",
107
107
  "source-map-loader": "^5.0.0",
108
108
  "stylelint": "^16.19.1",
109
- "stylelint-config-standard-scss": "^15.0.0",
109
+ "stylelint-config-standard-scss": "^15.0.1",
110
110
  "supertest": "^7.1.1",
111
111
  "tsc-alias": "1.8.16",
112
112
  "tstyche": "^3.5.0",
113
113
  "typed-scss-modules": "^8.1.1",
114
114
  "typescript": "^5.8.3",
115
- "webpack": "^5.99.8",
115
+ "webpack": "^5.99.9",
116
116
  "webpack-dev-middleware": "^7.4.2",
117
117
  "webpack-hot-middleware": "^2.26.1",
118
118
  "webpack-merge": "^6.0.1",
@@ -4,11 +4,12 @@
4
4
 
5
5
  import fs from 'fs';
6
6
  import path from 'path';
7
+ import { Writable } from 'stream';
8
+ import { brotliCompress, brotliDecompress } from 'zlib';
7
9
 
8
10
  import type { Request, RequestHandler } from 'express';
9
11
  import type { ComponentType } from 'react';
10
- import { Writable } from 'stream';
11
- import { brotliCompress, brotliDecompress } from 'zlib';
12
+ import type { Configuration, Stats } from 'webpack';
12
13
  import winston from 'winston';
13
14
 
14
15
  import { GlobalStateProvider, SsrContext } from '@dr.pogodin/react-global-state';
@@ -18,8 +19,8 @@ import {
18
19
  clone,
19
20
  cloneDeep,
20
21
  defaults,
21
- isString,
22
22
  get,
23
+ isString,
23
24
  mapValues,
24
25
  omit,
25
26
  } from 'lodash';
@@ -28,15 +29,13 @@ import config from 'config';
28
29
  import forge from 'node-forge';
29
30
 
30
31
  import { prerenderToNodeStream } from 'react-dom/static';
31
- import { HelmetProvider, type HelmetDataContext } from '@dr.pogodin/react-helmet';
32
+ import { type HelmetDataContext, HelmetProvider } from '@dr.pogodin/react-helmet';
32
33
  import { StaticRouter } from 'react-router';
33
34
  import serializeJs from 'serialize-javascript';
34
35
  import { type BuildInfoT, setBuildInfo } from 'utils/isomorphy/buildInfo';
35
36
 
36
37
  import type { ChunkGroupsT, SsrContextT } from 'utils/globalState';
37
38
 
38
- import type { Configuration, Stats } from 'webpack';
39
-
40
39
  import Cache from './Cache';
41
40
 
42
41
  const sanitizedConfig = omit(config, 'SECRET');
@@ -116,6 +116,7 @@ export type OptionsT = RendererOptionsT & {
116
116
  (server: ServerT) => boolean | Promise<boolean>;
117
117
 
118
118
  beforeExpressJsSetup?: (server: ServerT) => Promise<void> | void;
119
+ cookieSignatureSecret?: string;
119
120
  cspSettingsHook?: (
120
121
  defaultOptions: CspOptionsT,
121
122
  req: Request,
@@ -207,7 +208,7 @@ export default async function factory(
207
208
 
208
209
  server.use(express.json({ limit: '300kb' }));
209
210
  server.use(express.urlencoded({ extended: false }));
210
- server.use(cookieParser());
211
+ server.use(cookieParser(options.cookieSignatureSecret));
211
212
  server.use(requestIp.mw());
212
213
 
213
214
  server.use(csrf({ cookie: true }));
@@ -1,11 +1,17 @@
1
1
  // The <Button> component implements a standard button / button-like link.
2
2
 
3
- import type { FunctionComponent, PointerEventHandler, ReactNode } from 'react';
4
-
5
- import Link from 'components/Link';
3
+ import type {
4
+ FunctionComponent,
5
+ KeyboardEventHandler,
6
+ MouseEventHandler,
7
+ PointerEventHandler,
8
+ ReactNode,
9
+ } from 'react';
6
10
 
7
11
  import themed, { type Theme } from '@dr.pogodin/react-themes';
8
12
 
13
+ import Link from 'components/Link';
14
+
9
15
  import defaultTheme from './style.scss';
10
16
 
11
17
  type PropsT = {
@@ -13,8 +19,9 @@ type PropsT = {
13
19
  children?: ReactNode;
14
20
  disabled?: boolean;
15
21
  enforceA?: boolean;
16
- onClick?: React.MouseEventHandler & React.KeyboardEventHandler;
17
- onMouseDown?: React.MouseEventHandler;
22
+ onClick?: MouseEventHandler & KeyboardEventHandler;
23
+ onMouseDown?: MouseEventHandler;
24
+ onMouseUp?: MouseEventHandler;
18
25
  onPointerDown?: PointerEventHandler;
19
26
  openNewTab?: boolean;
20
27
  replace?: boolean;
@@ -31,6 +38,7 @@ export const BaseButton: FunctionComponent<PropsT> = ({
31
38
  enforceA,
32
39
  onClick,
33
40
  onMouseDown,
41
+ onMouseUp,
34
42
  onPointerDown,
35
43
  openNewTab,
36
44
  replace,
@@ -59,6 +67,7 @@ export const BaseButton: FunctionComponent<PropsT> = ({
59
67
  enforceA={enforceA}
60
68
  onClick={onClick}
61
69
  onMouseDown={onMouseDown}
70
+ onMouseUp={onMouseUp}
62
71
  onPointerDown={onPointerDown}
63
72
  openNewTab={openNewTab}
64
73
  replace={replace}
@@ -78,6 +87,7 @@ export const BaseButton: FunctionComponent<PropsT> = ({
78
87
  if (e.key === 'Enter') onClick(e);
79
88
  } : undefined}
80
89
  onMouseDown={onMouseDown}
90
+ onMouseUp={onMouseUp}
81
91
  onPointerDown={onPointerDown}
82
92
  role="button"
83
93
  tabIndex={0}
@@ -8,8 +8,6 @@ import {
8
8
 
9
9
  import { BaseModal } from 'components/Modal';
10
10
 
11
- import S from './style.scss';
12
-
13
11
  import {
14
12
  type OptionT,
15
13
  type OptionsT,
@@ -17,6 +15,8 @@ import {
17
15
  optionValueName,
18
16
  } from '../../common';
19
17
 
18
+ import S from './style.scss';
19
+
20
20
  export type ContainerPosT = {
21
21
  left: number;
22
22
  top: number;
@@ -2,12 +2,12 @@ import { useEffect, useRef, useState } from 'react';
2
2
 
3
3
  import themed from '@dr.pogodin/react-themes';
4
4
 
5
+ import { type PropsT, type ValueT, optionValueName } from '../common';
6
+
5
7
  import Options, { type ContainerPosT, type RefT, areEqual } from './Options';
6
8
 
7
9
  import defaultTheme from './theme.scss';
8
10
 
9
- import { type PropsT, type ValueT, optionValueName } from '../common';
10
-
11
11
  const BaseCustomDropdown: React.FunctionComponent<
12
12
  PropsT<React.ReactNode, (value: ValueT) => void>
13
13
  > = ({
@@ -2,10 +2,10 @@
2
2
 
3
3
  import themed from '@dr.pogodin/react-themes';
4
4
 
5
- import defaultTheme from './theme.scss';
6
-
7
5
  import { type PropsT, optionValueName } from '../common';
8
6
 
7
+ import defaultTheme from './theme.scss';
8
+
9
9
  /**
10
10
  * Implements a themeable dropdown list. Internally it is rendered with help of
11
11
  * the standard HTML `<select>` element, thus the styling support is somewhat
@@ -1,7 +1,7 @@
1
1
  import themedImpl, {
2
- type Theme,
3
2
  COMPOSE,
4
3
  PRIORITY,
4
+ type Theme,
5
5
  ThemeProvider,
6
6
  } from '@dr.pogodin/react-themes';
7
7
 
@@ -28,17 +28,17 @@ import type { ReactNode } from 'react';
28
28
  import register from '@babel/register/experimental-worker';
29
29
 
30
30
  import JsdomEnv from 'jest-environment-jsdom';
31
- import { createFsFromVolume, Volume } from 'memfs';
31
+ import { Volume, createFsFromVolume } from 'memfs';
32
32
  import webpack, { type Configuration } from 'webpack';
33
33
  /* eslint-enable import/no-extraneous-dependencies */
34
34
 
35
- import ssrFactory from 'server/renderer';
36
-
37
35
  import type {
38
36
  EnvironmentContext,
39
37
  JestEnvironmentConfig,
40
38
  } from '@jest/environment';
41
39
 
40
+ import ssrFactory from 'server/renderer';
41
+
42
42
  import { setBuildInfo } from '../isomorphy/buildInfo';
43
43
 
44
44
  export default class E2eSsrEnv extends JsdomEnv {
@@ -5,8 +5,8 @@ import {
5
5
  type FunctionComponent,
6
6
  type ReactNode,
7
7
  type RefObject,
8
- lazy,
9
8
  Suspense,
9
+ lazy,
10
10
  useInsertionEffect,
11
11
  } from 'react';
12
12