mirror of
https://github.com/penpot/penpot.git
synced 2025-01-22 14:39:45 -05: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)
|
||||
(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?)
|
||||
(assoc :fills [] :hide-in-viewer true)))
|
||||
(assoc :fills [] :hide-in-viewer true :show-content true)))
|
||||
|
||||
shape
|
||||
(with-meta shape {:index new-index})
|
||||
|
|
|
@ -65,6 +65,11 @@
|
|||
:layout-padding-type
|
||||
:layout-padding
|
||||
|
||||
:layout-grid-dir
|
||||
:layout-justify-items
|
||||
:layout-grid-columns
|
||||
:layout-grid-rows
|
||||
|
||||
:layout-item-margin
|
||||
:layout-item-margin-type
|
||||
:layout-item-h-sizing
|
||||
|
|
|
@ -215,7 +215,6 @@
|
|||
|
||||
target-frame
|
||||
(->> (ctst/get-frames-by-position objects position)
|
||||
(remove :hide-in-viewer)
|
||||
(last))]
|
||||
|
||||
(when (and (not= (:id target-frame) uuid/zero)
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
(ns app.main.data.workspace.layout
|
||||
"Workspace layout management events and helpers."
|
||||
(:require
|
||||
[app.common.data :as d]
|
||||
[app.common.data.macros :as dm]
|
||||
[app.main.data.events :as ev]
|
||||
[app.util.storage :refer [storage]]
|
||||
|
@ -123,7 +124,7 @@
|
|||
ev/Event
|
||||
(-data [_]
|
||||
{::ev/origin "workspace:sidebar"
|
||||
:mode (name mode)})
|
||||
:mode (d/name mode)})
|
||||
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
(ptk/reify ::create-shape-layout
|
||||
ev/Event
|
||||
(-data [_]
|
||||
{:layout (name type)})
|
||||
{:layout (d/name type)})
|
||||
|
||||
ptk/WatchEvent
|
||||
(watch [_ state _]
|
||||
|
|
|
@ -69,47 +69,50 @@
|
|||
|
||||
(defn generate-report
|
||||
[data]
|
||||
(let [team-id (:current-team-id @st/state)
|
||||
profile-id (:profile-id @st/state)
|
||||
(try
|
||||
(let [team-id (:current-team-id @st/state)
|
||||
profile-id (:profile-id @st/state)
|
||||
|
||||
trace (:app.main.errors/trace data)
|
||||
instance (:app.main.errors/instance data)
|
||||
content (with-out-str
|
||||
(println "Hint: " (or (:hint data) (ex-message instance) "--"))
|
||||
(println "Prof ID:" (str (or profile-id "--")))
|
||||
(println "Team ID:" (str (or team-id "--")))
|
||||
trace (:app.main.errors/trace data)
|
||||
instance (:app.main.errors/instance data)
|
||||
content (with-out-str
|
||||
(println "Hint: " (or (:hint data) (ex-message instance) "--"))
|
||||
(println "Prof ID:" (str (or profile-id "--")))
|
||||
(println "Team ID:" (str (or team-id "--")))
|
||||
|
||||
(when-let [file-id (:file-id data)]
|
||||
(println "File ID:" (str file-id)))
|
||||
|
||||
(println)
|
||||
|
||||
(println "Data:")
|
||||
(loop [data data]
|
||||
(-> (d/without-qualified data)
|
||||
(dissoc :explain)
|
||||
(d/update-when :data (constantly "(...)"))
|
||||
(pp/pprint {:level 8 :length 10}))
|
||||
(when-let [file-id (:file-id data)]
|
||||
(println "File ID:" (str file-id)))
|
||||
|
||||
(println)
|
||||
|
||||
(when-let [explain (:explain data)]
|
||||
(print explain))
|
||||
(println "Data:")
|
||||
(loop [data data]
|
||||
(-> (d/without-qualified data)
|
||||
(dissoc :explain)
|
||||
(d/update-when :data (constantly "(...)"))
|
||||
(pp/pprint {:level 8 :length 10}))
|
||||
|
||||
(when (and (= :server-error (:type data))
|
||||
(contains? data :data))
|
||||
(recur (:data data))))
|
||||
(println)
|
||||
|
||||
(println "Trace:")
|
||||
(println trace)
|
||||
(println)
|
||||
(when-let [explain (:explain data)]
|
||||
(print explain))
|
||||
|
||||
(println "Last events:")
|
||||
(pp/pprint @st/last-events {:length 200})
|
||||
(when (and (= :server-error (:type data))
|
||||
(contains? data :data))
|
||||
(recur (:data data))))
|
||||
|
||||
(println))]
|
||||
(println "Trace:")
|
||||
(println trace)
|
||||
(println)
|
||||
|
||||
(wapi/create-blob content "text/plain")))
|
||||
(println "Last events:")
|
||||
(pp/pprint @st/last-events {:length 200})
|
||||
|
||||
(println))]
|
||||
(wapi/create-blob content "text/plain"))
|
||||
(catch :default err
|
||||
(.error js/console err)
|
||||
nil)))
|
||||
|
||||
|
||||
(mf/defc internal-error
|
||||
|
@ -117,6 +120,7 @@
|
|||
[{:keys [data]}]
|
||||
(let [on-click (mf/use-fn #(st/emit! (rt/assign-exception nil)))
|
||||
report-uri (mf/use-ref nil)
|
||||
report (mf/use-memo (mf/deps data) #(generate-report data))
|
||||
|
||||
on-download
|
||||
(mf/use-fn
|
||||
|
@ -125,17 +129,18 @@
|
|||
(when-let [uri (mf/ref-val report-uri)]
|
||||
(dom/trigger-download-uri "report" "text/plain" uri))))]
|
||||
|
||||
(mf/with-effect [data]
|
||||
(let [report (generate-report data)
|
||||
uri (wapi/create-uri report)]
|
||||
(mf/set-ref-val! report-uri uri)
|
||||
(fn []
|
||||
(wapi/revoke-uri uri))))
|
||||
(mf/with-effect [report]
|
||||
(when (some? report)
|
||||
(let [uri (wapi/create-uri report)]
|
||||
(mf/set-ref-val! report-uri uri)
|
||||
(fn []
|
||||
(wapi/revoke-uri uri)))))
|
||||
|
||||
[:> error-container {}
|
||||
[:div {:class (stl/css :main-message)} (tr "labels.internal-error.main-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)}
|
||||
[:button {:on-click on-click} (tr "labels.retry")]]]))
|
||||
|
||||
|
|
|
@ -492,7 +492,7 @@
|
|||
[:button {:class (stl/css-case
|
||||
:padding-toggle true
|
||||
:selected (= type :multiple))
|
||||
:data-type (name type)
|
||||
:data-type (d/name type)
|
||||
:on-click on-type-change'}
|
||||
i/padding-extended-refactor]]))
|
||||
|
||||
|
@ -557,7 +557,7 @@
|
|||
:no-validate true
|
||||
:placeholder "--"
|
||||
:data-type "row-gap"
|
||||
:data-wrap-type (name wrap-type)
|
||||
:data-wrap-type (d/name wrap-type)
|
||||
:on-focus on-gap-focus
|
||||
:on-change on-change'
|
||||
:on-blur on-gap-blur
|
||||
|
@ -576,7 +576,7 @@
|
|||
:no-validate true
|
||||
:placeholder "--"
|
||||
:data-type "column-gap"
|
||||
:data-wrap-type (name wrap-type)
|
||||
:data-wrap-type (d/name wrap-type)
|
||||
:on-focus on-gap-focus
|
||||
:on-change on-change'
|
||||
:on-blur on-gap-blur
|
||||
|
@ -627,7 +627,7 @@
|
|||
::mf/private true}
|
||||
[{:keys [is-column value on-change]}]
|
||||
(let [type (if ^boolean is-column "column" "row")]
|
||||
[:& radio-buttons {:selected (name value)
|
||||
[:& radio-buttons {:selected (d/name value)
|
||||
:decode-fn keyword
|
||||
:on-change on-change
|
||||
:name (dm/str "flex-align-items-" type)}
|
||||
|
@ -649,7 +649,7 @@
|
|||
::mf/private :obj}
|
||||
[{:keys [is-column value on-change]}]
|
||||
(let [type (if ^boolean is-column "column" "row")]
|
||||
[:& radio-buttons {:selected (name value)
|
||||
[:& radio-buttons {:selected (d/name value)
|
||||
:on-change on-change
|
||||
:decode-fn keyword
|
||||
:name (dm/str "grid-justify-items-" type)}
|
||||
|
@ -811,7 +811,7 @@
|
|||
[:& h/sortable-container {}
|
||||
[:div {:class (stl/css :grid-tracks-info-container)}
|
||||
(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
|
||||
:is-column is-column
|
||||
:index index
|
||||
|
@ -1137,7 +1137,7 @@
|
|||
[:div {:class (stl/css :row :padding-section)}
|
||||
[:& padding-section {:value (:layout-padding 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}]]]
|
||||
|
||||
nil))]))
|
||||
|
@ -1324,7 +1324,7 @@
|
|||
[:div {:class (stl/css :row :padding-section)}
|
||||
[:& padding-section {:value (:layout-padding 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}]]
|
||||
|
||||
[:div {:class (stl/css :row :grid-tracks-row)}
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
|
||||
detach-color
|
||||
(mf/use-fn
|
||||
(mf/deps ids index)
|
||||
(mf/deps ids index value)
|
||||
(fn [_color _opacity]
|
||||
(when-not (string? (:color value))
|
||||
(st/emit! (dch/update-shapes
|
||||
|
|
Loading…
Add table
Reference in a new issue