mirror of
https://github.com/penpot/penpot.git
synced 2025-05-07 18:35:54 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
cdd268afbc
8 changed files with 96 additions and 43 deletions
16
CHANGES.md
16
CHANGES.md
|
@ -12,6 +12,22 @@
|
||||||
|
|
||||||
### :heart: Community contributions by (Thank you!)
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
||||||
|
|
||||||
|
## 1.17.2
|
||||||
|
|
||||||
|
### :bug: Bugs fixed
|
||||||
|
- Fix invite members button text [Taiga #4794](https://tree.taiga.io/project/penpot/issue/4794)
|
||||||
|
|
||||||
|
## 1.17.2
|
||||||
|
|
||||||
|
### :bug: Bugs fixed
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
### :heart: Community contributions by (Thank you!)
|
||||||
|
|
||||||
|
- To @ondrejkonec: for some code contributions on this release.
|
||||||
|
|
||||||
## 1.17.1
|
## 1.17.1
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
(ns app.rpc
|
(ns app.rpc
|
||||||
(:require
|
(:require
|
||||||
[app.auth.ldap :as-alias ldap]
|
[app.auth.ldap :as-alias ldap]
|
||||||
[app.common.data :as d]
|
|
||||||
[app.common.exceptions :as ex]
|
[app.common.exceptions :as ex]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.common.spec :as us]
|
[app.common.spec :as us]
|
||||||
|
|
|
@ -68,6 +68,12 @@
|
||||||
(gpt/add base-p (hv 0.01))
|
(gpt/add base-p (hv 0.01))
|
||||||
(gpt/add base-p (vv 0.01))]
|
(gpt/add base-p (vv 0.01))]
|
||||||
|
|
||||||
|
col?
|
||||||
|
(conj (gpt/add base-p (vv min-height)))
|
||||||
|
|
||||||
|
row?
|
||||||
|
(conj (gpt/add base-p (hv min-width)))
|
||||||
|
|
||||||
(and col? h-start?)
|
(and col? h-start?)
|
||||||
(conj (gpt/add base-p (hv min-width)))
|
(conj (gpt/add base-p (hv min-width)))
|
||||||
|
|
||||||
|
|
|
@ -1495,10 +1495,6 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr auto;
|
grid-template-columns: 1fr auto;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
.btn-large {
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
max-width: 250px;
|
max-width: 250px;
|
||||||
}
|
}
|
||||||
|
@ -1587,7 +1583,19 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.buttons {
|
.buttons {
|
||||||
margin-top: 12px;
|
margin: 12px 0;
|
||||||
|
button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
white-space: break-spaces;
|
||||||
|
word-break: break-word;
|
||||||
|
height: fit-content;
|
||||||
|
margin: 0;
|
||||||
|
padding: 5px 10px;
|
||||||
|
min-height: 40px;
|
||||||
|
max-height: 90px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1440,6 +1440,19 @@
|
||||||
(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]
|
||||||
|
(let [selected (wsh/lookup-selected state)]
|
||||||
|
(contains? frame-id (first selected))))
|
||||||
|
|
||||||
|
(defn frame-same-size?
|
||||||
|
[paste-obj frame-obj]
|
||||||
|
(and
|
||||||
|
(= (:heigth (:selrect (first (vals paste-obj))))
|
||||||
|
(:heigth (:selrect frame-obj)))
|
||||||
|
(= (:width (:selrect (first (vals paste-obj))))
|
||||||
|
(:width (:selrect frame-obj)))))
|
||||||
|
|
||||||
|
|
||||||
(defn- paste-shape
|
(defn- paste-shape
|
||||||
[{selected :selected
|
[{selected :selected
|
||||||
paste-objects :objects ;; rename this because here comes only the clipboard shapes,
|
paste-objects :objects ;; rename this because here comes only the clipboard shapes,
|
||||||
|
@ -1478,55 +1491,67 @@
|
||||||
item))
|
item))
|
||||||
|
|
||||||
(calculate-paste-position [state mouse-pos in-viewport?]
|
(calculate-paste-position [state mouse-pos in-viewport?]
|
||||||
(let [page-objects (wsh/lookup-page-objects state)
|
(let [page-objects (wsh/lookup-page-objects state)
|
||||||
selected-objs (map #(get paste-objects %) selected)
|
selected-objs (map #(get paste-objects %) selected)
|
||||||
page-selected (wsh/lookup-selected state)
|
first-selected-obj (first selected-objs)
|
||||||
wrapper (gsh/selection-rect selected-objs)
|
page-selected (wsh/lookup-selected state)
|
||||||
orig-pos (gpt/point (:x1 wrapper) (:y1 wrapper))]
|
wrapper (gsh/selection-rect selected-objs)
|
||||||
|
orig-pos (gpt/point (:x1 wrapper) (:y1 wrapper))
|
||||||
|
frame-id (first page-selected)
|
||||||
|
frame-object (get page-objects frame-id)
|
||||||
|
base (cph/get-base-shape page-objects page-selected)
|
||||||
|
index (cph/get-position-on-parent page-objects (:id base))]
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
;; Pasting inside a frame
|
|
||||||
(selected-frame? state)
|
(selected-frame? state)
|
||||||
(let [frame-id (first page-selected)
|
|
||||||
frame-object (get page-objects frame-id)
|
|
||||||
|
|
||||||
origin-frame-id (:frame-id (first selected-objs))
|
(if (or (same-frame-from-selected? state (first (vals paste-objects)))
|
||||||
origin-frame-object (get page-objects origin-frame-id)
|
(frame-same-size? paste-objects frame-object))
|
||||||
|
;; 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))
|
||||||
|
parent-id (:parent-id base)
|
||||||
|
paste-x (+ (:width selected-frame-obj) (:x selected-frame-obj) 50)
|
||||||
|
paste-y (:y selected-frame-obj)
|
||||||
|
delta (gpt/subtract (gpt/point paste-x paste-y) orig-pos)]
|
||||||
|
|
||||||
margin-x (-> (- (:width origin-frame-object) (+ (:x wrapper) (:width wrapper)))
|
[(:frame-id base) parent-id delta index])
|
||||||
(min (- (:width frame-object) (:width wrapper))))
|
|
||||||
|
|
||||||
margin-y (-> (- (:height origin-frame-object) (+ (:y wrapper) (:height wrapper)))
|
;; Paste inside selected frame otherwise
|
||||||
(min (- (:height frame-object) (:height wrapper))))
|
(let [origin-frame-id (:frame-id first-selected-obj)
|
||||||
|
origin-frame-object (get page-objects origin-frame-id)
|
||||||
|
|
||||||
|
margin-x (-> (- (:width origin-frame-object) (+ (:x wrapper) (:width wrapper)))
|
||||||
|
(min (- (:width frame-object) (:width wrapper))))
|
||||||
|
|
||||||
|
margin-y (-> (- (:height origin-frame-object) (+ (:y wrapper) (:height wrapper)))
|
||||||
|
(min (- (:height frame-object) (:height wrapper))))
|
||||||
|
|
||||||
;; Pasted objects mustn't exceed the selected frame x limit
|
;; Pasted objects mustn't exceed the selected frame x limit
|
||||||
paste-x (if (> (+ (:width wrapper) (:x1 wrapper)) (:width frame-object))
|
paste-x (if (> (+ (:width wrapper) (:x1 wrapper)) (:width frame-object))
|
||||||
(+ (- (:x frame-object) (:x orig-pos)) (- (:width frame-object) (:width wrapper) margin-x))
|
(+ (- (:x frame-object) (:x orig-pos)) (- (:width frame-object) (:width wrapper) margin-x))
|
||||||
(:x frame-object))
|
(:x frame-object))
|
||||||
|
|
||||||
;; Pasted objects mustn't exceed the selected frame y limit
|
;; Pasted objects mustn't exceed the selected frame y limit
|
||||||
paste-y (if (> (+ (:height wrapper) (:y1 wrapper)) (:height frame-object))
|
paste-y (if (> (+ (:height wrapper) (:y1 wrapper)) (:height frame-object))
|
||||||
(+ (- (:y frame-object) (:y orig-pos)) (- (:height frame-object) (:height wrapper) margin-y))
|
(+ (- (:y frame-object) (:y orig-pos)) (- (:height frame-object) (:height wrapper) margin-y))
|
||||||
(:y frame-object))
|
(:y frame-object))
|
||||||
|
|
||||||
delta (if (= origin-frame-id uuid/zero)
|
delta (if (= origin-frame-id uuid/zero)
|
||||||
;; When the origin isn't in a frame the result is pasted in the center.
|
;; When the origin isn't in a frame the result is pasted in the center.
|
||||||
(gpt/subtract (gsh/center-shape frame-object) (gsh/center-selrect wrapper))
|
(gpt/subtract (gsh/center-shape frame-object) (gsh/center-selrect wrapper))
|
||||||
;; When pasting from one frame to another frame the object position must be limited to container boundaries. If the pasted object doesn't fit we try to:
|
;; When pasting from one frame to another frame the object position must be limited to container boundaries. If the pasted object doesn't fit we try to:
|
||||||
;; - Align it to the limits on the x and y axis
|
;; - Align it to the limits on the x and y axis
|
||||||
;; - 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)]
|
||||||
[frame-id frame-id delta])
|
[frame-id frame-id delta])
|
||||||
|
|
||||||
:else
|
:else
|
||||||
(let [base (cph/get-base-shape page-objects page-selected)
|
(let [frame-id (:frame-id base)
|
||||||
index (cph/get-position-on-parent page-objects (:id base))
|
|
||||||
frame-id (:frame-id base)
|
|
||||||
parent-id (:parent-id base)
|
parent-id (:parent-id base)
|
||||||
delta (if in-viewport?
|
delta (if in-viewport?
|
||||||
(gpt/subtract mouse-pos orig-pos)
|
(gpt/subtract mouse-pos orig-pos)
|
||||||
|
|
|
@ -196,9 +196,8 @@
|
||||||
:name name
|
:name name
|
||||||
:step 2}))}
|
:step 2}))}
|
||||||
(tr "labels.back")]
|
(tr "labels.back")]
|
||||||
[:div {:title (tr "onboarding.choice.team-up.invite-members-submit")}
|
[:& fm/submit-button
|
||||||
[:& fm/submit-button
|
{:label (tr "onboarding.choice.team-up.invite-members-submit")}]]
|
||||||
{:label (tr "onboarding.choice.team-up.invite-members-submit")}]]]
|
|
||||||
[:div.skip-action
|
[:div.skip-action
|
||||||
{:on-click on-skip}
|
{:on-click on-skip}
|
||||||
[:div.action (tr "onboarding.choice.team-up.invite-members-skip")]]]]
|
[:div.action (tr "onboarding.choice.team-up.invite-members-skip")]]]]
|
||||||
|
|
|
@ -340,8 +340,7 @@
|
||||||
(when-not (empty? measure-ids)
|
(when-not (empty? measure-ids)
|
||||||
[:& measures-menu {:type type :all-types all-types :ids measure-ids :values measure-values :shape shapes}])
|
[:& measures-menu {:type type :all-types all-types :ids measure-ids :values measure-values :shape shapes}])
|
||||||
|
|
||||||
(when has-layout-container?
|
[:& layout-container-menu {:type type :ids layout-container-ids :values layout-container-values :multiple true}]
|
||||||
[:& layout-container-menu {:type type :ids layout-container-ids :values layout-container-values :multiple true}])
|
|
||||||
|
|
||||||
(when (or is-layout-child? has-layout-container?)
|
(when (or is-layout-child? has-layout-container?)
|
||||||
[:& layout-item-menu
|
[:& layout-item-menu
|
||||||
|
|
|
@ -69,10 +69,11 @@
|
||||||
on-pointer-down
|
on-pointer-down
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
(fn [event]
|
(fn [event]
|
||||||
(dom/capture-pointer event)
|
(when (= 0 (.-button event))
|
||||||
(mf/set-ref-val! dragging-ref true)
|
(dom/capture-pointer event)
|
||||||
(mf/set-ref-val! start-ref (dom/get-client-position event))
|
(mf/set-ref-val! dragging-ref true)
|
||||||
(mf/set-ref-val! start-pos-ref (get @ms/mouse-position axis))))
|
(mf/set-ref-val! start-ref (dom/get-client-position event))
|
||||||
|
(mf/set-ref-val! start-pos-ref (get @ms/mouse-position axis)))))
|
||||||
|
|
||||||
on-pointer-up
|
on-pointer-up
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
|
Loading…
Add table
Reference in a new issue