@abtnode/ux 1.16.23-beta-035db744 → 1.16.23-beta-2229bcee
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.
|
@@ -15,7 +15,7 @@ import CheckIcon from '@mui/icons-material/Check';
|
|
|
15
15
|
import useMediaQuery from '@mui/material/useMediaQuery';
|
|
16
16
|
import styled from '@emotion/styled';
|
|
17
17
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
18
|
-
import { BLOCKLET_CONFIGURABLE_KEY, BlockletStatus, BlockletEvents } from '@blocklet/constant';
|
|
18
|
+
import { BLOCKLET_CONFIGURABLE_KEY, BlockletStatus, BlockletEvents, BLOCKLET_APP_SPACE_REQUIREMENT } from '@blocklet/constant';
|
|
19
19
|
import Layout from '@blocklet/launcher-layout';
|
|
20
20
|
import { StepProvider, useStepContext } from '@blocklet/launcher-layout/lib/context/step';
|
|
21
21
|
import Box from '@mui/material/Box';
|
|
@@ -44,8 +44,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
44
44
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
45
45
|
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
46
46
|
const requirePurchase = meta => meta.inStore && isFreeBlocklet(meta) === false;
|
|
47
|
-
const
|
|
48
|
-
return meta?.capabilities?.didSpace;
|
|
47
|
+
const isRequiredOnSetup = meta => {
|
|
48
|
+
return [BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED, BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(meta?.capabilities?.didSpace);
|
|
49
49
|
};
|
|
50
50
|
/**
|
|
51
51
|
* @description
|
|
@@ -195,7 +195,7 @@ export default function AddComponentCore({
|
|
|
195
195
|
hasEnvironmentsStep: false,
|
|
196
196
|
hasRequiredEnvironments: false,
|
|
197
197
|
requirePurchase: false,
|
|
198
|
-
|
|
198
|
+
didSpaceIsRequiredSetup: null,
|
|
199
199
|
installResultProps: {},
|
|
200
200
|
purchaseResultProps: {},
|
|
201
201
|
showFromUrlDialog: false
|
|
@@ -644,7 +644,7 @@ export default function AddComponentCore({
|
|
|
644
644
|
|
|
645
645
|
// eslint-disable-next-line no-shadow
|
|
646
646
|
const componentRequirePurchase = requirePurchase(component.current.meta);
|
|
647
|
-
const
|
|
647
|
+
const componentDidSpaceIsRequiredSetup = isRequiredOnSetup(component.current.meta);
|
|
648
648
|
const didSpaceEndpoint = getDIDSpaceEndpoint(blocklet);
|
|
649
649
|
updateParams({
|
|
650
650
|
bundleDid,
|
|
@@ -652,7 +652,7 @@ export default function AddComponentCore({
|
|
|
652
652
|
...doc,
|
|
653
653
|
hasRequiredEnvironments: hasRequiredEnvironments(component.current.meta),
|
|
654
654
|
requirePurchase: componentRequirePurchase,
|
|
655
|
-
|
|
655
|
+
didSpaceIsRequiredSetup: componentDidSpaceIsRequiredSetup,
|
|
656
656
|
didSpaceEndpoint
|
|
657
657
|
});
|
|
658
658
|
if (isInit && componentRequirePurchase) {
|
|
@@ -976,12 +976,12 @@ export default function AddComponentCore({
|
|
|
976
976
|
confirm: t('common.next'),
|
|
977
977
|
onCancel,
|
|
978
978
|
onConfirm: onNext
|
|
979
|
-
}, meta && !alreadyInstalled(meta.did) && params?.
|
|
979
|
+
}, meta && !alreadyInstalled(meta.did) && params?.didSpaceIsRequiredSetup && {
|
|
980
980
|
key: 'didSpace',
|
|
981
981
|
name: /*#__PURE__*/_jsxs(_Fragment, {
|
|
982
|
-
children: [t('blocklet.component.didSpaceConfig'), " ", params.
|
|
982
|
+
children: [t('blocklet.component.didSpaceConfig'), " ", params.didSpaceIsRequiredSetup === 'required' && /*#__PURE__*/_jsx(Required, {})]
|
|
983
983
|
}),
|
|
984
|
-
disabled: params
|
|
984
|
+
disabled: params?.didSpaceIsRequiredSetup && !params.didSpaceEndpoint,
|
|
985
985
|
body: () => {
|
|
986
986
|
return /*#__PURE__*/_jsx(ConfigSpaceProvider, {
|
|
987
987
|
children: /*#__PURE__*/_jsxs(TypographyWrapper, {
|
|
@@ -59,9 +59,9 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
59
59
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
60
60
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable react/no-unstable-nested-components */
|
|
61
61
|
const requirePurchase = meta => meta.inStore && (0, _util.isFreeBlocklet)(meta) === false;
|
|
62
|
-
const
|
|
62
|
+
const isRequiredOnSetup = meta => {
|
|
63
63
|
var _meta$capabilities;
|
|
64
|
-
return meta === null || meta === void 0 ? void 0 : (_meta$capabilities = meta.capabilities) === null || _meta$capabilities === void 0 ? void 0 : _meta$capabilities.didSpace;
|
|
64
|
+
return [_constant.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED, _constant.BLOCKLET_APP_SPACE_REQUIREMENT.REQUIRED_ON_SETUP].includes(meta === null || meta === void 0 ? void 0 : (_meta$capabilities = meta.capabilities) === null || _meta$capabilities === void 0 ? void 0 : _meta$capabilities.didSpace);
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
67
|
* @description
|
|
@@ -216,7 +216,7 @@ function AddComponentCore(_ref3) {
|
|
|
216
216
|
hasEnvironmentsStep: false,
|
|
217
217
|
hasRequiredEnvironments: false,
|
|
218
218
|
requirePurchase: false,
|
|
219
|
-
|
|
219
|
+
didSpaceIsRequiredSetup: null,
|
|
220
220
|
installResultProps: {},
|
|
221
221
|
purchaseResultProps: {},
|
|
222
222
|
showFromUrlDialog: false
|
|
@@ -654,7 +654,7 @@ function AddComponentCore(_ref3) {
|
|
|
654
654
|
|
|
655
655
|
// eslint-disable-next-line no-shadow
|
|
656
656
|
const componentRequirePurchase = requirePurchase(component.current.meta);
|
|
657
|
-
const
|
|
657
|
+
const componentDidSpaceIsRequiredSetup = isRequiredOnSetup(component.current.meta);
|
|
658
658
|
const didSpaceEndpoint = getDIDSpaceEndpoint(blocklet);
|
|
659
659
|
updateParams(_objectSpread(_objectSpread({
|
|
660
660
|
bundleDid,
|
|
@@ -662,7 +662,7 @@ function AddComponentCore(_ref3) {
|
|
|
662
662
|
}, doc), {}, {
|
|
663
663
|
hasRequiredEnvironments: hasRequiredEnvironments(component.current.meta),
|
|
664
664
|
requirePurchase: componentRequirePurchase,
|
|
665
|
-
|
|
665
|
+
didSpaceIsRequiredSetup: componentDidSpaceIsRequiredSetup,
|
|
666
666
|
didSpaceEndpoint
|
|
667
667
|
}));
|
|
668
668
|
if (isInit && componentRequirePurchase) {
|
|
@@ -987,12 +987,12 @@ function AddComponentCore(_ref3) {
|
|
|
987
987
|
confirm: t('common.next'),
|
|
988
988
|
onCancel: _onCancel,
|
|
989
989
|
onConfirm: _onNext
|
|
990
|
-
}, meta && !alreadyInstalled(meta.did) && (params === null || params === void 0 ? void 0 : params.
|
|
990
|
+
}, meta && !alreadyInstalled(meta.did) && (params === null || params === void 0 ? void 0 : params.didSpaceIsRequiredSetup) && {
|
|
991
991
|
key: 'didSpace',
|
|
992
992
|
name: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
993
|
-
children: [t('blocklet.component.didSpaceConfig'), " ", params.
|
|
993
|
+
children: [t('blocklet.component.didSpaceConfig'), " ", params.didSpaceIsRequiredSetup === 'required' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_required.default, {})]
|
|
994
994
|
}),
|
|
995
|
-
disabled: params
|
|
995
|
+
disabled: (params === null || params === void 0 ? void 0 : params.didSpaceIsRequiredSetup) && !params.didSpaceEndpoint,
|
|
996
996
|
body: () => {
|
|
997
997
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_configSpace.ConfigSpaceProvider, {
|
|
998
998
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(TypographyWrapper, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abtnode/ux",
|
|
3
|
-
"version": "1.16.23-beta-
|
|
3
|
+
"version": "1.16.23-beta-2229bcee",
|
|
4
4
|
"description": "UX components shared across abtnode packages",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
30
30
|
"license": "Apache-2.0",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@abtnode/auth": "1.16.23-beta-
|
|
33
|
-
"@abtnode/constant": "1.16.23-beta-
|
|
34
|
-
"@abtnode/util": "1.16.23-beta-
|
|
32
|
+
"@abtnode/auth": "1.16.23-beta-2229bcee",
|
|
33
|
+
"@abtnode/constant": "1.16.23-beta-2229bcee",
|
|
34
|
+
"@abtnode/util": "1.16.23-beta-2229bcee",
|
|
35
35
|
"@ahooksjs/use-url-state": "^3.5.1",
|
|
36
36
|
"@arcblock/did": "^1.18.110",
|
|
37
37
|
"@arcblock/did-connect": "^2.9.24",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"@arcblock/react-hooks": "^2.9.24",
|
|
42
42
|
"@arcblock/terminal": "^2.9.24",
|
|
43
43
|
"@arcblock/ux": "^2.9.24",
|
|
44
|
-
"@blocklet/constant": "1.16.23-beta-
|
|
44
|
+
"@blocklet/constant": "1.16.23-beta-2229bcee",
|
|
45
45
|
"@blocklet/launcher-layout": "2.2.51",
|
|
46
46
|
"@blocklet/list": "^0.12.69",
|
|
47
|
-
"@blocklet/meta": "1.16.23-beta-
|
|
47
|
+
"@blocklet/meta": "1.16.23-beta-2229bcee",
|
|
48
48
|
"@blocklet/ui-react": "^2.9.24",
|
|
49
49
|
"@blocklet/uploader": "^0.0.69",
|
|
50
50
|
"@emotion/react": "^11.10.4",
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"jest": "^29.7.0",
|
|
108
108
|
"jest-environment-jsdom": "^29.7.0"
|
|
109
109
|
},
|
|
110
|
-
"gitHead": "
|
|
110
|
+
"gitHead": "f42242b4cc87ba11ba1d18ec09df7b024520e9d0",
|
|
111
111
|
"exports": {
|
|
112
112
|
".": {
|
|
113
113
|
"import": "./es/index.js",
|