Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-12-13 10:50:37 +08:00
commit 472a3b09af
19 changed files with 82 additions and 40 deletions

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "مسافة بادئة عكسية لمخطط القائمة",
"outlineOutdentTip": "عند التمكين، سيتم استخدام المنطق التفصيلي للقائمة لإنشاء مسافة بادئة عكسية، أي نقل عناصر القائمة تحت المستوى الأصلي",
"spellcheck": "التدقيق الإملائي",
"spellcheckTip": "بعد التمكين، سيتم استخدام وظيفة التحقق الإملائي المدمجة في المتصفح. حاليا، يتم دعم التحقق الإملائي باللغة الإنجليزية فقط",
"spellcheckTip": "عند التمكين، سيتم استخدام مدقق الإملاء المدمج في المتصفح. يرجى اختيار اللغات التي تريد التحقق منها في إعدادات المتصفح",
"spellcheckTip2": "عند التمكين، سيتم استخدام مدقق الإملاء المدمج. يرجى اختيار اللغات التي تريد التحقق منها من القائمة أدناه",
"over": "تجاوز",
"preview": "معاينة التصدير",
"desktop": "سطح المكتب",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Listenumriss ausrücken",
"outlineOutdentTip": "Nach der Aktivierung wird das Ausrücken den Listenumriss-Logik verwenden, d.h. die Listenpunkte unter dem übergeordneten Element verschieben",
"spellcheck": "Rechtschreibprüfung",
"spellcheckTip": "Nach der Aktivierung wird die eingebaute Rechtschreibprüfung des Browsers verwendet. Derzeit wird nur die englische Rechtschreibprüfung unterstützt.",
"spellcheckTip": "Wenn aktiviert, wird die im Browser integrierte Rechtschreibprüfung verwendet. Bitte wählen Sie die zu prüfenden Sprachen in den Browsereinstellungen aus",
"spellcheckTip2": "Wenn aktiviert, wird die integrierte Rechtschreibprüfung verwendet. Bitte wählen Sie die zu prüfenden Sprachen aus der folgenden Liste",
"over": "über",
"preview": "Export Vorschau",
"desktop": "Desktop",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "List outline outdent",
"outlineOutdentTip": "When enabled, the outdent will be using the list outline logic, i.e. moving the list items below the parent",
"spellcheck": "Spell Check",
"spellcheckTip": "When enabled, the browser's built-in spell check function will be used. Currently, only English spell check is supported",
"spellcheckTip": "When enabled, the browser's built-in spellcheck will be used. Please select the languages to check in your browser settings",
"spellcheckTip2": "When enabled, the built-in spellcheck will be used. Please select the languages to check from the list below",
"over": "over",
"preview": "Export Preview",
"desktop": "Desktop",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Lista de contorno sin sangría",
"outlineOutdentTip": "Después de habilitar, el outdent utilizará la lógica de esquema de la lista, es decir, moviendo los elementos de la lista debajo del padre",
"spellcheck": "Corrección ortográfica",
"spellcheckTip": "Después de habilitar, se utilizará la función de revisión ortográfica integrada del navegador. Actualmente, solo se admite la revisión ortográfica en inglés",
"spellcheckTip": "Al activarlo se usará el corrector ortográfico integrado del navegador. Por favor, seleccione los idiomas a comprobar en la configuración del navegador",
"spellcheckTip2": "Al activarlo se usará el corrector ortográfico integrado. Por favor, seleccione los idiomas a comprobar en la lista de abajo",
"over": "sobre",
"preview": "Vista previa de la exportación",
"desktop": "Escritorio",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Liste des retraits excessifs du contour",
"outlineOutdentTip": "Après l'activation, le retrait négatif utilisera la logique de contour de la liste, c'est-à-dire en déplaçant les éléments de la liste sous le parent",
"spellcheck": "Vérification orthographique",
"spellcheckTip": "Après l'activation, la fonction de vérification orthographique intégrée du navigateur sera utilisée. Actuellement, seule la vérification orthographique en anglais est prise en charge",
"spellcheckTip": "Si activé, la vérification orthographique intégrée du navigateur sera utilisée. Veuillez choisir les langues à vérifier dans les paramètres du navigateur",
"spellcheckTip2": "Si activé, la vérification orthographique intégrée sera utilisée. Veuillez choisir les langues à vérifier dans la liste ci-dessous",
"over": "over",
"preview": "Aperçu de l'exportation",
"desktop": "bureau",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "הפחתה ברשימה החיצונית",
"outlineOutdentTip": "לאחר הפעלת אפשרות זו, ההפחתה תשתמש בלוגיקת רשימת תווי, כלומר העברת פריטי הרשימה מתחת להורה",
"spellcheck": "בדיקת איות",
"spellcheckTip": "לאחר הפעלת אפשרות זו, תשתמש בפונקציית בדיקת האיות המובנית בדפדפן. כרגע, רק בדיקת האיות באנגלית נתמכת",
"spellcheckTip": "בהפעלה ייעשה שימוש בבדיקת האיות המובנית בדפדפן. בחר את השפות לבדיקה בהגדרות הדפדפן",
"spellcheckTip2": "בהפעלה ייעשה שימוש בבדיקת האיות המובנית. בחר את השפות לבדיקה מהרשימה למטה",
"over": "מעבר",
"preview": "תצוגה מקדימה לייצוא",
"desktop": "דסקטופ",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Riduci rientro elenco struttura",
"outlineOutdentTip": "Dopo l'abilitazione, il riduci rientro utilizzerà la logica di struttura dell'elenco, ovvero spostando gli elementi dell'elenco sotto il genitore",
"spellcheck": "Controllo ortografico",
"spellcheckTip": "Dopo l'abilitazione, verrà utilizzata la funzione di controllo ortografico integrata del browser. Attualmente, supporta solo l'inglese",
"spellcheckTip": "Se abilitato, verrà utilizzato il correttore ortografico integrato del browser. Seleziona le lingue da controllare nelle impostazioni del browser",
"spellcheckTip2": "Se abilitato, verrà utilizzato il correttore ortografico integrato. Seleziona le lingue da controllare dall'elenco sottostante",
"over": "terminato",
"preview": "Anteprima esportazione",
"desktop": "Desktop",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "リストのアウトラインアウトデント",
"outlineOutdentTip": "リスト項目にアウトラインロジックを使用してアウトデントします",
"spellcheck": "スペルチェック",
"spellcheckTip": "ブラウザの組み込みスペルチェック機能を使用します。現時点では英語のスペルチェックのみがサポートされています",
"spellcheckTip": "有効にすると、ブラウザ内蔵のスペルチェック機能を使用します。ブラウザの設定でチェックする言語を選択してください",
"spellcheckTip2": "有効にすると、内蔵のスペルチェック機能を使用します。以下の一覧からチェックする言語を選択してください",
"over": "以上",
"preview": "プレビュー",
"desktop": "デスクトップ",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "목록 개요 내어쓰기",
"outlineOutdentTip": "활성화하면 목록 개요 로직을 사용하여 내어쓰기합니다. 즉, 목록 항목을 상위 항목 아래로 이동합니다",
"spellcheck": "맞춤법 검사",
"spellcheckTip": "활성화하면 브라우저의 내장 맞춤법 검사 기능이 사용됩니다. 현재 영어 맞춤법 검사만 지원됩니다",
"spellcheckTip": "활성화하면 브라우저에 내장된 맞춤법 검사 기능을 사용합니다. 브라우저 설정에서 검사할 언어를 선택하세요",
"spellcheckTip2": "활성화하면 내장 맞춤법 검사 기능을 사용합니다. 아래 목록에서 검사할 언어를 선택하세요",
"over": "초과",
"preview": "내보내기 미리보기",
"desktop": "데스크톱",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Zwiń zarys listy",
"outlineOutdentTip": "Po włączeniu, zwijanie będzie używać logiki zarysu listy, czyli przeniesienie elementów listy poniżej rodzica",
"spellcheck": "Sprawdzanie pisowni",
"spellcheckTip": "Po włączeniu zostanie użyta wbudowana funkcja sprawdzania pisowni przeglądarki. Obecnie obsługiwane jest tylko sprawdzanie pisowni w języku angielskim",
"spellcheckTip": "Po włączeniu będzie używana wbudowana w przeglądarkę kontrola pisowni. Proszę wybrać języki do sprawdzania w ustawieniach przeglądarki",
"spellcheckTip2": "Po włączeniu będzie używana wbudowana kontrola pisowni. Proszę wybrać języki do sprawdzania z poniższej listy",
"over": "ponad",
"preview": "Podgląd eksportu",
"desktop": "Desktop",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Recuo negativo de lista",
"outlineOutdentTip": "Quando ativado, o recuo negativo usará a lógica de esboço de lista, ou seja, movendo os itens da lista abaixo do pai",
"spellcheck": "Verificação Ortográfica",
"spellcheckTip": "Quando ativado, usará a função de verificação ortográfica incorporada do navegador. Atualmente, apenas a verificação ortográfica em inglês é suportada",
"spellcheckTip": "Ao ativar, será utilizado o corretor ortográfico embutido no navegador. Por favor, escolha os idiomas a verificar nas configurações do navegador",
"spellcheckTip2": "Ao ativar, será utilizado o corretor ortográfico embutido. Por favor, escolha os idiomas a verificar na lista abaixo",
"over": "sobre",
"preview": "Pré-visualização de Exportação",
"desktop": "Área de Trabalho",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "Список уменьшить отступ",
"outlineOutdentTip": "После включения уменьшение отступа будет использовать логику списка, то есть перемещение элементов списка ниже родителя",
"spellcheck": "Проверка орфографии",
"spellcheckTip": "После включения будет использоваться встроенная функция проверки орфографии браузера. В настоящее время поддерживается только проверка орфографии на английском языке",
"spellcheckTip": "После включения будет использоваться встроенная в браузер проверка орфографии. Пожалуйста, выберите языки проверки в настройках браузера",
"spellcheckTip2": "После включения будет использоваться встроенная проверка орфографии. Пожалуйста, выберите языки проверки из списка ниже",
"over": "над",
"preview": "Предварительный экспорт",
"desktop": "Рабочий стол",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "列表大綱反向縮進",
"outlineOutdentTip": "啟用後將使用列表大綱式邏輯反向縮進,即將列表項移動到父級下方",
"spellcheck": "拼寫檢查",
"spellcheckTip": "啟用後將使用瀏覽器內置的拼寫檢查功能,目前僅支持英文拼寫檢查",
"spellcheckTip": "啟用後將使用瀏覽器內建的拼寫檢查功能,請從瀏覽器設定中選擇需要檢查的語言",
"spellcheckTip2": "啟用後將使用內建的拼寫檢查功能,請從下面的列表中選擇需要檢查的語言",
"over": "超過",
"preview": "匯出預覽",
"desktop": "桌面",

View file

@ -1338,7 +1338,8 @@
"outlineOutdent": "列表大纲反向缩进",
"outlineOutdentTip": "启用后将使用列表大纲式逻辑反向缩进,即将列表项移动到父级下方",
"spellcheck": "拼写检查",
"spellcheckTip": "启用后将使用浏览器内置的拼写检查功能,目前仅支持英文拼写检查",
"spellcheckTip": "启用后将使用浏览器内置的拼写检查功能,请从浏览器设置中选择需要检查的语言",
"spellcheckTip2": "启用后将使用内置的拼写检查功能,请从下面的列表中选择需要检查的语言",
"over": "超过",
"preview": "导出预览",
"desktop": "桌面",

View file

@ -225,10 +225,16 @@ export const afterLoadPlugin = (plugin: Plugin) => {
export const reloadPlugin = async (app: App, data: {
upsertCodePlugins?: string[],
upsertDataPlugins?: string[],
removePlugins?: string[]
unloadPlugins?: string[],
uninstallPlugins?: string[],
} = {}) => {
const {upsertCodePlugins = [], upsertDataPlugins = [], removePlugins = []} = data;
removePlugins.forEach((item) => {
const {upsertCodePlugins = [], upsertDataPlugins = [], unloadPlugins = [], uninstallPlugins = []} = data;
// 禁用
unloadPlugins.forEach((item) => {
uninstall(app, item, true);
});
// 卸载
uninstallPlugins.forEach((item) => {
uninstall(app, item, false);
});
upsertCodePlugins.forEach((item) => {

View file

@ -68,9 +68,9 @@ func setPetalEnabled(c *gin.Context) {
}
if enabled {
upsertPluginCodeSet := hashset.New(packageName)
model.PushReloadPlugin(upsertPluginCodeSet, nil, nil, app)
model.PushReloadPlugin(upsertPluginCodeSet, nil, nil, nil, app)
} else {
removePluginSet := hashset.New(packageName)
model.PushReloadPlugin(nil, nil, removePluginSet, app)
unloadPluginSet := hashset.New(packageName)
model.PushReloadPlugin(nil, nil, unloadPluginSet, nil, app)
}
}

View file

@ -256,8 +256,8 @@ func UninstallBazaarPlugin(pluginName, frontend string) error {
petals = tmp
savePetals(petals)
removePluginSet := hashset.New(pluginName)
PushReloadPlugin(nil, nil, removePluginSet, "")
uninstallPluginSet := hashset.New(pluginName)
PushReloadPlugin(nil, nil, nil, uninstallPluginSet, "")
return nil
}

View file

@ -38,11 +38,25 @@ import (
"github.com/siyuan-note/siyuan/kernel/util"
)
func PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, removePluginNameSet *hashset.Set, excludeApp string) {
if nil != removePluginNameSet {
for _, n := range removePluginNameSet.Values() {
func PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, unloadPluginNameSet, uninstallPluginNameSet *hashset.Set, excludeApp string) {
// 集合去重
if nil != uninstallPluginNameSet {
for _, n := range uninstallPluginNameSet.Values() {
pluginName := n.(string)
if nil != upsertCodePluginSet {
upsertCodePluginSet.Remove(pluginName)
}
if nil != upsertDataPluginSet {
upsertDataPluginSet.Remove(pluginName)
}
if nil != unloadPluginNameSet {
unloadPluginNameSet.Remove(pluginName)
}
}
}
if nil != unloadPluginNameSet {
for _, n := range unloadPluginNameSet.Values() {
pluginName := n.(string)
// 如果插件在 removePluginSet 中,从其他集合中移除
if nil != upsertCodePluginSet {
upsertCodePluginSet.Remove(pluginName)
}
@ -54,14 +68,13 @@ func PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, removePluginName
if nil != upsertCodePluginSet {
for _, n := range upsertCodePluginSet.Values() {
pluginName := n.(string)
// 如果插件在 upsertCodePluginSet 中,从 upsertDataPluginSet 中移除
if nil != upsertDataPluginSet {
upsertDataPluginSet.Remove(pluginName)
}
}
}
upsertCodePlugins, upsertDataPlugins, removePlugins := []string{}, []string{}, []string{}
upsertCodePlugins, upsertDataPlugins, unloadPlugins, uninstallPlugins := []string{}, []string{}, []string{}, []string{}
if nil != upsertCodePluginSet {
for _, n := range upsertCodePluginSet.Values() {
upsertCodePlugins = append(upsertCodePlugins, n.(string))
@ -72,22 +85,28 @@ func PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, removePluginName
upsertDataPlugins = append(upsertDataPlugins, n.(string))
}
}
if nil != removePluginNameSet {
for _, n := range removePluginNameSet.Values() {
removePlugins = append(removePlugins, n.(string))
if nil != unloadPluginNameSet {
for _, n := range unloadPluginNameSet.Values() {
unloadPlugins = append(unloadPlugins, n.(string))
}
}
if nil != uninstallPluginNameSet {
for _, n := range uninstallPluginNameSet.Values() {
uninstallPlugins = append(uninstallPlugins, n.(string))
}
}
pushReloadPlugin0(upsertCodePlugins, upsertDataPlugins, removePlugins, excludeApp)
pushReloadPlugin0(upsertCodePlugins, upsertDataPlugins, unloadPlugins, uninstallPlugins, excludeApp)
}
func pushReloadPlugin0(upsertCodePlugins, upsertDataPlugins, removePlugins []string, excludeApp string) {
logging.LogInfof("reload plugins [codeChanges=%v, dataChanges=%v, removes=%v]", upsertCodePlugins, upsertDataPlugins, removePlugins)
func pushReloadPlugin0(upsertCodePlugins, upsertDataPlugins, unloadPlugins, uninstallPlugins []string, excludeApp string) {
logging.LogInfof("reload plugins [codeChanges=%v, dataChanges=%v, unloads=%v, uninstalls=%v]", upsertCodePlugins, upsertDataPlugins, unloadPlugins, uninstallPlugins)
if "" == excludeApp {
util.BroadcastByType("main", "reloadPlugin", 0, "", map[string]interface{}{
"upsertCodePlugins": upsertCodePlugins,
"upsertDataPlugins": upsertDataPlugins,
"removePlugins": removePlugins,
"unloadPlugins": unloadPlugins,
"uninstallPlugins": uninstallPlugins,
})
return
}
@ -95,7 +114,8 @@ func pushReloadPlugin0(upsertCodePlugins, upsertDataPlugins, removePlugins []str
util.BroadcastByTypeAndExcludeApp(excludeApp, "main", "reloadPlugin", 0, "", map[string]interface{}{
"upsertCodePlugins": upsertCodePlugins,
"upsertDataPlugins": upsertDataPlugins,
"removePlugins": removePlugins,
"unloadPlugins": unloadPlugins,
"uninstallPlugins": uninstallPlugins,
})
}

View file

@ -1635,7 +1635,7 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
}
}
removeWidgetDirSet, removePluginSet := hashset.New(), hashset.New()
removeWidgetDirSet, unloadPluginSet, uninstallPluginSet := hashset.New(), hashset.New(), hashset.New()
for _, file := range mergeResult.Removes {
removes = append(removes, file.Path)
if strings.HasPrefix(file.Path, "/storage/riff/") {
@ -1664,7 +1664,8 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
if strings.HasPrefix(file.Path, "/plugins/") {
if parts := strings.Split(file.Path, "/"); 2 < len(parts) {
needReloadPlugin = true
removePluginSet.Add(parts[2])
// 删除插件目录:卸载
uninstallPluginSet.Add(parts[2])
}
}
@ -1681,7 +1682,8 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
}
for _, removePetal := range mergeResult.RemovePetals {
needReloadPlugin = true
removePluginSet.Add(removePetal)
// Petal 中删除插件:卸载
uninstallPluginSet.Add(removePetal)
}
if needReloadFlashcard {
@ -1693,7 +1695,7 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
}
if needReloadPlugin {
PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, removePluginSet, "")
PushReloadPlugin(upsertCodePluginSet, upsertDataPluginSet, unloadPluginSet, uninstallPluginSet, "")
}
for _, widgetDir := range removeWidgetDirSet.Values() {