@dr.pogodin/react-utils 1.26.2 → 1.26.4
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/build/development/index.js +7 -7
- package/build/development/index.js.map +1 -1
- package/build/development/shared/components/Button/index.js +3 -1
- package/build/development/shared/components/Button/index.js.map +1 -1
- package/build/development/shared/components/Throbber/index.js +5 -5
- package/build/development/shared/components/Throbber/index.js.map +1 -1
- package/build/development/shared/utils/globalState.js +2 -3
- package/build/development/shared/utils/globalState.js.map +1 -1
- package/build/development/web.bundle.js +4 -4
- package/build/production/index.js +1 -1
- package/build/production/index.js.map +1 -1
- package/build/production/shared/components/Button/index.js +1 -1
- package/build/production/shared/components/Button/index.js.map +1 -1
- package/build/production/shared/components/Throbber/index.js +1 -1
- package/build/production/shared/components/Throbber/index.js.map +1 -1
- package/build/production/shared/utils/globalState.js +2 -2
- package/build/production/shared/utils/globalState.js.map +1 -1
- package/build/production/web.bundle.js +1 -1
- package/build/production/web.bundle.js.map +1 -1
- package/build/types-code/index.d.ts +1 -1
- package/config/webpack/app-development.d.ts +2 -0
- package/config/webpack/app-development.js +1 -4
- package/config/webpack/app-production.d.ts +4 -1
- package/config/webpack/app-production.js +1 -4
- package/config/webpack/lib-base.d.ts +2 -0
- package/config/webpack/lib-base.js +1 -1
- package/package.json +11 -11
- package/src/index.ts +9 -2
- package/src/shared/components/Button/index.tsx +4 -1
- package/src/shared/components/Throbber/index.tsx +5 -4
- package/src/shared/utils/globalState.ts +2 -2
|
@@ -4,7 +4,7 @@ declare const server: typeof ServerT | null;
|
|
|
4
4
|
declare const client: any;
|
|
5
5
|
export { default as api } from 'axios';
|
|
6
6
|
export * as PT from 'prop-types';
|
|
7
|
-
export {
|
|
7
|
+
export { type AsyncCollectionLoaderT, type AsyncDataEnvelopeT, type AsyncDataLoaderT, type ForceT, type UseAsyncDataOptionsT, type UseAsyncDataResT, type UseGlobalStateResT, type ValueOrInitializerT, getGlobalState, GlobalStateProvider, useAsyncCollection, useAsyncData, useGlobalState, withGlobalStateType, } from '@dr.pogodin/react-global-state';
|
|
8
8
|
export { BaseModal, Button, Checkbox, Dropdown, Input, Link, PageLayout, MetaTags, Modal, NavLink, ScalableRect, Throbber, WithTooltip, YouTubeVideo, } from './shared/components';
|
|
9
9
|
export { type Theme, config, Barrier, Emitter, isomorphy, getSsrContext, JU, Semaphore, splitComponent, themed, ThemeProvider, time, webpack, withRetries, } from './shared/utils';
|
|
10
10
|
export { client, server };
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
1
2
|
import webpack from 'webpack';
|
|
2
3
|
import { type OptionsT as BaseOptionsT } from './app-base';
|
|
3
4
|
type OptionsT = BaseOptionsT & {
|
|
4
5
|
dontUseHmr?: boolean;
|
|
5
6
|
dontUseReactGlobalStateDebugging?: boolean;
|
|
7
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
6
8
|
};
|
|
7
9
|
/**
|
|
8
10
|
* @param ops
|
|
@@ -28,10 +28,7 @@ function configFactory(ops) {
|
|
|
28
28
|
entry.push('webpack-hot-middleware/client?reload=true');
|
|
29
29
|
entry.push(...Array.isArray(o.entry) ? o.entry : [o.entry]);
|
|
30
30
|
const plugins = [
|
|
31
|
-
new mini_css_extract_plugin_1.default({
|
|
32
|
-
chunkFilename: '[id].css',
|
|
33
|
-
filename: '[id].css',
|
|
34
|
-
}),
|
|
31
|
+
new mini_css_extract_plugin_1.default(Object.assign({ chunkFilename: '[id].css', filename: '[id].css' }, ops.cssExtractionOptions)),
|
|
35
32
|
new webpack_1.default.DefinePlugin({
|
|
36
33
|
'process.env.BABEL_ENV': JSON.stringify('development'),
|
|
37
34
|
'process.env.DEV_TOOLS': JSON.stringify(true),
|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
* @module webpack/app-production
|
|
4
4
|
* @desc Production Webpack configuration for applications.
|
|
5
5
|
*/
|
|
6
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
6
7
|
import { type Configuration } from 'webpack';
|
|
7
8
|
import { type OptionsT as BaseOptionsT } from './app-base';
|
|
8
|
-
type OptionsT = BaseOptionsT
|
|
9
|
+
type OptionsT = BaseOptionsT & {
|
|
10
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
11
|
+
};
|
|
9
12
|
/**
|
|
10
13
|
* @param {object} ops
|
|
11
14
|
* @param {string} ops.context Base URL for resolution of relative config paths.
|
|
@@ -46,10 +46,7 @@ function configFactory(ops) {
|
|
|
46
46
|
'process.env.BABEL_ENV': JSON.stringify('production'),
|
|
47
47
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
48
48
|
}),
|
|
49
|
-
new mini_css_extract_plugin_1.default({
|
|
50
|
-
chunkFilename: '[contenthash].css',
|
|
51
|
-
filename: '[contenthash].css',
|
|
52
|
-
}),
|
|
49
|
+
new mini_css_extract_plugin_1.default(Object.assign({ chunkFilename: '[contenthash].css', filename: '[contenthash].css' }, ops.cssExtractionOptions)),
|
|
53
50
|
],
|
|
54
51
|
});
|
|
55
52
|
return res;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import MiniCssExtractPlugin from 'mini-css-extract-plugin';
|
|
1
2
|
import { type Configuration } from 'webpack';
|
|
2
3
|
export type OptionsT = {
|
|
3
4
|
babelEnv: string;
|
|
4
5
|
babelLoaderOptions?: object;
|
|
5
6
|
context: string;
|
|
7
|
+
cssExtractionOptions?: MiniCssExtractPlugin.PluginOptions;
|
|
6
8
|
cssLocalIdent?: string;
|
|
7
9
|
dontUseProgressPlugin?: boolean;
|
|
8
10
|
entry: string | string[];
|
|
@@ -17,7 +17,7 @@ const utils_1 = require("@dr.pogodin/babel-plugin-react-css-modules/utils");
|
|
|
17
17
|
*/
|
|
18
18
|
function configFactory(ops) {
|
|
19
19
|
const plugins = [
|
|
20
|
-
new mini_css_extract_plugin_1.default({ filename: 'style.css' }),
|
|
20
|
+
new mini_css_extract_plugin_1.default(Object.assign({ filename: 'style.css' }, ops.cssExtractionOptions)),
|
|
21
21
|
];
|
|
22
22
|
if (!ops.dontUseProgressPlugin)
|
|
23
23
|
plugins.push(new webpack_1.ProgressPlugin());
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.26.
|
|
2
|
+
"version": "1.26.4",
|
|
3
3
|
"bin": {
|
|
4
4
|
"react-utils-build": "bin/build.js",
|
|
5
5
|
"react-utils-setup": "bin/setup.js"
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
"@dr.pogodin/babel-plugin-react-css-modules": "^6.12.0",
|
|
13
13
|
"@dr.pogodin/csurf": "^1.13.0",
|
|
14
14
|
"@dr.pogodin/js-utils": "^0.0.6",
|
|
15
|
-
"@dr.pogodin/react-global-state": "^0.10.0-alpha.
|
|
15
|
+
"@dr.pogodin/react-global-state": "^0.10.0-alpha.5",
|
|
16
16
|
"@dr.pogodin/react-themes": "^1.5.1",
|
|
17
17
|
"@jest/environment": "^29.7.0",
|
|
18
|
-
"axios": "^1.
|
|
18
|
+
"axios": "^1.6.0",
|
|
19
19
|
"commander": "^11.1.0",
|
|
20
20
|
"compression": "^1.7.4",
|
|
21
21
|
"config": "^3.3.9",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"react": "^18.2.0",
|
|
37
37
|
"react-dom": "^18.2.0",
|
|
38
38
|
"react-helmet": "^6.1.0",
|
|
39
|
-
"react-router-dom": "^6.
|
|
39
|
+
"react-router-dom": "^6.18.0",
|
|
40
40
|
"request-ip": "^3.3.0",
|
|
41
41
|
"rimraf": "^5.0.5",
|
|
42
42
|
"serialize-javascript": "^6.0.1",
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
"@types/cookie-parser": "^1.4.5",
|
|
69
69
|
"@types/csurf": "^1.11.4",
|
|
70
70
|
"@types/express": "^4.17.20",
|
|
71
|
-
"@types/jest": "^29.5.
|
|
71
|
+
"@types/jest": "^29.5.7",
|
|
72
72
|
"@types/lodash": "^4.14.200",
|
|
73
73
|
"@types/morgan": "^1.9.7",
|
|
74
74
|
"@types/node-forge": "^1.3.8",
|
|
75
75
|
"@types/pretty": "^2.0.2",
|
|
76
|
-
"@types/react": "^18.2.
|
|
76
|
+
"@types/react": "^18.2.33",
|
|
77
77
|
"@types/react-dom": "^18.2.14",
|
|
78
78
|
"@types/react-helmet": "^6.1.8",
|
|
79
79
|
"@types/react-test-renderer": "^18.0.5",
|
|
@@ -83,13 +83,13 @@
|
|
|
83
83
|
"@types/supertest": "^2.0.15",
|
|
84
84
|
"@types/uuid": "^9.0.6",
|
|
85
85
|
"@types/webpack": "^5.28.4",
|
|
86
|
-
"@typescript-eslint/eslint-plugin": "^6.9.
|
|
87
|
-
"@typescript-eslint/parser": "^6.9.
|
|
86
|
+
"@typescript-eslint/eslint-plugin": "^6.9.1",
|
|
87
|
+
"@typescript-eslint/parser": "^6.9.1",
|
|
88
88
|
"autoprefixer": "^10.4.16",
|
|
89
89
|
"babel-jest": "^29.7.0",
|
|
90
90
|
"babel-loader": "^9.1.3",
|
|
91
91
|
"babel-plugin-module-resolver": "^5.0.0",
|
|
92
|
-
"core-js": "^3.33.
|
|
92
|
+
"core-js": "^3.33.2",
|
|
93
93
|
"css-loader": "^6.8.1",
|
|
94
94
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
95
95
|
"eslint": "^8.52.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"eslint-config-airbnb-typescript": "^17.0.0",
|
|
98
98
|
"eslint-import-resolver-babel-module": "^5.3.2",
|
|
99
99
|
"eslint-plugin-import": "^2.29.0",
|
|
100
|
-
"eslint-plugin-jest": "^27.
|
|
100
|
+
"eslint-plugin-jest": "^27.6.0",
|
|
101
101
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
102
102
|
"eslint-plugin-react": "^7.33.2",
|
|
103
103
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -116,7 +116,7 @@
|
|
|
116
116
|
"react-test-renderer": "^18.2.0",
|
|
117
117
|
"regenerator-runtime": "^0.14.0",
|
|
118
118
|
"resolve-url-loader": "^5.0.0",
|
|
119
|
-
"sass": "^1.69.
|
|
119
|
+
"sass": "^1.69.5",
|
|
120
120
|
"sass-loader": "^13.3.2",
|
|
121
121
|
"sitemap": "^7.1.1",
|
|
122
122
|
"stylelint": "^15.11.0",
|
package/src/index.ts
CHANGED
|
@@ -12,13 +12,20 @@ export { default as api } from 'axios';
|
|
|
12
12
|
export * as PT from 'prop-types';
|
|
13
13
|
|
|
14
14
|
export {
|
|
15
|
-
|
|
16
|
-
type
|
|
15
|
+
type AsyncCollectionLoaderT,
|
|
16
|
+
type AsyncDataEnvelopeT,
|
|
17
|
+
type AsyncDataLoaderT,
|
|
18
|
+
type ForceT,
|
|
19
|
+
type UseAsyncDataOptionsT,
|
|
20
|
+
type UseAsyncDataResT,
|
|
21
|
+
type UseGlobalStateResT,
|
|
22
|
+
type ValueOrInitializerT,
|
|
17
23
|
getGlobalState,
|
|
18
24
|
GlobalStateProvider,
|
|
19
25
|
useAsyncCollection,
|
|
20
26
|
useAsyncData,
|
|
21
27
|
useGlobalState,
|
|
28
|
+
withGlobalStateType,
|
|
22
29
|
} from '@dr.pogodin/react-global-state';
|
|
23
30
|
|
|
24
31
|
export {
|
|
@@ -65,11 +65,14 @@ const BaseButton: React.FunctionComponent<PropsT> = ({
|
|
|
65
65
|
</Link>
|
|
66
66
|
);
|
|
67
67
|
}
|
|
68
|
+
|
|
68
69
|
return (
|
|
69
70
|
<div
|
|
70
71
|
className={className}
|
|
71
72
|
onClick={onClick}
|
|
72
|
-
onKeyDown={onClick
|
|
73
|
+
onKeyDown={onClick && ((e) => {
|
|
74
|
+
if (e.key === 'Enter') onClick(e);
|
|
75
|
+
})}
|
|
73
76
|
onMouseDown={onMouseDown}
|
|
74
77
|
role="button"
|
|
75
78
|
tabIndex={0}
|
|
@@ -20,10 +20,10 @@ type PropsT = {
|
|
|
20
20
|
* [Other theming properties](https://www.npmjs.com/package/@dr.pogodin/react-themes#themed-component-properties)
|
|
21
21
|
*/
|
|
22
22
|
const Throbber: React.FunctionComponent<PropsT> = ({ theme }) => (
|
|
23
|
-
<span className={theme.container}
|
|
24
|
-
<span className={theme.circle}
|
|
25
|
-
<span className={theme.circle}
|
|
26
|
-
<span className={theme.circle}
|
|
23
|
+
<span className={theme.container}>
|
|
24
|
+
<span className={theme.circle} />
|
|
25
|
+
<span className={theme.circle} />
|
|
26
|
+
<span className={theme.circle} />
|
|
27
27
|
</span>
|
|
28
28
|
);
|
|
29
29
|
|
|
@@ -31,6 +31,7 @@ const ThemedThrobber = themed(
|
|
|
31
31
|
Throbber,
|
|
32
32
|
'Throbber',
|
|
33
33
|
[
|
|
34
|
+
'bouncing',
|
|
34
35
|
'circle',
|
|
35
36
|
'container',
|
|
36
37
|
],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Request } from 'express';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { type SsrContext, withGlobalStateType } from '@dr.pogodin/react-global-state';
|
|
4
4
|
|
|
5
5
|
export type ChunkGroupsT = {
|
|
6
6
|
[chunkName: string]: string[];
|
|
@@ -22,7 +22,7 @@ export interface SsrContextT<StateT> extends SsrContext<StateT> {
|
|
|
22
22
|
|
|
23
23
|
const {
|
|
24
24
|
getSsrContext,
|
|
25
|
-
} =
|
|
25
|
+
} = withGlobalStateType<unknown, SsrContextT<unknown>>();
|
|
26
26
|
|
|
27
27
|
export {
|
|
28
28
|
getSsrContext,
|