@blocklet/ui-react 3.2.18 → 3.3.0
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/.local/afs-storage.sqlite3 +0 -0
- package/.aigne/doc-smith/history.yaml +5 -0
- package/.aigne/doc-smith/media-description.yaml +11 -0
- package/docs/assets/diagram/component-installer-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh.jpg +0 -0
- package/docs/components-component-management-component-installer.ja.md +3 -77
- package/docs/components-component-management-component-installer.md +4 -78
- package/docs/components-component-management-component-installer.zh-TW.md +3 -77
- package/docs/components-component-management-component-installer.zh.md +3 -77
- package/docs/components-component-management.ja.md +3 -32
- package/docs/components-component-management.md +3 -32
- package/docs/components-component-management.zh-TW.md +3 -32
- package/docs/components-component-management.zh.md +3 -32
- package/docs/components-layout-dashboard.ja.md +3 -49
- package/docs/components-layout-dashboard.md +5 -49
- package/docs/components-layout-dashboard.zh-TW.md +3 -49
- package/docs/components-layout-dashboard.zh.md +3 -49
- package/docs/components-layout-header.ja.md +3 -53
- package/docs/components-layout-header.md +3 -53
- package/docs/components-layout-header.zh-TW.md +3 -53
- package/docs/components-layout-header.zh.md +3 -53
- package/docs/components-layout.ja.md +3 -22
- package/docs/components-layout.md +3 -22
- package/docs/components-layout.zh-TW.md +3 -22
- package/docs/components-layout.zh.md +3 -22
- package/docs/components-notifications.ja.md +3 -51
- package/docs/components-notifications.md +3 -51
- package/docs/components-notifications.zh-TW.md +3 -52
- package/docs/components-notifications.zh.md +3 -51
- package/docs/components-user-management-user-center.ja.md +3 -38
- package/docs/components-user-management-user-center.md +12 -48
- package/docs/components-user-management-user-center.zh-TW.md +3 -38
- package/docs/components-user-management-user-center.zh.md +3 -38
- package/docs/components-user-management-user-sessions.ja.md +3 -46
- package/docs/components-user-management-user-sessions.md +4 -45
- package/docs/components-user-management-user-sessions.zh-TW.md +3 -46
- package/docs/components-user-management-user-sessions.zh.md +3 -46
- package/docs/components-user-management.ja.md +3 -30
- package/docs/components-user-management.md +6 -31
- package/docs/components-user-management.zh-TW.md +3 -30
- package/docs/components-user-management.zh.md +3 -30
- package/docs/core-concepts.ja.md +3 -33
- package/docs/core-concepts.md +4 -33
- package/docs/core-concepts.zh-TW.md +3 -33
- package/docs/core-concepts.zh.md +3 -33
- package/docs/overview.ja.md +3 -43
- package/docs/overview.md +3 -43
- package/docs/overview.zh-TW.md +3 -43
- package/docs/overview.zh.md +3 -43
- package/lib/Dashboard/app-shell/app-header.js +47 -39
- package/lib/Dashboard/app-shell/app-info-context.d.ts +4 -0
- package/lib/Dashboard/app-shell/app-info-context.js +61 -47
- package/lib/Dashboard/index.d.ts +1 -1
- package/lib/Dashboard/index.js +1 -1
- package/package.json +10 -10
- package/src/Dashboard/app-shell/app-header.tsx +14 -1
- package/src/Dashboard/app-shell/app-info-context.tsx +44 -19
- package/src/Dashboard/index.jsx +1 -1
|
@@ -8,57 +8,9 @@ The core of the notification system is built around a WebSocket connection, enab
|
|
|
8
8
|
|
|
9
9
|
The notification system follows a straightforward, event-driven architecture. When a notable event occurs in the backend, a notification is generated and broadcasted through a WebSocket channel. The frontend client listens on this channel, receives the notification, and updates the UI accordingly.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
User: {
|
|
15
|
-
shape: c4-person
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Backend: {
|
|
19
|
-
label: "Blocklet Backend"
|
|
20
|
-
shape: rectangle
|
|
21
|
-
|
|
22
|
-
Event-Trigger: {
|
|
23
|
-
label: "Event Occurs"
|
|
24
|
-
shape: oval
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Notification-Service: {
|
|
28
|
-
label: "Notification Service"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
WebSocket-Server: {
|
|
33
|
-
label: "WebSocket Server"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Frontend: {
|
|
37
|
-
label: "Frontend Application"
|
|
38
|
-
shape: rectangle
|
|
39
|
-
|
|
40
|
-
WebSocket-Client: {
|
|
41
|
-
label: "WebSocket Client"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
NotificationAddon: {
|
|
45
|
-
label: "NotificationAddon"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
SnackbarProvider: {
|
|
49
|
-
label: "SnackbarProvider"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
# Defines the flow of the notification process
|
|
54
|
-
Backend.Event-Trigger -> Backend.Notification-Service: "1. Triggers notification"
|
|
55
|
-
Backend.Notification-Service -> WebSocket-Server: "2. Pushes message"
|
|
56
|
-
WebSocket-Server -> Frontend.WebSocket-Client: "3. Broadcasts to client"
|
|
57
|
-
Frontend.WebSocket-Client -> Frontend.NotificationAddon: "4. Forwards message"
|
|
58
|
-
Frontend.NotificationAddon -> Frontend.NotificationAddon: "5a. Updates unread count"
|
|
59
|
-
Frontend.NotificationAddon -> Frontend.SnackbarProvider: "5b. Shows toast notification"
|
|
60
|
-
Frontend.SnackbarProvider -> User: "6. Displays to user"
|
|
61
|
-
```
|
|
11
|
+
<!-- DIAGRAM_IMAGE_START:architecture:16:9:1765962229 -->
|
|
12
|
+

|
|
13
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
62
14
|
|
|
63
15
|
## Core Components
|
|
64
16
|
|
|
@@ -8,58 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
通知系統遵循一個直接的、事件驅動的架構。當後端發生值得注意的事件時,會產生一則通知並透過 WebSocket 通道廣播。前端用戶端會監聽此通道,接收通知,並相應地更新 UI。
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
User: {
|
|
15
|
-
label: "使用者"
|
|
16
|
-
shape: c4-person
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
Backend: {
|
|
20
|
-
label: "Blocklet 後端"
|
|
21
|
-
shape: rectangle
|
|
22
|
-
|
|
23
|
-
Event-Trigger: {
|
|
24
|
-
label: "事件發生"
|
|
25
|
-
shape: oval
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Notification-Service: {
|
|
29
|
-
label: "通知服務"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
WebSocket-Server: {
|
|
34
|
-
label: "WebSocket 伺服器"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
Frontend: {
|
|
38
|
-
label: "前端應用程式"
|
|
39
|
-
shape: rectangle
|
|
40
|
-
|
|
41
|
-
WebSocket-Client: {
|
|
42
|
-
label: "WebSocket 客戶端"
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
NotificationAddon: {
|
|
46
|
-
label: "NotificationAddon"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
SnackbarProvider: {
|
|
50
|
-
label: "SnackbarProvider"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
# 定義通知流程
|
|
55
|
-
Backend.Event-Trigger -> Backend.Notification-Service: "1. 觸發通知"
|
|
56
|
-
Backend.Notification-Service -> WebSocket-Server: "2. 推送訊息"
|
|
57
|
-
WebSocket-Server -> Frontend.WebSocket-Client: "3. 廣播至客戶端"
|
|
58
|
-
Frontend.WebSocket-Client -> Frontend.NotificationAddon: "4. 轉發訊息"
|
|
59
|
-
Frontend.NotificationAddon -> Frontend.NotificationAddon: "5a. 更新未讀計數"
|
|
60
|
-
Frontend.NotificationAddon -> Frontend.SnackbarProvider: "5b. 顯示快顯通知"
|
|
61
|
-
Frontend.SnackbarProvider -> User: "6. 向使用者顯示"
|
|
62
|
-
```
|
|
11
|
+
<!-- DIAGRAM_IMAGE_START:architecture:16:9:1765962229 -->
|
|
12
|
+

|
|
13
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
63
14
|
|
|
64
15
|
## 核心元件
|
|
65
16
|
|
|
@@ -8,57 +8,9 @@
|
|
|
8
8
|
|
|
9
9
|
通知系统遵循一个简单、事件驱动的架构。当后端发生值得注意的事件时,会生成一个通知并通过 WebSocket 通道广播。前端客户端监听此通道,接收通知,并相应地更新 UI。
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
User: {
|
|
15
|
-
shape: c4-person
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
Backend: {
|
|
19
|
-
label: "Blocklet 后端"
|
|
20
|
-
shape: rectangle
|
|
21
|
-
|
|
22
|
-
Event-Trigger: {
|
|
23
|
-
label: "事件发生"
|
|
24
|
-
shape: oval
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Notification-Service: {
|
|
28
|
-
label: "通知服务"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
WebSocket-Server: {
|
|
33
|
-
label: "WebSocket 服务器"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Frontend: {
|
|
37
|
-
label: "前端应用"
|
|
38
|
-
shape: rectangle
|
|
39
|
-
|
|
40
|
-
WebSocket-Client: {
|
|
41
|
-
label: "WebSocket 客户端"
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
NotificationAddon: {
|
|
45
|
-
label: "NotificationAddon"
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
SnackbarProvider: {
|
|
49
|
-
label: "SnackbarProvider"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
# 定义通知流程
|
|
54
|
-
Backend.Event-Trigger -> Backend.Notification-Service: "1. 触发通知"
|
|
55
|
-
Backend.Notification-Service -> WebSocket-Server: "2. 推送消息"
|
|
56
|
-
WebSocket-Server -> Frontend.WebSocket-Client: "3. 广播到客户端"
|
|
57
|
-
Frontend.WebSocket-Client -> Frontend.NotificationAddon: "4. 转发消息"
|
|
58
|
-
Frontend.NotificationAddon -> Frontend.NotificationAddon: "5a. 更新未读计数"
|
|
59
|
-
Frontend.NotificationAddon -> Frontend.SnackbarProvider: "5b. 显示浮动提示通知"
|
|
60
|
-
Frontend.SnackbarProvider -> User: "6. 显示给用户"
|
|
61
|
-
```
|
|
11
|
+
<!-- DIAGRAM_IMAGE_START:architecture:16:9:1765962229 -->
|
|
12
|
+

|
|
13
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
62
14
|
|
|
63
15
|
## 核心组件
|
|
64
16
|
|
|
@@ -4,44 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
このコンポーネントは高度に拡張可能に設計されており、開発者はブロックレットのメタデータを通じてカスタムタブやコンテンツを追加でき、異なるアプリケーション間で一貫したユーザーエクスペリエンスを保証します。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
UserCenter: {
|
|
11
|
-
label: "UserCenter コンポーネントのレイアウト"
|
|
12
|
-
shape: rectangle
|
|
13
|
-
|
|
14
|
-
Header: { shape: rectangle }
|
|
15
|
-
|
|
16
|
-
Main: {
|
|
17
|
-
direction: right
|
|
18
|
-
shape: rectangle
|
|
19
|
-
|
|
20
|
-
Sidebar: {
|
|
21
|
-
label: "UserBasicInfo\n(プロファイルサイドバー)"
|
|
22
|
-
shape: rectangle
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Content: {
|
|
26
|
-
label: "コンテンツエリア"
|
|
27
|
-
shape: rectangle
|
|
28
|
-
|
|
29
|
-
Tabs: {
|
|
30
|
-
label: "タブナビゲーション"
|
|
31
|
-
shape: rectangle
|
|
32
|
-
}
|
|
33
|
-
TabPanel: {
|
|
34
|
-
label: "アクティブなタブのコンテンツ"
|
|
35
|
-
shape: rectangle
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Footer: { shape: rectangle }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
UserCenter.Main.Content.Tabs -> UserCenter.Main.Content.TabPanel: "コンテンツを制御"
|
|
44
|
-
```
|
|
7
|
+
<!-- DIAGRAM_IMAGE_START:architecture:4:3:1765962229 -->
|
|
8
|
+

|
|
9
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
45
10
|
|
|
46
11
|
## 基本的な使用法
|
|
47
12
|
|
|
@@ -4,44 +4,9 @@ The `UserCenter` component is a comprehensive, pre-built interface that provides
|
|
|
4
4
|
|
|
5
5
|
This component is designed to be highly extensible, allowing developers to add custom tabs and content through the blocklet's metadata, ensuring a consistent user experience across different applications.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
UserCenter: {
|
|
11
|
-
label: "UserCenter Component Layout"
|
|
12
|
-
shape: rectangle
|
|
13
|
-
|
|
14
|
-
Header: { shape: rectangle }
|
|
15
|
-
|
|
16
|
-
Main: {
|
|
17
|
-
direction: right
|
|
18
|
-
shape: rectangle
|
|
19
|
-
|
|
20
|
-
Sidebar: {
|
|
21
|
-
label: "UserBasicInfo\n(Profile Sidebar)"
|
|
22
|
-
shape: rectangle
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Content: {
|
|
26
|
-
label: "Content Area"
|
|
27
|
-
shape: rectangle
|
|
28
|
-
|
|
29
|
-
Tabs: {
|
|
30
|
-
label: "Tabs Navigation"
|
|
31
|
-
shape: rectangle
|
|
32
|
-
}
|
|
33
|
-
TabPanel: {
|
|
34
|
-
label: "Active Tab Content"
|
|
35
|
-
shape: rectangle
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Footer: { shape: rectangle }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
UserCenter.Main.Content.Tabs -> UserCenter.Main.Content.TabPanel: "Controls Content"
|
|
44
|
-
```
|
|
7
|
+
<!-- DIAGRAM_IMAGE_START:architecture:4:3:1765962229 -->
|
|
8
|
+

|
|
9
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
45
10
|
|
|
46
11
|
## Basic Usage
|
|
47
12
|
|
|
@@ -105,16 +70,17 @@ The `UserCenter` is composed of several key sections and components that provide
|
|
|
105
70
|
|
|
106
71
|
By default, the `UserCenter` includes the following tabs for every user:
|
|
107
72
|
|
|
108
|
-
| Tab | Description | Visibility
|
|
109
|
-
| ------------------- | ------------------------------------------------------------------------------ |
|
|
110
|
-
| **NFTs** | Displays the user's NFT collections. | Public
|
|
111
|
-
| **Social Activity** | Shows the user's followers and following lists if social features are enabled. | Public
|
|
112
|
-
| **Settings** | Access to profile, privacy, notification, and session management. | Owner Only
|
|
113
|
-
| **Storage** | Interface for managing connections to DID Spaces for decentralized storage. | Owner Only
|
|
73
|
+
| Tab | Description | Visibility |
|
|
74
|
+
| ------------------- | ------------------------------------------------------------------------------ | ---------- |
|
|
75
|
+
| **NFTs** | Displays the user's NFT collections. | Public |
|
|
76
|
+
| **Social Activity** | Shows the user's followers and following lists if social features are enabled. | Public |
|
|
77
|
+
| **Settings** | Access to profile, privacy, notification, and session management. | Owner Only |
|
|
78
|
+
| **Storage** | Interface for managing connections to DID Spaces for decentralized storage. | Owner Only |
|
|
114
79
|
|
|
115
80
|
### User Profile (`UserBasicInfo`)
|
|
116
81
|
|
|
117
82
|
The `UserBasicInfo` component is a dedicated section (typically a sidebar on desktop) that displays essential user details:
|
|
83
|
+
|
|
118
84
|
- **Avatar and Name**: Shows the user's profile picture and full name. The owner can click the avatar to open the profile switcher.
|
|
119
85
|
- **DID**: Displays the user's Decentralized Identifier, with options to copy it or view its QR code.
|
|
120
86
|
- **Social Actions**: For public profiles, it shows "Follow" or "Unfollow" buttons.
|
|
@@ -173,11 +139,9 @@ You can extend the `UserCenter` by adding new tabs through your blocklet's confi
|
|
|
173
139
|
const currentTab = '/profile/activity';
|
|
174
140
|
|
|
175
141
|
return (
|
|
176
|
-
<UserCenter currentTab={currentTab}>
|
|
177
|
-
{currentTab === '/profile/activity' && <MyActivityComponent />}
|
|
178
|
-
</UserCenter>
|
|
142
|
+
<UserCenter currentTab={currentTab}>{currentTab === '/profile/activity' && <MyActivityComponent />}</UserCenter>
|
|
179
143
|
);
|
|
180
144
|
}
|
|
181
145
|
```
|
|
182
146
|
|
|
183
|
-
This approach allows you to seamlessly integrate application-specific pages into the standard `UserCenter` layout.
|
|
147
|
+
This approach allows you to seamlessly integrate application-specific pages into the standard `UserCenter` layout.
|
|
@@ -4,44 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
此元件設計為高度可擴展,允許開發者透過 blocklet 的元資料新增自訂分頁和內容,確保在不同應用程式中提供一致的使用者體驗。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
UserCenter: {
|
|
11
|
-
label: "UserCenter 元件佈局"
|
|
12
|
-
shape: rectangle
|
|
13
|
-
|
|
14
|
-
Header: { shape: rectangle }
|
|
15
|
-
|
|
16
|
-
Main: {
|
|
17
|
-
direction: right
|
|
18
|
-
shape: rectangle
|
|
19
|
-
|
|
20
|
-
Sidebar: {
|
|
21
|
-
label: "UserBasicInfo\n(個人檔案側邊欄)"
|
|
22
|
-
shape: rectangle
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Content: {
|
|
26
|
-
label: "內容區域"
|
|
27
|
-
shape: rectangle
|
|
28
|
-
|
|
29
|
-
Tabs: {
|
|
30
|
-
label: "分頁導覽"
|
|
31
|
-
shape: rectangle
|
|
32
|
-
}
|
|
33
|
-
TabPanel: {
|
|
34
|
-
label: "當前分頁內容"
|
|
35
|
-
shape: rectangle
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Footer: { shape: rectangle }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
UserCenter.Main.Content.Tabs -> UserCenter.Main.Content.TabPanel: "控制內容"
|
|
44
|
-
```
|
|
7
|
+
<!-- DIAGRAM_IMAGE_START:architecture:4:3:1765962229 -->
|
|
8
|
+

|
|
9
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
45
10
|
|
|
46
11
|
## 基本用法
|
|
47
12
|
|
|
@@ -4,44 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
该组件被设计为高度可扩展,允许开发者通过 blocklet 的元数据添加自定义标签页和内容,从而确保在不同应用中提供一致的用户体验。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
UserCenter: {
|
|
11
|
-
label: "UserCenter 组件布局"
|
|
12
|
-
shape: rectangle
|
|
13
|
-
|
|
14
|
-
Header: { shape: rectangle }
|
|
15
|
-
|
|
16
|
-
Main: {
|
|
17
|
-
direction: right
|
|
18
|
-
shape: rectangle
|
|
19
|
-
|
|
20
|
-
Sidebar: {
|
|
21
|
-
label: "UserBasicInfo\n(个人资料侧边栏)"
|
|
22
|
-
shape: rectangle
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Content: {
|
|
26
|
-
label: "内容区域"
|
|
27
|
-
shape: rectangle
|
|
28
|
-
|
|
29
|
-
Tabs: {
|
|
30
|
-
label: "标签页导航"
|
|
31
|
-
shape: rectangle
|
|
32
|
-
}
|
|
33
|
-
TabPanel: {
|
|
34
|
-
label: "当前标签页内容"
|
|
35
|
-
shape: rectangle
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Footer: { shape: rectangle }
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
UserCenter.Main.Content.Tabs -> UserCenter.Main.Content.TabPanel: "控制内容"
|
|
44
|
-
```
|
|
7
|
+
<!-- DIAGRAM_IMAGE_START:architecture:4:3:1765962229 -->
|
|
8
|
+

|
|
9
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
45
10
|
|
|
46
11
|
## 基本用法
|
|
47
12
|
|
|
@@ -17,52 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
`UserSessions` コンポーネントは、開発者が提供する関数からセッションデータを要求することによって動作します。この設計により、コンポーネントは特定のバックエンド実装から切り離され、より大きな柔軟性が提供されます。
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
User-Interaction: {
|
|
24
|
-
shape: c4-person
|
|
25
|
-
label: "ユーザー"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
UserSessions-Component: {
|
|
29
|
-
label: "UserSessions コンポーネント"
|
|
30
|
-
shape: rectangle
|
|
31
|
-
|
|
32
|
-
Datatable: {
|
|
33
|
-
label: "データテーブル"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Actions: {
|
|
37
|
-
label: "ログアウト / すべてログアウト"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Application-Backend: {
|
|
42
|
-
label: "アプリケーションバックエンド"
|
|
43
|
-
shape: rectangle
|
|
44
|
-
|
|
45
|
-
API-Endpoint: {
|
|
46
|
-
label: "API エンドポイント\n(例: /api/sessions)"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Database: {
|
|
50
|
-
shape: cylinder
|
|
51
|
-
label: "セッションストレージ"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
User-Interaction -> UserSessions-Component.Datatable: "1. セッションを表示"
|
|
56
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "2. getUserSessions prop を呼び出し"
|
|
57
|
-
Application-Backend.API-Endpoint -> Database: "3. セッションデータを取得"
|
|
58
|
-
Database -> Application-Backend.API-Endpoint: "4. データを返す"
|
|
59
|
-
Application-Backend.API-Endpoint -> UserSessions-Component: "5. list と paging で promise を解決"
|
|
60
|
-
UserSessions-Component.Datatable -> User-Interaction: "6. セッションをレンダリング"
|
|
61
|
-
User-Interaction -> UserSessions-Component.Actions: "7. 「ログアウト」をクリック"
|
|
62
|
-
UserSessions-Component.Actions -> Application-Backend.API-Endpoint: "8. ログアウトリクエストを送信"
|
|
63
|
-
Application-Backend.API-Endpoint -> Database: "9. セッションを削除"
|
|
64
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "10. データを更新"
|
|
65
|
-
```
|
|
20
|
+
<!-- DIAGRAM_IMAGE_START:sequence:16:9:1765962229 -->
|
|
21
|
+

|
|
22
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
66
23
|
|
|
67
24
|
## 使用方法
|
|
68
25
|
|
|
@@ -17,52 +17,11 @@ The component is designed to be a plug-and-play solution for developers needing
|
|
|
17
17
|
|
|
18
18
|
The `UserSessions` component operates by requesting session data from a developer-provided function. This design decouples the component from any specific backend implementation, offering greater flexibility.
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
direction: down
|
|
20
|
+
The following diagram illustrates the interaction between the user, the component, and the application backend:
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
UserSessions-Component: {
|
|
29
|
-
label: "UserSessions Component"
|
|
30
|
-
shape: rectangle
|
|
31
|
-
|
|
32
|
-
Datatable: {
|
|
33
|
-
label: "Datatable"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Actions: {
|
|
37
|
-
label: "Logout / Logout All"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Application-Backend: {
|
|
42
|
-
label: "Application Backend"
|
|
43
|
-
shape: rectangle
|
|
44
|
-
|
|
45
|
-
API-Endpoint: {
|
|
46
|
-
label: "API Endpoint\n(e.g., /api/sessions)"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Database: {
|
|
50
|
-
shape: cylinder
|
|
51
|
-
label: "Session Storage"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
User-Interaction -> UserSessions-Component.Datatable: "1. Views sessions"
|
|
56
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "2. Calls `getUserSessions` prop"
|
|
57
|
-
Application-Backend.API-Endpoint -> Database: "3. Fetches session data"
|
|
58
|
-
Database -> Application-Backend.API-Endpoint: "4. Returns data"
|
|
59
|
-
Application-Backend.API-Endpoint -> UserSessions-Component: "5. Resolves promise with list and paging"
|
|
60
|
-
UserSessions-Component.Datatable -> User-Interaction: "6. Renders sessions"
|
|
61
|
-
User-Interaction -> UserSessions-Component.Actions: "7. Clicks 'Logout'"
|
|
62
|
-
UserSessions-Component.Actions -> Application-Backend.API-Endpoint: "8. Sends logout request"
|
|
63
|
-
Application-Backend.API-Endpoint -> Database: "9. Deletes session"
|
|
64
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "10. Refreshes data"
|
|
65
|
-
```
|
|
22
|
+
<!-- DIAGRAM_IMAGE_START:sequence:16:9:1765962229 -->
|
|
23
|
+

|
|
24
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
66
25
|
|
|
67
26
|
## Usage
|
|
68
27
|
|
|
@@ -17,52 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
`UserSessions` 元件透過向開發人員提供的函式請求會話資料來運作。這種設計將元件與任何特定的後端實作解耦,提供了更大的靈活性。
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
User-Interaction: {
|
|
24
|
-
shape: c4-person
|
|
25
|
-
label: "使用者"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
UserSessions-Component: {
|
|
29
|
-
label: "UserSessions 元件"
|
|
30
|
-
shape: rectangle
|
|
31
|
-
|
|
32
|
-
Datatable: {
|
|
33
|
-
label: "資料表"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Actions: {
|
|
37
|
-
label: "登出 / 全部登出"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Application-Backend: {
|
|
42
|
-
label: "應用程式後端"
|
|
43
|
-
shape: rectangle
|
|
44
|
-
|
|
45
|
-
API-Endpoint: {
|
|
46
|
-
label: "API 端點\n(例如 /api/sessions)"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Database: {
|
|
50
|
-
shape: cylinder
|
|
51
|
-
label: "會話儲存"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
User-Interaction -> UserSessions-Component.Datatable: "1. 查看會話"
|
|
56
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "2. 呼叫 `getUserSessions` 屬性"
|
|
57
|
-
Application-Backend.API-Endpoint -> Database: "3. 擷取會話資料"
|
|
58
|
-
Database -> Application-Backend.API-Endpoint: "4. 回傳資料"
|
|
59
|
-
Application-Backend.API-Endpoint -> UserSessions-Component: "5. 以列表和分頁解析 promise"
|
|
60
|
-
UserSessions-Component.Datatable -> User-Interaction: "6. 渲染會話"
|
|
61
|
-
User-Interaction -> UserSessions-Component.Actions: "7. 點擊「登出」"
|
|
62
|
-
UserSessions-Component.Actions -> Application-Backend.API-Endpoint: "8. 發送登出請求"
|
|
63
|
-
Application-Backend.API-Endpoint -> Database: "9. 刪除會話"
|
|
64
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "10. 重新整理資料"
|
|
65
|
-
```
|
|
20
|
+
<!-- DIAGRAM_IMAGE_START:sequence:16:9:1765962229 -->
|
|
21
|
+

|
|
22
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
66
23
|
|
|
67
24
|
## 使用方式
|
|
68
25
|
|
|
@@ -17,52 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
`UserSessions` 组件通过调用开发者提供的函数来请求会话数据。这种设计将组件与任何特定的后端实现解耦,从而提供了更大的灵活性。
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
User-Interaction: {
|
|
24
|
-
shape: c4-person
|
|
25
|
-
label: "用户"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
UserSessions-Component: {
|
|
29
|
-
label: "UserSessions 组件"
|
|
30
|
-
shape: rectangle
|
|
31
|
-
|
|
32
|
-
Datatable: {
|
|
33
|
-
label: "数据表格"
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
Actions: {
|
|
37
|
-
label: "登出 / 全部登出"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
Application-Backend: {
|
|
42
|
-
label: "应用后端"
|
|
43
|
-
shape: rectangle
|
|
44
|
-
|
|
45
|
-
API-Endpoint: {
|
|
46
|
-
label: "API 端点\n(例如, /api/sessions)"
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
Database: {
|
|
50
|
-
shape: cylinder
|
|
51
|
-
label: "会话存储"
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
User-Interaction -> UserSessions-Component.Datatable: "1. 查看会话"
|
|
56
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "2. 调用 `getUserSessions` 属性"
|
|
57
|
-
Application-Backend.API-Endpoint -> Database: "3. 获取会话数据"
|
|
58
|
-
Database -> Application-Backend.API-Endpoint: "4. 返回数据"
|
|
59
|
-
Application-Backend.API-Endpoint -> UserSessions-Component: "5. 以列表和分页信息解析 Promise"
|
|
60
|
-
UserSessions-Component.Datatable -> User-Interaction: "6. 渲染会话"
|
|
61
|
-
User-Interaction -> UserSessions-Component.Actions: "7. 点击'登出'"
|
|
62
|
-
UserSessions-Component.Actions -> Application-Backend.API-Endpoint: "8. 发送登出请求"
|
|
63
|
-
Application-Backend.API-Endpoint -> Database: "9. 删除会话"
|
|
64
|
-
UserSessions-Component -> Application-Backend.API-Endpoint: "10. 刷新数据"
|
|
65
|
-
```
|
|
20
|
+
<!-- DIAGRAM_IMAGE_START:sequence:16:9:1765962229 -->
|
|
21
|
+

|
|
22
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
66
23
|
|
|
67
24
|
## 用法
|
|
68
25
|
|
|
@@ -4,36 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
このセクションでは、スイートで利用可能な主要コンポーネントの概要を説明します。詳細な実装ガイドとAPIリファレンスについては、以下にリンクされている特定のコンポーネントのドキュメントを参照してください。
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
User: {
|
|
11
|
-
shape: c4-person
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
Application: {
|
|
15
|
-
label: "Blocklet アプリケーション"
|
|
16
|
-
shape: rectangle
|
|
17
|
-
grid-columns: 1
|
|
18
|
-
grid-gap: 100
|
|
19
|
-
|
|
20
|
-
UserCenter: {
|
|
21
|
-
label: "UserCenter\n(プロファイルと設定)"
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
UserSessions: {
|
|
25
|
-
label: "UserSessions\n(ログインアクティビティ)"
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
OrgsSwitch: {
|
|
29
|
-
label: "OrgsSwitch\n(チームコンテキスト)"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
User -> Application.UserCenter: "プロファイルを管理"
|
|
34
|
-
User -> Application.UserSessions: "セッションを確認"
|
|
35
|
-
User -> Application.OrgsSwitch: "組織を切り替え"
|
|
36
|
-
```
|
|
7
|
+
<!-- DIAGRAM_IMAGE_START:architecture:16:9:1765962229 -->
|
|
8
|
+

|
|
9
|
+
<!-- DIAGRAM_IMAGE_END -->
|
|
37
10
|
|
|
38
11
|
## コアコンポーネント
|
|
39
12
|
|