Compare commits

..

14 Commits

Author SHA1 Message Date
Andrey Antukh
b68c426cd1 🐛 Fix exception on fills menu when binary-fills flag is active
And multiple shapes are selected.
2025-07-29 15:10:32 +02:00
Andrey Antukh
d00de7d5a4 Merge pull request #6960 from penpot/xaviju-remove-image-shape-type-fix
🐛 Remove image type from inspect tab panels
2025-07-25 12:49:57 +02:00
Xaviju
2fbd4b07e0 🐛 Remove image type from inspect tab panels 2025-07-25 12:08:01 +02:00
Andrey Antukh
523373dfa2 📎 Update .gitignore file 2025-07-23 12:09:15 +02:00
Andrey Antukh
b71ec4bfe0 Simplify docker build script (#6924) 2025-07-21 20:45:03 +02:00
Andrey Antukh
51107c3fc9 🐛 Fix incorrect event name on event constructor 2025-07-21 11:58:48 +02:00
Alejandro Alonso
abef9f3cf7 Merge pull request #6889 from penpot/niwinz-staging-bugfix
🐛 Fix unexpected exception on processing old texts
2025-07-14 07:08:31 +02:00
Andrey Antukh
40c300fa1a 🐛 Fix unexpected exception on processing old texts 2025-07-10 09:22:00 +02:00
Alejandro Alonso
5b704faf79 Merge pull request #6862 from penpot/niwinz-develop-minor-fixes
 Add several improvements
2025-07-07 15:40:20 +02:00
Andrey Antukh
d24eab7241 📎 Update changelog 2025-07-07 15:07:07 +02:00
Andrey Antukh
c8fef97598 Add missing field on get-teams rpc method 2025-07-07 13:36:00 +02:00
Andrey Antukh
44e3e4a641 🔥 Remove image shape inspect pannel
Image shapes are long ago deprecated not used
on penpot
2025-07-07 13:36:00 +02:00
Andrey Antukh
f3616c68a0 Improve decode empty string for path content 2025-07-07 13:36:00 +02:00
Andrey Antukh
9ea3f81bc4 🐛 Clean invalid library colors 2025-07-07 13:35:59 +02:00
12 changed files with 61 additions and 80 deletions

6
.gitignore vendored
View File

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

View File

@@ -1,6 +1,14 @@
# CHANGELOG
## 2.8.0 (Next / Unreleased)
## 2.8.1 (Unreleased)
### :bug: Bugs fixed
- Fix unexpected exception on processing old texts [Github #6889](https://github.com/penpot/penpot/pull/6889)
- Fix error on inspect tab when selecting multiple shapes [Taiga #11655](https://tree.taiga.io/project/penpot/issue/11655)
## 2.8.0
### :rocket: Epics and highlights
@@ -15,8 +23,8 @@ on [its own changelog](library/CHANGES.md)
**Penpot migrate from Redis to Valkey**
As [Valkey](https://valkey.io/) is an opne-souce fork of [Redis](https://redis.io/)
version 7.2.4, this version of Penpot will be compatible with Redis but may diverge
in future versions. Therefore, **migration from Redis to ValKey is recommended for all
version 7.2.4, this version of Penpot will be compatible with Redis but may diverge
in future versions. Therefore, **migration from Redis to ValKey is recommended for all
on-premises instances** that want to keep up to date.
### :heart: Community contributions (Thank you!)

View File

@@ -139,7 +139,8 @@
'~:status', CASE COALESCE(p.props->'~:subscription'->>'~:type', 'professional')
WHEN 'professional' THEN 'active'
ELSE COALESCE(p.props->'~:subscription'->>'~:status', 'incomplete')
END
END,
'~:seats', p.props->'~:quantity'
) AS subscription
FROM team_profile_rel AS tp
JOIN team AS t ON (t.id = tp.team_id)

View File

@@ -1019,8 +1019,8 @@
[data _]
(let [update-colors
(fn [colors]
(into {} (filter #(-> % val types.color/valid-color?) colors)))]
(update data :colors update-colors)))
(into {} (filter #(-> % val types.color/valid-library-color?) colors)))]
(d/update-when data :colors update-colors)))
(defmethod migrate-data "legacy-52"
[data _]
@@ -1034,7 +1034,6 @@
(update data :pages-index d/update-vals update-page)))
(defmethod migrate-data "legacy-53"
[data _]
(migrate-data data "legacy-26"))
@@ -1517,6 +1516,17 @@
(d/update-when data :colors d/update-vals clear-color)))
(defmethod migrate-data "0009-clean-library-colors"
[data _]
(d/update-when data :colors
(fn [colors]
(reduce-kv (fn [colors id color]
(if (types.color/valid-library-color? color)
colors
(dissoc colors id)))
colors
colors))))
(def available-migrations
(into (d/ordered-set)
["legacy-2"
@@ -1580,4 +1590,5 @@
"0005-deprecate-image-type"
"0006-fix-old-texts-fills"
"0007-clear-invalid-strokes-and-fills-v2"
"0008-fix-library-colors-v4"]))
"0008-fix-library-colors-v4"
"0009-clean-library-colors"]))

View File

@@ -117,6 +117,7 @@
[:ref-id {:optional true} ::sm/uuid]
[:ref-file {:optional true} ::sm/uuid]])
;; This schema represent an "applied color"
(def schema:color
[:and
[:merge {:title "Color"}

View File

@@ -20,7 +20,8 @@
[app.common.schema.generators :as sg]
[app.common.svg.path :as svg.path]
[app.common.transit :as t]
[app.common.types.path :as-alias path])
[app.common.types.path :as-alias path]
[cuerdas.core :as str])
(:import
#?(:cljs [goog.string StringBuffer]
:clj [java.nio ByteBuffer ByteOrder])))
@@ -530,7 +531,9 @@
:decode/json (fn [s]
(cond
(string? s)
(from-string s)
(if (str/empty? s)
(from-plain [])
(from-string s))
(vector? s)
(let [decode-fn (deref decoder)]

View File

@@ -1,14 +1,17 @@
#!/usr/bin/env bash
set -x
DOCKER_CLI_EXPERIMENTAL=enabled
IMAGE=${1:-backend}
OUTPUT="type=registry"
if [ "--local" = "$2" ]; then
OUTPUT="type=docker"
fi
ORG=${PENPOT_DOCKER_NAMESPACE:-penpotapp};
PLATFORM=${PENPOT_BUILD_PLATFORM:-linux/amd64};
IMAGE=${PENPOT_BUILD_IMAGE:-backend}
PLATFORM=${PENPOT_BUILD_PLATFORM:-linux/amd64};
PLATFORM=${PENPOT_BUILD_PLATFORM:-linux/amd64,linux/arm64};
VERSION=${PENPOT_BUILD_VERSION:-latest}
DOCKER_IMAGE="$ORG/$IMAGE";
OPTIONS="-t $DOCKER_IMAGE:$VERSION";
@@ -20,7 +23,7 @@ for element in "${TAGS[@]}"; do
done
docker buildx inspect penpot > /dev/null 2>&1;
docker run --privileged --rm tonistiigi/binfmt --install all
docker run --privileged --rm tonistiigi/binfmt --install all > /dev/null;
if [ $? -eq 1 ]; then
docker buildx create --name=penpot --use
@@ -32,4 +35,5 @@ fi
unset IFS;
docker buildx build --platform ${PLATFORM// /,} $OPTIONS -f Dockerfile.$IMAGE "$@" .;
shift;
docker buildx build --output $OUTPUT --platform ${PLATFORM// /,} $OPTIONS -f Dockerfile.$IMAGE .;

View File

@@ -245,4 +245,4 @@
(defn event
[props]
(ptk/data-event ::events props))
(ptk/data-event ::event props))

View File

@@ -479,7 +479,7 @@
;; We don't have the fills attribute. It's an old text without color
;; so need to be black
(and (nil? (:fills node)) (empty? color-attrs))
(update :fills conj txt/default-text-attrs)
(assoc :fills (:fills txt/default-text-attrs))
;; Remove duplicates from the fills
:always

View File

@@ -15,7 +15,6 @@
[app.main.ui.inspect.attributes.blur :refer [blur-panel]]
[app.main.ui.inspect.attributes.fill :refer [fill-panel]]
[app.main.ui.inspect.attributes.geometry :refer [geometry-panel]]
[app.main.ui.inspect.attributes.image :refer [image-panel]]
[app.main.ui.inspect.attributes.layout :refer [layout-panel]]
[app.main.ui.inspect.attributes.layout-element :refer [layout-element-panel]]
[app.main.ui.inspect.attributes.shadow :refer [shadow-panel]]
@@ -27,13 +26,12 @@
[rumext.v2 :as mf]))
(def type->options
{:multiple [:fill :stroke :image :text :shadow :blur :layout-element]
{:multiple [:fill :stroke :text :shadow :blur :layout-element]
:frame [:geometry :fill :stroke :shadow :blur :layout :layout-element]
:group [:geometry :svg :layout-element]
:rect [:geometry :fill :stroke :shadow :blur :svg :layout-element]
:circle [:geometry :fill :stroke :shadow :blur :svg :layout-element]
:path [:geometry :fill :stroke :shadow :blur :svg :layout-element]
:image [:image :geometry :fill :stroke :shadow :blur :svg :layout-element]
:text [:geometry :text :shadow :blur :stroke :layout-element]
:variant [:variant :geometry :fill :stroke :shadow :blur :layout :layout-element]})
@@ -69,7 +67,6 @@
:stroke stroke-panel
:shadow shadow-panel
:blur blur-panel
:image image-panel
:text text-panel
:svg svg-panel
:variant variant-panel*)

View File

@@ -1,51 +0,0 @@
;; This Source Code Form is subject to the terms of the Mozilla Public
;; License, v. 2.0. If a copy of the MPL was not distributed with this
;; file, You can obtain one at http://mozilla.org/MPL/2.0/.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.ui.inspect.attributes.image
(:require-macros [app.main.style :as stl])
(:require
[app.common.files.helpers :as cfh]
[app.common.media :as cm]
[app.config :as cf]
[app.main.ui.components.copy-button :refer [copy-button*]]
[app.util.code-gen.style-css :as css]
[app.util.i18n :refer [tr]]
[cuerdas.core :as str]
[rumext.v2 :as mf]))
(defn has-image? [shape]
(= (:type shape) :image))
(mf/defc image-panel
[{:keys [objects shapes]}]
(for [shape (filter cfh/image-shape? shapes)]
[:div {:class (stl/css :attributes-block)
:key (str "image-" (:id shape))}
[:div {:class (stl/css :image-wrapper)}
[:img {:src (cf/resolve-file-media (-> shape :metadata))}]]
[:div {:class (stl/css :image-row)}
[:div {:class (stl/css :global/attr-label)}
(tr "inspect.attributes.image.width")]
[:div {:class (stl/css :global/attr-value)}
[:> copy-button* {:data (css/get-css-property objects (:metadata shape) :width)}
[:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :width)]]]]
[:div {:class (stl/css :image-row)}
[:div {:class (stl/css :global/attr-label)}
(tr "inspect.attributes.image.height")]
[:div {:class (stl/css :global/attr-value)}
[:> copy-button* {:data (css/get-css-property objects (:metadata shape) :height)}
[:div {:class (stl/css :button-children)} (css/get-css-value objects (:metadata shape) :height)]]]]
(let [mtype (-> shape :metadata :mtype)
name (:name shape)
extension (cm/mtype->extension mtype)]
[:a {:class (stl/css :download-button)
:target "_blank"
:download (cond-> name extension (str/concat extension))
:href (cf/resolve-file-media (-> shape :metadata))}
(tr "inspect.attributes.image.download")])]))

View File

@@ -55,15 +55,22 @@
;; Excluding nil values
values (d/without-nils values)
fills (if (contains? cfg/flags :frontend-binary-fills)
fills (get values :fills)
fills (if (and (contains? cfg/flags :frontend-binary-fills)
(not= fills :multiple))
(take types.fill/MAX-FILLS (d/nilv (:fills values) []))
(:fills values))
fills)
has-fills? (or (= :multiple fills) (some? (seq fills)))
can-add-fills? (if (contains? cfg/flags :frontend-binary-fills)
(and (not (= :multiple fills))
(< (count fills) types.fill/MAX-FILLS))
(not (= :multiple fills)))
state* (mf/use-state has-fills?)
open? (deref state*)