@abtnode/ux 1.16.28-beta-bfbab430 → 1.16.28-beta-641c9f13
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/analytics/traffic.js +4 -10
- package/lib/blocklet/authentication/federated/federated-detail-dialog.js +2 -2
- package/lib/blocklet/blocklet-source.js +2 -2
- package/lib/blocklet/component/add-component/add-component-core.js +2 -2
- package/lib/blocklet/component/did-space/connect-to.js +4 -4
- package/lib/blocklet/component/navigation/navigation-dialog.js +2 -3
- package/lib/blocklet/component/space-connector.js +3 -3
- package/lib/blocklet/component/space-selector.js +2 -2
- package/lib/blocklet/component/store-blocklet-list.js +3 -3
- package/lib/blocklet/logo-uploader.js +2 -2
- package/lib/blocklet/notification/push-kit.js +1 -1
- package/lib/blocklet/preferences/index.js +3 -3
- package/lib/blocklet/publish/create-release/header.js +2 -1
- package/lib/blocklet/publish/create-release/keep-now-resources.js +15 -0
- package/lib/blocklet/publish/create-release/resources.js +4 -3
- package/lib/blocklet/publish/release-list.js +4 -4
- package/lib/blocklet/publish/utils/upload-image-to-project.js +2 -2
- package/lib/blocklet/purchase/component-purchase.js +2 -2
- package/lib/blocklet/storage/connect-to.js +4 -4
- package/lib/blocklet/storage/item.js +3 -3
- package/lib/blocklet/util.js +4 -4
- package/lib/hooks/url-evaluation.js +2 -2
- package/lib/hooks/use-app-logo.js +4 -4
- package/lib/hooks/use-bundle-logo.js +4 -4
- package/lib/invitation/invitation-receive.js +1 -1
- package/lib/locales/ar.js +5 -2
- package/lib/locales/de.js +5 -2
- package/lib/locales/en.js +5 -1
- package/lib/locales/es.js +5 -2
- package/lib/locales/fr.js +5 -2
- package/lib/locales/hi.js +5 -2
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +5 -2
- package/lib/locales/ja.js +5 -2
- package/lib/locales/ko.js +5 -2
- package/lib/locales/pt.js +5 -2
- package/lib/locales/ru.js +5 -2
- package/lib/locales/th.js +5 -2
- package/lib/locales/vi.js +5 -2
- package/lib/locales/zh-tw.js +6 -3
- package/lib/locales/zh.js +10 -3
- package/lib/store/connect-actions.js +2 -2
- package/lib/store/item.js +2 -2
- package/lib/team/members/util.js +3 -3
- package/lib/util/index.js +18 -18
- package/lib/util/join-url-keep-search.js +2 -2
- package/lib/util/spaces.js +4 -2
- package/package.json +19 -20
package/lib/analytics/traffic.js
CHANGED
|
@@ -3,16 +3,10 @@
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import dayjs from '@abtnode/util/lib/dayjs';
|
|
5
5
|
import nthArg from 'lodash/nthArg';
|
|
6
|
-
import
|
|
6
|
+
import { joinURL } from 'ufo';
|
|
7
7
|
import useAsyncRetry from 'react-use/lib/useAsyncRetry';
|
|
8
8
|
import Iframe from 'react-iframe';
|
|
9
|
-
import Alert from '@mui/material
|
|
10
|
-
import Spinner from '@mui/material/CircularProgress';
|
|
11
|
-
import Grid from '@mui/material/Grid';
|
|
12
|
-
import Typography from '@mui/material/Typography';
|
|
13
|
-
import Button from '@mui/material/Button';
|
|
14
|
-
import IconButton from '@mui/material/IconButton';
|
|
15
|
-
import Popover from '@mui/material/Popover';
|
|
9
|
+
import { Alert, CircularProgress, Grid, Typography, Button, IconButton, Popover } from '@mui/material';
|
|
16
10
|
import ViewIcon from '@mui/icons-material/LaunchOutlined';
|
|
17
11
|
import { DateRangePicker } from 'mui-daterange-picker';
|
|
18
12
|
import { DatePicker } from '@mui/x-date-pickers';
|
|
@@ -114,7 +108,7 @@ export default function TrafficInsights({
|
|
|
114
108
|
error
|
|
115
109
|
} = data;
|
|
116
110
|
if (!list.length && loading) {
|
|
117
|
-
return /*#__PURE__*/_jsx(
|
|
111
|
+
return /*#__PURE__*/_jsx(CircularProgress, {});
|
|
118
112
|
}
|
|
119
113
|
if (error) {
|
|
120
114
|
return /*#__PURE__*/_jsx(Alert, {
|
|
@@ -150,7 +144,7 @@ export default function TrafficInsights({
|
|
|
150
144
|
|
|
151
145
|
// eslint-disable-next-line no-nested-ternary
|
|
152
146
|
const pathPrefix = inService ? WELLKNOWN_SERVICE_PATH_PREFIX : process.env.NODE_ENV === 'production' ? info.routing.adminPath : '';
|
|
153
|
-
const breakdownUrl =
|
|
147
|
+
const breakdownUrl = joinURL(window.location.origin, pathPrefix, `/api/analytics/traffic?date=${dayjs(date).format('YYYY-MM-DD')}&did=${did}`);
|
|
154
148
|
const onRangeChange = range => {
|
|
155
149
|
setDateRange(range);
|
|
156
150
|
setAnchorEl(null);
|
|
@@ -11,7 +11,7 @@ import { Address } from '@arcblock/did-connect';
|
|
|
11
11
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
12
12
|
import StarsIcon from '@mui/icons-material/Stars';
|
|
13
13
|
import isUrl from 'is-url';
|
|
14
|
-
import
|
|
14
|
+
import { joinURL } from 'ufo';
|
|
15
15
|
import { useBlockletContext } from '../../../contexts/blocklet';
|
|
16
16
|
import { useNodeContext } from '../../../contexts/node';
|
|
17
17
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
@@ -95,7 +95,7 @@ const FederatedDetailDialog = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
if (['appLogo'].includes(key)) {
|
|
98
|
-
const logoUrl = isUrl(value) ? value :
|
|
98
|
+
const logoUrl = isUrl(value) ? value : joinURL(state.data.appUrl || '', value || '');
|
|
99
99
|
try {
|
|
100
100
|
const logoUrlInstance = new URL(logoUrl);
|
|
101
101
|
logoUrlInstance.searchParams.set('imageFilter', 'resize');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useContext } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { joinURL } from 'ufo';
|
|
4
4
|
import toUpper from 'lodash/toUpper';
|
|
5
5
|
import Tag from '@arcblock/ux/lib/Tag';
|
|
6
6
|
import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
@@ -21,7 +21,7 @@ export default function BlockletSource({
|
|
|
21
21
|
type: "success",
|
|
22
22
|
children: toUpper(sourceInfo.source)
|
|
23
23
|
}, "source"), sourceInfo.source === 'registry' && /*#__PURE__*/_jsx(ExternalLink, {
|
|
24
|
-
href:
|
|
24
|
+
href: joinURL(sourceInfo.deployedFrom, 'blocklets', blocklet?.meta?.bundleDid || ''),
|
|
25
25
|
target: "_blank",
|
|
26
26
|
className: "page-link",
|
|
27
27
|
underline: "hover",
|
|
@@ -7,7 +7,7 @@ import Alert from '@arcblock/ux/lib/Alert';
|
|
|
7
7
|
import AnimationWaiter from '@arcblock/ux/lib/AnimationWaiter';
|
|
8
8
|
import Button from '@arcblock/ux/lib/Button';
|
|
9
9
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
10
|
-
import { BLOCKLET_APP_SPACE_REQUIREMENT, BLOCKLET_CONFIGURABLE_KEY, BlockletEvents,
|
|
10
|
+
import { BLOCKLET_APP_SPACE_REQUIREMENT, BLOCKLET_CONFIGURABLE_KEY, BlockletEvents, BlockletStatus } from '@blocklet/constant';
|
|
11
11
|
import { StepProvider } from '@blocklet/launcher-layout/lib/context/step';
|
|
12
12
|
import ResultMessage from '@blocklet/launcher-layout/lib/launch-result-message';
|
|
13
13
|
import PageHeader from '@blocklet/launcher-layout/lib/page-header';
|
|
@@ -851,7 +851,7 @@ export default function AddComponentCore({
|
|
|
851
851
|
}
|
|
852
852
|
});
|
|
853
853
|
}
|
|
854
|
-
if (hasStartEngine(meta) &&
|
|
854
|
+
if (hasStartEngine(meta) && !alreadyInstalled(meta.did)) {
|
|
855
855
|
steps.push({
|
|
856
856
|
key: 'config',
|
|
857
857
|
name: t('common.config'),
|
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import Button from '@arcblock/ux/lib/Button';
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
6
|
-
import
|
|
6
|
+
import { joinURL } from 'ufo';
|
|
7
7
|
import toast from '@arcblock/ux/lib/Toast';
|
|
8
8
|
import SplitButton from '@arcblock/ux/lib/SplitButton';
|
|
9
9
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
@@ -62,7 +62,7 @@ function ConnectTo({
|
|
|
62
62
|
checkTimeout: 1000 * 300,
|
|
63
63
|
prefix: '/api/did',
|
|
64
64
|
checkFn: axios.create({
|
|
65
|
-
baseURL:
|
|
65
|
+
baseURL: joinURL(window.location.origin, getPathPrefix())
|
|
66
66
|
}).get,
|
|
67
67
|
messages: {
|
|
68
68
|
title: t('storage.spaces.provideNFT.title', {
|
|
@@ -191,10 +191,10 @@ function ConnectTo({
|
|
|
191
191
|
setAuthorizeConnect(preValue => ({
|
|
192
192
|
...preValue,
|
|
193
193
|
open: true,
|
|
194
|
-
prefix:
|
|
194
|
+
prefix: joinURL(didSpacesCoreUrl, 'space/api/did'),
|
|
195
195
|
baseUrl: new URL(didSpacesCoreUrl).origin,
|
|
196
196
|
checkFn: axios.create({
|
|
197
|
-
baseURL:
|
|
197
|
+
baseURL: joinURL(didSpacesCoreUrl, 'space')
|
|
198
198
|
}).get,
|
|
199
199
|
extraParams: {
|
|
200
200
|
appDid: blockletInfo.appDid,
|
|
@@ -23,8 +23,7 @@ import { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRe
|
|
|
23
23
|
import { Controller, useForm } from 'react-hook-form';
|
|
24
24
|
import { Icon, loadIcon } from '@iconify/react';
|
|
25
25
|
import { isMatchSection, checkLink, flattenNavigation } from '@blocklet/meta/lib/parse-navigation-from-blocklet';
|
|
26
|
-
import
|
|
27
|
-
import { withoutTrailingSlash } from 'ufo/dist/index.mjs';
|
|
26
|
+
import { joinURL, withoutTrailingSlash } from 'ufo';
|
|
28
27
|
import isAbsoluteUrl from 'is-absolute-url';
|
|
29
28
|
import { SUPPORTED_LANGUAGES } from '@blocklet/constant';
|
|
30
29
|
import LocaleTabs from './locale-tabs';
|
|
@@ -169,7 +168,7 @@ const NavigationDialog = /*#__PURE__*/forwardRef(function NavigationDialog({
|
|
|
169
168
|
return withoutTrailingSlash(stringLink);
|
|
170
169
|
}
|
|
171
170
|
const selectedLink = isObject(selectedOption.link) ? selectedOption.link[state.locale] : selectedOption.link;
|
|
172
|
-
return withoutTrailingSlash(
|
|
171
|
+
return withoutTrailingSlash(joinURL(stringLink, selectedLink || '/'));
|
|
173
172
|
}
|
|
174
173
|
return null;
|
|
175
174
|
}, [components, state.locale, selectedOption, watchComponent]);
|
|
@@ -4,7 +4,7 @@ import { LocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
|
4
4
|
import { BLOCKLET_CONFIGURABLE_KEY, DID_SPACES } from '@blocklet/constant';
|
|
5
5
|
import axios from 'axios';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
|
-
import
|
|
7
|
+
import { joinURL } from 'ufo';
|
|
8
8
|
import { isEmpty } from 'lodash';
|
|
9
9
|
import Typography from '@mui/material/Typography';
|
|
10
10
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
@@ -118,10 +118,10 @@ const SpaceConnector = /*#__PURE__*/forwardRef(({
|
|
|
118
118
|
...preValue,
|
|
119
119
|
action: 'one-click-authorization',
|
|
120
120
|
checkTimeout: 1000 * 300,
|
|
121
|
-
prefix:
|
|
121
|
+
prefix: joinURL(gatewayUrl, 'space/api/did'),
|
|
122
122
|
baseUrl: new URL(gatewayUrl).origin,
|
|
123
123
|
checkFn: axios.create({
|
|
124
|
-
baseURL:
|
|
124
|
+
baseURL: joinURL(gatewayUrl, 'space')
|
|
125
125
|
}).get,
|
|
126
126
|
extraParams: {
|
|
127
127
|
appDid: blocklet.appDid,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
|
-
import
|
|
4
|
+
import { joinURL } from 'ufo';
|
|
5
5
|
import isUrl from 'is-url';
|
|
6
6
|
import useLocalStorage from 'react-use/lib/useLocalStorage';
|
|
7
7
|
import Button from '@arcblock/ux/lib/Button';
|
|
@@ -40,7 +40,7 @@ function SpaceSelector({
|
|
|
40
40
|
} = useSessionContext();
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
if (gatewayUrl && !gatewayList.find(x => x.value === gatewayUrl)) {
|
|
43
|
-
api.get(
|
|
43
|
+
api.get(joinURL(gatewayUrl, '/__blocklet__.js?type=json')).then(res => {
|
|
44
44
|
// FIXME: @wangshijun handle mountPoint
|
|
45
45
|
setGatewayList([...gatewayList, {
|
|
46
46
|
value: gatewayUrl,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { useEffect, useState } from 'react';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import
|
|
6
|
+
import { joinURL } from 'ufo';
|
|
7
7
|
import Link from '@mui/material/Link';
|
|
8
8
|
import { ErrorFallback } from '@arcblock/ux/lib/ErrorBoundary';
|
|
9
9
|
import { ErrorBoundary } from 'react-error-boundary';
|
|
@@ -20,7 +20,7 @@ import { formatRegistryLogoPath } from '../../util';
|
|
|
20
20
|
import { useBlockletContext } from '../../contexts/blocklet';
|
|
21
21
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const getStoreDetail = (meta, endpoint) => {
|
|
23
|
-
return
|
|
23
|
+
return joinURL(endpoint, `/blocklets/${meta.did}`);
|
|
24
24
|
};
|
|
25
25
|
const displayAttributes = ({
|
|
26
26
|
blocklet,
|
|
@@ -42,7 +42,7 @@ function BlockletItem({
|
|
|
42
42
|
const {
|
|
43
43
|
t
|
|
44
44
|
} = useLocaleContext();
|
|
45
|
-
let logoUrl =
|
|
45
|
+
let logoUrl = joinURL(endpoint, formatRegistryLogoPath(blocklet.did, blocklet.logo || ''));
|
|
46
46
|
try {
|
|
47
47
|
const tempURL = new URL(logoUrl);
|
|
48
48
|
tempURL.searchParams.set('v', blocklet.version || +new Date());
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { lazy, useRef } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import
|
|
3
|
+
import { joinURL } from 'ufo';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
5
|
import noop from 'lodash/noop';
|
|
6
6
|
import Box from '@mui/material/Box';
|
|
@@ -52,7 +52,7 @@ export default function LogoUploader({
|
|
|
52
52
|
disabled: true
|
|
53
53
|
},
|
|
54
54
|
apiPathProps: {
|
|
55
|
-
uploader:
|
|
55
|
+
uploader: joinURL(prefix, uploadPrefix, type, did),
|
|
56
56
|
disableMediaKitPrefix: true
|
|
57
57
|
},
|
|
58
58
|
coreProps: {
|
|
@@ -85,7 +85,7 @@ function NotificationPushKit() {
|
|
|
85
85
|
await api.sendPush({
|
|
86
86
|
input: {
|
|
87
87
|
did,
|
|
88
|
-
receiver:
|
|
88
|
+
receiver: pageState.testReceiver,
|
|
89
89
|
notification: JSON.stringify({
|
|
90
90
|
title: 'Test push-kit notification',
|
|
91
91
|
body: 'This is message from push-kit config test',
|
|
@@ -2,7 +2,7 @@ import React, { useState, useContext } from 'react';
|
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import Iframe from 'react-iframe';
|
|
5
|
-
import
|
|
5
|
+
import { joinURL } from 'ufo';
|
|
6
6
|
import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
|
|
7
7
|
import { Grid, Box } from '@mui/material';
|
|
8
8
|
import GeneralIcon from '@mui/icons-material/TuneRounded';
|
|
@@ -236,9 +236,9 @@ export default function BlockletPreferences({
|
|
|
236
236
|
if (!inService) {
|
|
237
237
|
urlSearchParams.set('authKey', '__sst');
|
|
238
238
|
}
|
|
239
|
-
urlSearchParams.set('schemaKey',
|
|
239
|
+
urlSearchParams.set('schemaKey', joinURL(window.location.origin, pathPrefix, `/api/preferences?id=${encodeURIComponent(current)}`));
|
|
240
240
|
content = /*#__PURE__*/_jsx(Iframe, {
|
|
241
|
-
url: `${
|
|
241
|
+
url: `${joinURL(window.location.origin, pathPrefix, '/hosted/form-collector/')}?${urlSearchParams.toString()}`,
|
|
242
242
|
width: "100%",
|
|
243
243
|
height: "100%",
|
|
244
244
|
frameBorder: 0,
|
|
@@ -122,6 +122,7 @@ function Header({
|
|
|
122
122
|
});
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
|
+
setLoading(true);
|
|
125
126
|
if (initLogoUrl) {
|
|
126
127
|
try {
|
|
127
128
|
const filename = await uploadImageToProject({
|
|
@@ -135,10 +136,10 @@ function Header({
|
|
|
135
136
|
});
|
|
136
137
|
} catch (err) {
|
|
137
138
|
Toast.error(err.message);
|
|
139
|
+
setLoading(false);
|
|
138
140
|
return;
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
|
-
setLoading(true);
|
|
142
143
|
const saveKeys = Object.keys(saveSelectedEventsRef.current);
|
|
143
144
|
try {
|
|
144
145
|
await pAll(saveKeys.map(x => {
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
function keepNowResources(trees, list) {
|
|
2
|
+
const listSet = new Set(list || []);
|
|
3
|
+
const result = [];
|
|
4
|
+
function traverse(tree) {
|
|
5
|
+
if (listSet.has(tree?.id)) {
|
|
6
|
+
result.push(tree?.id);
|
|
7
|
+
}
|
|
8
|
+
if (tree?.children) {
|
|
9
|
+
tree.children.forEach(traverse);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
(trees || []).forEach(traverse);
|
|
13
|
+
return result;
|
|
14
|
+
}
|
|
15
|
+
export default keepNowResources;
|
|
@@ -3,7 +3,7 @@ import classnames from 'classnames';
|
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useEffect, useRef } from 'react';
|
|
5
5
|
import useSetState from 'react-use/lib/useSetState';
|
|
6
|
-
import
|
|
6
|
+
import { joinURL } from 'ufo';
|
|
7
7
|
import { Box } from '@mui/material';
|
|
8
8
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
9
9
|
import { hasStartEngine } from '@blocklet/meta/lib/engine';
|
|
@@ -14,6 +14,7 @@ import { useNodeContext } from '../../../contexts/node';
|
|
|
14
14
|
import { axios } from '../../../util/api';
|
|
15
15
|
import StopBox from './stop-box';
|
|
16
16
|
import Tree from './tree';
|
|
17
|
+
import keepNowResources from './keep-now-resources';
|
|
17
18
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
const fillParent = (nodes, parentId) => {
|
|
19
20
|
nodes.forEach(node => {
|
|
@@ -31,7 +32,7 @@ const parseUrl = (component, projectId, releaseId, locale, initUrl) => {
|
|
|
31
32
|
const {
|
|
32
33
|
exportApi = '/'
|
|
33
34
|
} = component?.meta.resource || {};
|
|
34
|
-
const urlObj = new URL(
|
|
35
|
+
const urlObj = new URL(joinURL('http://127.0.0.1', component.mountPoint, exportApi || '/').replace(/\/+/g, '/'));
|
|
35
36
|
urlObj.searchParams.set('projectId', projectId);
|
|
36
37
|
urlObj.searchParams.set('releaseId', releaseId);
|
|
37
38
|
urlObj.searchParams.set('local', locale);
|
|
@@ -178,7 +179,7 @@ export default function Resources({
|
|
|
178
179
|
const list = res?.resources || [];
|
|
179
180
|
if (list?.length) {
|
|
180
181
|
setSelectedResourceIds({
|
|
181
|
-
[child.meta.did]: list
|
|
182
|
+
[child.meta.did]: keepNowResources(tree, list)
|
|
182
183
|
});
|
|
183
184
|
setSelectedComponentsMapByIds(child.meta.did, tree, list);
|
|
184
185
|
if (!readOnly) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import React, { useState, useEffect } from 'react';
|
|
3
3
|
import { Link, useParams } from 'react-router-dom';
|
|
4
4
|
import styled from '@emotion/styled';
|
|
5
|
-
import
|
|
5
|
+
import { joinURL } from 'ufo';
|
|
6
6
|
import upperFirst from 'lodash/upperFirst';
|
|
7
7
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
8
8
|
import { Box, useMediaQuery, IconButton, Typography, Tooltip, Breadcrumbs } from '@mui/material';
|
|
@@ -234,12 +234,12 @@ export default function ReleaseList() {
|
|
|
234
234
|
let downloadUrl = '';
|
|
235
235
|
const published = release.status === 'published';
|
|
236
236
|
if (published) {
|
|
237
|
-
const blockletMetaUrl =
|
|
237
|
+
const blockletMetaUrl = joinURL(serverEndpoint, `/api/project/${blocklet.meta.did}/${project.id}/${project.lastReleaseId}/release/blocklet.json`);
|
|
238
238
|
const url = new URL(serverEndpoint);
|
|
239
|
-
url.pathname =
|
|
239
|
+
url.pathname = joinURL(url.pathname, '/launch-blocklet/agreement');
|
|
240
240
|
url.searchParams.set('blocklet_meta_url', blockletMetaUrl);
|
|
241
241
|
installUrl = url.href;
|
|
242
|
-
downloadUrl =
|
|
242
|
+
downloadUrl = joinURL(`${WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${blocklet.meta.did}/${project.id}/${project.lastReleaseId}/download/${(project.lastReleaseFiles || [])[0]}`);
|
|
243
243
|
}
|
|
244
244
|
return /*#__PURE__*/_jsxs(Box, {
|
|
245
245
|
display: "flex",
|
|
@@ -41,7 +41,7 @@ const uploadImageToProject = async ({
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
// 使用 Tus 协议上传文件
|
|
44
|
-
const createUploadResponse = await axios.post(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/api/project', did, projectId, uploadType, 'upload'),
|
|
44
|
+
const createUploadResponse = await axios.post(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/api/project', did, projectId, uploadType, 'upload'), null, {
|
|
45
45
|
headers: {
|
|
46
46
|
'Tus-Resumable': '1.0.0',
|
|
47
47
|
'Upload-Length': file.size,
|
|
@@ -53,7 +53,7 @@ const uploadImageToProject = async ({
|
|
|
53
53
|
const uploadUrl = createUploadResponse.headers.location;
|
|
54
54
|
|
|
55
55
|
// Upload the file in chunks
|
|
56
|
-
const chunkSize =
|
|
56
|
+
const chunkSize = 2 * 1024 * 1024;
|
|
57
57
|
let offset = 0;
|
|
58
58
|
let filename = '';
|
|
59
59
|
for (const chunk of createFileChunks(file, chunkSize)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable react/jsx-one-expression-per-line */
|
|
2
2
|
import { useState, useEffect, useImperativeHandle, forwardRef } from 'react';
|
|
3
|
-
import
|
|
3
|
+
import { joinURL } from 'ufo';
|
|
4
4
|
import { getDisplayName } from '@blocklet/meta/lib/util';
|
|
5
5
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
6
6
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
@@ -132,7 +132,7 @@ export function ComponentPurchase({
|
|
|
132
132
|
purchase: {
|
|
133
133
|
action: 'acquire-asset',
|
|
134
134
|
checkFn: axios.create({
|
|
135
|
-
baseURL:
|
|
135
|
+
baseURL: joinURL(baseUrl, '/store')
|
|
136
136
|
}).get,
|
|
137
137
|
extraParams: {
|
|
138
138
|
factory: meta.nftFactory,
|
|
@@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
|
|
3
3
|
import Button from '@arcblock/ux/lib/Button';
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
6
|
-
import
|
|
6
|
+
import { joinURL } from 'ufo';
|
|
7
7
|
import toast from '@arcblock/ux/lib/Toast';
|
|
8
8
|
import SplitButton from '@arcblock/ux/lib/SplitButton';
|
|
9
9
|
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
@@ -53,7 +53,7 @@ function ConnectTo({
|
|
|
53
53
|
action: 'connect-to-did-spaces',
|
|
54
54
|
checkTimeout: 1000 * 300,
|
|
55
55
|
checkFn: axios.create({
|
|
56
|
-
baseURL:
|
|
56
|
+
baseURL: joinURL(window.location.origin, getPathPrefix())
|
|
57
57
|
}).get,
|
|
58
58
|
messages: {
|
|
59
59
|
title: t('storage.spaces.provideNFT.title', {
|
|
@@ -198,10 +198,10 @@ function ConnectTo({
|
|
|
198
198
|
setAuthorizeConnect(preValue => ({
|
|
199
199
|
...preValue,
|
|
200
200
|
open: true,
|
|
201
|
-
prefix:
|
|
201
|
+
prefix: joinURL(didSpacesCoreUrl, 'space/api/did'),
|
|
202
202
|
baseUrl: new URL(didSpacesCoreUrl).origin,
|
|
203
203
|
checkFn: axios.create({
|
|
204
|
-
baseURL:
|
|
204
|
+
baseURL: joinURL(didSpacesCoreUrl, 'space')
|
|
205
205
|
}).get,
|
|
206
206
|
extraParams: {
|
|
207
207
|
appDid: blockletInfo.appDid,
|
|
@@ -4,7 +4,7 @@ import Button from '@arcblock/ux/lib/Button';
|
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
7
|
-
import
|
|
7
|
+
import { joinURL } from 'ufo';
|
|
8
8
|
import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
|
|
9
9
|
import DidConnect from '@arcblock/did-connect/lib/Connect';
|
|
10
10
|
import { useRequest } from 'ahooks';
|
|
@@ -176,10 +176,10 @@ function SpaceItem({
|
|
|
176
176
|
setAuthorizeConnect(preValue => ({
|
|
177
177
|
...preValue,
|
|
178
178
|
open: true,
|
|
179
|
-
prefix:
|
|
179
|
+
prefix: joinURL(spaceGateway.url, 'space/api/did'),
|
|
180
180
|
baseUrl: new URL(spaceGateway.url).origin,
|
|
181
181
|
checkFn: axios.create({
|
|
182
|
-
baseURL:
|
|
182
|
+
baseURL: joinURL(spaceGateway.url, 'space')
|
|
183
183
|
}).get,
|
|
184
184
|
extraParams: {
|
|
185
185
|
appDid,
|
package/lib/blocklet/util.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import sortBy from 'lodash/sortBy';
|
|
2
|
-
import
|
|
2
|
+
import { joinURL } from 'ufo';
|
|
3
3
|
import isEmpty from 'lodash/isEmpty';
|
|
4
4
|
import normalizePathPrefix from '@abtnode/util/lib/normalize-path-prefix';
|
|
5
5
|
import { forEachBlockletSync, replaceSlotToIp } from '@blocklet/meta/lib/util';
|
|
@@ -7,12 +7,12 @@ import { BLOCKLET_APP_SPACE_REQUIREMENT } from '@blocklet/constant';
|
|
|
7
7
|
import { SLOT_FOR_IP_DNS_SITE } from '@abtnode/constant';
|
|
8
8
|
export const getServerUrl = (info, encodeURI = false) => {
|
|
9
9
|
const adminPath = process.env.NODE_ENV === 'production' ? info.routing.adminPath : '';
|
|
10
|
-
return encodeURI ? encodeURIComponent(
|
|
10
|
+
return encodeURI ? encodeURIComponent(joinURL(window.location.origin, adminPath)) : joinURL(window.location.origin, adminPath);
|
|
11
11
|
};
|
|
12
12
|
export const getLaunchAgreementUrl = (meta, info, storeUrl) => {
|
|
13
13
|
const serverUrl = getServerUrl(info);
|
|
14
|
-
const metaUrl =
|
|
15
|
-
const url = new URL(
|
|
14
|
+
const metaUrl = joinURL(storeUrl, `/api/blocklets/${meta.did}/blocklet.json`);
|
|
15
|
+
const url = new URL(joinURL(serverUrl, '/launch-blocklet/agreement'));
|
|
16
16
|
url.searchParams.set('blocklet_meta_url', metaUrl);
|
|
17
17
|
url.searchParams.set('from', window.location.href);
|
|
18
18
|
return url.href;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState, useEffect, useMemo, useRef, useContext } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import { joinURL } from 'ufo';
|
|
3
3
|
import memoize from 'lodash/memoize';
|
|
4
4
|
import { WELLKNOWN_PING_PREFIX } from '@abtnode/constant';
|
|
5
5
|
import { evaluateURLs } from '@abtnode/util/lib/url-evaluation';
|
|
@@ -16,7 +16,7 @@ const ping = memoize(url => {
|
|
|
16
16
|
if (hostname === window.location.hostname) {
|
|
17
17
|
return true;
|
|
18
18
|
}
|
|
19
|
-
return defaultCheckAccessible(
|
|
19
|
+
return defaultCheckAccessible(joinURL(origin, WELLKNOWN_PING_PREFIX));
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
// url <-> evaluation cache
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { joinURL } from 'ufo';
|
|
2
2
|
import { BLOCKLET_CONFIGURABLE_KEY } from '@blocklet/constant';
|
|
3
3
|
import { useNodeContext } from '../contexts/node';
|
|
4
4
|
import { isInstalling, getLogoHash } from '../util';
|
|
@@ -21,9 +21,9 @@ export default function useAppLogo({
|
|
|
21
21
|
const customRectLogo = (blocklet?.environments || []).find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_RECT)?.value;
|
|
22
22
|
const customFavicon = (blocklet?.environments || []).find(x => x.key === BLOCKLET_CONFIGURABLE_KEY.BLOCKLET_APP_LOGO_FAVICON)?.value;
|
|
23
23
|
const prefix = window.env?.apiPrefix || '/';
|
|
24
|
-
const logoUrl =
|
|
25
|
-
const rectLogoUrl =
|
|
26
|
-
const faviconUrl =
|
|
24
|
+
const logoUrl = `${joinURL(prefix, `/blocklet/logo/${inService ? '' : blocklet.meta.did}`)}${getSearch(blocklet, customLogo)}`;
|
|
25
|
+
const rectLogoUrl = `${joinURL(prefix, `/blocklet/logo-rect/${inService ? '' : blocklet.meta.did}`)}${getSearch(blocklet, customRectLogo)}`;
|
|
26
|
+
const faviconUrl = `${joinURL(prefix, `/blocklet/logo-favicon/${inService ? '' : blocklet.meta.did}`)}${getSearch(blocklet, customFavicon)}`;
|
|
27
27
|
return {
|
|
28
28
|
logoUrl,
|
|
29
29
|
rectLogoUrl,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { joinURL } from 'ufo';
|
|
2
2
|
import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
|
|
3
3
|
import { useNodeContext } from '../contexts/node';
|
|
4
4
|
import { formatRegistryLogoPath, APP_PREFIX, isDownloading, isExtracting } from '../util';
|
|
@@ -12,14 +12,14 @@ export default function useAvatar({
|
|
|
12
12
|
} = node;
|
|
13
13
|
const pending = isDownloading(blocklet?.status) || isExtracting(blocklet?.status);
|
|
14
14
|
const search = `?v=${blocklet?.meta?.version}${pending ? '~' : ''}`;
|
|
15
|
-
let logoUrl = inService ?
|
|
15
|
+
let logoUrl = inService ? `${joinURL(APP_PREFIX, WELLKNOWN_SERVICE_PATH_PREFIX, '/blocklet/logo-bundle')}${search}` : joinURL(node.imgPrefix, 'blocklet.png');
|
|
16
16
|
if (blocklet.source === 'registry' && blocklet.deployedFrom && blocklet.meta.logo) {
|
|
17
|
-
logoUrl =
|
|
17
|
+
logoUrl = `${joinURL(blocklet.deployedFrom, formatRegistryLogoPath(blocklet.meta.bundleDid, blocklet.meta.logo))}${search}`;
|
|
18
18
|
} else {
|
|
19
19
|
const prefix = window.env.apiPrefix || '/';
|
|
20
20
|
const components = ancestors.concat(blocklet);
|
|
21
21
|
const list = inService ? components.slice(1) : components;
|
|
22
|
-
logoUrl =
|
|
22
|
+
logoUrl = `${joinURL(prefix, `/blocklet/logo-bundle${list.map(x => `/${x.meta.did}`).join('')}`)}${search}`;
|
|
23
23
|
}
|
|
24
24
|
return {
|
|
25
25
|
logoUrl,
|
|
@@ -4,7 +4,7 @@ import styled from '@emotion/styled';
|
|
|
4
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
5
5
|
import DidButton from '@arcblock/did-connect/lib/Button';
|
|
6
6
|
import { AUTH_SERVICE_PREFIX, API_DID_PREFIX } from '@arcblock/did-connect/lib/constant';
|
|
7
|
-
import joinURL from '
|
|
7
|
+
import { joinURL } from 'ufo';
|
|
8
8
|
import { formatDateTime } from '../util';
|
|
9
9
|
import usePassportId from '../hooks/use-passport-id';
|
|
10
10
|
import { useSessionContext } from '../contexts/session';
|
package/lib/locales/ar.js
CHANGED
|
@@ -979,7 +979,10 @@ export default {
|
|
|
979
979
|
testReceiver: 'مستقبل PushKit',
|
|
980
980
|
testSend: 'اختبار إرسال مجموعة الدفع',
|
|
981
981
|
inputTestReceiver: 'الرجاء إدخال مستقبل الاختبار',
|
|
982
|
-
receiverRequired: 'مطلوب مستقبل PushKit'
|
|
982
|
+
receiverRequired: 'مطلوب مستقبل PushKit',
|
|
983
|
+
pushPath: 'مسار Api ل push-kit (افتراضي /api/push)',
|
|
984
|
+
did: 'PushKit Blocklet DID',
|
|
985
|
+
customOptions: 'خيارات مخصصة'
|
|
983
986
|
}
|
|
984
987
|
},
|
|
985
988
|
router: {
|
|
@@ -1501,7 +1504,7 @@ export default {
|
|
|
1501
1504
|
installedButStopped: 'تم تثبيت التطبيق بنجاح ، ولكن لا يمكن تشغيله. يمكنك بدء تشغيله يدويًا بعد حل مشكلة الحجب.',
|
|
1502
1505
|
installedButError: 'تم تثبيت التطبيق بنجاح ، ولكن فشل في البدء',
|
|
1503
1506
|
restoreFailed: 'فشل في استعادة التطبيق، يرجى المحاولة مرة أخرى',
|
|
1504
|
-
resourceBlocklet: 'لا يمكن تثبيت
|
|
1507
|
+
resourceBlocklet: 'لا يمكن تثبيت الكتلة كتطبيق، يمكنك إضافة هذه الكتلة إلى التطبيقات الحالية.'
|
|
1505
1508
|
},
|
|
1506
1509
|
steps: {
|
|
1507
1510
|
introduction: 'مقدمة',
|
package/lib/locales/de.js
CHANGED
|
@@ -979,7 +979,10 @@ export default {
|
|
|
979
979
|
testReceiver: 'PushKit-Empfänger',
|
|
980
980
|
testSend: 'Test-Push-Kit senden',
|
|
981
981
|
inputTestReceiver: 'Bitte geben Sie den Test-Empfänger ein',
|
|
982
|
-
receiverRequired: 'PushKit-Empfänger ist erforderlich'
|
|
982
|
+
receiverRequired: 'PushKit-Empfänger ist erforderlich',
|
|
983
|
+
pushPath: 'Api-Pfad für Push-Kit (Standard /api/push)',
|
|
984
|
+
did: 'PushKit Blocklet DID',
|
|
985
|
+
customOptions: 'Benutzerdefinierte Optionen'
|
|
983
986
|
}
|
|
984
987
|
},
|
|
985
988
|
router: {
|
|
@@ -1501,7 +1504,7 @@ export default {
|
|
|
1501
1504
|
installedButStopped: 'Die App wurde erfolgreich installiert, kann jedoch nicht gestartet werden. Sie können sie manuell starten, nachdem Sie die blockierenden Probleme behoben haben.',
|
|
1502
1505
|
installedButError: 'Die App wurde erfolgreich installiert, konnte jedoch nicht gestartet werden',
|
|
1503
1506
|
restoreFailed: 'Fehler beim Wiederherstellen der App, bitte versuchen Sie es erneut',
|
|
1504
|
-
resourceBlocklet: '
|
|
1507
|
+
resourceBlocklet: 'Blocklet kann nicht als Anwendung installiert werden, Sie können diese Blocklet in vorhandene Anwendungen einfügen.'
|
|
1505
1508
|
},
|
|
1506
1509
|
steps: {
|
|
1507
1510
|
introduction: 'Einführung',
|
package/lib/locales/en.js
CHANGED
|
@@ -833,6 +833,10 @@ export default {
|
|
|
833
833
|
welcome: {
|
|
834
834
|
switchLabel: 'Welcome Page'
|
|
835
835
|
},
|
|
836
|
+
security: {
|
|
837
|
+
switchLabel: 'File System Isolation',
|
|
838
|
+
switchTips: 'After disabling this option, the file system of the Blocklet will no longer be in isolation, which may pose a risk of malicious software damaging the file system.'
|
|
839
|
+
},
|
|
836
840
|
upgrade: {
|
|
837
841
|
title: 'Upgrade Blocklet Server to {version}',
|
|
838
842
|
description: 'During the upgrade, your Blocklet Server will enter maintenance mode for a few minutes while the update is completed.',
|
|
@@ -1493,7 +1497,7 @@ export default {
|
|
|
1493
1497
|
installedButStopped: 'The app is installed successfully, but cannot be started. You can start it manually after resolving blocking issues',
|
|
1494
1498
|
installedButError: 'The app is successfully installed, but failed to start',
|
|
1495
1499
|
restoreFailed: 'Failed to restore app, please try again',
|
|
1496
|
-
resourceBlocklet: '
|
|
1500
|
+
resourceBlocklet: 'Blocklet cannot be installed as an application, you can add this blocklet into existing applications.'
|
|
1497
1501
|
},
|
|
1498
1502
|
steps: {
|
|
1499
1503
|
introduction: 'Introduction',
|