@ray-js/runtime 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.
- package/lib/PageInstance.js +1 -0
- package/lib/index.js +5 -5
- package/lib/lifecycle.js +1 -0
- package/lib/withPageLifecycle/index.js +19 -14
- package/package.json +4 -4
package/lib/PageInstance.js
CHANGED
package/lib/index.js
CHANGED
|
@@ -7,15 +7,15 @@ export { useAppEvent } from './useAppEvent';
|
|
|
7
7
|
export { usePageEvent } from './usePageEvent';
|
|
8
8
|
export { withPageLifecycle } from './withPageLifecycle';
|
|
9
9
|
export { getCurrent } from './current';
|
|
10
|
-
export const useNativeEffect = () => console.warn(
|
|
10
|
+
export const useNativeEffect = () => console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u94A9\u5B50 'useNativeEffect'");
|
|
11
11
|
export const useQuery = () => {
|
|
12
|
-
console.warn(
|
|
12
|
+
console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u94A9\u5B50 'useQuery'");
|
|
13
13
|
return null;
|
|
14
14
|
};
|
|
15
|
-
export const usePageInstance = () => console.warn(
|
|
16
|
-
export const useComponentInstance = () => console.warn(
|
|
15
|
+
export const usePageInstance = () => console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u94A9\u5B50 'usePageInstance'");
|
|
16
|
+
export const useComponentInstance = () => console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u94A9\u5B50 'useComponentInstance'");
|
|
17
17
|
export const createPortal = runtime.createPortal;
|
|
18
18
|
export const useModal = () => {
|
|
19
|
-
console.warn(
|
|
19
|
+
console.warn("// TODO \u6682\u672A\u5B9E\u73B0\u94A9\u5B50 'useModal'");
|
|
20
20
|
return undefined;
|
|
21
21
|
};
|
package/lib/lifecycle.js
CHANGED
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
3
4
|
const _excluded = ["forwardedRef"];
|
|
4
5
|
import "core-js/modules/esnext.iterator.constructor.js";
|
|
5
6
|
import "core-js/modules/esnext.iterator.for-each.js";
|
|
7
|
+
import "core-js/modules/web.dom-collections.iterator.js";
|
|
6
8
|
import React from 'react';
|
|
7
9
|
import { pageLifecycles } from '@ray-js/types';
|
|
8
10
|
import { PageInstanceContext } from '../PageInstanceContext';
|
|
9
11
|
|
|
10
12
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
11
13
|
export function withPageLifecycle(Component) {
|
|
12
|
-
const displayName =
|
|
14
|
+
const displayName = "WithPageLifecycle(".concat(Component.displayName || Component.name, ")");
|
|
13
15
|
class WithPageLifeCycle extends React.Component {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (forwardedRef) {
|
|
21
|
-
if (typeof forwardedRef === 'function') {
|
|
22
|
-
forwardedRef(ref);
|
|
23
|
-
} else if (typeof forwardedRef === 'object') {
|
|
24
|
-
forwardedRef.current = ref;
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
_defineProperty(this, "refHandle", ref => {
|
|
19
|
+
const forwardedRef = this.props.forwardedRef;
|
|
20
|
+
if (ref) {
|
|
21
|
+
this.additionToLifecycle(ref);
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
if (forwardedRef) {
|
|
24
|
+
if (typeof forwardedRef === 'function') {
|
|
25
|
+
forwardedRef(ref);
|
|
26
|
+
} else if (typeof forwardedRef === 'object') {
|
|
27
|
+
forwardedRef.current = ref;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
28
32
|
render() {
|
|
29
33
|
const _this$props = this.props,
|
|
30
34
|
{
|
|
@@ -52,6 +56,7 @@ export function withPageLifecycle(Component) {
|
|
|
52
56
|
});
|
|
53
57
|
}
|
|
54
58
|
}
|
|
59
|
+
_defineProperty(WithPageLifeCycle, "displayName", displayName);
|
|
55
60
|
const forwardRef = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
56
61
|
return /*#__PURE__*/React.createElement(WithPageLifeCycle, _extends({}, props, {
|
|
57
62
|
forwardedRef: ref
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/runtime",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.55",
|
|
4
4
|
"description": "Ray cross runtime",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ray"
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"@ray-core/runtime": "^0.4.9"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ray-js/cli": "1.7.
|
|
31
|
-
"@ray-js/types": "1.7.
|
|
30
|
+
"@ray-js/cli": "1.7.55",
|
|
31
|
+
"@ray-js/types": "1.7.55",
|
|
32
32
|
"typescript": "^5.8.3"
|
|
33
33
|
},
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public",
|
|
36
36
|
"registry": "https://registry.npmjs.org"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "99c603c95b6dc57833bd51784cf28c93a4d36b96"
|
|
39
39
|
}
|