Merge remote-tracking branch 'origin/staging' into develop

This commit is contained in:
Andrey Antukh 2025-07-23 12:26:09 +02:00
commit 8aebe1a41e
15 changed files with 67 additions and 32 deletions

6
.gitignore vendored
View file

@ -41,6 +41,7 @@
/backend/resources/public/assets /backend/resources/public/assets
/backend/resources/public/media /backend/resources/public/media
/backend/target/ /backend/target/
/backend/experiments
/bundle* /bundle*
/cd.md /cd.md
/clj-profiler/ /clj-profiler/
@ -51,9 +52,6 @@
/exporter/target /exporter/target
/frontend/.storybook/preview-body.html /frontend/.storybook/preview-body.html
/frontend/.storybook/preview-head.html /frontend/.storybook/preview-head.html
/frontend/cypress/fixtures/validuser.json
/frontend/cypress/videos/*/
/frontend/cypress/videos/*/
/frontend/dist/ /frontend/dist/
/frontend/npm-debug.log /frontend/npm-debug.log
/frontend/out/ /frontend/out/
@ -70,6 +68,8 @@
/vendor/svgclean/bundle*.js /vendor/svgclean/bundle*.js
/web /web
/library/target/ /library/target/
/library/*.zip
/external
clj-profiler/ clj-profiler/
node_modules node_modules

View file

@ -40,6 +40,7 @@
- Improve text layer auto-resize: auto-width switches to auto-height on horizontal resize, and only switches to fixed on vertical resize [Taiga #11578](https://tree.taiga.io/project/penpot/issue/11578) - Improve text layer auto-resize: auto-width switches to auto-height on horizontal resize, and only switches to fixed on vertical resize [Taiga #11578](https://tree.taiga.io/project/penpot/issue/11578)
- Highlight first font in font selector search. Apply only on Enter or click. [Taiga #11579](https://tree.taiga.io/project/penpot/issue/11579) - Highlight first font in font selector search. Apply only on Enter or click. [Taiga #11579](https://tree.taiga.io/project/penpot/issue/11579)
- Add the ability to show login dialog on profile settings [Github #6871](https://github.com/penpot/penpot/pull/6871) - Add the ability to show login dialog on profile settings [Github #6871](https://github.com/penpot/penpot/pull/6871)
- Improve the application of tokens with object specific tokens [Taiga #10209](https://tree.taiga.io/project/penpot/us/10209)
### :bug: Bugs fixed ### :bug: Bugs fixed
@ -56,6 +57,9 @@
- Fix duplicating pages with mainInstance shapes nested inside groups [Taiga #10774](https://tree.taiga.io/project/penpot/issue/10774) - Fix duplicating pages with mainInstance shapes nested inside groups [Taiga #10774](https://tree.taiga.io/project/penpot/issue/10774)
- Fix ESC key not closing Add/Manage Libraries modal [Taiga #11523](https://tree.taiga.io/project/penpot/issue/11523) - Fix ESC key not closing Add/Manage Libraries modal [Taiga #11523](https://tree.taiga.io/project/penpot/issue/11523)
- Fix copying a shadow color from info tab [Taiga #11211](https://tree.taiga.io/project/penpot/issue/11211) - Fix copying a shadow color from info tab [Taiga #11211](https://tree.taiga.io/project/penpot/issue/11211)
- Fix remove color button in the gradient editor [Taiga #11623](https://tree.taiga.io/project/penpot/issue/11623)
- Fix "Copy as SVG" generates different code from the Inspect panel [Taiga #11519](https://tree.taiga.io/project/penpot/issue/11519)
- Fix overriden tokens in text copies are not preserved [Taiga #11486](https://tree.taiga.io/project/penpot/issue/11486)
## 2.8.1 (Unreleased) ## 2.8.1 (Unreleased)

View file

@ -518,15 +518,31 @@
;; --- SHAPE UPDATE ;; --- SHAPE UPDATE
(defn- get-token-groups (defn- get-token-groups
"Get the sync attrs groups that are affected by changes in applied tokens.
If any token has been applied or unapplied in the shape, calculate the corresponding
attributes and get the groups. If some of the attributes are to be applied in the
content nodes of a text shape, also return the content groups (only for attributes,
so the text is not touched)."
[shape new-applied-tokens] [shape new-applied-tokens]
(let [old-applied-tokens (d/nilv (:applied-tokens shape) #{}) (let [old-applied-tokens (d/nilv (:applied-tokens shape) #{})
changed-token-attrs (filter #(not= (get old-applied-tokens %) (get new-applied-tokens %)) changed-token-attrs (filter #(not= (get old-applied-tokens %) (get new-applied-tokens %))
ctt/all-keys) ctt/all-keys)
changed-groups (into #{} text-shape? (= (:type shape) :text)
(comp (map ctt/token-attr->shape-attr) attrs-in-text-content? (some #(ctt/attrs-in-text-content %)
(map #(get ctk/sync-attrs %)) changed-token-attrs)
(filter some?))
changed-token-attrs)] changed-groups (into #{}
(comp (map ctt/token-attr->shape-attr)
(map #(get ctk/sync-attrs %))
(filter some?))
changed-token-attrs)
changed-groups (if (and text-shape?
(d/not-empty? changed-groups)
attrs-in-text-content?)
(conj changed-groups :content-group :text-content-attribute)
changed-groups)]
changed-groups)) changed-groups))
(defn set-shape-attr (defn set-shape-attr

View file

@ -273,6 +273,13 @@
[attributes token-type] [attributes token-type]
(seq (appliable-attrs attributes token-type))) (seq (appliable-attrs attributes token-type)))
;; Token attrs that are set inside content blocks of text shapes, instead
;; at the shape level.
(def attrs-in-text-content
(set/union
typography-keys
#{:fill}))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; TOKENS IN SHAPES ;; TOKENS IN SHAPES
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View file

@ -97,6 +97,11 @@ file itself, which you can use as a basis for creating your own settings.
You can also consult the list of parameters on the You can also consult the list of parameters on the
<a href="https://artifacthub.io/packages/helm/penpot/penpot#parameters" target="_blank">ArtifactHub page of the project</a>. <a href="https://artifacthub.io/packages/helm/penpot/penpot#parameters" target="_blank">ArtifactHub page of the project</a>.
### Using OpenShift?
If you are deploying Penpot on OpenShift, we recommend following the specific guidelines provided in our Penpot-helm documentation:
<a href="https://artifacthub.io/packages/helm/penpot/penpot#-openshift-requirements" target="_blank">`Installing the chart with OpenShift requirements`</a>
Make sure to review the section **OpenShift Requirements** for important security and compatibility considerations.
## Upgrade Penpot ## Upgrade Penpot

View file

@ -80,8 +80,7 @@
(cb/format-code style-type))) (cb/format-code style-type)))
markup-code markup-code
(-> (cg/generate-markup-code objects markup-type [shape]) (cg/generate-formatted-markup-code objects markup-type [shape])]
(cb/format-code markup-type))]
(update-preview-window (update-preview-window
preview preview

View file

@ -346,8 +346,8 @@
(gsh/translate-to-frame % (get objects parent-frame-id))) (gsh/translate-to-frame % (get objects parent-frame-id)))
shapes (mapv maybe-translate selected) shapes (mapv maybe-translate selected)
svg (svg/generate-markup objects shapes)] svg-formatted (svg/generate-formatted-markup objects shapes)]
(wapi/write-to-clipboard svg))))) (wapi/write-to-clipboard svg-formatted)))))
(defn copy-selected-css (defn copy-selected-css
[] []

View file

@ -10,7 +10,8 @@
[app.common.data :as d] [app.common.data :as d]
[app.common.data.macros :as dm] [app.common.data.macros :as dm]
[app.common.types.fills :as types.fills] [app.common.types.fills :as types.fills]
[app.common.types.text :as txt] [app.common.types.text :as types.text]
[app.common.text :as txt]
[app.main.fonts :as fonts] [app.main.fonts :as fonts]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.store :as st] [app.main.store :as st]
@ -174,7 +175,7 @@
(let [style-text-blocks (->> (:content shape) (let [style-text-blocks (->> (:content shape)
(txt/content->text+styles) (txt/content->text+styles)
(remove (fn [[_ text]] (str/empty? (str/trim text)))) (remove (fn [[_ text]] (str/empty? (str/trim text))))
(mapv (fn [[style text]] (vector (merge (txt/get-default-text-attrs) style) text))))] (mapv (fn [[style text]] (vector (merge (types.text/get-default-text-attrs) style) text))))]
(for [[idx [full-style text]] (map-indexed vector style-text-blocks)] (for [[idx [full-style text]] (map-indexed vector style-text-blocks)]
[:& typography-block {:key idx [:& typography-block {:key idx

View file

@ -149,8 +149,7 @@
(mf/use-memo (mf/use-memo
(mf/deps markup-type shapes images-data) (mf/deps markup-type shapes images-data)
(fn [] (fn []
(-> (cg/generate-markup-code objects markup-type shapes) (cg/generate-formatted-markup-code objects markup-type shapes)))
(cb/format-code markup-type))))
on-markup-copied on-markup-copied
(mf/use-fn (mf/use-fn

View file

@ -6,7 +6,6 @@
[app.main.data.auth :as da] [app.main.data.auth :as da]
[app.main.data.event :as ev] [app.main.data.event :as ev]
[app.main.data.modal :as modal] [app.main.data.modal :as modal]
[app.main.data.profile :as du]
[app.main.refs :as refs] [app.main.refs :as refs]
[app.main.repo :as rp] [app.main.repo :as rp]
[app.main.router :as rt] [app.main.router :as rt]
@ -319,12 +318,6 @@
(if (= success-modal-is-trial? "true") (if (= success-modal-is-trial? "true")
(tr "subscription.settings.enterprise-trial") (tr "subscription.settings.enterprise-trial")
(tr "subscription.settings.enterprise")))}) (tr "subscription.settings.enterprise")))})
(du/update-profile-props {:subscription
(-> subscription
(assoc :type (if (= params-subscription "subscribed-to-penpot-unlimited")
"unlimited"
"enterprise"))
(assoc :status "trialing"))})
(rt/nav :settings-subscription {} {::rt/replace true}))))) (rt/nav :settings-subscription {} {::rt/replace true})))))
[:section {:class (stl/css :dashboard-section)} [:section {:class (stl/css :dashboard-section)}

View file

@ -276,10 +276,9 @@
handle-gradient-remove-stop handle-gradient-remove-stop
(mf/use-fn (mf/use-fn
(mf/deps state) (mf/deps state)
(fn [stop] (fn [index]
(when (> (count (:stops state)) 2) (when (> (count (:stops state)) 2)
(when-let [index (d/index-of-pred (:stops state) #(= % stop))] (st/emit! (dc/remove-gradient-stop index)))))
(st/emit! (dc/remove-gradient-stop index))))))
handle-stop-edit-start handle-stop-edit-start
(mf/use-fn (mf/use-fn

View file

@ -80,10 +80,10 @@
handle-remove-stop handle-remove-stop
(mf/use-callback (mf/use-callback
(mf/deps on-remove-stop stop) (mf/deps on-remove-stop index)
(fn [] (fn []
(when on-remove-stop (when on-remove-stop
(on-remove-stop stop)))) (on-remove-stop index))))
handle-focus-stop-offset handle-focus-stop-offset
(mf/use-fn (mf/use-fn

View file

@ -410,7 +410,7 @@
:else :else
(let [objects (u/locate-objects) (let [objects (u/locate-objects)
shapes (into [] (map u/proxy->shape) shapes)] shapes (into [] (map u/proxy->shape) shapes)]
(cg/generate-markup-code objects type shapes))))) (cg/generate-formatted-markup-code objects type shapes)))))
:generateStyle :generateStyle
(fn [shapes options] (fn [shapes options]

View file

@ -6,6 +6,7 @@
(ns app.util.code-gen (ns app.util.code-gen
(:require (:require
[app.util.code-beautify :as cb]
[app.util.code-gen.markup-html :as html] [app.util.code-gen.markup-html :as html]
[app.util.code-gen.markup-svg :as svg] [app.util.code-gen.markup-svg :as svg]
[app.util.code-gen.style-css :as css])) [app.util.code-gen.style-css :as css]))
@ -18,6 +19,11 @@
"svg" svg/generate-markup)] "svg" svg/generate-markup)]
(generate-markup objects shapes))) (generate-markup objects shapes)))
(defn generate-formatted-markup-code
[objects type shapes]
(let [markup (generate-markup-code objects type shapes)]
(cb/format-code markup type)))
(defn generate-style-code (defn generate-style-code
([objects type root-shapes all-shapes] ([objects type root-shapes all-shapes]
(generate-style-code objects type root-shapes all-shapes nil)) (generate-style-code objects type root-shapes all-shapes nil))

View file

@ -8,6 +8,7 @@
(:require (:require
["react-dom/server" :as rds] ["react-dom/server" :as rds]
[app.main.render :as render] [app.main.render :as render]
[app.util.code-beautify :as cb]
[cuerdas.core :as str] [cuerdas.core :as str]
[rumext.v2 :as mf])) [rumext.v2 :as mf]))
@ -24,3 +25,8 @@
(->> shapes (->> shapes
(map #(generate-svg objects %)) (map #(generate-svg objects %))
(str/join "\n"))) (str/join "\n")))
(defn generate-formatted-markup
[objects shapes]
(let [markup (generate-markup objects shapes)]
(cb/format-code markup "svg")))