diff --git a/CHANGES.md b/CHANGES.md index 1515fa29d..deb8802d8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -25,7 +25,8 @@ - Fix problem with strokes not refreshing in Safari [Taiga #9040](https://tree.taiga.io/project/penpot/issue/9040) - Fix problem with multiple color changes [Taiga #9631](https://tree.taiga.io/project/penpot/issue/9631) -## 2.4.3 (Unreleased) + +## 2.4.3 ### :bug: Bugs fixed diff --git a/backend/src/app/http.clj b/backend/src/app/http.clj index 4d85cdaee..e04b0523d 100644 --- a/backend/src/app/http.clj +++ b/backend/src/app/http.clj @@ -42,8 +42,8 @@ (def default-params {::port 6060 ::host "0.0.0.0" - ::max-body-size (* 1024 1024 30) ; default 30 MiB - ::max-multipart-body-size (* 1024 1024 120)}) ; default 120 MiB + ::max-body-size 31457280 ; default 30 MiB + ::max-multipart-body-size 367001600}) ; default 350 MiB (defmethod ig/expand-key ::server [k v] diff --git a/common/src/app/common/files/defaults.cljc b/common/src/app/common/files/defaults.cljc index 0a7463b4d..668d2f5e7 100644 --- a/common/src/app/common/files/defaults.cljc +++ b/common/src/app/common/files/defaults.cljc @@ -6,4 +6,4 @@ (ns app.common.files.defaults) -(def version 64) +(def version 67) diff --git a/common/src/app/common/files/migrations.cljc b/common/src/app/common/files/migrations.cljc index 8e7082619..783e98727 100644 --- a/common/src/app/common/files/migrations.cljc +++ b/common/src/app/common/files/migrations.cljc @@ -1179,7 +1179,25 @@ (update data :components update-vals update-component))) -(defn migrate-up-63 +(defn migrate-up-65 + [data] + (let [update-object + (fn [object] + (d/update-when object :plugin-data d/without-nils)) + + update-page + (fn [page] + (-> (update-object page) + (update :objects update-vals update-object)))] + + (-> data + (update-object) + (d/update-when :pages-index update-vals update-page) + (d/update-when :colors update-vals update-object) + (d/update-when :typographies update-vals update-object) + (d/update-when :components update-vals update-object)))) + +(defn migrate-up-66 [data] (letfn [(update-object [object] (if (and (:rx object) (not (:r1 object))) @@ -1197,7 +1215,7 @@ (update :pages-index update-vals update-container) (update :components update-vals update-container)))) -(defn migrate-up-64 +(defn migrate-up-67 [data] (letfn [(update-object [object] (d/update-when object :shadow #(into [] (reverse %)))) @@ -1260,5 +1278,6 @@ {:id 57 :migrate-up migrate-up-57} {:id 59 :migrate-up migrate-up-59} {:id 62 :migrate-up migrate-up-62} - {:id 63 :migrate-up migrate-up-63} - {:id 64 :migrate-up migrate-up-64}]) + {:id 65 :migrate-up migrate-up-65} + {:id 66 :migrate-up migrate-up-66} + {:id 67 :migrate-up migrate-up-67}]) diff --git a/docker/images/docker-compose.yaml b/docker/images/docker-compose.yaml index 023f8e0fd..95508084b 100644 --- a/docker/images/docker-compose.yaml +++ b/docker/images/docker-compose.yaml @@ -29,6 +29,15 @@ x-flags: &penpot-flags x-uri: &penpot-public-uri PENPOT_PUBLIC_URI: http://localhost:9001 +x-body-size: &penpot-http-body-size + # Max body size (30MiB); Used for plain requests, should never be + # greater than multi-part size + PENPOT_HTTP_SERVER_MAX_BODY_SIZE: 31457280 + + # Max multipart body size (350MiB) + PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE: 367001600 + + networks: penpot: @@ -103,7 +112,7 @@ services: # - "traefik.http.routers.penpot-https.tls.certresolver=letsencrypt" environment: - << : *penpot-flags + << : [*penpot-flags, *penpot-http-body-size] penpot-backend: image: "penpotapp/backend:latest" @@ -125,7 +134,7 @@ services: ## container. environment: - << : [*penpot-flags, *penpot-public-uri] + << : [*penpot-flags, *penpot-public-uri, *penpot-http-body-size] ## Penpot SECRET KEY. It serves as a master key from which other keys for subsystems ## (eg http sessions, or invitations) are derived. @@ -283,5 +292,3 @@ services: # ports: # - 9000:9000 # - 9001:9001 - - diff --git a/docker/images/files/nginx-entrypoint.sh b/docker/images/files/nginx-entrypoint.sh index c34245230..74c0042d6 100644 --- a/docker/images/files/nginx-entrypoint.sh +++ b/docker/images/files/nginx-entrypoint.sh @@ -22,7 +22,9 @@ update_flags /var/www/app/js/config.js export PENPOT_BACKEND_URI=${PENPOT_BACKEND_URI:-http://penpot-backend:6060}; export PENPOT_EXPORTER_URI=${PENPOT_EXPORTER_URI:-http://penpot-exporter:6061}; export PENPOT_INTERNAL_RESOLVER=${PENPOT_INTERNAL_RESOLVER:-127.0.0.11}; +export PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE=${PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE:-367001600}; # Default to 350MiB -envsubst "\$PENPOT_BACKEND_URI,\$PENPOT_EXPORTER_URI,\$PENPOT_INTERNAL_RESOLVER" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf +envsubst "\$PENPOT_BACKEND_URI,\$PENPOT_EXPORTER_URI,\$PENPOT_INTERNAL_RESOLVER,\$PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE" \ + < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf exec "$@"; diff --git a/docker/images/files/nginx.conf b/docker/images/files/nginx.conf index e03f7ef0b..19f2e3a1a 100644 --- a/docker/images/files/nginx.conf +++ b/docker/images/files/nginx.conf @@ -64,7 +64,7 @@ http { listen 8080 default_server; server_name _; - client_max_body_size 100M; + client_max_body_size $PENPOT_HTTP_SERVER_MAX_MULTIPART_BODY_SIZE; charset utf-8; proxy_http_version 1.1; diff --git a/frontend/src/app/main/data/dashboard.cljs b/frontend/src/app/main/data/dashboard.cljs index 54f64e965..3f0d9bbd3 100644 --- a/frontend/src/app/main/data/dashboard.cljs +++ b/frontend/src/app/main/data/dashboard.cljs @@ -467,6 +467,7 @@ (defn create-file [{:keys [project-id name] :as params}] (dm/assert! (uuid? project-id)) + (ptk/reify ::create-file ev/Event (-data [_] {:project-id project-id}) diff --git a/frontend/src/app/main/ui/dashboard/files.cljs b/frontend/src/app/main/ui/dashboard/files.cljs index 8572cf103..251a7bbd2 100644 --- a/frontend/src/app/main/ui/dashboard/files.cljs +++ b/frontend/src/app/main/ui/dashboard/files.cljs @@ -169,7 +169,7 @@ (let [mdata {:on-success on-file-created} params {:project-id (:id project)}] (st/emit! (-> (dd/create-file (with-meta params mdata)) - (with-meta {::ev/origin origin}))))))] + (with-meta {::ev/origin origin :has-files (> file-count 0)}))))))] (mf/with-effect [project] (when project diff --git a/frontend/src/app/main/ui/dashboard/placeholder.cljs b/frontend/src/app/main/ui/dashboard/placeholder.cljs index dc8523220..af826ebc9 100644 --- a/frontend/src/app/main/ui/dashboard/placeholder.cljs +++ b/frontend/src/app/main/ui/dashboard/placeholder.cljs @@ -20,7 +20,10 @@ (mf/use-fn (mf/deps create-fn) (fn [_] - (create-fn "dashboard:empty-folder-placeholder")))] + (create-fn "dashboard:empty-folder-placeholder"))) + show-text (mf/use-state nil) + on-mouse-enter (mf/use-fn #(reset! show-text true)) + on-mouse-leave (mf/use-fn #(reset! show-text nil))] (cond (true? dragging?) [:ul @@ -43,9 +46,15 @@ :else [:div {:class (stl/css :grid-empty-placeholder)} - [:button {:class (stl/css :create-new) - :on-click on-click} - (if (cf/external-feature-flag "add-file-01" "test") (tr "dashboard.add-file") i/add)]]))) + (if (cf/external-feature-flag "add-file-01" "test") + [:button {:class (stl/css :create-new) + :on-click on-click + :on-mouse-enter on-mouse-enter + :on-mouse-leave on-mouse-leave} + (if @show-text (tr "dashboard.add-file") i/add)] + [:button {:class (stl/css :create-new) + :on-click on-click} + i/add])]))) (mf/defc loading-placeholder [] diff --git a/frontend/src/app/main/ui/dashboard/projects.cljs b/frontend/src/app/main/ui/dashboard/projects.cljs index 669374b9f..12f22309b 100644 --- a/frontend/src/app/main/ui/dashboard/projects.cljs +++ b/frontend/src/app/main/ui/dashboard/projects.cljs @@ -181,7 +181,7 @@ (let [mdata {:on-success on-file-created} params {:project-id project-id}] (st/emit! (-> (dd/create-file (with-meta params mdata)) - (with-meta {::ev/origin origin})))))) + (with-meta {::ev/origin origin :has-files (> file-count 0)})))))) on-create-click (mf/use-fn diff --git a/frontend/text-editor/src/editor/controllers/SelectionController.js b/frontend/text-editor/src/editor/controllers/SelectionController.js index 4f8e49ca9..77cb109a9 100644 --- a/frontend/text-editor/src/editor/controllers/SelectionController.js +++ b/frontend/text-editor/src/editor/controllers/SelectionController.js @@ -358,6 +358,16 @@ export class SelectionController extends EventTarget { detail: this.#currentStyle, }) ); + } else { + const firstInline = this.#textEditor.root?.firstElementChild?.firstElementChild; + if (firstInline) { + this.#updateCurrentStyle(firstInline); + this.dispatchEvent( + new CustomEvent("stylechange", { + detail: this.#currentStyle, + }), + ); + } } }