@blocklet/ui-react 3.1.48 → 3.1.50
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/.aigne/doc-smith/config.yaml +76 -0
- package/.aigne/doc-smith/history.yaml +9 -0
- package/.aigne/doc-smith/output/structure-plan.json +249 -0
- package/.aigne/doc-smith/upload-cache.yaml +528 -0
- package/docs/_sidebar.md +19 -0
- package/docs/components-component-management-blocklet-studio.ja.md +194 -0
- package/docs/components-component-management-blocklet-studio.md +194 -0
- package/docs/components-component-management-blocklet-studio.zh-TW.md +194 -0
- package/docs/components-component-management-blocklet-studio.zh.md +194 -0
- package/docs/components-component-management-component-installer.ja.md +256 -0
- package/docs/components-component-management-component-installer.md +256 -0
- package/docs/components-component-management-component-installer.zh-TW.md +256 -0
- package/docs/components-component-management-component-installer.zh.md +256 -0
- package/docs/components-component-management.ja.md +59 -0
- package/docs/components-component-management.md +59 -0
- package/docs/components-component-management.zh-TW.md +59 -0
- package/docs/components-component-management.zh.md +59 -0
- package/docs/components-layout-dashboard.ja.md +231 -0
- package/docs/components-layout-dashboard.md +231 -0
- package/docs/components-layout-dashboard.zh-TW.md +231 -0
- package/docs/components-layout-dashboard.zh.md +231 -0
- package/docs/components-layout-footer.ja.md +165 -0
- package/docs/components-layout-footer.md +165 -0
- package/docs/components-layout-footer.zh-TW.md +165 -0
- package/docs/components-layout-footer.zh.md +165 -0
- package/docs/components-layout-header.ja.md +233 -0
- package/docs/components-layout-header.md +233 -0
- package/docs/components-layout-header.zh-TW.md +233 -0
- package/docs/components-layout-header.zh.md +233 -0
- package/docs/components-layout.ja.md +50 -0
- package/docs/components-layout.md +50 -0
- package/docs/components-layout.zh-TW.md +50 -0
- package/docs/components-layout.zh.md +50 -0
- package/docs/components-notifications.ja.md +173 -0
- package/docs/components-notifications.md +173 -0
- package/docs/components-notifications.zh-TW.md +174 -0
- package/docs/components-notifications.zh.md +173 -0
- package/docs/components-user-management-user-center.ja.md +183 -0
- package/docs/components-user-management-user-center.md +183 -0
- package/docs/components-user-management-user-center.zh-TW.md +183 -0
- package/docs/components-user-management-user-center.zh.md +183 -0
- package/docs/components-user-management-user-sessions.ja.md +164 -0
- package/docs/components-user-management-user-sessions.md +164 -0
- package/docs/components-user-management-user-sessions.zh-TW.md +164 -0
- package/docs/components-user-management-user-sessions.zh.md +164 -0
- package/docs/components-user-management.ja.md +76 -0
- package/docs/components-user-management.md +76 -0
- package/docs/components-user-management.zh-TW.md +76 -0
- package/docs/components-user-management.zh.md +76 -0
- package/docs/components-utilities-icon.ja.md +106 -0
- package/docs/components-utilities-icon.md +106 -0
- package/docs/components-utilities-icon.zh-TW.md +106 -0
- package/docs/components-utilities-icon.zh.md +106 -0
- package/docs/components-utilities.ja.md +136 -0
- package/docs/components-utilities.md +136 -0
- package/docs/components-utilities.zh-TW.md +136 -0
- package/docs/components-utilities.zh.md +136 -0
- package/docs/components.ja.md +27 -0
- package/docs/components.md +27 -0
- package/docs/components.zh-TW.md +27 -0
- package/docs/components.zh.md +27 -0
- package/docs/core-concepts.ja.md +164 -0
- package/docs/core-concepts.md +164 -0
- package/docs/core-concepts.zh-TW.md +164 -0
- package/docs/core-concepts.zh.md +164 -0
- package/docs/getting-started.ja.md +132 -0
- package/docs/getting-started.md +132 -0
- package/docs/getting-started.zh-TW.md +132 -0
- package/docs/getting-started.zh.md +132 -0
- package/docs/hooks-api.ja.md +214 -0
- package/docs/hooks-api.md +214 -0
- package/docs/hooks-api.zh-TW.md +214 -0
- package/docs/hooks-api.zh.md +214 -0
- package/docs/how-to-guides.ja.md +413 -0
- package/docs/how-to-guides.md +413 -0
- package/docs/how-to-guides.zh-TW.md +413 -0
- package/docs/how-to-guides.zh.md +413 -0
- package/docs/overview.ja.md +91 -0
- package/docs/overview.md +91 -0
- package/docs/overview.zh-TW.md +91 -0
- package/docs/overview.zh.md +91 -0
- package/glossary.md +12 -0
- package/lib/Dashboard/index.js +46 -42
- package/lib/Footer/index.js +51 -36
- package/lib/Header/index.js +48 -44
- package/lib/UserCenter/components/settings.js +1 -0
- package/lib/UserCenter/components/user-center.js +133 -133
- package/lib/blocklets.d.ts +13 -2
- package/lib/blocklets.js +40 -40
- package/lib/common/header-addons.js +37 -33
- package/package.json +7 -7
- package/src/Dashboard/index.jsx +8 -3
- package/src/Footer/index.jsx +22 -4
- package/src/Header/index.tsx +7 -2
- package/src/UserCenter/components/settings.tsx +1 -0
- package/src/UserCenter/components/user-center.tsx +6 -6
- package/src/blocklets.js +18 -9
- package/src/common/header-addons.jsx +7 -2
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
# ComponentInstaller
|
|
2
|
+
|
|
3
|
+
`ComponentInstaller` 是一个实用工具组件,为依赖其他 blocklet 的功能充当网关。它会验证指定的组件依赖项是否已安装。如果未安装,它会为管理员(默认为 `owner` 或 `admin` 角色)提供一个用户友好的界面,以便直接进行安装。如果用户缺少必要的权限,它会显示一条消息,建议他们联系管理员。
|
|
4
|
+
|
|
5
|
+
该组件对于创建能够优雅处理可选依赖项缺失的稳健应用程序至关重要,通过引导管理员完成安装过程来改善用户体验。
|
|
6
|
+
|
|
7
|
+
## 工作原理
|
|
8
|
+
|
|
9
|
+
该组件的逻辑遵循一个清晰的顺序流程,以确保在渲染其子组件之前满足依赖关系。
|
|
10
|
+
|
|
11
|
+
```d2
|
|
12
|
+
direction: down
|
|
13
|
+
|
|
14
|
+
start: {
|
|
15
|
+
label: "开始"
|
|
16
|
+
shape: oval
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
check_dependencies: {
|
|
20
|
+
label: "检查在 'did' prop 中定义的依赖项"
|
|
21
|
+
shape: rectangle
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
is_installed: {
|
|
25
|
+
label: "所有依赖项都已安装吗?"
|
|
26
|
+
shape: diamond
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
render_children: {
|
|
30
|
+
label: "渲染子组件"
|
|
31
|
+
shape: rectangle
|
|
32
|
+
style.fill: "#d4edda"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
check_permission: {
|
|
36
|
+
label: "根据 'roles' prop 检查用户角色"
|
|
37
|
+
shape: rectangle
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
has_permission: {
|
|
41
|
+
label: "用户有权限吗?"
|
|
42
|
+
shape: diamond
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
display_installer: {
|
|
46
|
+
label: "显示安装器界面"
|
|
47
|
+
shape: rectangle
|
|
48
|
+
style.fill: "#cce5ff"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
is_mute: {
|
|
52
|
+
label: "'noPermissionMute' prop 是否为 true?"
|
|
53
|
+
shape: diamond
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
display_suggestion: {
|
|
57
|
+
label: "显示“联系管理员”建议"
|
|
58
|
+
shape: rectangle
|
|
59
|
+
style.fill: "#f8d7da"
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
render_fallback: {
|
|
63
|
+
label: "渲染回退组件或 null"
|
|
64
|
+
shape: rectangle
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
end: {
|
|
68
|
+
label: "结束"
|
|
69
|
+
shape: oval
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
start -> check_dependencies
|
|
73
|
+
check_dependencies -> is_installed
|
|
74
|
+
is_installed -> render_children: "是"
|
|
75
|
+
is_installed -> check_permission: "否"
|
|
76
|
+
render_children -> end
|
|
77
|
+
|
|
78
|
+
check_permission -> has_permission
|
|
79
|
+
has_permission -> display_installer: "是"
|
|
80
|
+
has_permission -> is_mute: "否"
|
|
81
|
+
display_installer -> end
|
|
82
|
+
|
|
83
|
+
is_mute -> render_fallback: "是"
|
|
84
|
+
is_mute -> display_suggestion: "否"
|
|
85
|
+
render_fallback -> end
|
|
86
|
+
display_suggestion -> end
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
1. **依赖检查**:它读取 `did` prop,并与 blocklet 的元数据(`window.blocklet.optionalComponents`)进行核对,以确定所需的组件是否已安装。
|
|
90
|
+
2. **权限检查**:如果缺少任何组件,它会使用 `SessionPermission` 组件来验证当前用户的角色是否与 `roles` prop 中指定的角色匹配。
|
|
91
|
+
3. **条件渲染**:
|
|
92
|
+
* 如果所有依赖项都已安装,它将渲染其 `children`。
|
|
93
|
+
* 如果依赖项缺失且用户拥有权限,它将显示一个弹出式安装面板。
|
|
94
|
+
* 如果依赖项缺失且用户缺乏权限,它将显示联系管理员的建议,或者如果启用了 `noPermissionMute`,则渲染一个 `fallback` 组件。
|
|
95
|
+
|
|
96
|
+
## 基本用法
|
|
97
|
+
|
|
98
|
+
使用 `ComponentInstaller` 包裹任何依赖于可选 blocklet 的组件或功能。提供所需组件的 DID。
|
|
99
|
+
|
|
100
|
+
```jsx "MyFeature.jsx" icon=logos:react
|
|
101
|
+
import ComponentInstaller from '@arcblock/blocklet-ui-react/lib/ComponentInstaller';
|
|
102
|
+
import MyDependentComponent from './MyDependentComponent';
|
|
103
|
+
|
|
104
|
+
export default function MyFeature() {
|
|
105
|
+
// 替换为所需组件的实际 DID
|
|
106
|
+
const requiredComponentDid = 'z8ia2427634f1e909a304e2b963715a18';
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<ComponentInstaller did={requiredComponentDid}>
|
|
110
|
+
{/* 只有在满足依赖关系时,此组件才会被渲染 */}
|
|
111
|
+
<MyDependentComponent />
|
|
112
|
+
</ComponentInstaller>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Props
|
|
118
|
+
|
|
119
|
+
`ComponentInstaller` 接受以下 props 来自定义其行为。
|
|
120
|
+
|
|
121
|
+
<x-field-group>
|
|
122
|
+
<x-field data-name="did" data-type="string | string[]" data-required="true">
|
|
123
|
+
<x-field-desc markdown>要检查的组件依赖项的 DID(或 DID 数组)。这是您需要的 blocklet 的主要标识符。</x-field-desc>
|
|
124
|
+
</x-field>
|
|
125
|
+
<x-field data-name="children" data-type="any" data-required="true">
|
|
126
|
+
<x-field-desc markdown>确认所有依赖项都已安装后要渲染的内容。可以是标准的 React 节点或渲染函数。</x-field-desc>
|
|
127
|
+
</x-field>
|
|
128
|
+
<x-field data-name="roles" data-type="string[]" data-default='["owner", "admin"]'>
|
|
129
|
+
<x-field-desc markdown>允许查看安装界面并安装缺失组件的用户角色数组。</x-field-desc>
|
|
130
|
+
</x-field>
|
|
131
|
+
<x-field data-name="fallback" data-type="React.ReactNode" data-required="false">
|
|
132
|
+
<x-field-desc markdown>一个回退组件,用于在检查依赖项时或当 `noPermissionMute` 对没有安装权限的用户激活时显示。</x-field-desc>
|
|
133
|
+
</x-field>
|
|
134
|
+
<x-field data-name="noPermissionMute" data-type="boolean" data-default="false">
|
|
135
|
+
<x-field-desc markdown>如果为 `true`,没有权限的用户将看到 `fallback` 组件(或什么也不显示),而不是“联系管理员”的消息。</x-field-desc>
|
|
136
|
+
</x-field>
|
|
137
|
+
<x-field data-name="disabled" data-type="boolean" data-default="false">
|
|
138
|
+
<x-field-desc markdown>如果为 `true`,该组件将绕过所有检查并立即渲染其 `children`。</x-field-desc>
|
|
139
|
+
</x-field>
|
|
140
|
+
<x-field data-name="onInstalled" data-type="function" data-required="false">
|
|
141
|
+
<x-field-desc markdown>依赖项检查完成后触发的回调函数。它接收已安装组件的列表。</x-field-desc>
|
|
142
|
+
</x-field>
|
|
143
|
+
<x-field data-name="onError" data-type="function" data-required="false">
|
|
144
|
+
<x-field-desc markdown>如果在依赖项检查期间发生错误,则触发的回调函数。它接收导致错误的组件列表。</x-field-desc>
|
|
145
|
+
</x-field>
|
|
146
|
+
<x-field data-name="onClose" data-type="function" data-required="false">
|
|
147
|
+
<x-field-desc markdown>当安装弹出窗口关闭时调用的回调函数。</x-field-desc>
|
|
148
|
+
</x-field>
|
|
149
|
+
<x-field data-name="closeByOutSize" data-type="boolean" data-default="false">
|
|
150
|
+
<x-field-desc markdown>如果为 `true`,当用户点击安装弹出窗口外部时,该窗口将关闭。</x-field-desc>
|
|
151
|
+
</x-field>
|
|
152
|
+
<x-field data-name="warnIcon" data-type="React.ReactNode" data-required="false">
|
|
153
|
+
<x-field-desc markdown>一个自定义的 React 节点,用于替换安装弹出窗口中的默认警告图标。</x-field-desc>
|
|
154
|
+
</x-field>
|
|
155
|
+
</x-field-group>
|
|
156
|
+
|
|
157
|
+
## 高级用法
|
|
158
|
+
|
|
159
|
+
### 检查多个组件
|
|
160
|
+
|
|
161
|
+
您可以向 `did` prop 传递一个 DID 数组,以一次性检查多个依赖项。只有在所有指定的组件都已安装的情况下,子组件才会渲染。
|
|
162
|
+
|
|
163
|
+
```jsx "MyDashboard.jsx" icon=logos:react
|
|
164
|
+
import ComponentInstaller from '@arcblock/blocklet-ui-react/lib/ComponentInstaller';
|
|
165
|
+
import AnalyticsWidget from './AnalyticsWidget';
|
|
166
|
+
import CmsWidget from './CmsWidget';
|
|
167
|
+
|
|
168
|
+
export default function MyDashboard() {
|
|
169
|
+
const requiredDids = [
|
|
170
|
+
'z8ia2427634f1e909a304e2b963715a18', // Analytics Service
|
|
171
|
+
'z8ia3c1f2e4b8e6a1b2c3d4e5f6a7b8c9', // CMS Service
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
return (
|
|
175
|
+
<ComponentInstaller did={requiredDids}>
|
|
176
|
+
<AnalyticsWidget />
|
|
177
|
+
<CmsWidget />
|
|
178
|
+
</ComponentInstaller>
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### 为加载状态使用回退组件
|
|
184
|
+
|
|
185
|
+
提供一个 `fallback` 组件,以在依赖项检查进行中时改善用户体验。这对于与 `noPermissionMute` 一起使用,为未经授权的用户显示占位符也很有用。
|
|
186
|
+
|
|
187
|
+
```jsx "FeatureWithLoading.jsx" icon=logos:react
|
|
188
|
+
import ComponentInstaller from '@arcblock/blocklet-ui-react/lib/ComponentInstaller';
|
|
189
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
190
|
+
import Box from '@mui/material/Box';
|
|
191
|
+
import MyDependentComponent from './MyDependentComponent';
|
|
192
|
+
|
|
193
|
+
export default function FeatureWithLoading() {
|
|
194
|
+
const LoadingSpinner = (
|
|
195
|
+
<Box sx={{ display: 'flex', justifyContent: 'center', p: 4 }}>
|
|
196
|
+
<CircularProgress />
|
|
197
|
+
</Box>
|
|
198
|
+
);
|
|
199
|
+
|
|
200
|
+
return (
|
|
201
|
+
<ComponentInstaller
|
|
202
|
+
did="z8ia2427634f1e909a304e2b963715a18"
|
|
203
|
+
fallback={LoadingSpinner}
|
|
204
|
+
noPermissionMute={true}
|
|
205
|
+
>
|
|
206
|
+
<MyDependentComponent />
|
|
207
|
+
</ComponentInstaller>
|
|
208
|
+
);
|
|
209
|
+
}
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### 使用渲染 Props 自定义 UI
|
|
213
|
+
|
|
214
|
+
为了完全控制 UI,您可以将一个函数作为 `children` 传递。该函数接收一个包含 `hasPermission`、`optComponents` 和 `installStatus` 的对象,允许您构建一个完全自定义的安装界面。
|
|
215
|
+
|
|
216
|
+
```jsx "CustomInstallerButton.jsx" icon=logos:react
|
|
217
|
+
import ComponentInstaller from '@arcblock/blocklet-ui-react/lib/ComponentInstaller';
|
|
218
|
+
import Button from '@mui/material/Button';
|
|
219
|
+
|
|
220
|
+
export default function CustomInstallerButton() {
|
|
221
|
+
const requiredDid = 'z8ia2427634f1e909a304e2b963715a18';
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
<ComponentInstaller did={requiredDid}>
|
|
225
|
+
{({ hasPermission, optComponents, installStatus }) => {
|
|
226
|
+
const isMissing = optComponents.length > 0;
|
|
227
|
+
const status = installStatus[requiredDid] || 'not_installed';
|
|
228
|
+
|
|
229
|
+
if (!isMissing) {
|
|
230
|
+
return <p>功能已准备就绪!</p>;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (!hasPermission) {
|
|
234
|
+
return <p>请请求管理员安装所需组件。</p>;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
return (
|
|
238
|
+
<Button
|
|
239
|
+
variant="contained"
|
|
240
|
+
disabled={status !== 'not_installed'}
|
|
241
|
+
onClick={() => window.open(optComponents[0].installUrl, '_blank')}
|
|
242
|
+
>
|
|
243
|
+
{status === 'not_installed' ? `安装 ${optComponents[0].meta.title}` : `正在安装... (${status})`}
|
|
244
|
+
</Button>
|
|
245
|
+
);
|
|
246
|
+
}}
|
|
247
|
+
</ComponentInstaller>
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
## 总结
|
|
253
|
+
|
|
254
|
+
`ComponentInstaller` 是一个功能强大的组件,用于管理 blocklet 应用程序中的可选依赖项。它提供了一种结构化且用户友好的方式,以确保所需组件可用,并在必要时引导管理员完成安装过程。通过使用此组件,您可以构建更具弹性和功能丰富的应用程序,以适应用户的环境。
|
|
255
|
+
|
|
256
|
+
有关管理组件的更多详细信息,您可能还对 [BlockletStudio](./components-component-management-blocklet-studio.md) 组件感兴趣,它为资源和组件管理提供了更全面的界面。
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# コンポーネント管理
|
|
2
|
+
|
|
3
|
+
コンポーネント管理は、実行中のアプリケーション内でブロックレットコンポーネントを動的にインストール、公開、管理するための一連のツールを提供します。この機能により、アプリケーションはモジュール式で拡張可能になり、管理者や開発者はコアアプリケーションの完全な再デプロイを必要とせずに機能を追加または更新できます。
|
|
4
|
+
|
|
5
|
+
これらのツールは、機能をその場で構成・更新できる柔軟なシステムを構築するために不可欠です。例えば、アプリケーションが必要な依存関係をすべて実行時に持つことを保証したり、開発者が新しいリソースを公開するための統合インターフェースを提供したりすることができます。
|
|
6
|
+
|
|
7
|
+
このライフサイクルを管理するための主要なコンポーネントは `ComponentInstaller` と `BlockletStudio` です。
|
|
8
|
+
|
|
9
|
+
```d2
|
|
10
|
+
direction: down
|
|
11
|
+
|
|
12
|
+
Application: {
|
|
13
|
+
label: "メインアプリケーション"
|
|
14
|
+
shape: rectangle
|
|
15
|
+
style.fill: "#f0f7ff"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Blocklet-Components: {
|
|
19
|
+
label: "Blocklet コンポーネント"
|
|
20
|
+
shape: rectangle
|
|
21
|
+
style.fill: "#f6ffed"
|
|
22
|
+
style.stroke-dash: 2
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ComponentInstaller: {
|
|
26
|
+
label: "ComponentInstaller"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
style.fill: "#fff7e6"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
BlockletStudio: {
|
|
32
|
+
label: "BlockletStudio"
|
|
33
|
+
shape: rectangle
|
|
34
|
+
style.fill: "#fff1f0"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Application -> Blocklet-Components: "依存/使用"
|
|
38
|
+
ComponentInstaller -> Blocklet-Components: "インストール & 検証"
|
|
39
|
+
BlockletStudio -> Blocklet-Components: "公開 & 管理"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## コアツール
|
|
43
|
+
|
|
44
|
+
このセクションでは、利用可能なコンポーネント管理ツールの簡単な概要を説明します。詳細なドキュメントと使用例については、各サブページを参照してください。
|
|
45
|
+
|
|
46
|
+
<x-cards data-columns="2">
|
|
47
|
+
<x-card data-title="ComponentInstaller" data-icon="lucide:package-check" data-href="/components/component-management/component-installer">
|
|
48
|
+
必要なすべての依存コンポーネントがインストールされているかを確認し、管理者が不足しているコンポーネントをインストールするための、ロールで保護されたシンプルなインターフェースを提供するユーティリティコンポーネントです。
|
|
49
|
+
</x-card>
|
|
50
|
+
<x-card data-title="BlockletStudio" data-icon="lucide:box" data-href="/components/component-management/blocklet-studio">
|
|
51
|
+
アプリケーション内で直接、コンポーネントおよび関連リソースの公開、バージョン管理、管理を行うための包括的なスタジオを提供する、埋め込み可能な iframe ベースのインターフェースです。
|
|
52
|
+
</x-card>
|
|
53
|
+
</x-cards>
|
|
54
|
+
|
|
55
|
+
## 概要
|
|
56
|
+
|
|
57
|
+
`ComponentInstaller` と `BlockletStudio` を活用することで、開発者は保守と拡張が容易な堅牢なアプリケーションを構築できます。`ComponentInstaller` は依存関係を管理することでアプリケーションの健全性を保証し、`BlockletStudio` はコンテンツと機能の管理のための強力なインターフェースを提供します。
|
|
58
|
+
|
|
59
|
+
基本的な原則に関する詳細については、[コアコンセプト](./core-concepts.md) のドキュメントを参照してください。
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Component Management
|
|
2
|
+
|
|
3
|
+
Component management provides a suite of tools for dynamically installing, publishing, and managing blocklet components within a running application. This capability allows applications to be modular and extensible, enabling administrators and developers to add or update features without requiring a full redeployment of the core application.
|
|
4
|
+
|
|
5
|
+
These tools are essential for creating flexible systems where functionality can be composed and updated on the fly. For example, you can ensure that an application has all its necessary dependencies at runtime or provide an integrated interface for developers to publish new resources.
|
|
6
|
+
|
|
7
|
+
The primary components for managing this lifecycle are `ComponentInstaller` and `BlockletStudio`.
|
|
8
|
+
|
|
9
|
+
```d2
|
|
10
|
+
direction: down
|
|
11
|
+
|
|
12
|
+
Application: {
|
|
13
|
+
label: "Main Application"
|
|
14
|
+
shape: rectangle
|
|
15
|
+
style.fill: "#f0f7ff"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Blocklet-Components: {
|
|
19
|
+
label: "Blocklet Components"
|
|
20
|
+
shape: rectangle
|
|
21
|
+
style.fill: "#f6ffed"
|
|
22
|
+
style.stroke-dash: 2
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ComponentInstaller: {
|
|
26
|
+
label: "ComponentInstaller"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
style.fill: "#fff7e6"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
BlockletStudio: {
|
|
32
|
+
label: "BlockletStudio"
|
|
33
|
+
shape: rectangle
|
|
34
|
+
style.fill: "#fff1f0"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Application -> Blocklet-Components: "Depends on / Uses"
|
|
38
|
+
ComponentInstaller -> Blocklet-Components: "Installs & Verifies"
|
|
39
|
+
BlockletStudio -> Blocklet-Components: "Publishes & Manages"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Core Tools
|
|
43
|
+
|
|
44
|
+
This section provides a brief overview of the available component management tools. For detailed documentation and usage examples, please refer to the specific sub-pages.
|
|
45
|
+
|
|
46
|
+
<x-cards data-columns="2">
|
|
47
|
+
<x-card data-title="ComponentInstaller" data-icon="lucide:package-check" data-href="/components/component-management/component-installer">
|
|
48
|
+
A utility component that verifies if all required dependent components are installed and provides a simple, role-protected interface for administrators to install any missing ones.
|
|
49
|
+
</x-card>
|
|
50
|
+
<x-card data-title="BlockletStudio" data-icon="lucide:box" data-href="/components/component-management/blocklet-studio">
|
|
51
|
+
An embeddable iframe-based interface that provides a comprehensive studio for publishing, versioning, and managing components and their associated resources directly within your application.
|
|
52
|
+
</x-card>
|
|
53
|
+
</x-cards>
|
|
54
|
+
|
|
55
|
+
## Summary
|
|
56
|
+
|
|
57
|
+
By leveraging `ComponentInstaller` and `BlockletStudio`, developers can build robust applications that are easy to maintain and extend. `ComponentInstaller` ensures application health by managing dependencies, while `BlockletStudio` provides a powerful interface for content and feature management.
|
|
58
|
+
|
|
59
|
+
For more information on the underlying principles, see the [Core Concepts](./core-concepts.md) documentation.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 組件管理
|
|
2
|
+
|
|
3
|
+
組件管理提供了一套工具,用於在執行中的應用程式內動態安裝、發布和管理 blocklet 組件。此功能使應用程式得以模組化和擴充,讓管理員和開發人員能夠新增或更新功能,而無需對核心應用程式進行完整的重新部署。
|
|
4
|
+
|
|
5
|
+
這些工具對於創建功能可以即時組合和更新的靈活系統至關重要。例如,您可以確保應用程式在執行階段擁有所有必要的依賴項,或為開發人員提供一個整合式介面來發布新資源。
|
|
6
|
+
|
|
7
|
+
管理此生命週期的主要組件是 `ComponentInstaller` 和 `BlockletStudio`。
|
|
8
|
+
|
|
9
|
+
```d2
|
|
10
|
+
direction: down
|
|
11
|
+
|
|
12
|
+
Application: {
|
|
13
|
+
label: "主應用程式"
|
|
14
|
+
shape: rectangle
|
|
15
|
+
style.fill: "#f0f7ff"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Blocklet-Components: {
|
|
19
|
+
label: "Blocklet 組件"
|
|
20
|
+
shape: rectangle
|
|
21
|
+
style.fill: "#f6ffed"
|
|
22
|
+
style.stroke-dash: 2
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ComponentInstaller: {
|
|
26
|
+
label: "ComponentInstaller"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
style.fill: "#fff7e6"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
BlockletStudio: {
|
|
32
|
+
label: "BlockletStudio"
|
|
33
|
+
shape: rectangle
|
|
34
|
+
style.fill: "#fff1f0"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Application -> Blocklet-Components: "依賴 / 使用"
|
|
38
|
+
ComponentInstaller -> Blocklet-Components: "安裝與驗證"
|
|
39
|
+
BlockletStudio -> Blocklet-Components: "發布與管理"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 核心工具
|
|
43
|
+
|
|
44
|
+
本節簡要概述了可用的組件管理工具。有關詳細文件和使用範例,請參閱特定的子頁面。
|
|
45
|
+
|
|
46
|
+
<x-cards data-columns="2">
|
|
47
|
+
<x-card data-title="ComponentInstaller" data-icon="lucide:package-check" data-href="/components/component-management/component-installer">
|
|
48
|
+
一個實用組件,用於驗證是否已安裝所有必要的相依組件,並為管理員提供一個簡單、受角色保護的介面來安裝任何缺少的組件。
|
|
49
|
+
</x-card>
|
|
50
|
+
<x-card data-title="BlockletStudio" data-icon="lucide:box" data-href="/components/component-management/blocklet-studio">
|
|
51
|
+
一個可嵌入的、基於 iframe 的介面,提供一個全面的工作室,用於直接在您的應用程式內發布、版本控制和管理組件及其相關資源。
|
|
52
|
+
</x-card>
|
|
53
|
+
</x-cards>
|
|
54
|
+
|
|
55
|
+
## 總結
|
|
56
|
+
|
|
57
|
+
透過利用 `ComponentInstaller` 和 `BlockletStudio`,開發人員可以建立易於維護和擴展的穩健應用程式。`ComponentInstaller` 透過管理依賴項來確保應用程式的健康狀態,而 `BlockletStudio` 則為內容和功能管理提供強大的介面。
|
|
58
|
+
|
|
59
|
+
欲了解更多關於其基本原理的資訊,請參閱 [核心概念](./core-concepts.md) 文件。
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# 组件管理
|
|
2
|
+
|
|
3
|
+
组件管理提供了一套工具,用于在正在运行的应用程序中动态安装、发布和管理 blocklet 组件。此功能使应用程序能够模块化和可扩展,允许管理员和开发人员添加或更新功能,而无需对核心应用程序进行完全重新部署。
|
|
4
|
+
|
|
5
|
+
这些工具对于创建可以动态组合和更新功能的灵活系统至关重要。例如,您可以确保应用程序在运行时拥有所有必需的依赖项,或为开发人员提供一个集成的界面来发布新资源。
|
|
6
|
+
|
|
7
|
+
管理此生命周期的主要组件是 `ComponentInstaller` 和 `BlockletStudio`。
|
|
8
|
+
|
|
9
|
+
```d2
|
|
10
|
+
direction: down
|
|
11
|
+
|
|
12
|
+
Application: {
|
|
13
|
+
label: "主应用程序"
|
|
14
|
+
shape: rectangle
|
|
15
|
+
style.fill: "#f0f7ff"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
Blocklet-Components: {
|
|
19
|
+
label: "Blocklet 组件"
|
|
20
|
+
shape: rectangle
|
|
21
|
+
style.fill: "#f6ffed"
|
|
22
|
+
style.stroke-dash: 2
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
ComponentInstaller: {
|
|
26
|
+
label: "ComponentInstaller"
|
|
27
|
+
shape: rectangle
|
|
28
|
+
style.fill: "#fff7e6"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
BlockletStudio: {
|
|
32
|
+
label: "BlockletStudio"
|
|
33
|
+
shape: rectangle
|
|
34
|
+
style.fill: "#fff1f0"
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
Application -> Blocklet-Components: "依赖/使用"
|
|
38
|
+
ComponentInstaller -> Blocklet-Components: "安装与验证"
|
|
39
|
+
BlockletStudio -> Blocklet-Components: "发布与管理"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## 核心工具
|
|
43
|
+
|
|
44
|
+
本节简要概述了可用的组件管理工具。有关详细文档和使用示例,请参阅具体子页面。
|
|
45
|
+
|
|
46
|
+
<x-cards data-columns="2">
|
|
47
|
+
<x-card data-title="ComponentInstaller" data-icon="lucide:package-check" data-href="/components/component-management/component-installer">
|
|
48
|
+
一个实用程序组件,用于验证是否所有必需的依赖组件都已安装,并为管理员提供一个简单的、受角色保护的界面来安装任何缺失的组件。
|
|
49
|
+
</x-card>
|
|
50
|
+
<x-card data-title="BlockletStudio" data-icon="lucide:box" data-href="/components/component-management/blocklet-studio">
|
|
51
|
+
一个可嵌入的、基于 iframe 的界面,提供了一个全面的工作室,用于在您的应用程序内直接发布、版本化和管理组件及其相关资源。
|
|
52
|
+
</x-card>
|
|
53
|
+
</x-cards>
|
|
54
|
+
|
|
55
|
+
## 摘要
|
|
56
|
+
|
|
57
|
+
通过利用 `ComponentInstaller` 和 `BlockletStudio`,开发人员可以构建易于维护和扩展的健壮应用程序。`ComponentInstaller` 通过管理依赖关系来确保应用程序的健康,而 `BlockletStudio` 则为内容和功能管理提供了强大的界面。
|
|
58
|
+
|
|
59
|
+
有关基本原理的更多信息,请参阅 [核心概念](./core-concepts.md) 文档。
|