浏览代码

enhance(plugin): polish marketplace ui

charlie 4 年之前
父节点
当前提交
d456ed7823

+ 4 - 0
resources/marketplace.html

@@ -39,6 +39,10 @@
       padding-top: 30vh;
       padding-top: 30vh;
       font-weight: 400;
       font-weight: 400;
     }
     }
+
+    pre {
+      max-width: 800px;
+    }
   </style>
   </style>
 </head>
 </head>
 <body>
 <body>

+ 17 - 5
src/main/frontend/components/plugins.cljs

@@ -308,11 +308,23 @@
 
 
       [:div.cp__plugins-installed
       [:div.cp__plugins-installed
        [:div.mb-4.flex.items-center.justify-between
        [:div.mb-4.flex.items-center.justify-between
-        (ui/button
-          (t :plugin/load-unpacked)
-          :intent "logseq"
-          :on-click plugin-handler/load-unpacked-plugin)
-        (unpacked-plugin-loader selected-unpacked-pkg)
+
+        [:div.flex.align-items
+         (ui/button
+           (t :plugin/load-unpacked)
+           :title (t :plugin/unpacked-tips)
+           :intent "logseq"
+           :on-click plugin-handler/load-unpacked-plugin)
+
+         (ui/button
+           [:span.flex.items-center
+            [:i {:style {:transform "scale(.8)"}} svg/external-link] "Samples for Developer"]
+           :class "ml-2"
+           :intent "logseq"
+           :on-click #(plugin-handler/invoke-exported-api
+                        "open_external_link" "https://github.com/logseq/logseq-plugin-samples"))
+
+         (unpacked-plugin-loader selected-unpacked-pkg)]
 
 
         (when (util/electron?)
         (when (util/electron?)
           [:div.flex.align-items
           [:div.flex.align-items

+ 1 - 1
src/main/frontend/components/plugins.css

@@ -78,7 +78,7 @@
 
 
       > p {
       > p {
         color: var(--ls-primary-text-color);
         color: var(--ls-primary-text-color);
-        opacity: .3;
+        opacity: .5;
 
 
         > small:last-child {
         > small:last-child {
           cursor: pointer;
           cursor: pointer;

+ 4 - 2
src/main/frontend/dicts.cljs

@@ -325,8 +325,9 @@
         :plugin/open-package "Open package"
         :plugin/open-package "Open package"
         :plugin/load-unpacked "Load unpacked plugin"
         :plugin/load-unpacked "Load unpacked plugin"
         :plugin/open-preferences "Open plugin preferences file"
         :plugin/open-preferences "Open plugin preferences file"
-        :plugin/restart "Restart"
+        :plugin/restart "Restart App"
         :plugin/marketplace-tips "If the plugin you installed from marketplace for the first time not work properly, you could try to restart the application."
         :plugin/marketplace-tips "If the plugin you installed from marketplace for the first time not work properly, you could try to restart the application."
+        :plugin/unpacked-tips "For development purposes or to load the trusted community plugin from local disk."
         :plugin/up-to-date "It's up to date"
         :plugin/up-to-date "It's up to date"
 
 
         :pdf/copy-ref "Copy ref"
         :pdf/copy-ref "Copy ref"
@@ -1017,10 +1018,11 @@
            :plugin/marketplace "插件市场"
            :plugin/marketplace "插件市场"
            :plugin/open-settings "打开配置项"
            :plugin/open-settings "打开配置项"
            :plugin/open-package "打开包目录"
            :plugin/open-package "打开包目录"
-           :plugin/load-unpacked "手动载入外部插件"
+           :plugin/load-unpacked "手动载入插件"
            :plugin/open-preferences "打开预设配置文件"
            :plugin/open-preferences "打开预设配置文件"
            :plugin/restart "重启应用"
            :plugin/restart "重启应用"
            :plugin/marketplace-tips "如果首次从市场安装或更新的插件,遇到非预期工作情况,可以尝试重启应用。"
            :plugin/marketplace-tips "如果首次从市场安装或更新的插件,遇到非预期工作情况,可以尝试重启应用。"
+           :plugin/unpacked-tips "用于开发目的或者从本地磁盘载入可信的社区插件。"
            :plugin/up-to-date "已经是最新了"
            :plugin/up-to-date "已经是最新了"
 
 
            :pdf/copy-ref "复制引用"
            :pdf/copy-ref "复制引用"

+ 11 - 0
src/main/frontend/ui.css

@@ -152,6 +152,17 @@
     }
     }
   }
   }
 
 
+  &[intent='link'] {
+    @apply focus:border-gray-500 dark:hover:text-gray-200;
+
+    color: var(--ls-primary-text-color);
+    background: transparent;
+
+    &:hover {
+      color: var(--ls-link-text-color);
+    }
+  }
+
   &.p-1 {
   &.p-1 {
     padding: 0.25rem 0.5rem !important;
     padding: 0.25rem 0.5rem !important;
   }
   }