Browse Source

enhance(ui): not resizeable image within the positioned property node

charlie 11 tháng trước cách đây
mục cha
commit
a6dbcb155f

+ 5 - 2
src/main/frontend/components/block.cljs

@@ -302,6 +302,7 @@
                    state)}
   [state config title src metadata full-text local?]
   (let [breadcrumb? (:breadcrumb? config)
+        positioned? (:property-position config)
         asset-block (:asset-block config)
         asset-container [:div.asset-container {:key "resize-asset-container"}
                          [:img.rounded-sm.relative
@@ -311,7 +312,8 @@
                             :src src
                             :title title}
                            metadata)]
-                         (when-not breadcrumb?
+                         (when (and (not breadcrumb?)
+                                 (not positioned?))
                            [:<>
                             (let [image-src (fs/asset-path-normalize src)]
                               [:.asset-action-bar {:aria-hidden "true"}
@@ -389,7 +391,8 @@
                   :else
                   {}))
         resizable? (and (not (mobile-util/native-platform?))
-                     (not breadcrumb?))]
+                     (not breadcrumb?)
+                     (not positioned?))]
     (if (or (:disable-resize? config)
           (not resizable?))
       asset-container

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

@@ -872,6 +872,17 @@ html.is-mac {
 .positioned-properties {
   @apply text-sm;
 }
+
+.positioned-properties.block-left {
+  .asset-container {
+    @apply max-w-[120px];
+  }
+
+  .block-title-wrap {
+    @apply hidden;
+  }
+}
+
 .positioned-properties.block-right {
   button {
     @apply whitespace-nowrap mr-0.5;
@@ -965,7 +976,7 @@ html.is-mac {
   .handle-left , .handle-right {
     @apply absolute w-[6px] h-[15%] min-h-[30px] bg-black/30 hover:bg-black/70
     top-[50%] left-[5px] rounded-full cursor-col-resize select-none
-    translate-y-[-20%] opacity-0;
+    translate-y-[-20%] opacity-0 border border-gray-200;
   }
 
   .handle-right {

+ 2 - 1
src/main/frontend/components/property/value.cljs

@@ -774,7 +774,7 @@
             (inline-text {} :markdown (str value'))))))))
 
 (rum/defc select-item
-  [property type value {:keys [page-cp inline-text other-position? _icon?] :as opts}]
+  [property type value {:keys [page-cp inline-text other-position? property-position _icon?] :as opts}]
   (let [closed-values? (seq (:property/closed-values property))
         tag? (or (:tag? opts) (= (:db/ident property) :block/tags))
         inline-text-cp (fn [content]
@@ -799,6 +799,7 @@
          (rum/with-key
            (page-cp {:disable-preview? true
                      :tag? tag?
+                     :property-position property-position
                      :meta-click? other-position?} value)
            (:db/id value)))