@abtnode/ux 1.16.25-next-bc2f4c63 → 1.16.26-beta-e0056285
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/es/analytics/disk.js +8 -11
- package/es/analytics/memory.js +1 -2
- package/es/analytics/runtime.js +1 -2
- package/es/analytics/traffic.js +1 -2
- package/es/blocklet/actions.js +11 -1
- package/es/blocklet/component/add-component-core.js +8 -0
- package/es/blocklet/component/component-cell.js +2 -1
- package/es/blocklet/component/select-store.js +8 -4
- package/es/blocklet/disk-info.js +1 -1
- package/es/blocklet/icons.js +3 -1
- package/es/blocklet/overview.js +13 -7
- package/es/blocklet/publish/connect-store-list.js +62 -0
- package/es/blocklet/publish/create-release.js +192 -49
- package/es/blocklet/publish/index.js +0 -4
- package/es/blocklet/publish/project-list.js +133 -29
- package/es/blocklet/publish/release-list.js +19 -5
- package/es/blocklet/publish/resource.js +46 -34
- package/es/blocklet/publish/select-components.js +3 -3
- package/es/blocklet/router/rule-list.js +2 -1
- package/es/locales/ar.js +23 -10
- package/es/locales/de.js +22 -9
- package/es/locales/en.js +21 -10
- package/es/locales/es.js +22 -9
- package/es/locales/fr.js +22 -9
- package/es/locales/hi.js +22 -9
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +23 -10
- package/es/locales/ja.js +23 -10
- package/es/locales/ko.js +23 -10
- package/es/locales/pt.js +22 -9
- package/es/locales/ru.js +22 -9
- package/es/locales/th.js +22 -9
- package/es/locales/vi.js +23 -10
- package/es/locales/zh-tw.js +22 -9
- package/es/locales/zh.js +27 -14
- package/es/store/add.js +1 -0
- package/es/store/delete.js +9 -4
- package/es/store/item.js +233 -36
- package/es/team/members/connections.js +2 -1
- package/es/team/members/member.js +2 -1
- package/es/util/index.js +8 -8
- package/lib/analytics/disk.js +7 -10
- package/lib/analytics/memory.js +5 -6
- package/lib/analytics/runtime.js +1 -2
- package/lib/analytics/traffic.js +2 -3
- package/lib/blocklet/actions.js +14 -2
- package/lib/blocklet/component/add-component-core.js +4 -1
- package/lib/blocklet/component/component-cell.js +2 -1
- package/lib/blocklet/component/select-store.js +8 -4
- package/lib/blocklet/disk-info.js +2 -2
- package/lib/blocklet/icons.js +3 -1
- package/lib/blocklet/overview.js +13 -7
- package/lib/blocklet/publish/connect-store-list.js +72 -0
- package/lib/blocklet/publish/create-release.js +194 -47
- package/lib/blocklet/publish/index.js +0 -4
- package/lib/blocklet/publish/project-list.js +133 -29
- package/lib/blocklet/publish/release-list.js +19 -5
- package/lib/blocklet/publish/resource.js +45 -33
- package/lib/blocklet/publish/select-components.js +3 -3
- package/lib/blocklet/router/rule-list.js +2 -1
- package/lib/locales/ar.js +23 -10
- package/lib/locales/de.js +22 -9
- package/lib/locales/en.js +21 -10
- package/lib/locales/es.js +22 -9
- package/lib/locales/fr.js +22 -9
- package/lib/locales/hi.js +22 -9
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +23 -10
- package/lib/locales/ja.js +23 -10
- package/lib/locales/ko.js +23 -10
- package/lib/locales/pt.js +22 -9
- package/lib/locales/ru.js +22 -9
- package/lib/locales/th.js +22 -9
- package/lib/locales/vi.js +23 -10
- package/lib/locales/zh-tw.js +22 -9
- package/lib/locales/zh.js +27 -14
- package/lib/store/add.js +1 -0
- package/lib/store/delete.js +9 -4
- package/lib/store/item.js +233 -37
- package/lib/team/members/connections.js +2 -1
- package/lib/team/members/member.js +2 -1
- package/lib/util/index.js +14 -13
- package/package.json +17 -17
- package/es/blocklet/publish/create-project.js +0 -205
- package/lib/blocklet/publish/create-project.js +0 -215
package/es/locales/vi.js
CHANGED
|
@@ -257,7 +257,7 @@ export default {
|
|
|
257
257
|
protected: 'Bảo vệ',
|
|
258
258
|
protocol: 'Giao thức',
|
|
259
259
|
publish: 'Xuất bản',
|
|
260
|
-
published: '
|
|
260
|
+
published: 'Công bố',
|
|
261
261
|
purchase: 'Mua hàng',
|
|
262
262
|
readMore: 'Nhiều hơn',
|
|
263
263
|
redirect: 'Chuyển hướng',
|
|
@@ -348,7 +348,12 @@ export default {
|
|
|
348
348
|
endTime: 'Thời gian kết thúc',
|
|
349
349
|
selected: 'Đã chọn',
|
|
350
350
|
timeoutError: 'Lỗi thời gian chờ',
|
|
351
|
-
tags: 'Tags'
|
|
351
|
+
tags: 'Tags',
|
|
352
|
+
publishToStore: 'Xuất bản vào Cửa hàng',
|
|
353
|
+
connectToStore: 'Kết nối tới Cửa hàng',
|
|
354
|
+
uploaded: 'Đã tải lên',
|
|
355
|
+
uploadToStore: 'Tải lên Cửa hàng',
|
|
356
|
+
upload: 'Tải lên'
|
|
352
357
|
},
|
|
353
358
|
blocklet: {
|
|
354
359
|
external: 'Bên ngoài',
|
|
@@ -655,12 +660,12 @@ export default {
|
|
|
655
660
|
resourceTitle: 'Tài nguyên',
|
|
656
661
|
blockletEmptyTip: 'Ở đây không có khối',
|
|
657
662
|
createBlockletTip: 'Bạn có thể tạo blocklet mới thông qua các tài nguyên, thành phần và cấu hình hiện có trong ứng dụng này',
|
|
658
|
-
createBlocklet: '
|
|
663
|
+
createBlocklet: 'Khối mới',
|
|
659
664
|
deleteBlockletTip: 'Blocklet không thể khôi phục sau khi xóa, vui lòng xác nhận',
|
|
660
665
|
componentNotRunning: 'Thành phần {name} không đang chạy, vui lòng khởi động trước',
|
|
661
666
|
releaseEmptyTip: 'Không có bản phát hành ở đây',
|
|
662
667
|
createReleaseTip: 'Bạn có thể tạo một phiên bản của blocklet, cùng với ghi chú về phiên bản và tài nguyên, để mọi người khác có thể sử dụng',
|
|
663
|
-
createRelease: '
|
|
668
|
+
createRelease: 'Phiên bản mới',
|
|
664
669
|
deleteReleaseTip: 'Phiên bản không thể khôi phục sau khi xóa',
|
|
665
670
|
createBlockletDid: 'Tạo từ Ví Điện tử DID',
|
|
666
671
|
createReleaseSuccess: 'Phát hành được tạo thành công',
|
|
@@ -680,13 +685,21 @@ export default {
|
|
|
680
685
|
noDescription: 'Yêu cầu miêu tả Blocklet',
|
|
681
686
|
noNote: 'Cần có Ghi chú phát hành'
|
|
682
687
|
},
|
|
683
|
-
packTip: 'Các thành phần và cấu hình ứng dụng sẽ được tự động bao gồm trong
|
|
688
|
+
packTip: 'Hiện tại, blocklet có thể được cài đặt trực tiếp như các ứng dụng. Các thành phần và cấu hình ứng dụng sẽ được tự động bao gồm trong Blocklet.',
|
|
684
689
|
resourceChangedWarning: 'Bạn đã chỉnh sửa nguồn tài nguyên, vui lòng lưu lại đúng giờ',
|
|
685
|
-
installResourceTip: '
|
|
690
|
+
installResourceTip: 'Đường dẫn Cài đặt:',
|
|
686
691
|
installResourceTip2: 'Nếu bạn muốn xem thêm những mẹo khác, vui lòng truy cập',
|
|
687
692
|
installResourceHelp: 'Tài liệu giúp đỡ',
|
|
688
693
|
componentIncluded: 'Bao gồm',
|
|
689
|
-
componentForceRequired: 'Bắt Buộc Yêu Cầu'
|
|
694
|
+
componentForceRequired: 'Bắt Buộc Yêu Cầu',
|
|
695
|
+
productListTitle: 'Xuất bản Blocklets',
|
|
696
|
+
download: 'Tải về {name}',
|
|
697
|
+
delete: 'Xóa {name}',
|
|
698
|
+
copyInstallUrl: 'Sao chép URL cài đặt',
|
|
699
|
+
install: 'Cài đặt {name}',
|
|
700
|
+
publishToStoreSuccess: 'Blocklet đã được xuất bản vào cửa hàng thành công',
|
|
701
|
+
connectStoreSuccess: 'Kết nối Blocklet Store thành công',
|
|
702
|
+
uploadToStoreSuccess: 'Blocklet đã tải lên Store thành công, bạn cần phải xuất bản nó trong Store'
|
|
690
703
|
},
|
|
691
704
|
titleValidationError: 'Độ dài tiêu đề phải ít nhất 3 ký tự',
|
|
692
705
|
descriptionValidationError: 'Chiều dài mô tả phải từ 3 đến 160 ký tự.'
|
|
@@ -790,7 +803,7 @@ export default {
|
|
|
790
803
|
switchLabel: 'Trang Chào mừng'
|
|
791
804
|
},
|
|
792
805
|
upgrade: {
|
|
793
|
-
title: 'Nâng cấp
|
|
806
|
+
title: 'Nâng cấp máy chủ Blocklet',
|
|
794
807
|
description: 'Trong quá trình nâng cấp, máy chủ Blocklet của bạn sẽ vào chế độ bảo trì trong vài phút trong khi cập nhật hoàn tất.',
|
|
795
808
|
dialog: 'Nhấp vào "xác nhận" để cài đặt bản cập nhật. Blocklet Server sẽ vào chế độ bảo trì cho đến khi cập nhật hoàn thành và tự động trở lại chế độ sản xuất.',
|
|
796
809
|
confirm: 'Nâng cấp',
|
|
@@ -803,7 +816,7 @@ export default {
|
|
|
803
816
|
verifying: 'Đang xác minh máy chủ Blocklet v{version}',
|
|
804
817
|
rollback: 'Máy chủ Rollback Blocklet',
|
|
805
818
|
complete: 'Nâng cấp đã hoàn thành!',
|
|
806
|
-
progress: 'Nâng cấp
|
|
819
|
+
progress: 'Nâng cấp {name}',
|
|
807
820
|
check: 'Kiểm tra cập nhật',
|
|
808
821
|
latest: 'Bạn đang chạy phiên bản mới nhất.'
|
|
809
822
|
},
|
|
@@ -818,7 +831,7 @@ export default {
|
|
|
818
831
|
cleanup: 'Đảm bảo mọi thứ đều ổn',
|
|
819
832
|
rollback: 'Dọn dẹp trạng thái bẩn',
|
|
820
833
|
complete: 'Giữ hoàn chỉnh!',
|
|
821
|
-
progress: 'Khởi động lại
|
|
834
|
+
progress: 'Khởi động lại {name}'
|
|
822
835
|
},
|
|
823
836
|
register: {
|
|
824
837
|
titleAdded: 'Thêm vào Blocklet Launcher',
|
package/es/locales/zh-tw.js
CHANGED
|
@@ -348,7 +348,12 @@ export default {
|
|
|
348
348
|
endTime: '結束時間',
|
|
349
349
|
selected: '已選取',
|
|
350
350
|
timeoutError: '超時錯誤',
|
|
351
|
-
tags: '標籤'
|
|
351
|
+
tags: '標籤',
|
|
352
|
+
publishToStore: '發布到商店',
|
|
353
|
+
connectToStore: '連接至商店',
|
|
354
|
+
uploaded: '已上傳',
|
|
355
|
+
uploadToStore: '上傳至 Store',
|
|
356
|
+
upload: '上傳'
|
|
352
357
|
},
|
|
353
358
|
blocklet: {
|
|
354
359
|
external: '外部的',
|
|
@@ -655,12 +660,12 @@ export default {
|
|
|
655
660
|
resourceTitle: '資源',
|
|
656
661
|
blockletEmptyTip: '這裡沒有任何區塊元件',
|
|
657
662
|
createBlockletTip: '您可以透過現有的資源、元件和設定,在此應用程式中建立新的 blocklet',
|
|
658
|
-
createBlocklet: '
|
|
663
|
+
createBlocklet: '新的區塊',
|
|
659
664
|
deleteBlockletTip: '刪除後無法恢復區塊,請確認',
|
|
660
665
|
componentNotRunning: '{name}元件未運行,請先啟動。',
|
|
661
666
|
releaseEmptyTip: '這裡沒有任何發布',
|
|
662
667
|
createReleaseTip: '您可以創建一個區塊釋出,附帶釋出說明和資源,供其他人使用',
|
|
663
|
-
createRelease: '
|
|
668
|
+
createRelease: '新版本發布',
|
|
664
669
|
deleteReleaseTip: '刪除後無法還原發布',
|
|
665
670
|
createBlockletDid: '從DID錢包創建',
|
|
666
671
|
createReleaseSuccess: '發佈成功',
|
|
@@ -680,13 +685,21 @@ export default {
|
|
|
680
685
|
noDescription: '需要提供 Blocklet 描述',
|
|
681
686
|
noNote: '需要提供發佈說明'
|
|
682
687
|
},
|
|
683
|
-
packTip: '
|
|
688
|
+
packTip: '目前,blocklet可以直接安裝為應用程序。組件和應用程序配置將自動包含在blocklet中',
|
|
684
689
|
resourceChangedWarning: '您已修改資源,請儘速保存',
|
|
685
|
-
installResourceTip: '
|
|
690
|
+
installResourceTip: '安裝網址:',
|
|
686
691
|
installResourceTip2: '如果您想查看更多提示,請訪問 {name}',
|
|
687
692
|
installResourceHelp: '幫助文件',
|
|
688
693
|
componentIncluded: '已包含',
|
|
689
|
-
componentForceRequired: '強制要求'
|
|
694
|
+
componentForceRequired: '強制要求',
|
|
695
|
+
productListTitle: '發布 Blocklets',
|
|
696
|
+
download: '下載 {name}',
|
|
697
|
+
delete: '刪除 {name}',
|
|
698
|
+
copyInstallUrl: '複製安裝連結',
|
|
699
|
+
install: '安裝{name}',
|
|
700
|
+
publishToStoreSuccess: '成功發佈到 Store 的區塊鏈',
|
|
701
|
+
connectStoreSuccess: 'Store 連線成功',
|
|
702
|
+
uploadToStoreSuccess: 'Blocklet 成功上傳至 Store,請在 Store 中發布'
|
|
690
703
|
},
|
|
691
704
|
titleValidationError: '標題長度必須至少為3到40個字符',
|
|
692
705
|
descriptionValidationError: '描述長度必須介於3到160個字符之間'
|
|
@@ -790,7 +803,7 @@ export default {
|
|
|
790
803
|
switchLabel: '歡迎頁面'
|
|
791
804
|
},
|
|
792
805
|
upgrade: {
|
|
793
|
-
title: '升級 Blocklet 伺服器
|
|
806
|
+
title: '升級 Blocklet 伺服器',
|
|
794
807
|
description: '在升級期間,您的 Blocklet 伺服器將進入維護模式,更新完成後將持續幾分鐘。',
|
|
795
808
|
dialog: '點擊"確認"安裝更新。Blocklet服務器將進入維護模式,直到更新完成並自動返回生產模式。',
|
|
796
809
|
confirm: '升級',
|
|
@@ -803,7 +816,7 @@ export default {
|
|
|
803
816
|
verifying: '正在驗證Blocklet服務器v{version}',
|
|
804
817
|
rollback: '回滾Blocklet伺服器',
|
|
805
818
|
complete: '升級完成!',
|
|
806
|
-
progress: '
|
|
819
|
+
progress: '升級 {name}',
|
|
807
820
|
check: '檢查更新',
|
|
808
821
|
latest: '您正在執行最新版本。'
|
|
809
822
|
},
|
|
@@ -818,7 +831,7 @@ export default {
|
|
|
818
831
|
cleanup: '確保一切正常',
|
|
819
832
|
rollback: '清理髒污狀態',
|
|
820
833
|
complete: '維護完成!',
|
|
821
|
-
progress: '重新啟動
|
|
834
|
+
progress: '重新啟動 {name}'
|
|
822
835
|
},
|
|
823
836
|
register: {
|
|
824
837
|
titleAdded: '已新增至 Blocklet Launcher',
|
package/es/locales/zh.js
CHANGED
|
@@ -257,7 +257,7 @@ export default {
|
|
|
257
257
|
protected: '受保护',
|
|
258
258
|
protocol: '协议',
|
|
259
259
|
publish: '发布',
|
|
260
|
-
published: '
|
|
260
|
+
published: '已发布',
|
|
261
261
|
purchase: '购买',
|
|
262
262
|
readMore: '更多',
|
|
263
263
|
redirect: '重定向',
|
|
@@ -348,7 +348,12 @@ export default {
|
|
|
348
348
|
endTime: '结束时间',
|
|
349
349
|
selected: '已选中',
|
|
350
350
|
timeoutError: '超时错误',
|
|
351
|
-
tags: '标签'
|
|
351
|
+
tags: '标签',
|
|
352
|
+
publishToStore: '发布到 Store',
|
|
353
|
+
connectToStore: '连接 Store',
|
|
354
|
+
uploaded: '已上传',
|
|
355
|
+
uploadToStore: '上传到 Store',
|
|
356
|
+
upload: '上传'
|
|
352
357
|
},
|
|
353
358
|
blocklet: {
|
|
354
359
|
external: '外部',
|
|
@@ -655,26 +660,26 @@ export default {
|
|
|
655
660
|
productTitle: 'Blocklet 详情',
|
|
656
661
|
versionTitle: '版本信息',
|
|
657
662
|
imgTitle: '图片资源',
|
|
658
|
-
resourceTitle: '
|
|
659
|
-
blockletEmptyTip: '这里没有任何
|
|
663
|
+
resourceTitle: '资源型 Blocklet',
|
|
664
|
+
blockletEmptyTip: '这里没有任何 Blocklet',
|
|
660
665
|
createBlockletTip: '你可以使用此应用的资源,组件,配置制作新的 Blocklet',
|
|
661
|
-
createBlocklet: '
|
|
666
|
+
createBlocklet: '新的块',
|
|
662
667
|
deleteBlockletTip: '此 Blocklet 删除后不可恢复,是否继续?',
|
|
663
668
|
componentNotRunning: '组件 {name} 未运行',
|
|
664
669
|
releaseEmptyTip: '这里没有任何发布',
|
|
665
|
-
createReleaseTip: '您可以创建 Blocklet
|
|
666
|
-
createRelease: '
|
|
670
|
+
createReleaseTip: '您可以创建 Blocklet 新版本,在发布中包含说明和资源,以供其他人使用',
|
|
671
|
+
createRelease: '创建新的版本',
|
|
667
672
|
deleteReleaseTip: '此发布删除后不可恢复,是否继续?',
|
|
668
673
|
createBlockletDid: '通过 DID 钱包创建',
|
|
669
674
|
createReleaseSuccess: '发布成功',
|
|
670
675
|
saveDraftSuccess: '保存成功',
|
|
671
|
-
packTip: 'Blocklet
|
|
676
|
+
packTip: '您的 Blocklet 现在可以直接安装为应用程序。应用程序配置将自动包含在内',
|
|
672
677
|
resourceChangedWarning: '您修改了资源,请及时保存',
|
|
673
|
-
installResourceTip: '
|
|
678
|
+
installResourceTip: '安装网址:',
|
|
674
679
|
installResourceTip2: '如果你需要更多提示,请查看',
|
|
675
680
|
installResourceHelp: '帮助文档',
|
|
676
681
|
componentIncluded: '包含',
|
|
677
|
-
componentForceRequired: '
|
|
682
|
+
componentForceRequired: '强依赖',
|
|
678
683
|
connect: {
|
|
679
684
|
title: '创建 Blocklet DID',
|
|
680
685
|
scan: '扫描下面的二维码来生成 Blocklet DID',
|
|
@@ -689,7 +694,15 @@ export default {
|
|
|
689
694
|
noVersion: '请填写 Blocklet 版本号',
|
|
690
695
|
noDescription: '请填写 Blocklet 描述',
|
|
691
696
|
noNote: '请填写 发布说明'
|
|
692
|
-
}
|
|
697
|
+
},
|
|
698
|
+
productListTitle: '发布 Blocklets',
|
|
699
|
+
download: '下载 {name}',
|
|
700
|
+
delete: '删除 {name}',
|
|
701
|
+
copyInstallUrl: '复制安装链接',
|
|
702
|
+
install: '安装 {name}',
|
|
703
|
+
publishToStoreSuccess: '成功发布 Blocklet 到 Store',
|
|
704
|
+
connectStoreSuccess: 'Blocklet 成功连接 Store',
|
|
705
|
+
uploadToStoreSuccess: 'Blocklet 成功上传至 Store,请在 Store 中发布'
|
|
693
706
|
},
|
|
694
707
|
titleValidationError: '标题长度必须至少为3到40个字符',
|
|
695
708
|
descriptionValidationError: '描述长度必须在3到160个字符之间'
|
|
@@ -786,7 +799,7 @@ export default {
|
|
|
786
799
|
nftDomainUrl: 'NFT Domain 地址',
|
|
787
800
|
nftDomainUrlPlaceholder: '你可以选择其它的 NFT Domain 服务器, 也可以使用官方提供的版本',
|
|
788
801
|
upgrade: {
|
|
789
|
-
title: '
|
|
802
|
+
title: '升级 Blocklet 服务器',
|
|
790
803
|
description: '在升级期间,节点将会进入维护模式几分钟。',
|
|
791
804
|
dialog: '点击 “确认” 安装更新。节点将进入维护模式,直到更新完成并自动返回生产模式。',
|
|
792
805
|
confirm: '升级',
|
|
@@ -799,7 +812,7 @@ export default {
|
|
|
799
812
|
verifying: '验证节点新版本 v{version}',
|
|
800
813
|
rollback: '回滚此次升级',
|
|
801
814
|
complete: '升级完成!',
|
|
802
|
-
progress: '
|
|
815
|
+
progress: '升级 {name}',
|
|
803
816
|
check: '检查更新',
|
|
804
817
|
latest: '太棒了,你的节点已经是最新版!'
|
|
805
818
|
},
|
|
@@ -814,7 +827,7 @@ export default {
|
|
|
814
827
|
cleanup: '验证重启成功',
|
|
815
828
|
rollback: '撤销重启操作',
|
|
816
829
|
complete: '维护完成',
|
|
817
|
-
progress: '
|
|
830
|
+
progress: '重新开始 {name}'
|
|
818
831
|
},
|
|
819
832
|
welcome: {
|
|
820
833
|
switchLabel: 'Welcome 页面'
|
package/es/store/add.js
CHANGED
|
@@ -16,6 +16,7 @@ import { formatError, isNewStoreUrl } from '../util';
|
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
17
17
|
const useStyles = makeStyles(theme => ({
|
|
18
18
|
addMenuItemRoot: {
|
|
19
|
+
marginTop: '8px',
|
|
19
20
|
justifyContent: 'center',
|
|
20
21
|
color: theme.palette.primary.main,
|
|
21
22
|
lineHeight: '3.2'
|
package/es/store/delete.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useState } from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import IconButton from '@mui/material/IconButton';
|
|
4
3
|
import useTheme from '@mui/material/styles/useTheme';
|
|
5
4
|
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
6
5
|
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
7
6
|
import Toast from '@arcblock/ux/lib/Toast';
|
|
7
|
+
import { Button } from '@mui/material';
|
|
8
8
|
import { useNodeContext } from '../contexts/node';
|
|
9
9
|
import DelConfirm from '../delete-confirm';
|
|
10
10
|
import { formatError } from '../util';
|
|
@@ -66,11 +66,16 @@ export default function DeleteStore({
|
|
|
66
66
|
setConfirmSetting(setting);
|
|
67
67
|
};
|
|
68
68
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
69
|
-
children: [/*#__PURE__*/_jsx(
|
|
69
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
70
|
+
color: "primary",
|
|
70
71
|
disabled: loading,
|
|
71
72
|
onClick: onMenuItemClick,
|
|
72
|
-
size: "
|
|
73
|
-
children: /*#__PURE__*/_jsx(DeleteOutlineIcon, {
|
|
73
|
+
size: "small",
|
|
74
|
+
children: /*#__PURE__*/_jsx(DeleteOutlineIcon, {
|
|
75
|
+
sx: {
|
|
76
|
+
zoom: 0.95
|
|
77
|
+
}
|
|
78
|
+
})
|
|
74
79
|
}), confirmSetting && /*#__PURE__*/_jsx(DelConfirm, {
|
|
75
80
|
keyName: confirmSetting.keyName,
|
|
76
81
|
title: confirmSetting.title,
|
package/es/store/item.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
/* eslint-disable react/jsx-one-expression-per-line */
|
|
2
1
|
import { makeStyles } from '@mui/styles';
|
|
3
|
-
import Typography from '@mui/material
|
|
4
|
-
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
|
|
2
|
+
import { Typography, Button, ButtonGroup, CircularProgress } from '@mui/material';
|
|
5
3
|
import LaunchIcon from '@mui/icons-material/Launch';
|
|
6
|
-
import
|
|
4
|
+
import PublishIcon from '@mui/icons-material/BackupOutlined';
|
|
5
|
+
import LinkOutlinedIcon from '@mui/icons-material/LinkOutlined';
|
|
6
|
+
import DoneIcon from '@mui/icons-material/Done';
|
|
7
7
|
import PropTypes from 'prop-types';
|
|
8
|
+
import { useEffect, useState } from 'react';
|
|
9
|
+
import joinUrl from 'url-join';
|
|
10
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
11
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
8
12
|
import DeleteStore from './delete';
|
|
13
|
+
import { useNodeContext } from '../contexts/node';
|
|
14
|
+
import { formatError } from '../util';
|
|
9
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
16
|
const useStyles = makeStyles(() => ({
|
|
11
17
|
buttonText: {
|
|
@@ -14,62 +20,253 @@ const useStyles = makeStyles(() => ({
|
|
|
14
20
|
iconRoot: {
|
|
15
21
|
minWidth: 24
|
|
16
22
|
},
|
|
23
|
+
box: {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'row',
|
|
26
|
+
justifyContent: 'space-between',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
width: '100%'
|
|
30
|
+
},
|
|
17
31
|
menuName: {
|
|
32
|
+
flexShrink: 1,
|
|
18
33
|
display: 'flex',
|
|
19
34
|
flexDirection: 'column',
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
overflow: 'hidden',
|
|
36
|
+
flex: 1
|
|
37
|
+
},
|
|
38
|
+
actions: {
|
|
39
|
+
flex: 1,
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexDirection: 'row',
|
|
42
|
+
justifyContent: 'flex-end',
|
|
43
|
+
alignItems: 'center'
|
|
44
|
+
},
|
|
45
|
+
title: {
|
|
46
|
+
fontSize: 16,
|
|
47
|
+
overflow: 'hidden',
|
|
48
|
+
textOverflow: 'ellipsis',
|
|
49
|
+
whiteSpace: 'nowrap'
|
|
50
|
+
},
|
|
51
|
+
url: {
|
|
52
|
+
fontSize: 14,
|
|
53
|
+
opacity: 0.5,
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
textOverflow: 'ellipsis',
|
|
56
|
+
whiteSpace: 'nowrap'
|
|
57
|
+
},
|
|
58
|
+
buttonLine: {
|
|
59
|
+
height: '100%',
|
|
60
|
+
width: '1px',
|
|
61
|
+
backgroundColor: '#e0e0e0'
|
|
26
62
|
}
|
|
27
63
|
}));
|
|
28
64
|
export default function StoreItem({
|
|
29
65
|
teamDid,
|
|
66
|
+
projectId,
|
|
67
|
+
releaseId,
|
|
30
68
|
store,
|
|
31
|
-
onDelete
|
|
69
|
+
onDelete,
|
|
70
|
+
kind,
|
|
71
|
+
published,
|
|
72
|
+
connected,
|
|
73
|
+
releaseType,
|
|
74
|
+
onPublish
|
|
32
75
|
}) {
|
|
33
76
|
const classes = useStyles();
|
|
77
|
+
const {
|
|
78
|
+
t
|
|
79
|
+
} = useLocaleContext();
|
|
80
|
+
const {
|
|
81
|
+
api
|
|
82
|
+
} = useNodeContext();
|
|
83
|
+
const [loading, setLoading] = useState(false);
|
|
84
|
+
const isPublish = kind === 'publish';
|
|
85
|
+
const handleOpenUrl = e => {
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
if (isPublish) {
|
|
88
|
+
window.open(joinUrl(store.url, 'developer/blocklets'));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
window.open(store.url);
|
|
92
|
+
};
|
|
93
|
+
const handleConnectToStore = () => {
|
|
94
|
+
setLoading(true);
|
|
95
|
+
setTimeout(() => {
|
|
96
|
+
setLoading(false);
|
|
97
|
+
}, 10000);
|
|
98
|
+
api.connectToStore({
|
|
99
|
+
input: {
|
|
100
|
+
did: teamDid,
|
|
101
|
+
storeUrl: store.url,
|
|
102
|
+
storeId: store.id,
|
|
103
|
+
storeName: store.name
|
|
104
|
+
}
|
|
105
|
+
}).then(res => {
|
|
106
|
+
if (!res?.url) {
|
|
107
|
+
Toast.error('failed to connect to store');
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
window.open(res.url);
|
|
111
|
+
}).catch(err => {
|
|
112
|
+
Toast.error(formatError(err));
|
|
113
|
+
});
|
|
114
|
+
};
|
|
115
|
+
const handleUploadToStore = () => {
|
|
116
|
+
setLoading(true);
|
|
117
|
+
api.publishToStore({
|
|
118
|
+
input: {
|
|
119
|
+
did: teamDid,
|
|
120
|
+
storeId: store.id,
|
|
121
|
+
storeName: store.name,
|
|
122
|
+
projectId,
|
|
123
|
+
releaseId,
|
|
124
|
+
type: releaseType
|
|
125
|
+
}
|
|
126
|
+
}).then(res => {
|
|
127
|
+
if (res.url === 'uploaded') {
|
|
128
|
+
Toast.success(t('blocklet.publish.uploadToStoreSuccess'));
|
|
129
|
+
} else if (res.url === 'published') {
|
|
130
|
+
Toast.success(t('blocklet.publish.publishToStoreSuccess'));
|
|
131
|
+
}
|
|
132
|
+
onPublish?.(null);
|
|
133
|
+
}).catch(err => {
|
|
134
|
+
Toast.error(formatError(err));
|
|
135
|
+
onPublish?.(err);
|
|
136
|
+
}).finally(() => {
|
|
137
|
+
setLoading(false);
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
useEffect(() => {
|
|
141
|
+
if (connected) {
|
|
142
|
+
setLoading(false);
|
|
143
|
+
}
|
|
144
|
+
}, [connected]);
|
|
34
145
|
return /*#__PURE__*/_jsxs("div", {
|
|
35
|
-
className: classes.
|
|
36
|
-
children: [/*#__PURE__*/_jsx(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
style: {
|
|
40
|
-
fontWeight: '400'
|
|
146
|
+
className: classes.box,
|
|
147
|
+
children: [loading && /*#__PURE__*/_jsx(CircularProgress, {
|
|
148
|
+
sx: {
|
|
149
|
+
marginRight: 2
|
|
41
150
|
},
|
|
42
|
-
|
|
43
|
-
}), /*#__PURE__*/
|
|
44
|
-
className:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
151
|
+
size: 16
|
|
152
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
153
|
+
className: classes.menuName,
|
|
154
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
155
|
+
component: "span",
|
|
156
|
+
className: classes.title,
|
|
157
|
+
variant: "subtitle1",
|
|
158
|
+
children: store.name
|
|
159
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
160
|
+
className: classes.url,
|
|
161
|
+
component: "span",
|
|
162
|
+
variant: "inherit",
|
|
163
|
+
children: `${store.url}`
|
|
164
|
+
})]
|
|
165
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
166
|
+
className: classes.actions,
|
|
167
|
+
children: [isPublish && /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
168
|
+
disabled: loading,
|
|
169
|
+
variant: "outlined",
|
|
170
|
+
sx: {
|
|
171
|
+
height: 36
|
|
172
|
+
},
|
|
173
|
+
size: "small",
|
|
174
|
+
children: [!connected && /*#__PURE__*/_jsxs(Button, {
|
|
175
|
+
sx: {
|
|
176
|
+
paddingLeft: 2,
|
|
177
|
+
paddingRight: 2,
|
|
178
|
+
fontSize: 15
|
|
179
|
+
},
|
|
180
|
+
onClick: handleConnectToStore,
|
|
181
|
+
children: [/*#__PURE__*/_jsx(LinkOutlinedIcon, {
|
|
182
|
+
sx: {
|
|
183
|
+
marginRight: 1
|
|
184
|
+
}
|
|
185
|
+
}), t('common.connect')]
|
|
186
|
+
}), connected && published && /*#__PURE__*/_jsxs(Button, {
|
|
187
|
+
disabled: true,
|
|
188
|
+
sx: {
|
|
189
|
+
paddingLeft: 2,
|
|
190
|
+
paddingRight: 2,
|
|
191
|
+
fontSize: 15
|
|
192
|
+
},
|
|
193
|
+
children: [/*#__PURE__*/_jsx(DoneIcon, {
|
|
194
|
+
sx: {
|
|
195
|
+
marginRight: 1
|
|
196
|
+
}
|
|
197
|
+
}), t('common.uploaded')]
|
|
198
|
+
}), connected && !published && /*#__PURE__*/_jsxs(Button, {
|
|
199
|
+
sx: {
|
|
200
|
+
paddingLeft: 2,
|
|
201
|
+
paddingRight: 2,
|
|
202
|
+
fontSize: 15
|
|
203
|
+
},
|
|
204
|
+
onClick: handleUploadToStore,
|
|
205
|
+
children: [/*#__PURE__*/_jsx(PublishIcon, {
|
|
206
|
+
sx: {
|
|
207
|
+
marginRight: 1
|
|
208
|
+
}
|
|
209
|
+
}), t('common.upload')]
|
|
210
|
+
}), /*#__PURE__*/_jsx(Button, {
|
|
211
|
+
onClick: handleOpenUrl,
|
|
212
|
+
children: /*#__PURE__*/_jsx(LaunchIcon, {
|
|
213
|
+
sx: {
|
|
214
|
+
zoom: 0.9
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
}), !store.protected && /*#__PURE__*/_jsx(DeleteStore, {
|
|
218
|
+
store: store,
|
|
219
|
+
onDelete: onDelete,
|
|
220
|
+
teamDid: teamDid
|
|
221
|
+
})]
|
|
222
|
+
}), !isPublish && /*#__PURE__*/_jsxs(ButtonGroup, {
|
|
223
|
+
disabled: loading,
|
|
224
|
+
variant: "outlined",
|
|
225
|
+
sx: {
|
|
226
|
+
height: 36
|
|
53
227
|
},
|
|
54
|
-
size: "
|
|
55
|
-
children: /*#__PURE__*/_jsx(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
228
|
+
size: "small",
|
|
229
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
230
|
+
onClick: handleOpenUrl,
|
|
231
|
+
children: /*#__PURE__*/_jsx(LaunchIcon, {
|
|
232
|
+
sx: {
|
|
233
|
+
zoom: 0.9
|
|
234
|
+
}
|
|
235
|
+
})
|
|
236
|
+
}), !store.protected && /*#__PURE__*/_jsx(DeleteStore, {
|
|
237
|
+
store: store,
|
|
238
|
+
onDelete: onDelete,
|
|
239
|
+
teamDid: teamDid
|
|
240
|
+
})]
|
|
60
241
|
})]
|
|
61
242
|
})]
|
|
62
243
|
});
|
|
63
244
|
}
|
|
64
245
|
StoreItem.propTypes = {
|
|
246
|
+
kind: PropTypes.string,
|
|
65
247
|
teamDid: PropTypes.string.isRequired,
|
|
248
|
+
published: PropTypes.bool,
|
|
249
|
+
connected: PropTypes.bool,
|
|
250
|
+
projectId: PropTypes.string,
|
|
251
|
+
releaseId: PropTypes.string,
|
|
252
|
+
releaseType: PropTypes.string,
|
|
66
253
|
store: PropTypes.shape({
|
|
254
|
+
id: PropTypes.string.isRequired,
|
|
67
255
|
name: PropTypes.string.isRequired,
|
|
68
256
|
url: PropTypes.string.isRequired,
|
|
69
|
-
protected: PropTypes.bool
|
|
257
|
+
protected: PropTypes.bool,
|
|
258
|
+
connected: PropTypes.bool
|
|
70
259
|
}).isRequired,
|
|
71
|
-
onDelete: PropTypes.func
|
|
260
|
+
onDelete: PropTypes.func,
|
|
261
|
+
onPublish: PropTypes.func
|
|
72
262
|
};
|
|
73
263
|
StoreItem.defaultProps = {
|
|
264
|
+
kind: 'store',
|
|
265
|
+
published: false,
|
|
266
|
+
connected: false,
|
|
267
|
+
releaseId: '',
|
|
268
|
+
projectId: '',
|
|
269
|
+
releaseType: '',
|
|
270
|
+
onPublish: () => {},
|
|
74
271
|
onDelete: () => {}
|
|
75
272
|
};
|