@abtnode/ux 1.16.27-beta-d1555a79 → 1.16.27-beta-595ed831
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/blocklet/audit-logs.js +4 -1
- package/lib/blocklet/component/add-component/add-component-core.js +200 -281
- package/lib/blocklet/component/add-component/step-connect.js +9 -3
- package/lib/blocklet/component/related-components-dialog.js +1 -0
- package/lib/blocklet/component/store-blocklet-list.js +52 -7
- package/lib/blocklet/publish/connect-store-list.js +8 -4
- package/lib/blocklet/publish/create-release.js +145 -72
- package/lib/blocklet/publish/hooks/use-want-to-connect-store.js +21 -0
- package/lib/blocklet/publish/resource.js +73 -41
- package/lib/blocklet/publish/select-components.js +31 -11
- package/lib/blocklet/publish/stop-box.js +35 -0
- package/lib/blocklet/publish/utils/upload-image-to-project.js +73 -0
- package/lib/blocklet/publish/{wait-connect.js → utils/wait-connect.js} +2 -2
- package/lib/hooks/use-promise-window-open.js +31 -0
- package/lib/locales/ar.js +6 -3
- package/lib/locales/de.js +6 -3
- package/lib/locales/en.js +5 -2
- package/lib/locales/es.js +6 -3
- package/lib/locales/fr.js +6 -3
- package/lib/locales/hi.js +6 -3
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +6 -3
- package/lib/locales/ja.js +6 -3
- package/lib/locales/ko.js +6 -3
- package/lib/locales/pt.js +6 -3
- package/lib/locales/ru.js +6 -3
- package/lib/locales/th.js +6 -3
- package/lib/locales/vi.js +6 -3
- package/lib/locales/zh-tw.js +7 -4
- package/lib/locales/zh.js +6 -3
- package/lib/store/item.js +38 -31
- package/package.json +18 -17
|
@@ -5,14 +5,14 @@ import joinUrl from 'url-join';
|
|
|
5
5
|
import classnames from 'classnames';
|
|
6
6
|
import useSetState from 'react-use/lib/useSetState';
|
|
7
7
|
import Box from '@mui/material/Box';
|
|
8
|
-
import StopIcon from '@mui/icons-material/DoDisturbAlt';
|
|
9
8
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
10
9
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
11
10
|
import pAll from 'p-all';
|
|
12
11
|
import Tree from './tree';
|
|
13
12
|
import { useNodeContext } from '../../contexts/node';
|
|
14
13
|
import { axios } from '../../util/api';
|
|
15
|
-
import
|
|
14
|
+
import StopBox from './stop-box';
|
|
15
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const fillParent = (nodes, parentId) => {
|
|
17
17
|
nodes.forEach(node => {
|
|
18
18
|
if (parentId) {
|
|
@@ -64,6 +64,29 @@ export const uploadResource = async ({
|
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
};
|
|
67
|
+
const getNodeIdDependencies = (node, nodeIds) => {
|
|
68
|
+
if (!node) {
|
|
69
|
+
return {};
|
|
70
|
+
}
|
|
71
|
+
const nodeIdMap = nodeIds.reduce((acc, curr) => {
|
|
72
|
+
acc[curr] = true;
|
|
73
|
+
return acc;
|
|
74
|
+
}, {});
|
|
75
|
+
const getDependencies = (children, deps) => {
|
|
76
|
+
children.forEach(child => {
|
|
77
|
+
if (nodeIdMap[child.id] && child.dependentComponents?.length) {
|
|
78
|
+
child.dependentComponents.forEach(dep => {
|
|
79
|
+
deps[dep] = true;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
if (child.children) {
|
|
83
|
+
getDependencies(child.children, deps);
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return deps;
|
|
87
|
+
};
|
|
88
|
+
return getDependencies(node, {});
|
|
89
|
+
};
|
|
67
90
|
export default function Resource({
|
|
68
91
|
app,
|
|
69
92
|
component,
|
|
@@ -73,6 +96,7 @@ export default function Resource({
|
|
|
73
96
|
saveSelectedEventsRef,
|
|
74
97
|
readOnly,
|
|
75
98
|
initialResources = {},
|
|
99
|
+
setResourceComponentsMap,
|
|
76
100
|
initUrl
|
|
77
101
|
}) {
|
|
78
102
|
const {
|
|
@@ -85,9 +109,19 @@ export default function Resource({
|
|
|
85
109
|
const [resources, setResources] = useSetState({});
|
|
86
110
|
const [selectedResourceIds, setSelectedResourceIds] = useSetState({});
|
|
87
111
|
const refs = useRef({});
|
|
112
|
+
const loadedDataRef = useRef(false);
|
|
88
113
|
const releaseId = release.id;
|
|
89
114
|
refs.current.projectId = projectId;
|
|
90
115
|
refs.current.releaseId = releaseId;
|
|
116
|
+
const setSelectedComponentsMapByIds = (did, theResource, ids) => {
|
|
117
|
+
if (!theResource) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
const deps = getNodeIdDependencies(theResource, ids);
|
|
121
|
+
setResourceComponentsMap?.({
|
|
122
|
+
[did]: Object.keys(deps)
|
|
123
|
+
});
|
|
124
|
+
};
|
|
91
125
|
const handleTreeChange = data => {
|
|
92
126
|
saveSelectedEventsRef.current[component.meta.did] = {
|
|
93
127
|
resources: data,
|
|
@@ -96,6 +130,7 @@ export default function Resource({
|
|
|
96
130
|
setSelectedResourceIds({
|
|
97
131
|
[component.meta.did]: data
|
|
98
132
|
});
|
|
133
|
+
setSelectedComponentsMapByIds(component.meta.did, resources[component.meta.did], data);
|
|
99
134
|
};
|
|
100
135
|
useEffect(() => {
|
|
101
136
|
if (!resources[component?.meta.did]) {
|
|
@@ -110,22 +145,35 @@ export default function Resource({
|
|
|
110
145
|
}
|
|
111
146
|
}, [component, projectId, release, locale, initUrl, setResources, resources, releaseId]);
|
|
112
147
|
useEffect(() => {
|
|
113
|
-
if (releaseId && projectId) {
|
|
148
|
+
if (releaseId && projectId && !loadedDataRef.current) {
|
|
114
149
|
pAll(app.children.map(child => {
|
|
115
|
-
return () => {
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
150
|
+
return async () => {
|
|
151
|
+
if (!child) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
let tree;
|
|
155
|
+
try {
|
|
156
|
+
if (child.mountPoint) {
|
|
157
|
+
const res = await axios.get(parseUrl(child, projectId, releaseId, locale, initUrl));
|
|
158
|
+
tree = fillParent(res?.data?.resources || []);
|
|
159
|
+
setResources({
|
|
160
|
+
[child?.meta.did]: tree
|
|
161
|
+
});
|
|
122
162
|
}
|
|
123
|
-
|
|
163
|
+
const res = await api.getSelectedResources({
|
|
164
|
+
input: {
|
|
165
|
+
did: app.meta.did,
|
|
166
|
+
projectId,
|
|
167
|
+
releaseId,
|
|
168
|
+
componentDid: child.meta.did
|
|
169
|
+
}
|
|
170
|
+
});
|
|
124
171
|
const list = res?.resources || [];
|
|
125
172
|
if (list?.length) {
|
|
126
173
|
setSelectedResourceIds({
|
|
127
174
|
[child.meta.did]: list
|
|
128
175
|
});
|
|
176
|
+
setSelectedComponentsMapByIds(child.meta.did, tree, list);
|
|
129
177
|
if (!readOnly) {
|
|
130
178
|
saveSelectedEventsRef.current[child?.meta.did] = {
|
|
131
179
|
resources: list,
|
|
@@ -133,16 +181,18 @@ export default function Resource({
|
|
|
133
181
|
};
|
|
134
182
|
}
|
|
135
183
|
}
|
|
136
|
-
}
|
|
184
|
+
} catch (err) {
|
|
137
185
|
Toast.error(err.message);
|
|
138
|
-
}
|
|
186
|
+
}
|
|
139
187
|
};
|
|
140
188
|
}), {
|
|
141
189
|
concurrency: 2
|
|
190
|
+
}).then(() => {
|
|
191
|
+
loadedDataRef.current = true;
|
|
142
192
|
});
|
|
143
193
|
}
|
|
144
194
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
145
|
-
}, [releaseId, projectId, readOnly]);
|
|
195
|
+
}, [releaseId, projectId, readOnly, locale, initUrl, setResources]);
|
|
146
196
|
useEffect(() => {
|
|
147
197
|
if (initialResources && Object.keys(initialResources).length) {
|
|
148
198
|
app.children.forEach(child => {
|
|
@@ -163,30 +213,10 @@ export default function Resource({
|
|
|
163
213
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
164
214
|
}, [app, initialResources, readOnly]);
|
|
165
215
|
if (component.status !== 'running') {
|
|
166
|
-
return /*#__PURE__*/
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
justifyContent: 'center',
|
|
171
|
-
alignItems: 'center',
|
|
172
|
-
margin: '10px 0px'
|
|
173
|
-
},
|
|
174
|
-
children: [/*#__PURE__*/_jsx(StopIcon, {
|
|
175
|
-
sx: {
|
|
176
|
-
fontSize: 32,
|
|
177
|
-
opacity: 0.3,
|
|
178
|
-
mb: 2
|
|
179
|
-
}
|
|
180
|
-
}), /*#__PURE__*/_jsx(Box, {
|
|
181
|
-
sx: {
|
|
182
|
-
mb: 2,
|
|
183
|
-
fontSize: 'small',
|
|
184
|
-
color: 'action'
|
|
185
|
-
},
|
|
186
|
-
children: t('blocklet.publish.componentNotRunning', {
|
|
187
|
-
name: component.meta.title
|
|
188
|
-
})
|
|
189
|
-
})]
|
|
216
|
+
return /*#__PURE__*/_jsx(StopBox, {
|
|
217
|
+
children: t('blocklet.publish.componentNotRunning', {
|
|
218
|
+
name: component.meta.title
|
|
219
|
+
})
|
|
190
220
|
});
|
|
191
221
|
}
|
|
192
222
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -220,8 +250,9 @@ Resource.propTypes = {
|
|
|
220
250
|
id: PropTypes.string.isRequired,
|
|
221
251
|
status: PropTypes.string
|
|
222
252
|
}),
|
|
223
|
-
initialResources: PropTypes.
|
|
224
|
-
initUrl: PropTypes.object
|
|
253
|
+
initialResources: PropTypes.object,
|
|
254
|
+
initUrl: PropTypes.object,
|
|
255
|
+
setResourceComponentsMap: PropTypes.func
|
|
225
256
|
};
|
|
226
257
|
Resource.defaultProps = {
|
|
227
258
|
error: '',
|
|
@@ -230,7 +261,8 @@ Resource.defaultProps = {
|
|
|
230
261
|
id: ''
|
|
231
262
|
},
|
|
232
263
|
initUrl: null,
|
|
233
|
-
initialResources:
|
|
264
|
+
initialResources: {},
|
|
265
|
+
setResourceComponentsMap: () => {}
|
|
234
266
|
};
|
|
235
267
|
const Container = styled(Box)`
|
|
236
268
|
border: 1px solid #ccc;
|
|
@@ -13,19 +13,33 @@ export default function SelectComponents({
|
|
|
13
13
|
value,
|
|
14
14
|
app,
|
|
15
15
|
onChange,
|
|
16
|
-
disabled
|
|
16
|
+
disabled,
|
|
17
|
+
resourceRelateComponents,
|
|
18
|
+
dependentComponentsMode
|
|
17
19
|
}) {
|
|
18
20
|
const {
|
|
19
21
|
t,
|
|
20
22
|
locale
|
|
21
23
|
} = useLocaleContext();
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
+
const readonlyComponents = dependentComponentsMode === 'readonly';
|
|
25
|
+
const components = useMemo(() => {
|
|
26
|
+
const valueToMap = value.reduce((acc, curr) => {
|
|
27
|
+
acc[curr.did] = curr.included;
|
|
28
|
+
return acc;
|
|
29
|
+
}, {});
|
|
30
|
+
return (app.children || []).filter(component => {
|
|
31
|
+
if (readonlyComponents) {
|
|
32
|
+
return resourceRelateComponents[component.meta.did] || valueToMap[component.meta.did];
|
|
33
|
+
}
|
|
34
|
+
return true;
|
|
35
|
+
});
|
|
36
|
+
}, [app.children, value, resourceRelateComponents, readonlyComponents]);
|
|
37
|
+
const list = useMemo(() => components.map(component => {
|
|
24
38
|
const exist = value.find(item => item.did === component.meta.did);
|
|
25
39
|
return exist || {
|
|
26
40
|
did: component.meta.did
|
|
27
41
|
};
|
|
28
|
-
}), [
|
|
42
|
+
}), [components, value]);
|
|
29
43
|
const map = list.reduce((acc, curr) => {
|
|
30
44
|
acc[curr.did] = pick(curr, ['required', 'included']);
|
|
31
45
|
return acc;
|
|
@@ -91,12 +105,13 @@ export default function SelectComponents({
|
|
|
91
105
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
92
106
|
customBodyRenderLite: rawIndex => {
|
|
93
107
|
const component = components[rawIndex];
|
|
108
|
+
const isDefault = resourceRelateComponents[component.meta.did];
|
|
94
109
|
const included = !!map[component.meta.did]?.included;
|
|
95
110
|
return /*#__PURE__*/_jsx(Checkbox, {
|
|
96
111
|
size: "small",
|
|
97
|
-
checked: included,
|
|
112
|
+
checked: isDefault || included,
|
|
98
113
|
onClick: () => toggleIncluded(component.meta.did),
|
|
99
|
-
disabled: disabled
|
|
114
|
+
disabled: readonlyComponents || isDefault || disabled
|
|
100
115
|
});
|
|
101
116
|
}
|
|
102
117
|
}
|
|
@@ -107,13 +122,14 @@ export default function SelectComponents({
|
|
|
107
122
|
// eslint-disable-next-line react/no-unstable-nested-components
|
|
108
123
|
customBodyRenderLite: rawIndex => {
|
|
109
124
|
const component = components[rawIndex];
|
|
125
|
+
const isDefault = resourceRelateComponents[component.meta.did];
|
|
110
126
|
const included = !!map[component.meta.did]?.included;
|
|
111
127
|
const required = !!map[component.meta.did]?.required;
|
|
112
128
|
return /*#__PURE__*/_jsx(Checkbox, {
|
|
113
|
-
disabled: disabled || !included,
|
|
114
129
|
size: "small",
|
|
115
|
-
checked: required && included,
|
|
116
|
-
onClick: () => toggleRequired(component.meta.did)
|
|
130
|
+
checked: isDefault || required && included,
|
|
131
|
+
onClick: () => toggleRequired(component.meta.did),
|
|
132
|
+
disabled: readonlyComponents || isDefault || disabled || !included
|
|
117
133
|
});
|
|
118
134
|
}
|
|
119
135
|
}
|
|
@@ -144,12 +160,16 @@ SelectComponents.propTypes = {
|
|
|
144
160
|
included: PropTypes.bool
|
|
145
161
|
})),
|
|
146
162
|
onChange: PropTypes.func,
|
|
147
|
-
disabled: PropTypes.bool
|
|
163
|
+
disabled: PropTypes.bool,
|
|
164
|
+
dependentComponentsMode: PropTypes.string,
|
|
165
|
+
resourceRelateComponents: PropTypes.object
|
|
148
166
|
};
|
|
149
167
|
SelectComponents.defaultProps = {
|
|
150
168
|
value: [],
|
|
151
169
|
onChange: () => {},
|
|
152
|
-
disabled: false
|
|
170
|
+
disabled: false,
|
|
171
|
+
dependentComponentsMode: 'auto',
|
|
172
|
+
resourceRelateComponents: {}
|
|
153
173
|
};
|
|
154
174
|
const Root = styled(Box)`
|
|
155
175
|
.main-table {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
import { Box, Container } from '@mui/material';
|
|
3
|
+
import StopIcon from '@mui/icons-material/DoDisturbAlt';
|
|
4
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
5
|
+
function StopBox({
|
|
6
|
+
children
|
|
7
|
+
}) {
|
|
8
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
9
|
+
sx: {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
flexDirection: 'column',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
margin: '10px 0px'
|
|
15
|
+
},
|
|
16
|
+
children: [/*#__PURE__*/_jsx(StopIcon, {
|
|
17
|
+
sx: {
|
|
18
|
+
fontSize: 32,
|
|
19
|
+
opacity: 0.3,
|
|
20
|
+
mb: 2
|
|
21
|
+
}
|
|
22
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
23
|
+
sx: {
|
|
24
|
+
mb: 2,
|
|
25
|
+
fontSize: 'small',
|
|
26
|
+
color: 'action'
|
|
27
|
+
},
|
|
28
|
+
children: children
|
|
29
|
+
})]
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
StopBox.propTypes = {
|
|
33
|
+
children: PropTypes.node.isRequired
|
|
34
|
+
};
|
|
35
|
+
export default StopBox;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { WELLKNOWN_SERVICE_PATH_PREFIX } from '@abtnode/constant';
|
|
2
|
+
import axios from '@abtnode/util/lib/axios';
|
|
3
|
+
import { joinURL } from 'ufo';
|
|
4
|
+
export const urlToFile = async url => {
|
|
5
|
+
if (typeof url !== 'string') {
|
|
6
|
+
throw new Error('URL must be a string');
|
|
7
|
+
}
|
|
8
|
+
try {
|
|
9
|
+
const filename = url.split('/').pop().split('?')[0];
|
|
10
|
+
const response = await fetch(url);
|
|
11
|
+
const blob = await response.blob();
|
|
12
|
+
return new File([blob], filename, {
|
|
13
|
+
type: blob.type
|
|
14
|
+
});
|
|
15
|
+
} catch (error) {
|
|
16
|
+
throw new Error('Failed to convert Logo URL to file');
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function* createFileChunks(file, chunkSize) {
|
|
20
|
+
let offset = 0;
|
|
21
|
+
while (offset < file.size) {
|
|
22
|
+
yield file.slice(offset, offset + chunkSize);
|
|
23
|
+
offset += chunkSize;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const uploadImageToProject = async ({
|
|
27
|
+
did,
|
|
28
|
+
projectId,
|
|
29
|
+
uploadType = 'logo',
|
|
30
|
+
imageUrl
|
|
31
|
+
}) => {
|
|
32
|
+
const file = await urlToFile(imageUrl);
|
|
33
|
+
const formData = new FormData();
|
|
34
|
+
formData.append('file', file);
|
|
35
|
+
// Create metadata header
|
|
36
|
+
const metadata = {
|
|
37
|
+
uploaderId: 'Uploader',
|
|
38
|
+
relativePath: encodeURIComponent(file.name),
|
|
39
|
+
name: encodeURIComponent(file.name),
|
|
40
|
+
type: file.type
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
// 使用 Tus 协议上传文件
|
|
44
|
+
const createUploadResponse = await axios.post(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, '/api/project', did, projectId, uploadType, 'upload'), formData, {
|
|
45
|
+
headers: {
|
|
46
|
+
'Tus-Resumable': '1.0.0',
|
|
47
|
+
'Upload-Length': file.size,
|
|
48
|
+
'X-Uploader-File-Ext': file.name.split('.').pop(),
|
|
49
|
+
'Upload-Metadata': Object.keys(metadata).map(key => `${key} ${btoa(metadata[key])}`).join(',')
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
// Extract the upload URL from the response
|
|
53
|
+
const uploadUrl = createUploadResponse.headers.location;
|
|
54
|
+
|
|
55
|
+
// Upload the file in chunks
|
|
56
|
+
const chunkSize = 5 * 1024 * 1024;
|
|
57
|
+
let offset = 0;
|
|
58
|
+
let filename = '';
|
|
59
|
+
for (const chunk of createFileChunks(file, chunkSize)) {
|
|
60
|
+
// eslint-disable-next-line no-await-in-loop
|
|
61
|
+
const res = await axios.patch(joinURL(WELLKNOWN_SERVICE_PATH_PREFIX, uploadUrl), chunk, {
|
|
62
|
+
headers: {
|
|
63
|
+
'Tus-Resumable': '1.0.0',
|
|
64
|
+
'Upload-Offset': offset,
|
|
65
|
+
'Content-Type': 'application/offset+octet-stream'
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
offset += chunk.size;
|
|
69
|
+
filename = res.data.filename;
|
|
70
|
+
}
|
|
71
|
+
return filename;
|
|
72
|
+
};
|
|
73
|
+
export default uploadImageToProject;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
async function waitPromiseFunction(promiseFunction, interval = 1500, maxAttempts =
|
|
1
|
+
async function waitPromiseFunction(promiseFunction, interval = 1500, maxAttempts = 600, intervalFirst = 5000) {
|
|
2
2
|
let attempts = 0;
|
|
3
3
|
|
|
4
4
|
// eslint-disable-next-line no-promise-executor-return
|
|
@@ -12,7 +12,7 @@ async function waitPromiseFunction(promiseFunction, interval = 1500, maxAttempts
|
|
|
12
12
|
if (attempts >= maxAttempts) {
|
|
13
13
|
reject(error);
|
|
14
14
|
} else {
|
|
15
|
-
setTimeout(() => poll(resolve, reject), interval
|
|
15
|
+
setTimeout(() => poll(resolve, reject), interval);
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useRef } from 'react';
|
|
2
|
+
function usePromiseWindowOpen({
|
|
3
|
+
onOpen,
|
|
4
|
+
onClose
|
|
5
|
+
}) {
|
|
6
|
+
const windowRef = useRef(null);
|
|
7
|
+
const timer = useRef(null);
|
|
8
|
+
const openWindow = async fn => {
|
|
9
|
+
if (windowRef.current) {
|
|
10
|
+
clearInterval(timer.current);
|
|
11
|
+
windowRef.current.close();
|
|
12
|
+
}
|
|
13
|
+
windowRef.current = window.open('about:blank', '_blank');
|
|
14
|
+
onOpen?.(windowRef.current);
|
|
15
|
+
timer.current = setInterval(() => {
|
|
16
|
+
if (!windowRef.current || windowRef.current.closed) {
|
|
17
|
+
windowRef.current = null;
|
|
18
|
+
clearInterval(timer.current);
|
|
19
|
+
onClose?.();
|
|
20
|
+
}
|
|
21
|
+
}, 500);
|
|
22
|
+
await Promise.resolve(fn(windowRef.current, url => {
|
|
23
|
+
if (!windowRef.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
windowRef.current.location.href = url;
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
return openWindow;
|
|
30
|
+
}
|
|
31
|
+
export default usePromiseWindowOpen;
|
package/lib/locales/ar.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'النماذج المرتبطة',
|
|
614
614
|
required: 'مطلوب',
|
|
615
615
|
installed: 'مثبت',
|
|
616
|
-
installingTip: 'جاري تثبيت المكون، الرجاء الانتظار...'
|
|
616
|
+
installingTip: 'جاري تثبيت المكون، الرجاء الانتظار...',
|
|
617
|
+
upgrade: 'ترقية'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: 'مسار عنوان URL',
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: 'لا توجد أي كتل هنا',
|
|
672
673
|
createBlockletTip: 'يمكنك إنشاء وحدة جديدة من خلال الموارد والمكونات والتكوين الحالي في هذا التطبيق',
|
|
673
674
|
createBlocklet: 'بلوكليت جديد',
|
|
674
|
-
componentNotRunning: '
|
|
675
|
+
componentNotRunning: 'البلوكليت {name} لا يعمل، يرجى تشغيله أولا',
|
|
675
676
|
releaseEmptyTip: 'لا توجد أي إصدارات هنا',
|
|
676
677
|
createReleaseTip: 'يمكنك إنشاء إصدار للـ بلوكليت، جنباً إلى جنب مع ملاحظات الإصدار والموارد، ليستخدمها الآخرون.',
|
|
677
678
|
createRelease: 'إصدار جديد',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'حاليًا ، كما هو الحال بوصفه كتلة مورد ، لا يمكن تثبيته مباشرة من المتجر.',
|
|
724
725
|
whyCantSeeInStore: 'لماذا لا أستطيع رؤية هذا البلوكليت في المتجر؟',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: 'لماذا لا يمكنني رؤية بلوكليت الموارد هذا في المتجر؟',
|
|
726
|
-
tenantScope: 'مستأجر'
|
|
727
|
+
tenantScope: 'مستأجر',
|
|
728
|
+
blockletStudio: 'استوديو بلوكليت',
|
|
729
|
+
allComponentsNotRunning: 'لا يعمل بلوكلتس، يرجى تشغيله أولاً'
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: 'يجب أن يكون طول العنوان على الأقل 3 أحرف',
|
|
729
732
|
descriptionValidationError: 'يجب أن تكون طول الوصف بين 3 و 160 حرفًا'
|
package/lib/locales/de.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'Verwandte Blocklets',
|
|
614
614
|
required: 'Erforderlich',
|
|
615
615
|
installed: 'Installiert',
|
|
616
|
-
installingTip: 'Komponente wird installiert, bitte warten...'
|
|
616
|
+
installingTip: 'Komponente wird installiert, bitte warten...',
|
|
617
|
+
upgrade: 'Upgrade'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: 'URL Pfad',
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: 'Es gibt hier keine Blocklets',
|
|
672
673
|
createBlockletTip: 'Sie können über vorhandene Ressourcen, Komponenten und Konfigurationen in dieser Anwendung einen neuen Blocklet erstellen',
|
|
673
674
|
createBlocklet: 'Neuer Blocklet',
|
|
674
|
-
componentNotRunning: '
|
|
675
|
+
componentNotRunning: 'Blocklet {name} läuft nicht, bitte starte es zuerst',
|
|
675
676
|
releaseEmptyTip: 'Es gibt hier keine Veröffentlichungen',
|
|
676
677
|
createReleaseTip: 'Du kannst eine Veröffentlichung des Blocklets erstellen, zusammen mit Versionshinweisen und Ressourcen, die andere Personen nutzen können.',
|
|
677
678
|
createRelease: 'Neue Veröffentlichung',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'Zurzeit kann es als Ressourcen-Blocklet nicht direkt aus dem Store installiert werden.',
|
|
724
725
|
whyCantSeeInStore: 'Warum kann ich dieses Blocklet nicht im Store sehen?',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: 'Warum kann ich diesen Ressourcen-Blocklet nicht im Store sehen?',
|
|
726
|
-
tenantScope: 'Mieter'
|
|
727
|
+
tenantScope: 'Mieter',
|
|
728
|
+
blockletStudio: 'Blocklet Studio',
|
|
729
|
+
allComponentsNotRunning: 'Blocklets läuft nicht, bitte starten Sie es zuerst'
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: 'Die Länge des Titels muss mindestens 3 Zeichen betragen',
|
|
729
732
|
descriptionValidationError: 'Die Beschreibungslänge muss zwischen 3 und 160 Zeichen liegen'
|
package/lib/locales/en.js
CHANGED
|
@@ -582,6 +582,7 @@ export default {
|
|
|
582
582
|
requiredBy: 'The Blocklet is required by {name}'
|
|
583
583
|
},
|
|
584
584
|
choose: 'Choose',
|
|
585
|
+
upgrade: 'Upgrade',
|
|
585
586
|
addWithName: 'Add Blocklet To {name}',
|
|
586
587
|
relatedComponents: 'Related Blocklets',
|
|
587
588
|
required: 'Required',
|
|
@@ -659,8 +660,9 @@ export default {
|
|
|
659
660
|
delete: 'Delete {name}',
|
|
660
661
|
copyInstallUrl: 'Copy Install URL',
|
|
661
662
|
createResource: 'Create Resource',
|
|
663
|
+
blockletStudio: 'Blocklet Studio',
|
|
662
664
|
tenantScope: 'Tenant',
|
|
663
|
-
addResource: 'Add
|
|
665
|
+
addResource: 'Add Blocklet',
|
|
664
666
|
productTitle: 'Product',
|
|
665
667
|
versionTitle: 'Version',
|
|
666
668
|
imgTitle: 'Images',
|
|
@@ -669,7 +671,8 @@ export default {
|
|
|
669
671
|
createBlockletTip: 'You can create new blocklet through existing resources, components, and configuration in this application',
|
|
670
672
|
createBlocklet: 'New blocklet',
|
|
671
673
|
reconnectStoreTip: 'After reconnecting, a new developer will be bound. Are you sure you want to reconnect?',
|
|
672
|
-
componentNotRunning: '
|
|
674
|
+
componentNotRunning: 'Blocklet {name} is not running, please start it first',
|
|
675
|
+
allComponentsNotRunning: 'Blocklets is not running, please start it first',
|
|
673
676
|
releaseEmptyTip: "There aren't any releases here",
|
|
674
677
|
viewLastRelease: 'View last release',
|
|
675
678
|
createReleaseTip: 'You can create a release of the blocklet, along with release notes and resources, for other people to use',
|
package/lib/locales/es.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'Bloques relacionados',
|
|
614
614
|
required: 'Requerido',
|
|
615
615
|
installed: 'Instalado',
|
|
616
|
-
installingTip: 'Instalando componente, por favor espere...'
|
|
616
|
+
installingTip: 'Instalando componente, por favor espere...',
|
|
617
|
+
upgrade: 'Mejorar'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: 'URL Path',
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: 'Aquí no hay bloqueadores',
|
|
672
673
|
createBlockletTip: 'Puede crear un nuevo blocklet a través de recursos, componentes y configuración existentes en esta aplicación',
|
|
673
674
|
createBlocklet: 'Nuevo bloque',
|
|
674
|
-
componentNotRunning: 'El
|
|
675
|
+
componentNotRunning: 'El Blocklet {name} no está en ejecución, por favor inícialo primero',
|
|
675
676
|
releaseEmptyTip: 'No hay ninguna versión aquí',
|
|
676
677
|
createReleaseTip: 'Puedes crear una versión de la blocklet, junto con notas de lanzamiento y recursos, para que otras personas la puedan utilizar',
|
|
677
678
|
createRelease: 'Nuevo lanzamiento',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'Actualmente, como un Bloque de Recursos, no se puede instalar directamente desde la Tienda.',
|
|
724
725
|
whyCantSeeInStore: '¿Por qué no puedo ver este blocklet en la Tienda?',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: '¿Por qué no puedo ver este Recurso Blocklet en la Tienda?',
|
|
726
|
-
tenantScope: 'Inquilino'
|
|
727
|
+
tenantScope: 'Inquilino',
|
|
728
|
+
blockletStudio: 'Blocklet Studio',
|
|
729
|
+
allComponentsNotRunning: 'Blocklets no está ejecutándose, por favor inícialo primero'
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: 'La longitud del título debe ser de al menos 3 caracteres',
|
|
729
732
|
descriptionValidationError: 'La longitud de la descripción debe estar entre 3 y 160 caracteres'
|
package/lib/locales/fr.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'Blocklets associés',
|
|
614
614
|
required: 'Obligatoire',
|
|
615
615
|
installed: 'Installé',
|
|
616
|
-
installingTip: 'Installation du composant, veuillez patienter...'
|
|
616
|
+
installingTip: 'Installation du composant, veuillez patienter...',
|
|
617
|
+
upgrade: 'Mise à niveau'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: "Chemin d'URL",
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: "Il n'y a pas de blocs ici",
|
|
672
673
|
createBlockletTip: 'Vous pouvez créer un nouveau blocklet à partir des ressources, composants et configurations existants dans cette application',
|
|
673
674
|
createBlocklet: 'Nouvelle blocklet',
|
|
674
|
-
componentNotRunning: "Le
|
|
675
|
+
componentNotRunning: "Le bloc {name} ne fonctionne pas, veuillez le démarrer d'abord",
|
|
675
676
|
releaseEmptyTip: "Il n'y a pas de sorties ici",
|
|
676
677
|
createReleaseTip: "Vous pouvez créer une version du blocklet, ainsi que des notes de version et des ressources, pour que d'autres personnes puissent les utiliser.",
|
|
677
678
|
createRelease: 'Nouvelle version',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'Actuellement, en tant que bloc de ressources, il ne peut pas être installé directement depuis le Store.',
|
|
724
725
|
whyCantSeeInStore: 'Pourquoi je ne peux pas voir ce blocklet dans le Store?',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: 'Pourquoi je ne peux pas voir ce Blocklet de ressources dans le magasin ?',
|
|
726
|
-
tenantScope: 'Locataire'
|
|
727
|
+
tenantScope: 'Locataire',
|
|
728
|
+
blockletStudio: 'Blocklet Studio',
|
|
729
|
+
allComponentsNotRunning: "Blocklets ne fonctionne pas, veuillez le démarrer d'abord"
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: "La longueur du titre doit être d'au moins 3 caractères",
|
|
729
732
|
descriptionValidationError: 'La longueur de la description doit être comprise entre 3 et 160 caractères'
|
package/lib/locales/hi.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'संबंधित ब्लॉकलेट्स',
|
|
614
614
|
required: 'आवश्यक',
|
|
615
615
|
installed: 'स्थापित',
|
|
616
|
-
installingTip: 'घटक स्थापित हो रहा है, कृपया प्रतीक्षा करें...'
|
|
616
|
+
installingTip: 'घटक स्थापित हो रहा है, कृपया प्रतीक्षा करें...',
|
|
617
|
+
upgrade: 'अपग्रेड'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: 'URL पथ',
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: 'यहाँ कोई ब्लॉकलेट नहीं हैं',
|
|
672
673
|
createBlockletTip: 'आप इस ऐप्लिकेशन में मौजूदा संसाधनों, कॉम्पोनेंट्स और कॉन्फ़िगरेशन के माध्यम से नया ब्लॉकलेट बना सकते हैं',
|
|
673
674
|
createBlocklet: 'नया ब्लॉकलेट',
|
|
674
|
-
componentNotRunning: '
|
|
675
|
+
componentNotRunning: 'ब्लॉकलेट {name} चल रहा नहीं है, कृपया पहले इसे स्टार्ट करें',
|
|
675
676
|
releaseEmptyTip: 'यहां कोई रिलीज़ नहीं हैं',
|
|
676
677
|
createReleaseTip: 'आप ब्लॉकलेट का एक रिलीज़ बना सकते हैं, रिलीज़ नोट्स और संसाधनों के साथ, जिन्हें दूसरे लोगों का उपयोग कर सकते हैं।',
|
|
677
678
|
createRelease: 'नई रिलीज़',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'वर्तमान में, रिसोर्स ब्लॉकलेट के रूप में, यह स्टोर से सीधे स्थापित नहीं किया जा सकता है।',
|
|
724
725
|
whyCantSeeInStore: 'क्यों मुझे स्टोर में इस ब्लॉकलेट को नहीं देख सकता?',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: 'क्यों मुझे दुकान में इस संसाधन ब्लॉकलेट को नहीं देख सकता हूँ?',
|
|
726
|
-
tenantScope: 'किरायेदार'
|
|
727
|
+
tenantScope: 'किरायेदार',
|
|
728
|
+
blockletStudio: 'ब्लॉकलेट स्टूडियो',
|
|
729
|
+
allComponentsNotRunning: 'ब्लॉकलेट्स चल नहीं रहा है, कृपया पहले इसे शुरू करें'
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: 'शीर्षक की लंबाई कम से कम 3 अक्षर होनी चाहिए',
|
|
729
732
|
descriptionValidationError: 'विवरण की लंबाई 3 और 160 वर्णों के बीच होनी चाहिए'
|
package/lib/locales/i18n.db
CHANGED
|
Binary file
|
package/lib/locales/id.js
CHANGED
|
@@ -613,7 +613,8 @@ export default {
|
|
|
613
613
|
relatedComponents: 'Blocklet Terkait',
|
|
614
614
|
required: 'Dibutuhkan',
|
|
615
615
|
installed: 'Terpasang',
|
|
616
|
-
installingTip: 'Sedang menginstal komponen, harap tunggu...'
|
|
616
|
+
installingTip: 'Sedang menginstal komponen, harap tunggu...',
|
|
617
|
+
upgrade: 'Tingkatkan'
|
|
617
618
|
},
|
|
618
619
|
router: {
|
|
619
620
|
urlPath: 'URL Path',
|
|
@@ -671,7 +672,7 @@ export default {
|
|
|
671
672
|
blockletEmptyTip: 'Tidak ada blok di sini',
|
|
672
673
|
createBlockletTip: 'Anda dapat membuat blocklet baru melalui sumber daya, komponen, dan konfigurasi yang ada dalam aplikasi ini',
|
|
673
674
|
createBlocklet: 'Blok baru',
|
|
674
|
-
componentNotRunning: '
|
|
675
|
+
componentNotRunning: 'Blocklet {name} tidak berjalan, harap mulai terlebih dahulu',
|
|
675
676
|
releaseEmptyTip: 'Tidak ada rilis di sini',
|
|
676
677
|
createReleaseTip: 'Anda dapat membuat rilis dari blocklet, bersama dengan catatan rilis dan sumber daya, agar orang lain dapat menggunakannya',
|
|
677
678
|
createRelease: 'Rilis baru',
|
|
@@ -723,7 +724,9 @@ export default {
|
|
|
723
724
|
resourceTip: 'Saat ini, sebagai Blok Sumber Daya, tidak dapat diinstal langsung dari Toko.',
|
|
724
725
|
whyCantSeeInStore: 'Mengapa saya tidak dapat melihat blok ini di Toko?',
|
|
725
726
|
whyCantSeeResourceBlockletInStore: 'Mengapa saya tidak bisa melihat Resource Blocklet ini di Toko?',
|
|
726
|
-
tenantScope: 'Penyewa'
|
|
727
|
+
tenantScope: 'Penyewa',
|
|
728
|
+
blockletStudio: 'Blocklet Studio',
|
|
729
|
+
allComponentsNotRunning: 'Blocklets tidak sedang berjalan, harap mulai terlebih dahulu'
|
|
727
730
|
},
|
|
728
731
|
titleValidationError: 'Panjang judul harus setidaknya 3 karakter',
|
|
729
732
|
descriptionValidationError: 'Panjang deskripsi harus antara 3 dan 160 karakter.'
|