An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: Improve plugin publishing controls and interaction documentation https://github.com/siyuan-note/siyuan/issues/18354
Danielae884d763c2a
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.jsonindex 5f1b34cf95..a38e9d6685 100644--- a/app/appearance/langs/ar.json+++ b/app/appearance/langs/ar.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "نشر بيانات الإضافة","pluginPublishData": "بيانات الإضافة المنشورة","pluginPublishDataGrantTip": "هل تسمح لزوار خدمة النشر بقراءة هذه الحقول؟ انشر فقط المحتوى المناسب للإفصاح عنه. ستُحذف البيانات المنشورة الحالية","pluginPublishDataRevokeTip": "إلغاء الوصول وحذف البيانات المنشورة لهذه الإضافة",diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.jsonindex af18b328db..02e9960c0b 100644--- a/app/appearance/langs/de.json+++ b/app/appearance/langs/de.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Plugin-Daten veröffentlichen","pluginPublishData": "Veröffentlichte Plugin-Daten","pluginPublishDataGrantTip": "Besuchern des Veröffentlichungsdienstes Zugriff auf diese Felder erlauben? Veröffentlichen Sie nur dafür geeignete Inhalte. Bisher veröffentlichte Daten werden gelöscht","pluginPublishDataRevokeTip": "Zugriff widerrufen und die veröffentlichten Daten dieses Plugins löschen",diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.jsonindex a46192c76d..959814de61 100644--- a/app/appearance/langs/en.json+++ b/app/appearance/langs/en.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publish plugin data","pluginPublishData": "Plugin published data","pluginPublishDataGrantTip": "Allow publishing-service visitors to read these fields? Only publish content suitable for disclosure. Existing published data will be cleared","pluginPublishDataRevokeTip": "Revoke access and delete this plugin's published data",diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.jsonindex c662bf6e80..ce2db8c6c6 100644--- a/app/appearance/langs/es.json+++ b/app/appearance/langs/es.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publicar datos del complemento","pluginPublishData": "Datos publicados del complemento","pluginPublishDataGrantTip": "¿Permitir que los visitantes del servicio de publicación lean estos campos? Publique solo contenido apto para divulgar. Se borrarán los datos publicados existentes","pluginPublishDataRevokeTip": "Revocar el acceso y eliminar los datos publicados de este complemento",diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.jsonindex 69c54bc77b..29cafcb88e 100644--- a/app/appearance/langs/fr.json+++ b/app/appearance/langs/fr.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publier les données du plugin","pluginPublishData": "Données publiées du greffon","pluginPublishDataGrantTip": "Autoriser les visiteurs du service de publication à lire ces champs ? Ne publiez que du contenu destiné à être divulgué. Les données déjà publiées seront effacées","pluginPublishDataRevokeTip": "Révoquer l’accès et supprimer les données publiées de ce greffon",diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.jsonindex 0d6d62d222..b905e82ad8 100644--- a/app/appearance/langs/he.json+++ b/app/appearance/langs/he.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "פרסום נתוני התוסף","pluginPublishData": "הנתונים שפורסמו מהתוסף","pluginPublishDataGrantTip": "לאפשר למבקרים בשירות הפרסום לקרוא שדות אלה? יש לפרסם רק תוכן המתאים לחשיפה. הנתונים שכבר פורסמו יימחקו","pluginPublishDataRevokeTip": "ביטול הגישה ומחיקת הנתונים שפורסמו מתוסף זה",diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.jsonindex 86658953af..9b295482eb 100644--- a/app/appearance/langs/hi.json+++ b/app/appearance/langs/hi.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "प्लगइन डेटा प्रकाशित करें","pluginPublishData": "प्लगइन का प्रकाशित डेटा","pluginPublishDataGrantTip": "क्या प्रकाशन सेवा के आगंतुकों को ये फ़ील्ड पढ़ने की अनुमति दें? केवल साझा करने योग्य सामग्री प्रकाशित करें। मौजूदा प्रकाशित डेटा मिटा दिया जाएगा","pluginPublishDataRevokeTip": "पहुँच रद्द करें और इस प्लगइन का प्रकाशित डेटा हटाएँ",diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.jsonindex 222634e19e..903abcc5ea 100644--- a/app/appearance/langs/id.json+++ b/app/appearance/langs/id.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publikasikan data plugin","pluginPublishData": "Data plugin yang dipublikasikan","pluginPublishDataGrantTip": "Izinkan pengunjung layanan publikasi membaca kolom ini? Publikasikan hanya konten yang layak diungkapkan. Data publikasi yang ada akan dihapus","pluginPublishDataRevokeTip": "Cabut akses dan hapus data publikasi plugin ini",diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.jsonindex 7ba7b1e545..a3f6f0ed69 100644--- a/app/appearance/langs/it.json+++ b/app/appearance/langs/it.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Pubblica i dati del plugin","pluginPublishData": "Dati pubblicati del componente aggiuntivo","pluginPublishDataGrantTip": "Consentire ai visitatori del servizio di pubblicazione di leggere questi campi? Pubblicare solo contenuti adatti alla divulgazione. I dati già pubblicati verranno cancellati","pluginPublishDataRevokeTip": "Revocare l’accesso ed eliminare i dati pubblicati di questo componente aggiuntivo",diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.jsonindex 670066815f..bf49b00057 100644--- a/app/appearance/langs/ja.json+++ b/app/appearance/langs/ja.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "プラグインデータを公開","pluginPublishData": "プラグインの公開データ","pluginPublishDataGrantTip": "公開サービスの閲覧者に以下のフィールドの読み取りを許可しますか?公開してよい内容のみを含めてください。既存の公開データは消去されます","pluginPublishDataRevokeTip": "許可を取り消し、このプラグインの公開データを削除する",diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.jsonindex 83577edccb..b712acd684 100644--- a/app/appearance/langs/ko.json+++ b/app/appearance/langs/ko.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "플러그인 데이터 공개","pluginPublishData": "플러그인 공개 데이터","pluginPublishDataGrantTip": "게시 서비스 방문자가 다음 필드를 읽도록 허용할까요? 공개해도 되는 내용만 게시하세요. 기존 공개 데이터는 삭제됩니다","pluginPublishDataRevokeTip": "접근 권한을 취소하고 이 플러그인의 공개 데이터 삭제",diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.jsonindex d9c5561e45..0db9fe1528 100644--- a/app/appearance/langs/nl.json+++ b/app/appearance/langs/nl.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Plugingegevens publiceren","pluginPublishData": "Gepubliceerde plug-ingegevens","pluginPublishDataGrantTip": "Bezoekers van de publicatiedienst toestaan deze velden te lezen? Publiceer alleen inhoud die openbaar mag worden. Bestaande gepubliceerde gegevens worden gewist","pluginPublishDataRevokeTip": "Toegang intrekken en de gepubliceerde gegevens van deze plug-in verwijderen",diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.jsonindex 0f93d1326a..4fa36008d9 100644--- a/app/appearance/langs/pl.json+++ b/app/appearance/langs/pl.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publikuj dane wtyczki","pluginPublishData": "Opublikowane dane wtyczki","pluginPublishDataGrantTip": "Zezwolić odwiedzającym usługę publikowania na odczyt tych pól? Publikuj tylko treści odpowiednie do ujawnienia. Dotychczas opublikowane dane zostaną usunięte","pluginPublishDataRevokeTip": "Cofnij dostęp i usuń opublikowane dane tej wtyczki",diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.jsonindex 6723915173..578b93ab95 100644--- a/app/appearance/langs/pt-BR.json+++ b/app/appearance/langs/pt-BR.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Publicar dados do plugin","pluginPublishData": "Dados publicados do plugin","pluginPublishDataGrantTip": "Permitir que visitantes do serviço de publicação leiam estes campos? Publique apenas conteúdo adequado para divulgação. Os dados já publicados serão apagados","pluginPublishDataRevokeTip": "Revogar o acesso e excluir os dados publicados deste plugin",diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.jsonindex 7f17fb947d..d34cd2af96 100644--- a/app/appearance/langs/ru.json+++ b/app/appearance/langs/ru.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Опубликовать данные плагина","pluginPublishData": "Опубликованные данные плагина","pluginPublishDataGrantTip": "Разрешить посетителям сервиса публикации читать эти поля? Публикуйте только сведения, подходящие для раскрытия. Ранее опубликованные данные будут удалены","pluginPublishDataRevokeTip": "Отозвать доступ и удалить опубликованные данные этого плагина",diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.jsonindex e076ec24cd..d5f276dcd7 100644--- a/app/appearance/langs/sk.json+++ b/app/appearance/langs/sk.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Zverejniť údaje doplnku","pluginPublishData": "Zverejnené údaje doplnku","pluginPublishDataGrantTip": "Povoliť návštevníkom publikačnej služby čítať tieto polia? Zverejňujte iba obsah vhodný na sprístupnenie. Doteraz zverejnené údaje sa vymažú","pluginPublishDataRevokeTip": "Odvolať prístup a odstrániť zverejnené údaje tohto doplnku",diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.jsonindex c02cf9c4cb..4fe735a818 100644--- a/app/appearance/langs/sr.json+++ b/app/appearance/langs/sr.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Објави податке додатка","pluginPublishData": "Објављени подаци додатка","pluginPublishDataGrantTip": "Дозволити посетиоцима услуге објављивања да читају ова поља? Објављујте само садржај погодан за откривање. Постојећи објављени подаци биће обрисани","pluginPublishDataRevokeTip": "Опозови приступ и избриши објављене податке овог додатка",diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.jsonindex 773ecdd6b7..4eb8d012f1 100644--- a/app/appearance/langs/th.json+++ b/app/appearance/langs/th.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "เผยแพร่ข้อมูลปลั๊กอิน","pluginPublishData": "ข้อมูลที่เผยแพร่ของปลั๊กอิน","pluginPublishDataGrantTip": "อนุญาตให้ผู้เข้าชมบริการเผยแพร่อ่านฟิลด์เหล่านี้หรือไม่? เผยแพร่เฉพาะเนื้อหาที่เปิดเผยได้ ข้อมูลที่เผยแพร่อยู่จะถูกล้าง","pluginPublishDataRevokeTip": "เพิกถอนสิทธิ์เข้าถึงและลบข้อมูลที่เผยแพร่ของปลั๊กอินนี้",diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.jsonindex 519e83e674..bb287ea606 100644--- a/app/appearance/langs/tr.json+++ b/app/appearance/langs/tr.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Eklenti verilerini yayımla","pluginPublishData": "Eklentinin yayımlanan verileri","pluginPublishDataGrantTip": "Yayın hizmeti ziyaretçilerinin bu alanları okumasına izin verilsin mi? Yalnızca açıklanmaya uygun içerikleri yayımlayın. Mevcut yayımlanmış veriler silinecek","pluginPublishDataRevokeTip": "Erişimi iptal et ve bu eklentinin yayımlanan verilerini sil",diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.jsonindex f322c3e3c1..b906340167 100644--- a/app/appearance/langs/uk.json+++ b/app/appearance/langs/uk.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "Опублікувати дані плагіна","pluginPublishData": "Опубліковані дані плагіна","pluginPublishDataGrantTip": "Дозволити відвідувачам сервісу публікації читати ці поля? Публікуйте лише відомості, придатні для розкриття. Раніше опубліковані дані буде видалено","pluginPublishDataRevokeTip": "Скасувати доступ і видалити опубліковані дані цього плагіна",diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.jsonindex efe66b8e96..3f870e2780 100644--- a/app/appearance/langs/zh-CN.json+++ b/app/appearance/langs/zh-CN.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "发布插件数据","pluginPublishData": "插件发布数据","pluginPublishDataGrantTip": "允许发布服务访问者读取以下字段?请仅公开适合披露的内容,现有发布数据将被清空","pluginPublishDataRevokeTip": "撤销授权并删除此插件的发布数据",diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.jsonindex 2df0bd0be0..be99cf4cec 100644--- a/app/appearance/langs/zh-TW.json+++ b/app/appearance/langs/zh-TW.json@@ -1,4 +1,5 @@{+ "pluginPublishDataTip": "發佈外掛資料","pluginPublishData": "外掛程式發佈資料","pluginPublishDataGrantTip": "允許發佈服務訪客讀取下列欄位?請僅公開適合披露的內容,現有發佈資料將被清空","pluginPublishDataRevokeTip": "撤銷授權並刪除此外掛程式的發佈資料",diff --git a/app/src/assets/scss/business/_config.scss b/app/src/assets/scss/business/_config.scssindex 27d36da20a..4f1bdba0f2 100644--- a/app/src/assets/scss/business/_config.scss+++ b/app/src/assets/scss/business/_config.scss@@ -610,6 +610,11 @@display: inline-flex;}+ &__publish-data {+ display: inline-flex;+ vertical-align: middle;+ }+&__panel {height: 100%;overflow: auto;diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.tsindex 439c28e4fe..b554ff33d5 100644--- a/app/src/config/bazaar.ts+++ b/app/src/config/bazaar.ts@@ -828,7 +828,7 @@ ${primaryAction ? '<div class="fn__hr"></div>' : ""}<span class="fn__space--small"></span><span class="fn__flex-center ft__on-surface">${window.siyuan.languages.publishService}</span></label>- <button data-type="plugin-publish-data" class="b3-button b3-button--outline">${window.siyuan.languages.pluginPublishData}</button>` : "";+ <button type="button" data-type="plugin-publish-data" class="block__icon block__icon--show config-bazaar__publish-data ariaLabel" data-position="north" aria-label="${escapeAttr(window.siyuan.languages.pluginPublishDataTip)}"><svg aria-hidden="true"><use xlink:href="#iconUpload"></use></svg></button>` : "";const available = bazaar._getUpdatedItem(bazaarType, bazaarItem.name)?.available;const ratingKey = getRatingKey(bazaarType, bazaarItem.name);return `<div data-name="${escapeAttr(bazaarItem.name)}" data-package-type="${bazaarType}" data-package-source="downloaded" class="b3-card${bazaarItem.current ? " b3-card--current" : ""}">diff --git a/docs/PLUGIN-PUBLISH.md b/docs/PLUGIN-PUBLISH.mdindex 2518c2dd63..d654a94c05 100644--- a/docs/PLUGIN-PUBLISH.md+++ b/docs/PLUGIN-PUBLISH.md@@ -4,6 +4,53 @@Publish permissions apply to visitors, not individual browser plugins. Published data can be downloaded by visitors and read by other code in the same page. Never publish tokens, passwords, registration codes, or private notebook content.+## User interactions and feedback++A public snapshot is a separate copy of data that a plugin prepares for publishing-service visitors. Allowing a plugin in the publishing service, authorizing its data fields, and generating public data are three separate steps. Authorization does not generate data or copy private settings.++### Interface responsibilities++Data authorization is accessed through the upload icon button beside the plugin card's **Publish service** switch. Its tooltip is **Publish plugin data**, and it opens the **Plugin published data** dialog. References to the **Plugin published data** action below mean this icon button.++| Action | Provided by | Interface and behavior |+| --- | --- | --- |+| Enable the publishing service | SiYuan | Enable the service in settings; downloaded plugin cards then show the per-plugin **Publish service** switch and **Plugin published data** button |+| Allow plugin publishing | SiYuan | The card's **Publish service** switch controls whether the plugin can be published; the switch is disabled when the author prohibits publishing |+| Grant or revoke data access | SiYuan | The **Plugin published data** dialog shows the package name, declared fields, and grant or revocation information, with **Cancel** and **Confirm** buttons |+| Generate or update public data | Plugin | The plugin provides an action or documented automatic updates in the administrator environment; SiYuan has no shared generate-snapshot button |+| Display public content and read status | Plugin | The plugin displays content and handles missing authorization, missing snapshots, and read failures; SiYuan returns corresponding API errors rather than rendering a shared plugin content area |++### First use++1. The administrator enables the publishing service in settings and configures access and document permissions through the existing publishing features+2. Open <kbd>Settings</kbd> - <kbd>Marketplace</kbd> - <kbd>Downloaded</kbd>, select **Plugin**, check that plugins are globally enabled and the target plugin is enabled, then turn on its card's **Publish service** switch+3. If the plugin needs public data, click **Plugin published data** on the same card; when no fields are declared, SiYuan reports that the plugin has not declared publishable fields and does not open a grant dialog; plugins using only frontend resources do not need a data grant+4. Review the package name and complete field list, including the disclosure scope and notice that the previous snapshot will be cleared; the current dialog grants the declared fields as a group without individual checkboxes, and **Cancel** leaves authorization unchanged+5. Click **Confirm** to submit the grant and close the dialog; closing it does not mean data has been generated and must not be treated as proof that saving succeeded; there is currently no separate grant-success notification or snapshot-status panel, and reopening **Plugin published data** reads the current grant, showing revocation information when access is granted+6. Follow the plugin's instructions to generate data in the administrator interface or trigger its automatic update condition; the plugin should explain the entry point, public content, and update timing, reporting an update only after saving succeeds+7. Visitors open the published page, where the plugin reads and displays public data; if authorization exists but generation has not succeeded, the plugin should display a missing-snapshot message or safe defaults without attempting to read private settings++### Updates and stopping publication++* Update: regenerate public data through the plugin in the administrator environment; updates within the existing scope need no new grant, and the plugin must explain whether saving private settings also updates public data+* View updates: visitors reload the published page or use the plugin's refresh action; SiYuan has no shared plugin-snapshot refresh button+* Revoke: click **Plugin published data** again, review the revocation information, and click **Confirm**; success removes the grant and snapshot and denies subsequent data reads, while frontend resources remain controlled by the plugin's publishing switch+* Pause all publishing for a plugin: turn off its card's **Publish service** switch to deny subsequent resource and data reads; this does not revoke the data grant, so turning it back on can make the retained snapshot readable if its grant remains valid+* Grant again: after revocation, a new grant still requires the plugin to generate new public data; expanding the declaration also requires a new grant, which clears the previous snapshot+* Uninstall and reinstall: uninstall removes authorization and the snapshot, so reinstall requires authorization and generation again; stopping publication cannot recover content already downloaded by visitors++### Error feedback and interaction acceptance++The following table specifies feedback that plugins should provide. Each plugin implements its own entry points and wording; the table does not describe an existing shared SiYuan status interface. After a failed public read, stop using the previous snapshot and show a message or safe defaults without falling back to private storage.++| Scenario | Expected administrator or visitor feedback | Acceptance criteria |+| --- | --- | --- |+| Missing authorization or unavailable plugin (403) | Visitors see that data is unavailable; the plugin's administrator action prompts checking the publishing switch and data grant | No private data is displayed, and the plugin does not grant itself access |+| Authorized but not generated (404) | Visitors see a missing-snapshot message or defaults; administrators follow the plugin's generation instructions | Verify authorization and generation separately; a missing snapshot must not prevent the whole plugin from loading |+| Read, network, or storage failure | The plugin reports a read failure and provides a retry suitable for its interface | Do not treat errors as valid empty data or continue displaying previously read content |+| Save failure or changed fields during authorization | Administrators see failure feedback and reopen the grant dialog to review current fields when needed | No false update-success message or scope expansion through a stale field list |+| Read after revocation or publishing disablement | Visitors cannot obtain public data; disabling plugin publishing also denies its resources | Subsequent requests are denied; already downloaded copies cannot be recalled |+## Resource declarationStandard frontend entries (`index.js`, `index.css`, and direct `i18n/*.json` language files) remain available for enabled plugins. Declare every additional frontend file in `plugin.json`:diff --git a/docs/PLUGIN-PUBLISH.zh-CN.md b/docs/PLUGIN-PUBLISH.zh-CN.mdindex bb2d07ed76..474fc6ddba 100644--- a/docs/PLUGIN-PUBLISH.zh-CN.md+++ b/docs/PLUGIN-PUBLISH.zh-CN.md@@ -4,6 +4,53 @@发布权限授予访问者,不区分同一页面中的浏览器插件。公开数据也能被访问者下载或被页面中的其他代码读取。不要公开令牌、密码、注册码或私有笔记本内容。+## 用户操作与界面反馈++公开快照是插件专门准备给发布访问者读取的一份数据。允许插件用于发布服务、授权数据字段、生成公开数据是三个独立步骤。授权本身不会生成数据,也不会复制私有配置。++### 界面职责++数据授权入口是插件卡片「发布服务」开关旁的上传图标按钮,悬停提示为「发布插件数据」,点击后打开标题为「插件发布数据」的弹窗。下文的「插件发布数据」操作均指此图标入口。++| 操作 | 提供方 | 界面与行为 |+| --- | --- | --- |+| 启用发布服务 | 思源 | 在设置中开启发布服务;开启后,已下载插件卡片显示插件的「发布服务」开关和「插件发布数据」按钮 |+| 允许插件发布 | 思源 | 插件卡片的「发布服务」开关控制该插件是否可用于发布;作者禁止发布时,开关不可操作 |+| 授权或撤销数据 | 思源 | 「插件发布数据」弹窗展示插件包名、声明字段和授权或撤销说明,提供「取消」「确定」按钮 |+| 生成、更新公开数据 | 插件 | 插件提供操作入口,或在管理员环境中按其说明自动更新;思源没有统一的「生成快照」按钮 |+| 展示公开内容和读取状态 | 插件 | 插件在发布页面显示内容,并处理未授权、尚未生成和读取失败;思源接口提供对应错误,不统一绘制插件内容区 |++### 首次使用++1. 管理员在设置中开启发布服务,并按现有发布功能配置访问方式和文档权限+2. 打开 <kbd>设置</kbd> - <kbd>集市</kbd> - <kbd>已下载</kbd>,选择「插件」,确认插件总开关及目标插件已启用,再开启目标插件卡片的「发布服务」开关+3. 如果插件需要公开数据,点击同一卡片的「插件发布数据」;没有声明数据字段时,思源提示「此插件尚未声明可公开的数据字段」,不显示授权弹窗;仅使用前端资源的插件无需数据授权+4. 在弹窗中核对插件包名和完整字段清单,阅读公开范围及旧快照将被清空的说明;当前按整组声明字段授权,不提供逐字段勾选,点击「取消」不改变授权+5. 点击「确定」提交授权,弹窗关闭;关闭弹窗不代表已经生成公开数据,也不应被当作保存成功的证明;当前没有独立的授权成功提示或快照状态面板,再次点击「插件发布数据」可读取最新授权状态,已授权时弹窗改为撤销说明+6. 按插件自己的说明,在管理员界面执行生成操作,或触发其自动更新条件;插件应说明入口、公开内容和更新时机,并在成功保存后反馈公开数据已更新,保存失败时不得提示成功+7. 访问者打开发布页面,插件读取公开数据并展示内容;只有授权而尚未成功生成时,插件应显示尚未生成的提示或安全默认内容,不能尝试读取私有配置++### 日常更新与停止公开++- 更新:在管理员环境中通过插件重新生成公开数据,同一授权范围内无需再次授权;保存私有设置是否触发更新由插件明确说明,不能假设私有设置保存后会自动公开+- 查看更新:访问者刷新发布页面,或使用插件提供的刷新方式;思源没有统一的插件快照刷新按钮+- 撤销:管理员再次点击「插件发布数据」,确认撤销说明后点击「确定」;成功后删除授权和快照,拒绝后续数据读取,插件前端资源仍由其发布开关控制+- 暂停整个插件发布:关闭插件卡片的「发布服务」开关,拒绝后续资源和数据读取;此操作不等同于撤销数据授权,重新开启后若原授权仍有效,可继续读取保留的快照+- 重新授权:撤销后再次授权仍需由插件重新生成公开数据;声明扩大时也需要重新授权,授权后旧快照清空+- 卸载与重装:卸载清理授权和快照,重装后重新执行授权与生成流程;停止公开无法收回访问者已下载的内容++### 异常反馈与交互验收++下表描述插件应提供的交互反馈,具体入口与文案由插件实现,不表示思源已经提供统一的状态界面。发布页面读取失败时应停止使用旧快照,显示提示或安全默认内容,且不回退到私有存储。++| 场景 | 管理员或访问者应看到的反馈 | 验收要点 |+| --- | --- | --- |+| 未授权或插件不可发布(403) | 访问者看到数据不可用;管理员在插件操作中得到检查插件发布开关和数据授权的提示 | 不展示私有数据,不由插件自动授予权限 |+| 已授权但尚未生成(404) | 访问者看到尚未生成或默认内容;管理员按插件说明执行生成操作 | 授权成功与生成成功分别验证,插件其余功能不因缺少快照而整体加载失败 |+| 读取失败、网络或存储异常 | 插件提示读取失败,并提供适合自身界面的重试方式 | 不把错误解释成有效空数据,不继续展示上次读取的内容 |+| 保存失败或授权期间字段声明变化 | 管理员看到失败反馈,必要时重新打开授权弹窗核对最新字段 | 不提示更新成功,不通过过期字段清单扩大授权 |+| 撤销或关闭插件发布后再次读取 | 访问者不再获得公开数据;关闭插件发布时也不再获得插件资源 | 验证后续请求被拒绝;已经下载的副本不在撤回范围内 |+## 资源声明已启用插件的标准前端入口 `index.js`、`index.css` 及 `i18n` 下直接存放的 `.json` 语言文件继续可用。额外的前端文件必须在 `plugin.json` 中声明: