diff --git a/docs/plugin-development.md b/docs/plugin-development.md index 445306cb..0ade8c7a 100644 --- a/docs/plugin-development.md +++ b/docs/plugin-development.md @@ -21,13 +21,15 @@ EdgeEver provides client plugin and no-code theme extension capabilities. Users - [2. Templates](#2-templates) - [3. Resources & Attachments](#3-resources--attachments) - [4. Editor & Embeds](#4-editor--embeds) - - [5. UI, Commands & Panels](#5-ui-commands--panels) - - [6. Settings](#6-settings) - - [7. Storage & Secrets](#7-storage--secrets) - - [8. Network Requests](#8-network-requests) - - [9. Schedules (Desktop Only)](#9-schedules-desktop-only) - - [10. Events](#10-events) - - [11. AI Capabilities](#11-ai-capabilities) + - [5. Commands](#5-commands) + - [6. UI & Notices](#6-ui--notices) + - [7. Panels](#7-panels) + - [8. Settings](#8-settings) + - [9. Storage & Secrets](#9-storage--secrets) + - [10. Network Requests](#10-network-requests) + - [11. Schedules (Desktop Only)](#11-schedules-desktop-only) + - [12. Events](#12-events) + - [13. AI Capabilities](#13-ai-capabilities) - [Themes (No-Code Extensions)](#themes-no-code-extensions) - [Packaging, Distribution & Local Testing](#packaging-distribution--local-testing) - [Packaging Rules](#packaging-rules) @@ -410,9 +412,7 @@ await context.editor.insertEmbed({ --- -### 5. UI, Commands & Panels - -#### Commands +### 5. Commands ```ts context.commands.register({ @@ -426,14 +426,21 @@ context.commands.register({ }); ``` -#### Note Navigation +--- + +### 6. UI & Notices ```ts +// Global host notice +context.ui.showNotice("Action executed"); + // Open note and optionally jump to exact search term await context.ui.openNote(noteId, { search: "search term" }); ``` -#### Custom DOM Panels +--- + +### 7. Panels Register native DOM panels presented as dialogs or full-screen views: @@ -483,7 +490,7 @@ await context.ui.panels.open("task-dashboard", { state: { initialTab: "all" } }) --- -### 6. Settings +### 8. Settings Declare settings fields in `manifest.json`; EdgeEver renders the settings UI automatically: @@ -530,7 +537,7 @@ context.events.on("settings.changed", async ({ key }) => { --- -### 7. Storage & Secrets +### 9. Storage & Secrets Isolated per workspace and plugin ID on the current device: @@ -548,7 +555,7 @@ await context.secrets.remove("api_key"); --- -### 8. Network Requests +### 10. Network Requests ```ts // 1. Standard request (arbitrary HTTP/HTTPS; subject to host CORS policies) @@ -569,7 +576,7 @@ const xml = await publicRes.text(); --- -### 9. Schedules (Desktop Only) +### 11. Schedules (Desktop Only) Desktop plugins can persist scheduled execution of registered commands while EdgeEver is running: @@ -597,7 +604,7 @@ await context.schedules.remove("hourly-sync"); --- -### 10. Events +### 12. Events Subscribe to workspace data changes: @@ -614,7 +621,7 @@ context.events.on("workspace.synced", () => { /* Workspace sync completed */ }); --- -### 11. AI Capabilities +### 13. AI Capabilities Invoke workspace-configured AI models for text generation and media transcription (credentials are managed securely by the host; plugins never touch user API keys): diff --git a/docs/plugin-development.zh-CN.md b/docs/plugin-development.zh-CN.md index 998bfe6d..8397bbe5 100644 --- a/docs/plugin-development.zh-CN.md +++ b/docs/plugin-development.zh-CN.md @@ -21,13 +21,15 @@ EdgeEver 提供客户端插件与无代码主题扩展能力。用户可从官 - [2. 模板管理(Templates)](#2-模板管理templates) - [3. 资源附件(Resources)](#3-资源附件resources) - [4. 编辑器交互(Editor & Embeds)](#4-编辑器交互editor--embeds) - - [5. 界面交互(UI, Commands & Panels)](#5-界面交互ui-commands--panels) - - [6. 统一设置(Settings)](#6-统一设置settings) - - [7. 数据存储与安全凭据(Storage & Secrets)](#7-数据存储与安全凭据storage--secrets) - - [8. 网络请求(Network)](#8-网络请求network) - - [9. 定时任务(Schedules,仅桌面端)](#9-定时任务schedules仅桌面端) - - [10. 事件监听(Events)](#10-事件监听events) - - [11. 人工智能(AI)](#11-人工智能ai) + - [5. 全局命令(Commands)](#5-全局命令commands) + - [6. 宿主界面与通知(UI & Notices)](#6-宿主界面与通知ui--notices) + - [7. 自定义面板(Panels)](#7-自定义面板panels) + - [8. 统一设置(Settings)](#8-统一设置settings) + - [9. 数据存储与安全凭据(Storage & Secrets)](#9-数据存储与安全凭据storage--secrets) + - [10. 网络请求(Network)](#10-网络请求network) + - [11. 定时任务(Schedules,仅桌面端)](#11-定时任务schedules仅桌面端) + - [12. 事件监听(Events)](#12-事件监听events) + - [13. 人工智能(AI)](#13-人工智能ai) - [主题扩展(Theme Manifest)](#主题扩展theme-manifest) - [打包、分发与本地开发](#打包分发与本地开发) - [打包规范](#打包规范) @@ -410,9 +412,7 @@ await context.editor.insertEmbed({ --- -### 5. 界面交互(UI, Commands & Panels) - -#### 命令注册 +### 5. 全局命令(Commands) ```ts context.commands.register({ @@ -426,14 +426,21 @@ context.commands.register({ }); ``` -#### 笔记跳转 +--- + +### 6. 宿主界面与通知(UI & Notices) ```ts +// 宿主全局轻提示 +context.ui.showNotice("操作执行成功"); + // 打开指定笔记并可选跳转至指定搜索关键词 await context.ui.openNote(noteId, { search: "关键定位词" }); ``` -#### 自定义 DOM 面板(Panels) +--- + +### 7. 自定义面板(Panels) 插件可以注册全屏或对话框形态的原生 DOM 面板: @@ -483,7 +490,7 @@ await context.ui.panels.open("task-dashboard", { state: { initialTab: "all" } }) --- -### 6. 统一设置(Settings) +### 8. 统一设置(Settings) EdgeEver 由宿主统一渲染插件设置界面。在 `manifest.json` 中声明配置字段,无需手写设置页 UI: @@ -530,7 +537,7 @@ context.events.on("settings.changed", async ({ key }) => { --- -### 7. 数据存储与安全凭据(Storage & Secrets) +### 9. 数据存储与安全凭据(Storage & Secrets) 用于插件自身的数据持久化(按工作区与插件 ID 隔离存储在当前设备): @@ -548,7 +555,7 @@ await context.secrets.remove("api_key"); --- -### 8. 网络请求(Network) +### 10. 网络请求(Network) ```ts // 1. 标准请求(支持任意 HTTP/HTTPS 请求,受宿主环境 CORS 策略约束) @@ -569,7 +576,7 @@ const xml = await publicRes.text(); --- -### 9. 定时任务(Schedules,仅桌面端) +### 11. 定时任务(Schedules,仅桌面端) 桌面端插件可注册定时计划执行已注册的命令(在 EdgeEver 打开期间运行): @@ -597,7 +604,7 @@ await context.schedules.remove("hourly-sync"); --- -### 10. 事件监听(Events) +### 12. 事件监听(Events) 订阅工作区的数据变更事件: @@ -614,7 +621,7 @@ context.events.on("workspace.synced", () => { /* 工作区同步完成 */ }); --- -### 11. 人工智能(AI) +### 13. 人工智能(AI) 调用用户当前工作区已配置的 AI 模型生成文本或转录媒体(凭据由宿主安全保管,插件无需知晓用户 API Key):