@abtnode/ux 1.16.14-beta-c308dc3b → 1.16.14-beta-963cb583

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 (213) hide show
  1. package/es/actions.js +97 -0
  2. package/es/analytics/card.js +92 -0
  3. package/es/analytics/chart.js +96 -0
  4. package/es/analytics/cpu.js +36 -0
  5. package/es/analytics/disk.js +111 -0
  6. package/es/analytics/memory.js +72 -0
  7. package/es/analytics/runtime.js +173 -0
  8. package/es/analytics/traffic.js +259 -0
  9. package/es/blocklet/access/config-access.js +307 -0
  10. package/es/blocklet/access/index.js +216 -0
  11. package/es/blocklet/actions.js +474 -0
  12. package/es/blocklet/add-cert.js +177 -0
  13. package/es/blocklet/agreement-app.js +21 -0
  14. package/es/blocklet/agreement.js +127 -0
  15. package/es/blocklet/app-avatar.js +57 -0
  16. package/es/blocklet/audit-logs.js +259 -0
  17. package/es/blocklet/blocklet-source.js +48 -0
  18. package/es/blocklet/bundle-avatar.js +64 -0
  19. package/es/blocklet/component/add.js +1313 -0
  20. package/es/blocklet/component/configuration.js +122 -0
  21. package/es/blocklet/component/delete.js +134 -0
  22. package/es/blocklet/component/environment.js +370 -0
  23. package/es/blocklet/component/index.js +975 -0
  24. package/es/blocklet/component/line.js +20 -0
  25. package/es/blocklet/component/navigation/locale-tabs.js +225 -0
  26. package/es/blocklet/component/navigation/navigation-actions.js +112 -0
  27. package/es/blocklet/component/navigation/navigation-dialog.js +607 -0
  28. package/es/blocklet/component/navigation/navigation-preview.js +101 -0
  29. package/es/blocklet/component/navigation/simple-select.js +124 -0
  30. package/es/blocklet/component/select-store.js +155 -0
  31. package/es/blocklet/component/selected/index.js +94 -0
  32. package/es/blocklet/component/setting.js +109 -0
  33. package/es/blocklet/component/sortable-tree.js +126 -0
  34. package/es/blocklet/component/space-connector.js +199 -0
  35. package/es/blocklet/component/space-selector.js +178 -0
  36. package/es/blocklet/component/start.js +101 -0
  37. package/es/blocklet/component/store-blocklet-list.js +200 -0
  38. package/es/blocklet/component/switch-control.js +57 -0
  39. package/es/blocklet/config-navigation.js +331 -0
  40. package/es/blocklet/configuration.js +603 -0
  41. package/es/blocklet/disk-info.js +75 -0
  42. package/es/blocklet/icons.js +18 -0
  43. package/es/blocklet/install-from-url.js +337 -0
  44. package/es/blocklet/log.js +90 -0
  45. package/es/blocklet/migration.js +149 -0
  46. package/es/blocklet/mode.js +19 -0
  47. package/es/blocklet/notification/email.js +257 -0
  48. package/es/blocklet/notification/index.js +49 -0
  49. package/es/blocklet/oauth/auth0.js +145 -0
  50. package/es/blocklet/oauth/common-settings.js +133 -0
  51. package/es/blocklet/oauth/federated-detail-dialog.js +175 -0
  52. package/es/blocklet/oauth/federated-invite-dialog.js +83 -0
  53. package/es/blocklet/oauth/federated-join-dialog.js +111 -0
  54. package/es/blocklet/oauth/federated-site-list.js +338 -0
  55. package/es/blocklet/oauth/federated.js +81 -0
  56. package/es/blocklet/oauth/index.js +69 -0
  57. package/es/blocklet/overview.js +293 -0
  58. package/es/blocklet/page-group.js +19 -0
  59. package/es/blocklet/preferences/app-sk.js +142 -0
  60. package/es/blocklet/preferences/index.js +305 -0
  61. package/es/blocklet/purchase/common.js +95 -0
  62. package/es/blocklet/purchase/component-purchase.js +237 -0
  63. package/es/blocklet/purchase/index.js +4 -0
  64. package/es/blocklet/router/action/add-domain-alias.js +167 -0
  65. package/es/blocklet/router/action/add-rule.js +211 -0
  66. package/es/blocklet/router/action/config-routing-rule.js +232 -0
  67. package/es/blocklet/router/action/delete-domain-alias.js +99 -0
  68. package/es/blocklet/router/action/delete-rule.js +108 -0
  69. package/es/blocklet/router/action/update-rule.js +209 -0
  70. package/es/blocklet/router/domain-actions.js +64 -0
  71. package/es/blocklet/router/domain-status.js +88 -0
  72. package/es/blocklet/router/rule-actions.js +66 -0
  73. package/es/blocklet/router/rule-list.js +190 -0
  74. package/es/blocklet/router/util.js +131 -0
  75. package/es/blocklet/runtime-info.js +68 -0
  76. package/es/blocklet/status.js +91 -0
  77. package/es/blocklet/storage/action.js +134 -0
  78. package/es/blocklet/storage/backups.js +241 -0
  79. package/es/blocklet/storage/connect-to.js +372 -0
  80. package/es/blocklet/storage/connected.js +198 -0
  81. package/es/blocklet/storage/delete.js +113 -0
  82. package/es/blocklet/storage/disconnect.js +243 -0
  83. package/es/blocklet/storage/index.js +19 -0
  84. package/es/blocklet/storage/item.js +558 -0
  85. package/es/blocklet/storage/preview-nft.js +286 -0
  86. package/es/blocklet/transfer-owner.js +198 -0
  87. package/es/blocklet/types.js +18 -0
  88. package/es/blocklet/util.js +145 -0
  89. package/es/blocklet/version.js +141 -0
  90. package/es/card-selector.js +134 -0
  91. package/es/certificate.js +105 -0
  92. package/es/chain.js +13 -0
  93. package/es/click-to-copy.js +22 -0
  94. package/es/confirm.js +149 -0
  95. package/es/contexts/audit-log.js +152 -0
  96. package/es/contexts/blocklet.js +10 -0
  97. package/es/contexts/deleting-blocklets.js +70 -0
  98. package/es/contexts/node.js +17 -0
  99. package/es/contexts/session.js +8 -0
  100. package/es/contexts/team.js +10 -0
  101. package/es/delete-confirm.js +121 -0
  102. package/es/did-address.js +46 -0
  103. package/es/dot.js +14 -0
  104. package/es/exchange-passport.js +102 -0
  105. package/es/form/form-select-input.js +184 -0
  106. package/es/form/form-text-input.js +178 -0
  107. package/es/form/form-wrapper.js +88 -0
  108. package/es/form/input-triggers.js +98 -0
  109. package/es/form/required.js +8 -0
  110. package/es/hooks/blocklet.js +229 -0
  111. package/es/hooks/confirm.js +90 -0
  112. package/es/hooks/mobile-width.js +11 -0
  113. package/es/hooks/url-evaluation.js +155 -0
  114. package/es/hooks/use-app-logo.js +16 -0
  115. package/es/hooks/use-backup-progress.js +31 -0
  116. package/es/hooks/use-blocklet-info-for-connect-did-spaces.js +50 -0
  117. package/es/hooks/use-bundle-logo.js +27 -0
  118. package/es/hooks/use-navigation.js +347 -0
  119. package/es/hooks/use-passport-id.js +14 -0
  120. package/es/hooks/use-subscription.js +22 -0
  121. package/es/icons/empty-space-nft.svg +59 -0
  122. package/es/icons/empty-spaces-nft.svg +58 -0
  123. package/es/icons/long-arrow.svg +5 -0
  124. package/es/icons/space-connected.svg +3 -0
  125. package/es/icons/space-disconnect.svg +3 -0
  126. package/es/index.js +3 -0
  127. package/es/invitation/invitation-app.js +58 -0
  128. package/es/invitation/invitation-login.js +68 -0
  129. package/es/invitation/invitation-passport.js +146 -0
  130. package/es/invitation/invitation-receive.js +138 -0
  131. package/es/invitation/invitation-success.js +93 -0
  132. package/es/invitation/invitation-user.js +90 -0
  133. package/es/invitation/invitation.js +90 -0
  134. package/es/issue-passport.js +142 -0
  135. package/es/launch-blocklet/content-layout.js +58 -0
  136. package/es/launch-blocklet/page-header.js +43 -0
  137. package/es/layout/addon.js +114 -0
  138. package/es/layout/feedback.js +55 -0
  139. package/es/locales/en.js +1541 -0
  140. package/es/locales/index.js +9 -0
  141. package/es/locales/zh.js +1544 -0
  142. package/es/logs/clock.js +11 -0
  143. package/es/logs/download.js +132 -0
  144. package/es/logs/log-terminal.js +253 -0
  145. package/es/lost-passport.js +452 -0
  146. package/es/nav-logo.js +219 -0
  147. package/es/passport-tag.js +43 -0
  148. package/es/permission.js +57 -0
  149. package/es/relative-time.js +53 -0
  150. package/es/result-message.js +11 -0
  151. package/es/schema-form/color-input.js +98 -0
  152. package/es/schema-form/common-prop-types.js +13 -0
  153. package/es/schema-form/index.js +215 -0
  154. package/es/schema-form/passport-input.js +55 -0
  155. package/es/schema-form/text-input.js +57 -0
  156. package/es/store/add.js +179 -0
  157. package/es/store/delete.js +96 -0
  158. package/es/store/item.js +76 -0
  159. package/es/subscription.js +144 -0
  160. package/es/table-icons.js +34 -0
  161. package/es/table.js +52 -0
  162. package/es/tag.js +21 -0
  163. package/es/team/members/actions.js +89 -0
  164. package/es/team/members/index.js +636 -0
  165. package/es/team/members/invitations.js +188 -0
  166. package/es/team/members/invite-member.js +208 -0
  167. package/es/team/members/issue-passport.js +152 -0
  168. package/es/team/members/member.js +408 -0
  169. package/es/team/members/passport-issuances.js +155 -0
  170. package/es/team/members/passports.js +364 -0
  171. package/es/team/members/toggle-user-approval.js +122 -0
  172. package/es/team/members/transfer-node.js +256 -0
  173. package/es/team/members/util.js +14 -0
  174. package/es/team/passports/color.js +127 -0
  175. package/es/team/passports/detail.js +312 -0
  176. package/es/team/passports/index.js +282 -0
  177. package/es/team/passports/mutate-role.js +198 -0
  178. package/es/team/passports/trusted-factories.js +221 -0
  179. package/es/team/passports/trusted-factory.js +343 -0
  180. package/es/team/passports/trusted-issuer.js +296 -0
  181. package/es/team/passports/trusted-issuers.js +226 -0
  182. package/es/team/search-input.js +46 -0
  183. package/es/team/styles/dialog.js +72 -0
  184. package/es/team/styles/list-header.js +31 -0
  185. package/es/util/api.js +6 -0
  186. package/es/util/constants.js +2 -0
  187. package/es/util/index.js +598 -0
  188. package/es/util/mode.js +4 -0
  189. package/es/util/space-gateway.js +51 -0
  190. package/es/util/spaces.js +160 -0
  191. package/es/who-can-access/config.js +38 -0
  192. package/es/wrap-locale.js +15 -0
  193. package/lib/blocklet/component/add.js +5 -0
  194. package/lib/blocklet/component/selected/index.js +47 -0
  195. package/lib/blocklet/component/space-connector.js +1 -1
  196. package/lib/blocklet/component/space-selector.js +1 -1
  197. package/lib/blocklet/storage/backups.js +1 -1
  198. package/lib/blocklet/storage/connect-to.js +6 -7
  199. package/lib/blocklet/storage/connected.js +1 -1
  200. package/lib/blocklet/storage/disconnect.js +1 -1
  201. package/lib/blocklet/storage/index.js +1 -1
  202. package/lib/blocklet/storage/item.js +1 -1
  203. package/lib/card-selector.js +14 -14
  204. package/lib/invitation/invitation-passport.js +7 -6
  205. package/lib/invitation/invitation-receive.js +1 -1
  206. package/lib/locales/en.js +12 -5
  207. package/lib/locales/zh.js +10 -3
  208. package/lib/lost-passport.js +2 -2
  209. package/lib/schema-form/passport-input.js +12 -11
  210. package/lib/team/passports/color.js +14 -14
  211. package/lib/team/passports/trusted-factory.js +1 -1
  212. package/lib/util/spaces.js +13 -1
  213. package/package.json +88 -21
@@ -0,0 +1,57 @@
1
+ import styled from '@emotion/styled';
2
+ import IOSSwitch from '@arcblock/ux/lib/Switch';
3
+
4
+ /**
5
+ * 该组件的对 UX 中 iOS 风格的 Switch 组件包装, 统一布局
6
+ * 具体参考: https://github.com/ArcBlock/blocklet-server/issues/4809
7
+ *
8
+ * - label 在左, 切换器在右
9
+ * - 整体宽度控制, 宽屏下 max-width 为 300px 避免 label 与 switch 相隔太远, 窄屏下 100% 宽度
10
+ */
11
+ /**
12
+ * @description
13
+ * @param {{
14
+ * labelProps: object,
15
+ * className: string;
16
+ * style: import('react').CSSProperties
17
+ * } & import('@mui/material').SwitchProps} { labelProps, className, style, ...rest }
18
+ * @return {*}
19
+ */
20
+ import { jsx as _jsx } from "react/jsx-runtime";
21
+ function SwitchControl({
22
+ labelProps,
23
+ className,
24
+ style,
25
+ ...rest
26
+ }) {
27
+ const _labelProps = {
28
+ ...labelProps,
29
+ labelPlacement: labelProps?.labelPlacement || 'start'
30
+ };
31
+ return /*#__PURE__*/_jsx(Root, {
32
+ className: className,
33
+ style: style,
34
+ children: /*#__PURE__*/_jsx(IOSSwitch, {
35
+ labelProps: _labelProps,
36
+ ...rest
37
+ })
38
+ });
39
+ }
40
+ SwitchControl.propTypes = IOSSwitch.propTypes;
41
+ SwitchControl.defaultProps = IOSSwitch.defaultProps;
42
+ const Root = styled.div`
43
+ max-width: 300px;
44
+ > label {
45
+ display: flex;
46
+ justify-content: space-between;
47
+ width: 100%;
48
+ margin-left: 0;
49
+ margin-right: 0;
50
+ }
51
+ ${({
52
+ theme
53
+ }) => theme.breakpoints.down('sm')} {
54
+ max-width: 100%;
55
+ }
56
+ `;
57
+ export default SwitchControl;
@@ -0,0 +1,331 @@
1
+ import { useCallback, useMemo, useRef } from 'react';
2
+ import Box from '@mui/material/Box';
3
+ import Button from '@mui/material/Button';
4
+ import ButtonGroup from '@mui/material/ButtonGroup';
5
+ import FormControl from '@mui/material/FormControl';
6
+ import InputLabel from '@mui/material/InputLabel';
7
+ import MenuItem from '@mui/material/MenuItem';
8
+ import Paper from '@mui/material/Paper';
9
+ import Select from '@mui/material/Select';
10
+ import Toolbar from '@mui/material/Toolbar';
11
+ import Typography from '@mui/material/Typography';
12
+ import LoadingButton from '@mui/lab/LoadingButton';
13
+ import Toast from '@arcblock/ux/lib/Toast';
14
+ import { Icon } from '@iconify/react';
15
+ import { useReactive } from 'ahooks';
16
+ import { Confirm } from '@arcblock/ux/lib/Dialog';
17
+ import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
18
+ import { SessionContext } from '@arcblock/did-connect/lib/Session';
19
+ import noop from 'lodash/noop';
20
+ import SortableTree from './component/sortable-tree';
21
+ import NavigationDialog from './component/navigation/navigation-dialog';
22
+ import NavigationActions from './component/navigation/navigation-actions';
23
+ import useNavigation from '../hooks/use-navigation';
24
+ import { useBlockletContext } from '../contexts/blocklet';
25
+ import NavigationPreview from './component/navigation/navigation-preview';
26
+ import { useTeamContext } from '../contexts/team';
27
+ import { formatError } from '../util';
28
+
29
+ // FIXME: @zhanghan 这里还有几处文案没有 i18n
30
+ import { jsx as _jsx } from "react/jsx-runtime";
31
+ import { jsxs as _jsxs } from "react/jsx-runtime";
32
+ import { Fragment as _Fragment } from "react/jsx-runtime";
33
+ const mockSession = {
34
+ login: noop,
35
+ logout: noop,
36
+ switch: noop,
37
+ switchDid: noop,
38
+ switchProfile: noop,
39
+ switchPassport: noop,
40
+ useDid: () => {
41
+ return {
42
+ walletDid: 'abcdefghijklmnopqrstuvwxyz'
43
+ };
44
+ },
45
+ useOAuth: () => {
46
+ return {
47
+ logoutOAuth: noop,
48
+ bindOAuth: noop,
49
+ configs: {},
50
+ switchOAuthPassport: noop
51
+ };
52
+ }
53
+ };
54
+ const navigationTypeMap = {
55
+ header: 'Header',
56
+ footer: 'Footer',
57
+ bottom: 'Footer Link',
58
+ social: 'Footer Social',
59
+ dashboard: 'Dashboard',
60
+ sessionManager: 'SessionManager'
61
+ };
62
+ function ConfigNavigation() {
63
+ const {
64
+ t
65
+ } = useLocaleContext();
66
+ const {
67
+ blocklet
68
+ } = useBlockletContext();
69
+ const refNavigationDialog = useRef(null);
70
+ const {
71
+ roles
72
+ } = useTeamContext();
73
+ const pageState = useReactive({
74
+ saveLoading: false,
75
+ resetLoading: false,
76
+ showResetConfirm: false,
77
+ mockRole: 'owner'
78
+ });
79
+ const {
80
+ state: navigationState,
81
+ navigation,
82
+ getNavigation,
83
+ saveNavigationList,
84
+ resetNavigation,
85
+ updateActiveSection,
86
+ updateNavigationTree,
87
+ updateNavigationItem,
88
+ delNavigationItem,
89
+ addNavigationItem
90
+ } = useNavigation();
91
+ const handleAddNavigation = useCallback(params => {
92
+ refNavigationDialog.current.add({
93
+ parent: params
94
+ }, (close, data) => {
95
+ addNavigationItem(data);
96
+ close();
97
+ });
98
+ }, [addNavigationItem]);
99
+ const handleEditNavigation = useCallback((type, params = {}) => {
100
+ switch (type) {
101
+ case 'edit':
102
+ refNavigationDialog.current.edit(params, (close, data) => {
103
+ updateNavigationItem(data);
104
+ close();
105
+ });
106
+ break;
107
+ case 'toggle':
108
+ updateNavigationItem({
109
+ id: params.id,
110
+ visible: !params.visible
111
+ });
112
+ break;
113
+ case 'del':
114
+ delNavigationItem(params.id);
115
+ break;
116
+ default:
117
+ }
118
+ }, [delNavigationItem, updateNavigationItem]);
119
+ const handleSaveNavigation = useCallback(async () => {
120
+ try {
121
+ pageState.saveLoading = true;
122
+ await saveNavigationList(navigationState.rawNavigation);
123
+ Toast.success(t('common.succeeded'));
124
+ } catch (e) {
125
+ Toast.error( /*#__PURE__*/_jsxs(Box, {
126
+ children: [/*#__PURE__*/_jsx(Typography, {
127
+ variant: "subtitle2",
128
+ children: t('navigation.actionFailed')
129
+ }), /*#__PURE__*/_jsx(Typography, {
130
+ variant: "body1",
131
+ children: formatError(e) || e.error
132
+ })]
133
+ }));
134
+ } finally {
135
+ pageState.saveLoading = false;
136
+ }
137
+ }, [navigationState.rawNavigation, pageState, saveNavigationList, t]);
138
+ const handleResetNavigation = useCallback(async () => {
139
+ try {
140
+ pageState.resetLoading = true;
141
+ await resetNavigation();
142
+ Toast.success('重置成功', {
143
+ variant: 'success'
144
+ });
145
+ } catch (e) {
146
+ Toast.error( /*#__PURE__*/_jsxs(Box, {
147
+ children: [/*#__PURE__*/_jsx(Typography, {
148
+ variant: "subtitle2",
149
+ children: t('navigation.actionFailed')
150
+ }), /*#__PURE__*/_jsx(Typography, {
151
+ variant: "body1",
152
+ children: formatError(e) || e.error
153
+ })]
154
+ }));
155
+ } finally {
156
+ pageState.resetLoading = false;
157
+ }
158
+ }, [pageState, resetNavigation, t]);
159
+ const sessionCtxValue = useMemo(() => {
160
+ return {
161
+ session: {
162
+ ...mockSession,
163
+ user: {
164
+ did: blocklet.appDid,
165
+ fullName: 'Preview User',
166
+ role: pageState.mockRole
167
+ }
168
+ }
169
+ };
170
+ }, [blocklet.appDid, pageState.mockRole]);
171
+ return /*#__PURE__*/_jsxs(_Fragment, {
172
+ children: [/*#__PURE__*/_jsx(ButtonGroup, {
173
+ variant: "outlined",
174
+ children: Object.keys(navigationTypeMap).map(key => {
175
+ return /*#__PURE__*/_jsxs(Button, {
176
+ variant: navigationState.activeSection === key ? 'contained' : undefined,
177
+ onClick: () => updateActiveSection(key),
178
+ children: [navigationTypeMap[key], ` (${getNavigation(key).length})`]
179
+ }, key);
180
+ })
181
+ }), /*#__PURE__*/_jsxs(Toolbar, {
182
+ variant: "dense",
183
+ sx: {
184
+ paddingLeft: '0px !important',
185
+ paddingRight: '0px !important',
186
+ mt: 2
187
+ },
188
+ children: [/*#__PURE__*/_jsx(Typography, {
189
+ variant: "h6",
190
+ component: "div",
191
+ sx: {
192
+ flexGrow: 1
193
+ },
194
+ children: "Config"
195
+ }), /*#__PURE__*/_jsx(ButtonGroup, {
196
+ variant: "outlined",
197
+ children: /*#__PURE__*/_jsx(LoadingButton, {
198
+ size: "small",
199
+ variant: "outlined",
200
+ color: "error",
201
+ startIcon: /*#__PURE__*/_jsx(Icon, {
202
+ icon: "system-uicons:reset"
203
+ }),
204
+ sx: {
205
+ mr: 2
206
+ },
207
+ loading: pageState.resetLoading,
208
+ loadingPosition: "start",
209
+ onClick: () => {
210
+ pageState.showResetConfirm = true;
211
+ },
212
+ children: "\u91CD\u7F6E"
213
+ })
214
+ }), /*#__PURE__*/_jsxs(ButtonGroup, {
215
+ variant: "outlined",
216
+ children: [/*#__PURE__*/_jsx(Button, {
217
+ size: "small",
218
+ variant: "outlined",
219
+ startIcon: /*#__PURE__*/_jsx(Icon, {
220
+ icon: "mdi:plus"
221
+ }),
222
+ onClick: () => handleAddNavigation(),
223
+ children: "\u65B0\u5EFA"
224
+ }), /*#__PURE__*/_jsx(LoadingButton, {
225
+ size: "small",
226
+ variant: "contained",
227
+ startIcon: /*#__PURE__*/_jsx(Icon, {
228
+ icon: "mdi:content-save"
229
+ }),
230
+ loading: pageState.saveLoading,
231
+ loadingPosition: "start",
232
+ onClick: handleSaveNavigation,
233
+ children: "\u4FDD\u5B58"
234
+ })]
235
+ })]
236
+ }), /*#__PURE__*/_jsx(Paper, {
237
+ variant: "outlined",
238
+ sx: {
239
+ display: 'flex',
240
+ height: 280,
241
+ overflow: 'hidden'
242
+ },
243
+ children: /*#__PURE__*/_jsx(Paper, {
244
+ elevation: 0,
245
+ sx: {
246
+ flex: 1,
247
+ overflow: 'auto'
248
+ },
249
+ children: /*#__PURE__*/_jsx(SortableTree, {
250
+ treeData: getNavigation(navigationState.activeSection),
251
+ setTreeData: updateNavigationTree,
252
+ renderActions: ({
253
+ data,
254
+ className
255
+ }) => {
256
+ return /*#__PURE__*/_jsx(NavigationActions, {
257
+ data: data,
258
+ className: className,
259
+ section: navigationState.activeSection,
260
+ add: (...args) => handleAddNavigation(...args),
261
+ del: (...args) => handleEditNavigation('del', ...args),
262
+ edit: (...args) => handleEditNavigation('edit', ...args),
263
+ toggle: (...args) => handleEditNavigation('toggle', ...args)
264
+ });
265
+ }
266
+ })
267
+ })
268
+ }), /*#__PURE__*/_jsxs(Toolbar, {
269
+ variant: "dense",
270
+ sx: {
271
+ paddingLeft: '0px !important',
272
+ paddingRight: '0px !important',
273
+ mt: 3
274
+ },
275
+ children: [/*#__PURE__*/_jsx(Typography, {
276
+ variant: "h6",
277
+ component: "div",
278
+ sx: {
279
+ flexGrow: 1
280
+ },
281
+ children: "Preview"
282
+ }), /*#__PURE__*/_jsxs(FormControl, {
283
+ sx: {
284
+ m: 1,
285
+ minWidth: 120
286
+ },
287
+ size: "small",
288
+ children: [/*#__PURE__*/_jsx(InputLabel, {
289
+ children: "Role"
290
+ }), /*#__PURE__*/_jsx(Select, {
291
+ value: pageState.mockRole,
292
+ label: "Role",
293
+ onChange: e => {
294
+ pageState.mockRole = e.target.value;
295
+ },
296
+ children: roles.map(item => /*#__PURE__*/_jsx(MenuItem, {
297
+ value: item.name,
298
+ children: item.title
299
+ }, item.name))
300
+ })]
301
+ })]
302
+ }), /*#__PURE__*/_jsx(Paper, {
303
+ variant: "outlined",
304
+ children: /*#__PURE__*/_jsx(SessionContext.Provider, {
305
+ value: sessionCtxValue,
306
+ children: /*#__PURE__*/_jsx(NavigationPreview, {
307
+ navigation: navigation
308
+ })
309
+ })
310
+ }), /*#__PURE__*/_jsx(NavigationDialog, {
311
+ ref: refNavigationDialog,
312
+ section: navigationState.activeSection,
313
+ components: navigationState.components,
314
+ rawNavigations: navigationState.rawNavigation
315
+ }), /*#__PURE__*/_jsx(Confirm, {
316
+ open: pageState.showResetConfirm,
317
+ title: "\u662F\u5426\u6E05\u7A7A\u6240\u6709\u81EA\u5B9A\u4E49\u5BFC\u822A",
318
+ onConfirm: async () => {
319
+ await handleResetNavigation();
320
+ pageState.showResetConfirm = false;
321
+ },
322
+ onCancel: () => {
323
+ pageState.showResetConfirm = false;
324
+ },
325
+ children: /*#__PURE__*/_jsx("p", {
326
+ children: "\u6E05\u7A7A\u540E\uFF0C\u5BFC\u822A\u4F1A\u6062\u590D\u5230 Blocklet \u539F\u6709\u9ED8\u8BA4\u7684\u914D\u7F6E"
327
+ })
328
+ })]
329
+ });
330
+ }
331
+ export default ConfigNavigation;