Bỏ qua, đến nội dung

@digiforce-nc/plugin-theme-editor ​

Plugin chỉnh sửa theme giao diện — tùy biến màu sắc, typography, spacing qua antd design tokens, quản lý nhiều theme và chuyển đổi nhanh.

Plugin này làm gì? ​

Plugin cho phép admin tạo và quản lý nhiều theme (bộ giao diện). Mỗi theme là một tập hợp antd design tokens — quyết định màu sắc, font, border, spacing của toàn bộ ứng dụng. User chuyển đổi theme theo sở thích.

Ba nhiệm vụ chính ​

#Nhiệm vụChi tiết
1Quản lý themesCRUD themes với JSON config (antd design tokens), built-in themes
2Theme EditorGiao diện trực quan: color picker, token previewer
3User preferenceMỗi user chọn theme riêng, lưu vào systemSettings.themeId

Kiến trúc ​

Database — collection themeConfig ​

FieldMô tả
configJSON chứa antd tokens (colorPrimary, fontSize, borderRadius...)
isBuiltInTheme hệ thống cung cấp sẵn (không xóa được)
defaultTheme mặc định cho user mới

Built-in themes ​

Khi cài đặt plugin lần đầu, 4 theme mặc định được tạo:

ThemeMô tả
Default LightTheme sáng mặc định
DarkTheme tối — giảm mỏi mắt
CompactTheme gọn — spacing nhỏ hơn
Compact DarkKết hợp compact + dark

ACL — Phân quyền ​

ACL ruleQuyềnMô tả
themeConfig:listpublicAi cũng xem được danh sách themes
users:updateThemeloggedInUser đã đăng nhập tự đổi theme
themeConfig:*Admin (snippet)Chỉ admin tạo/sửa/xóa theme

Dependencies ​

PackageVai trò
react-colorfulColor picker component
vanilla-jsoneditorJSON editor cho cấu hình nâng cao
@digiforce-nc/serverServer framework
@digiforce-nc/databaseDatabase ORM
@digiforce-nc/clientClient framework — antd integration

Mục lục chi tiết ​