mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
d5dbe0b594
8 changed files with 62 additions and 51 deletions
|
@ -122,8 +122,9 @@
|
||||||
(some? layout-props)
|
(some? layout-props)
|
||||||
(d/patch-object layout-props)
|
(d/patch-object layout-props)
|
||||||
|
|
||||||
|
;; Frames from shapes will not be displayed in viewer and no clipped
|
||||||
(or (not= frame-id uuid/zero) without-fill?)
|
(or (not= frame-id uuid/zero) without-fill?)
|
||||||
(assoc :fills [] :hide-in-viewer true)))
|
(assoc :fills [] :hide-in-viewer true :show-content true)))
|
||||||
|
|
||||||
shape
|
shape
|
||||||
(with-meta shape {:index new-index})
|
(with-meta shape {:index new-index})
|
||||||
|
|
|
@ -65,6 +65,11 @@
|
||||||
:layout-padding-type
|
:layout-padding-type
|
||||||
:layout-padding
|
:layout-padding
|
||||||
|
|
||||||
|
:layout-grid-dir
|
||||||
|
:layout-justify-items
|
||||||
|
:layout-grid-columns
|
||||||
|
:layout-grid-rows
|
||||||
|
|
||||||
:layout-item-margin
|
:layout-item-margin
|
||||||
:layout-item-margin-type
|
:layout-item-margin-type
|
||||||
:layout-item-h-sizing
|
:layout-item-h-sizing
|
||||||
|
|
|
@ -215,7 +215,6 @@
|
||||||
|
|
||||||
target-frame
|
target-frame
|
||||||
(->> (ctst/get-frames-by-position objects position)
|
(->> (ctst/get-frames-by-position objects position)
|
||||||
(remove :hide-in-viewer)
|
|
||||||
(last))]
|
(last))]
|
||||||
|
|
||||||
(when (and (not= (:id target-frame) uuid/zero)
|
(when (and (not= (:id target-frame) uuid/zero)
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
(ns app.main.data.workspace.layout
|
(ns app.main.data.workspace.layout
|
||||||
"Workspace layout management events and helpers."
|
"Workspace layout management events and helpers."
|
||||||
(:require
|
(:require
|
||||||
|
[app.common.data :as d]
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.main.data.events :as ev]
|
[app.main.data.events :as ev]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
|
@ -123,7 +124,7 @@
|
||||||
ev/Event
|
ev/Event
|
||||||
(-data [_]
|
(-data [_]
|
||||||
{::ev/origin "workspace:sidebar"
|
{::ev/origin "workspace:sidebar"
|
||||||
:mode (name mode)})
|
:mode (d/name mode)})
|
||||||
|
|
||||||
ptk/UpdateEvent
|
ptk/UpdateEvent
|
||||||
(update [_ state]
|
(update [_ state]
|
||||||
|
|
|
@ -211,7 +211,7 @@
|
||||||
(ptk/reify ::create-shape-layout
|
(ptk/reify ::create-shape-layout
|
||||||
ev/Event
|
ev/Event
|
||||||
(-data [_]
|
(-data [_]
|
||||||
{:layout (name type)})
|
{:layout (d/name type)})
|
||||||
|
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ state _]
|
||||||
|
|
|
@ -69,6 +69,7 @@
|
||||||
|
|
||||||
(defn generate-report
|
(defn generate-report
|
||||||
[data]
|
[data]
|
||||||
|
(try
|
||||||
(let [team-id (:current-team-id @st/state)
|
(let [team-id (:current-team-id @st/state)
|
||||||
profile-id (:profile-id @st/state)
|
profile-id (:profile-id @st/state)
|
||||||
|
|
||||||
|
@ -108,8 +109,10 @@
|
||||||
(pp/pprint @st/last-events {:length 200})
|
(pp/pprint @st/last-events {:length 200})
|
||||||
|
|
||||||
(println))]
|
(println))]
|
||||||
|
(wapi/create-blob content "text/plain"))
|
||||||
(wapi/create-blob content "text/plain")))
|
(catch :default err
|
||||||
|
(.error js/console err)
|
||||||
|
nil)))
|
||||||
|
|
||||||
|
|
||||||
(mf/defc internal-error
|
(mf/defc internal-error
|
||||||
|
@ -117,6 +120,7 @@
|
||||||
[{:keys [data]}]
|
[{:keys [data]}]
|
||||||
(let [on-click (mf/use-fn #(st/emit! (rt/assign-exception nil)))
|
(let [on-click (mf/use-fn #(st/emit! (rt/assign-exception nil)))
|
||||||
report-uri (mf/use-ref nil)
|
report-uri (mf/use-ref nil)
|
||||||
|
report (mf/use-memo (mf/deps data) #(generate-report data))
|
||||||
|
|
||||||
on-download
|
on-download
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
|
@ -125,17 +129,18 @@
|
||||||
(when-let [uri (mf/ref-val report-uri)]
|
(when-let [uri (mf/ref-val report-uri)]
|
||||||
(dom/trigger-download-uri "report" "text/plain" uri))))]
|
(dom/trigger-download-uri "report" "text/plain" uri))))]
|
||||||
|
|
||||||
(mf/with-effect [data]
|
(mf/with-effect [report]
|
||||||
(let [report (generate-report data)
|
(when (some? report)
|
||||||
uri (wapi/create-uri report)]
|
(let [uri (wapi/create-uri report)]
|
||||||
(mf/set-ref-val! report-uri uri)
|
(mf/set-ref-val! report-uri uri)
|
||||||
(fn []
|
(fn []
|
||||||
(wapi/revoke-uri uri))))
|
(wapi/revoke-uri uri)))))
|
||||||
|
|
||||||
[:> error-container {}
|
[:> error-container {}
|
||||||
[:div {:class (stl/css :main-message)} (tr "labels.internal-error.main-message")]
|
[:div {:class (stl/css :main-message)} (tr "labels.internal-error.main-message")]
|
||||||
[:div {:class (stl/css :desc-message)} (tr "labels.internal-error.desc-message")]
|
[:div {:class (stl/css :desc-message)} (tr "labels.internal-error.desc-message")]
|
||||||
[:a {:on-click on-download} "Download report.txt"]
|
(when (some? report)
|
||||||
|
[:a {:on-click on-download} "Download report.txt"])
|
||||||
[:div {:class (stl/css :sign-info)}
|
[:div {:class (stl/css :sign-info)}
|
||||||
[:button {:on-click on-click} (tr "labels.retry")]]]))
|
[:button {:on-click on-click} (tr "labels.retry")]]]))
|
||||||
|
|
||||||
|
|
|
@ -492,7 +492,7 @@
|
||||||
[:button {:class (stl/css-case
|
[:button {:class (stl/css-case
|
||||||
:padding-toggle true
|
:padding-toggle true
|
||||||
:selected (= type :multiple))
|
:selected (= type :multiple))
|
||||||
:data-type (name type)
|
:data-type (d/name type)
|
||||||
:on-click on-type-change'}
|
:on-click on-type-change'}
|
||||||
i/padding-extended-refactor]]))
|
i/padding-extended-refactor]]))
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@
|
||||||
:no-validate true
|
:no-validate true
|
||||||
:placeholder "--"
|
:placeholder "--"
|
||||||
:data-type "row-gap"
|
:data-type "row-gap"
|
||||||
:data-wrap-type (name wrap-type)
|
:data-wrap-type (d/name wrap-type)
|
||||||
:on-focus on-gap-focus
|
:on-focus on-gap-focus
|
||||||
:on-change on-change'
|
:on-change on-change'
|
||||||
:on-blur on-gap-blur
|
:on-blur on-gap-blur
|
||||||
|
@ -576,7 +576,7 @@
|
||||||
:no-validate true
|
:no-validate true
|
||||||
:placeholder "--"
|
:placeholder "--"
|
||||||
:data-type "column-gap"
|
:data-type "column-gap"
|
||||||
:data-wrap-type (name wrap-type)
|
:data-wrap-type (d/name wrap-type)
|
||||||
:on-focus on-gap-focus
|
:on-focus on-gap-focus
|
||||||
:on-change on-change'
|
:on-change on-change'
|
||||||
:on-blur on-gap-blur
|
:on-blur on-gap-blur
|
||||||
|
@ -627,7 +627,7 @@
|
||||||
::mf/private true}
|
::mf/private true}
|
||||||
[{:keys [is-column value on-change]}]
|
[{:keys [is-column value on-change]}]
|
||||||
(let [type (if ^boolean is-column "column" "row")]
|
(let [type (if ^boolean is-column "column" "row")]
|
||||||
[:& radio-buttons {:selected (name value)
|
[:& radio-buttons {:selected (d/name value)
|
||||||
:decode-fn keyword
|
:decode-fn keyword
|
||||||
:on-change on-change
|
:on-change on-change
|
||||||
:name (dm/str "flex-align-items-" type)}
|
:name (dm/str "flex-align-items-" type)}
|
||||||
|
@ -649,7 +649,7 @@
|
||||||
::mf/private :obj}
|
::mf/private :obj}
|
||||||
[{:keys [is-column value on-change]}]
|
[{:keys [is-column value on-change]}]
|
||||||
(let [type (if ^boolean is-column "column" "row")]
|
(let [type (if ^boolean is-column "column" "row")]
|
||||||
[:& radio-buttons {:selected (name value)
|
[:& radio-buttons {:selected (d/name value)
|
||||||
:on-change on-change
|
:on-change on-change
|
||||||
:decode-fn keyword
|
:decode-fn keyword
|
||||||
:name (dm/str "grid-justify-items-" type)}
|
:name (dm/str "grid-justify-items-" type)}
|
||||||
|
@ -811,7 +811,7 @@
|
||||||
[:& h/sortable-container {}
|
[:& h/sortable-container {}
|
||||||
[:div {:class (stl/css :grid-tracks-info-container)}
|
[:div {:class (stl/css :grid-tracks-info-container)}
|
||||||
(for [[index column] (d/enumerate column-values)]
|
(for [[index column] (d/enumerate column-values)]
|
||||||
[:& grid-track-info {:key (dm/str index "-" (name type))
|
[:& grid-track-info {:key (dm/str index "-" (d/name type))
|
||||||
:type type
|
:type type
|
||||||
:is-column is-column
|
:is-column is-column
|
||||||
:index index
|
:index index
|
||||||
|
@ -1137,7 +1137,7 @@
|
||||||
[:div {:class (stl/css :row :padding-section)}
|
[:div {:class (stl/css :row :padding-section)}
|
||||||
[:& padding-section {:value (:layout-padding values)
|
[:& padding-section {:value (:layout-padding values)
|
||||||
:type (:layout-padding-type values)
|
:type (:layout-padding-type values)
|
||||||
:on-change-style on-padding-type-change
|
:on-type-change on-padding-type-change
|
||||||
:on-change on-padding-change}]]]
|
:on-change on-padding-change}]]]
|
||||||
|
|
||||||
nil))]))
|
nil))]))
|
||||||
|
@ -1324,7 +1324,7 @@
|
||||||
[:div {:class (stl/css :row :padding-section)}
|
[:div {:class (stl/css :row :padding-section)}
|
||||||
[:& padding-section {:value (:layout-padding values)
|
[:& padding-section {:value (:layout-padding values)
|
||||||
:type (:layout-padding-type values)
|
:type (:layout-padding-type values)
|
||||||
:on-change-style on-padding-type-change
|
:on-type-change on-padding-type-change
|
||||||
:on-change on-padding-change}]]
|
:on-change on-padding-change}]]
|
||||||
|
|
||||||
[:div {:class (stl/css :row :grid-tracks-row)}
|
[:div {:class (stl/css :row :grid-tracks-row)}
|
||||||
|
|
|
@ -116,7 +116,7 @@
|
||||||
|
|
||||||
detach-color
|
detach-color
|
||||||
(mf/use-fn
|
(mf/use-fn
|
||||||
(mf/deps ids index)
|
(mf/deps ids index value)
|
||||||
(fn [_color _opacity]
|
(fn [_color _opacity]
|
||||||
(when-not (string? (:color value))
|
(when-not (string? (:color value))
|
||||||
(st/emit! (dch/update-shapes
|
(st/emit! (dch/update-shapes
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue