@abtnode/ux 1.16.27-beta-c450492a → 1.16.27-beta-d1555a79
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/actions.js +39 -56
- package/lib/analytics/card.js +62 -41
- package/lib/analytics/chart.js +40 -53
- package/lib/analytics/cpu.js +20 -28
- package/lib/analytics/disk.js +40 -52
- package/lib/analytics/memory.js +28 -37
- package/lib/analytics/runtime.js +40 -52
- package/lib/analytics/traffic.js +87 -98
- package/lib/blocklet/access/config-access.js +109 -106
- package/lib/blocklet/access/index.js +96 -102
- package/lib/blocklet/actions.js +312 -332
- package/lib/blocklet/add-cert.js +57 -73
- package/lib/blocklet/agreement-app.js +13 -23
- package/lib/blocklet/agreement.js +126 -58
- package/lib/blocklet/app-avatar.js +19 -35
- package/lib/blocklet/audit-logs.js +139 -98
- package/lib/blocklet/authentication/common-settings.js +88 -104
- package/lib/blocklet/authentication/federated/federated-detail-dialog.js +57 -66
- package/lib/blocklet/authentication/federated/federated-invite-dialog.js +29 -39
- package/lib/blocklet/authentication/federated/federated-join-dialog.js +36 -45
- package/lib/blocklet/authentication/federated/federated-site-list.js +73 -87
- package/lib/blocklet/authentication/federated/index.js +35 -48
- package/lib/blocklet/authentication/index.js +27 -34
- package/lib/blocklet/authentication/oauth/apple.js +125 -152
- package/lib/blocklet/authentication/oauth/auth0.js +93 -114
- package/lib/blocklet/authentication/oauth/drag-item.js +49 -57
- package/lib/blocklet/authentication/oauth/github.js +78 -96
- package/lib/blocklet/authentication/oauth/google.js +78 -96
- package/lib/blocklet/authentication/oauth/index.js +47 -61
- package/lib/blocklet/blocklet-source.js +23 -32
- package/lib/blocklet/bundle-avatar.js +26 -42
- package/{es/blocklet/component → lib/blocklet/component/add-component}/add-component-core.js +161 -237
- package/{es/blocklet/component → lib/blocklet/component/add-component}/add-component-dialog.js +2 -2
- package/lib/blocklet/component/add-component/step-connect.js +215 -0
- package/lib/blocklet/component/button.js +9 -20
- package/lib/blocklet/component/component-cell.js +141 -137
- package/lib/blocklet/component/component-info-dialog.js +94 -90
- package/lib/blocklet/component/configuration.js +56 -58
- package/lib/blocklet/component/delete.js +56 -66
- package/lib/blocklet/component/did-space/connect-to.js +100 -108
- package/lib/blocklet/component/did-space/connected.js +14 -21
- package/lib/blocklet/component/did-space/delete.js +31 -39
- package/lib/blocklet/component/did-space/disconnect.js +58 -69
- package/lib/blocklet/component/did-space/index.js +40 -47
- package/lib/blocklet/component/did-space/item.js +113 -78
- package/lib/blocklet/component/domain-list.js +211 -230
- package/lib/blocklet/component/environment.js +137 -92
- package/lib/blocklet/component/index.js +230 -222
- package/lib/blocklet/component/line.js +10 -18
- package/lib/blocklet/component/navigation/locale-tabs.js +64 -76
- package/lib/blocklet/component/navigation/navigation-actions.js +43 -51
- package/lib/blocklet/component/navigation/navigation-dialog.js +263 -299
- package/lib/blocklet/component/navigation/navigation-preview.js +44 -48
- package/lib/blocklet/component/navigation/simple-select.js +54 -70
- package/lib/blocklet/component/optional-component-cell.js +91 -55
- package/lib/blocklet/component/related-components-dialog.js +40 -50
- package/lib/blocklet/component/select-store.js +70 -74
- package/lib/blocklet/component/selected/index.js +72 -26
- package/lib/blocklet/component/setting.js +48 -62
- package/lib/blocklet/component/shorten-label.js +34 -0
- package/lib/blocklet/component/sortable-tree.js +49 -63
- package/lib/blocklet/component/space-connector.js +64 -78
- package/lib/blocklet/component/space-selector.js +65 -71
- package/lib/blocklet/component/start.js +42 -49
- package/lib/blocklet/component/step-actions.js +72 -37
- package/lib/blocklet/component/store-blocklet-list.js +93 -103
- package/lib/blocklet/component/switch-control.js +36 -42
- package/lib/blocklet/config-navigation.js +106 -134
- package/lib/blocklet/configuration.js +188 -171
- package/lib/blocklet/disk-info.js +26 -44
- package/lib/blocklet/icons.js +21 -28
- package/lib/blocklet/install-from-url.js +93 -107
- package/lib/blocklet/log.js +27 -43
- package/lib/blocklet/logo-uploader.js +76 -58
- package/lib/blocklet/migration.js +40 -50
- package/lib/blocklet/mode.js +12 -28
- package/lib/blocklet/notification/email.js +154 -186
- package/lib/blocklet/notification/index.js +20 -27
- package/lib/blocklet/overview.js +59 -60
- package/lib/blocklet/page-group.js +12 -28
- package/lib/blocklet/preferences/app-sk.js +54 -57
- package/lib/blocklet/preferences/index.js +100 -111
- package/lib/blocklet/publish/connect-store-button.js +112 -0
- package/lib/blocklet/publish/connect-store-list.js +51 -56
- package/lib/blocklet/publish/create-release.js +512 -392
- package/lib/blocklet/publish/index.js +42 -46
- package/lib/blocklet/publish/project-list.js +128 -106
- package/lib/blocklet/publish/release-list.js +98 -97
- package/lib/blocklet/publish/resource.js +186 -157
- package/lib/blocklet/publish/select-components.js +73 -68
- package/lib/blocklet/publish/tree.js +141 -109
- package/lib/blocklet/publish/wait-connect.js +64 -0
- package/lib/blocklet/purchase/common.js +37 -45
- package/lib/blocklet/purchase/component-purchase.js +74 -91
- package/lib/blocklet/purchase/index.js +3 -12
- package/lib/blocklet/resource-type.js +19 -36
- package/lib/blocklet/router/action/add-domain-alias.js +56 -67
- package/lib/blocklet/router/action/add-rule.js +63 -73
- package/lib/blocklet/router/action/config-routing-rule.js +84 -93
- package/lib/blocklet/router/action/delete-domain-alias.js +27 -34
- package/lib/blocklet/router/action/delete-rule.js +31 -39
- package/lib/blocklet/router/action/update-rule.js +66 -76
- package/lib/blocklet/router/add-domain.js +113 -131
- package/lib/blocklet/router/dns-tip.js +40 -57
- package/lib/blocklet/router/domain-actions.js +52 -67
- package/lib/blocklet/router/domain-status.js +27 -35
- package/lib/blocklet/router/rule-actions.js +45 -60
- package/lib/blocklet/router/rule-list.js +83 -92
- package/lib/blocklet/router/util.js +30 -46
- package/lib/blocklet/runtime-info.js +30 -48
- package/lib/blocklet/status.js +37 -52
- package/lib/blocklet/storage/action.js +59 -76
- package/lib/blocklet/storage/auto-backup.js +23 -31
- package/lib/blocklet/storage/auto-check-update.js +28 -42
- package/lib/blocklet/storage/backups.js +50 -60
- package/lib/blocklet/storage/connect-to.js +100 -106
- package/lib/blocklet/storage/connected.js +35 -40
- package/lib/blocklet/storage/delete.js +34 -42
- package/lib/blocklet/storage/disconnect.js +65 -76
- package/lib/blocklet/storage/index.js +9 -16
- package/lib/blocklet/storage/item.js +193 -153
- package/lib/blocklet/storage/preview-nft.js +74 -87
- package/lib/blocklet/transfer-owner.js +70 -74
- package/lib/blocklet/types.js +12 -18
- package/lib/blocklet/util.js +38 -55
- package/lib/blocklet/version.js +59 -69
- package/lib/card-selector.js +63 -39
- package/lib/certificate.js +35 -43
- package/lib/chain.js +3 -10
- package/lib/clear-cache.js +28 -44
- package/lib/click-to-copy.js +15 -31
- package/lib/confirm.js +72 -84
- package/lib/contexts/audit-log.js +30 -41
- package/lib/contexts/blocklet-storage.js +56 -65
- package/lib/contexts/blocklet.js +5 -13
- package/lib/contexts/config-space.js +34 -42
- package/lib/contexts/deleting-blocklets.js +18 -26
- package/lib/contexts/domain.js +20 -30
- package/lib/contexts/node.js +8 -20
- package/lib/contexts/session.js +5 -17
- package/lib/contexts/team.js +5 -13
- package/lib/delete-confirm.js +53 -60
- package/lib/did-address.js +24 -39
- package/lib/dot.js +9 -12
- package/lib/empty-spinner.js +15 -31
- package/lib/exchange-passport.js +30 -42
- package/lib/form/form-autocomplete-input.js +101 -117
- package/lib/form/form-select-input.js +69 -87
- package/lib/form/form-text-input.js +59 -75
- package/lib/form/form-wrapper.js +88 -12
- package/lib/form/input-triggers.js +39 -47
- package/lib/form/required.js +8 -12
- package/lib/hooks/blocklet.js +83 -106
- package/lib/hooks/confirm.js +31 -47
- package/lib/hooks/mobile-width.js +5 -12
- package/lib/hooks/url-evaluation.js +37 -50
- package/lib/hooks/use-app-logo.js +17 -27
- package/lib/hooks/use-auto-backup.js +15 -25
- package/lib/hooks/use-auto-check-update.js +15 -25
- package/lib/hooks/use-backup-progress.js +19 -30
- package/lib/hooks/use-backups.js +22 -30
- package/lib/hooks/use-blocklet-info-for-connect-did-spaces.js +17 -26
- package/lib/hooks/use-bundle-logo.js +13 -22
- package/lib/hooks/use-check-update-by-url.js +12 -20
- package/lib/hooks/use-components-by-blocklet-meta-url.js +11 -17
- package/lib/hooks/use-event-listen.js +4 -10
- package/lib/hooks/use-install-component-by-url.js +20 -29
- package/lib/hooks/use-mobile.js +9 -16
- package/lib/hooks/use-navigation.js +66 -74
- package/lib/hooks/use-passport-id.js +1 -7
- package/lib/hooks/use-snackbar.js +2 -8
- package/lib/hooks/use-space-gateways.js +21 -29
- package/lib/hooks/use-storage-endpoint.js +8 -13
- package/lib/hooks/use-subscription.js +8 -14
- package/lib/hooks/use-width.js +5 -12
- package/lib/images.js +31 -34
- package/lib/index.js +3 -20
- package/lib/invitation/invitation-app.js +42 -35
- package/lib/invitation/invitation-login.js +51 -29
- package/lib/invitation/invitation-passport.js +76 -48
- package/lib/invitation/invitation-receive.js +81 -66
- package/lib/invitation/invitation-success.js +51 -41
- package/lib/invitation/invitation-user.js +48 -38
- package/lib/invitation/invitation.js +69 -63
- package/lib/issue-passport.js +64 -53
- package/lib/launch-blocklet/content-layout.js +54 -29
- package/lib/launch-blocklet/page-header.js +29 -24
- package/lib/layout/addon.js +72 -56
- package/lib/layout/feedback.js +25 -25
- package/lib/locales/ar.js +14 -18
- package/lib/locales/de.js +15 -19
- package/lib/locales/en.js +19 -23
- package/lib/locales/es.js +14 -18
- package/lib/locales/fr.js +14 -18
- package/lib/locales/hi.js +14 -18
- package/lib/locales/i18n.db +0 -0
- package/lib/locales/id.js +14 -18
- package/lib/locales/index.js +19 -27
- package/lib/locales/ja.js +14 -18
- package/lib/locales/ko.js +14 -18
- package/lib/locales/pt.js +14 -18
- package/lib/locales/ru.js +13 -17
- package/lib/locales/th.js +13 -17
- package/lib/locales/vi.js +14 -18
- package/lib/locales/zh-tw.js +28 -32
- package/lib/locales/zh.js +26 -30
- package/lib/logs/clock.js +7 -14
- package/lib/logs/download.js +45 -53
- package/lib/logs/log-terminal.js +145 -84
- package/lib/lost-passport.js +226 -110
- package/lib/nav-logo.js +157 -60
- package/lib/notifications/addon.js +34 -43
- package/lib/notifications/default-icon-variants.js +23 -31
- package/lib/notifications/list.js +122 -89
- package/lib/notifications/notification.js +64 -56
- package/lib/notifications/page.js +151 -104
- package/lib/notifications/tag.js +12 -28
- package/lib/passport-tag.js +31 -32
- package/lib/permission.js +19 -32
- package/lib/relative-time.js +25 -39
- package/lib/result-message.js +11 -13
- package/lib/schema-form/color-input.js +24 -32
- package/lib/schema-form/common-prop-types.js +10 -17
- package/lib/schema-form/index.js +75 -89
- package/lib/schema-form/passport-input.js +28 -42
- package/lib/schema-form/text-input.js +20 -35
- package/lib/store/add.js +50 -58
- package/lib/store/connect-actions.js +46 -54
- package/lib/store/delete.js +35 -43
- package/lib/store/item.js +124 -136
- package/lib/subscription/blocklet.js +76 -90
- package/lib/subscription/chip-label.js +15 -23
- package/lib/subscription/server.js +83 -96
- package/lib/table-icons.js +33 -40
- package/lib/table.js +52 -12
- package/lib/tag.js +14 -30
- package/lib/team/members/actions.js +68 -82
- package/lib/team/members/connections.js +11 -19
- package/lib/team/members/index.js +289 -189
- package/lib/team/members/invitations.js +45 -55
- package/lib/team/members/invite-member.js +69 -76
- package/lib/team/members/issue-passport.js +54 -62
- package/lib/team/members/member.js +154 -142
- package/lib/team/members/passport-issuances.js +65 -61
- package/lib/team/members/passport-item.js +63 -55
- package/lib/team/members/passports.js +110 -115
- package/lib/team/members/toggle-user-approval.js +34 -42
- package/lib/team/members/transfer-node.js +78 -85
- package/lib/team/members/util.js +6 -12
- package/lib/team/passports/color.js +53 -61
- package/lib/team/passports/detail.js +136 -97
- package/lib/team/passports/index.js +117 -98
- package/lib/team/passports/mutate-role.js +50 -58
- package/lib/team/passports/trusted-factories.js +88 -93
- package/lib/team/passports/trusted-factory.js +99 -100
- package/lib/team/passports/trusted-issuer.js +92 -96
- package/lib/team/passports/trusted-issuers.js +88 -93
- package/lib/team/search-input.js +45 -36
- package/lib/team/styles/dialog.js +71 -11
- package/lib/team/styles/list-header.js +30 -11
- package/lib/util/api.js +5 -18
- package/lib/util/constants.js +3 -10
- package/lib/util/index.js +215 -324
- package/lib/util/join-url-keep-search.js +3 -10
- package/lib/util/mode.js +1 -7
- package/lib/util/parse-progress.js +1 -7
- package/lib/util/space-gateway.js +16 -23
- package/lib/util/spaces.js +48 -72
- package/lib/util/storage-ttl.js +4 -15
- package/lib/who-can-access/config.js +11 -18
- package/lib/wrap-locale.js +11 -18
- package/package.json +20 -100
- package/es/actions.js +0 -100
- package/es/analytics/card.js +0 -91
- package/es/analytics/chart.js +0 -95
- package/es/analytics/cpu.js +0 -36
- package/es/analytics/disk.js +0 -107
- package/es/analytics/memory.js +0 -70
- package/es/analytics/runtime.js +0 -174
- package/es/analytics/traffic.js +0 -257
- package/es/blocklet/access/config-access.js +0 -305
- package/es/blocklet/access/index.js +0 -215
- package/es/blocklet/actions.js +0 -536
- package/es/blocklet/add-cert.js +0 -193
- package/es/blocklet/agreement-app.js +0 -21
- package/es/blocklet/agreement.js +0 -214
- package/es/blocklet/app-avatar.js +0 -45
- package/es/blocklet/audit-logs.js +0 -275
- package/es/blocklet/authentication/common-settings.js +0 -133
- package/es/blocklet/authentication/federated/federated-detail-dialog.js +0 -193
- package/es/blocklet/authentication/federated/federated-invite-dialog.js +0 -82
- package/es/blocklet/authentication/federated/federated-join-dialog.js +0 -110
- package/es/blocklet/authentication/federated/federated-site-list.js +0 -319
- package/es/blocklet/authentication/federated/index.js +0 -79
- package/es/blocklet/authentication/index.js +0 -68
- package/es/blocklet/authentication/oauth/apple.js +0 -222
- package/es/blocklet/authentication/oauth/auth0.js +0 -170
- package/es/blocklet/authentication/oauth/drag-item.js +0 -177
- package/es/blocklet/authentication/oauth/github.js +0 -146
- package/es/blocklet/authentication/oauth/google.js +0 -145
- package/es/blocklet/authentication/oauth/index.js +0 -122
- package/es/blocklet/blocklet-source.js +0 -47
- package/es/blocklet/bundle-avatar.js +0 -64
- package/es/blocklet/component/button.js +0 -12
- package/es/blocklet/component/component-cell.js +0 -339
- package/es/blocklet/component/component-info-dialog.js +0 -257
- package/es/blocklet/component/configuration.js +0 -122
- package/es/blocklet/component/delete.js +0 -132
- package/es/blocklet/component/did-space/connect-to.js +0 -351
- package/es/blocklet/component/did-space/connected.js +0 -41
- package/es/blocklet/component/did-space/delete.js +0 -102
- package/es/blocklet/component/did-space/disconnect.js +0 -228
- package/es/blocklet/component/did-space/index.js +0 -74
- package/es/blocklet/component/did-space/item.js +0 -230
- package/es/blocklet/component/domain-list.js +0 -519
- package/es/blocklet/component/environment.js +0 -364
- package/es/blocklet/component/index.js +0 -545
- package/es/blocklet/component/line.js +0 -24
- package/es/blocklet/component/navigation/locale-tabs.js +0 -227
- package/es/blocklet/component/navigation/navigation-actions.js +0 -111
- package/es/blocklet/component/navigation/navigation-dialog.js +0 -608
- package/es/blocklet/component/navigation/navigation-preview.js +0 -108
- package/es/blocklet/component/navigation/simple-select.js +0 -123
- package/es/blocklet/component/optional-component-cell.js +0 -140
- package/es/blocklet/component/related-components-dialog.js +0 -194
- package/es/blocklet/component/select-store.js +0 -170
- package/es/blocklet/component/selected/index.js +0 -93
- package/es/blocklet/component/setting.js +0 -109
- package/es/blocklet/component/sortable-tree.js +0 -125
- package/es/blocklet/component/space-connector.js +0 -197
- package/es/blocklet/component/space-selector.js +0 -177
- package/es/blocklet/component/start.js +0 -101
- package/es/blocklet/component/step-actions.js +0 -98
- package/es/blocklet/component/store-blocklet-list.js +0 -227
- package/es/blocklet/component/switch-control.js +0 -57
- package/es/blocklet/config-navigation.js +0 -354
- package/es/blocklet/configuration.js +0 -589
- package/es/blocklet/disk-info.js +0 -74
- package/es/blocklet/icons.js +0 -22
- package/es/blocklet/install-from-url.js +0 -335
- package/es/blocklet/log.js +0 -90
- package/es/blocklet/logo-uploader.js +0 -133
- package/es/blocklet/migration.js +0 -148
- package/es/blocklet/mode.js +0 -19
- package/es/blocklet/notification/email.js +0 -342
- package/es/blocklet/notification/index.js +0 -48
- package/es/blocklet/overview.js +0 -158
- package/es/blocklet/page-group.js +0 -19
- package/es/blocklet/preferences/app-sk.js +0 -141
- package/es/blocklet/preferences/index.js +0 -304
- package/es/blocklet/publish/connect-store-list.js +0 -97
- package/es/blocklet/publish/create-release.js +0 -1059
- package/es/blocklet/publish/index.js +0 -69
- package/es/blocklet/publish/project-list.js +0 -399
- package/es/blocklet/publish/release-list.js +0 -351
- package/es/blocklet/publish/resource.js +0 -235
- package/es/blocklet/publish/select-components.js +0 -180
- package/es/blocklet/publish/tree.js +0 -237
- package/es/blocklet/purchase/common.js +0 -93
- package/es/blocklet/purchase/component-purchase.js +0 -235
- package/es/blocklet/purchase/index.js +0 -4
- package/es/blocklet/resource-type.js +0 -34
- package/es/blocklet/router/action/add-domain-alias.js +0 -172
- package/es/blocklet/router/action/add-rule.js +0 -223
- package/es/blocklet/router/action/config-routing-rule.js +0 -283
- package/es/blocklet/router/action/delete-domain-alias.js +0 -97
- package/es/blocklet/router/action/delete-rule.js +0 -106
- package/es/blocklet/router/action/update-rule.js +0 -221
- package/es/blocklet/router/add-domain.js +0 -307
- package/es/blocklet/router/dns-tip.js +0 -103
- package/es/blocklet/router/domain-actions.js +0 -64
- package/es/blocklet/router/domain-status.js +0 -87
- package/es/blocklet/router/rule-actions.js +0 -65
- package/es/blocklet/router/rule-list.js +0 -203
- package/es/blocklet/router/util.js +0 -148
- package/es/blocklet/runtime-info.js +0 -67
- package/es/blocklet/status.js +0 -106
- package/es/blocklet/storage/action.js +0 -149
- package/es/blocklet/storage/auto-backup.js +0 -55
- package/es/blocklet/storage/auto-check-update.js +0 -69
- package/es/blocklet/storage/backups.js +0 -212
- package/es/blocklet/storage/connect-to.js +0 -353
- package/es/blocklet/storage/connected.js +0 -112
- package/es/blocklet/storage/delete.js +0 -112
- package/es/blocklet/storage/disconnect.js +0 -241
- package/es/blocklet/storage/index.js +0 -16
- package/es/blocklet/storage/item.js +0 -544
- package/es/blocklet/storage/preview-nft.js +0 -283
- package/es/blocklet/transfer-owner.js +0 -199
- package/es/blocklet/types.js +0 -18
- package/es/blocklet/util.js +0 -151
- package/es/blocklet/version.js +0 -139
- package/es/card-selector.js +0 -134
- package/es/certificate.js +0 -102
- package/es/chain.js +0 -13
- package/es/clear-cache.js +0 -77
- package/es/click-to-copy.js +0 -22
- package/es/confirm.js +0 -162
- package/es/contexts/audit-log.js +0 -152
- package/es/contexts/blocklet-storage.js +0 -247
- package/es/contexts/blocklet.js +0 -10
- package/es/contexts/config-space.js +0 -160
- package/es/contexts/deleting-blocklets.js +0 -70
- package/es/contexts/domain.js +0 -75
- package/es/contexts/node.js +0 -17
- package/es/contexts/session.js +0 -8
- package/es/contexts/team.js +0 -10
- package/es/delete-confirm.js +0 -120
- package/es/did-address.js +0 -46
- package/es/dot.js +0 -14
- package/es/empty-spinner.js +0 -24
- package/es/exchange-passport.js +0 -93
- package/es/form/form-autocomplete-input.js +0 -283
- package/es/form/form-select-input.js +0 -188
- package/es/form/form-text-input.js +0 -176
- package/es/form/form-wrapper.js +0 -88
- package/es/form/input-triggers.js +0 -96
- package/es/form/required.js +0 -8
- package/es/hooks/blocklet.js +0 -317
- package/es/hooks/confirm.js +0 -98
- package/es/hooks/mobile-width.js +0 -11
- package/es/hooks/url-evaluation.js +0 -155
- package/es/hooks/use-app-logo.js +0 -32
- package/es/hooks/use-auto-backup.js +0 -33
- package/es/hooks/use-auto-check-update.js +0 -33
- package/es/hooks/use-backup-progress.js +0 -65
- package/es/hooks/use-backups.js +0 -61
- package/es/hooks/use-blocklet-info-for-connect-did-spaces.js +0 -55
- package/es/hooks/use-bundle-logo.js +0 -27
- package/es/hooks/use-check-update-by-url.js +0 -28
- package/es/hooks/use-components-by-blocklet-meta-url.js +0 -36
- package/es/hooks/use-event-listen.js +0 -11
- package/es/hooks/use-install-component-by-url.js +0 -65
- package/es/hooks/use-mobile.js +0 -17
- package/es/hooks/use-navigation.js +0 -331
- package/es/hooks/use-passport-id.js +0 -18
- package/es/hooks/use-snackbar.js +0 -2
- package/es/hooks/use-space-gateways.js +0 -66
- package/es/hooks/use-storage-endpoint.js +0 -23
- package/es/hooks/use-subscription.js +0 -22
- package/es/hooks/use-width.js +0 -12
- package/es/icons/empty-space-nft.svg +0 -59
- package/es/icons/empty-spaces-nft.svg +0 -58
- package/es/icons/long-arrow.svg +0 -5
- package/es/icons/space-connected.svg +0 -3
- package/es/icons/space-disconnect.svg +0 -3
- package/es/images.js +0 -48
- package/es/index.js +0 -3
- package/es/invitation/invitation-app.js +0 -57
- package/es/invitation/invitation-login.js +0 -68
- package/es/invitation/invitation-passport.js +0 -144
- package/es/invitation/invitation-receive.js +0 -170
- package/es/invitation/invitation-success.js +0 -92
- package/es/invitation/invitation-user.js +0 -89
- package/es/invitation/invitation.js +0 -103
- package/es/issue-passport.js +0 -151
- package/es/launch-blocklet/content-layout.js +0 -58
- package/es/launch-blocklet/page-header.js +0 -42
- package/es/layout/addon.js +0 -119
- package/es/layout/feedback.js +0 -58
- package/es/locales/ar.js +0 -1825
- package/es/locales/de.js +0 -1825
- package/es/locales/en.js +0 -1815
- package/es/locales/es.js +0 -1825
- package/es/locales/fr.js +0 -1825
- package/es/locales/hi.js +0 -1825
- package/es/locales/i18n.db +0 -0
- package/es/locales/id.js +0 -1825
- package/es/locales/index.js +0 -20
- package/es/locales/ja.js +0 -1825
- package/es/locales/ko.js +0 -1825
- package/es/locales/pt.js +0 -1825
- package/es/locales/ru.js +0 -1825
- package/es/locales/th.js +0 -1825
- package/es/locales/vi.js +0 -1825
- package/es/locales/zh-tw.js +0 -1825
- package/es/locales/zh.js +0 -1832
- package/es/logs/clock.js +0 -11
- package/es/logs/download.js +0 -132
- package/es/logs/log-terminal.js +0 -253
- package/es/lost-passport.js +0 -501
- package/es/nav-logo.js +0 -217
- package/es/notifications/addon.js +0 -90
- package/es/notifications/default-icon-variants.js +0 -53
- package/es/notifications/list.js +0 -272
- package/es/notifications/notification.js +0 -147
- package/es/notifications/page.js +0 -314
- package/es/notifications/tag.js +0 -28
- package/es/passport-tag.js +0 -42
- package/es/permission.js +0 -57
- package/es/relative-time.js +0 -56
- package/es/result-message.js +0 -11
- package/es/schema-form/color-input.js +0 -97
- package/es/schema-form/common-prop-types.js +0 -13
- package/es/schema-form/index.js +0 -222
- package/es/schema-form/passport-input.js +0 -54
- package/es/schema-form/text-input.js +0 -57
- package/es/store/add.js +0 -178
- package/es/store/connect-actions.js +0 -139
- package/es/store/delete.js +0 -112
- package/es/store/item.js +0 -347
- package/es/subscription/blocklet.js +0 -175
- package/es/subscription/chip-label.js +0 -40
- package/es/subscription/server.js +0 -189
- package/es/table-icons.js +0 -34
- package/es/table.js +0 -52
- package/es/tag.js +0 -21
- package/es/team/members/actions.js +0 -143
- package/es/team/members/connections.js +0 -28
- package/es/team/members/index.js +0 -741
- package/es/team/members/invitations.js +0 -187
- package/es/team/members/invite-member.js +0 -206
- package/es/team/members/issue-passport.js +0 -150
- package/es/team/members/member.js +0 -394
- package/es/team/members/passport-issuances.js +0 -154
- package/es/team/members/passport-item.js +0 -103
- package/es/team/members/passports.js +0 -308
- package/es/team/members/toggle-user-approval.js +0 -123
- package/es/team/members/transfer-node.js +0 -255
- package/es/team/members/util.js +0 -14
- package/es/team/passports/color.js +0 -125
- package/es/team/passports/detail.js +0 -310
- package/es/team/passports/index.js +0 -289
- package/es/team/passports/mutate-role.js +0 -196
- package/es/team/passports/trusted-factories.js +0 -220
- package/es/team/passports/trusted-factory.js +0 -341
- package/es/team/passports/trusted-issuer.js +0 -293
- package/es/team/passports/trusted-issuers.js +0 -225
- package/es/team/search-input.js +0 -46
- package/es/team/styles/dialog.js +0 -72
- package/es/team/styles/list-header.js +0 -31
- package/es/util/api.js +0 -6
- package/es/util/constants.js +0 -3
- package/es/util/index.js +0 -691
- package/es/util/join-url-keep-search.js +0 -15
- package/es/util/mode.js +0 -4
- package/es/util/parse-progress.js +0 -10
- package/es/util/space-gateway.js +0 -51
- package/es/util/spaces.js +0 -235
- package/es/util/storage-ttl.js +0 -78
- package/es/who-can-access/config.js +0 -38
- package/es/wrap-locale.js +0 -15
- package/lib/blocklet/component/add-component-button.js +0 -57
- package/lib/blocklet/component/add-component-core.js +0 -1188
- package/lib/blocklet/component/add-component-dialog.js +0 -85
- /package/{es/blocklet/component → lib/blocklet/component/add-component}/add-component-button.js +0 -0
|
@@ -1,66 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _resource = _interopRequireDefault(require("./resource"));
|
|
43
|
-
var _selectComponents = _interopRequireDefault(require("./select-components"));
|
|
44
|
-
var _connectStoreList = _interopRequireDefault(require("./connect-store-list"));
|
|
45
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
46
|
-
var _window$env, _templateObject;
|
|
47
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
48
|
-
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
49
|
-
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
50
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
51
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
52
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
53
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
54
|
-
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
55
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
56
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
1
|
+
import { useState, useEffect, lazy, useRef, useCallback, useMemo } from 'react';
|
|
2
|
+
import { Link, useNavigate, useParams } from 'react-router-dom';
|
|
3
|
+
import styled from '@emotion/styled';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import useSetState from 'react-use/lib/useSetState';
|
|
6
|
+
import pick from 'lodash/pick';
|
|
7
|
+
import joinUrl from 'url-join';
|
|
8
|
+
import semver from 'semver';
|
|
9
|
+
import pAll from 'p-all';
|
|
10
|
+
import Avatar from '@mui/material/Avatar';
|
|
11
|
+
import TextField from '@mui/material/TextField';
|
|
12
|
+
import Typography from '@mui/material/Typography';
|
|
13
|
+
import Breadcrumbs from '@mui/material/Breadcrumbs';
|
|
14
|
+
import Box from '@mui/material/Box';
|
|
15
|
+
import IconButton from '@mui/material/IconButton';
|
|
16
|
+
import DeleteOutlineIcon from '@mui/icons-material/DeleteOutline';
|
|
17
|
+
import CloudUploadRoundedIcon from '@mui/icons-material/CloudUploadRounded';
|
|
18
|
+
import InputAdornment from '@mui/material/InputAdornment';
|
|
19
|
+
import Spinner from '@mui/material/CircularProgress';
|
|
20
|
+
import MaterialDialog from '@mui/material/Dialog';
|
|
21
|
+
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
22
|
+
import Button from '@arcblock/ux/lib/Button';
|
|
23
|
+
import Toast from '@arcblock/ux/lib/Toast';
|
|
24
|
+
import Empty from '@arcblock/ux/lib/Empty';
|
|
25
|
+
import Tabs from '@arcblock/ux/lib/Tabs';
|
|
26
|
+
import Dialog from '@arcblock/ux/lib/Dialog';
|
|
27
|
+
import Alert from '@arcblock/ux/lib/Alert';
|
|
28
|
+
import { PROJECT } from '@blocklet/constant';
|
|
29
|
+
import { WELLKNOWN_SERVICE_PATH_PREFIX, UNOWNED_DID, BLOCKLET_STORE } from '@abtnode/constant';
|
|
30
|
+
import BlockletBundleAvatar from '../bundle-avatar';
|
|
31
|
+
import { useNodeContext } from '../../contexts/node';
|
|
32
|
+
import { useBlockletContext } from '../../contexts/blocklet';
|
|
33
|
+
import EmptySpinner from '../../empty-spinner';
|
|
34
|
+
import ClickToCopy from '../../click-to-copy';
|
|
35
|
+
import { formatError } from '../../util';
|
|
36
|
+
import Resource, { uploadResource } from './resource';
|
|
37
|
+
import SelectComponents from './select-components';
|
|
38
|
+
import ConnectStoreList from './connect-store-list';
|
|
39
|
+
import { createMessageId, waitGetConnectedByStudio, waitGetConnectedStore } from './wait-connect';
|
|
40
|
+
import ConnectStoreButton from './connect-store-button';
|
|
41
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
57
42
|
const allowedFileTypes = ['image/*', '.jpg', '.jpeg', '.png', '.gif', '.svg'];
|
|
58
43
|
const maxFileSize = 1024 * 1024 * 10; // 10 MB
|
|
59
44
|
|
|
60
|
-
const serverEndpoint =
|
|
45
|
+
const serverEndpoint = window.env?.serverEndpoint;
|
|
61
46
|
|
|
62
47
|
// eslint-disable-next-line import/no-unresolved
|
|
63
|
-
const UploaderComponent = /*#__PURE__*/
|
|
48
|
+
const UploaderComponent = /*#__PURE__*/lazy(() => import('@blocklet/uploader/react').then(res => ({
|
|
64
49
|
default: res.Uploader
|
|
65
50
|
})));
|
|
66
51
|
const validateParams = (params, status, t) => {
|
|
@@ -76,13 +61,13 @@ const validateParams = (params, status, t) => {
|
|
|
76
61
|
param: 'blockletVersion',
|
|
77
62
|
message: t('blocklet.publish.errorTip.noVersion')
|
|
78
63
|
});
|
|
79
|
-
} else if (!
|
|
64
|
+
} else if (!semver.valid(params.blockletVersion)) {
|
|
80
65
|
errors.push({
|
|
81
66
|
param: 'blockletVersion',
|
|
82
67
|
message: 'Invalid Blocklet Version'
|
|
83
68
|
});
|
|
84
69
|
}
|
|
85
|
-
if (status ===
|
|
70
|
+
if (status === PROJECT.RELEASE_STATUS.published) {
|
|
86
71
|
if (!params.blockletDescription) {
|
|
87
72
|
errors.push({
|
|
88
73
|
param: 'blockletDescription',
|
|
@@ -98,26 +83,25 @@ const validateParams = (params, status, t) => {
|
|
|
98
83
|
}
|
|
99
84
|
return errors.length ? errors : null;
|
|
100
85
|
};
|
|
101
|
-
const addComponentTabs =
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
} = _ref;
|
|
86
|
+
const addComponentTabs = ({
|
|
87
|
+
tabs,
|
|
88
|
+
blocklet,
|
|
89
|
+
ancestors = []
|
|
90
|
+
}) => {
|
|
107
91
|
const key = blocklet.meta.did;
|
|
108
92
|
tabs.push({
|
|
109
|
-
label: /*#__PURE__*/(
|
|
93
|
+
label: /*#__PURE__*/_jsxs(Box, {
|
|
110
94
|
display: "flex",
|
|
111
95
|
alignItems: "center",
|
|
112
96
|
justifyContent: "flex-start",
|
|
113
|
-
children: [/*#__PURE__*/(
|
|
97
|
+
children: [/*#__PURE__*/_jsx(BlockletBundleAvatar, {
|
|
114
98
|
size: 24,
|
|
115
99
|
blocklet: blocklet,
|
|
116
100
|
ancestors: ancestors
|
|
117
|
-
}), /*#__PURE__*/(
|
|
101
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
118
102
|
ml: "4px",
|
|
119
103
|
className: "text",
|
|
120
|
-
children: /*#__PURE__*/(
|
|
104
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
121
105
|
children: blocklet.meta.title
|
|
122
106
|
})
|
|
123
107
|
})]
|
|
@@ -125,11 +109,8 @@ const addComponentTabs = _ref => {
|
|
|
125
109
|
value: key
|
|
126
110
|
});
|
|
127
111
|
};
|
|
128
|
-
const pickParams = (
|
|
129
|
-
const params = (
|
|
130
|
-
params.blockletScreenshots || (params.blockletScreenshots = []);
|
|
131
|
-
params.publishedStoreIds || (params.publishedStoreIds = []);
|
|
132
|
-
params.connectedStores || (params.connectedStores = []);
|
|
112
|
+
const pickParams = (baseParams, app) => {
|
|
113
|
+
const params = pick(baseParams, ['blockletVersion', 'blockletTitle', 'blockletDescription', 'blockletLogo', 'blockletIntroduction', 'blockletScreenshots', 'connectedStores', 'blockletComponents', 'lastReleaseId', 'note']);
|
|
133
114
|
if (!params.blockletComponents) {
|
|
134
115
|
params.blockletComponents = (app.children || []).map(x => ({
|
|
135
116
|
did: x.meta.did,
|
|
@@ -137,58 +118,57 @@ const pickParams = (release, app) => {
|
|
|
137
118
|
required: false
|
|
138
119
|
}));
|
|
139
120
|
} else {
|
|
140
|
-
params.blockletComponents = params.blockletComponents.map(x =>
|
|
121
|
+
params.blockletComponents = params.blockletComponents.map(x => ({
|
|
122
|
+
...x,
|
|
141
123
|
included: true
|
|
142
124
|
}));
|
|
143
125
|
}
|
|
144
126
|
return params;
|
|
145
127
|
};
|
|
146
|
-
function CreateRelease(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
128
|
+
export default function CreateRelease({
|
|
129
|
+
initUrl,
|
|
130
|
+
...rest
|
|
131
|
+
}) {
|
|
132
|
+
const navigate = useNavigate();
|
|
150
133
|
const {
|
|
151
134
|
projectId,
|
|
152
135
|
releaseId: inputReleaseId,
|
|
153
136
|
componentDid = ''
|
|
154
|
-
} =
|
|
137
|
+
} = useParams();
|
|
155
138
|
const {
|
|
156
139
|
t,
|
|
157
140
|
locale
|
|
158
|
-
} =
|
|
159
|
-
const {
|
|
160
|
-
api: sessionApi
|
|
161
|
-
} = (0, _session.useSessionContext)();
|
|
141
|
+
} = useLocaleContext();
|
|
162
142
|
const {
|
|
163
143
|
blocklet
|
|
164
|
-
} =
|
|
165
|
-
const [params, setParams] = (
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
144
|
+
} = useBlockletContext();
|
|
145
|
+
const [params, setParams] = useSetState({
|
|
146
|
+
blockletScreenshots: [],
|
|
147
|
+
publishedStoreIds: [],
|
|
148
|
+
connectedStores: []
|
|
149
|
+
});
|
|
150
|
+
const [paramsErrTip, setParamsErrTip] = useState({});
|
|
151
|
+
const [loading, setLoading] = useState(false);
|
|
152
|
+
const [createLoading, setCreateLoading] = useState(false);
|
|
153
|
+
const [release, setRelease] = useSetState(null);
|
|
170
154
|
const {
|
|
171
|
-
api
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const
|
|
177
|
-
const
|
|
178
|
-
const [
|
|
179
|
-
const
|
|
180
|
-
const [
|
|
181
|
-
const
|
|
155
|
+
api
|
|
156
|
+
} = useNodeContext();
|
|
157
|
+
const uploaderLogoRef = useRef(null);
|
|
158
|
+
const uploaderScreenshotRef = useRef(null);
|
|
159
|
+
const [installResourceTip, setInstallResourceTip] = useState();
|
|
160
|
+
const [showStoreDialog, setShowStoreDialog] = useState(false);
|
|
161
|
+
const [initialResources, setInitialResources] = useState({});
|
|
162
|
+
const [releaseUsedLast, setReleaseUsedLast] = useState(false);
|
|
163
|
+
const saveSelectedEventsRef = useRef({});
|
|
164
|
+
const [_wantToConnectStore, setWantToConnectStore] = useState(null);
|
|
165
|
+
const baseStore = (blocklet?.settings?.storeList || []).find(x => x.id === BLOCKLET_STORE.id);
|
|
166
|
+
const wantToConnectStore = _wantToConnectStore || baseStore;
|
|
167
|
+
const releaseId = inputReleaseId === 'create' ? params?.lastReleaseId || '' : inputReleaseId;
|
|
182
168
|
const mode = inputReleaseId === 'create' ? 'create' : 'edit';
|
|
183
|
-
const projectType =
|
|
184
|
-
var _params$blockletCompo;
|
|
185
|
-
return params !== null && params !== void 0 && (_params$blockletCompo = params.blockletComponents) !== null && _params$blockletCompo !== void 0 && _params$blockletCompo.some(x => x.included) ? 'pack' : 'resource';
|
|
186
|
-
}, [params === null || params === void 0 ? void 0 : params.blockletComponents]);
|
|
169
|
+
const projectType = useMemo(() => params?.blockletComponents?.some(x => x.included) ? 'pack' : 'resource', [params?.blockletComponents]);
|
|
187
170
|
const tabs = [];
|
|
188
|
-
const resourceComponents = (
|
|
189
|
-
var _x$meta$resource;
|
|
190
|
-
return (_x$meta$resource = x.meta.resource) === null || _x$meta$resource === void 0 ? void 0 : _x$meta$resource.exportApi;
|
|
191
|
-
}).filter(x => !componentDid || x.meta.did === componentDid);
|
|
171
|
+
const resourceComponents = (blocklet?.children || []).filter(x => x.meta.resource?.exportApi).filter(x => !componentDid || x.meta.did === componentDid);
|
|
192
172
|
resourceComponents.forEach(item => {
|
|
193
173
|
addComponentTabs({
|
|
194
174
|
tabs,
|
|
@@ -197,11 +177,36 @@ function CreateRelease(_ref2) {
|
|
|
197
177
|
ancestors: [blocklet]
|
|
198
178
|
});
|
|
199
179
|
});
|
|
200
|
-
const [tab, setTab] =
|
|
201
|
-
const isPublished =
|
|
180
|
+
const [tab, setTab] = useState(tabs[0]?.value);
|
|
181
|
+
const isPublished = !releaseUsedLast && release?.status === 'published';
|
|
202
182
|
const readOnly = isPublished;
|
|
203
|
-
const
|
|
204
|
-
|
|
183
|
+
const getRelease = async () => {
|
|
184
|
+
try {
|
|
185
|
+
const res = await api.getRelease({
|
|
186
|
+
input: {
|
|
187
|
+
did: blocklet.meta.did,
|
|
188
|
+
projectId,
|
|
189
|
+
releaseId
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
setLoading(false);
|
|
193
|
+
if (!res.release) {
|
|
194
|
+
Toast.error('Release not found');
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
setParams(lastParams => pickParams({
|
|
198
|
+
...lastParams,
|
|
199
|
+
...res.release,
|
|
200
|
+
blockletVersion: mode === 'create' ? semver.inc(res.release.blockletVersion, 'patch') : res.release.blockletVersion
|
|
201
|
+
}, blocklet));
|
|
202
|
+
setRelease(res.release);
|
|
203
|
+
} catch (err) {
|
|
204
|
+
setLoading(false);
|
|
205
|
+
Toast.error(formatError(err));
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
const getProject = async () => {
|
|
209
|
+
if (projectId === UNOWNED_DID) {
|
|
205
210
|
setParams({
|
|
206
211
|
blockletVersion: '1.0.0',
|
|
207
212
|
blockletTitle: ''
|
|
@@ -209,248 +214,272 @@ function CreateRelease(_ref2) {
|
|
|
209
214
|
return;
|
|
210
215
|
}
|
|
211
216
|
if (!projectId) {
|
|
212
|
-
|
|
217
|
+
Toast.error(t('blocklet.publish.errorTip.noDid'));
|
|
213
218
|
return;
|
|
214
219
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
try {
|
|
221
|
+
const res = await api.getProject({
|
|
222
|
+
input: {
|
|
223
|
+
did: blocklet.meta.did,
|
|
224
|
+
projectId
|
|
225
|
+
}
|
|
226
|
+
});
|
|
221
227
|
setLoading(false);
|
|
222
228
|
const data = res.project || {};
|
|
223
229
|
if (!data.blockletVersion) {
|
|
224
230
|
data.blockletVersion = '1.0.0';
|
|
225
|
-
} else if (mode === 'create' &&
|
|
226
|
-
data.blockletVersion =
|
|
231
|
+
} else if (mode === 'create' && semver.valid(data.blockletVersion)) {
|
|
232
|
+
data.blockletVersion = semver.inc(data.blockletVersion, 'patch');
|
|
227
233
|
}
|
|
228
234
|
const theParams = pickParams(data, blocklet);
|
|
229
|
-
if (theParams.blockletTitle === projectId.slice(0, 8)) {
|
|
230
|
-
theParams.blockletTitle = '';
|
|
231
|
-
}
|
|
232
235
|
setParams(theParams);
|
|
233
|
-
}
|
|
234
|
-
setLoading(false);
|
|
235
|
-
_Toast.default.error((0, _util.formatError)(err));
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
const getRelease = () => {
|
|
239
|
-
api.getRelease({
|
|
240
|
-
input: {
|
|
241
|
-
did: blocklet.meta.did,
|
|
242
|
-
projectId,
|
|
243
|
-
releaseId
|
|
244
|
-
}
|
|
245
|
-
}).then(res => {
|
|
236
|
+
} catch (err) {
|
|
246
237
|
setLoading(false);
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}).catch(err => {
|
|
250
|
-
setLoading(false);
|
|
251
|
-
_Toast.default.error((0, _util.formatError)(err));
|
|
252
|
-
});
|
|
238
|
+
Toast.error(formatError(err));
|
|
239
|
+
}
|
|
253
240
|
};
|
|
254
|
-
const getData = (
|
|
241
|
+
const getData = useCallback(async () => {
|
|
255
242
|
if (mode === 'edit') {
|
|
256
243
|
if (!releaseId) {
|
|
257
|
-
|
|
244
|
+
Toast.error('Empty release id');
|
|
258
245
|
return;
|
|
259
246
|
}
|
|
260
|
-
|
|
247
|
+
await getProject();
|
|
248
|
+
await getRelease();
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
await getProject();
|
|
252
|
+
if (releaseId) {
|
|
253
|
+
setReleaseUsedLast(true);
|
|
254
|
+
await getRelease();
|
|
261
255
|
}
|
|
262
|
-
getProject();
|
|
263
256
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
264
257
|
}, [mode, releaseId]);
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
|
|
258
|
+
const onPublish = () => {
|
|
259
|
+
window.parent.postMessage({
|
|
260
|
+
event: 'studioDialog.uploaded',
|
|
261
|
+
componentDid
|
|
262
|
+
}, '*');
|
|
263
|
+
getRelease();
|
|
264
|
+
};
|
|
265
|
+
const onRelease = async status => {
|
|
266
|
+
if (!projectId || projectId === UNOWNED_DID) {
|
|
267
|
+
Toast.error(t('blocklet.publish.errorTip.noDid'));
|
|
268
268
|
return;
|
|
269
269
|
}
|
|
270
270
|
const errors = validateParams(params, status, t);
|
|
271
271
|
if (errors) {
|
|
272
|
-
|
|
273
|
-
setParamsErrTip(errors.reduce((acc, x) =>
|
|
272
|
+
Toast.error(errors.map(x => x.message).join('; '));
|
|
273
|
+
setParamsErrTip(errors.reduce((acc, x) => ({
|
|
274
|
+
...acc,
|
|
274
275
|
[x.param]: x.message
|
|
275
276
|
}), {}));
|
|
276
277
|
return;
|
|
277
278
|
}
|
|
278
|
-
const _params =
|
|
279
|
-
|
|
279
|
+
const _params = {
|
|
280
|
+
...params
|
|
281
|
+
};
|
|
282
|
+
_params.blockletVersion = semver.valid(_params.blockletVersion);
|
|
280
283
|
if (!_params.blockletVersion) {
|
|
281
|
-
|
|
284
|
+
Toast.error('Invalid Blocklet Version');
|
|
282
285
|
setParamsErrTip({
|
|
283
286
|
blockletVersion: 'Invalid Blocklet Version'
|
|
284
287
|
});
|
|
285
288
|
return;
|
|
286
289
|
}
|
|
290
|
+
const saveKeys = Object.keys(saveSelectedEventsRef.current);
|
|
291
|
+
if (!saveKeys.length) {
|
|
292
|
+
Toast.error('No resource selected');
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
setLoading(true);
|
|
296
|
+
try {
|
|
297
|
+
await pAll(saveKeys.map(x => {
|
|
298
|
+
return () => {
|
|
299
|
+
const item = saveSelectedEventsRef.current[x];
|
|
300
|
+
return uploadResource({
|
|
301
|
+
api,
|
|
302
|
+
locale,
|
|
303
|
+
projectId,
|
|
304
|
+
releaseId: releaseUsedLast ? '' : releaseId,
|
|
305
|
+
appDid: blocklet.meta.did,
|
|
306
|
+
component: item.component,
|
|
307
|
+
resources: item.resources,
|
|
308
|
+
initUrl
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
}), {
|
|
312
|
+
concurrency: 2
|
|
313
|
+
});
|
|
314
|
+
} catch (err) {
|
|
315
|
+
Toast.error(err.message);
|
|
316
|
+
setLoading(false);
|
|
317
|
+
setParamsErrTip({
|
|
318
|
+
resources: 'Invalid save the resource'
|
|
319
|
+
});
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
287
322
|
_params.blockletTitle = (_params.blockletTitle || '').trim();
|
|
288
323
|
_params.blockletDescription = (_params.blockletDescription || '').trim();
|
|
289
324
|
_params.blockletIntroduction = (_params.blockletIntroduction || '').trim();
|
|
290
325
|
_params.note = (_params.note || '').trim();
|
|
291
|
-
_params.blockletComponents = (_params
|
|
326
|
+
_params.blockletComponents = (_params?.blockletComponents || []).filter(x => x.included).map(x => pick(x, ['did', 'required'])).map(JSON.stringify);
|
|
292
327
|
setCreateLoading(status);
|
|
293
|
-
setLoading(true);
|
|
294
328
|
api.createRelease({
|
|
295
|
-
input:
|
|
329
|
+
input: {
|
|
330
|
+
..._params,
|
|
296
331
|
did: blocklet.meta.did,
|
|
297
332
|
projectId,
|
|
298
|
-
releaseId,
|
|
333
|
+
releaseId: releaseUsedLast ? '' : releaseId,
|
|
299
334
|
status
|
|
300
|
-
}
|
|
335
|
+
}
|
|
301
336
|
}).then(res => {
|
|
302
|
-
setCreateLoading(false);
|
|
303
|
-
setLoading(false);
|
|
304
337
|
if (status === 'draft') {
|
|
305
|
-
|
|
338
|
+
Toast.success(t('blocklet.publish.saveDraftSuccess'));
|
|
306
339
|
} else {
|
|
307
|
-
|
|
340
|
+
setReleaseUsedLast(false);
|
|
341
|
+
Toast.success(t('blocklet.publish.createReleaseSuccess'));
|
|
342
|
+
window.parent.postMessage({
|
|
343
|
+
event: 'studioDialog.released',
|
|
344
|
+
componentDid
|
|
345
|
+
}, '*');
|
|
308
346
|
}
|
|
309
347
|
if (mode === 'create') {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
navigate("../".concat(projectId, "/").concat(id), {
|
|
348
|
+
const id = res?.release?.id;
|
|
349
|
+
navigate(`../${projectId}/${id}`, {
|
|
313
350
|
replace: true
|
|
314
351
|
});
|
|
315
352
|
} else {
|
|
316
353
|
getRelease();
|
|
317
354
|
}
|
|
318
355
|
}).catch(err => {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
const msg = (0, _util.formatError)(err);
|
|
322
|
-
_Toast.default.error(msg);
|
|
356
|
+
const msg = formatError(err);
|
|
357
|
+
Toast.error(msg);
|
|
323
358
|
if (/resource.*empty/.test(msg)) {
|
|
324
359
|
setParamsErrTip({
|
|
325
360
|
blockletResource: msg
|
|
326
361
|
});
|
|
327
362
|
}
|
|
363
|
+
}).finally(() => {
|
|
364
|
+
setCreateLoading(false);
|
|
365
|
+
setLoading(false);
|
|
328
366
|
});
|
|
329
367
|
};
|
|
330
|
-
const
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
if (!params.blockletTitle) {
|
|
334
|
-
setParamsErrTip({
|
|
335
|
-
blockletTitle: t('blocklet.publish.errorTip.noTitle')
|
|
336
|
-
});
|
|
337
|
-
_Toast.default.error(t('blocklet.publish.errorTip.noTitle'));
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
if (!projectId || projectId === _constant2.UNOWNED_DID) {
|
|
341
|
-
setOpenConnect(true);
|
|
342
|
-
}
|
|
343
|
-
};
|
|
344
|
-
const handleDidConnectClose = () => {
|
|
345
|
-
setOpenConnect(false);
|
|
368
|
+
const onOpenConnectStore = async param => {
|
|
369
|
+
await waitGetConnectedStore(api, param);
|
|
370
|
+
getData();
|
|
346
371
|
};
|
|
347
|
-
const
|
|
348
|
-
|
|
349
|
-
|
|
372
|
+
const onOpenConnectByStudio = async param => {
|
|
373
|
+
const timer = setTimeout(() => {
|
|
374
|
+
setLoading(false);
|
|
375
|
+
}, 6000);
|
|
376
|
+
const nextBlockletDid = await waitGetConnectedByStudio(api, param);
|
|
377
|
+
setLoading(false);
|
|
378
|
+
clearTimeout(timer);
|
|
379
|
+
window.parent.postMessage({
|
|
380
|
+
event: 'studioDialog.connected',
|
|
381
|
+
componentDid
|
|
382
|
+
}, '*');
|
|
383
|
+
navigate(window.location.pathname.replace(`${UNOWNED_DID}/create`, `${nextBlockletDid}/create`), {
|
|
384
|
+
replace: true
|
|
350
385
|
});
|
|
351
386
|
};
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
};
|
|
356
|
-
const handleCreate = nextProjectDid => {
|
|
357
|
-
var _params$blockletCompo2;
|
|
358
|
-
if (!nextProjectDid) {
|
|
359
|
-
_Toast.default.error(t('blocklet.publish.errorTip.noDid'));
|
|
387
|
+
const handleConnectByStudio = () => {
|
|
388
|
+
if (!params.blockletTitle) {
|
|
389
|
+
Toast.error(t('blocklet.publish.errorTip.noTitle'));
|
|
360
390
|
return;
|
|
361
391
|
}
|
|
362
392
|
setLoading(true);
|
|
363
|
-
|
|
393
|
+
if (!wantToConnectStore) {
|
|
394
|
+
Toast.error('No store found');
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
397
|
+
const messageId = createMessageId();
|
|
398
|
+
api.connectByStudio({
|
|
364
399
|
input: {
|
|
365
|
-
did: blocklet
|
|
366
|
-
blockletTitle: params
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
400
|
+
did: blocklet?.meta?.did,
|
|
401
|
+
blockletTitle: params?.blockletTitle,
|
|
402
|
+
storeUrl: wantToConnectStore.url,
|
|
403
|
+
storeId: wantToConnectStore.id,
|
|
404
|
+
storeName: wantToConnectStore.name,
|
|
405
|
+
type: params?.blockletComponents?.length > 0 ? 'pack' : 'resource',
|
|
406
|
+
componentDid,
|
|
407
|
+
messageId,
|
|
408
|
+
tenantScope: initUrl?.searchParams.get('tenantScope') || ''
|
|
370
409
|
}
|
|
371
|
-
}).then(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
410
|
+
}).then(res => {
|
|
411
|
+
if (!res?.url) {
|
|
412
|
+
Toast.error('failed to connect to store');
|
|
413
|
+
return;
|
|
414
|
+
}
|
|
415
|
+
window.open(res.url);
|
|
416
|
+
onOpenConnectByStudio({
|
|
417
|
+
did: blocklet?.meta?.did,
|
|
418
|
+
projectId: '',
|
|
419
|
+
messageId
|
|
375
420
|
});
|
|
376
421
|
}).catch(err => {
|
|
377
|
-
|
|
378
|
-
_Toast.default.error(err.message);
|
|
422
|
+
Toast.error(formatError(err));
|
|
379
423
|
});
|
|
380
424
|
};
|
|
381
|
-
const
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
_Toast.default.error('Empty Blocklet DID');
|
|
386
|
-
} else {
|
|
387
|
-
handleCreate(did);
|
|
388
|
-
}
|
|
389
|
-
setOpenConnect(false);
|
|
425
|
+
const handleChangeSelectedComponents = data => {
|
|
426
|
+
setParams({
|
|
427
|
+
blockletComponents: data
|
|
428
|
+
});
|
|
390
429
|
};
|
|
391
|
-
|
|
430
|
+
useEffect(() => {
|
|
392
431
|
getData();
|
|
393
432
|
}, [getData]);
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
433
|
+
useEffect(() => {
|
|
434
|
+
if (mode === 'create' && initUrl) {
|
|
435
|
+
setParams({
|
|
436
|
+
blockletTitle: initUrl.searchParams.get('title'),
|
|
437
|
+
blockletLogo: initUrl.searchParams.get('logo'),
|
|
438
|
+
blockletDescription: initUrl.searchParams.get('description'),
|
|
439
|
+
blockletIntroduction: initUrl.searchParams.get('introduction'),
|
|
440
|
+
blockletComponents: JSON.parse(initUrl.searchParams.get('components') || '[]'),
|
|
441
|
+
note: initUrl.searchParams.get('note') || 'No note'
|
|
442
|
+
});
|
|
443
|
+
const resourcesString = initUrl.searchParams.get('resources');
|
|
444
|
+
try {
|
|
445
|
+
const resources = JSON.parse(resourcesString);
|
|
446
|
+
setInitialResources(resources);
|
|
447
|
+
} catch (_) {
|
|
448
|
+
//
|
|
449
|
+
}
|
|
398
450
|
}
|
|
399
|
-
}, [
|
|
451
|
+
}, [setParams, initUrl, mode]);
|
|
400
452
|
if (!params && loading) {
|
|
401
|
-
return /*#__PURE__*/(
|
|
453
|
+
return /*#__PURE__*/_jsx(EmptySpinner, {});
|
|
402
454
|
}
|
|
403
455
|
if (!params) {
|
|
404
456
|
return null;
|
|
405
457
|
}
|
|
406
|
-
const
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
action: "gen-blocklet-key-pair",
|
|
411
|
-
locale: locale,
|
|
412
|
-
checkFn: sessionApi.get,
|
|
413
|
-
saveConnect: false,
|
|
414
|
-
forceConnected: false,
|
|
415
|
-
checkTimeout: 5 * 60 * 1000,
|
|
416
|
-
onSuccess: handleCreateBlockletDidSuccess,
|
|
417
|
-
onError: handleCreateBlockletDidError,
|
|
418
|
-
extraParams: {
|
|
419
|
-
did: blocklet.meta.did
|
|
420
|
-
},
|
|
421
|
-
messages: {
|
|
422
|
-
title: t('blocklet.publish.connect.title'),
|
|
423
|
-
scan: t('blocklet.publish.connect.scan'),
|
|
424
|
-
confirm: t('blocklet.publish.connect.confirm'),
|
|
425
|
-
success: t('blocklet.publish.connect.success')
|
|
426
|
-
}
|
|
427
|
-
}) : null;
|
|
428
|
-
const uploadLogoPrefix = "".concat(_constant2.WELLKNOWN_SERVICE_PATH_PREFIX, "/api/project/").concat(blocklet.meta.did, "/").concat(projectId, "/logo/upload");
|
|
429
|
-
const uploadScreenshotPrefix = "".concat(_constant2.WELLKNOWN_SERVICE_PATH_PREFIX, "/api/project/").concat(blocklet.meta.did, "/").concat(projectId, "/screenshot/upload");
|
|
430
|
-
const logoUrl = params !== null && params !== void 0 && params.blockletLogo ? "".concat(uploadLogoPrefix, "/").concat(params.blockletLogo) : "".concat(_constant2.WELLKNOWN_SERVICE_PATH_PREFIX, "/static/images/logo.png");
|
|
431
|
-
const screenshotUrls = ((params === null || params === void 0 ? void 0 : params.blockletScreenshots) || []).filter(Boolean).map(x => "".concat(uploadScreenshotPrefix, "/").concat(x));
|
|
458
|
+
const uploadLogoPrefix = `${WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${blocklet.meta.did}/${projectId}/logo/upload`;
|
|
459
|
+
const uploadScreenshotPrefix = `${WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${blocklet.meta.did}/${projectId}/screenshot/upload`;
|
|
460
|
+
const logoUrl = params?.blockletLogo ? `${uploadLogoPrefix}/${params.blockletLogo}` : `${WELLKNOWN_SERVICE_PATH_PREFIX}/static/images/logo.png`;
|
|
461
|
+
const screenshotUrls = (params?.blockletScreenshots || []).filter(Boolean).map(x => `${uploadScreenshotPrefix}/${x}`);
|
|
432
462
|
const item = resourceComponents.find(x => x.meta.did === tab);
|
|
433
|
-
const resourceContent = item ? /*#__PURE__*/(
|
|
434
|
-
children: /*#__PURE__*/(
|
|
463
|
+
const resourceContent = item ? /*#__PURE__*/_jsx(Box, {
|
|
464
|
+
children: /*#__PURE__*/_jsx(Resource, {
|
|
465
|
+
initialResources: initialResources,
|
|
466
|
+
saveSelectedEventsRef: saveSelectedEventsRef,
|
|
435
467
|
error: paramsErrTip.blockletResource,
|
|
436
468
|
app: blocklet,
|
|
469
|
+
readOnly: readOnly,
|
|
437
470
|
component: item,
|
|
438
|
-
|
|
439
|
-
|
|
471
|
+
initUrl: initUrl,
|
|
472
|
+
projectId: projectId === UNOWNED_DID ? '' : projectId,
|
|
473
|
+
releaseUsedLast: releaseUsedLast,
|
|
474
|
+
release: {
|
|
475
|
+
...release,
|
|
440
476
|
id: releaseId
|
|
441
|
-
}),
|
|
442
|
-
onSave: selected => {
|
|
443
|
-
if (selected.length) {
|
|
444
|
-
setParamsErrTip({
|
|
445
|
-
blockletResource: ''
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
477
|
}
|
|
449
478
|
})
|
|
450
|
-
}) : /*#__PURE__*/(
|
|
479
|
+
}) : /*#__PURE__*/_jsx(Box, {
|
|
451
480
|
display: "flex",
|
|
452
481
|
mt: -3,
|
|
453
|
-
children: /*#__PURE__*/(
|
|
482
|
+
children: /*#__PURE__*/_jsx(Empty, {
|
|
454
483
|
children: t('common.empty')
|
|
455
484
|
})
|
|
456
485
|
});
|
|
@@ -459,17 +488,17 @@ function CreateRelease(_ref2) {
|
|
|
459
488
|
};
|
|
460
489
|
let installButton = null;
|
|
461
490
|
if (isPublished && serverEndpoint) {
|
|
462
|
-
const blockletMetaUrl = (
|
|
491
|
+
const blockletMetaUrl = joinUrl(serverEndpoint, `/api/project/${blocklet.meta.did}/${projectId}/${releaseId}/release/blocklet.json`);
|
|
463
492
|
if (projectType === 'pack') {
|
|
464
493
|
const url = new URL(serverEndpoint);
|
|
465
|
-
url.pathname = (
|
|
494
|
+
url.pathname = joinUrl(url.pathname, '/launch-blocklet/agreement');
|
|
466
495
|
url.searchParams.set('blocklet_meta_url', blockletMetaUrl);
|
|
467
|
-
installButton = /*#__PURE__*/(
|
|
496
|
+
installButton = /*#__PURE__*/_jsx(Button, {
|
|
468
497
|
variant: "outlined",
|
|
469
498
|
style: {
|
|
470
499
|
marginRight: 8
|
|
471
500
|
},
|
|
472
|
-
children: /*#__PURE__*/(
|
|
501
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
473
502
|
href: url.href,
|
|
474
503
|
target: "_blank",
|
|
475
504
|
rel: "noreferrer",
|
|
@@ -477,38 +506,38 @@ function CreateRelease(_ref2) {
|
|
|
477
506
|
})
|
|
478
507
|
});
|
|
479
508
|
} else {
|
|
480
|
-
installButton = /*#__PURE__*/(
|
|
481
|
-
children: [/*#__PURE__*/(
|
|
509
|
+
installButton = /*#__PURE__*/_jsxs(_Fragment, {
|
|
510
|
+
children: [/*#__PURE__*/_jsx(Button, {
|
|
482
511
|
variant: "outlined",
|
|
483
512
|
style: {
|
|
484
513
|
marginRight: 8
|
|
485
514
|
},
|
|
486
515
|
onClick: () => setInstallResourceTip(blockletMetaUrl),
|
|
487
516
|
children: t('blocklet.publish.copyInstallUrl')
|
|
488
|
-
}), /*#__PURE__*/(
|
|
517
|
+
}), /*#__PURE__*/_jsx(MaterialDialog, {
|
|
489
518
|
fullWidth: true,
|
|
490
519
|
maxWidth: "sm",
|
|
491
520
|
open: installResourceTip,
|
|
492
521
|
onClose: () => setInstallResourceTip(''),
|
|
493
|
-
children: /*#__PURE__*/(
|
|
522
|
+
children: /*#__PURE__*/_jsxs(Box, {
|
|
494
523
|
sx: {
|
|
495
524
|
py: 5,
|
|
496
525
|
px: 4,
|
|
497
526
|
wordBreak: 'break-all'
|
|
498
527
|
},
|
|
499
|
-
children: [/*#__PURE__*/(
|
|
528
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
500
529
|
variant: "h6",
|
|
501
530
|
sx: {
|
|
502
531
|
mb: 2
|
|
503
532
|
},
|
|
504
533
|
children: t('blocklet.publish.installResourceTip')
|
|
505
|
-
}), /*#__PURE__*/(
|
|
534
|
+
}), /*#__PURE__*/_jsx(ClickToCopy, {
|
|
506
535
|
children: installResourceTip
|
|
507
|
-
}), /*#__PURE__*/(
|
|
536
|
+
}), /*#__PURE__*/_jsxs(Typography, {
|
|
508
537
|
sx: {
|
|
509
538
|
mt: 2
|
|
510
539
|
},
|
|
511
|
-
children: [t('blocklet.publish.installResourceTip2'), /*#__PURE__*/(
|
|
540
|
+
children: [t('blocklet.publish.installResourceTip2'), /*#__PURE__*/_jsx("a", {
|
|
512
541
|
style: {
|
|
513
542
|
marginLeft: 4
|
|
514
543
|
},
|
|
@@ -523,46 +552,50 @@ function CreateRelease(_ref2) {
|
|
|
523
552
|
});
|
|
524
553
|
}
|
|
525
554
|
}
|
|
526
|
-
return /*#__PURE__*/(
|
|
527
|
-
|
|
555
|
+
return /*#__PURE__*/_jsxs(Main, {
|
|
556
|
+
...rest,
|
|
557
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
528
558
|
className: "sticky-header",
|
|
529
|
-
children: [/*#__PURE__*/(
|
|
559
|
+
children: [/*#__PURE__*/_jsxs(Breadcrumbs, {
|
|
530
560
|
className: "breadcrumbs",
|
|
531
561
|
"aria-label": "breadcrumb",
|
|
532
|
-
children: [/*#__PURE__*/(
|
|
562
|
+
children: [/*#__PURE__*/_jsx(Link, {
|
|
533
563
|
to: "../",
|
|
534
564
|
children: t('common.blockletStudio')
|
|
535
|
-
}), /*#__PURE__*/(
|
|
536
|
-
to: "../".concat(projectId),
|
|
537
|
-
children: (params === null || params === void 0 ? void 0 : params.blockletTitle) || 'Blocklet'
|
|
538
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.default, {
|
|
565
|
+
}), projectId === UNOWNED_DID ? /*#__PURE__*/_jsx(Typography, {
|
|
539
566
|
color: "text.primary",
|
|
540
|
-
children:
|
|
567
|
+
children: params?.blockletTitle || 'Blocklet'
|
|
568
|
+
}) : /*#__PURE__*/_jsx(Link, {
|
|
569
|
+
to: `../${projectId}`,
|
|
570
|
+
children: params?.blockletTitle
|
|
571
|
+
}), /*#__PURE__*/_jsx(Typography, {
|
|
572
|
+
color: "text.primary",
|
|
573
|
+
children: mode === 'create' ? t('common.create') : params?.blockletVersion || t('common.edit')
|
|
541
574
|
})]
|
|
542
|
-
}), /*#__PURE__*/(
|
|
575
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
543
576
|
display: "flex",
|
|
544
|
-
children: [!isPublished && /*#__PURE__*/(
|
|
545
|
-
children: [/*#__PURE__*/(
|
|
577
|
+
children: [!isPublished && /*#__PURE__*/_jsxs(_Fragment, {
|
|
578
|
+
children: [/*#__PURE__*/_jsxs(Button, {
|
|
546
579
|
variant: "outlined",
|
|
547
580
|
disabled: loading || createLoading,
|
|
548
|
-
onClick: () => onRelease(
|
|
581
|
+
onClick: () => onRelease(PROJECT.RELEASE_STATUS.draft),
|
|
549
582
|
style: {
|
|
550
583
|
marginRight: 12
|
|
551
584
|
},
|
|
552
|
-
children: [createLoading ===
|
|
585
|
+
children: [createLoading === PROJECT.RELEASE_STATUS.draft && /*#__PURE__*/_jsx(Spinner, {
|
|
553
586
|
size: 14,
|
|
554
587
|
sx: {
|
|
555
588
|
mr: 0.5
|
|
556
589
|
}
|
|
557
590
|
}), t('blocklet.publish.saveDraft')]
|
|
558
|
-
}), /*#__PURE__*/(
|
|
591
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
559
592
|
variant: "contained",
|
|
560
593
|
disabled: loading || createLoading,
|
|
561
594
|
style: {
|
|
562
595
|
marginRight: 12
|
|
563
596
|
},
|
|
564
|
-
onClick: () => onRelease(
|
|
565
|
-
children: [createLoading ===
|
|
597
|
+
onClick: () => onRelease(PROJECT.RELEASE_STATUS.published),
|
|
598
|
+
children: [createLoading === PROJECT.RELEASE_STATUS.published && /*#__PURE__*/_jsx(Spinner, {
|
|
566
599
|
size: 14,
|
|
567
600
|
sx: {
|
|
568
601
|
mr: 0.5
|
|
@@ -570,20 +603,20 @@ function CreateRelease(_ref2) {
|
|
|
570
603
|
color: "inherit"
|
|
571
604
|
}), t('common.release')]
|
|
572
605
|
})]
|
|
573
|
-
}), isPublished && /*#__PURE__*/(
|
|
574
|
-
children: [installButton, /*#__PURE__*/(
|
|
606
|
+
}), isPublished && /*#__PURE__*/_jsxs(_Fragment, {
|
|
607
|
+
children: [installButton, /*#__PURE__*/_jsx(Button, {
|
|
575
608
|
variant: "outlined",
|
|
576
609
|
style: {
|
|
577
610
|
marginRight: 12
|
|
578
611
|
},
|
|
579
|
-
children: /*#__PURE__*/(
|
|
580
|
-
href: (
|
|
612
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
613
|
+
href: joinUrl(`${WELLKNOWN_SERVICE_PATH_PREFIX}/api/project/${blocklet.meta.did}/${projectId}/${releaseId}/download/${(release.files || [])[0]}`),
|
|
581
614
|
children: t('common.download')
|
|
582
615
|
})
|
|
583
|
-
}), /*#__PURE__*/(
|
|
616
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
584
617
|
variant: "contained",
|
|
585
618
|
onClick: () => setShowStoreDialog(true),
|
|
586
|
-
children: [/*#__PURE__*/(
|
|
619
|
+
children: [/*#__PURE__*/_jsx(CloudUploadRoundedIcon, {
|
|
587
620
|
style: {
|
|
588
621
|
fontSize: '1.3em',
|
|
589
622
|
marginRight: 4
|
|
@@ -592,23 +625,24 @@ function CreateRelease(_ref2) {
|
|
|
592
625
|
})]
|
|
593
626
|
})]
|
|
594
627
|
})]
|
|
595
|
-
}), /*#__PURE__*/(
|
|
596
|
-
children: [/*#__PURE__*/(
|
|
628
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
629
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
597
630
|
pt: 5
|
|
598
|
-
}), /*#__PURE__*/(
|
|
631
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
599
632
|
display: "flex",
|
|
600
633
|
className: "section",
|
|
601
|
-
children: [/*#__PURE__*/(
|
|
634
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
602
635
|
variant: "h3",
|
|
603
636
|
className: "left",
|
|
604
637
|
children: t('blocklet.publish.productTitle')
|
|
605
|
-
}), /*#__PURE__*/(
|
|
638
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
606
639
|
sx: {
|
|
607
640
|
flex: 1
|
|
608
641
|
},
|
|
609
|
-
children: [/*#__PURE__*/(
|
|
610
|
-
|
|
611
|
-
|
|
642
|
+
children: [/*#__PURE__*/_jsx(TextField, {
|
|
643
|
+
disabled: readOnly,
|
|
644
|
+
label: `Blocklet ${t('common.title')}`,
|
|
645
|
+
placeholder: `Blocklet ${t('common.title')}`,
|
|
612
646
|
InputProps: {
|
|
613
647
|
'data-cy': 'blocklet-title',
|
|
614
648
|
readOnly
|
|
@@ -628,34 +662,37 @@ function CreateRelease(_ref2) {
|
|
|
628
662
|
},
|
|
629
663
|
error: !!paramsErrTip.blockletTitle,
|
|
630
664
|
helperText: paramsErrTip.blockletTitle || ''
|
|
631
|
-
}), /*#__PURE__*/(
|
|
665
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
632
666
|
required: true,
|
|
633
667
|
label: "Blocklet DID",
|
|
634
668
|
fullWidth: true,
|
|
635
669
|
readonly: true,
|
|
636
|
-
disabled:
|
|
670
|
+
disabled: true,
|
|
637
671
|
autoComplete: "off",
|
|
638
672
|
variant: "outlined",
|
|
639
|
-
onClick: handleDidConnectShow,
|
|
640
|
-
onInput: handleDidConnectShow,
|
|
641
673
|
InputProps: {
|
|
642
674
|
'data-cy': 'export-blocklet-did',
|
|
643
|
-
endAdornment: projectId ===
|
|
675
|
+
endAdornment: projectId === UNOWNED_DID && /*#__PURE__*/_jsx(InputAdornment, {
|
|
644
676
|
position: "end",
|
|
645
|
-
children: /*#__PURE__*/(
|
|
646
|
-
|
|
647
|
-
|
|
677
|
+
children: /*#__PURE__*/_jsx(ConnectStoreButton, {
|
|
678
|
+
blocklet: blocklet,
|
|
679
|
+
store: wantToConnectStore,
|
|
680
|
+
onChangeStore: setWantToConnectStore,
|
|
681
|
+
disabled: !params.blockletTitle || readOnly || loading,
|
|
682
|
+
loading: loading,
|
|
683
|
+
onClick: handleConnectByStudio
|
|
648
684
|
})
|
|
649
685
|
})
|
|
650
686
|
},
|
|
651
687
|
helperText: "",
|
|
652
|
-
value: projectId ===
|
|
688
|
+
value: projectId === UNOWNED_DID ? '' : projectId,
|
|
653
689
|
sx: {
|
|
654
690
|
mt: 3
|
|
655
691
|
}
|
|
656
|
-
}), /*#__PURE__*/(
|
|
657
|
-
|
|
658
|
-
|
|
692
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
693
|
+
disabled: readOnly,
|
|
694
|
+
label: `Blocklet ${t('common.description')}`,
|
|
695
|
+
placeholder: `Blocklet ${t('common.description')}`,
|
|
659
696
|
InputProps: {
|
|
660
697
|
'data-cy': 'blocklet-description',
|
|
661
698
|
readOnly
|
|
@@ -678,15 +715,16 @@ function CreateRelease(_ref2) {
|
|
|
678
715
|
sx: {
|
|
679
716
|
mt: 3
|
|
680
717
|
}
|
|
681
|
-
}), /*#__PURE__*/(
|
|
682
|
-
|
|
683
|
-
|
|
718
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
719
|
+
disabled: readOnly,
|
|
720
|
+
label: `Blocklet ${t('common.introduction')}`,
|
|
721
|
+
placeholder: `Blocklet ${t('common.introduction')}`,
|
|
684
722
|
InputProps: {
|
|
685
723
|
'data-cy': 'export-blocklet-introduction',
|
|
686
724
|
readOnly,
|
|
687
|
-
endAdornment: /*#__PURE__*/(
|
|
725
|
+
endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
|
|
688
726
|
position: "end",
|
|
689
|
-
children: [
|
|
727
|
+
children: [params?.blockletIntroduction?.length || 0, " / ", PROJECT.MAX_INTRO_LENGTH]
|
|
690
728
|
})
|
|
691
729
|
},
|
|
692
730
|
autoComplete: "off",
|
|
@@ -700,7 +738,7 @@ function CreateRelease(_ref2) {
|
|
|
700
738
|
blockletIntroduction: ''
|
|
701
739
|
});
|
|
702
740
|
setParams({
|
|
703
|
-
blockletIntroduction: e.target.value.slice(0,
|
|
741
|
+
blockletIntroduction: e.target.value.slice(0, PROJECT.MAX_INTRO_LENGTH)
|
|
704
742
|
});
|
|
705
743
|
},
|
|
706
744
|
error: !!paramsErrTip.blockletIntroduction,
|
|
@@ -710,22 +748,23 @@ function CreateRelease(_ref2) {
|
|
|
710
748
|
}
|
|
711
749
|
})]
|
|
712
750
|
})]
|
|
713
|
-
}), /*#__PURE__*/(
|
|
751
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
714
752
|
display: "flex",
|
|
715
753
|
mt: 3,
|
|
716
754
|
className: "section",
|
|
717
|
-
children: [/*#__PURE__*/(
|
|
755
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
718
756
|
variant: "h3",
|
|
719
757
|
className: "left",
|
|
720
758
|
children: t('blocklet.publish.versionTitle')
|
|
721
|
-
}), /*#__PURE__*/(
|
|
759
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
722
760
|
sx: {
|
|
723
761
|
flex: 1
|
|
724
762
|
},
|
|
725
|
-
children: [/*#__PURE__*/(
|
|
763
|
+
children: [/*#__PURE__*/_jsx(TextField, {
|
|
726
764
|
required: true,
|
|
727
|
-
|
|
728
|
-
|
|
765
|
+
disabled: readOnly,
|
|
766
|
+
label: `Blocklet ${t('common.version')}`,
|
|
767
|
+
placeholder: `Blocklet ${t('common.version')}`,
|
|
729
768
|
InputProps: {
|
|
730
769
|
'data-cy': 'blocklet-version',
|
|
731
770
|
readOnly
|
|
@@ -733,7 +772,7 @@ function CreateRelease(_ref2) {
|
|
|
733
772
|
autoComplete: "off",
|
|
734
773
|
variant: "outlined",
|
|
735
774
|
fullWidth: true,
|
|
736
|
-
value: params.blockletVersion,
|
|
775
|
+
value: params.blockletVersion || '',
|
|
737
776
|
onChange: e => {
|
|
738
777
|
setParamsErrTip({
|
|
739
778
|
blockletVersion: ''
|
|
@@ -744,29 +783,30 @@ function CreateRelease(_ref2) {
|
|
|
744
783
|
},
|
|
745
784
|
error: !!paramsErrTip.blockletVersion,
|
|
746
785
|
helperText: paramsErrTip.blockletVersion || ''
|
|
747
|
-
}), /*#__PURE__*/(
|
|
786
|
+
}), /*#__PURE__*/_jsx(TextField, {
|
|
748
787
|
label: t('blocklet.publish.releaseNote'),
|
|
749
788
|
autoComplete: "off",
|
|
789
|
+
disabled: readOnly,
|
|
750
790
|
variant: "outlined",
|
|
751
791
|
InputProps: {
|
|
752
792
|
'data-cy': 'release-note',
|
|
753
793
|
readOnly,
|
|
754
|
-
endAdornment: /*#__PURE__*/(
|
|
794
|
+
endAdornment: /*#__PURE__*/_jsxs(InputAdornment, {
|
|
755
795
|
position: "end",
|
|
756
|
-
children: [
|
|
796
|
+
children: [params?.note?.length || 0, " / ", PROJECT.MAX_NOTE_LENGTH]
|
|
757
797
|
})
|
|
758
798
|
},
|
|
759
799
|
fullWidth: true,
|
|
760
800
|
multiline: true,
|
|
761
801
|
minRows: 4,
|
|
762
802
|
required: true,
|
|
763
|
-
value: params.note,
|
|
803
|
+
value: params.note || '',
|
|
764
804
|
onChange: e => {
|
|
765
805
|
setParamsErrTip({
|
|
766
806
|
note: ''
|
|
767
807
|
});
|
|
768
808
|
setParams({
|
|
769
|
-
note: e.target.value.slice(0,
|
|
809
|
+
note: e.target.value.slice(0, PROJECT.MAX_NOTE_LENGTH)
|
|
770
810
|
});
|
|
771
811
|
},
|
|
772
812
|
error: !!paramsErrTip.note,
|
|
@@ -776,32 +816,32 @@ function CreateRelease(_ref2) {
|
|
|
776
816
|
}
|
|
777
817
|
})]
|
|
778
818
|
})]
|
|
779
|
-
}), /*#__PURE__*/(
|
|
819
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
780
820
|
display: "flex",
|
|
781
821
|
mt: 3,
|
|
782
822
|
className: "section full-width",
|
|
783
|
-
children: [/*#__PURE__*/(
|
|
823
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
784
824
|
variant: "h3",
|
|
785
825
|
className: "left",
|
|
786
826
|
children: t('blocklet.publish.imgTitle')
|
|
787
|
-
}), /*#__PURE__*/(
|
|
827
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
788
828
|
sx: {
|
|
789
829
|
flex: 1
|
|
790
830
|
},
|
|
791
|
-
children: [/*#__PURE__*/(
|
|
831
|
+
children: [/*#__PURE__*/_jsxs(Box, {
|
|
792
832
|
display: "flex",
|
|
793
|
-
children: [/*#__PURE__*/(
|
|
833
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
794
834
|
variant: "subtitle1",
|
|
795
835
|
sx: {
|
|
796
836
|
mr: 2
|
|
797
837
|
},
|
|
798
838
|
children: t('common.logo')
|
|
799
|
-
}), /*#__PURE__*/(
|
|
839
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
800
840
|
sx: {
|
|
801
841
|
flex: 1,
|
|
802
842
|
cursor: readOnly ? 'default' : 'pointer'
|
|
803
843
|
},
|
|
804
|
-
children: /*#__PURE__*/(
|
|
844
|
+
children: /*#__PURE__*/_jsx(Avatar, {
|
|
805
845
|
variant: "square",
|
|
806
846
|
sx: {
|
|
807
847
|
width: 80,
|
|
@@ -812,28 +852,28 @@ function CreateRelease(_ref2) {
|
|
|
812
852
|
onClick: () => !readOnly && uploaderLogoRef.current.open()
|
|
813
853
|
})
|
|
814
854
|
})]
|
|
815
|
-
}), /*#__PURE__*/(
|
|
855
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
816
856
|
display: "flex",
|
|
817
857
|
mt: 3,
|
|
818
|
-
children: [/*#__PURE__*/(
|
|
858
|
+
children: [/*#__PURE__*/_jsx(Typography, {
|
|
819
859
|
variant: "subtitle1",
|
|
820
860
|
sx: {
|
|
821
861
|
mr: 2
|
|
822
862
|
},
|
|
823
863
|
children: t('common.screenshot')
|
|
824
|
-
}), /*#__PURE__*/(
|
|
864
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
825
865
|
display: "flex",
|
|
826
866
|
alignItems: "center",
|
|
827
867
|
sx: {
|
|
828
868
|
flex: 1,
|
|
829
869
|
flexWrap: 'wrap'
|
|
830
870
|
},
|
|
831
|
-
children: [screenshotUrls.map((x, index) => /*#__PURE__*/(
|
|
871
|
+
children: [screenshotUrls.map((x, index) => /*#__PURE__*/_jsxs(Box, {
|
|
832
872
|
className: "screenshot",
|
|
833
|
-
children: [/*#__PURE__*/(
|
|
873
|
+
children: [/*#__PURE__*/_jsx("img", {
|
|
834
874
|
alt: "screenshot",
|
|
835
875
|
src: x
|
|
836
|
-
}), !readOnly && /*#__PURE__*/(
|
|
876
|
+
}), !readOnly && /*#__PURE__*/_jsx(IconButton, {
|
|
837
877
|
className: "action",
|
|
838
878
|
onClick: () => {
|
|
839
879
|
const arr = [...params.blockletScreenshots];
|
|
@@ -842,9 +882,9 @@ function CreateRelease(_ref2) {
|
|
|
842
882
|
blockletScreenshots: arr
|
|
843
883
|
});
|
|
844
884
|
},
|
|
845
|
-
children: /*#__PURE__*/(
|
|
885
|
+
children: /*#__PURE__*/_jsx(DeleteOutlineIcon, {})
|
|
846
886
|
})]
|
|
847
|
-
})), screenshotUrls.length < 5 && /*#__PURE__*/(
|
|
887
|
+
})), screenshotUrls.length < 5 && /*#__PURE__*/_jsx(Box, {
|
|
848
888
|
sx: {
|
|
849
889
|
width: 200,
|
|
850
890
|
height: 140,
|
|
@@ -862,7 +902,7 @@ function CreateRelease(_ref2) {
|
|
|
862
902
|
})]
|
|
863
903
|
})]
|
|
864
904
|
})]
|
|
865
|
-
}), /*#__PURE__*/(
|
|
905
|
+
}), /*#__PURE__*/_jsx(UploaderComponent, {
|
|
866
906
|
id: "\u200Buploader-logo",
|
|
867
907
|
ref: uploaderLogoRef,
|
|
868
908
|
popup: true,
|
|
@@ -887,14 +927,13 @@ function CreateRelease(_ref2) {
|
|
|
887
927
|
maxNumberOfFiles: 1
|
|
888
928
|
}
|
|
889
929
|
}
|
|
890
|
-
}, "uploader-logo"), /*#__PURE__*/(
|
|
930
|
+
}, "uploader-logo"), /*#__PURE__*/_jsx(UploaderComponent, {
|
|
891
931
|
id: "\u200Buploader-screenshot",
|
|
892
932
|
ref: uploaderScreenshotRef,
|
|
893
933
|
popup: true,
|
|
894
934
|
onUploadFinish: result => {
|
|
895
|
-
var _result$data;
|
|
896
935
|
const blockletScreenshots = params.blockletScreenshots || [];
|
|
897
|
-
blockletScreenshots.push(
|
|
936
|
+
blockletScreenshots.push(result.data?.filename);
|
|
898
937
|
setParams({
|
|
899
938
|
blockletScreenshots
|
|
900
939
|
});
|
|
@@ -913,21 +952,21 @@ function CreateRelease(_ref2) {
|
|
|
913
952
|
}
|
|
914
953
|
}
|
|
915
954
|
}, "uploader-screenshot")]
|
|
916
|
-
}), /*#__PURE__*/(
|
|
955
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
917
956
|
display: "flex",
|
|
918
957
|
mt: 3,
|
|
919
958
|
className: "section full-width",
|
|
920
|
-
children: [/*#__PURE__*/(
|
|
959
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
921
960
|
className: "left",
|
|
922
|
-
children: /*#__PURE__*/(
|
|
961
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
923
962
|
variant: "h3",
|
|
924
963
|
children: t('blocklet.publish.resourceTitle')
|
|
925
964
|
})
|
|
926
|
-
}), /*#__PURE__*/(
|
|
965
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
927
966
|
sx: {
|
|
928
967
|
flex: 1
|
|
929
968
|
},
|
|
930
|
-
children: [/*#__PURE__*/(
|
|
969
|
+
children: [/*#__PURE__*/_jsx(Tabs, {
|
|
931
970
|
tabs: tabs,
|
|
932
971
|
current: tab,
|
|
933
972
|
onChange: onTabChange,
|
|
@@ -935,73 +974,154 @@ function CreateRelease(_ref2) {
|
|
|
935
974
|
ml: -2,
|
|
936
975
|
mt: -1.5
|
|
937
976
|
}
|
|
938
|
-
}), /*#__PURE__*/(
|
|
977
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
939
978
|
children: resourceContent
|
|
940
979
|
})]
|
|
941
980
|
})]
|
|
942
|
-
}), /*#__PURE__*/(
|
|
981
|
+
}), /*#__PURE__*/_jsxs(Box, {
|
|
943
982
|
display: "flex",
|
|
944
983
|
mt: 3,
|
|
945
984
|
className: "section full-width",
|
|
946
|
-
children: [/*#__PURE__*/(
|
|
985
|
+
children: [/*#__PURE__*/_jsx(Box, {
|
|
947
986
|
className: "left",
|
|
948
|
-
children: /*#__PURE__*/(
|
|
987
|
+
children: /*#__PURE__*/_jsx(Typography, {
|
|
949
988
|
variant: "h3",
|
|
950
989
|
children: t('common.components')
|
|
951
990
|
})
|
|
952
|
-
}), /*#__PURE__*/(
|
|
991
|
+
}), /*#__PURE__*/_jsx(Box, {
|
|
953
992
|
sx: {
|
|
954
993
|
flex: 1
|
|
955
994
|
},
|
|
956
|
-
children: /*#__PURE__*/(
|
|
995
|
+
children: /*#__PURE__*/_jsx(SelectComponents, {
|
|
957
996
|
disabled: loading || readOnly,
|
|
958
997
|
app: blocklet,
|
|
959
|
-
value: params
|
|
998
|
+
value: params?.blockletComponents || [],
|
|
960
999
|
onChange: handleChangeSelectedComponents
|
|
961
1000
|
})
|
|
962
1001
|
})]
|
|
963
|
-
}), /*#__PURE__*/(
|
|
1002
|
+
}), /*#__PURE__*/_jsx(Alert, {
|
|
964
1003
|
type: "info",
|
|
965
1004
|
style: {
|
|
966
1005
|
width: '100%'
|
|
967
1006
|
},
|
|
968
|
-
children: /*#__PURE__*/(
|
|
1007
|
+
children: /*#__PURE__*/_jsx(Box, {
|
|
969
1008
|
display: "flex",
|
|
970
1009
|
alignItems: "center",
|
|
971
1010
|
rel: "noreferrer",
|
|
972
1011
|
children: projectType === 'pack' ? t('blocklet.publish.packTip') : t('blocklet.publish.resourceTip')
|
|
973
1012
|
})
|
|
974
1013
|
})]
|
|
975
|
-
}), /*#__PURE__*/(
|
|
1014
|
+
}), /*#__PURE__*/_jsx(Dialog, {
|
|
976
1015
|
title: t('common.connectToStore'),
|
|
977
1016
|
disableEscapeKeyDown: true,
|
|
978
1017
|
disablePortal: false,
|
|
979
1018
|
fullWidth: true,
|
|
980
1019
|
open: showStoreDialog,
|
|
981
1020
|
onClose: () => setShowStoreDialog(false),
|
|
982
|
-
children: /*#__PURE__*/(
|
|
1021
|
+
children: /*#__PURE__*/_jsx(ConnectStoreList, {
|
|
983
1022
|
projectType: projectType,
|
|
984
1023
|
blocklet: blocklet,
|
|
985
|
-
releaseType:
|
|
1024
|
+
releaseType: params?.blockletComponents?.length > 0 ? 'pack' : 'resource',
|
|
986
1025
|
projectId: projectId,
|
|
987
1026
|
releaseId: releaseId,
|
|
988
|
-
|
|
1027
|
+
componentDid: componentDid,
|
|
1028
|
+
onPublish: onPublish,
|
|
1029
|
+
onOpenConnectStore: onOpenConnectStore,
|
|
989
1030
|
onDelete: getData,
|
|
990
|
-
connectedStores: params.connectedStores,
|
|
991
|
-
publishedStoreIds: release
|
|
1031
|
+
connectedStores: params.connectedStores || [],
|
|
1032
|
+
publishedStoreIds: release?.publishedStoreIds
|
|
992
1033
|
})
|
|
993
1034
|
})]
|
|
994
|
-
})
|
|
1035
|
+
});
|
|
995
1036
|
}
|
|
996
|
-
CreateRelease.
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1037
|
+
CreateRelease.propTypes = {
|
|
1038
|
+
initUrl: PropTypes.object
|
|
1039
|
+
};
|
|
1040
|
+
CreateRelease.defaultProps = {
|
|
1041
|
+
initUrl: null
|
|
1042
|
+
};
|
|
1043
|
+
const Main = styled.div`
|
|
1044
|
+
.sticky-header {
|
|
1045
|
+
margin-top: -12px;
|
|
1046
|
+
padding: 12px 0;
|
|
1047
|
+
position: sticky;
|
|
1048
|
+
top: 0;
|
|
1049
|
+
z-index: 99;
|
|
1050
|
+
display: flex;
|
|
1051
|
+
align-items: center;
|
|
1052
|
+
justify-content: space-between;
|
|
1053
|
+
background-color: #fff;
|
|
1054
|
+
padding-bottom: 12px;
|
|
1055
|
+
border-bottom: ${({
|
|
1056
|
+
theme
|
|
1057
|
+
}) => `1px solid ${theme.palette.divider}`};
|
|
1058
|
+
}
|
|
1059
|
+
.screenshot {
|
|
1060
|
+
margin-bottom: 16px;
|
|
1061
|
+
max-width: 200px;
|
|
1062
|
+
max-height: 140px;
|
|
1063
|
+
width: 200px;
|
|
1064
|
+
height: 140px;
|
|
1065
|
+
overflow: hidden;
|
|
1066
|
+
display: flex;
|
|
1067
|
+
align-items: center;
|
|
1068
|
+
justify-content: center;
|
|
1069
|
+
background-color: #eee;
|
|
1070
|
+
margin-right: 16px;
|
|
1071
|
+
position: relative;
|
|
1072
|
+
.action {
|
|
1073
|
+
visibility: hidden;
|
|
1074
|
+
position: absolute;
|
|
1075
|
+
top: 0px;
|
|
1076
|
+
right: 0px;
|
|
1077
|
+
background-color: rgba(0, 0, 0, 0.2);
|
|
1078
|
+
color: rgba(255, 255, 255, 0.8);
|
|
1079
|
+
}
|
|
1080
|
+
&:hover .action {
|
|
1081
|
+
visibility: visible;
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
.screenshot img {
|
|
1085
|
+
width: 100%; /* 图像宽度填充容器 */
|
|
1086
|
+
height: auto; /* 图像高度自适应 */
|
|
1087
|
+
}
|
|
1088
|
+
.section {
|
|
1089
|
+
max-width: 800px;
|
|
1090
|
+
&.full-width {
|
|
1091
|
+
max-width: 100%;
|
|
1092
|
+
}
|
|
1093
|
+
.MuiTypography-h3 {
|
|
1094
|
+
font-size: 1.1rem;
|
|
1095
|
+
font-weight: 700;
|
|
1096
|
+
}
|
|
1097
|
+
.left {
|
|
1098
|
+
flex-shrink: 0;
|
|
1099
|
+
width: 140px;
|
|
1100
|
+
}
|
|
1101
|
+
.MuiTabs-indicator {
|
|
1102
|
+
display: none;
|
|
1103
|
+
}
|
|
1104
|
+
.MuiTypography-subtitle1 {
|
|
1105
|
+
width: 120px;
|
|
1106
|
+
font-weight: 700;
|
|
1107
|
+
font-size: 1rem;
|
|
1108
|
+
${({
|
|
1109
|
+
theme
|
|
1110
|
+
}) => theme.breakpoints.down('sm')} {
|
|
1111
|
+
width: 80px;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
.MuiButtonBase-root {
|
|
1116
|
+
a {
|
|
1117
|
+
color: inherit;
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
.MuiInputBase-multiline .MuiInputAdornment-positionEnd {
|
|
1121
|
+
align-self: flex-end;
|
|
1122
|
+
.MuiTypography-root {
|
|
1123
|
+
font-size: 0.8rem;
|
|
1124
|
+
}
|
|
1125
|
+
font-size: 0.8rem;
|
|
1126
|
+
}
|
|
1127
|
+
`;
|