@ray-js/framework 1.7.53 → 1.7.55

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.
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import '../../runtime';
2
3
  import React from 'react';
3
4
  import { createRouter } from '@ray-js/router';
@@ -12,6 +13,13 @@ const isClassComponent = Component => {
12
13
  export class Application extends React.Component {
13
14
  constructor(props) {
14
15
  super(props);
16
+ _defineProperty(this, "getGlobalConfig", (path, defaultValue) => {
17
+ const {
18
+ globalConfig = {}
19
+ } = this.props;
20
+ const value = get(globalConfig, path, defaultValue);
21
+ return value;
22
+ });
15
23
  this.state = {};
16
24
  const title = this.getGlobalConfig(['window', 'navigationBarTitleText'], 'Ray App');
17
25
  document.title = title;
@@ -38,13 +46,6 @@ export class Application extends React.Component {
38
46
  }
39
47
  });
40
48
  }
41
- getGlobalConfig = (path, defaultValue) => {
42
- const {
43
- globalConfig = {}
44
- } = this.props;
45
- const value = get(globalConfig, path, defaultValue);
46
- return value;
47
- };
48
49
  render() {
49
50
  const {
50
51
  app: App,
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import "core-js/modules/esnext.iterator.constructor.js";
2
3
  import "core-js/modules/esnext.iterator.for-each.js";
3
4
  import React from 'react';
@@ -6,9 +7,51 @@ import { pageLifecycles } from '@ray-js/types';
6
7
  import { get } from '../../utils';
7
8
  import './index.module.less';
8
9
  export class PageWrapper extends React.Component {
9
- $reachBottomDistance = 50;
10
10
  constructor(props) {
11
11
  super(props);
12
+ _defineProperty(this, "$reachBottomDistance", 50);
13
+ _defineProperty(this, "handlePageResize", () => {
14
+ const windowWidth = document.documentElement.clientWidth;
15
+ const windowHeight = document.documentElement.clientHeight;
16
+ lifecycle.emit({
17
+ uniqueId: this.$instance.uniqueId,
18
+ name: pageLifecycles.onResize,
19
+ args: {
20
+ windowWidth,
21
+ windowHeight
22
+ }
23
+ });
24
+ });
25
+ _defineProperty(this, "handlePageScroll", () => {
26
+ const event = {
27
+ scrollTop: window.scrollY
28
+ };
29
+ lifecycle.emit({
30
+ uniqueId: this.$instance.uniqueId,
31
+ name: pageLifecycles.onPageScroll,
32
+ args: event
33
+ });
34
+ this.checkReachBottom();
35
+ });
36
+ _defineProperty(this, "checkReachBottom", () => {
37
+ const isCurrentReachBottom = document.body.scrollHeight - (window.innerHeight + window.scrollY) <= this.$reachBottomDistance;
38
+ if (!this.$isReachBottom && isCurrentReachBottom) {
39
+ this.$isReachBottom = true;
40
+ lifecycle.emit({
41
+ uniqueId: this.$instance.uniqueId,
42
+ name: pageLifecycles.onReachBottom
43
+ });
44
+ return;
45
+ }
46
+ this.$isReachBottom = isCurrentReachBottom;
47
+ });
48
+ _defineProperty(this, "getPageConfig", (field, defaultValue) => {
49
+ const {
50
+ page
51
+ } = this.props;
52
+ const pageConfig = page.config;
53
+ return get(pageConfig, field, defaultValue);
54
+ });
12
55
  this.$instance = new PageInstance();
13
56
  lifecycle.addInstance(this.$instance);
14
57
  this.getGlobalConfig = this.props.getGlobalConfig;
@@ -54,48 +97,6 @@ export class PageWrapper extends React.Component {
54
97
  lifecycle.removeInstance(this.$instance);
55
98
  // TODO: 实现 onPullDownRefresh 生命周期
56
99
  }
57
- handlePageResize = () => {
58
- const windowWidth = document.documentElement.clientWidth;
59
- const windowHeight = document.documentElement.clientHeight;
60
- lifecycle.emit({
61
- uniqueId: this.$instance.uniqueId,
62
- name: pageLifecycles.onResize,
63
- args: {
64
- windowWidth,
65
- windowHeight
66
- }
67
- });
68
- };
69
- handlePageScroll = () => {
70
- const event = {
71
- scrollTop: window.scrollY
72
- };
73
- lifecycle.emit({
74
- uniqueId: this.$instance.uniqueId,
75
- name: pageLifecycles.onPageScroll,
76
- args: event
77
- });
78
- this.checkReachBottom();
79
- };
80
- checkReachBottom = () => {
81
- const isCurrentReachBottom = document.body.scrollHeight - (window.innerHeight + window.scrollY) <= this.$reachBottomDistance;
82
- if (!this.$isReachBottom && isCurrentReachBottom) {
83
- this.$isReachBottom = true;
84
- lifecycle.emit({
85
- uniqueId: this.$instance.uniqueId,
86
- name: pageLifecycles.onReachBottom
87
- });
88
- return;
89
- }
90
- this.$isReachBottom = isCurrentReachBottom;
91
- };
92
- getPageConfig = (field, defaultValue) => {
93
- const {
94
- page
95
- } = this.props;
96
- const pageConfig = page.config;
97
- return get(pageConfig, field, defaultValue);
98
- };
99
100
  render() {
100
101
  const {
101
102
  page,
@@ -1,5 +1,7 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import "core-js/modules/esnext.iterator.constructor.js";
2
3
  import "core-js/modules/esnext.iterator.map.js";
4
+ import "core-js/modules/web.dom-collections.iterator.js";
3
5
  import clsx from 'clsx';
4
6
  import React from 'react';
5
7
  import router from '@ray-js/router';
@@ -7,10 +9,13 @@ import { events, appStoreEmitter, renderOptions } from '../../store/appStore';
7
9
  import { withPublicPath } from '../../utils';
8
10
  import styles from './index.module.less';
9
11
  export class TabBar extends React.Component {
10
- state = (() => ({
11
- currentRoute: router.scheduler.currentRoute,
12
- renderOptions: renderOptions
13
- }))();
12
+ constructor() {
13
+ super(...arguments);
14
+ _defineProperty(this, "state", {
15
+ currentRoute: router.scheduler.currentRoute,
16
+ renderOptions: renderOptions
17
+ });
18
+ }
14
19
  componentDidMount() {
15
20
  this.unChangeHandle = router.scheduler.on('routeChange', route => {
16
21
  this.setState({
@@ -58,7 +63,7 @@ export class TabBar extends React.Component {
58
63
  }
59
64
  }, item.icon && /*#__PURE__*/React.createElement("img", {
60
65
  className: styles.icon,
61
- src: `${withPublicPath(isActive ? item.activeIcon : item.icon)}`
66
+ src: "".concat(withPublicPath(isActive ? item.activeIcon : item.icon))
62
67
  }), /*#__PURE__*/React.createElement("span", {
63
68
  className: styles.text,
64
69
  style: {
@@ -3,13 +3,13 @@ export function responsive() {
3
3
  function setRem() {
4
4
  let clientWidth = htmlRoot.clientWidth;
5
5
  // clientWidth = Math.min(clientWidth, 640); // PC 模式下限定最大值
6
- htmlRoot.style.fontSize = `${clientWidth / 7.5}px`;
6
+ htmlRoot.style.fontSize = "".concat(clientWidth / 7.5, "px");
7
7
  const div = document.createElement('div');
8
8
  div.style.width = '7.5rem';
9
9
  document.body.appendChild(div);
10
- htmlRoot.style.fontSize = `${parseFloat(htmlRoot.style.fontSize) * clientWidth / div.clientWidth}px`;
10
+ htmlRoot.style.fontSize = "".concat(parseFloat(htmlRoot.style.fontSize) * clientWidth / div.clientWidth, "px");
11
11
  document.body.removeChild(div);
12
- document.body.style.fontSize = `16px`;
12
+ document.body.style.fontSize = "16px";
13
13
  }
14
14
  let b = null;
15
15
  window.addEventListener('resize', function () {
@@ -1,3 +1,4 @@
1
+ import "core-js/modules/es.regexp.exec.js";
1
2
  import slash from 'slash';
2
3
  export function normalizeBasename(p) {
3
4
  p = slash(p !== null && p !== void 0 ? p : '/');
@@ -1,3 +1,5 @@
1
+ import "core-js/modules/es.regexp.exec.js";
2
+ import "core-js/modules/es.string.replace.js";
1
3
  export function withPublicPath(basePath) {
2
4
  return PUBLIC_PATH + basePath.replace(/^\//, '');
3
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/framework",
3
- "version": "1.7.53",
3
+ "version": "1.7.55",
4
4
  "description": "Ray Core",
5
5
  "keywords": [
6
6
  "ray"
@@ -23,12 +23,12 @@
23
23
  "watch": "tsc -p ./tsconfig.build.json --module esnext --outDir lib --watch"
24
24
  },
25
25
  "dependencies": {
26
- "@ray-js/framework-mp": "1.7.53",
27
- "@ray-js/framework-shared": "1.7.53",
28
- "@ray-js/library": "1.7.53",
29
- "@ray-js/location": "1.7.53",
30
- "@ray-js/router": "1.7.53",
31
- "@ray-js/runtime": "1.7.53",
26
+ "@ray-js/framework-mp": "1.7.55",
27
+ "@ray-js/framework-shared": "1.7.55",
28
+ "@ray-js/library": "1.7.55",
29
+ "@ray-js/location": "1.7.55",
30
+ "@ray-js/router": "1.7.55",
31
+ "@ray-js/runtime": "1.7.55",
32
32
  "clsx": "^1.2.1",
33
33
  "hoist-non-react-statics": "^3.3.2",
34
34
  "lodash.get": "^4.4.2",
@@ -37,12 +37,12 @@
37
37
  "tiny-invariant": "^1.3.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@ray-js/cli": "1.7.53",
41
- "@ray-js/types": "1.7.53"
40
+ "@ray-js/cli": "1.7.55",
41
+ "@ray-js/types": "1.7.55"
42
42
  },
43
43
  "publishConfig": {
44
44
  "access": "public",
45
45
  "registry": "https://registry.npmjs.org"
46
46
  },
47
- "gitHead": "5a151b15dd84ecf24beccb60450762fd0a0514bc"
47
+ "gitHead": "99c603c95b6dc57833bd51784cf28c93a4d36b96"
48
48
  }