Browse Source

fix: code block bottom space

Tienson Qin 9 months ago
parent
commit
25ba3e6b7d

+ 1 - 1
deps/db/src/logseq/db/common/sqlite.cljs

@@ -182,7 +182,7 @@
                                              (:block/_parent block))))
                                        (remove (fn [e] (or (:logseq.property/created-from-property e)
                                                            (:block/closed-value-property e)))))
-                             children-props (or children-props [:db/id :block/uuid :block/parent :block/order :block/collapsed? :block/title :logseq.task/status])]
+                             children-props (or children-props [:db/id :block/uuid :block/parent :block/order :block/collapsed? :block/title :logseq.task/status :logseq.property.node/display-type])]
                          (map
                           (fn [block]
                             (if (= children-props '[*])

+ 3 - 3
src/main/frontend/components/block.cljs

@@ -3954,10 +3954,10 @@
             [:div.ui-fenced-code-editor.flex.w-full
              {:ref (fn [el]
                      (set-inside-portal? (and el (whiteboard-handler/inside-portal? el))))
-              :on-mouse-over #(dom/add-class! (hooks/deref *actions-ref) "opacity-100")
+              :on-mouse-over #(dom/add-class! (hooks/deref *actions-ref) "!opacity-100")
               :on-mouse-leave (fn [e]
                                 (when (dom/has-class? (.-target e) "code-editor")
-                                  (dom/remove-class! (hooks/deref *actions-ref) "opacity-100")))}
+                                  (dom/remove-class! (hooks/deref *actions-ref) "!opacity-100")))}
              (cond
                (nil? inside-portal?) nil
 
@@ -3969,7 +3969,7 @@
 
                :else
                [:div.ls-code-editor-wrap
-                [:div.code-block-actions.flex.flex-row.gap-1.opacity-0.transition-opacity.ease-in.duration-300
+                [:div.code-block-actions
                  {:ref *actions-ref}
                  (shui/button
                   {:variant :text

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

@@ -1036,7 +1036,7 @@ html.is-mac {
   }
 
   > .code-block-actions {
-    @apply absolute right-1 top-1 select-none z-[1] text-xs bg-gray-01;
+    @apply flex flex-row gap-1 opacity-0 transition-opacity ease-in duration-300 absolute right-1 top-1 select-none z-[1] text-xs bg-gray-01;
 
     button {
       @apply !py-0 h-4 text-muted-foreground hover:text-foreground text-xs px-1;

+ 1 - 1
src/main/frontend/extensions/code.cljs

@@ -549,7 +549,7 @@
                            (fn [e]
                              (.stopPropagation e)))
         (.save editor)
-        (.setSize editor "100%" 600)
+        (.setSize editor "100%" 1024)
         (.refresh editor)))
     editor))
 

+ 0 - 5
src/main/frontend/extensions/code.css

@@ -45,11 +45,6 @@
   border-radius: 2px;
   line-height: 1.45em;
 
-  &-scroll {
-    padding-top: 14px;
-    padding-bottom: 62px;
-  }
-
   &:not(.CodeMirror-focused) {
     .CodeMirror-activeline-background {
       background: unset !important;