Merge pull request #4350 from penpot/alotor-bugfix-36

Bugfixes
This commit is contained in:
Eva Marco 2024-04-04 12:30:40 +02:00 committed by GitHub
commit 7e398515d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 41 additions and 18 deletions

View file

@ -299,12 +299,16 @@
(cond-> shape (cond-> shape
(neg? dot-x) (neg? dot-x)
(-> (cr/update! :flip-x not) (cr/update! :flip-x not)
(cr/update! :rotation -))
(neg? dot-x)
(cr/update! :rotation -)
(neg? dot-y) (neg? dot-y)
(-> (cr/update! :flip-y not) (cr/update! :flip-y not)
(cr/update! :rotation -)))))
(neg? dot-y)
(cr/update! :rotation -))))
(defn- apply-transform-move (defn- apply-transform-move
"Given a new set of points transformed, set up the rectangle so it keeps "Given a new set of points transformed, set up the rectangle so it keeps

View file

@ -31,7 +31,7 @@
[app.common.uuid :as uuid] [app.common.uuid :as uuid]
[clojure.set :as set])) [clojure.set :as set]))
(cr/defrecord Shape [id name type x y width height rotation selrect points transform transform-inverse parent-id frame-id]) (cr/defrecord Shape [id name type x y width height rotation selrect points transform transform-inverse parent-id frame-id flip-x flip-y])
(defn shape? (defn shape?
[o] [o]

View file

@ -249,14 +249,16 @@
ptk/UpdateEvent ptk/UpdateEvent
(update [_ state] (update [_ state]
(d/update-in-when state [:comments thread-id id] assoc :content content)) (-> state
(d/update-in-when [:comments thread-id id] assoc :content content)))
ptk/WatchEvent ptk/WatchEvent
(watch [_ state _] (watch [_ state _]
(let [share-id (-> state :viewer-local :share-id)] (let [file-id (:current-file-id state)
share-id (-> state :viewer-local :share-id)]
(->> (rp/cmd! :update-comment {:id id :content content :share-id share-id}) (->> (rp/cmd! :update-comment {:id id :content content :share-id share-id})
(rx/catch #(rx/throw {:type :comment-error})) (rx/catch #(rx/throw {:type :comment-error}))
(rx/ignore)))))) (rx/map #(retrieve-comment-threads file-id)))))))
(defn delete-comment-thread-on-workspace (defn delete-comment-thread-on-workspace
[{:keys [id] :as thread}] [{:keys [id] :as thread}]

View file

@ -66,8 +66,7 @@
&:hover { &:hover {
.cell-name { .cell-name {
display: grid; display: block;
grid-template-columns: 1fr auto;
} }
} }

View file

@ -144,7 +144,10 @@
(conj :rect :circle :path :bool))] (conj :rect :circle :path :bool))]
(or (= uuid/zero id) (or (= uuid/zero id)
(and (or (str/includes? (str/lower (:name shape)) (str/lower search)) (and (or (str/includes? (str/lower (:name shape)) (str/lower search))
(str/includes? (dm/str (:id shape)) (str/lower search))) ;; Only for local development we allow search for ids. Otherwise will be hard
;; search for numbers or single letter shape names (ie: "A")
(and *assert*
(str/includes? (dm/str (:id shape)) (str/lower search))))
(or (empty? filters) (or (empty? filters)
(and (contains? filters :component) (and (contains? filters :component)
(contains? shape :component-id)) (contains? shape :component-id))

View file

@ -616,9 +616,10 @@
[:div {:class (stl/css :name-wrapper)} [:div {:class (stl/css :name-wrapper)}
[:div {:class (stl/css :component-name)} [:div {:class (stl/css :component-name)}
(if multi [:span {:class (stl/css :component-name-inside)}
(tr "settings.multiple") (if multi
(cfh/last-path shape-name))] (tr "settings.multiple")
(cfh/last-path shape-name))]]
(when (and can-swap? (not multi)) (when (and can-swap? (not multi))
[:div {:class (stl/css :component-parent-name)} [:div {:class (stl/css :component-parent-name)}

View file

@ -56,7 +56,6 @@
padding-right: 0.5rem; padding-right: 0.5rem;
.component-name-wrapper { .component-name-wrapper {
width: 100%; width: 100%;
border-radius: $br-8; border-radius: $br-8;
} }
} }
@ -93,6 +92,7 @@
min-height: $s-32; min-height: $s-32;
padding: $s-8 0 $s-8 $s-2; padding: $s-8 0 $s-8 $s-2;
border-radius: $br-8 0 0 $br-8; border-radius: $br-8 0 0 $br-8;
overflow: hidden;
} }
.component-name { .component-name {
@ -103,6 +103,11 @@
min-height: $s-16; min-height: $s-16;
} }
.component-name-inside {
direction: ltr;
unicode-bidi: bidi-override;
}
.component-parent-name { .component-parent-name {
@include bodySmallTypography; @include bodySmallTypography;
@include textEllipsis; @include textEllipsis;

View file

@ -189,6 +189,7 @@
;; shortcuts.unmask ;; shortcuts.unmask
;; shortcuts.v-distribute ;; shortcuts.v-distribute
;; shortcuts.zoom-selected ;; shortcuts.zoom-selected
;; shortcuts.toggle-layout-grid
(let [translat-pre (case type (let [translat-pre (case type
:sc "shortcuts." :sc "shortcuts."
:sec "shortcut-section." :sec "shortcut-section."

View file

@ -335,8 +335,8 @@
flip-x (get shape :flip-x) flip-x (get shape :flip-x)
flip-y (get shape :flip-y) flip-y (get shape :flip-y)
half-flip? (or (and (some? flip-x) (not (some? flip-y))) half-flip? (or (and flip-x (not flip-y))
(and (some? flip-y) (not (some? flip-x))))] (and flip-y (not flip-x)))]
(when (and (not ^boolean read-only?) (when (and (not ^boolean read-only?)
(not (:transforming shape)) (not (:transforming shape))
@ -357,7 +357,7 @@
(and ^boolean half-flip? (and ^boolean half-flip?
(or (= position :top-right) (or (= position :top-right)
(= position :bottom-left))) (= position :bottom-left)))
(- rotation 90) (+ rotation 90)
:else :else
rotation) rotation)

View file

@ -20,6 +20,8 @@
:height :size :height :size
:min-width :size :min-width :size
:min-height :size :min-height :size
:max-width :size
:max-height :size
:background :color :background :color
:border :border :border :border
:border-radius :string-or-size-array :border-radius :string-or-size-array

View file

@ -3023,6 +3023,9 @@ msgstr "Zoom lense increase"
msgid "shortcuts.zoom-selected" msgid "shortcuts.zoom-selected"
msgstr "Zoom to selected" msgstr "Zoom to selected"
msgid "shortcuts.toggle-layout-grid"
msgstr "Add/remove grid layout"
#: src/app/main/ui/dashboard/team.cljs #: src/app/main/ui/dashboard/team.cljs
msgid "team.webhooks.max-length" msgid "team.webhooks.max-length"
msgstr "The webhook name must contain at most 2048 characters." msgstr "The webhook name must contain at most 2048 characters."

View file

@ -3069,6 +3069,9 @@ msgstr "Incrementar zoom a objetivo"
msgid "shortcuts.zoom-selected" msgid "shortcuts.zoom-selected"
msgstr "Zoom a selección" msgstr "Zoom a selección"
msgid "shortcuts.toggle-layout-grid"
msgstr "Añadir/eliminar grid layout"
#: src/app/main/ui/dashboard/team.cljs #: src/app/main/ui/dashboard/team.cljs
msgid "team.webhooks.max-length" msgid "team.webhooks.max-length"
msgstr "El nombre del webhook debe contener como máximo 2048 caracteres." msgstr "El nombre del webhook debe contener como máximo 2048 caracteres."