Merge pull request #3442 from penpot/eva-bugfixing-11

Bugfixing
This commit is contained in:
Aitor Moreno 2023-07-25 17:42:05 +02:00 committed by GitHub
commit 08a11929ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 59 additions and 5 deletions

View file

@ -89,7 +89,9 @@
- Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656) - Fix when user deletes one file during import it is impossible to finish importing of second file [Taiga #5656](https://tree.taiga.io/project/penpot/issue/5656)
- Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649) - Fix export multiple images when only one of them has export settings [Taiga #5649](https://tree.taiga.io/project/penpot/issue/5649)
- Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647) - Fix error when a user different than the thread creator edits a comment [Taiga #5647](https://tree.taiga.io/project/penpot/issue/5647)
- Fix unnecessary button [Taiga #3312](https://tree.taiga.io/project/penpot/issue/3312)
- Fix copy color information in several formats [Taiga #4723](https://tree.taiga.io/project/penpot/issue/4723)
- Fix dropdown width [Taiga #5541](https://tree.taiga.io/project/penpot/issue/5541)
### :arrow_up: Deps updates ### :arrow_up: Deps updates
- Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592) - Update google fonts catalog (at 2023/07/06) [Taiga #5592](https://tree.taiga.io/project/penpot/issue/5592)

View file

@ -752,6 +752,12 @@
[key (delay (generator-fn key))])) [key (delay (generator-fn key))]))
keys)) keys))
(defn opacity-to-hex [opacity]
(let [opacity (* opacity 255)
value (mth/round opacity)]
(.. value
(toString 16)
(padStart 2 "0"))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; String Functions ;; String Functions

View file

@ -316,6 +316,22 @@
&:hover { &:hover {
border: 1px solid $color-gray-20; border: 1px solid $color-gray-20;
} }
&.no-check {
.custom-select-dropdown {
width: 100%;
min-width: unset;
.check-icon {
display: none;
}
li.checked-element {
padding-left: 0.5rem;
&.is-selected {
background-color: $color-primary;
}
}
}
}
} }
.opened { .opened {
border: 1px solid $color-primary; border: 1px solid $color-primary;

View file

@ -214,7 +214,11 @@
:select-on-focus true :select-on-focus true
:on-change on-change}] :on-change on-change}]
[:div.buttons [:div.buttons
[:input.btn-primary {:type "button" :value "Post" :on-click on-submit*}] [:input.btn-primary {:type "button"
:value "Post"
:on-click on-submit*
:disabled (or (fm/all-spaces? @content)
(str/empty-or-nil? @content))}]
[:input.btn-secondary {:type "button" :value "Cancel" :on-click on-cancel}]]])) [:input.btn-secondary {:type "button" :value "Cancel" :on-click on-cancel}]]]))
(mf/defc comment-item (mf/defc comment-item

View file

@ -400,7 +400,7 @@
[:div.modal-footer [:div.modal-footer
[:div.action-buttons [:div.action-buttons
(when (or (= :analyzing (:status @state)) pending-import?) (when (= :analyzing (:status @state))
[:input.cancel-button [:input.cancel-button
{:type "button" {:type "button"
:value (tr "labels.cancel") :value (tr "labels.cancel")

View file

@ -35,6 +35,13 @@
{:to-prop "background" {:to-prop "background"
:format #(uc/color->background (shape->color shape))})) :format #(uc/color->background (shape->color shape))}))
(defn copy-data-format [shape format]
(cg/generate-css-props
shape
fill-attributes
{:to-prop "background-color"
:format #(uc/color->format->background (shape->color shape) format)}))
(mf/defc fill-block [{:keys [shape]}] (mf/defc fill-block [{:keys [shape]}]
(let [color-format (mf/use-state :hex) (let [color-format (mf/use-state :hex)
color (shape->color shape)] color (shape->color shape)]
@ -43,7 +50,7 @@
[:& color-row {:color color [:& color-row {:color color
:format @color-format :format @color-format
:on-change-format #(reset! color-format %) :on-change-format #(reset! color-format %)
:copy-data (copy-data shape)}]])) :copy-data (copy-data-format shape @color-format)}]]))
(mf/defc fill-panel (mf/defc fill-panel
[{:keys [shapes]}] [{:keys [shapes]}]

View file

@ -152,7 +152,7 @@
[:div.element-set-content [:div.element-set-content
[:div.row-flex [:div.row-flex
[:& select [:& select
{:class "flex-grow" {:class "flex-grow no-check"
:default-value selected-blend-mode :default-value selected-blend-mode
:options options :options options
:on-change handle-change-blend-mode :on-change handle-change-blend-mode

View file

@ -7,6 +7,7 @@
(ns app.util.color (ns app.util.color
"Color conversion utils." "Color conversion utils."
(:require (:require
[app.common.data :as d]
[app.util.i18n :as i18n :refer [tr]] [app.util.i18n :as i18n :refer [tr]]
[app.util.object :as obj] [app.util.object :as obj]
[app.util.strings :as ust] [app.util.strings :as ust]
@ -150,6 +151,24 @@
:else "transparent"))) :else "transparent")))
(defn color->format->background [{:keys [color opacity gradient]} format]
(let [opacity (or opacity 1)]
(cond
(and gradient (not= :multiple gradient))
(gradient->css gradient)
(not= color :multiple)
(case format
:rgba (let [[r g b] (hex->rgb color)]
(str/fmt "rgba(%s, %s, %s, %s)" r g b opacity))
:hsla (let [[h s l] (hex->hsl color)]
(str/fmt "hsla(%s, %s, %s, %s)" h (* 100 s) (* 100 l) opacity))
:hex (str color (str/upper (d/opacity-to-hex opacity))))
:else "transparent")))
(defn multiple? [{:keys [id file-id value color gradient]}] (defn multiple? [{:keys [id file-id value color gradient]}]
(or (= value :multiple) (or (= value :multiple)
(= color :multiple) (= color :multiple)