@ray-js/components 1.3.0-beta.2-beta-2 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export default function Modal({ children }: React.PropsWithChildren<Record<string, any>>): any;
@@ -0,0 +1,6 @@
1
+ import { usePageInstance, createPortal } from '@ray-js/runtime';
2
+ export default function Modal(_ref) {
3
+ var children = _ref.children;
4
+ var inst = usePageInstance();
5
+ return createPortal(children, inst.modalContainer);
6
+ }
@@ -0,0 +1,2 @@
1
+ import * as React from 'react';
2
+ export default function Modal({ children }: React.PropsWithChildren<Record<string, any>>): React.ReactPortal;
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import ReactDOM from 'react-dom';
3
+ export default function Modal(_ref) {
4
+ var children = _ref.children;
5
+ var domNode = React.useRef(document.createElement('div'));
6
+ React.useEffect(function () {
7
+ document.body.appendChild(domNode.current);
8
+ return function () {
9
+ document.body.removeChild(domNode.current);
10
+ };
11
+ }, []);
12
+ return /*#__PURE__*/ReactDOM.createPortal(children, domNode.current);
13
+ }
package/lib/index.d.ts CHANGED
@@ -31,3 +31,4 @@ export { default as Map } from './Map';
31
31
  export { default as Camera } from './Camera';
32
32
  export { default as Progress } from './Progress';
33
33
  export { default as Iframe } from './Iframe';
34
+ export { default as Modal } from './Modal';
package/lib/index.js CHANGED
@@ -30,4 +30,5 @@ export { default as WebView } from './WebView';
30
30
  export { default as Map } from './Map';
31
31
  export { default as Camera } from './Camera';
32
32
  export { default as Progress } from './Progress';
33
- export { default as Iframe } from './Iframe';
33
+ export { default as Iframe } from './Iframe';
34
+ export { default as Modal } from './Modal';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ray-js/components",
3
- "version": "1.3.0-beta.2-beta-2",
3
+ "version": "1.3.0",
4
4
  "description": "Ray basic components",
5
5
  "keywords": [
6
6
  "ray"
@@ -24,10 +24,10 @@
24
24
  "watch": "ray start --type=component"
25
25
  },
26
26
  "dependencies": {
27
- "@ray-core/macro": "^0.2.6",
28
- "@ray-core/wechat": "^0.2.6",
29
- "@ray-js/adapter": "^1.3.0-beta.2-beta-2",
30
- "@ray-js/framework-shared": "^1.3.0-beta.2-beta-2",
27
+ "@ray-core/macro": "^0.3.0",
28
+ "@ray-core/wechat": "^0.3.0",
29
+ "@ray-js/adapter": "^1.3.0",
30
+ "@ray-js/framework-shared": "^1.3.0",
31
31
  "ahooks": "^3.7.1",
32
32
  "clsx": "^1.1.1",
33
33
  "core-js": "^3.19.1",
@@ -37,7 +37,7 @@
37
37
  "style-to-object": "^0.3.0"
38
38
  },
39
39
  "devDependencies": {
40
- "@ray-js/cli": "^1.3.0-beta.2-beta-2"
40
+ "@ray-js/cli": "^1.3.0"
41
41
  },
42
42
  "maintainers": [
43
43
  {
@@ -45,6 +45,6 @@
45
45
  "email": "tuyafe@tuya.com"
46
46
  }
47
47
  ],
48
- "gitHead": "067ce2e382196cd995ebc4774fc5e977ac21115c",
48
+ "gitHead": "f7f96c375a429a2fa94452b0a9af3f841572921a",
49
49
  "repository": {}
50
50
  }