Merge pull request #6689 from penpot/niwinz-staging-add-sr-lang

 Add several fixes & enhancements
This commit is contained in:
Alejandro Alonso 2025-06-16 13:43:24 +02:00 committed by GitHub
commit 10ae4dd3f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 82 additions and 110 deletions

View file

@ -38,6 +38,7 @@ on-premises instances** that want to keep up to date.
- Update google fonts (at 2025/05/19) [Taiga 10792](https://tree.taiga.io/project/penpot/us/10792)
- Add tooltip component to DS [Taiga 9220](https://tree.taiga.io/project/penpot/us/9220)
- Allow multi file token export [Taiga #10144](https://tree.taiga.io/project/penpot/us/10144)
- Add Serbian language
### :bug: Bugs fixed
@ -48,7 +49,8 @@ on-premises instances** that want to keep up to date.
- Fix palette is over sidebar [#11160](https://tree.taiga.io/project/penpot/issue/11160)
- Fix font size input not displaying "mixed" when multiple texts are selected [Taiga #11177](https://tree.taiga.io/project/penpot/issue/11177)
- Misalignments at Create account [Taiga #11315](https://tree.taiga.io/project/penpot/issue/11315)
- Fix issue with importing files where flex/grid is used [Taiga #11334](https://tree.taiga.io/project/penpot/issue/11334)
- Fix wrong color in the export progress bar [Taiga #11299](https://tree.taiga.io/project/penpot/issue/11299)
## 2.7.2

View file

@ -28,7 +28,7 @@
integrant/integrant {:mvn/version "0.13.1"}
funcool/tubax {:mvn/version "2021.05.20-0"}
funcool/cuerdas {:mvn/version "2025.05.26-411"}
funcool/cuerdas {:mvn/version "2025.06.16-414"}
funcool/promesa
{:git/sha "f52f58cfacf62f59eab717e2637f37729d0cc383"
:git/url "https://github.com/funcool/promesa"}

View file

@ -91,10 +91,10 @@
parent-id (or parent-id (get selected-obj :parent-id))
base-parent (get objects parent-id)
layout-props
layout-attrs
(when (and (= 1 (count selected))
(ctl/any-layout? base-parent))
(select-keys selected-obj ctl/layout-item-props))
(select-keys selected-obj ctl/layout-child-attrs))
target-cell-id
(if (and (nil? target-cell-id)
@ -129,8 +129,8 @@
:parent-id parent-id
:shapes (into [] selected))
(some? layout-props)
(d/patch-object layout-props)
(some? layout-attrs)
(d/patch-object layout-attrs)
;; Frames from shapes will not be displayed in viewer and no clipped
(or (not= frame-id uuid/zero) without-fill?)

View file

@ -313,7 +313,7 @@
:title "Shape"}
[:group
[:merge {:title "GroupShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:group-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -321,8 +321,8 @@
[:frame
[:merge {:title "FrameShape"}
ctsl/schema:layout-child-attrs
ctsl/schema:layout-attrs
::ctsl/layout-attrs
schema:frame-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -332,14 +332,14 @@
[:bool
[:merge {:title "BoolShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:bool-attrs
schema:shape-generic-attrs
schema:shape-base-attrs]]
[:rect
[:merge {:title "RectShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:rect-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -347,7 +347,7 @@
[:circle
[:merge {:title "CircleShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:circle-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -355,7 +355,7 @@
[:image
[:merge {:title "ImageShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:image-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -363,7 +363,7 @@
[:svg-raw
[:merge {:title "SvgRawShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:svg-raw-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -371,14 +371,14 @@
[:path
[:merge {:title "PathShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:path-attrs
schema:shape-generic-attrs
schema:shape-base-attrs]]
[:text
[:merge {:title "TextShape"}
ctsl/schema:layout-attrs
ctsl/schema:layout-child-attrs
schema:text-attrs
schema:shape-generic-attrs
schema:shape-geom-attrs
@ -682,23 +682,6 @@
:r3
:r4})
(def ^:private layout-extract-props
#{:layout
:layout-flex-dir
:layout-gap-type
:layout-gap
:layout-wrap-type
:layout-align-items
:layout-align-content
:layout-justify-items
:layout-justify-content
:layout-padding-type
:layout-padding
:layout-grid-dir
:layout-grid-rows
:layout-grid-columns
:layout-grid-cells})
(defn extract-props
"Retrieves an object with the 'pasteable' properties for a shape."
[shape]
@ -729,9 +712,8 @@
(assoc-props node txt/text-node-attrs)))
props)))
(extract-layout-props
[props shape]
(d/patch-object props (select-keys shape layout-extract-props)))]
(extract-layout-attrs [props shape]
(d/patch-object props (select-keys shape ctsl/layout-attrs)))]
(let [;; For texts we don't extract the fill
extract-props
@ -739,7 +721,7 @@
(-> shape
(select-keys extract-props)
(cond-> (cfh/text-shape? shape) (extract-text-props shape))
(cond-> (ctsl/any-layout? shape) (extract-layout-props shape))))))
(cond-> (ctsl/any-layout? shape) (extract-layout-attrs shape))))))
(defn patch-props
"Given the object of `extract-props` applies it to a shape. Adapt the shape if necesary"
@ -764,7 +746,7 @@
(d/patch-object (select-keys props txt/text-node-attrs))))))))))
(patch-layout-props [shape props]
(let [shape (d/patch-object shape (select-keys props layout-extract-props))]
(let [shape (d/patch-object shape (select-keys props ctsl/layout-attrs))]
(cond-> shape
(ctsl/grid-layout? shape)
(ctsl/assign-cells objects))))]

View file

@ -43,7 +43,6 @@
;; :layout-item-absolute ;; boolean
;; :layout-item-z-index ;; int
(def layout-types
#{:flex :grid})
@ -74,49 +73,6 @@
(def justify-items-types
#{:start :end :center :stretch})
(def layout-item-props
[:layout-item-margin
:layout-item-margin-type
:layout-item-h-sizing
:layout-item-v-sizing
:layout-item-max-h
:layout-item-min-h
:layout-item-max-w
:layout-item-min-w
:layout-item-absolute
:layout-item-z-index])
(sm/register!
^{::sm/type ::layout-attrs}
[:map {:title "LayoutAttrs"}
[:layout {:optional true} [::sm/one-of layout-types]]
[:layout-flex-dir {:optional true} [::sm/one-of flex-direction-types]]
[:layout-gap {:optional true}
[:map
[:row-gap {:optional true} ::sm/safe-number]
[:column-gap {:optional true} ::sm/safe-number]]]
[:layout-gap-type {:optional true} [::sm/one-of gap-types]]
[:layout-wrap-type {:optional true} [::sm/one-of wrap-types]]
[:layout-padding-type {:optional true} [::sm/one-of padding-type]]
[:layout-padding {:optional true}
[:map
[:p1 ::sm/safe-number]
[:p2 ::sm/safe-number]
[:p3 ::sm/safe-number]
[:p4 ::sm/safe-number]]]
[:layout-justify-content {:optional true} [::sm/one-of justify-content-types]]
[:layout-justify-items {:optional true} [::sm/one-of justify-items-types]]
[:layout-align-content {:optional true} [::sm/one-of align-content-types]]
[:layout-align-items {:optional true} [::sm/one-of align-items-types]]
[:layout-grid-dir {:optional true} [::sm/one-of grid-direction-types]]
[:layout-grid-rows {:optional true}
[:vector {:gen/max 2} ::grid-track]]
[:layout-grid-columns {:optional true}
[:vector {:gen/max 2} ::grid-track]]
[:layout-grid-cells {:optional true}
[:map-of {:gen/max 5} ::sm/uuid ::grid-cell]]])
;; Grid types
(def grid-track-types
#{:percent :flex :auto :fixed})
@ -130,29 +86,59 @@
(def grid-cell-justify-self-types
#{:auto :start :center :end :stretch})
(sm/register!
^{::sm/type ::grid-cell}
[:map {:title "GridCell"}
[:id ::sm/uuid]
[:area-name {:optional true} :string]
[:row ::sm/safe-int]
[:row-span ::sm/safe-int]
[:column ::sm/safe-int]
[:column-span ::sm/safe-int]
[:position {:optional true} [::sm/one-of grid-position-types]]
[:align-self {:optional true} [::sm/one-of grid-cell-align-self-types]]
[:justify-self {:optional true} [::sm/one-of grid-cell-justify-self-types]]
[:shapes
[:vector {:gen/max 1} ::sm/uuid]]])
(def ^:private schema:grid-cell
[:map {:title "GridCell"}
[:id ::sm/uuid]
[:area-name {:optional true} :string]
[:row ::sm/safe-int]
[:row-span ::sm/safe-int]
[:column ::sm/safe-int]
[:column-span ::sm/safe-int]
[:position {:optional true} [::sm/one-of grid-position-types]]
[:align-self {:optional true} [::sm/one-of grid-cell-align-self-types]]
[:justify-self {:optional true} [::sm/one-of grid-cell-justify-self-types]]
[:shapes
[:vector {:gen/max 1} ::sm/uuid]]])
(sm/register!
^{::sm/type ::grid-track}
[:map {:title "GridTrack"}
[:type [::sm/one-of grid-track-types]]
[:value {:optional true} [:maybe ::sm/safe-number]]])
(def ^:private schema:grid-track
[:map {:title "GridTrack"}
[:type [::sm/one-of grid-track-types]]
[:value {:optional true} [:maybe ::sm/safe-number]]])
(def check-grid-track!
(sm/check-fn ::grid-track))
(def schema:layout-attrs
[:map {:title "LayoutAttrs"}
[:layout {:optional true} [::sm/one-of layout-types]]
[:layout-flex-dir {:optional true} [::sm/one-of flex-direction-types]]
[:layout-gap {:optional true}
[:map
[:row-gap {:optional true} ::sm/safe-number]
[:column-gap {:optional true} ::sm/safe-number]]]
[:layout-gap-type {:optional true} [::sm/one-of gap-types]]
[:layout-wrap-type {:optional true} [::sm/one-of wrap-types]]
[:layout-padding-type {:optional true} [::sm/one-of padding-type]]
[:layout-padding {:optional true}
[:map
[:p1 ::sm/safe-number]
[:p2 ::sm/safe-number]
[:p3 ::sm/safe-number]
[:p4 ::sm/safe-number]]]
[:layout-justify-content {:optional true} [::sm/one-of justify-content-types]]
[:layout-justify-items {:optional true} [::sm/one-of justify-items-types]]
[:layout-align-content {:optional true} [::sm/one-of align-content-types]]
[:layout-align-items {:optional true} [::sm/one-of align-items-types]]
[:layout-grid-dir {:optional true} [::sm/one-of grid-direction-types]]
[:layout-grid-rows {:optional true}
[:vector {:gen/max 2} schema:grid-track]]
[:layout-grid-columns {:optional true}
[:vector {:gen/max 2} schema:grid-track]]
[:layout-grid-cells {:optional true}
[:map-of {:gen/max 5} ::sm/uuid schema:grid-cell]]])
(def ^:private check-grid-track
(sm/check-fn schema:grid-track))
(def layout-attrs
(sm/keys schema:layout-attrs))
;; LAYOUT CHILDREN
@ -168,7 +154,7 @@
(def item-align-self-types
#{:start :end :center :stretch})
(def schema:layout-attrs
(def schema:layout-child-attrs
[:map {:title "LayoutChildAttrs"}
[:layout-item-margin-type {:optional true} [::sm/one-of item-margin-types]]
[:layout-item-margin {:optional true}
@ -187,6 +173,9 @@
[:layout-item-absolute {:optional true} :boolean]
[:layout-item-z-index {:optional true} ::sm/safe-number]])
(def layout-child-attrs
(sm/keys schema:layout-child-attrs))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; SCHEMAS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -194,8 +183,6 @@
(def valid-layouts
#{:flex :grid})
(sm/register! ::layout [::sm/one-of valid-layouts])
(defn flex-layout?
([objects id]
(flex-layout? (get objects id)))
@ -754,9 +741,7 @@
([type parent value]
(add-grid-track type parent value nil))
([type parent value index]
(dm/assert!
"expected a valid grid definition for `value`"
(check-grid-track! value))
(assert (check-grid-track value))
(let [[tracks-prop tracks-prop-other prop prop-other prop-span prop-span-other]
(if (= type :column)

View file

@ -274,6 +274,7 @@ async function readTranslations() {
"fa",
"fr",
"he",
"sr",
"nb_NO",
"pl",
"pt_BR",

View file

@ -21,6 +21,7 @@
[app.util.dom :as dom]
[app.util.i18n :as i18n :refer [tr c]]
[app.util.strings :as ust]
[app.util.theme :as theme]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
@ -208,8 +209,8 @@
[]
(let [state (mf/deref refs/export)
profile (mf/deref refs/profile)
theme (or (:theme profile) "default")
is-default-theme? (= "default" theme)
theme (or (:theme profile) theme/default)
is-default-theme? (= theme/default theme)
error? (:error state)
healthy? (:healthy? state)
detail-visible? (:detail-visible state)

View file

@ -43,6 +43,7 @@
{:label "Украї́нська мо́ва (community)" :value "uk"}
{:label "Český jazyk (community)" :value "cs"}
{:label "Latviešu valoda (community)" :value "lv"}
{:label "Српски (community)" :value "sr"}
{:label "Føroyskt mál (community)" :value "fo"}
{:label "Korean (community)" :value "ko"}
{:label "עִבְרִית (community)" :value "he"}