mirror of
https://github.com/penpot/penpot.git
synced 2025-07-05 11:57:15 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
b73b40b23c
3 changed files with 121 additions and 83 deletions
10
CHANGES.md
10
CHANGES.md
|
@ -20,6 +20,12 @@
|
||||||
- To @ondrejkonec: for contributing to the code with:
|
- To @ondrejkonec: for contributing to the code with:
|
||||||
- Refactor CSS variables [Github #2948](https://github.com/penpot/penpot/pull/2948)
|
- Refactor CSS variables [Github #2948](https://github.com/penpot/penpot/pull/2948)
|
||||||
|
|
||||||
|
## 1.17.3
|
||||||
|
|
||||||
|
### :bug: Bugs fixed
|
||||||
|
- Fix copy and paste very nested inside itself [Taiga #4848](https://tree.taiga.io/project/penpot/issue/4848)
|
||||||
|
- Fix custom fonts not rendered correctly [Taiga #4874](https://tree.taiga.io/project/penpot/issue/4874)
|
||||||
|
|
||||||
## 1.17.2
|
## 1.17.2
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
@ -29,10 +35,6 @@
|
||||||
- Fix correct behaviour for space-around and added space-evenly option
|
- Fix correct behaviour for space-around and added space-evenly option
|
||||||
- Fix duplicate with alt and undo only undo one step [Taiga #4746](https://tree.taiga.io/project/penpot/issue/4746)
|
- Fix duplicate with alt and undo only undo one step [Taiga #4746](https://tree.taiga.io/project/penpot/issue/4746)
|
||||||
- Fix problem creating frames inside layout [Taiga #4844](https://tree.taiga.io/project/penpot/issue/4844)
|
- Fix problem creating frames inside layout [Taiga #4844](https://tree.taiga.io/project/penpot/issue/4844)
|
||||||
|
|
||||||
## 1.17.2
|
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
|
||||||
- Fix paste board inside itself [Taiga #4775](https://tree.taiga.io/project/penpot/issue/4775)
|
- Fix paste board inside itself [Taiga #4775](https://tree.taiga.io/project/penpot/issue/4775)
|
||||||
- Fix middle button panning can drag guides [Taiga #4266](https://tree.taiga.io/project/penpot/issue/4266)
|
- Fix middle button panning can drag guides [Taiga #4266](https://tree.taiga.io/project/penpot/issue/4266)
|
||||||
|
|
||||||
|
|
|
@ -177,12 +177,20 @@
|
||||||
(watch [_ _ stream]
|
(watch [_ _ stream]
|
||||||
(let [team-id (:team-id project)
|
(let [team-id (:team-id project)
|
||||||
stoper (rx/filter (ptk/type? ::bundle-fetched) stream)]
|
stoper (rx/filter (ptk/type? ::bundle-fetched) stream)]
|
||||||
(->> (rx/merge
|
(->> (rx/concat
|
||||||
;; Initialize notifications & load team fonts
|
;; Initialize notifications
|
||||||
(rx/of (dwn/initialize team-id id)
|
(rx/of (dwn/initialize team-id id)
|
||||||
(dwsl/initialize)
|
(dwsl/initialize))
|
||||||
(df/load-team-fonts team-id))
|
|
||||||
|
|
||||||
|
;; Load team fonts. We must ensure custom fonts are fully loadad before starting the workspace load
|
||||||
|
(rx/merge
|
||||||
|
(->> stream
|
||||||
|
(rx/filter (ptk/type? :app.main.data.fonts/team-fonts-loaded))
|
||||||
|
(rx/take 1)
|
||||||
|
(rx/ignore))
|
||||||
|
(rx/of (df/load-team-fonts team-id)))
|
||||||
|
|
||||||
|
(rx/merge
|
||||||
;; Load all pages, independently if they are pointers or already
|
;; Load all pages, independently if they are pointers or already
|
||||||
;; resolved values.
|
;; resolved values.
|
||||||
(->> (rx/from (seq (:pages-index data)))
|
(->> (rx/from (seq (:pages-index data)))
|
||||||
|
@ -226,7 +234,7 @@
|
||||||
(resolve-pointers id)
|
(resolve-pointers id)
|
||||||
(rx/map #(update file :data merge %)))))
|
(rx/map #(update file :data merge %)))))
|
||||||
(rx/reduce conj [])
|
(rx/reduce conj [])
|
||||||
(rx/map libraries-fetched)))))))
|
(rx/map libraries-fetched))))))))
|
||||||
|
|
||||||
(rx/take-until stoper)))))))
|
(rx/take-until stoper)))))))
|
||||||
|
|
||||||
|
@ -1444,9 +1452,17 @@
|
||||||
(and (= 1 (count selected))
|
(and (= 1 (count selected))
|
||||||
(= :frame (get-in objects [(first selected) :type])))))
|
(= :frame (get-in objects [(first selected) :type])))))
|
||||||
|
|
||||||
(defn same-frame-from-selected? [state frame-id]
|
(defn get-tree-root-shapes [tree]
|
||||||
(let [selected (wsh/lookup-selected state)]
|
;; This fn gets a map of shapes and finds what shapes are parent of the rest
|
||||||
(contains? frame-id (first selected))))
|
(let [shapes-in-tree (vals tree)
|
||||||
|
shape-ids (keys tree)
|
||||||
|
parent-ids (set (map #(:parent-id %) shapes-in-tree))]
|
||||||
|
(->> shape-ids
|
||||||
|
(filter #(contains? parent-ids %)))))
|
||||||
|
|
||||||
|
(defn any-same-frame-from-selected? [state frame-ids]
|
||||||
|
(let [selected (first (wsh/lookup-selected state))]
|
||||||
|
(< 0 (count (filter #(= % selected) frame-ids)))))
|
||||||
|
|
||||||
(defn frame-same-size?
|
(defn frame-same-size?
|
||||||
[paste-obj frame-obj]
|
[paste-obj frame-obj]
|
||||||
|
@ -1504,13 +1520,18 @@
|
||||||
frame-id (first page-selected)
|
frame-id (first page-selected)
|
||||||
frame-object (get page-objects frame-id)
|
frame-object (get page-objects frame-id)
|
||||||
base (cph/get-base-shape page-objects page-selected)
|
base (cph/get-base-shape page-objects page-selected)
|
||||||
index (cph/get-position-on-parent page-objects (:id base))]
|
index (cph/get-position-on-parent page-objects (:id base))
|
||||||
|
tree-root (get-tree-root-shapes paste-objects)
|
||||||
|
only-one-root-shape? (and
|
||||||
|
(< 1 (count paste-objects))
|
||||||
|
(= 1 (count tree-root)))]
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(selected-frame? state)
|
(selected-frame? state)
|
||||||
|
|
||||||
(if (or (same-frame-from-selected? state (first (vals paste-objects)))
|
(if (or (any-same-frame-from-selected? state (keys paste-objects))
|
||||||
(frame-same-size? paste-objects frame-object))
|
(and only-one-root-shape?
|
||||||
|
(frame-same-size? paste-objects (first tree-root))))
|
||||||
;; Paste next to selected frame, if selected is itself or of the same size as the copied
|
;; Paste next to selected frame, if selected is itself or of the same size as the copied
|
||||||
(let [selected-frame-obj (get page-objects (first page-selected))
|
(let [selected-frame-obj (get page-objects (first page-selected))
|
||||||
parent-id (:parent-id base)
|
parent-id (:parent-id base)
|
||||||
|
@ -1548,6 +1569,7 @@
|
||||||
;; - Respect the distance of the object to the right and bottom in the original frame
|
;; - Respect the distance of the object to the right and bottom in the original frame
|
||||||
(gpt/point paste-x paste-y))]
|
(gpt/point paste-x paste-y))]
|
||||||
[frame-id frame-id delta]))
|
[frame-id frame-id delta]))
|
||||||
|
|
||||||
(empty? page-selected)
|
(empty? page-selected)
|
||||||
(let [frame-id (ctst/top-nested-frame page-objects mouse-pos)
|
(let [frame-id (ctst/top-nested-frame page-objects mouse-pos)
|
||||||
delta (gpt/subtract mouse-pos orig-pos)]
|
delta (gpt/subtract mouse-pos orig-pos)]
|
||||||
|
|
|
@ -236,6 +236,13 @@
|
||||||
(-> shape
|
(-> shape
|
||||||
(assoc :layout-item-h-sizing :auto
|
(assoc :layout-item-h-sizing :auto
|
||||||
:layout-item-v-sizing :auto))))
|
:layout-item-v-sizing :auto))))
|
||||||
|
;; Set the children to fixed to remove strange interactions
|
||||||
|
(dwc/update-shapes
|
||||||
|
selected
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :layout-item-h-sizing :fix
|
||||||
|
:layout-item-v-sizing :fix))))
|
||||||
|
|
||||||
(ptk/data-event :layout/update [new-shape-id])
|
(ptk/data-event :layout/update [new-shape-id])
|
||||||
(dws/delete-shapes page-id selected)
|
(dws/delete-shapes page-id selected)
|
||||||
|
@ -257,6 +264,13 @@
|
||||||
(merge flex-params)
|
(merge flex-params)
|
||||||
(assoc :layout-item-h-sizing :auto
|
(assoc :layout-item-h-sizing :auto
|
||||||
:layout-item-v-sizing :auto))))
|
:layout-item-v-sizing :auto))))
|
||||||
|
;; Set the children to fixed to remove strange interactions
|
||||||
|
(dwc/update-shapes
|
||||||
|
selected
|
||||||
|
(fn [shape]
|
||||||
|
(-> shape
|
||||||
|
(assoc :layout-item-h-sizing :fix
|
||||||
|
:layout-item-v-sizing :fix))))
|
||||||
|
|
||||||
(ptk/data-event :layout/update [new-shape-id])
|
(ptk/data-event :layout/update [new-shape-id])
|
||||||
(dwu/commit-undo-transaction undo-id))))))))
|
(dwu/commit-undo-transaction undo-id))))))))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue