plugin-build-guide-block 1.1.2 → 1.1.3
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/README.md +16 -74
- package/dist/client/index.js +2 -11
- package/dist/client/schemas/spacesSchema.d.ts +4 -0
- package/dist/externalVersion.js +7 -16
- package/dist/index.js +0 -9
- package/dist/locale/namespace.js +0 -9
- package/dist/locale/vi-VN.json +12 -4
- package/dist/locale/zh-CN.json +12 -4
- package/dist/server/actions/build.js +20 -22
- package/dist/server/actions/getHtml.js +0 -9
- package/dist/server/actions/getMarkdown.js +0 -9
- package/dist/server/collections/ai-build-guide-pages.js +0 -9
- package/dist/server/collections/ai-build-guide-spaces.js +0 -9
- package/dist/server/index.js +0 -9
- package/dist/server/plugin.js +0 -9
- package/package.json +1 -1
- package/src/client/UserGuideBlock.tsx +2 -2
- package/src/client/UserGuideManager.tsx +52 -23
- package/src/client/schemas/spacesSchema.ts +10 -5
- package/src/locale/vi-VN.json +12 -4
- package/src/locale/zh-CN.json +12 -4
- package/src/server/actions/build.ts +21 -17
package/README.md
CHANGED
|
@@ -1,74 +1,16 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
- **
|
|
9
|
-
- **
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
### Bảo mật
|
|
19
|
-
- **ACL**: Chỉ admin với snippet `pm.ai-build-guide` mới CRUD/build được. User `loggedIn` chỉ đọc được HTML (`getHtml`).
|
|
20
|
-
- **HTML Sanitization**: Hai lớp bảo vệ — server-side (sanitize-html) + client-side (DOMPurify).
|
|
21
|
-
- **Status guard**: API `getHtml` chỉ trả HTML khi Space ở trạng thái `completed`.
|
|
22
|
-
|
|
23
|
-
### Đa ngôn ngữ
|
|
24
|
-
- Hỗ trợ 3 ngôn ngữ: English (`en-US`), Tiếng Việt (`vi-VN`), 中文 (`zh-CN`).
|
|
25
|
-
|
|
26
|
-
## Kiến trúc
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
src/
|
|
30
|
-
├── server/
|
|
31
|
-
│ ├── plugin.ts # Đăng ký actions, ACL
|
|
32
|
-
│ ├── actions/
|
|
33
|
-
│ │ ├── build.ts # Build async: đọc docs → gọi LLM → sanitize → lưu HTML
|
|
34
|
-
│ │ └── getHtml.ts # Trả raw HTML (Content-Type: text/html)
|
|
35
|
-
│ └── collections/
|
|
36
|
-
│ └── ai-build-guide-spaces.ts # Collection definition
|
|
37
|
-
├── client/
|
|
38
|
-
│ ├── plugin.tsx # Đăng ký settings page, block initializer, FlowEngine model
|
|
39
|
-
│ ├── UserGuideBlock.tsx # Render HTML với DOMPurify
|
|
40
|
-
│ ├── UserGuideManager.tsx # Trang quản lý CRUD
|
|
41
|
-
│ ├── UserGuideBlockInitializer.tsx
|
|
42
|
-
│ ├── UserGuideBlockProvider.tsx
|
|
43
|
-
│ ├── schemas/
|
|
44
|
-
│ │ └── spacesSchema.ts # UI schema cho bảng + form
|
|
45
|
-
│ ├── components/
|
|
46
|
-
│ │ ├── BuildButton.tsx # Nút Build với auto-refresh
|
|
47
|
-
│ │ ├── LLMServiceSelect.tsx
|
|
48
|
-
│ │ ├── ModelSelect.tsx
|
|
49
|
-
│ │ └── StatusTag.tsx
|
|
50
|
-
│ └── models/
|
|
51
|
-
│ └── UserGuideBlockModel.ts # FlowEngine block model
|
|
52
|
-
└── locale/
|
|
53
|
-
├── en-US.json
|
|
54
|
-
├── vi-VN.json
|
|
55
|
-
└── zh-CN.json
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Dependencies
|
|
59
|
-
|
|
60
|
-
| Package | Loại | Mục đích |
|
|
61
|
-
|---------|------|----------|
|
|
62
|
-
| `sanitize-html` | dependency | Sanitize HTML phía server |
|
|
63
|
-
| `dompurify` | dependency | Sanitize HTML phía client |
|
|
64
|
-
| `@nocobase/plugin-ai` | peerDependency | Kết nối LLM service |
|
|
65
|
-
| `@nocobase/plugin-file-manager` | peerDependency | Đọc file đính kèm |
|
|
66
|
-
| `@langchain/core` | peerDependency | Message types cho LLM |
|
|
67
|
-
| `axios` | peerDependency | Fetch file từ URL |
|
|
68
|
-
|
|
69
|
-
## Cách sử dụng
|
|
70
|
-
|
|
71
|
-
1. Bật plugin trong Plugin Manager.
|
|
72
|
-
2. Vào **Settings → Build Guide Block** để tạo Space.
|
|
73
|
-
3. Chọn LLM Service, Model, upload tài liệu, nhấn **Build**.
|
|
74
|
-
4. Khi status = `completed`, vào trang bất kỳ → **Add Block → User Guide** → chọn Space.
|
|
1
|
+
# plugin-build-guide-block
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
Generate user guides, tutorials, and help books from documents using AI, then render the result as a block (HTML or Markdown).
|
|
5
|
+
|
|
6
|
+
## Features
|
|
7
|
+
- **AI Processing**: Automatically convert raw manuals or requirements into structured guides.
|
|
8
|
+
- **Multi-format Rendering**: Display output beautifully as Markdown or HTML.
|
|
9
|
+
- **Chapter Navigation**: Supports multi-page or sectioned guides with internal table of contents.
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
1. Enable the plugin in the Plugin Manager.
|
|
13
|
+
2. Add a "Build Guide" block to a page.
|
|
14
|
+
3. Upload source documents or provide prompts.
|
|
15
|
+
4. Trigger the AI build phase to generate the content.
|
|
16
|
+
5. Save and publish. The block will now display the formatted tutorial to end-users.
|