mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 07:59:36 +00:00
Merge branch 'staging' into staging-render
This commit is contained in:
commit
3eeaaab17e
2
.github/workflows/build-tag.yml
vendored
2
.github/workflows/build-tag.yml
vendored
@ -33,7 +33,7 @@ jobs:
|
|||||||
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }}
|
MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK }}
|
||||||
MATTERMOST_CHANNEL: bot-alerts-cicd
|
MATTERMOST_CHANNEL: bot-alerts-cicd
|
||||||
TEXT: |
|
TEXT: |
|
||||||
🐳 *[PENPOT] Docker image available: {{ github.ref_name }}*
|
🐳 *[PENPOT] Docker image available: ${{ github.ref_name }}*
|
||||||
🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
🔗 Run: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||||
@infra
|
@infra
|
||||||
|
|
||||||
|
|||||||
25
.github/workflows/tests.yml
vendored
25
.github/workflows/tests.yml
vendored
@ -21,7 +21,7 @@ concurrency:
|
|||||||
jobs:
|
jobs:
|
||||||
lint:
|
lint:
|
||||||
name: "Linter"
|
name: "Linter"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -34,7 +34,7 @@ jobs:
|
|||||||
|
|
||||||
test-common:
|
test-common:
|
||||||
name: "Common Tests"
|
name: "Common Tests"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -53,7 +53,8 @@ jobs:
|
|||||||
|
|
||||||
test-plugins:
|
test-plugins:
|
||||||
name: Plugins Runtime Linter & Tests
|
name: Plugins Runtime Linter & Tests
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -98,7 +99,7 @@ jobs:
|
|||||||
|
|
||||||
test-frontend:
|
test-frontend:
|
||||||
name: "Frontend Tests"
|
name: "Frontend Tests"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -119,7 +120,7 @@ jobs:
|
|||||||
|
|
||||||
test-render-wasm:
|
test-render-wasm:
|
||||||
name: "Render WASM Tests"
|
name: "Render WASM Tests"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -143,7 +144,7 @@ jobs:
|
|||||||
|
|
||||||
test-backend:
|
test-backend:
|
||||||
name: "Backend Tests"
|
name: "Backend Tests"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
services:
|
services:
|
||||||
@ -182,7 +183,7 @@ jobs:
|
|||||||
|
|
||||||
test-library:
|
test-library:
|
||||||
name: "Library Tests"
|
name: "Library Tests"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -196,7 +197,7 @@ jobs:
|
|||||||
|
|
||||||
build-integration:
|
build-integration:
|
||||||
name: "Build Integration Bundle"
|
name: "Build Integration Bundle"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -217,7 +218,7 @@ jobs:
|
|||||||
|
|
||||||
test-integration-1:
|
test-integration-1:
|
||||||
name: "Integration Tests 1/4"
|
name: "Integration Tests 1/4"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
needs: build-integration
|
needs: build-integration
|
||||||
|
|
||||||
@ -247,7 +248,7 @@ jobs:
|
|||||||
|
|
||||||
test-integration-2:
|
test-integration-2:
|
||||||
name: "Integration Tests 2/4"
|
name: "Integration Tests 2/4"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
needs: build-integration
|
needs: build-integration
|
||||||
|
|
||||||
@ -277,7 +278,7 @@ jobs:
|
|||||||
|
|
||||||
test-integration-3:
|
test-integration-3:
|
||||||
name: "Integration Tests 3/4"
|
name: "Integration Tests 3/4"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
needs: build-integration
|
needs: build-integration
|
||||||
|
|
||||||
@ -307,7 +308,7 @@ jobs:
|
|||||||
|
|
||||||
test-integration-4:
|
test-integration-4:
|
||||||
name: "Integration Tests 4/4"
|
name: "Integration Tests 4/4"
|
||||||
runs-on: ubuntu-24.04
|
runs-on: penpot-runner-02
|
||||||
container: penpotapp/devenv:latest
|
container: penpotapp/devenv:latest
|
||||||
needs: build-integration
|
needs: build-integration
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,11 @@
|
|||||||
- Fix unhandled exception tokens creation dialog [Github #8110](https://github.com/penpot/penpot/issues/8110)
|
- Fix unhandled exception tokens creation dialog [Github #8110](https://github.com/penpot/penpot/issues/8110)
|
||||||
- Fix allow negative spread values on shadow token creation [Taiga #13167](https://tree.taiga.io/project/penpot/issue/13167)
|
- Fix allow negative spread values on shadow token creation [Taiga #13167](https://tree.taiga.io/project/penpot/issue/13167)
|
||||||
- Fix spanish translations on import export token modal [Taiga #13171](https://tree.taiga.io/project/penpot/issue/13171)
|
- Fix spanish translations on import export token modal [Taiga #13171](https://tree.taiga.io/project/penpot/issue/13171)
|
||||||
|
- Remove whitespaces from asset export filename [Github #8133](https://github.com/penpot/penpot/pull/8133)
|
||||||
|
- Fix exception on uploading large fonts [Github #8135](https://github.com/penpot/penpot/pull/8135)
|
||||||
|
- Fix unhandled exception on open-new-window helper [Github #7787](https://github.com/penpot/penpot/issues/7787)
|
||||||
|
- Fix incorrect handling of input values on layout gap and padding inputs [Github #8113](https://github.com/penpot/penpot/issues/8113)
|
||||||
|
|
||||||
|
|
||||||
## 2.12.1
|
## 2.12.1
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,17 @@
|
|||||||
[app.rpc.helpers :as rph]
|
[app.rpc.helpers :as rph]
|
||||||
[app.rpc.quotes :as quotes]
|
[app.rpc.quotes :as quotes]
|
||||||
[app.storage :as sto]
|
[app.storage :as sto]
|
||||||
[app.util.services :as sv]))
|
[app.storage.tmp :as tmp]
|
||||||
|
[app.util.services :as sv]
|
||||||
|
[datoteka.io :as io])
|
||||||
|
(:import
|
||||||
|
java.io.InputStream
|
||||||
|
java.io.OutputStream
|
||||||
|
java.io.SequenceInputStream
|
||||||
|
java.util.Collections))
|
||||||
|
|
||||||
|
(set! *warn-on-reflection* true)
|
||||||
|
|
||||||
|
|
||||||
(def valid-weight #{100 200 300 400 500 600 700 800 900 950})
|
(def valid-weight #{100 200 300 400 500 600 700 800 900 950})
|
||||||
(def valid-style #{"normal" "italic"})
|
(def valid-style #{"normal" "italic"})
|
||||||
@ -105,7 +115,7 @@
|
|||||||
|
|
||||||
(defn create-font-variant
|
(defn create-font-variant
|
||||||
[{:keys [::sto/storage ::db/conn]} {:keys [data] :as params}]
|
[{:keys [::sto/storage ::db/conn]} {:keys [data] :as params}]
|
||||||
(letfn [(generate-missing! [data]
|
(letfn [(generate-missing [data]
|
||||||
(let [data (media/run {:cmd :generate-fonts :input data})]
|
(let [data (media/run {:cmd :generate-fonts :input data})]
|
||||||
(when (and (not (contains? data "font/otf"))
|
(when (and (not (contains? data "font/otf"))
|
||||||
(not (contains? data "font/ttf"))
|
(not (contains? data "font/ttf"))
|
||||||
@ -116,8 +126,26 @@
|
|||||||
:hint "invalid font upload, unable to generate missing font assets"))
|
:hint "invalid font upload, unable to generate missing font assets"))
|
||||||
data))
|
data))
|
||||||
|
|
||||||
|
(process-chunks [chunks]
|
||||||
|
(let [tmp (tmp/tempfile :prefix "penpot.tempfont." :suffix "")
|
||||||
|
streams (map io/input-stream chunks)
|
||||||
|
streams (Collections/enumeration streams)]
|
||||||
|
(with-open [^OutputStream output (io/output-stream tmp)
|
||||||
|
^InputStream input (SequenceInputStream. streams)]
|
||||||
|
(io/copy input output))
|
||||||
|
tmp))
|
||||||
|
|
||||||
|
(join-chunks [data]
|
||||||
|
(reduce-kv (fn [data mtype content]
|
||||||
|
(if (vector? content)
|
||||||
|
(assoc data mtype (process-chunks content))
|
||||||
|
data))
|
||||||
|
data
|
||||||
|
data))
|
||||||
|
|
||||||
(prepare-font [data mtype]
|
(prepare-font [data mtype]
|
||||||
(when-let [resource (get data mtype)]
|
(when-let [resource (get data mtype)]
|
||||||
|
|
||||||
(let [hash (sto/calculate-hash resource)
|
(let [hash (sto/calculate-hash resource)
|
||||||
content (-> (sto/content resource)
|
content (-> (sto/content resource)
|
||||||
(sto/wrap-with-hash hash))]
|
(sto/wrap-with-hash hash))]
|
||||||
@ -156,7 +184,8 @@
|
|||||||
:otf-file-id (:id otf)
|
:otf-file-id (:id otf)
|
||||||
:ttf-file-id (:id ttf)}))]
|
:ttf-file-id (:id ttf)}))]
|
||||||
|
|
||||||
(let [data (generate-missing! data)
|
(let [data (join-chunks data)
|
||||||
|
data (generate-missing data)
|
||||||
assets (persist-fonts-files! data)
|
assets (persist-fonts-files! data)
|
||||||
result (insert-font-variant! assets)]
|
result (insert-font-variant! assets)]
|
||||||
(vary-meta result assoc ::audit/replace-props (update params :data (comp vec keys))))))
|
(vary-meta result assoc ::audit/replace-props (update params :data (comp vec keys))))))
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
{:path path
|
{:path path
|
||||||
:mtype (mime/get type)
|
:mtype (mime/get type)
|
||||||
:name name
|
:name name
|
||||||
:filename (str/concat name (mime/get-extension type))
|
:filename (str/concat (str/slug name) (mime/get-extension type))
|
||||||
:id task-id}))
|
:id task-id}))
|
||||||
|
|
||||||
(defn create-zip
|
(defn create-zip
|
||||||
|
|||||||
@ -24,6 +24,20 @@
|
|||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.v2.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
|
(def ^:const default-chunk-size
|
||||||
|
(* 1024 1024 4)) ;; 4MiB
|
||||||
|
|
||||||
|
(defn- chunk-array
|
||||||
|
[data chunk-size]
|
||||||
|
(let [total-size (alength data)]
|
||||||
|
(loop [offset 0
|
||||||
|
chunks []]
|
||||||
|
(if (< offset total-size)
|
||||||
|
(let [end (min (+ offset chunk-size) total-size)
|
||||||
|
chunk (.subarray ^js data offset end)]
|
||||||
|
(recur end (conj chunks chunk)))
|
||||||
|
chunks))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; General purpose events & IMPL
|
;; General purpose events & IMPL
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
@ -116,9 +130,9 @@
|
|||||||
(not= hhea-descender win-descent)
|
(not= hhea-descender win-descent)
|
||||||
(and f-selection (or
|
(and f-selection (or
|
||||||
(not= hhea-ascender os2-ascent)
|
(not= hhea-ascender os2-ascent)
|
||||||
(not= hhea-descender os2-descent))))]
|
(not= hhea-descender os2-descent))))
|
||||||
|
data (js/Uint8Array. data)]
|
||||||
{:content {:data (js/Uint8Array. data)
|
{:content {:data (chunk-array data default-chunk-size)
|
||||||
:name name
|
:name name
|
||||||
:type type}
|
:type type}
|
||||||
:font-family (or family "")
|
:font-family (or family "")
|
||||||
|
|||||||
@ -628,6 +628,7 @@
|
|||||||
width: $sz-400;
|
width: $sz-400;
|
||||||
padding: var(--sp-xxxl);
|
padding: var(--sp-xxxl);
|
||||||
background-color: var(--color-background-primary);
|
background-color: var(--color-background-primary);
|
||||||
|
z-index: var(--z-index-set);
|
||||||
|
|
||||||
&.hero {
|
&.hero {
|
||||||
top: px2rem(216);
|
top: px2rem(216);
|
||||||
|
|||||||
@ -375,7 +375,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change ids)
|
(mf/deps on-change ids)
|
||||||
(fn [value attr event]
|
(fn [value attr event]
|
||||||
(if (or (string? value) (int? value))
|
(if (or (string? value) (number? value))
|
||||||
(on-change :simple attr value event)
|
(on-change :simple attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))
|
(let [resolved-value (:resolved-value (first value))
|
||||||
@ -489,7 +489,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change ids)
|
(mf/deps on-change ids)
|
||||||
(fn [value attr event]
|
(fn [value attr event]
|
||||||
(if (or (string? value) (int? value))
|
(if (or (string? value) (number? value))
|
||||||
(on-change :multiple attr value event)
|
(on-change :multiple attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))]
|
(let [resolved-value (:resolved-value (first value))]
|
||||||
@ -724,7 +724,7 @@
|
|||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps on-change wrap-type ids)
|
(mf/deps on-change wrap-type ids)
|
||||||
(fn [value event attr]
|
(fn [value event attr]
|
||||||
(if (or (string? value) (int? value))
|
(if (or (string? value) (number? value))
|
||||||
(on-change (= "nowrap" wrap-type) attr value event)
|
(on-change (= "nowrap" wrap-type) attr value event)
|
||||||
(do
|
(do
|
||||||
(let [resolved-value (:resolved-value (first value))]
|
(let [resolved-value (:resolved-value (first value))]
|
||||||
|
|||||||
@ -802,9 +802,10 @@
|
|||||||
([uri name]
|
([uri name]
|
||||||
(open-new-window uri name "noopener,noreferrer"))
|
(open-new-window uri name "noopener,noreferrer"))
|
||||||
([uri name features]
|
([uri name features]
|
||||||
(let [new-window (.open js/window (str uri) name features)]
|
(when-let [new-window (.open js/window (str uri) name features)]
|
||||||
(when (not= name "_blank")
|
(when (not= name "_blank")
|
||||||
(.reload (.-location new-window))))))
|
(when-let [location (.-location new-window)]
|
||||||
|
(.reload location))))))
|
||||||
|
|
||||||
(defn browser-back
|
(defn browser-back
|
||||||
[]
|
[]
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user