@blocklet/ui-react 3.0.6 → 3.0.8

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.
Files changed (133) hide show
  1. package/lib/@types/index.d.ts +204 -3
  2. package/lib/BlockletStudio/index.d.ts +27 -26
  3. package/lib/BlockletStudio/index.js +66 -66
  4. package/lib/ComponentInstaller/index.d.ts +15 -15
  5. package/lib/ComponentInstaller/installer-item.d.ts +10 -10
  6. package/lib/ComponentInstaller/locales.d.ts +2 -2
  7. package/lib/ComponentInstaller/use-component-installed.d.ts +2 -2
  8. package/lib/ComponentManager/components/add-component.d.ts +16 -13
  9. package/lib/ComponentManager/components/add-component.js +29 -29
  10. package/lib/ComponentManager/components/check-component.d.ts +2 -2
  11. package/lib/ComponentManager/components/publish-component.d.ts +10 -7
  12. package/lib/ComponentManager/components/publish-component.js +19 -19
  13. package/lib/ComponentManager/components/resource-dialog.d.ts +13 -11
  14. package/lib/ComponentManager/components/resource-dialog.js +1 -1
  15. package/lib/ComponentManager/index.d.ts +3 -4
  16. package/lib/ComponentManager/libs/locales.d.ts +14 -19
  17. package/lib/Dashboard/index.d.ts +16 -13
  18. package/lib/Footer/brand.d.ts +8 -8
  19. package/lib/Footer/copyright.d.ts +7 -7
  20. package/lib/Footer/index.d.ts +2 -2
  21. package/lib/Footer/internal-footer.d.ts +26 -21
  22. package/lib/Footer/internal-footer.js +1 -1
  23. package/lib/Footer/layout/plain.d.ts +15 -12
  24. package/lib/Footer/layout/row.d.ts +7 -7
  25. package/lib/Footer/layout/standard.d.ts +17 -14
  26. package/lib/Footer/layout/standard.js +1 -1
  27. package/lib/Footer/links.d.ts +15 -12
  28. package/lib/Footer/links.js +3 -3
  29. package/lib/Footer/social-media.d.ts +8 -8
  30. package/lib/Header/index.d.ts +23 -13
  31. package/lib/Header/index.js +17 -17
  32. package/lib/Icon/index.d.ts +9 -7
  33. package/lib/Icon/index.js +6 -6
  34. package/lib/Notifications/Snackbar.d.ts +16 -8
  35. package/lib/Notifications/Snackbar.js +1 -1
  36. package/lib/Notifications/hooks/use-title.d.ts +48 -9
  37. package/lib/Notifications/hooks/use-title.js +9 -9
  38. package/lib/Notifications/hooks/use-width.d.ts +2 -2
  39. package/lib/Notifications/utils.d.ts +69 -9
  40. package/lib/UserCenter/components/config-inviter.d.ts +4 -4
  41. package/lib/UserCenter/components/config-profile.d.ts +5 -5
  42. package/lib/UserCenter/components/danger-zone.d.ts +1 -2
  43. package/lib/UserCenter/components/editable-field.d.ts +34 -30
  44. package/lib/UserCenter/components/editable-field.js +12 -12
  45. package/lib/UserCenter/components/nft.d.ts +4 -4
  46. package/lib/UserCenter/components/notification.d.ts +5 -5
  47. package/lib/UserCenter/components/notification.js +5 -5
  48. package/lib/UserCenter/components/passport.d.ts +5 -5
  49. package/lib/UserCenter/components/privacy.d.ts +11 -5
  50. package/lib/UserCenter/components/settings.d.ts +10 -8
  51. package/lib/UserCenter/components/status-dialog/date-picker.d.ts +10 -9
  52. package/lib/UserCenter/components/status-dialog/date-picker.js +17 -10
  53. package/lib/UserCenter/components/status-dialog/index.d.ts +12 -9
  54. package/lib/UserCenter/components/status-dialog/index.js +8 -1
  55. package/lib/UserCenter/components/status-selector/duration-menu.d.ts +7 -7
  56. package/lib/UserCenter/components/status-selector/index.d.ts +9 -8
  57. package/lib/UserCenter/components/status-selector/index.js +5 -5
  58. package/lib/UserCenter/components/status-selector/menu-item.d.ts +24 -9
  59. package/lib/UserCenter/components/status-selector/menu-item.js +11 -6
  60. package/lib/UserCenter/components/storage/action.d.ts +9 -7
  61. package/lib/UserCenter/components/storage/connected.d.ts +5 -4
  62. package/lib/UserCenter/components/storage/delete.d.ts +6 -5
  63. package/lib/UserCenter/components/storage/disconnect.d.ts +2 -2
  64. package/lib/UserCenter/components/storage/index.d.ts +2 -2
  65. package/lib/UserCenter/components/storage/preview-nft.d.ts +5 -5
  66. package/lib/UserCenter/components/third-party-login/index.d.ts +4 -4
  67. package/lib/UserCenter/components/third-party-login/index.js +23 -29
  68. package/lib/UserCenter/components/third-party-login/third-party-item.d.ts +13 -4
  69. package/lib/UserCenter/components/user-center.d.ts +16 -15
  70. package/lib/UserCenter/components/user-info/address.d.ts +16 -7
  71. package/lib/UserCenter/components/user-info/index.d.ts +4 -5
  72. package/lib/UserCenter/components/user-info/link-preview-input.d.ts +5 -6
  73. package/lib/UserCenter/components/user-info/metadata.d.ts +10 -7
  74. package/lib/UserCenter/components/user-info/switch-role.d.ts +7 -6
  75. package/lib/UserCenter/components/user-info/timezone-select.d.ts +8 -7
  76. package/lib/UserCenter/components/user-info/user-basic-info.d.ts +13 -12
  77. package/lib/UserCenter/components/user-info/user-info-item.d.ts +11 -6
  78. package/lib/UserCenter/components/user-info/user-info-item.js +1 -1
  79. package/lib/UserCenter/components/user-info/user-info.d.ts +6 -6
  80. package/lib/UserCenter/components/user-info/user-status.d.ts +9 -9
  81. package/lib/UserCenter/components/user-info/user-status.js +17 -17
  82. package/lib/UserCenter/components/user-info/utils.d.ts +33 -15
  83. package/lib/UserCenter/components/webhook-item.d.ts +2 -10
  84. package/lib/UserCenter/index.d.ts +1 -2
  85. package/lib/UserCenter/libs/locales.d.ts +345 -513
  86. package/lib/UserCenter/libs/utils.d.ts +4 -3
  87. package/lib/UserSessions/components/user-session-info.d.ts +5 -5
  88. package/lib/UserSessions/components/user-sessions.d.ts +20 -8
  89. package/lib/UserSessions/index.d.ts +1 -2
  90. package/lib/UserSessions/libs/locales.d.ts +60 -88
  91. package/lib/UserSessions/libs/utils.d.ts +2 -3
  92. package/lib/blocklets.d.ts +9 -10
  93. package/lib/common/domain-warning.d.ts +7 -7
  94. package/lib/common/header-addons.d.ts +9 -9
  95. package/lib/common/link-blocker.d.ts +6 -3
  96. package/lib/common/notification-addon.d.ts +6 -6
  97. package/lib/common/overridable-theme-provider.d.ts +10 -7
  98. package/lib/common/wallet-hidden-topbar.d.ts +1 -2
  99. package/lib/common/ws.d.ts +3 -4
  100. package/lib/contexts/config-user-space.d.ts +27 -7
  101. package/lib/hooks/use-mobile.d.ts +3 -3
  102. package/lib/index.d.ts +10 -12
  103. package/lib/libs/client.d.ts +2 -3
  104. package/lib/libs/constant.d.ts +1 -2
  105. package/lib/libs/spaces.d.ts +2 -3
  106. package/lib/libs/with-hide-when-embed.d.ts +2 -3
  107. package/lib/types.d.ts +31 -32
  108. package/lib/utils.d.ts +10 -11
  109. package/package.json +8 -6
  110. package/src/BlockletStudio/index.tsx +13 -13
  111. package/src/ComponentManager/components/add-component.tsx +6 -6
  112. package/src/ComponentManager/components/publish-component.tsx +2 -2
  113. package/src/ComponentManager/components/resource-dialog.tsx +1 -1
  114. package/src/Footer/internal-footer.jsx +1 -1
  115. package/src/Footer/layout/standard.jsx +1 -1
  116. package/src/Footer/links.jsx +1 -1
  117. package/src/Header/index.tsx +2 -2
  118. package/src/Icon/index.tsx +2 -2
  119. package/src/Notifications/Snackbar.tsx +2 -2
  120. package/src/Notifications/hooks/use-title.tsx +1 -1
  121. package/src/UserCenter/components/editable-field.tsx +6 -6
  122. package/src/UserCenter/components/notification.tsx +2 -2
  123. package/src/UserCenter/components/status-dialog/date-picker.tsx +8 -1
  124. package/src/UserCenter/components/status-dialog/index.tsx +8 -1
  125. package/src/UserCenter/components/status-selector/index.tsx +1 -1
  126. package/src/UserCenter/components/status-selector/menu-item.tsx +6 -1
  127. package/src/UserCenter/components/third-party-login/index.tsx +0 -2
  128. package/src/UserCenter/components/user-center.tsx +1 -1
  129. package/src/UserCenter/components/user-info/link-preview-input.tsx +2 -2
  130. package/src/UserCenter/components/user-info/user-info-item.tsx +1 -1
  131. package/src/UserCenter/components/user-info/user-info.tsx +1 -1
  132. package/src/UserCenter/components/user-info/user-status.tsx +2 -2
  133. package/lib/UserCenter/components/storage/icons/empty-spaces-nft.svg.d.ts +0 -3
@@ -1,3 +1,204 @@
1
- declare var o: any;
2
- declare var r: any;
3
- export { o as DurationEnum, r as StatusEnum };
1
+ import { Axios } from 'axios';
2
+ import { UserPublicInfo } from '@blocklet/js-sdk';
3
+ import { OAUTH_PROVIDER } from '@arcblock/ux/lib/Util/constant';
4
+ import { CloseConnect, OpenConnect } from '@arcblock/did-connect/lib/types';
5
+ export type SessionContext = {
6
+ session: Session;
7
+ api: Axios;
8
+ connectApi: {
9
+ open: OpenConnect;
10
+ close: CloseConnect;
11
+ };
12
+ };
13
+ export type OAuthAccount = {
14
+ provider: keyof typeof OAUTH_PROVIDER;
15
+ id: string;
16
+ did: string;
17
+ pk: string;
18
+ lastLoginAt: string;
19
+ firstLoginAt: string;
20
+ order?: number;
21
+ userInfo?: {
22
+ email: string;
23
+ emailVerified: boolean;
24
+ name: string;
25
+ picture: string;
26
+ sub: string;
27
+ extraData: Object;
28
+ };
29
+ };
30
+ export type WalletAccount = {
31
+ provider: 'wallet';
32
+ did: string;
33
+ pk: string;
34
+ lastLoginAt: string;
35
+ firstLoginAt: string;
36
+ };
37
+ export type NFTAccount = {
38
+ provider: 'nft';
39
+ did: string;
40
+ pk: string;
41
+ owner: string;
42
+ lastLoginAt: string;
43
+ firstLoginAt: string;
44
+ };
45
+ export type ConnectedAccount = OAuthAccount | WalletAccount | NFTAccount;
46
+ export type UserMetadataLink = {
47
+ url: string;
48
+ favicon?: string;
49
+ };
50
+ export declare enum DurationEnum {
51
+ NoClear = "no_clear",
52
+ ThirtyMinutes = "30_minutes",
53
+ OneHour = "1_hour",
54
+ FourHours = "4_hours",
55
+ Today = "today",
56
+ ThisWeek = "this_week",
57
+ Custom = "custom"
58
+ }
59
+ export declare enum StatusEnum {
60
+ Meeting = "meeting",
61
+ Community = "community",
62
+ Holiday = "holiday",
63
+ OffSick = "off_sick",
64
+ WorkingRemotely = "working_remotely"
65
+ }
66
+ export type UserPhoneProps = {
67
+ country: string;
68
+ phoneNumber?: string;
69
+ };
70
+ export type UserMetadata = {
71
+ bio?: string;
72
+ location?: string;
73
+ timezone?: string;
74
+ joinedAt?: string;
75
+ status?: {
76
+ value: string;
77
+ duration?: DurationEnum;
78
+ dateRange?: Date[];
79
+ };
80
+ links?: UserMetadataLink[];
81
+ cover?: string;
82
+ email?: string;
83
+ phone?: UserPhoneProps;
84
+ };
85
+ export type UserAddress = {
86
+ country?: string;
87
+ province?: string;
88
+ city?: string;
89
+ line1?: string;
90
+ line2?: string;
91
+ postalCode?: string;
92
+ };
93
+ export type User = UserPublicInfo & {
94
+ role: string;
95
+ email?: string;
96
+ phone?: string;
97
+ sourceProvider?: string;
98
+ sourceAppPid?: string;
99
+ lastLoginAt?: string;
100
+ lastLoginIp?: string;
101
+ createdAt?: string;
102
+ passports?: any[];
103
+ didSpace?: Record<string, any>;
104
+ connectedAccounts?: any[];
105
+ locale?: string;
106
+ url: string;
107
+ inviter?: string;
108
+ emailVerified?: boolean;
109
+ phoneVerified?: boolean;
110
+ metadata?: UserMetadata;
111
+ address?: UserAddress;
112
+ };
113
+ export type UserCenterTab = {
114
+ value: string;
115
+ label: string;
116
+ url: string;
117
+ protected: boolean;
118
+ icon?: string;
119
+ isPrivate?: boolean;
120
+ };
121
+ export type Session = {
122
+ loading: boolean;
123
+ initialized: boolean;
124
+ user?: User;
125
+ login: any;
126
+ logout: any;
127
+ switch: any;
128
+ switchDid: any;
129
+ refreshProfile: () => Promise<void>;
130
+ switchProfile: any;
131
+ switchPassport: any;
132
+ refresh: Function;
133
+ useOAuth: Function;
134
+ usePasskey: Function;
135
+ };
136
+ export type WebhookType = 'slack' | 'api';
137
+ export type WebhookItemData = {
138
+ type: WebhookType;
139
+ url: string;
140
+ };
141
+ export type WebhookItemProps = {
142
+ onTest: (params: WebhookItemData) => void;
143
+ onSave: (params: WebhookItemData) => void;
144
+ onDelete?: (params: WebhookItemData) => void;
145
+ onCancel?: () => void;
146
+ edit: boolean;
147
+ type?: WebhookType;
148
+ url?: string;
149
+ };
150
+ export type CreatePassportProps = {
151
+ issuer: string;
152
+ title: string;
153
+ issuerDid: string;
154
+ issuerAvatarUrl: string;
155
+ ownerDid: string;
156
+ ownerName?: string;
157
+ ownerAvatarUrl: string;
158
+ preferredColor?: string;
159
+ revoked?: boolean;
160
+ isDataUrl?: boolean;
161
+ width?: string;
162
+ height?: string;
163
+ scope?: string;
164
+ role?: string;
165
+ display?: {
166
+ type: string;
167
+ content: string;
168
+ };
169
+ };
170
+ export type BlockletMetaProps = {
171
+ appLogo?: React.ReactNode;
172
+ appName?: string;
173
+ theme?: {
174
+ background?: string;
175
+ };
176
+ enableConnect?: boolean;
177
+ enableLocale?: boolean;
178
+ navigation?: Array<{
179
+ title?: string | object;
180
+ link?: string | object;
181
+ icon?: string;
182
+ items?: Array<{
183
+ title?: string | object;
184
+ link?: string | object;
185
+ }>;
186
+ }>;
187
+ };
188
+ export type SessionManagerProps = {
189
+ showText?: boolean;
190
+ showRole?: boolean;
191
+ switchDid?: boolean;
192
+ switchProfile?: boolean;
193
+ switchPassport?: boolean;
194
+ disableLogout?: boolean;
195
+ onLogin?: () => void;
196
+ onLogout?: () => void;
197
+ onSwitchDid?: () => void;
198
+ onSwitchProfile?: () => void;
199
+ onSwitchPassport?: () => void;
200
+ menu?: any[];
201
+ menuRender?: () => void;
202
+ dark?: boolean;
203
+ size?: number;
204
+ };
@@ -1,26 +1,27 @@
1
- export { G as default };
2
- declare function G({ open: a, setOpen: s, onOpened: t, componentDid: i, tenantScope: o, resourcesParams: h, mode: w, title: E, logo: R, description: L, introduction: y, note: D, componentsTitle: S, resourcesTitle: b, onUploaded: j, onReleased: x, onConnected: B, components: P, resources: U, style: _, zIndex: k, dependentComponentsMode: C, ...F }: {
3
- [x: string]: any;
4
- open: any;
5
- setOpen: any;
6
- onOpened: any;
7
- componentDid: any;
8
- tenantScope: any;
9
- resourcesParams?: {} | undefined;
10
- mode?: string | undefined;
11
- title: any;
12
- logo: any;
13
- description: any;
14
- introduction: any;
15
- note: any;
16
- componentsTitle: any;
17
- resourcesTitle: any;
18
- onUploaded: any;
19
- onReleased: any;
20
- onConnected: any;
21
- components?: any[] | undefined;
22
- resources?: {} | undefined;
23
- style?: {} | undefined;
24
- zIndex?: number | undefined;
25
- dependentComponentsMode: any;
26
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | null;
1
+ interface BlockletStudioProps {
2
+ open: boolean;
3
+ setOpen: (open: boolean) => void;
4
+ onOpened?: () => void;
5
+ componentDid: string;
6
+ tenantScope?: string;
7
+ resourcesParams?: Record<string, any>;
8
+ mode?: string;
9
+ title?: string;
10
+ logo?: string;
11
+ description?: string;
12
+ introduction?: string;
13
+ note?: string;
14
+ onUploaded?: (data: unknown) => void;
15
+ onReleased?: (data: unknown) => void;
16
+ onConnected?: (data: unknown) => void;
17
+ components?: Record<string, unknown>[];
18
+ resources?: Record<string, unknown>;
19
+ componentsTitle?: string;
20
+ resourcesTitle?: string;
21
+ style?: React.CSSProperties;
22
+ zIndex?: number;
23
+ dependentComponentsMode?: 'auto' | 'readonly';
24
+ [key: string]: any;
25
+ }
26
+ declare function BlockletStudio({ open, setOpen, onOpened, componentDid, tenantScope, resourcesParams, mode, title, logo, description, introduction, note, componentsTitle, resourcesTitle, onUploaded, onReleased, onConnected, components, resources, style, zIndex, dependentComponentsMode, ...rest }: BlockletStudioProps): import("react/jsx-runtime").JSX.Element | null;
27
+ export default BlockletStudio;
@@ -1,81 +1,81 @@
1
- import { jsx as T } from "react/jsx-runtime";
2
- import { BLOCKLET_SERVICE_PATH_PREFIX as V } from "@arcblock/ux/lib/Util/constant";
3
- import { useState as A, useRef as p, useEffect as H } from "react";
4
- import { joinURL as J } from "ufo";
5
- function K(a, s) {
6
- const t = new URL(a);
7
- return Object.keys(s).forEach((i) => {
8
- const o = s[i];
9
- o !== void 0 && t.searchParams.set(i, typeof o == "string" ? o : JSON.stringify(o));
10
- }), t.pathname + t.search;
1
+ import { jsx as I } from "react/jsx-runtime";
2
+ import { BLOCKLET_SERVICE_PATH_PREFIX as T } from "@arcblock/ux/lib/Util/constant";
3
+ import { useState as V, useRef as p, useEffect as A } from "react";
4
+ import { joinURL as H } from "ufo";
5
+ function J(d, s) {
6
+ const i = new URL(d);
7
+ return Object.keys(s).forEach((e) => {
8
+ const r = s[e];
9
+ r !== void 0 && i.searchParams.set(e, typeof r == "string" ? r : JSON.stringify(r));
10
+ }), i.pathname + i.search;
11
11
  }
12
- function G({
13
- open: a,
12
+ function z({
13
+ open: d,
14
14
  setOpen: s,
15
- onOpened: t,
16
- componentDid: i,
17
- tenantScope: o,
15
+ onOpened: i = void 0,
16
+ componentDid: e,
17
+ tenantScope: r = void 0,
18
18
  resourcesParams: h = {},
19
19
  mode: w = "dialog",
20
- title: E,
21
- logo: R,
22
- description: L,
23
- introduction: y,
24
- note: D,
25
- componentsTitle: S,
26
- resourcesTitle: b,
27
- onUploaded: j,
28
- onReleased: x,
29
- onConnected: B,
30
- components: P = [],
31
- resources: U = {},
32
- style: _ = {},
33
- zIndex: k = 9999,
34
- dependentComponentsMode: C,
35
- ...F
20
+ title: E = void 0,
21
+ logo: v = void 0,
22
+ description: R = void 0,
23
+ introduction: L = void 0,
24
+ note: y = void 0,
25
+ componentsTitle: D = void 0,
26
+ resourcesTitle: S = void 0,
27
+ onUploaded: b = void 0,
28
+ onReleased: j = void 0,
29
+ onConnected: x = void 0,
30
+ components: B = [],
31
+ resources: P = {},
32
+ style: U = {},
33
+ zIndex: _ = 9999,
34
+ dependentComponentsMode: k = void 0,
35
+ ...C
36
36
  }) {
37
- const [n, c] = A(!1), u = p("");
38
- u.current = i;
39
- const e = p({});
40
- if (e.current["resourceDialog.close"] = () => {
41
- c(!1), s(!1);
42
- }, e.current["resourceDialog.loaded"] = () => {
43
- c(!0), t == null || t();
44
- }, e.current["studioDialog.uploaded"] = j, e.current["studioDialog.connected"] = B, e.current["studioDialog.released"] = x, H(() => {
45
- const l = (r) => {
37
+ const [a, n] = V(!1), c = p("");
38
+ c.current = e;
39
+ const t = p({});
40
+ if (t.current["resourceDialog.close"] = () => {
41
+ n(!1), s(!1);
42
+ }, t.current["resourceDialog.loaded"] = () => {
43
+ n(!0), i == null || i();
44
+ }, t.current["studioDialog.uploaded"] = b, t.current["studioDialog.connected"] = x, t.current["studioDialog.released"] = j, A(() => {
45
+ const u = (o) => {
46
46
  var f, m, g;
47
- if (((f = r == null ? void 0 : r.data) == null ? void 0 : f.componentDid) !== u.current)
47
+ if (((f = o == null ? void 0 : o.data) == null ? void 0 : f.componentDid) !== c.current)
48
48
  return;
49
- const d = e.current[(m = r == null ? void 0 : r.data) == null ? void 0 : m.event];
50
- typeof d == "function" && d((g = r == null ? void 0 : r.data) == null ? void 0 : g.data);
49
+ const l = t.current[(m = o == null ? void 0 : o.data) == null ? void 0 : m.event];
50
+ typeof l == "function" && l((g = o == null ? void 0 : o.data) == null ? void 0 : g.data);
51
51
  };
52
- return window.addEventListener("message", l), () => {
53
- window.removeEventListener("message", l);
52
+ return window.addEventListener("message", u), () => {
53
+ window.removeEventListener("message", u);
54
54
  };
55
- }, []), !a)
55
+ }, []), !d)
56
56
  return null;
57
- const I = K(
58
- J(window.location.origin, V, "/embed/resources", i, "/publish"),
57
+ const F = J(
58
+ H(window.location.origin, T, "/embed/resources", e, "/publish"),
59
59
  {
60
60
  title: E,
61
- logo: R,
62
- description: L,
63
- introduction: y,
64
- note: D,
65
- tenantScope: o,
61
+ logo: v,
62
+ description: R,
63
+ introduction: L,
64
+ note: y,
65
+ tenantScope: r,
66
66
  mode: w,
67
67
  resourcesParams: h,
68
- resources: U,
69
- components: P,
70
- resourcesTitle: b,
71
- componentsTitle: S,
72
- dependentComponentsMode: C
68
+ resources: P,
69
+ components: B,
70
+ resourcesTitle: S,
71
+ componentsTitle: D,
72
+ dependentComponentsMode: k
73
73
  }
74
74
  );
75
- return /* @__PURE__ */ T(
75
+ return /* @__PURE__ */ I(
76
76
  "iframe",
77
77
  {
78
- src: I,
78
+ src: F,
79
79
  title: "Blocklet Studio",
80
80
  style: {
81
81
  position: "fixed",
@@ -83,18 +83,18 @@ function G({
83
83
  left: 0,
84
84
  width: "100vw",
85
85
  height: "100vh",
86
- zIndex: k,
86
+ zIndex: _,
87
87
  border: 0,
88
88
  padding: 0,
89
89
  margin: 0,
90
- pointerEvents: n ? "auto" : "none",
91
- opacity: n ? 1 : 0,
92
- ..._
90
+ pointerEvents: a ? "auto" : "none",
91
+ opacity: a ? 1 : 0,
92
+ ...U
93
93
  },
94
- ...F
94
+ ...C
95
95
  }
96
96
  );
97
97
  }
98
98
  export {
99
- G as default
99
+ z as default
100
100
  };
@@ -1,18 +1,18 @@
1
- import { default as t } from 'prop-types';
2
- export { G as default };
3
- declare function G(l: any): any;
4
- declare namespace G {
1
+ import { default as PropTypes } from 'prop-types';
2
+ declare function WrapComponentInstaller(props: any): any;
3
+ declare namespace WrapComponentInstaller {
5
4
  namespace propTypes {
6
- let children: t.Validator<any>;
7
- let disabled: t.Requireable<boolean>;
8
- let warnIcon: t.Requireable<t.ReactNodeLike>;
9
- let did: t.Validator<NonNullable<NonNullable<string | (string | null | undefined)[] | null | undefined>>>;
10
- let noPermissionMute: t.Requireable<boolean>;
11
- let onInstalled: t.Requireable<(...args: any[]) => any>;
12
- let onError: t.Requireable<(...args: any[]) => any>;
13
- let closeByOutSize: t.Requireable<boolean>;
14
- let onClose: t.Requireable<(...args: any[]) => any>;
15
- let fallback: t.Requireable<t.ReactNodeLike>;
16
- let roles: t.Requireable<any[]>;
5
+ let children: PropTypes.Validator<any>;
6
+ let disabled: PropTypes.Requireable<boolean>;
7
+ let warnIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
8
+ let did: PropTypes.Validator<NonNullable<NonNullable<string | (string | null | undefined)[] | null | undefined>>>;
9
+ let noPermissionMute: PropTypes.Requireable<boolean>;
10
+ let onInstalled: PropTypes.Requireable<(...args: any[]) => any>;
11
+ let onError: PropTypes.Requireable<(...args: any[]) => any>;
12
+ let closeByOutSize: PropTypes.Requireable<boolean>;
13
+ let onClose: PropTypes.Requireable<(...args: any[]) => any>;
14
+ let fallback: PropTypes.Requireable<PropTypes.ReactNodeLike>;
15
+ let roles: PropTypes.Requireable<any[]>;
17
16
  }
18
17
  }
18
+ export default WrapComponentInstaller;
@@ -1,18 +1,18 @@
1
- import { default as s } from 'prop-types';
2
- export { I as default };
3
- declare function I({ optionalComponent: e, index: h, installStatus: l, hasPermission: f, t: c }: {
1
+ import { default as PropTypes } from 'prop-types';
2
+ declare function InstallerItem({ optionalComponent, index, installStatus, hasPermission, t }: {
4
3
  optionalComponent: any;
5
4
  index: any;
6
5
  installStatus?: string | undefined;
7
6
  hasPermission: any;
8
7
  t: any;
9
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
10
- declare namespace I {
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ declare namespace InstallerItem {
11
10
  namespace propTypes {
12
- let t: s.Validator<(...args: any[]) => any>;
13
- let optionalComponent: s.Validator<object>;
14
- let index: s.Validator<number>;
15
- let installStatus: s.Requireable<string>;
16
- let hasPermission: s.Validator<boolean>;
11
+ let t: PropTypes.Validator<(...args: any[]) => any>;
12
+ let optionalComponent: PropTypes.Validator<object>;
13
+ let index: PropTypes.Validator<number>;
14
+ let installStatus: PropTypes.Requireable<string>;
15
+ let hasPermission: PropTypes.Validator<boolean>;
17
16
  }
18
17
  }
18
+ export default InstallerItem;
@@ -1,5 +1,5 @@
1
- export { e as default };
2
- declare namespace e {
1
+ export default translations;
2
+ declare namespace translations {
3
3
  namespace zh {
4
4
  let componentInstallerTitle: string;
5
5
  let componentInstallerInstall: string;
@@ -1,5 +1,5 @@
1
- export { B as default };
2
- declare function B({ did: e, onInstalled: f, onError: p }: {
1
+ export default useComponentInstalled;
2
+ declare function useComponentInstalled({ did, onInstalled, onError }: {
3
3
  did: any;
4
4
  onInstalled: any;
5
5
  onError: any;
@@ -1,13 +1,16 @@
1
- export { $ as default };
2
- declare function $({ componentDid: a, resourceType: w, resourceDid: p, grantedRoles: L, autoClose: R, selectedMeta: D, storeUrl: E, onComplete: n, onClose: t, render: m }: {
3
- componentDid: any;
4
- resourceType: any;
5
- resourceDid: any;
6
- grantedRoles?: string[] | undefined;
7
- autoClose?: boolean | undefined;
8
- selectedMeta: any;
9
- storeUrl: any;
10
- onComplete: any;
11
- onClose: any;
12
- render: any;
13
- }): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
1
+ import { ReactElement } from 'react';
2
+ export default function AddComponent({ componentDid, resourceType, resourceDid, grantedRoles, autoClose, selectedMeta, storeUrl, onComplete, onClose, render, }: {
3
+ componentDid: string;
4
+ resourceType?: string;
5
+ resourceDid?: string;
6
+ autoClose?: boolean;
7
+ selectedMeta?: any;
8
+ storeUrl?: string;
9
+ grantedRoles?: string[];
10
+ onComplete: () => void;
11
+ onClose: () => void;
12
+ render?: ({ onClick, loading }: {
13
+ onClick: () => void;
14
+ loading: boolean;
15
+ }) => ReactElement<any>;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,31 +1,31 @@
1
- import { jsxs as B, Fragment as C, jsx as g } from "react/jsx-runtime";
2
- import { use as F, useRef as I, useEffect as S } from "react";
3
- import j from "@arcblock/ux/lib/Button";
4
- import { useLocaleContext as P } from "@arcblock/ux/lib/Locale/context";
5
- import { BLOCKLET_SERVICE_PATH_PREFIX as T } from "@arcblock/ux/lib/Util/constant";
6
- import { useMemoizedFn as r, useReactive as U } from "ahooks";
7
- import { translate as _ } from "@arcblock/ux/lib/Locale/util";
8
- import { withQuery as A, joinURL as M } from "ufo";
9
- import { SessionContext as O } from "@arcblock/did-connect/lib/Session";
1
+ import { jsxs as y, Fragment as B, jsx as g } from "react/jsx-runtime";
2
+ import { use as C, useRef as F, useEffect as I } from "react";
3
+ import S from "@arcblock/ux/lib/Button";
4
+ import { useLocaleContext as j } from "@arcblock/ux/lib/Locale/context";
5
+ import { BLOCKLET_SERVICE_PATH_PREFIX as P } from "@arcblock/ux/lib/Util/constant";
6
+ import { useMemoizedFn as r, useReactive as T } from "ahooks";
7
+ import { translate as U } from "@arcblock/ux/lib/Locale/util";
8
+ import { withQuery as _, joinURL as A } from "ufo";
9
+ import { SessionContext as M } from "@arcblock/did-connect/lib/Session";
10
10
  import h from "@arcblock/ux/lib/Toast";
11
- import z from "./resource-dialog.js";
12
- import { translations as H } from "../libs/locales.js";
11
+ import O from "./resource-dialog.js";
12
+ import { translations as z } from "../libs/locales.js";
13
13
  function $({
14
14
  componentDid: a,
15
- resourceType: w,
16
- resourceDid: p,
15
+ resourceType: w = void 0,
16
+ resourceDid: p = void 0,
17
17
  grantedRoles: L = ["admin", "owner"],
18
18
  autoClose: R = !0,
19
- selectedMeta: D,
20
- storeUrl: E,
19
+ selectedMeta: D = void 0,
20
+ storeUrl: E = void 0,
21
21
  onComplete: n,
22
22
  onClose: t,
23
- render: m
23
+ render: d = void 0
24
24
  }) {
25
- const { session: d } = F(O), { locale: x } = P(), i = r((o, s = {}) => _(H, o, x, "en", s)), l = I(null), e = U({
25
+ const { session: m } = C(M), { locale: x } = j(), i = r((o, s = {}) => U(z, o, x, "en", s)), l = F(null), e = T({
26
26
  loading: !1,
27
27
  showDialog: !1
28
- }), b = A(M(T, "embed/resources", a, "add"), {
28
+ }), b = _(A(P, "embed/resources", a, "add"), {
29
29
  resourceDid: p,
30
30
  resourceType: w,
31
31
  mode: "dialog",
@@ -33,33 +33,33 @@ function $({
33
33
  showResourcesSwitch: "false",
34
34
  enableRunBackground: "false",
35
35
  showCategory: "false"
36
- }), k = r(() => {
36
+ }), v = r(() => {
37
37
  e.showDialog = !1, t == null || t();
38
38
  }), c = r(() => {
39
39
  e.showDialog = !1, n == null || n();
40
40
  }), f = r(() => {
41
41
  var o;
42
- if (!d.user) {
42
+ if (!m.user) {
43
43
  h.warning(i("needLogin"));
44
44
  return;
45
45
  }
46
- if (!L.includes((o = d.user) == null ? void 0 : o.role)) {
46
+ if (!L.includes((o = m.user) == null ? void 0 : o.role)) {
47
47
  h.warning(i("noPermission"));
48
48
  return;
49
49
  }
50
50
  e.loading = !0, e.showDialog = !0;
51
- }), y = r(() => {
51
+ }), k = r(() => {
52
52
  var o;
53
53
  e.loading = !1, l.current && ((o = l.current) == null || o.selectBlocklet(D));
54
54
  }), u = r((o) => {
55
55
  var s;
56
56
  ((s = o == null ? void 0 : o.data) == null ? void 0 : s.event) === "component.installed" && o.data.componentDid === a && (R || o.data.manual) && c();
57
57
  });
58
- return S(() => {
58
+ return I(() => {
59
59
  e.showDialog ? window.addEventListener("message", u) : window.removeEventListener("message", u);
60
- }, [e.showDialog]), /* @__PURE__ */ B(C, { children: [
61
- m ? m({ onClick: f, loading: e.loading }) : /* @__PURE__ */ g(
62
- j,
60
+ }, [e.showDialog]), /* @__PURE__ */ y(B, { children: [
61
+ d ? d({ onClick: f, loading: e.loading }) : /* @__PURE__ */ g(
62
+ S,
63
63
  {
64
64
  variant: "outlined",
65
65
  color: "secondary",
@@ -73,7 +73,7 @@ function $({
73
73
  "button"
74
74
  ),
75
75
  e.showDialog && /* @__PURE__ */ g(
76
- z,
76
+ O,
77
77
  {
78
78
  ref: l,
79
79
  src: b,
@@ -81,9 +81,9 @@ function $({
81
81
  open: !0,
82
82
  componentDid: a,
83
83
  loading: e.loading,
84
- onClose: k,
84
+ onClose: v,
85
85
  onComplete: c,
86
- onLoad: y
86
+ onLoad: k
87
87
  }
88
88
  )
89
89
  ] });
@@ -1,2 +1,2 @@
1
- import { default as r } from '../../ComponentInstaller/index.js';
2
- export { r as default };
1
+ import { default as CheckComponent } from '../../ComponentInstaller';
2
+ export default CheckComponent;