Explorar el Código

:art: fix https://github.com/siyuan-note/siyuan/issues/10485

Vanessa hace 1 año
padre
commit
dbc73466c7
Se han modificado 2 ficheros con 13 adiciones y 2 borrados
  1. 2 1
      app/src/assets/scss/mobile.scss
  2. 11 1
      app/src/mobile/util/keyboardToolbar.ts

+ 2 - 1
app/src/assets/scss/mobile.scss

@@ -363,6 +363,8 @@
       box-shadow: inset 0 0 0 .6px var(--b3-theme-on-surface);
       box-shadow: inset 0 0 0 .6px var(--b3-theme-on-surface);
       border: 0;
       border: 0;
       color: var(--b3-theme-on-background);
       color: var(--b3-theme-on-background);
+      min-height: 50px;
+      text-align: left;
     }
     }
 
 
     &-icon {
     &-icon {
@@ -376,7 +378,6 @@
     }
     }
 
 
     &-text {
     &-text {
-      line-height: 48px;
       margin-left: 6px;
       margin-left: 6px;
     }
     }
   }
   }

+ 11 - 1
app/src/mobile/util/keyboardToolbar.ts

@@ -195,6 +195,16 @@ export const renderTextMenu = (protyle: IProtyle, toolbarElement: Element) => {
 const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
 const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
     protyle.hint.splitChar = "/";
     protyle.hint.splitChar = "/";
     protyle.hint.lastIndex = -1;
     protyle.hint.lastIndex = -1;
+    let pluginHTML = ""
+    protyle.app.plugins.forEach((plugin) => {
+        plugin.protyleSlash.forEach(slash => {
+            pluginHTML += getSlashItem(`plugin${Constants.ZWSP}${plugin.name}${Constants.ZWSP}${slash.id}`,
+                "", slash.html, "true");
+        });
+    });
+    if (pluginHTML) {
+        pluginHTML = `<div class="keyboard__slash-title"></div><div class="keyboard__slash-block">${pluginHTML}</div>`
+    }
     const utilElement = toolbarElement.querySelector(".keyboard__util") as HTMLElement;
     const utilElement = toolbarElement.querySelector(".keyboard__util") as HTMLElement;
     utilElement.innerHTML = `<div class="keyboard__slash-title"></div>
     utilElement.innerHTML = `<div class="keyboard__slash-title"></div>
 <div class="keyboard__slash-block">
 <div class="keyboard__slash-block">
@@ -252,7 +262,7 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
     ${getSlashItem(`style${Constants.ZWSP}color: var(--b3-card-warning-color);background-color: var(--b3-card-warning-background);`, '<div style="color: var(--b3-card-warning-color);background-color: var(--b3-card-warning-background);" class="keyboard__slash-icon">A</div>', window.siyuan.languages.warningStyle, "true")}
     ${getSlashItem(`style${Constants.ZWSP}color: var(--b3-card-warning-color);background-color: var(--b3-card-warning-background);`, '<div style="color: var(--b3-card-warning-color);background-color: var(--b3-card-warning-background);" class="keyboard__slash-icon">A</div>', window.siyuan.languages.warningStyle, "true")}
     ${getSlashItem(`style${Constants.ZWSP}color: var(--b3-card-error-color);background-color: var(--b3-card-error-background);`, '<div style="color: var(--b3-card-error-color);background-color: var(--b3-card-error-background);" class="keyboard__slash-icon">A</div>', window.siyuan.languages.errorStyle, "true")}
     ${getSlashItem(`style${Constants.ZWSP}color: var(--b3-card-error-color);background-color: var(--b3-card-error-background);`, '<div style="color: var(--b3-card-error-color);background-color: var(--b3-card-error-background);" class="keyboard__slash-icon">A</div>', window.siyuan.languages.errorStyle, "true")}
     ${getSlashItem(`style${Constants.ZWSP}`, '<div class="keyboard__slash-icon">A</div>', window.siyuan.languages.clearFontStyle, "true")}
     ${getSlashItem(`style${Constants.ZWSP}`, '<div class="keyboard__slash-icon">A</div>', window.siyuan.languages.clearFontStyle, "true")}
-</div>`;
+</div>${pluginHTML}`;
     protyle.hint.bindUploadEvent(protyle, utilElement);
     protyle.hint.bindUploadEvent(protyle, utilElement);
 };
 };