@ray-js/framework 1.4.0-alpha.3 → 1.4.0-alpha.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.
package/lib/api/tabBar.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { appStoreEmitter, actions } from '../store/appStore';
2
2
  export function showTabBar(options) {
3
3
  var _options$success, _options$complete;
4
-
5
4
  appStoreEmitter.emit(actions.toggleTabBar, {
6
5
  visible: true,
7
6
  animation: options.animation
@@ -11,7 +10,6 @@ export function showTabBar(options) {
11
10
  }
12
11
  export function hideTabBar(options) {
13
12
  var _options$success2, _options$complete2;
14
-
15
13
  appStoreEmitter.emit(actions.toggleTabBar, {
16
14
  visible: false,
17
15
  animation: options.animation
@@ -7,15 +7,14 @@ import { Application } from '../components/Application';
7
7
  import { normalizeBasename } from '../utils';
8
8
  export function createApp(options) {
9
9
  var _cfg$globalConfig;
10
-
11
- var cfg = _objectSpread({}, options);
12
-
13
- var root = document.createElement('div');
10
+ const cfg = _objectSpread({}, options);
11
+ const root = document.createElement('div');
14
12
  root.id = 'root';
15
- document.body.appendChild(root); // 入口初始化 格式数据
16
-
13
+ document.body.appendChild(root);
14
+ // 入口初始化 格式数据
17
15
  set(cfg, 'globalConfig.basename', normalizeBasename((_cfg$globalConfig = cfg.globalConfig) === null || _cfg$globalConfig === void 0 ? void 0 : _cfg$globalConfig.basename));
18
- set(cfg, 'tabBar', normalizeTabBar(cfg.tabBar, cfg.routes)); // 作为 web 构建的启动入口文件
16
+ set(cfg, 'tabBar', normalizeTabBar(cfg.tabBar, cfg.routes));
19
17
 
18
+ // 作为 web 构建的启动入口文件
20
19
  ReactDOM.render( /*#__PURE__*/React.createElement(Application, cfg), root);
21
20
  }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ import set from 'lodash.set';
4
+ import { normalizeTabBar } from '@ray-js/framework-shared';
5
+ import { Application } from '../components/Application';
6
+ import { normalizeBasename } from '../utils';
7
+ export function createApp(options) {
8
+ var _a;
9
+ const cfg = Object.assign({}, options);
10
+ const root = document.createElement('div');
11
+ root.id = 'root';
12
+ document.body.appendChild(root);
13
+ // 入口初始化 格式数据
14
+ set(cfg, 'globalConfig.basename', normalizeBasename((_a = cfg.globalConfig) === null || _a === void 0 ? void 0 : _a.basename));
15
+ set(cfg, 'tabBar', normalizeTabBar(cfg.tabBar, cfg.routes));
16
+ // 作为 web 构建的启动入口文件
17
+ ReactDOM.render(<Application {...cfg}/>, root);
18
+ }
@@ -1,12 +1,12 @@
1
1
  import { getCurrent } from '@ray-js/runtime';
2
+
2
3
  /**
3
4
  * 创建抽象的 App Instance 对标到小程序,提供给 getApp() 进行使用
4
5
  * @param appThis
5
6
  */
6
-
7
7
  export function createAppInstance(appThis) {
8
- var current = getCurrent(); // App 实例仅且注册一次
9
-
8
+ const current = getCurrent();
9
+ // App 实例仅且注册一次
10
10
  if (!current.app) {
11
11
  current.app = appThis;
12
12
  }
@@ -0,0 +1,12 @@
1
+ import { getCurrent } from '@ray-js/runtime';
2
+ /**
3
+ * 创建抽象的 App Instance 对标到小程序,提供给 getApp() 进行使用
4
+ * @param appThis
5
+ */
6
+ export function createAppInstance(appThis) {
7
+ const current = getCurrent();
8
+ // App 实例仅且注册一次
9
+ if (!current.app) {
10
+ current.app = appThis;
11
+ }
12
+ }
package/lib/app/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { getCurrent } from '@ray-js/runtime';
2
2
  export * from './createApp';
3
3
  export function getApp() {
4
- var current = getCurrent();
4
+ const current = getCurrent();
5
5
  return current.app;
6
6
  }
@@ -0,0 +1,6 @@
1
+ import { getCurrent } from '@ray-js/runtime';
2
+ export * from './createApp';
3
+ export function getApp() {
4
+ const current = getCurrent();
5
+ return current.app;
6
+ }
@@ -3,5 +3,5 @@ export declare class AppWrapper extends React.Component<{
3
3
  children: any;
4
4
  }> {
5
5
  componentDidMount(): void;
6
- render(): JSX.Element;
6
+ render(): React.JSX.Element;
7
7
  }
@@ -1,53 +1,30 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _inherits from "@babel/runtime/helpers/esm/inherits";
4
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
5
1
  import React from 'react';
6
2
  import styles from './index.module.less';
7
3
  import { getApp } from '../../app';
8
4
  import location from '@ray-js/location';
9
- export var AppWrapper = /*#__PURE__*/function (_React$Component) {
10
- _inherits(AppWrapper, _React$Component);
11
-
12
- var _super = _createSuper(AppWrapper);
13
-
14
- function AppWrapper() {
15
- _classCallCheck(this, AppWrapper);
16
-
17
- return _super.apply(this, arguments);
18
- }
19
-
20
- _createClass(AppWrapper, [{
21
- key: "componentDidMount",
22
- value: function componentDidMount() {
23
- var app = getApp();
24
-
25
- if (typeof app.onLaunch === 'function') {
26
- app.onLaunch({
27
- path: location.pathname,
28
- query: location.query,
29
- params: location.params
30
- });
31
- } // 初次展现
32
-
33
-
34
- if (typeof app.onShow === 'function') {
35
- app.onShow({
36
- path: location.pathname,
37
- query: location.query,
38
- params: location.params
39
- });
40
- }
5
+ export class AppWrapper extends React.Component {
6
+ componentDidMount() {
7
+ const app = getApp();
8
+ if (typeof app.onLaunch === 'function') {
9
+ app.onLaunch({
10
+ path: location.pathname,
11
+ query: location.query,
12
+ params: location.params
13
+ });
41
14
  }
42
- }, {
43
- key: "render",
44
- value: function render() {
45
- return /*#__PURE__*/React.createElement("div", {
46
- id: "Application",
47
- className: styles.application
48
- }, this.props.children);
15
+ // 初次展现
16
+ if (typeof app.onShow === 'function') {
17
+ app.onShow({
18
+ path: location.pathname,
19
+ query: location.query,
20
+ params: location.params
21
+ });
49
22
  }
50
- }]);
51
-
52
- return AppWrapper;
53
- }(React.Component);
23
+ }
24
+ render() {
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ id: "Application",
27
+ className: styles.application
28
+ }, this.props.children);
29
+ }
30
+ }
@@ -0,0 +1,29 @@
1
+ import React from 'react';
2
+ import styles from './index.module.less';
3
+ import { getApp } from '../../app';
4
+ import location from '@ray-js/location';
5
+ export class AppWrapper extends React.Component {
6
+ componentDidMount() {
7
+ const app = getApp();
8
+ if (typeof app.onLaunch === 'function') {
9
+ app.onLaunch({
10
+ path: location.pathname,
11
+ query: location.query,
12
+ params: location.params,
13
+ });
14
+ }
15
+ // 初次展现
16
+ if (typeof app.onShow === 'function') {
17
+ app.onShow({
18
+ path: location.pathname,
19
+ query: location.query,
20
+ params: location.params,
21
+ });
22
+ }
23
+ }
24
+ render() {
25
+ return (<div id='Application' className={styles.application}>
26
+ {this.props.children}
27
+ </div>);
28
+ }
29
+ }
@@ -1,7 +1,7 @@
1
1
  import '../../runtime';
2
2
  import React from 'react';
3
3
  import * as types from '@ray-js/types';
4
- export declare type ApplicationProps = {
4
+ export type ApplicationProps = {
5
5
  globalConfig: types.GlobalConfig & types.WebGlobalConfig;
6
6
  routes: types.Routes;
7
7
  tabBar: types.TabBar;
@@ -15,5 +15,5 @@ export declare class Application extends React.Component<ApplicationProps, {
15
15
  constructor(props: Readonly<ApplicationProps>);
16
16
  componentDidMount(): void;
17
17
  getGlobalConfig: (path: string | string[], defaultValue?: any) => any;
18
- render(): JSX.Element | null;
18
+ render(): React.JSX.Element | null;
19
19
  }
@@ -1,8 +1,3 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
2
  import '../../runtime';
8
3
  import React from 'react';
@@ -12,94 +7,73 @@ import { get } from '../../utils';
12
7
  import { AppWrapper } from '../AppWrapper';
13
8
  import { PageWrapper } from '../PageWrapper';
14
9
  import { TabBar } from '../TabBar';
15
-
16
- var isClassComponent = function (Component) {
10
+ const isClassComponent = Component => {
17
11
  return Component.prototype && typeof Component.prototype.render === 'function';
18
12
  };
19
-
20
- export var Application = /*#__PURE__*/function (_React$Component) {
21
- _inherits(Application, _React$Component);
22
-
23
- var _super = _createSuper(Application);
24
-
25
- function Application(props) {
26
- var _this;
27
-
28
- _classCallCheck(this, Application);
29
-
30
- _this = _super.call(this, props);
31
-
32
- _defineProperty(_assertThisInitialized(_this), "getGlobalConfig", function (path, defaultValue) {
33
- var _this$props$globalCon = _this.props.globalConfig,
34
- globalConfig = _this$props$globalCon === void 0 ? {} : _this$props$globalCon;
35
- var value = get(globalConfig, path, defaultValue);
13
+ export class Application extends React.Component {
14
+ constructor(props) {
15
+ super(props);
16
+ _defineProperty(this, "getGlobalConfig", (path, defaultValue) => {
17
+ const {
18
+ globalConfig = {}
19
+ } = this.props;
20
+ const value = get(globalConfig, path, defaultValue);
36
21
  return value;
37
22
  });
38
-
39
- _this.state = {};
40
-
41
- var title = _this.getGlobalConfig(['window', 'navigationBarTitleText'], 'Ray App');
42
-
23
+ this.state = {};
24
+ const title = this.getGlobalConfig(['window', 'navigationBarTitleText'], 'Ray App');
43
25
  document.title = title;
44
- return _this;
45
26
  }
46
-
47
- _createClass(Application, [{
48
- key: "componentDidMount",
49
- value: function componentDidMount() {
50
- var _this2 = this;
51
-
52
- var _this$props = this.props,
53
- routes = _this$props.routes,
54
- pages = _this$props.pages,
55
- tabBar = _this$props.tabBar;
56
- var basename = this.getGlobalConfig('basename', '/') || '/';
57
- var bgColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
58
- document.body.style.backgroundColor = bgColor;
59
- createRouter({
60
- basename: basename,
61
- routes: routes,
62
- pages: pages,
63
- tabBar: tabBar,
64
- onChange: function onChange(component, props) {
65
- _this2.setState({
66
- component: component,
67
- matchedPage: props.page
68
- });
69
- }
70
- });
71
- }
72
- }, {
73
- key: "render",
74
- value: function render() {
75
- var _this$props2 = this.props,
76
- App = _this$props2.app,
77
- tabBar = _this$props2.tabBar;
78
- var basename = this.getGlobalConfig('basename', '/') || '/';
79
- var _this$state = this.state,
80
- PageComponent = _this$state.component,
81
- matchedPage = _this$state.matchedPage; // 空页面暂不渲染,否则 appEvent 无法应用到页面内部
82
-
83
- if (!matchedPage) {
84
- return null;
27
+ componentDidMount() {
28
+ const {
29
+ routes,
30
+ pages,
31
+ tabBar
32
+ } = this.props;
33
+ const basename = this.getGlobalConfig('basename', '/') || '/';
34
+ const bgColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
35
+ document.body.style.backgroundColor = bgColor;
36
+ createRouter({
37
+ basename,
38
+ routes,
39
+ pages,
40
+ tabBar,
41
+ onChange: (component, props) => {
42
+ this.setState({
43
+ component,
44
+ matchedPage: props.page
45
+ });
85
46
  }
47
+ });
48
+ }
49
+ render() {
50
+ const {
51
+ app: App,
52
+ tabBar
53
+ } = this.props;
54
+ const basename = this.getGlobalConfig('basename', '/') || '/';
55
+ const {
56
+ component: PageComponent,
57
+ matchedPage
58
+ } = this.state;
86
59
 
87
- var isClassType = isClassComponent(PageComponent);
88
- return /*#__PURE__*/React.createElement(AppWrapper, null, /*#__PURE__*/React.createElement(App, {
89
- ref: function ref(appThis) {
90
- createAppInstance(appThis);
91
- }
92
- }, /*#__PURE__*/React.createElement(PageWrapper, {
93
- isClassType: isClassType,
94
- page: matchedPage,
95
- key: matchedPage.route,
96
- getGlobalConfig: this.getGlobalConfig
97
- }, /*#__PURE__*/React.createElement(PageComponent, null)), matchedPage.isTabBar && /*#__PURE__*/React.createElement(TabBar, {
98
- basename: basename,
99
- config: tabBar
100
- })));
60
+ // 空页面暂不渲染,否则 appEvent 无法应用到页面内部
61
+ if (!matchedPage) {
62
+ return null;
101
63
  }
102
- }]);
103
-
104
- return Application;
105
- }(React.Component);
64
+ const isClassType = isClassComponent(PageComponent);
65
+ return /*#__PURE__*/React.createElement(AppWrapper, null, /*#__PURE__*/React.createElement(App, {
66
+ ref: appThis => {
67
+ createAppInstance(appThis);
68
+ }
69
+ }, /*#__PURE__*/React.createElement(PageWrapper, {
70
+ isClassType: isClassType,
71
+ page: matchedPage,
72
+ key: matchedPage.route,
73
+ getGlobalConfig: this.getGlobalConfig
74
+ }, /*#__PURE__*/React.createElement(PageComponent, null)), matchedPage.isTabBar && /*#__PURE__*/React.createElement(TabBar, {
75
+ basename: basename,
76
+ config: tabBar
77
+ })));
78
+ }
79
+ }
@@ -0,0 +1,59 @@
1
+ import '../../runtime';
2
+ import React from 'react';
3
+ import { createRouter } from '@ray-js/router';
4
+ import { createAppInstance } from '../../app/createAppInstance';
5
+ import { get } from '../../utils';
6
+ import { AppWrapper } from '../AppWrapper';
7
+ import { PageWrapper } from '../PageWrapper';
8
+ import { TabBar } from '../TabBar';
9
+ const isClassComponent = (Component) => {
10
+ return Component.prototype && typeof Component.prototype.render === 'function';
11
+ };
12
+ export class Application extends React.Component {
13
+ constructor(props) {
14
+ super(props);
15
+ this.getGlobalConfig = (path, defaultValue) => {
16
+ const { globalConfig = {} } = this.props;
17
+ const value = get(globalConfig, path, defaultValue);
18
+ return value;
19
+ };
20
+ this.state = {};
21
+ const title = this.getGlobalConfig(['window', 'navigationBarTitleText'], 'Ray App');
22
+ document.title = title;
23
+ }
24
+ componentDidMount() {
25
+ const { routes, pages, tabBar } = this.props;
26
+ const basename = this.getGlobalConfig('basename', '/') || '/';
27
+ const bgColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
28
+ document.body.style.backgroundColor = bgColor;
29
+ createRouter({
30
+ basename,
31
+ routes,
32
+ pages,
33
+ tabBar,
34
+ onChange: (component, props) => {
35
+ this.setState({ component, matchedPage: props.page });
36
+ },
37
+ });
38
+ }
39
+ render() {
40
+ const { app: App, tabBar } = this.props;
41
+ const basename = this.getGlobalConfig('basename', '/') || '/';
42
+ const { component: PageComponent, matchedPage } = this.state;
43
+ // 空页面暂不渲染,否则 appEvent 无法应用到页面内部
44
+ if (!matchedPage) {
45
+ return null;
46
+ }
47
+ const isClassType = isClassComponent(PageComponent);
48
+ return (<AppWrapper>
49
+ <App ref={(appThis) => {
50
+ createAppInstance(appThis);
51
+ }}>
52
+ <PageWrapper isClassType={isClassType} page={matchedPage} key={matchedPage.route} getGlobalConfig={this.getGlobalConfig}>
53
+ <PageComponent />
54
+ </PageWrapper>
55
+ {matchedPage.isTabBar && <TabBar basename={basename} config={tabBar}/>}
56
+ </App>
57
+ </AppWrapper>);
58
+ }
59
+ }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { PageInstance } from '@ray-js/runtime';
3
3
  import { Page, PageConfig } from '@ray-js/types';
4
4
  import './index.module.less';
5
- declare type PageWrapperProps = {
5
+ type PageWrapperProps = {
6
6
  isClassType: boolean;
7
7
  page: Page;
8
8
  getGlobalConfig: (path: string | string[], defaultValue?: any) => any;
@@ -20,6 +20,6 @@ export declare class PageWrapper extends React.Component<PageWrapperProps, any>
20
20
  handlePageScroll: () => void;
21
21
  checkReachBottom: () => void;
22
22
  getPageConfig: (field: keyof PageConfig | string[], defaultValue?: any) => any;
23
- render(): JSX.Element;
23
+ render(): React.JSX.Element;
24
24
  }
25
25
  export {};
@@ -1,162 +1,132 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import "core-js/modules/es.object.to-string.js";
8
- import "core-js/modules/web.dom-collections.for-each.js";
9
- import "core-js/modules/es.object.keys.js";
10
2
  import React from 'react';
11
3
  import { lifecycle, PageInstance, PageInstanceContext } from '@ray-js/runtime';
12
4
  import { pageLifecycles } from '@ray-js/types';
13
5
  import { get } from '../../utils';
14
6
  import './index.module.less';
15
- export var PageWrapper = /*#__PURE__*/function (_React$Component) {
16
- _inherits(PageWrapper, _React$Component);
17
-
18
- var _super = _createSuper(PageWrapper);
19
-
20
- function PageWrapper(props) {
21
- var _this;
22
-
23
- _classCallCheck(this, PageWrapper);
24
-
25
- _this = _super.call(this, props);
26
-
27
- _defineProperty(_assertThisInitialized(_this), "$reachBottomDistance", 50);
28
-
29
- _defineProperty(_assertThisInitialized(_this), "handlePageResize", function () {
30
- var windowWidth = document.documentElement.clientWidth;
31
- var windowHeight = document.documentElement.clientHeight;
7
+ export class PageWrapper extends React.Component {
8
+ constructor(props) {
9
+ super(props);
10
+ _defineProperty(this, "$reachBottomDistance", 50);
11
+ _defineProperty(this, "handlePageResize", () => {
12
+ const windowWidth = document.documentElement.clientWidth;
13
+ const windowHeight = document.documentElement.clientHeight;
32
14
  lifecycle.emit({
33
- uniqueId: _this.$instance.uniqueId,
15
+ uniqueId: this.$instance.uniqueId,
34
16
  name: pageLifecycles.onResize,
35
17
  args: {
36
- windowWidth: windowWidth,
37
- windowHeight: windowHeight
18
+ windowWidth,
19
+ windowHeight
38
20
  }
39
21
  });
40
22
  });
41
-
42
- _defineProperty(_assertThisInitialized(_this), "handlePageScroll", function () {
43
- var event = {
23
+ _defineProperty(this, "handlePageScroll", () => {
24
+ const event = {
44
25
  scrollTop: window.scrollY
45
26
  };
46
27
  lifecycle.emit({
47
- uniqueId: _this.$instance.uniqueId,
28
+ uniqueId: this.$instance.uniqueId,
48
29
  name: pageLifecycles.onPageScroll,
49
30
  args: event
50
31
  });
51
-
52
- _this.checkReachBottom();
32
+ this.checkReachBottom();
53
33
  });
54
-
55
- _defineProperty(_assertThisInitialized(_this), "checkReachBottom", function () {
56
- var isCurrentReachBottom = document.body.scrollHeight - (window.innerHeight + window.scrollY) <= _this.$reachBottomDistance;
57
-
58
- if (!_this.$isReachBottom && isCurrentReachBottom) {
59
- _this.$isReachBottom = true;
34
+ _defineProperty(this, "checkReachBottom", () => {
35
+ const isCurrentReachBottom = document.body.scrollHeight - (window.innerHeight + window.scrollY) <= this.$reachBottomDistance;
36
+ if (!this.$isReachBottom && isCurrentReachBottom) {
37
+ this.$isReachBottom = true;
60
38
  lifecycle.emit({
61
- uniqueId: _this.$instance.uniqueId,
39
+ uniqueId: this.$instance.uniqueId,
62
40
  name: pageLifecycles.onReachBottom
63
41
  });
64
42
  return;
65
43
  }
66
-
67
- _this.$isReachBottom = isCurrentReachBottom;
44
+ this.$isReachBottom = isCurrentReachBottom;
68
45
  });
69
-
70
- _defineProperty(_assertThisInitialized(_this), "getPageConfig", function (field, defaultValue) {
71
- var page = _this.props.page;
72
- var pageConfig = page.config;
46
+ _defineProperty(this, "getPageConfig", (field, defaultValue) => {
47
+ const {
48
+ page
49
+ } = this.props;
50
+ const pageConfig = page.config;
73
51
  return get(pageConfig, field, defaultValue);
74
52
  });
75
-
76
- _this.$instance = new PageInstance();
77
- lifecycle.addInstance(_this.$instance);
78
- _this.getGlobalConfig = _this.props.getGlobalConfig;
79
- return _this;
53
+ this.$instance = new PageInstance();
54
+ lifecycle.addInstance(this.$instance);
55
+ this.getGlobalConfig = this.props.getGlobalConfig;
80
56
  }
57
+ componentDidMount() {
58
+ const title = this.getPageConfig('navigationBarTitleText', '');
59
+ document.title = title;
60
+ window.addEventListener('scroll', this.handlePageScroll);
61
+ window.addEventListener('resize', this.handlePageResize);
62
+ const backgroundColor = this.getPageConfig('backgroundColor');
63
+ if (backgroundColor) {
64
+ document.body.style.backgroundColor = backgroundColor;
65
+ }
81
66
 
82
- _createClass(PageWrapper, [{
83
- key: "componentDidMount",
84
- value: function componentDidMount() {
85
- var title = this.getPageConfig('navigationBarTitleText', '');
86
- document.title = title;
87
- window.addEventListener('scroll', this.handlePageScroll);
88
- window.addEventListener('resize', this.handlePageResize);
89
- var backgroundColor = this.getPageConfig('backgroundColor');
90
-
91
- if (backgroundColor) {
92
- document.body.style.backgroundColor = backgroundColor;
93
- } // 获取页面触底的距离
94
-
95
-
96
- this.$reachBottomDistance = this.getPageConfig('onReachBottomDistance', this.getGlobalConfig(['window', 'onReachBottomDistance'], 50) // 全局配置
97
- ); // FIXME: 应用实例化未完成,didMount 从内至外执行
98
- // 此时触发 onShow onReady 获取不到 getApp 实例,组件内也存在这样的情况
67
+ // 获取页面触底的距离
68
+ this.$reachBottomDistance = this.getPageConfig('onReachBottomDistance', this.getGlobalConfig(['window', 'onReachBottomDistance'], 50) // 全局配置
69
+ );
99
70
 
100
- lifecycle.emit({
101
- uniqueId: this.$instance.uniqueId,
102
- name: pageLifecycles.onShow
103
- });
104
- lifecycle.emit({
105
- uniqueId: this.$instance.uniqueId,
106
- name: pageLifecycles.onReady
107
- });
108
- }
109
- }, {
110
- key: "componentWillUnmount",
111
- value: function componentWillUnmount() {
112
- window.removeEventListener('scroll', this.handlePageScroll);
113
- window.removeEventListener('resize', this.handlePageResize); // FIXME: 目前是 SPA 的页面直接切换,卸载前直接调用事件
71
+ // FIXME: 应用实例化未完成,didMount 从内至外执行
72
+ // 此时触发 onShow onReady 获取不到 getApp 实例,组件内也存在这样的情况
73
+ lifecycle.emit({
74
+ uniqueId: this.$instance.uniqueId,
75
+ name: pageLifecycles.onShow
76
+ });
77
+ lifecycle.emit({
78
+ uniqueId: this.$instance.uniqueId,
79
+ name: pageLifecycles.onReady
80
+ });
81
+ }
82
+ componentWillUnmount() {
83
+ window.removeEventListener('scroll', this.handlePageScroll);
84
+ window.removeEventListener('resize', this.handlePageResize);
85
+
86
+ // FIXME: 目前是 SPA 的页面直接切换,卸载前直接调用事件
87
+ lifecycle.emit({
88
+ uniqueId: this.$instance.uniqueId,
89
+ name: pageLifecycles.onHide
90
+ });
91
+ lifecycle.emit({
92
+ uniqueId: this.$instance.uniqueId,
93
+ name: pageLifecycles.onUnload
94
+ });
95
+ lifecycle.removeInstance(this.$instance);
96
+ // TODO: 实现 onPullDownRefresh 生命周期
97
+ }
114
98
 
115
- lifecycle.emit({
116
- uniqueId: this.$instance.uniqueId,
117
- name: pageLifecycles.onHide
118
- });
119
- lifecycle.emit({
120
- uniqueId: this.$instance.uniqueId,
121
- name: pageLifecycles.onUnload
122
- });
123
- lifecycle.removeInstance(this.$instance); // TODO: 实现 onPullDownRefresh 生命周期
124
- }
125
- }, {
126
- key: "render",
127
- value: function render() {
128
- var _this$props = this.props,
129
- page = _this$props.page,
130
- children = _this$props.children,
131
- isClassType = _this$props.isClassType;
132
- var $instance = this.$instance;
133
- var globalBackgroundColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
134
- var backgroundColor = this.getPageConfig('backgroundColor', globalBackgroundColor);
135
- document.body.style.backgroundColor = backgroundColor;
136
- return /*#__PURE__*/React.createElement(PageInstanceContext.Provider, {
137
- value: {
138
- $instance: $instance,
139
- pageConfig: page.config
140
- }
141
- }, /*#__PURE__*/React.createElement("v-page", {
142
- "data-route": page.route
143
- }, isClassType ?
144
- /*#__PURE__*/
145
- // @ts-ignore
146
- React.cloneElement(children, {
147
- ref: function ref(ins) {
148
- if (ins) {
149
- // 实现 class 生命周期用法的挂载
150
- Object.keys(pageLifecycles).forEach(function (event) {
151
- if (typeof ins[event] === 'function') {
152
- $instance.registerLifecycle(event, ins, ins[event]);
153
- }
154
- });
155
- }
99
+ render() {
100
+ const {
101
+ page,
102
+ children,
103
+ isClassType
104
+ } = this.props;
105
+ const $instance = this.$instance;
106
+ const globalBackgroundColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
107
+ const backgroundColor = this.getPageConfig('backgroundColor', globalBackgroundColor);
108
+ document.body.style.backgroundColor = backgroundColor;
109
+ return /*#__PURE__*/React.createElement(PageInstanceContext.Provider, {
110
+ value: {
111
+ $instance,
112
+ pageConfig: page.config
113
+ }
114
+ }, /*#__PURE__*/React.createElement("v-page", {
115
+ "data-route": page.route
116
+ }, isClassType ?
117
+ /*#__PURE__*/
118
+ // @ts-ignore
119
+ React.cloneElement(children, {
120
+ ref(ins) {
121
+ if (ins) {
122
+ // 实现 class 生命周期用法的挂载
123
+ Object.keys(pageLifecycles).forEach(event => {
124
+ if (typeof ins[event] === 'function') {
125
+ $instance.registerLifecycle(event, ins, ins[event]);
126
+ }
127
+ });
156
128
  }
157
- }) : children));
158
- }
159
- }]);
160
-
161
- return PageWrapper;
162
- }(React.Component);
129
+ }
130
+ }) : children));
131
+ }
132
+ }
@@ -0,0 +1,116 @@
1
+ import React from 'react';
2
+ import { lifecycle, PageInstance, PageInstanceContext } from '@ray-js/runtime';
3
+ import { pageLifecycles } from '@ray-js/types';
4
+ import { get } from '../../utils';
5
+ import './index.module.less';
6
+ export class PageWrapper extends React.Component {
7
+ constructor(props) {
8
+ super(props);
9
+ this.$reachBottomDistance = 50;
10
+ this.handlePageResize = () => {
11
+ const windowWidth = document.documentElement.clientWidth;
12
+ const windowHeight = document.documentElement.clientHeight;
13
+ lifecycle.emit({
14
+ uniqueId: this.$instance.uniqueId,
15
+ name: pageLifecycles.onResize,
16
+ args: { windowWidth, windowHeight },
17
+ });
18
+ };
19
+ this.handlePageScroll = () => {
20
+ const event = { scrollTop: window.scrollY };
21
+ lifecycle.emit({
22
+ uniqueId: this.$instance.uniqueId,
23
+ name: pageLifecycles.onPageScroll,
24
+ args: event,
25
+ });
26
+ this.checkReachBottom();
27
+ };
28
+ this.checkReachBottom = () => {
29
+ const isCurrentReachBottom = document.body.scrollHeight - (window.innerHeight + window.scrollY) <=
30
+ this.$reachBottomDistance;
31
+ if (!this.$isReachBottom && isCurrentReachBottom) {
32
+ this.$isReachBottom = true;
33
+ lifecycle.emit({
34
+ uniqueId: this.$instance.uniqueId,
35
+ name: pageLifecycles.onReachBottom,
36
+ });
37
+ return;
38
+ }
39
+ this.$isReachBottom = isCurrentReachBottom;
40
+ };
41
+ this.getPageConfig = (field, defaultValue) => {
42
+ const { page } = this.props;
43
+ const pageConfig = page.config;
44
+ return get(pageConfig, field, defaultValue);
45
+ };
46
+ this.$instance = new PageInstance();
47
+ lifecycle.addInstance(this.$instance);
48
+ this.getGlobalConfig = this.props.getGlobalConfig;
49
+ }
50
+ componentDidMount() {
51
+ const title = this.getPageConfig('navigationBarTitleText', '');
52
+ document.title = title;
53
+ window.addEventListener('scroll', this.handlePageScroll);
54
+ window.addEventListener('resize', this.handlePageResize);
55
+ const backgroundColor = this.getPageConfig('backgroundColor');
56
+ if (backgroundColor) {
57
+ document.body.style.backgroundColor = backgroundColor;
58
+ }
59
+ // 获取页面触底的距离
60
+ this.$reachBottomDistance = this.getPageConfig('onReachBottomDistance', this.getGlobalConfig(['window', 'onReachBottomDistance'], 50) // 全局配置
61
+ );
62
+ // FIXME: 应用实例化未完成,didMount 从内至外执行
63
+ // 此时触发 onShow onReady 获取不到 getApp 实例,组件内也存在这样的情况
64
+ lifecycle.emit({
65
+ uniqueId: this.$instance.uniqueId,
66
+ name: pageLifecycles.onShow,
67
+ });
68
+ lifecycle.emit({
69
+ uniqueId: this.$instance.uniqueId,
70
+ name: pageLifecycles.onReady,
71
+ });
72
+ }
73
+ componentWillUnmount() {
74
+ window.removeEventListener('scroll', this.handlePageScroll);
75
+ window.removeEventListener('resize', this.handlePageResize);
76
+ // FIXME: 目前是 SPA 的页面直接切换,卸载前直接调用事件
77
+ lifecycle.emit({
78
+ uniqueId: this.$instance.uniqueId,
79
+ name: pageLifecycles.onHide,
80
+ });
81
+ lifecycle.emit({
82
+ uniqueId: this.$instance.uniqueId,
83
+ name: pageLifecycles.onUnload,
84
+ });
85
+ lifecycle.removeInstance(this.$instance);
86
+ // TODO: 实现 onPullDownRefresh 生命周期
87
+ }
88
+ render() {
89
+ const { page, children, isClassType } = this.props;
90
+ const $instance = this.$instance;
91
+ const globalBackgroundColor = this.getGlobalConfig(['window', 'backgroundColor'], '#fff');
92
+ const backgroundColor = this.getPageConfig('backgroundColor', globalBackgroundColor);
93
+ document.body.style.backgroundColor = backgroundColor;
94
+ return (<PageInstanceContext.Provider value={{ $instance, pageConfig: page.config }}>
95
+ <v-page data-route={page.route}>
96
+ {isClassType
97
+ ? // @ts-ignore
98
+ React.cloneElement(children, {
99
+ ref(ins) {
100
+ if (ins) {
101
+ // 实现 class 生命周期用法的挂载
102
+ Object.keys(pageLifecycles).forEach((event) => {
103
+ if (typeof ins[event] === 'function') {
104
+ $instance.registerLifecycle(event, ins, ins[event]);
105
+ }
106
+ });
107
+ }
108
+ },
109
+ })
110
+ : children}
111
+ {/* TODO: 如果需要转场动画,需要在 PageWrapper 中渲染 */}
112
+ {/* {page?.isTabBar && <TabBar config={tabBarConfig} />} */}
113
+ </v-page>
114
+ </PageInstanceContext.Provider>);
115
+ }
116
+ }
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import { TabBar as ITabBar } from '@ray-js/types';
3
3
  import { renderOptions } from '../../store/appStore';
4
- declare type TabBarProps = {
4
+ type TabBarProps = {
5
5
  config: ITabBar;
6
6
  basename?: string;
7
7
  };
@@ -20,6 +20,6 @@ export declare class TabBar extends React.Component<TabBarProps, {
20
20
  };
21
21
  componentDidMount(): void;
22
22
  componentWillUnmount(): void;
23
- render(): JSX.Element;
23
+ render(): React.JSX.Element;
24
24
  }
25
25
  export {};
@@ -1,102 +1,73 @@
1
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/esm/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/esm/inherits";
5
- import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import "core-js/modules/es.array.concat.js";
8
- import "core-js/modules/es.array.map.js";
2
+ import "core-js/modules/web.dom-collections.iterator.js";
9
3
  import clsx from 'clsx';
10
4
  import React from 'react';
11
5
  import router from '@ray-js/router';
12
6
  import { events, appStoreEmitter, renderOptions } from '../../store/appStore';
13
7
  import { withPublicPath } from '../../utils';
14
8
  import styles from './index.module.less';
15
- export var TabBar = /*#__PURE__*/function (_React$Component) {
16
- _inherits(TabBar, _React$Component);
17
-
18
- var _super = _createSuper(TabBar);
19
-
20
- function TabBar() {
21
- var _this;
22
-
23
- _classCallCheck(this, TabBar);
24
-
25
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
26
- args[_key] = arguments[_key];
27
- }
28
-
29
- _this = _super.call.apply(_super, [this].concat(args));
30
-
31
- _defineProperty(_assertThisInitialized(_this), "state", {
9
+ export class TabBar extends React.Component {
10
+ constructor() {
11
+ super(...arguments);
12
+ _defineProperty(this, "state", {
32
13
  currentRoute: router.scheduler.currentRoute,
33
14
  renderOptions: renderOptions
34
15
  });
35
-
36
- return _this;
37
16
  }
38
-
39
- _createClass(TabBar, [{
40
- key: "componentDidMount",
41
- value: function componentDidMount() {
42
- var _this2 = this;
43
-
44
- this.unChangeHandle = router.scheduler.on('routeChange', function (route) {
45
- _this2.setState({
46
- currentRoute: route
47
- });
17
+ componentDidMount() {
18
+ this.unChangeHandle = router.scheduler.on('routeChange', route => {
19
+ this.setState({
20
+ currentRoute: route
48
21
  });
49
- this.unAppStoreChange = appStoreEmitter.on(events.tabBarChange, function (state) {
50
- _this2.setState({
51
- renderOptions: state
52
- });
22
+ });
23
+ this.unAppStoreChange = appStoreEmitter.on(events.tabBarChange, state => {
24
+ this.setState({
25
+ renderOptions: state
53
26
  });
54
- }
55
- }, {
56
- key: "componentWillUnmount",
57
- value: function componentWillUnmount() {
58
- var _this$unChangeHandle, _this$unAppStoreChang;
59
-
60
- (_this$unChangeHandle = this.unChangeHandle) === null || _this$unChangeHandle === void 0 ? void 0 : _this$unChangeHandle.call(this);
61
- (_this$unAppStoreChang = this.unAppStoreChange) === null || _this$unAppStoreChang === void 0 ? void 0 : _this$unAppStoreChang.call(this);
62
- }
63
- }, {
64
- key: "render",
65
- value: function render() {
66
- var _clsx;
67
-
68
- var config = this.props.config;
69
- var _this$state = this.state,
70
- currentRoute = _this$state.currentRoute,
71
- renderOptions = _this$state.renderOptions;
27
+ });
28
+ }
29
+ componentWillUnmount() {
30
+ var _this$unChangeHandle, _this$unAppStoreChang;
31
+ (_this$unChangeHandle = this.unChangeHandle) === null || _this$unChangeHandle === void 0 ? void 0 : _this$unChangeHandle.call(this);
32
+ (_this$unAppStoreChang = this.unAppStoreChange) === null || _this$unAppStoreChang === void 0 ? void 0 : _this$unAppStoreChang.call(this);
33
+ }
34
+ render() {
35
+ const {
36
+ config
37
+ } = this.props;
38
+ const {
39
+ currentRoute,
40
+ renderOptions
41
+ } = this.state;
42
+ return /*#__PURE__*/React.createElement("div", {
43
+ "data-route": currentRoute,
44
+ className: clsx(styles.wrapper, {
45
+ [styles.hidden]: !renderOptions.tabBarVisible && !renderOptions.tabBarAnimation,
46
+ [styles.showIn]: renderOptions.tabBarVisible && renderOptions.tabBarAnimation,
47
+ [styles.hideOut]: !renderOptions.tabBarVisible && renderOptions.tabBarAnimation
48
+ })
49
+ }, /*#__PURE__*/React.createElement("div", {
50
+ className: styles.tabBar
51
+ }, config.list.map((item, index) => {
52
+ const fullRoute = item.route;
53
+ const isActive = currentRoute === fullRoute;
54
+ // console.log('>>>>>>>> currentRoute: %s, item: %s', currentRoute, item.route)
72
55
  return /*#__PURE__*/React.createElement("div", {
73
- "data-route": currentRoute,
74
- className: clsx(styles.wrapper, (_clsx = {}, _defineProperty(_clsx, styles.hidden, !renderOptions.tabBarVisible && !renderOptions.tabBarAnimation), _defineProperty(_clsx, styles.showIn, renderOptions.tabBarVisible && renderOptions.tabBarAnimation), _defineProperty(_clsx, styles.hideOut, !renderOptions.tabBarVisible && renderOptions.tabBarAnimation), _clsx))
75
- }, /*#__PURE__*/React.createElement("div", {
76
- className: styles.tabBar
77
- }, config.list.map(function (item, index) {
78
- var fullRoute = item.route;
79
- var isActive = currentRoute === fullRoute; // console.log('>>>>>>>> currentRoute: %s, item: %s', currentRoute, item.route)
80
-
81
- return /*#__PURE__*/React.createElement("div", {
82
- "data-full-route": fullRoute,
83
- key: item.pagePath + index,
84
- className: styles.item,
85
- onClick: function onClick() {
86
- router.push(item.route);
87
- }
88
- }, item.icon && /*#__PURE__*/React.createElement("img", {
89
- className: styles.icon,
90
- src: "".concat(withPublicPath(isActive ? item.activeIcon : item.icon))
91
- }), /*#__PURE__*/React.createElement("span", {
92
- className: styles.text,
93
- style: {
94
- color: isActive ? config.selectedColor : config.textColor
95
- }
96
- }, item.text));
97
- })));
98
- }
99
- }]);
100
-
101
- return TabBar;
102
- }(React.Component);
56
+ "data-full-route": fullRoute,
57
+ key: item.pagePath + index,
58
+ className: styles.item,
59
+ onClick: () => {
60
+ router.push(item.route);
61
+ }
62
+ }, item.icon && /*#__PURE__*/React.createElement("img", {
63
+ className: styles.icon,
64
+ src: "".concat(withPublicPath(isActive ? item.activeIcon : item.icon))
65
+ }), /*#__PURE__*/React.createElement("span", {
66
+ className: styles.text,
67
+ style: {
68
+ color: isActive ? config.selectedColor : config.textColor
69
+ }
70
+ }, item.text));
71
+ })));
72
+ }
73
+ }
@@ -0,0 +1,55 @@
1
+ import clsx from 'clsx';
2
+ import React from 'react';
3
+ import router from '@ray-js/router';
4
+ import { events, appStoreEmitter, renderOptions } from '../../store/appStore';
5
+ import { withPublicPath } from '../../utils';
6
+ import styles from './index.module.less';
7
+ export class TabBar extends React.Component {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.state = {
11
+ currentRoute: router.scheduler.currentRoute,
12
+ renderOptions: renderOptions,
13
+ };
14
+ }
15
+ componentDidMount() {
16
+ this.unChangeHandle = router.scheduler.on('routeChange', (route) => {
17
+ this.setState({
18
+ currentRoute: route,
19
+ });
20
+ });
21
+ this.unAppStoreChange = appStoreEmitter.on(events.tabBarChange, (state) => {
22
+ this.setState({ renderOptions: state });
23
+ });
24
+ }
25
+ componentWillUnmount() {
26
+ var _a, _b;
27
+ (_a = this.unChangeHandle) === null || _a === void 0 ? void 0 : _a.call(this);
28
+ (_b = this.unAppStoreChange) === null || _b === void 0 ? void 0 : _b.call(this);
29
+ }
30
+ render() {
31
+ const { config } = this.props;
32
+ const { currentRoute, renderOptions } = this.state;
33
+ return (<div data-route={currentRoute} className={clsx(styles.wrapper, {
34
+ [styles.hidden]: !renderOptions.tabBarVisible && !renderOptions.tabBarAnimation,
35
+ [styles.showIn]: renderOptions.tabBarVisible && renderOptions.tabBarAnimation,
36
+ [styles.hideOut]: !renderOptions.tabBarVisible && renderOptions.tabBarAnimation,
37
+ })}>
38
+ <div className={styles.tabBar}>
39
+ {config.list.map((item, index) => {
40
+ const fullRoute = item.route;
41
+ const isActive = currentRoute === fullRoute;
42
+ // console.log('>>>>>>>> currentRoute: %s, item: %s', currentRoute, item.route)
43
+ return (<div data-full-route={fullRoute} key={item.pagePath + index} className={styles.item} onClick={() => {
44
+ router.push(item.route);
45
+ }}>
46
+ {item.icon && (<img className={styles.icon} src={`${withPublicPath(isActive ? item.activeIcon : item.icon)}`}/>)}
47
+ <span className={styles.text} style={{ color: isActive ? config.selectedColor : config.textColor }}>
48
+ {item.text}
49
+ </span>
50
+ </div>);
51
+ })}
52
+ </div>
53
+ </div>);
54
+ }
55
+ }
@@ -1,3 +1,4 @@
1
- import { responsive } from './responsive'; // 响应式设计 rem 单位
1
+ import { responsive } from './responsive';
2
2
 
3
+ // 响应式设计 rem 单位
3
4
  responsive();
@@ -1,19 +1,17 @@
1
- import "core-js/modules/es.parse-float.js";
2
- var htmlRoot = document.querySelector('html');
1
+ const htmlRoot = document.querySelector('html');
3
2
  export function responsive() {
4
3
  function setRem() {
5
- var clientWidth = htmlRoot.clientWidth; // clientWidth = Math.min(clientWidth, 640); // PC 模式下限定最大值
6
-
4
+ let clientWidth = htmlRoot.clientWidth;
5
+ // clientWidth = Math.min(clientWidth, 640); // PC 模式下限定最大值
7
6
  htmlRoot.style.fontSize = "".concat(clientWidth / 7.5, "px");
8
- var div = document.createElement('div');
7
+ const div = document.createElement('div');
9
8
  div.style.width = '7.5rem';
10
9
  document.body.appendChild(div);
11
10
  htmlRoot.style.fontSize = "".concat(parseFloat(htmlRoot.style.fontSize) * clientWidth / div.clientWidth, "px");
12
11
  document.body.removeChild(div);
13
12
  document.body.style.fontSize = "16px";
14
13
  }
15
-
16
- var b = null;
14
+ let b = null;
17
15
  window.addEventListener('resize', function () {
18
16
  clearTimeout(b);
19
17
  b = setTimeout(setRem, 100);
@@ -1,23 +1,20 @@
1
- import "core-js/modules/es.object.assign.js";
2
1
  import { Emitter } from '@ray-js/framework-shared';
3
- export var appStoreEmitter = new Emitter();
4
- export var renderOptions = {
2
+ export const appStoreEmitter = new Emitter();
3
+ export const renderOptions = {
5
4
  tabBarVisible: true,
6
5
  tabBarAnimation: false
7
6
  };
8
- export var actions = {
7
+ export const actions = {
9
8
  toggleTabBar: 'toggleTabBar',
10
9
  onChange: 'onChange'
11
10
  };
12
- export var events = {
11
+ export const events = {
13
12
  tabBarChange: 'tabBarChange'
14
13
  };
15
-
16
- var update = function (eventName, nextState) {
14
+ const update = (eventName, nextState) => {
17
15
  Object.assign(renderOptions, nextState);
18
16
  appStoreEmitter.emit(eventName, renderOptions);
19
17
  };
20
-
21
18
  appStoreEmitter.on(actions.toggleTabBar, function (next) {
22
19
  if (next.visible !== renderOptions.tabBarVisible) update(events.tabBarChange, {
23
20
  tabBarVisible: next.visible,
@@ -1,14 +1,9 @@
1
- import "core-js/modules/es.regexp.exec.js";
2
- import "core-js/modules/es.regexp.test.js";
3
1
  import slash from 'slash';
4
2
  export function normalizeBasename(p) {
5
3
  var _p;
6
-
7
4
  p = slash((_p = p) !== null && _p !== void 0 ? _p : '/');
8
-
9
5
  if (!/^\//.test(p)) {
10
6
  p = '/' + p;
11
7
  }
12
-
13
8
  return p;
14
9
  }
@@ -1,4 +1,3 @@
1
- import "core-js/modules/es.regexp.exec.js";
2
1
  import "core-js/modules/es.string.replace.js";
3
2
  export function withPublicPath(basePath) {
4
3
  return PUBLIC_PATH + basePath.replace(/^\//, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/framework",
3
- "version": "1.4.0-alpha.3",
3
+ "version": "1.4.0-alpha.5",
4
4
  "description": "Ray Core",
5
5
  "keywords": [
6
6
  "ray"
@@ -20,22 +20,22 @@
20
20
  "watch": "tsc -p ./tsconfig.build.json --module esnext --outDir lib --watch"
21
21
  },
22
22
  "dependencies": {
23
- "@ray-js/framework-mp": "^1.4.0-alpha.3",
24
- "@ray-js/framework-shared": "^1.4.0-alpha.3",
25
- "@ray-js/library": "^1.4.0-alpha.3",
26
- "@ray-js/location": "^1.4.0-alpha.3",
27
- "@ray-js/router": "^1.4.0-alpha.3",
28
- "@ray-js/runtime": "^1.4.0-alpha.3",
29
- "clsx": "^1.1.1",
23
+ "@ray-js/framework-mp": "^1.4.0-alpha.5",
24
+ "@ray-js/framework-shared": "^1.4.0-alpha.5",
25
+ "@ray-js/library": "^1.4.0-alpha.5",
26
+ "@ray-js/location": "^1.4.0-alpha.5",
27
+ "@ray-js/router": "^1.4.0-alpha.5",
28
+ "@ray-js/runtime": "^1.4.0-alpha.5",
29
+ "clsx": "^1.2.1",
30
30
  "hoist-non-react-statics": "^3.3.2",
31
31
  "lodash.get": "^4.4.2",
32
32
  "lodash.set": "^4.3.2",
33
- "slash": "^5.0.0",
34
- "tiny-invariant": "^1.1.0"
33
+ "slash": "^5.1.0",
34
+ "tiny-invariant": "^1.3.1"
35
35
  },
36
36
  "devDependencies": {
37
- "@ray-js/cli": "^1.4.0-alpha.3",
38
- "@ray-js/types": "^1.4.0-alpha.3"
37
+ "@ray-js/cli": "^1.4.0-alpha.5",
38
+ "@ray-js/types": "^1.4.0-alpha.5"
39
39
  },
40
40
  "maintainers": [
41
41
  {
@@ -43,6 +43,6 @@
43
43
  "email": "tuyafe@tuya.com"
44
44
  }
45
45
  ],
46
- "gitHead": "438a6262377009a49dd569adab1079542e4e857a",
46
+ "gitHead": "14cb935df10f020e714b44bb41d4899646db751c",
47
47
  "repository": {}
48
48
  }
package/LICENSE.md DELETED
@@ -1,9 +0,0 @@
1
- Copyright © 2014-2022 Tuya.inc
2
-
3
- MIT License
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.