mirror of
https://github.com/penpot/penpot.git
synced 2025-06-26 19:56:59 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
e271caa32b
7 changed files with 94 additions and 34 deletions
|
@ -35,7 +35,7 @@
|
||||||
- Fix problem in viewer with the back button [Taiga #10907](https://tree.taiga.io/project/penpot/issue/10907)
|
- Fix problem in viewer with the back button [Taiga #10907](https://tree.taiga.io/project/penpot/issue/10907)
|
||||||
|
|
||||||
### :bug: Bugs fixed
|
### :bug: Bugs fixed
|
||||||
|
- Fix resize bar background on tokens panel [Taiga #10811](https://tree.taiga.io/project/penpot/issue/10811)
|
||||||
- Fix shortcut for history version panel [Taiga #11006](https://tree.taiga.io/project/penpot/issue/11006)
|
- Fix shortcut for history version panel [Taiga #11006](https://tree.taiga.io/project/penpot/issue/11006)
|
||||||
- Fix positioning of comment drafts when near the right / bottom edges of viewport [Taiga #10534](https://tree.taiga.io/project/penpot/issue/10534)
|
- Fix positioning of comment drafts when near the right / bottom edges of viewport [Taiga #10534](https://tree.taiga.io/project/penpot/issue/10534)
|
||||||
- Fix path having a wrong selrect [Taiga #10257](https://tree.taiga.io/project/penpot/issue/10257)
|
- Fix path having a wrong selrect [Taiga #10257](https://tree.taiga.io/project/penpot/issue/10257)
|
||||||
|
@ -58,6 +58,7 @@
|
||||||
- Fix Out of Sync Token Value & Color Picker [Github #102](https://github.com/tokens-studio/penpot/issues/102)
|
- Fix Out of Sync Token Value & Color Picker [Github #102](https://github.com/tokens-studio/penpot/issues/102)
|
||||||
- Fix Color should preserve color space [Github #69](https://github.com/tokens-studio/penpot/issues/69)
|
- Fix Color should preserve color space [Github #69](https://github.com/tokens-studio/penpot/issues/69)
|
||||||
- Fix cannot rename Design Token Sets when group of same name exists [Taiga Issue #10773](https://tree.taiga.io/project/penpot/issue/10773)
|
- Fix cannot rename Design Token Sets when group of same name exists [Taiga Issue #10773](https://tree.taiga.io/project/penpot/issue/10773)
|
||||||
|
- Fix problem when duplicating grid layout [Github #6391](https://github.com/penpot/penpot/issues/6391)
|
||||||
|
|
||||||
## 2.6.2 (Unreleased)
|
## 2.6.2 (Unreleased)
|
||||||
|
|
||||||
|
|
|
@ -108,6 +108,7 @@
|
||||||
[::ip-addr {:optional true} ::sm/text]
|
[::ip-addr {:optional true} ::sm/text]
|
||||||
[::props {:optional true} [:map-of :keyword :any]]
|
[::props {:optional true} [:map-of :keyword :any]]
|
||||||
[::context {:optional true} [:map-of :keyword :any]]
|
[::context {:optional true} [:map-of :keyword :any]]
|
||||||
|
[::tracked-at {:optional true} ::sm/inst]
|
||||||
[::webhooks/event? {:optional true} ::sm/boolean]
|
[::webhooks/event? {:optional true} ::sm/boolean]
|
||||||
[::webhooks/batch-timeout {:optional true} ::dt/duration]
|
[::webhooks/batch-timeout {:optional true} ::dt/duration]
|
||||||
[::webhooks/batch-key {:optional true}
|
[::webhooks/batch-key {:optional true}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.db :as db]
|
[app.db :as db]
|
||||||
[app.http.client :as http]
|
[app.http.client :as http]
|
||||||
|
[app.loggers.audit :as audit]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[app.worker :as wrk]
|
[app.worker :as wrk]
|
||||||
[clojure.data.json :as json]
|
[clojure.data.json :as json]
|
||||||
|
@ -67,9 +68,18 @@
|
||||||
(defmethod ig/init-key ::process-event-handler
|
(defmethod ig/init-key ::process-event-handler
|
||||||
[_ cfg]
|
[_ cfg]
|
||||||
(fn [{:keys [props] :as task}]
|
(fn [{:keys [props] :as task}]
|
||||||
(l/dbg :hint "process webhook event" :name (:name props))
|
|
||||||
|
|
||||||
(when-let [items (lookup-webhooks cfg props)]
|
(let [items (lookup-webhooks cfg props)
|
||||||
|
event {::audit/profile-id (:profile-id props)
|
||||||
|
::audit/name "webhook"
|
||||||
|
::audit/type "trigger"
|
||||||
|
::audit/props {:name (get props :name)
|
||||||
|
:event-id (get props :id)
|
||||||
|
:total-affected (count items)}}]
|
||||||
|
|
||||||
|
(audit/insert! cfg event)
|
||||||
|
|
||||||
|
(when items
|
||||||
(l/trc :hint "webhooks found for event" :total (count items))
|
(l/trc :hint "webhooks found for event" :total (count items))
|
||||||
(db/tx-run! cfg (fn [cfg]
|
(db/tx-run! cfg (fn [cfg]
|
||||||
(doseq [item items]
|
(doseq [item items]
|
||||||
|
@ -78,7 +88,7 @@
|
||||||
(assoc ::wrk/queue :webhooks)
|
(assoc ::wrk/queue :webhooks)
|
||||||
(assoc ::wrk/max-retries 3)
|
(assoc ::wrk/max-retries 3)
|
||||||
(assoc ::wrk/params {:event props
|
(assoc ::wrk/params {:event props
|
||||||
:config item})))))))))
|
:config item}))))))))))
|
||||||
;; --- RUN
|
;; --- RUN
|
||||||
|
|
||||||
(declare interpret-exception)
|
(declare interpret-exception)
|
||||||
|
|
|
@ -1050,6 +1050,33 @@
|
||||||
:id id
|
:id id
|
||||||
:delta delta})))
|
:delta delta})))
|
||||||
|
|
||||||
|
(defn reorder-children
|
||||||
|
[changes id children]
|
||||||
|
(assert-page-id! changes)
|
||||||
|
(assert-objects! changes)
|
||||||
|
|
||||||
|
(let [page-id (::page-id (meta changes))
|
||||||
|
objects (lookup-objects changes)
|
||||||
|
shape (get objects id)
|
||||||
|
old-children (:shapes shape)
|
||||||
|
|
||||||
|
redo-change
|
||||||
|
{:type :reorder-children
|
||||||
|
:parent-id (:id shape)
|
||||||
|
:page-id page-id
|
||||||
|
:shapes children}
|
||||||
|
|
||||||
|
undo-change
|
||||||
|
{:type :reorder-children
|
||||||
|
:parent-id (:id shape)
|
||||||
|
:page-id page-id
|
||||||
|
:shapes old-children}]
|
||||||
|
|
||||||
|
(-> changes
|
||||||
|
(update :redo-changes conj redo-change)
|
||||||
|
(update :undo-changes conj undo-change)
|
||||||
|
(apply-changes-local))))
|
||||||
|
|
||||||
(defn reorder-grid-children
|
(defn reorder-grid-children
|
||||||
[changes ids]
|
[changes ids]
|
||||||
(assert-page-id! changes)
|
(assert-page-id! changes)
|
||||||
|
|
|
@ -223,10 +223,12 @@
|
||||||
"Generate changes to create a new instance from a component."
|
"Generate changes to create a new instance from a component."
|
||||||
([changes objects file-id component-id position page libraries]
|
([changes objects file-id component-id position page libraries]
|
||||||
(generate-instantiate-component changes objects file-id component-id position page libraries nil nil nil {}))
|
(generate-instantiate-component changes objects file-id component-id position page libraries nil nil nil {}))
|
||||||
|
([changes objects file-id component-id position page libraries old-id parent-id frame-id params]
|
||||||
([changes objects file-id component-id position page libraries old-id parent-id frame-id
|
(generate-instantiate-component changes objects file-id component-id position page libraries old-id parent-id frame-id {} params))
|
||||||
|
([changes objects file-id component-id position page libraries old-id parent-id frame-id ids-map
|
||||||
{:keys [force-frame?]
|
{:keys [force-frame?]
|
||||||
:or {force-frame? false}}]
|
:or {force-frame? false}}]
|
||||||
|
|
||||||
(let [component (ctf/get-component libraries file-id component-id)
|
(let [component (ctf/get-component libraries file-id component-id)
|
||||||
library (get libraries file-id)
|
library (get libraries file-id)
|
||||||
parent (when parent-id (get objects parent-id))
|
parent (when parent-id (get objects parent-id))
|
||||||
|
@ -246,6 +248,9 @@
|
||||||
(:data library)
|
(:data library)
|
||||||
position
|
position
|
||||||
(cond-> {}
|
(cond-> {}
|
||||||
|
(contains? ids-map old-id)
|
||||||
|
(assoc :force-id (get ids-map old-id))
|
||||||
|
|
||||||
force-frame?
|
force-frame?
|
||||||
(assoc :force-frame-id frame-id)))
|
(assoc :force-frame-id frame-id)))
|
||||||
|
|
||||||
|
@ -267,8 +272,11 @@
|
||||||
(cond-> (pcb/add-object changes first-shape {:ignore-touched true})
|
(cond-> (pcb/add-object changes first-shape {:ignore-touched true})
|
||||||
(some? old-id) (pcb/amend-last-change #(assoc % :old-id old-id)))
|
(some? old-id) (pcb/amend-last-change #(assoc % :old-id old-id)))
|
||||||
|
|
||||||
|
duplicated-parent?
|
||||||
|
(->> ids-map vals (some #(= % (:parent-id first-shape))))
|
||||||
|
|
||||||
changes
|
changes
|
||||||
(if (ctl/grid-layout? objects (:parent-id first-shape))
|
(if (and (ctl/grid-layout? objects (:parent-id first-shape)) (not duplicated-parent?))
|
||||||
(let [target-cell (-> position meta :cell)
|
(let [target-cell (-> position meta :cell)
|
||||||
|
|
||||||
[row column]
|
[row column]
|
||||||
|
@ -2028,17 +2036,26 @@
|
||||||
[changes library-data component-id library-id current-page objects]
|
[changes library-data component-id library-id current-page objects]
|
||||||
(let [{:keys [changes shape]} (prepare-restore-component changes library-data component-id current-page)
|
(let [{:keys [changes shape]} (prepare-restore-component changes library-data component-id current-page)
|
||||||
parent-id (:parent-id shape)
|
parent-id (:parent-id shape)
|
||||||
objects (cond-> (assoc objects (:id shape) shape)
|
|
||||||
(not (nil? parent-id))
|
insert-before?
|
||||||
(update-in [parent-id :shapes]
|
(and (ctl/flex-layout? objects parent-id)
|
||||||
#(conj % (:id shape))))
|
(not (ctl/reverse? objects parent-id)))
|
||||||
|
|
||||||
|
objects
|
||||||
|
(-> objects
|
||||||
|
(assoc (:id shape) shape)
|
||||||
|
(cond-> (and (some? parent-id) insert-before?)
|
||||||
|
(update-in [parent-id :shapes] #(d/concat-vec [(:id shape)] %)))
|
||||||
|
(cond-> (and (some? parent-id) (not insert-before?))
|
||||||
|
(update-in [parent-id :shapes] conj (:id shape))))
|
||||||
|
|
||||||
;; Adds a resize-parents operation so the groups are updated. We add all the new objects
|
;; Adds a resize-parents operation so the groups are updated. We add all the new objects
|
||||||
new-objects-ids (->> changes :redo-changes (filter #(= (:type %) :add-obj)) (mapv :id))
|
new-objects-ids (->> changes :redo-changes (filter #(= (:type %) :add-obj)) (mapv :id))
|
||||||
changes (-> changes
|
changes (-> changes
|
||||||
(pcb/with-objects objects)
|
(pcb/with-objects objects)
|
||||||
(pcb/resize-parents new-objects-ids))]
|
(pcb/resize-parents new-objects-ids)
|
||||||
|
;; Fix the order of the children inside the parent
|
||||||
|
(pcb/reorder-children parent-id (get-in objects [parent-id :shapes])))]
|
||||||
(assoc changes :file-id library-id)))
|
(assoc changes :file-id library-id)))
|
||||||
|
|
||||||
(defn generate-detach-component
|
(defn generate-detach-component
|
||||||
|
@ -2277,6 +2294,7 @@
|
||||||
main-id
|
main-id
|
||||||
parent-id
|
parent-id
|
||||||
frame-id
|
frame-id
|
||||||
|
ids-map
|
||||||
{})))]
|
{})))]
|
||||||
changes))
|
changes))
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ $width-settings-bar-max: $s-500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.resize-area-horiz {
|
.resize-area-horiz {
|
||||||
|
background-color: var(--panel-background-color);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -193,12 +193,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.resize-area-horiz {
|
.resize-area-horiz {
|
||||||
|
background-color: var(--panel-background-color);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: $s-3 0 $s-1 0;
|
padding: $s-3 0 $s-1 0;
|
||||||
height: $s-6;
|
height: $s-6;
|
||||||
cursor: ns-resize;
|
cursor: ns-resize;
|
||||||
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.resize-handle-horiz {
|
.resize-handle-horiz {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue