mirror of
https://github.com/penpot/penpot.git
synced 2025-07-18 07:57:12 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
c2649ffd1c
5 changed files with 16 additions and 12 deletions
|
@ -698,11 +698,7 @@
|
||||||
|
|
||||||
(defn get-team-recent-files
|
(defn get-team-recent-files
|
||||||
[conn team-id]
|
[conn team-id]
|
||||||
(->> (db/exec! conn [sql:team-recent-files team-id])
|
(db/exec! conn [sql:team-recent-files team-id]))
|
||||||
(mapv (fn [row]
|
|
||||||
(if-let [media-id (:thumbnail-id row)]
|
|
||||||
(assoc row :thumbnail-uri (resolve-public-uri media-id))
|
|
||||||
(dissoc row :media-id))))))
|
|
||||||
|
|
||||||
(def ^:private schema:get-team-recent-files
|
(def ^:private schema:get-team-recent-files
|
||||||
[:map {:title "get-team-recent-files"}
|
[:map {:title "get-team-recent-files"}
|
||||||
|
|
|
@ -881,6 +881,12 @@
|
||||||
(rx/of
|
(rx/of
|
||||||
(dwu/start-undo-transaction undo-id)
|
(dwu/start-undo-transaction undo-id)
|
||||||
(update-component shape-id undo-group)
|
(update-component shape-id undo-group)
|
||||||
|
|
||||||
|
;; These two calls are necessary for properly sync thumbnails
|
||||||
|
;; when a main component does not live in the same page
|
||||||
|
(update-component-thumbnail-sync state component-id file-id "frame")
|
||||||
|
(update-component-thumbnail-sync state component-id file-id "component")
|
||||||
|
|
||||||
(sync-file current-file-id file-id :components component-id undo-group)
|
(sync-file current-file-id file-id :components component-id undo-group)
|
||||||
(when (not current-file?)
|
(when (not current-file?)
|
||||||
(sync-file file-id file-id :components component-id undo-group))
|
(sync-file file-id file-id :components component-id undo-group))
|
||||||
|
|
|
@ -99,7 +99,7 @@
|
||||||
[{:keys [shape]}]
|
[{:keys [shape]}]
|
||||||
(let [thumbnails? (mf/use-ctx muc/render-thumbnails)
|
(let [thumbnails? (mf/use-ctx muc/render-thumbnails)
|
||||||
childs (mapv (d/getf objects) (:shapes shape))]
|
childs (mapv (d/getf objects) (:shapes shape))]
|
||||||
(if (and thumbnails? (some? (:thumbnail shape)))
|
(if (and thumbnails? (some? (:thumbnail-id shape)))
|
||||||
[:& frame/frame-thumbnail {:shape shape :bounds (:children-bounds shape)}]
|
[:& frame/frame-thumbnail {:shape shape :bounds (:children-bounds shape)}]
|
||||||
[:& frame-shape {:shape shape :childs childs}])))))
|
[:& frame-shape {:shape shape :childs childs}])))))
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,6 @@
|
||||||
(mf/defc frame-container
|
(mf/defc frame-container
|
||||||
{::mf/wrap-props false}
|
{::mf/wrap-props false}
|
||||||
[props]
|
[props]
|
||||||
|
|
||||||
(let [shape (unchecked-get props "shape")
|
(let [shape (unchecked-get props "shape")
|
||||||
children (unchecked-get props "children")
|
children (unchecked-get props "children")
|
||||||
|
|
||||||
|
|
|
@ -73,11 +73,14 @@
|
||||||
;; it affects to the height calculation the browser does
|
;; it affects to the height calculation the browser does
|
||||||
font-size (if (some #(not= "" (:text %)) (:children paragraph))
|
font-size (if (some #(not= "" (:text %)) (:children paragraph))
|
||||||
"0"
|
"0"
|
||||||
(:font-size styles (:font-size txt/default-text-attrs)))]
|
(:font-size styles (:font-size txt/default-text-attrs)))
|
||||||
(cond-> styles
|
|
||||||
;; Every paragraph must have line-height to be correctly rendered
|
line-height (:line-height styles)
|
||||||
(nil? (:line-height styles)) (assoc :line-height (:line-height txt/default-text-attrs))
|
line-height (if (and (some? line-height) (not= "" line-height))
|
||||||
true (assoc :font-size font-size))))
|
line-height
|
||||||
|
(:line-height txt/default-text-attrs))]
|
||||||
|
(-> styles
|
||||||
|
(assoc :font-size font-size :line-height line-height))))
|
||||||
|
|
||||||
(defn get-root-styles
|
(defn get-root-styles
|
||||||
[root]
|
[root]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue