@blocklet/ui-react 2.9.27 → 2.9.29

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,49 +1,7 @@
1
- export default ComponentInstaller;
2
- declare function ComponentInstaller({ warnIcon, did, noPermissionMute, onInstalled, onError, children, closeByOutSize, onClose, fallback, disabled, roles, }: {
3
- warnIcon: any;
4
- did: any;
5
- noPermissionMute: any;
6
- onInstalled: any;
7
- onError: any;
8
- children: any;
9
- closeByOutSize: any;
10
- onClose: any;
11
- fallback: any;
12
- disabled: any;
13
- roles?: string[] | undefined;
14
- }): any;
15
- declare namespace ComponentInstaller {
1
+ declare function WrapComponentInstaller(props: any): any;
2
+ declare namespace WrapComponentInstaller {
16
3
  namespace propTypes {
17
- let disabled: any;
18
- let warnIcon: any;
19
- let did: any;
20
- let noPermissionMute: any;
21
- let onInstalled: any;
22
- let onError: any;
23
4
  let children: any;
24
- let closeByOutSize: any;
25
- let onClose: any;
26
- let fallback: any;
27
- let roles: any;
28
- }
29
- namespace defaultProps {
30
- let disabled_1: boolean;
31
- export { disabled_1 as disabled };
32
- let warnIcon_1: null;
33
- export { warnIcon_1 as warnIcon };
34
- let noPermissionMute_1: boolean;
35
- export { noPermissionMute_1 as noPermissionMute };
36
- let onInstalled_1: null;
37
- export { onInstalled_1 as onInstalled };
38
- let onError_1: null;
39
- export { onError_1 as onError };
40
- let closeByOutSize_1: boolean;
41
- export { closeByOutSize_1 as closeByOutSize };
42
- let onClose_1: null;
43
- export { onClose_1 as onClose };
44
- let fallback_1: null;
45
- export { fallback_1 as fallback };
46
- let roles_1: string[];
47
- export { roles_1 as roles };
48
5
  }
49
6
  }
7
+ export default WrapComponentInstaller;
@@ -301,4 +301,12 @@ ComponentInstaller.defaultProps = {
301
301
  fallback: null,
302
302
  roles: ["owner", "admin"]
303
303
  };
304
- export default ComponentInstaller;
304
+ export default function WrapComponentInstaller(props) {
305
+ if (window.blocklet) {
306
+ return /* @__PURE__ */ jsx(ComponentInstaller, { ...props });
307
+ }
308
+ return props.children;
309
+ }
310
+ WrapComponentInstaller.propTypes = {
311
+ children: PropTypes.any.isRequired
312
+ };
@@ -1,49 +1,7 @@
1
- export default ComponentInstaller;
2
- declare function ComponentInstaller({ warnIcon, did, noPermissionMute, onInstalled, onError, children, closeByOutSize, onClose, fallback, disabled, roles, }: {
3
- warnIcon: any;
4
- did: any;
5
- noPermissionMute: any;
6
- onInstalled: any;
7
- onError: any;
8
- children: any;
9
- closeByOutSize: any;
10
- onClose: any;
11
- fallback: any;
12
- disabled: any;
13
- roles?: string[] | undefined;
14
- }): any;
15
- declare namespace ComponentInstaller {
1
+ declare function WrapComponentInstaller(props: any): any;
2
+ declare namespace WrapComponentInstaller {
16
3
  namespace propTypes {
17
- let disabled: any;
18
- let warnIcon: any;
19
- let did: any;
20
- let noPermissionMute: any;
21
- let onInstalled: any;
22
- let onError: any;
23
4
  let children: any;
24
- let closeByOutSize: any;
25
- let onClose: any;
26
- let fallback: any;
27
- let roles: any;
28
- }
29
- namespace defaultProps {
30
- let disabled_1: boolean;
31
- export { disabled_1 as disabled };
32
- let warnIcon_1: null;
33
- export { warnIcon_1 as warnIcon };
34
- let noPermissionMute_1: boolean;
35
- export { noPermissionMute_1 as noPermissionMute };
36
- let onInstalled_1: null;
37
- export { onInstalled_1 as onInstalled };
38
- let onError_1: null;
39
- export { onError_1 as onError };
40
- let closeByOutSize_1: boolean;
41
- export { closeByOutSize_1 as closeByOutSize };
42
- let onClose_1: null;
43
- export { onClose_1 as onClose };
44
- let fallback_1: null;
45
- export { fallback_1 as fallback };
46
- let roles_1: string[];
47
- export { roles_1 as roles };
48
5
  }
49
6
  }
7
+ export default WrapComponentInstaller;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
6
+ module.exports = WrapComponentInstaller;
7
7
  var _jsxRuntime = require("react/jsx-runtime");
8
8
  var _material = require("@mui/material");
9
9
  var _react = require("@iconify/react");
@@ -384,4 +384,14 @@ ComponentInstaller.defaultProps = {
384
384
  fallback: null,
385
385
  roles: ["owner", "admin"]
386
386
  };
387
- module.exports = ComponentInstaller;
387
+ function WrapComponentInstaller(props) {
388
+ if (window.blocklet) {
389
+ return /* @__PURE__ */(0, _jsxRuntime.jsx)(ComponentInstaller, {
390
+ ...props
391
+ });
392
+ }
393
+ return props.children;
394
+ }
395
+ WrapComponentInstaller.propTypes = {
396
+ children: _propTypes.default.any.isRequired
397
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.9.27",
3
+ "version": "2.9.29",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -62,10 +62,10 @@
62
62
  }
63
63
  },
64
64
  "dependencies": {
65
- "@abtnode/constant": "1.16.23-beta-c9c4e08e",
66
- "@arcblock/did-connect": "^2.9.27",
67
- "@arcblock/ux": "^2.9.27",
68
- "@blocklet/js-sdk": "1.16.23-beta-c9c4e08e",
65
+ "@abtnode/constant": "1.16.23",
66
+ "@arcblock/did-connect": "^2.9.29",
67
+ "@arcblock/ux": "^2.9.29",
68
+ "@blocklet/js-sdk": "1.16.23",
69
69
  "@emotion/react": "^11.10.4",
70
70
  "@emotion/styled": "^11.10.4",
71
71
  "@iconify-icons/material-symbols": "^1.2.58",
@@ -99,5 +99,5 @@
99
99
  "jest": "^28.1.3",
100
100
  "unbuild": "^2.0.0"
101
101
  },
102
- "gitHead": "136c191575887728058a066851b0c8b6c72a9a57"
102
+ "gitHead": "fff3168d6a3c902a39818dfa8eb42544b88225e9"
103
103
  }
@@ -309,4 +309,14 @@ ComponentInstaller.defaultProps = {
309
309
  roles: ['owner', 'admin'],
310
310
  };
311
311
 
312
- export default ComponentInstaller;
312
+ export default function WrapComponentInstaller(props) {
313
+ if (window.blocklet) {
314
+ return <ComponentInstaller {...props} />;
315
+ }
316
+
317
+ return props.children;
318
+ }
319
+
320
+ WrapComponentInstaller.propTypes = {
321
+ children: PropTypes.any.isRequired,
322
+ };