@rsmax/web 1.3.3 → 1.3.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/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.3.4](https://github.com/remaxjs/remax/compare/v1.3.3...v1.3.4) (2025-06-02)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **web:** 修复 web 平台无法启动 ([567d4b8](https://github.com/remaxjs/remax/commit/567d4b88d99f3c2770336619d62197db16199e49))
11
+ - **web:** 修复测试 ([31d6c23](https://github.com/remaxjs/remax/commit/31d6c23d9da225bfe75eb696c6baeadf436e2554))
12
+
6
13
  ## [1.3.3](https://github.com/remaxjs/remax/compare/v1.3.2...v1.3.3) (2025-05-30)
7
14
 
8
15
  **Note:** Version bump only for package @rsmax/web
package/assets/app.css CHANGED
@@ -1,4 +1,4 @@
1
- .remax-button {
1
+ .rsmax-button {
2
2
  /* prettier-ignore */
3
3
  font-size: 18PX;
4
4
  /* prettier-ignore */
@@ -26,7 +26,7 @@
26
26
  width: 100%;
27
27
  }
28
28
 
29
- .remax-input {
29
+ .rsmax-input {
30
30
  /* prettier-ignore */
31
31
  font-size: 17PX;
32
32
  /* prettier-ignore */
@@ -39,7 +39,7 @@
39
39
  box-sizing: content-box;
40
40
  }
41
41
 
42
- .remax-textarea {
42
+ .rsmax-textarea {
43
43
  position: relative;
44
44
  background-color: rgb(255, 255, 255);
45
45
  /* prettier-ignore */
@@ -52,7 +52,7 @@
52
52
  line-height: 1.4;
53
53
  }
54
54
 
55
- .remax-image {
55
+ .rsmax-image {
56
56
  background-repeat: no-repeat;
57
57
  display: inline-block;
58
58
  overflow: hidden;
@@ -63,26 +63,26 @@
63
63
  height: 225PX;
64
64
  }
65
65
 
66
- .remax-text-selectable {
66
+ .rsmax-text-selectable {
67
67
  user-select: text;
68
68
  }
69
69
 
70
- .remax-web-view {
70
+ .rsmax-web-view {
71
71
  width: 100%;
72
72
  min-height: 100vh;
73
73
  }
74
74
 
75
- .remax-page.with-tab-bar {
75
+ .rsmax-page.with-tab-bar {
76
76
  padding-bottom: 96px;
77
77
  }
78
78
 
79
- .remax-page {
79
+ .rsmax-page {
80
80
  min-height: 100vh;
81
81
  box-sizing: border-box;
82
82
  font-size: 32px;
83
83
  }
84
84
 
85
- .remax-page.disable-scroll {
85
+ .rsmax-page.disable-scroll {
86
86
  overflow: hidden;
87
87
  }
88
88
 
@@ -104,12 +104,12 @@
104
104
  margin-top: -100px;
105
105
  }
106
106
 
107
- .remax-pull-to-refresh-loading {
107
+ .rsmax-pull-to-refresh-loading {
108
108
  width: 100px;
109
109
  height: 100px;
110
110
  }
111
111
 
112
- .remax-tab-bar {
112
+ .rsmax-tab-bar {
113
113
  height: 96px;
114
114
  position: fixed;
115
115
  bottom: 0;
@@ -123,7 +123,7 @@
123
123
  z-index: 999999;
124
124
  }
125
125
 
126
- .remax-tab-bar .remax-tab-item {
126
+ .rsmax-tab-bar .rsmax-tab-item {
127
127
  display: flex;
128
128
  flex-direction: column;
129
129
  align-items: center;
@@ -131,7 +131,7 @@
131
131
  height: 100%;
132
132
  }
133
133
 
134
- .remax-tab-bar .remax-tab-item .remax-tab-item-image {
134
+ .rsmax-tab-bar .rsmax-tab-item .rsmax-tab-item-image {
135
135
  height: 34px;
136
136
  width: 34px;
137
137
  background-size: contain;
@@ -139,13 +139,13 @@
139
139
  background-repeat: no-repeat;
140
140
  }
141
141
 
142
- .remax-tab-bar .remax-tab-item .remax-tab-item-title {
142
+ .rsmax-tab-bar .rsmax-tab-item .rsmax-tab-item-title {
143
143
  font-size: 12px;
144
144
  color: #333;
145
145
  transform: scale(0.7);
146
146
  }
147
147
 
148
- .remax-tab-bar .remax-tab-item .remax-tab-item-title.active {
148
+ .rsmax-tab-bar .rsmax-tab-item .rsmax-tab-item-title.active {
149
149
  color: #108ee9;
150
150
  }
151
151
 
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  interface LoadingIconProps {
3
3
  animate?: boolean;
4
4
  }
@@ -1,39 +1,19 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
25
5
  Object.defineProperty(exports, "__esModule", { value: true });
26
- const React = __importStar(require("react"));
6
+ const react_1 = __importDefault(require("react"));
27
7
  const values = '2; 2; 2; 2';
28
8
  const animateValues = '0; 4; 0; 0';
29
9
  function LoadingIcon(props) {
30
10
  const animate = props.animate;
31
- return (React.createElement("svg", { className: "remax-pull-to-refresh-loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
32
- React.createElement("circle", { transform: "translate(8 0)", cx: "0", cy: "16", r: "0" },
33
- React.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" })),
34
- React.createElement("circle", { transform: "translate(16 0)", cx: "0", cy: "16", r: "0" },
35
- React.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0.3", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" })),
36
- React.createElement("circle", { transform: "translate(24 0)", cx: "0", cy: "16", r: "0" },
37
- React.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0.6", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" }))));
11
+ return (react_1.default.createElement("svg", { className: "rsmax-pull-to-refresh-loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
12
+ react_1.default.createElement("circle", { transform: "translate(8 0)", cx: "0", cy: "16", r: "0" },
13
+ react_1.default.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" })),
14
+ react_1.default.createElement("circle", { transform: "translate(16 0)", cx: "0", cy: "16", r: "0" },
15
+ react_1.default.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0.3", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" })),
16
+ react_1.default.createElement("circle", { transform: "translate(24 0)", cx: "0", cy: "16", r: "0" },
17
+ react_1.default.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0.6", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" }))));
38
18
  }
39
19
  exports.default = LoadingIcon;
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  declare const RemaxPullToRefresh: React.FC<any>;
3
3
  export default RemaxPullToRefresh;
@@ -1,42 +1,19 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const React = __importStar(require("react"));
6
+ const react_1 = __importDefault(require("react"));
30
7
  const rmc_pull_to_refresh_1 = __importDefault(require("rmc-pull-to-refresh"));
31
8
  const LoadingIcon_1 = __importDefault(require("./LoadingIcon"));
32
9
  const RemaxPullToRefresh = props => {
33
- return (React.createElement(rmc_pull_to_refresh_1.default, Object.assign({}, props, { getScrollContainer: () => {
10
+ return (react_1.default.createElement(rmc_pull_to_refresh_1.default, Object.assign({}, props, { getScrollContainer: () => {
34
11
  document.body;
35
12
  }, indicator: {
36
- activate: React.createElement(LoadingIcon_1.default, null),
37
- deactivate: React.createElement(LoadingIcon_1.default, null),
38
- release: React.createElement(LoadingIcon_1.default, { animate: true }),
39
- finish: React.createElement(LoadingIcon_1.default, null),
13
+ activate: react_1.default.createElement(LoadingIcon_1.default, null),
14
+ deactivate: react_1.default.createElement(LoadingIcon_1.default, null),
15
+ release: react_1.default.createElement(LoadingIcon_1.default, { animate: true }),
16
+ finish: react_1.default.createElement(LoadingIcon_1.default, null),
40
17
  } })));
41
18
  };
42
19
  exports.default = RemaxPullToRefresh;
package/cjs/TabBar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { History } from 'history';
3
3
  import { TabBarConfig } from './types';
4
4
  export declare function TabBar({ config, history }: {
package/cjs/TabBar.js CHANGED
@@ -1,35 +1,15 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
25
5
  Object.defineProperty(exports, "__esModule", { value: true });
26
6
  exports.TabBar = void 0;
27
- const React = __importStar(require("react"));
7
+ const react_1 = __importDefault(require("react"));
28
8
  const react_router_dom_1 = require("react-router-dom");
29
9
  function TabBar({ config, history }) {
30
10
  var _a;
31
- const [currentPath, setCurrentPath] = React.useState(history.location.pathname);
32
- React.useEffect(() => {
11
+ const [currentPath, setCurrentPath] = react_1.default.useState(history.location.pathname);
12
+ react_1.default.useEffect(() => {
33
13
  setCurrentPath(history.location.pathname);
34
14
  return history.listen(() => {
35
15
  setCurrentPath(history.location.pathname);
@@ -41,7 +21,7 @@ function TabBar({ config, history }) {
41
21
  }
42
22
  return currentPath === url;
43
23
  };
44
- return (React.createElement("div", { className: "remax-tab-bar", style: { backgroundColor: (_a = config.backgroundColor) !== null && _a !== void 0 ? _a : '' } }, config.items.map((item, index) => (React.createElement(TabBarItem, { key: index, config: config, isActive: isActive(item.url), item: item })))));
24
+ return (react_1.default.createElement("div", { className: "rsmax-tab-bar", style: { backgroundColor: (_a = config.backgroundColor) !== null && _a !== void 0 ? _a : '' } }, config.items.map((item, index) => (react_1.default.createElement(TabBarItem, { key: index, config: config, isActive: isActive(item.url), item: item })))));
45
25
  }
46
26
  exports.TabBar = TabBar;
47
27
  function TabBarItem({ config, isActive, item }) {
@@ -49,9 +29,9 @@ function TabBarItem({ config, isActive, item }) {
49
29
  const icon = isActive ? item.activeImage || item.image : item.image;
50
30
  const textColor = (_a = config.textColor) !== null && _a !== void 0 ? _a : '#333';
51
31
  const selectedColor = (_b = config.selectedColor) !== null && _b !== void 0 ? _b : '#108ee9';
52
- return (React.createElement(react_router_dom_1.Link, { to: `/${item.url}`, className: "remax-tab-item" },
53
- React.createElement("div", { className: "remax-tab-item-image", style: { backgroundImage: `url(${icon})` } }),
54
- React.createElement("div", { className: "remax-tab-item-title", style: {
32
+ return (react_1.default.createElement(react_router_dom_1.Link, { to: `/${item.url}`, className: "rsmax-tab-item" },
33
+ react_1.default.createElement("div", { className: "rsmax-tab-item-image", style: { backgroundImage: `url(${icon})` } }),
34
+ react_1.default.createElement("div", { className: "rsmax-tab-item-title", style: {
55
35
  color: isActive ? selectedColor : textColor,
56
36
  } }, item.title)));
57
37
  }
package/cjs/bootstrap.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const react_dom_1 = require("react-dom");
6
+ const client_1 = require("react-dom/client");
7
7
  const umi_hd_1 = __importDefault(require("umi-hd"));
8
8
  const history_1 = require("history");
9
9
  const framework_shared_1 = require("@rsmax/framework-shared");
@@ -13,6 +13,10 @@ function bootstrap(options) {
13
13
  const { appConfig } = options;
14
14
  const history = !appConfig.router || appConfig.router.type !== 'browser' ? (0, history_1.createHashHistory)() : (0, history_1.createBrowserHistory)();
15
15
  framework_shared_1.RuntimeOptions.apply({ history, mpa: false });
16
- (0, react_dom_1.render)((0, createApp_1.default)(options, history), document.getElementById('remax-app'));
16
+ const container = document.getElementById('rsmax-app');
17
+ if (!container)
18
+ throw new Error('Failed to find the root element');
19
+ const root = (0, client_1.createRoot)(container);
20
+ root.render((0, createApp_1.default)(options, history));
17
21
  }
18
22
  exports.default = bootstrap;
@@ -1,33 +1,10 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const React = __importStar(require("react"));
30
- const react_dom_1 = require("react-dom");
6
+ const react_1 = __importDefault(require("react"));
7
+ const client_1 = require("react-dom/client");
31
8
  const umi_hd_1 = __importDefault(require("umi-hd"));
32
9
  const createAppConfig_1 = __importDefault(require("./createAppConfig"));
33
10
  const framework_shared_1 = require("@rsmax/framework-shared");
@@ -39,8 +16,8 @@ function createApp(options) {
39
16
  const { appComponent, pageComponent, page, appConfig } = options;
40
17
  const AppConfig = (0, createAppConfig_1.default)(appComponent);
41
18
  const PageConfig = (0, createPageConfig_1.default)(pageComponent, page.route);
42
- return (React.createElement(AppConfig, null,
43
- React.createElement(PageConfig, { pageConfig: Object.assign(Object.assign({}, appConfig.window), page.config), tabBar: appConfig.tabBar, location: window.location, cacheLifecycles: {
19
+ return (react_1.default.createElement(AppConfig, null,
20
+ react_1.default.createElement(PageConfig, { pageConfig: Object.assign(Object.assign({}, appConfig.window), page.config), tabBar: appConfig.tabBar, location: window.location, cacheLifecycles: {
44
21
  didCache: noop,
45
22
  didRecover: noop,
46
23
  } })));
@@ -75,6 +52,10 @@ function bootstrap(options) {
75
52
  };
76
53
  framework_shared_1.RuntimeOptions.apply({ pluginDriver, history, mpa: true });
77
54
  const App = createApp(options);
78
- (0, react_dom_1.render)(App, document.getElementById('remax-app'));
55
+ const container = document.getElementById('rsmax-app');
56
+ if (!container)
57
+ throw new Error('Failed to find the root element');
58
+ const root = (0, client_1.createRoot)(container);
59
+ root.render(App);
79
60
  }
80
61
  exports.default = bootstrap;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { History } from 'history';
3
3
  import { BootstrapOptions } from './types';
4
4
  export default function createApp(options: BootstrapOptions, history: History): React.JSX.Element;
package/cjs/createApp.js CHANGED
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const React = __importStar(require("react"));
6
+ const react_1 = __importDefault(require("react"));
30
7
  const framework_shared_1 = require("@rsmax/framework-shared");
31
8
  const react_router_cache_route_1 = require("@remax/react-router-cache-route");
32
9
  const react_router_dom_1 = require("react-router-dom");
@@ -46,27 +23,27 @@ function createApp(options, history) {
46
23
  : (0, createPageConfig_1.default)(pageComponents[i](), page.route);
47
24
  return pageComponent;
48
25
  });
49
- return (React.createElement(react_router_dom_1.Router, { history: history },
50
- React.createElement(AppConfig, null,
51
- React.createElement(react_router_cache_route_1.CacheSwitch, null,
52
- React.createElement(react_router_dom_1.Route, { exact: true, path: "/" },
53
- React.createElement(react_router_dom_1.Redirect, { to: `/${(_a = pages[0]) === null || _a === void 0 ? void 0 : _a.route}` })),
26
+ return (react_1.default.createElement(react_router_dom_1.Router, { history: history },
27
+ react_1.default.createElement(AppConfig, null,
28
+ react_1.default.createElement(react_router_cache_route_1.CacheSwitch, null,
29
+ react_1.default.createElement(react_router_dom_1.Route, { exact: true, path: "/" },
30
+ react_1.default.createElement(react_router_dom_1.Redirect, { to: `/${(_a = pages[0]) === null || _a === void 0 ? void 0 : _a.route}` })),
54
31
  pages.map((page, i) => {
55
- return (React.createElement(react_router_cache_route_1.CacheRoute, { key: page.route, className: "remax-cached-router-wrapper", path: `/${page.route}`, exact: true }, (props) => {
32
+ return (react_1.default.createElement(react_router_cache_route_1.CacheRoute, { key: page.route, className: "rsmax-cached-router-wrapper", path: `/${page.route}`, exact: true }, (props) => {
56
33
  const pageComponent = pageComponentsHoc[i];
57
- return React.createElement(pageComponent, Object.assign(Object.assign({}, props), { pageConfig: Object.assign(Object.assign({}, appConfig.window), page.config), tabBar: appConfig.tabBar }));
34
+ return react_1.default.createElement(pageComponent, Object.assign(Object.assign({}, props), { pageConfig: Object.assign(Object.assign({}, appConfig.window), page.config), tabBar: appConfig.tabBar }));
58
35
  }));
59
36
  }),
60
- React.createElement(react_router_dom_1.Route, null,
61
- React.createElement(react_router_dom_1.Redirect, { to: `/${(_b = pages[0]) === null || _b === void 0 ? void 0 : _b.route}` }))),
62
- ((_c = appConfig.tabBar) === null || _c === void 0 ? void 0 : _c.items) && appConfig.tabBar.items.length > 0 && (React.createElement(TabBar_1.TabBar, { history: history, config: appConfig.tabBar })),
63
- process.env.NODE_ENV === 'development' && React.createElement(LogLocation, null))));
37
+ react_1.default.createElement(react_router_dom_1.Route, null,
38
+ react_1.default.createElement(react_router_dom_1.Redirect, { to: `/${(_b = pages[0]) === null || _b === void 0 ? void 0 : _b.route}` }))),
39
+ ((_c = appConfig.tabBar) === null || _c === void 0 ? void 0 : _c.items) && appConfig.tabBar.items.length > 0 && (react_1.default.createElement(TabBar_1.TabBar, { history: history, config: appConfig.tabBar })),
40
+ process.env.NODE_ENV === 'development' && react_1.default.createElement(LogLocation, null))));
64
41
  }
65
42
  exports.default = createApp;
66
43
  function LogLocation() {
67
44
  const location = (0, react_router_dom_1.useLocation)();
68
- React.useEffect(() => {
69
- console.log('[remax][react-router]location change', location.pathname);
45
+ react_1.default.useEffect(() => {
46
+ console.log('[rsmax][react-router]location change', location.pathname);
70
47
  }, [location]);
71
48
  return null;
72
49
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  export default function createAppConfig(this: any, App: any): {
3
3
  new (props: any): {
4
4
  componentDidMount(): void;
@@ -1,40 +1,20 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
24
4
  };
25
5
  Object.defineProperty(exports, "__esModule", { value: true });
26
- const React = __importStar(require("react"));
6
+ const react_1 = __importDefault(require("react"));
27
7
  const react_is_1 = require("react-is");
28
8
  const framework_shared_1 = require("@rsmax/framework-shared");
29
- class DefaultAppComponent extends React.Component {
9
+ class DefaultAppComponent extends react_1.default.Component {
30
10
  render() {
31
- return React.createElement(React.Fragment, this.props);
11
+ return react_1.default.createElement(react_1.default.Fragment, this.props);
32
12
  }
33
13
  }
34
14
  function createAppConfig(App) {
35
15
  const createConfig = (AppComponent = DefaultAppComponent) => {
36
16
  const config = {
37
- _instance: React.createRef(),
17
+ _instance: react_1.default.createRef(),
38
18
  callLifecycle(lifecycle, ...args) {
39
19
  const callbacks = framework_shared_1.AppInstanceContext.lifecycleCallback[lifecycle] || [];
40
20
  let result;
@@ -50,7 +30,7 @@ function createAppConfig(App) {
50
30
  }
51
31
  },
52
32
  };
53
- return class AppConfig extends React.Component {
33
+ return class AppConfig extends react_1.default.Component {
54
34
  constructor() {
55
35
  super(...arguments);
56
36
  this.visibilityChangeEvent = () => {
@@ -80,7 +60,7 @@ function createAppConfig(App) {
80
60
  if ((0, framework_shared_1.isClassComponent)(AppComponent) || AppComponent.$$typeof === react_is_1.ForwardRef) {
81
61
  ref = config._instance;
82
62
  }
83
- return React.createElement(AppComponent, Object.assign({}, this.props, { ref: ref }));
63
+ return react_1.default.createElement(AppComponent, Object.assign({}, this.props, { ref: ref }));
84
64
  }
85
65
  };
86
66
  };
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { TabBarConfig, PageConfig } from './types';
3
3
  interface PageConfigProps {
4
4
  tabBar: TabBarConfig;
@@ -1,32 +1,9 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __importDefault = (this && this.__importDefault) || function (mod) {
26
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
4
  };
28
5
  Object.defineProperty(exports, "__esModule", { value: true });
29
- const React = __importStar(require("react"));
6
+ const react_1 = __importDefault(require("react"));
30
7
  const qs_1 = __importDefault(require("qs"));
31
8
  const framework_shared_1 = require("@rsmax/framework-shared");
32
9
  const PullToRefresh_1 = __importDefault(require("./PullToRefresh"));
@@ -34,7 +11,7 @@ const DEFAULT_REACH_BOTTOM_DISTANCE = 50;
34
11
  function createPageConfig(Page, name) {
35
12
  const page = {
36
13
  lifeCycleCallback: {},
37
- wrapperRef: React.createRef(),
14
+ wrapperRef: react_1.default.createRef(),
38
15
  registerLifecycle(lifeCycle, callback) {
39
16
  this.lifeCycleCallback[lifeCycle] = this.lifeCycleCallback[lifeCycle] || [];
40
17
  this.lifeCycleCallback[lifeCycle].push(callback);
@@ -58,7 +35,7 @@ function createPageConfig(Page, name) {
58
35
  },
59
36
  };
60
37
  const PageWrapper = (0, framework_shared_1.createPageWrapper)(Page, name);
61
- return class PageConfig extends React.Component {
38
+ return class PageConfig extends react_1.default.Component {
62
39
  constructor(props) {
63
40
  super(props);
64
41
  this.state = {
@@ -141,17 +118,17 @@ function createPageConfig(Page, name) {
141
118
  const { tabBar, location } = this.props;
142
119
  const { refreshing } = this.state;
143
120
  const hasTabBar = !!tabBar;
144
- const className = `remax-page ${hasTabBar ? 'with-tab-bar' : ''}`;
121
+ const className = `rsmax-page ${hasTabBar ? 'with-tab-bar' : ''}`;
145
122
  const query = qs_1.default.parse(location.search, { ignoreQueryPrefix: true });
146
123
  if (this.isPullDownRefreshEnabled()) {
147
- return (React.createElement(PullToRefresh_1.default, { onRefresh: this.handleRefresh, refreshing: refreshing, distanceToRefresh: 50 },
148
- React.createElement("div", { className: className }, React.createElement(PageWrapper, {
124
+ return (react_1.default.createElement(PullToRefresh_1.default, { onRefresh: this.handleRefresh, refreshing: refreshing, distanceToRefresh: 50 },
125
+ react_1.default.createElement("div", { className: className }, react_1.default.createElement(PageWrapper, {
149
126
  page,
150
127
  query,
151
128
  ref: page.wrapperRef,
152
129
  }))));
153
130
  }
154
- return (React.createElement("div", { className: className }, React.createElement(PageWrapper, {
131
+ return (react_1.default.createElement("div", { className: className }, react_1.default.createElement(PageWrapper, {
155
132
  page,
156
133
  query,
157
134
  ref: page.wrapperRef,
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  interface LoadingIconProps {
3
3
  animate?: boolean;
4
4
  }
@@ -1,9 +1,9 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  const values = '2; 2; 2; 2';
3
3
  const animateValues = '0; 4; 0; 0';
4
4
  export default function LoadingIcon(props) {
5
5
  const animate = props.animate;
6
- return (React.createElement("svg", { className: "remax-pull-to-refresh-loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
6
+ return (React.createElement("svg", { className: "rsmax-pull-to-refresh-loading", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 32 32" },
7
7
  React.createElement("circle", { transform: "translate(8 0)", cx: "0", cy: "16", r: "0" },
8
8
  React.createElement("animate", { attributeName: "r", values: !animate ? values : animateValues, dur: "1.2s", repeatCount: "indefinite", begin: "0", keyTimes: "0;0.2;0.7;1", keySplines: "0.2 0.2 0.4 0.8;0.2 0.6 0.4 0.8;0.2 0.6 0.4 0.8", calcMode: "spline" })),
9
9
  React.createElement("circle", { transform: "translate(16 0)", cx: "0", cy: "16", r: "0" },
@@ -1,3 +1,3 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  declare const RemaxPullToRefresh: React.FC<any>;
3
3
  export default RemaxPullToRefresh;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import PullToRefresh from 'rmc-pull-to-refresh';
3
3
  import LoadingIcon from './LoadingIcon';
4
4
  const RemaxPullToRefresh = props => {
package/esm/TabBar.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { History } from 'history';
3
3
  import { TabBarConfig } from './types';
4
4
  export declare function TabBar({ config, history }: {
package/esm/TabBar.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { Link } from 'react-router-dom';
3
3
  export function TabBar({ config, history }) {
4
4
  var _a;
@@ -15,16 +15,16 @@ export function TabBar({ config, history }) {
15
15
  }
16
16
  return currentPath === url;
17
17
  };
18
- return (React.createElement("div", { className: "remax-tab-bar", style: { backgroundColor: (_a = config.backgroundColor) !== null && _a !== void 0 ? _a : '' } }, config.items.map((item, index) => (React.createElement(TabBarItem, { key: index, config: config, isActive: isActive(item.url), item: item })))));
18
+ return (React.createElement("div", { className: "rsmax-tab-bar", style: { backgroundColor: (_a = config.backgroundColor) !== null && _a !== void 0 ? _a : '' } }, config.items.map((item, index) => (React.createElement(TabBarItem, { key: index, config: config, isActive: isActive(item.url), item: item })))));
19
19
  }
20
20
  function TabBarItem({ config, isActive, item }) {
21
21
  var _a, _b;
22
22
  const icon = isActive ? item.activeImage || item.image : item.image;
23
23
  const textColor = (_a = config.textColor) !== null && _a !== void 0 ? _a : '#333';
24
24
  const selectedColor = (_b = config.selectedColor) !== null && _b !== void 0 ? _b : '#108ee9';
25
- return (React.createElement(Link, { to: `/${item.url}`, className: "remax-tab-item" },
26
- React.createElement("div", { className: "remax-tab-item-image", style: { backgroundImage: `url(${icon})` } }),
27
- React.createElement("div", { className: "remax-tab-item-title", style: {
25
+ return (React.createElement(Link, { to: `/${item.url}`, className: "rsmax-tab-item" },
26
+ React.createElement("div", { className: "rsmax-tab-item-image", style: { backgroundImage: `url(${icon})` } }),
27
+ React.createElement("div", { className: "rsmax-tab-item-title", style: {
28
28
  color: isActive ? selectedColor : textColor,
29
29
  } }, item.title)));
30
30
  }
package/esm/bootstrap.js CHANGED
@@ -1,4 +1,4 @@
1
- import { render } from 'react-dom';
1
+ import { createRoot } from 'react-dom/client';
2
2
  import hd from 'umi-hd';
3
3
  import { createHashHistory, createBrowserHistory } from 'history';
4
4
  import { RuntimeOptions } from '@rsmax/framework-shared';
@@ -8,5 +8,9 @@ export default function bootstrap(options) {
8
8
  const { appConfig } = options;
9
9
  const history = !appConfig.router || appConfig.router.type !== 'browser' ? createHashHistory() : createBrowserHistory();
10
10
  RuntimeOptions.apply({ history, mpa: false });
11
- render(createApp(options, history), document.getElementById('remax-app'));
11
+ const container = document.getElementById('rsmax-app');
12
+ if (!container)
13
+ throw new Error('Failed to find the root element');
14
+ const root = createRoot(container);
15
+ root.render(createApp(options, history));
12
16
  }
@@ -1,5 +1,5 @@
1
- import * as React from 'react';
2
- import { render } from 'react-dom';
1
+ import React from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
3
  import hd from 'umi-hd';
4
4
  import createAppConfig from './createAppConfig';
5
5
  import { PluginDriver, RuntimeOptions } from '@rsmax/framework-shared';
@@ -47,5 +47,9 @@ export default function bootstrap(options) {
47
47
  };
48
48
  RuntimeOptions.apply({ pluginDriver, history, mpa: true });
49
49
  const App = createApp(options);
50
- render(App, document.getElementById('remax-app'));
50
+ const container = document.getElementById('rsmax-app');
51
+ if (!container)
52
+ throw new Error('Failed to find the root element');
53
+ const root = createRoot(container);
54
+ root.render(App);
51
55
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { History } from 'history';
3
3
  import { BootstrapOptions } from './types';
4
4
  export default function createApp(options: BootstrapOptions, history: History): React.JSX.Element;
package/esm/createApp.js CHANGED
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { RuntimeOptions, PluginDriver } from '@rsmax/framework-shared';
3
3
  import { CacheRoute, CacheSwitch } from '@remax/react-router-cache-route';
4
4
  import { Router, Route, Redirect, useLocation } from 'react-router-dom';
@@ -24,7 +24,7 @@ export default function createApp(options, history) {
24
24
  React.createElement(Route, { exact: true, path: "/" },
25
25
  React.createElement(Redirect, { to: `/${(_a = pages[0]) === null || _a === void 0 ? void 0 : _a.route}` })),
26
26
  pages.map((page, i) => {
27
- return (React.createElement(CacheRoute, { key: page.route, className: "remax-cached-router-wrapper", path: `/${page.route}`, exact: true }, (props) => {
27
+ return (React.createElement(CacheRoute, { key: page.route, className: "rsmax-cached-router-wrapper", path: `/${page.route}`, exact: true }, (props) => {
28
28
  const pageComponent = pageComponentsHoc[i];
29
29
  return React.createElement(pageComponent, Object.assign(Object.assign({}, props), { pageConfig: Object.assign(Object.assign({}, appConfig.window), page.config), tabBar: appConfig.tabBar }));
30
30
  }));
@@ -37,7 +37,7 @@ export default function createApp(options, history) {
37
37
  function LogLocation() {
38
38
  const location = useLocation();
39
39
  React.useEffect(() => {
40
- console.log('[remax][react-router]location change', location.pathname);
40
+ console.log('[rsmax][react-router]location change', location.pathname);
41
41
  }, [location]);
42
42
  return null;
43
43
  }
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  export default function createAppConfig(this: any, App: any): {
3
3
  new (props: any): {
4
4
  componentDidMount(): void;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { ForwardRef } from 'react-is';
3
3
  import { AppInstanceContext, AppLifecycle, callbackName, isClassComponent } from '@rsmax/framework-shared';
4
4
  class DefaultAppComponent extends React.Component {
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import { TabBarConfig, PageConfig } from './types';
3
3
  interface PageConfigProps {
4
4
  tabBar: TabBarConfig;
@@ -1,4 +1,4 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  import qs from 'qs';
3
3
  import { createPageWrapper, Lifecycle, callbackName } from '@rsmax/framework-shared';
4
4
  import PullToRefresh from './PullToRefresh';
@@ -113,7 +113,7 @@ export default function createPageConfig(Page, name) {
113
113
  const { tabBar, location } = this.props;
114
114
  const { refreshing } = this.state;
115
115
  const hasTabBar = !!tabBar;
116
- const className = `remax-page ${hasTabBar ? 'with-tab-bar' : ''}`;
116
+ const className = `rsmax-page ${hasTabBar ? 'with-tab-bar' : ''}`;
117
117
  const query = qs.parse(location.search, { ignoreQueryPrefix: true });
118
118
  if (this.isPullDownRefreshEnabled()) {
119
119
  return (React.createElement(PullToRefresh, { onRefresh: this.handleRefresh, refreshing: refreshing, distanceToRefresh: 50 },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsmax/web",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "Shim of web for rsmax",
5
5
  "author": "Wei Zhu <yesmeck@gmail.com>",
6
6
  "homepage": "https://github.com/remaxjs/remax#readme",
@@ -26,7 +26,7 @@
26
26
  "dependencies": {
27
27
  "@loadable/component": "^5.12.0",
28
28
  "@remax/react-router-cache-route": "^1.8.4",
29
- "@rsmax/framework-shared": "1.3.3",
29
+ "@rsmax/framework-shared": "1.3.4",
30
30
  "history": "^5.3.0",
31
31
  "qs": "^6.9.3",
32
32
  "react-is": "^18.3.0",
@@ -38,15 +38,16 @@
38
38
  "@types/loadable__component": "^5.10.0",
39
39
  "@types/qs": "^6.9.3",
40
40
  "@types/react": "^18.3.0",
41
- "@types/react-is": "^17.0.2",
41
+ "@types/react-is": "^18.3.0",
42
42
  "@types/react-router-dom": "^5.3.3",
43
43
  "@types/react-test-renderer": "^18.3.0",
44
44
  "jsdom": "^26.1.0",
45
45
  "react": "^18.3.0",
46
+ "react-dom": "^18.3.0",
46
47
  "react-test-renderer": "^18.3.0"
47
48
  },
48
49
  "publishConfig": {
49
50
  "access": "public"
50
51
  },
51
- "gitHead": "c147c027f14f6f05c23c3f22aaf00a504b438ee8"
52
+ "gitHead": "162e6c3a1c557480622b4bdc39e258de6026430e"
52
53
  }