mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 04:48:39 +00:00
Merge branch 'staging' into develop
This commit is contained in:
commit
69daee4137
78
.gitignore
vendored
78
.gitignore
vendored
@ -1,51 +1,51 @@
|
|||||||
figwheel_server.log
|
|
||||||
*jar
|
|
||||||
*-init.clj
|
*-init.clj
|
||||||
|
*.jar
|
||||||
|
*.penpot
|
||||||
|
.calva
|
||||||
|
.clj-kondo
|
||||||
|
.cpcache
|
||||||
.lein-deps-sum
|
.lein-deps-sum
|
||||||
.lein-failures
|
.lein-failures
|
||||||
.lein-repl-history
|
|
||||||
.lein-plugins/
|
.lein-plugins/
|
||||||
.repl
|
.lein-repl-history
|
||||||
|
.lsp
|
||||||
.nrepl-port
|
.nrepl-port
|
||||||
.cpcache
|
|
||||||
.rebel_readline_history
|
|
||||||
.nyc_output
|
.nyc_output
|
||||||
/vendor/**/target
|
.rebel_readline_history
|
||||||
/cd.md
|
.repl
|
||||||
node_modules
|
/.clj-kondo/.cache
|
||||||
/backend/target/
|
/_dump
|
||||||
/backend/resources/public/media
|
/backend/-
|
||||||
/backend/resources/public/assets
|
|
||||||
/backend/assets/
|
/backend/assets/
|
||||||
/backend/dist/
|
/backend/dist/
|
||||||
/backend/logs/
|
/backend/logs/
|
||||||
/backend/-
|
/backend/resources/public/assets
|
||||||
/telemetry/
|
/backend/resources/public/media
|
||||||
/frontend/npm-debug.log
|
/backend/target/
|
||||||
/frontend/target/
|
|
||||||
/frontend/dist/
|
|
||||||
/frontend/out/
|
|
||||||
/frontend/.shadow-cljs
|
|
||||||
/frontend/resources/public/*
|
|
||||||
/frontend/resources/fonts/experiments
|
|
||||||
/exporter/target
|
|
||||||
/exporter/.shadow-cljs
|
|
||||||
/docker/images/bundle*
|
|
||||||
/common/.shadow-cljs
|
|
||||||
/common/target
|
|
||||||
/common/coverage
|
|
||||||
/.clj-kondo/.cache
|
|
||||||
clj-profiler/
|
|
||||||
/bundle*
|
/bundle*
|
||||||
/media
|
/cd.md
|
||||||
|
/clj-profiler/
|
||||||
|
/common/.shadow-cljs
|
||||||
|
/common/coverage
|
||||||
|
/common/target
|
||||||
/deploy
|
/deploy
|
||||||
/web
|
/docker/images/bundle*
|
||||||
/_dump
|
/exporter/.shadow-cljs
|
||||||
/vendor/svgclean/bundle*.js
|
/exporter/target
|
||||||
|
/frontend/.shadow-cljs
|
||||||
.calva
|
|
||||||
.clj-kondo
|
|
||||||
.lsp
|
|
||||||
/frontend/cypress/videos/*/
|
/frontend/cypress/videos/*/
|
||||||
/frontend/cypress/fixtures/validuser.json
|
/frontend/cypress/videos/*/
|
||||||
|
/frontend/dist/
|
||||||
|
/frontend/npm-debug.log
|
||||||
|
/frontend/out/
|
||||||
|
/frontend/resources/fonts/experiments
|
||||||
|
/frontend/resources/public/*
|
||||||
|
/frontend/target/
|
||||||
|
/media
|
||||||
|
/telemetry/
|
||||||
|
/vendor/**/target
|
||||||
|
/vendor/svgclean/bundle*.js
|
||||||
|
/web
|
||||||
|
clj-profiler/
|
||||||
|
figwheel_server.log
|
||||||
|
node_modules
|
||||||
|
|||||||
@ -73,6 +73,10 @@
|
|||||||
- Show correctly group types label in handoff [Taiga #2482](https://tree.taiga.io/project/penpot/issue/2482)
|
- Show correctly group types label in handoff [Taiga #2482](https://tree.taiga.io/project/penpot/issue/2482)
|
||||||
- Display view mode buttons always centered in viewer [#Taiga 2466](https://tree.taiga.io/project/penpot/issue/2466)
|
- Display view mode buttons always centered in viewer [#Taiga 2466](https://tree.taiga.io/project/penpot/issue/2466)
|
||||||
- Fix default profile image generation issue [Taiga #2601](https://tree.taiga.io/project/penpot/issue/2601)
|
- Fix default profile image generation issue [Taiga #2601](https://tree.taiga.io/project/penpot/issue/2601)
|
||||||
|
- Fix edit blur attributes for multiselection [Taiga #2625](https://tree.taiga.io/project/penpot/issue/2625)
|
||||||
|
- Fix auto hide header in viewer full screen [Taiga #2632](https://tree.taiga.io/project/penpot/issue/2632)
|
||||||
|
- Fix zoom in/out after fit or fill [Taiga #2630](https://tree.taiga.io/project/penpot/issue/2630)
|
||||||
|
- Normalize zoom levels in workspace and viewer [Taiga #2631](https://tree.taiga.io/project/penpot/issue/2631)
|
||||||
|
|
||||||
### :arrow_up: Deps updates
|
### :arrow_up: Deps updates
|
||||||
|
|
||||||
|
|||||||
@ -89,9 +89,9 @@
|
|||||||
data (some-> params :file :tempfile fs/slurp-bytes blob/decode)]
|
data (some-> params :file :tempfile fs/slurp-bytes blob/decode)]
|
||||||
|
|
||||||
(if (and data project-id)
|
(if (and data project-id)
|
||||||
(do
|
(let [fname (str "imported-file-" (dt/now))]
|
||||||
(m.files/create-file pool {:id (uuid/next)
|
(m.files/create-file pool {:id (uuid/next)
|
||||||
:name "imported-file"
|
:name fname
|
||||||
:project-id project-id
|
:project-id project-id
|
||||||
:profile-id profile-id
|
:profile-id profile-id
|
||||||
:data data})
|
:data data})
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
"A main namespace for server repl."
|
"A main namespace for server repl."
|
||||||
#_:clj-kondo/ignore
|
#_:clj-kondo/ignore
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.data :as d]
|
||||||
[app.common.pages :as cp]
|
[app.common.pages :as cp]
|
||||||
[app.common.uuid :as uuid]
|
|
||||||
[app.common.pages.migrations :as pmg]
|
[app.common.pages.migrations :as pmg]
|
||||||
|
[app.common.uuid :as uuid]
|
||||||
[app.config :as cfg]
|
[app.config :as cfg]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.db.sql :as sql]
|
[app.db.sql :as sql]
|
||||||
@ -12,12 +13,12 @@
|
|||||||
[app.rpc.queries.profile :as prof]
|
[app.rpc.queries.profile :as prof]
|
||||||
[app.srepl.dev :as dev]
|
[app.srepl.dev :as dev]
|
||||||
[app.util.blob :as blob]
|
[app.util.blob :as blob]
|
||||||
[cuerdas.core :as str]
|
[clojure.pprint :refer [pprint]]
|
||||||
[clojure.pprint :refer [pprint]]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defn update-file
|
(defn update-file
|
||||||
([id f] (update-file id f false))
|
([system id f] (update-file system id f false))
|
||||||
([id f save?]
|
([system id f save?]
|
||||||
(db/with-atomic [conn (:app.db/pool system)]
|
(db/with-atomic [conn (:app.db/pool system)]
|
||||||
(let [file (db/get-by-id conn :file id {:for-update true})
|
(let [file (db/get-by-id conn :file id {:for-update true})
|
||||||
file (-> file
|
file (-> file
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.fullscreen .viewer-layout:not(.force-visible) {
|
.fullscreen.viewer-layout:not(.force-visible) {
|
||||||
& .viewer-header {
|
& .viewer-header {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@ -23,10 +23,3 @@
|
|||||||
:grid-alignment true
|
:grid-alignment true
|
||||||
:background "var(--color-white)"})
|
:background "var(--color-white)"})
|
||||||
|
|
||||||
(def zoom-levels
|
|
||||||
[0.01 0.03 0.05 0.07 0.09 0.10 0.11 0.13 0.15 0.18
|
|
||||||
0.20 0.21 0.22 0.23 0.24 0.25 0.27 0.28 0.30 0.32 0.34
|
|
||||||
0.36 0.38 0.40 0.42 0.44 0.46 0.48 0.50 0.54 0.57 0.60
|
|
||||||
0.63 0.66 0.69 0.73 0.77 0.81 0.85 0.90 0.95 1.00 1.05
|
|
||||||
1.10 1.15 1.21 1.27 1.33 1.40 1.47 1.54 1.62 1.70 1.78
|
|
||||||
1.87 1.96 2.00 2.16 2.27 2.38 2.50 2.62 2.75 2.88 3.00])
|
|
||||||
|
|||||||
@ -11,7 +11,6 @@
|
|||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
[app.common.types.interactions :as cti]
|
[app.common.types.interactions :as cti]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.main.constants :as c]
|
|
||||||
[app.main.data.comments :as dcm]
|
[app.main.data.comments :as dcm]
|
||||||
[app.main.data.fonts :as df]
|
[app.main.data.fonts :as df]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
@ -190,18 +189,14 @@
|
|||||||
(ptk/reify ::increase-zoom
|
(ptk/reify ::increase-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [increase #(nth c/zoom-levels
|
(let [increase #(min (* % 1.3) 200)]
|
||||||
(+ (d/index-of c/zoom-levels %) 1)
|
|
||||||
(last c/zoom-levels))]
|
|
||||||
(update-in state [:viewer-local :zoom] (fnil increase 1))))))
|
(update-in state [:viewer-local :zoom] (fnil increase 1))))))
|
||||||
|
|
||||||
(def decrease-zoom
|
(def decrease-zoom
|
||||||
(ptk/reify ::decrease-zoom
|
(ptk/reify ::decrease-zoom
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
(let [decrease #(nth c/zoom-levels
|
(let [decrease #(max (/ % 1.3) 0.01)]
|
||||||
(- (d/index-of c/zoom-levels %) 1)
|
|
||||||
(first c/zoom-levels))]
|
|
||||||
(update-in state [:viewer-local :zoom] (fnil decrease 1))))))
|
(update-in state [:viewer-local :zoom] (fnil decrease 1))))))
|
||||||
|
|
||||||
(def reset-zoom
|
(def reset-zoom
|
||||||
|
|||||||
@ -413,6 +413,43 @@
|
|||||||
;; Workspace State Manipulation
|
;; Workspace State Manipulation
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
;; --- Toggle layout flag
|
||||||
|
|
||||||
|
(defn toggle-layout-flags
|
||||||
|
[& flags]
|
||||||
|
(ptk/reify ::toggle-layout-flags
|
||||||
|
ptk/UpdateEvent
|
||||||
|
(update [_ state]
|
||||||
|
(update state :workspace-layout
|
||||||
|
(fn [stored]
|
||||||
|
(reduce (fn [flags flag]
|
||||||
|
(if (contains? flags flag)
|
||||||
|
(disj flags flag)
|
||||||
|
(conj flags flag)))
|
||||||
|
stored
|
||||||
|
(d/concat-set flags)))))))
|
||||||
|
|
||||||
|
;; --- Set element options mode
|
||||||
|
|
||||||
|
(defn set-options-mode
|
||||||
|
[mode]
|
||||||
|
(us/assert ::options-mode mode)
|
||||||
|
(ptk/reify ::set-options-mode
|
||||||
|
ptk/UpdateEvent
|
||||||
|
(update [_ state]
|
||||||
|
(assoc-in state [:workspace-local :options-mode] mode))))
|
||||||
|
|
||||||
|
;; --- Tooltip
|
||||||
|
|
||||||
|
(defn assign-cursor-tooltip
|
||||||
|
[content]
|
||||||
|
(ptk/reify ::assign-cursor-tooltip
|
||||||
|
ptk/UpdateEvent
|
||||||
|
(update [_ state]
|
||||||
|
(if (string? content)
|
||||||
|
(assoc-in state [:workspace-local :tooltip] content)
|
||||||
|
(assoc-in state [:workspace-local :tooltip] nil)))))
|
||||||
|
|
||||||
;; --- Viewport Sizing
|
;; --- Viewport Sizing
|
||||||
|
|
||||||
(declare increase-zoom)
|
(declare increase-zoom)
|
||||||
@ -552,44 +589,6 @@
|
|||||||
(-> state
|
(-> state
|
||||||
(update :workspace-local dissoc :zooming)))))
|
(update :workspace-local dissoc :zooming)))))
|
||||||
|
|
||||||
|
|
||||||
;; --- Toggle layout flag
|
|
||||||
|
|
||||||
(defn toggle-layout-flags
|
|
||||||
[& flags]
|
|
||||||
(ptk/reify ::toggle-layout-flags
|
|
||||||
ptk/UpdateEvent
|
|
||||||
(update [_ state]
|
|
||||||
(update state :workspace-layout
|
|
||||||
(fn [stored]
|
|
||||||
(reduce (fn [flags flag]
|
|
||||||
(if (contains? flags flag)
|
|
||||||
(disj flags flag)
|
|
||||||
(conj flags flag)))
|
|
||||||
stored
|
|
||||||
(d/concat-set flags)))))))
|
|
||||||
|
|
||||||
;; --- Set element options mode
|
|
||||||
|
|
||||||
(defn set-options-mode
|
|
||||||
[mode]
|
|
||||||
(us/assert ::options-mode mode)
|
|
||||||
(ptk/reify ::set-options-mode
|
|
||||||
ptk/UpdateEvent
|
|
||||||
(update [_ state]
|
|
||||||
(assoc-in state [:workspace-local :options-mode] mode))))
|
|
||||||
|
|
||||||
;; --- Tooltip
|
|
||||||
|
|
||||||
(defn assign-cursor-tooltip
|
|
||||||
[content]
|
|
||||||
(ptk/reify ::assign-cursor-tooltip
|
|
||||||
ptk/UpdateEvent
|
|
||||||
(update [_ state]
|
|
||||||
(if (string? content)
|
|
||||||
(assoc-in state [:workspace-local :tooltip] content)
|
|
||||||
(assoc-in state [:workspace-local :tooltip] nil)))))
|
|
||||||
|
|
||||||
;; --- Zoom Management
|
;; --- Zoom Management
|
||||||
|
|
||||||
(defn- impl-update-zoom
|
(defn- impl-update-zoom
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
(ns app.main.ui.shapes.path
|
(ns app.main.ui.shapes.path
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.logging :as log]
|
||||||
[app.main.ui.shapes.attrs :as attrs]
|
[app.main.ui.shapes.attrs :as attrs]
|
||||||
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
|
[app.main.ui.shapes.custom-stroke :refer [shape-custom-stroke]]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
@ -20,10 +21,17 @@
|
|||||||
(let [shape (unchecked-get props "shape")
|
(let [shape (unchecked-get props "shape")
|
||||||
content (:content shape)
|
content (:content shape)
|
||||||
pdata (mf/with-memo [content]
|
pdata (mf/with-memo [content]
|
||||||
(upf/format-path content))
|
(try
|
||||||
|
(upf/format-path content)
|
||||||
|
(catch :default e
|
||||||
|
(log/error :hint "unexpected error on formating path"
|
||||||
|
:shape-name (:name shape)
|
||||||
|
:shape-id (:id shape)
|
||||||
|
:cause e)
|
||||||
|
"")))
|
||||||
|
|
||||||
props (-> (attrs/extract-style-attrs shape)
|
props (-> (attrs/extract-style-attrs shape)
|
||||||
(obj/set! "d" pdata))]
|
(obj/set! "d" pdata))]
|
||||||
|
|
||||||
[:& shape-custom-stroke {:shape shape}
|
[:& shape-custom-stroke {:shape shape}
|
||||||
[:> :path props]]))
|
[:> :path props]]))
|
||||||
|
|
||||||
|
|||||||
@ -222,7 +222,6 @@
|
|||||||
blur-ids blur-values
|
blur-ids blur-values
|
||||||
stroke-ids stroke-values
|
stroke-ids stroke-values
|
||||||
text-ids text-values]
|
text-ids text-values]
|
||||||
|
|
||||||
(mf/use-memo
|
(mf/use-memo
|
||||||
(mf/deps objects-no-measures)
|
(mf/deps objects-no-measures)
|
||||||
(fn []
|
(fn []
|
||||||
@ -233,7 +232,7 @@
|
|||||||
(get-attrs shapes objects-no-measures :constraint)
|
(get-attrs shapes objects-no-measures :constraint)
|
||||||
(get-attrs shapes objects-no-measures :fill)
|
(get-attrs shapes objects-no-measures :fill)
|
||||||
(get-attrs shapes objects-no-measures :shadow)
|
(get-attrs shapes objects-no-measures :shadow)
|
||||||
(get-attrs shapes objects-no-measures :shadow)
|
(get-attrs shapes objects-no-measures :blur)
|
||||||
(get-attrs shapes objects-no-measures :stroke)
|
(get-attrs shapes objects-no-measures :stroke)
|
||||||
(get-attrs shapes objects-no-measures :text)])))]
|
(get-attrs shapes objects-no-measures :text)])))]
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
(ns app.main.ui.workspace.viewport.outline
|
(ns app.main.ui.workspace.viewport.outline
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.exceptions :as ex]
|
||||||
[app.common.geom.shapes :as gsh]
|
[app.common.geom.shapes :as gsh]
|
||||||
[app.common.pages :as cp]
|
[app.common.pages :as cp]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
@ -27,7 +28,9 @@
|
|||||||
path-data
|
path-data
|
||||||
(mf/use-memo
|
(mf/use-memo
|
||||||
(mf/deps shape)
|
(mf/deps shape)
|
||||||
#(when path? (upf/format-path (:content shape))))
|
#(when path?
|
||||||
|
(or (ex/ignoring (upf/format-path (:content shape)))
|
||||||
|
"")))
|
||||||
|
|
||||||
{:keys [x y width height selrect]} shape
|
{:keys [x y width height selrect]} shape
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user