@breautek/router 4.0.0 → 4.1.0
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/dist/router.js +27 -25
- package/dist/src/View.d.ts +2 -6
- package/package.json +19 -19
- package/src/View.tsx +11 -6
package/dist/router.js
CHANGED
|
@@ -773,23 +773,25 @@ class View extends React__namespace.Component {
|
|
|
773
773
|
getViewStylesheet() {
|
|
774
774
|
return null;
|
|
775
775
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
776
|
+
_getViewBodyClass() {
|
|
777
|
+
return this.constructor.name;
|
|
778
|
+
}
|
|
779
779
|
componentDidMount() {
|
|
780
780
|
this.getTitle().then((title) => {
|
|
781
781
|
this.props.router.setTitle(title);
|
|
782
782
|
});
|
|
783
|
+
document.body.classList.add(this.$getViewBodyClass());
|
|
783
784
|
let stylesheet = this.getViewStylesheet();
|
|
784
785
|
if (stylesheet) {
|
|
785
786
|
stylesheet.use();
|
|
786
787
|
}
|
|
787
788
|
this.props.router.__onViewMount(this);
|
|
788
789
|
}
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
790
|
+
$getViewBodyClass() {
|
|
791
|
+
return `${this._getViewBodyClass()}-body`;
|
|
792
|
+
}
|
|
792
793
|
componentWillUnmount() {
|
|
794
|
+
document.body.classList.remove(this.$getViewBodyClass());
|
|
793
795
|
let stylesheet = this.getViewStylesheet();
|
|
794
796
|
if (stylesheet) {
|
|
795
797
|
stylesheet.unuse();
|
|
@@ -1017,7 +1019,7 @@ class TransitionSlide extends TransitionStrategy {
|
|
|
1017
1019
|
}
|
|
1018
1020
|
|
|
1019
1021
|
var name = "@breautek/router";
|
|
1020
|
-
var version = "4.
|
|
1022
|
+
var version = "4.1.0";
|
|
1021
1023
|
var description = "An alternate react router.";
|
|
1022
1024
|
var main = "dist/router.js";
|
|
1023
1025
|
var types = "dist/src/api.d.ts";
|
|
@@ -1053,33 +1055,33 @@ var peerDependencies = {
|
|
|
1053
1055
|
"react-dom": "16.x || 17.x || 18.x"
|
|
1054
1056
|
};
|
|
1055
1057
|
var devDependencies = {
|
|
1056
|
-
"@rollup/plugin-commonjs": "25.0.
|
|
1057
|
-
"@rollup/plugin-json": "6.0.
|
|
1058
|
-
"@rollup/plugin-node-resolve": "15.
|
|
1059
|
-
"@testing-library/jest-dom": "
|
|
1058
|
+
"@rollup/plugin-commonjs": "25.0.7",
|
|
1059
|
+
"@rollup/plugin-json": "6.0.1",
|
|
1060
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
1061
|
+
"@testing-library/jest-dom": "6.1.4",
|
|
1060
1062
|
"@testing-library/react": "14.0.0",
|
|
1061
|
-
"@types/jest": "29.5.
|
|
1062
|
-
"@types/react": "18.2.
|
|
1063
|
-
"@types/react-dom": "18.2.
|
|
1064
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
1065
|
-
"@typescript-eslint/parser": "6.
|
|
1063
|
+
"@types/jest": "29.5.6",
|
|
1064
|
+
"@types/react": "18.2.33",
|
|
1065
|
+
"@types/react-dom": "18.2.14",
|
|
1066
|
+
"@typescript-eslint/eslint-plugin": "6.9.0",
|
|
1067
|
+
"@typescript-eslint/parser": "6.9.0",
|
|
1066
1068
|
ajv: "8.12.0",
|
|
1067
|
-
eslint: "8.
|
|
1068
|
-
"eslint-plugin-react": "7.
|
|
1069
|
-
glob: "10.3.
|
|
1069
|
+
eslint: "8.52.0",
|
|
1070
|
+
"eslint-plugin-react": "7.33.2",
|
|
1071
|
+
glob: "10.3.10",
|
|
1070
1072
|
"ignore-styles": "5.0.1",
|
|
1071
|
-
jest: "29.
|
|
1072
|
-
"jest-environment-jsdom": "29.
|
|
1073
|
+
jest: "29.7.0",
|
|
1074
|
+
"jest-environment-jsdom": "29.7.0",
|
|
1073
1075
|
"node-sass": "9.0.0",
|
|
1074
1076
|
react: "18.2.0",
|
|
1075
1077
|
"react-dom": "18.2.0",
|
|
1076
|
-
rollup: "
|
|
1078
|
+
rollup: "4.1.4",
|
|
1077
1079
|
"rollup-plugin-progress": "1.1.2",
|
|
1078
|
-
"rollup-plugin-sass": "1.12.
|
|
1079
|
-
"rollup-plugin-typescript2": "0.
|
|
1080
|
+
"rollup-plugin-sass": "1.12.21",
|
|
1081
|
+
"rollup-plugin-typescript2": "0.36.0",
|
|
1080
1082
|
"ts-jest": "29.1.1",
|
|
1081
1083
|
"ts-node": "10.9.1",
|
|
1082
|
-
typescript: "5.
|
|
1084
|
+
typescript: "5.2.2"
|
|
1083
1085
|
};
|
|
1084
1086
|
var packageInfo = {
|
|
1085
1087
|
name: name,
|
package/dist/src/View.d.ts
CHANGED
|
@@ -22,13 +22,9 @@ export declare abstract class View<TPageProps extends IViewProps = IViewProps> e
|
|
|
22
22
|
* Override to return a webpack API style stylesheet
|
|
23
23
|
*/
|
|
24
24
|
getViewStylesheet(): IViewStylesheet;
|
|
25
|
-
|
|
26
|
-
* @ignore
|
|
27
|
-
*/
|
|
25
|
+
protected _getViewBodyClass(): string;
|
|
28
26
|
componentDidMount(): void;
|
|
29
|
-
|
|
30
|
-
* @ignore
|
|
31
|
-
*/
|
|
27
|
+
private $getViewBodyClass;
|
|
32
28
|
componentWillUnmount(): void;
|
|
33
29
|
/**
|
|
34
30
|
* Gets the underlying HTML node for this View
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@breautek/router",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "An alternate react router.",
|
|
5
5
|
"main": "dist/router.js",
|
|
6
6
|
"types": "dist/src/api.d.ts",
|
|
@@ -36,32 +36,32 @@
|
|
|
36
36
|
"react-dom": "16.x || 17.x || 18.x"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@rollup/plugin-commonjs": "25.0.
|
|
40
|
-
"@rollup/plugin-json": "6.0.
|
|
41
|
-
"@rollup/plugin-node-resolve": "15.
|
|
42
|
-
"@testing-library/jest-dom": "
|
|
39
|
+
"@rollup/plugin-commonjs": "25.0.7",
|
|
40
|
+
"@rollup/plugin-json": "6.0.1",
|
|
41
|
+
"@rollup/plugin-node-resolve": "15.2.3",
|
|
42
|
+
"@testing-library/jest-dom": "6.1.4",
|
|
43
43
|
"@testing-library/react": "14.0.0",
|
|
44
|
-
"@types/jest": "29.5.
|
|
45
|
-
"@types/react": "18.2.
|
|
46
|
-
"@types/react-dom": "18.2.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
48
|
-
"@typescript-eslint/parser": "6.
|
|
44
|
+
"@types/jest": "29.5.6",
|
|
45
|
+
"@types/react": "18.2.33",
|
|
46
|
+
"@types/react-dom": "18.2.14",
|
|
47
|
+
"@typescript-eslint/eslint-plugin": "6.9.0",
|
|
48
|
+
"@typescript-eslint/parser": "6.9.0",
|
|
49
49
|
"ajv": "8.12.0",
|
|
50
|
-
"eslint": "8.
|
|
51
|
-
"eslint-plugin-react": "7.
|
|
52
|
-
"glob": "10.3.
|
|
50
|
+
"eslint": "8.52.0",
|
|
51
|
+
"eslint-plugin-react": "7.33.2",
|
|
52
|
+
"glob": "10.3.10",
|
|
53
53
|
"ignore-styles": "5.0.1",
|
|
54
|
-
"jest": "29.
|
|
55
|
-
"jest-environment-jsdom": "29.
|
|
54
|
+
"jest": "29.7.0",
|
|
55
|
+
"jest-environment-jsdom": "29.7.0",
|
|
56
56
|
"node-sass": "9.0.0",
|
|
57
57
|
"react": "18.2.0",
|
|
58
58
|
"react-dom": "18.2.0",
|
|
59
|
-
"rollup": "
|
|
59
|
+
"rollup": "4.1.4",
|
|
60
60
|
"rollup-plugin-progress": "1.1.2",
|
|
61
|
-
"rollup-plugin-sass": "1.12.
|
|
62
|
-
"rollup-plugin-typescript2": "0.
|
|
61
|
+
"rollup-plugin-sass": "1.12.21",
|
|
62
|
+
"rollup-plugin-typescript2": "0.36.0",
|
|
63
63
|
"ts-jest": "29.1.1",
|
|
64
64
|
"ts-node": "10.9.1",
|
|
65
|
-
"typescript": "5.
|
|
65
|
+
"typescript": "5.2.2"
|
|
66
66
|
}
|
|
67
67
|
}
|
package/src/View.tsx
CHANGED
|
@@ -37,14 +37,17 @@ export abstract class View<TPageProps extends IViewProps = IViewProps> extends R
|
|
|
37
37
|
return null;
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
protected _getViewBodyClass(): string {
|
|
41
|
+
return this.constructor.name;
|
|
42
|
+
}
|
|
43
|
+
|
|
43
44
|
public componentDidMount(): void {
|
|
44
45
|
this.getTitle().then((title: string) => {
|
|
45
46
|
this.props.router.setTitle(title);
|
|
46
47
|
});
|
|
47
48
|
|
|
49
|
+
document.body.classList.add(this.$getViewBodyClass());
|
|
50
|
+
|
|
48
51
|
let stylesheet: IViewStylesheet = this.getViewStylesheet();
|
|
49
52
|
if (stylesheet) {
|
|
50
53
|
stylesheet.use();
|
|
@@ -53,10 +56,12 @@ export abstract class View<TPageProps extends IViewProps = IViewProps> extends R
|
|
|
53
56
|
this.props.router.__onViewMount(this);
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
+
private $getViewBodyClass(): string {
|
|
60
|
+
return `${this._getViewBodyClass()}-body`;
|
|
61
|
+
}
|
|
62
|
+
|
|
59
63
|
public componentWillUnmount(): void {
|
|
64
|
+
document.body.classList.remove(this.$getViewBodyClass());
|
|
60
65
|
let stylesheet: IViewStylesheet = this.getViewStylesheet();
|
|
61
66
|
if (stylesheet) {
|
|
62
67
|
stylesheet.unuse();
|