mirror of
https://github.com/penpot/penpot.git
synced 2025-05-16 13:56:11 +02:00
Merge remote-tracking branch 'origin/staging' into develop
This commit is contained in:
commit
05716c7164
4 changed files with 16 additions and 4 deletions
|
@ -1118,6 +1118,9 @@
|
||||||
(rx/of (rt/nav :dashboard-projects {:team-id team-id}))))))
|
(rx/of (rt/nav :dashboard-projects {:team-id team-id}))))))
|
||||||
([team-id]
|
([team-id]
|
||||||
(ptk/reify ::go-to-projects-1
|
(ptk/reify ::go-to-projects-1
|
||||||
|
ptk/UpdateEvent
|
||||||
|
(update [_ state]
|
||||||
|
(assoc state :current-team-id team-id))
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ _ _]
|
(watch [_ _ _]
|
||||||
(rx/of (rt/nav :dashboard-projects {:team-id team-id}))))))
|
(rx/of (rt/nav :dashboard-projects {:team-id team-id}))))))
|
||||||
|
|
|
@ -27,6 +27,13 @@
|
||||||
[app.util.text.content.styles :as styles]
|
[app.util.text.content.styles :as styles]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
(defn- gen-name
|
||||||
|
[editor]
|
||||||
|
(when (some? editor)
|
||||||
|
(let [editor-root (.-root editor)
|
||||||
|
result (.-textContent editor-root)]
|
||||||
|
(when (not= result "") result))))
|
||||||
|
|
||||||
(defn- initialize-event-handlers
|
(defn- initialize-event-handlers
|
||||||
"Internal editor events handler initializer/destructor"
|
"Internal editor events handler initializer/destructor"
|
||||||
[shape-id content selection-ref editor-ref container-ref]
|
[shape-id content selection-ref editor-ref container-ref]
|
||||||
|
@ -51,6 +58,8 @@
|
||||||
instance
|
instance
|
||||||
(dwt/create-editor editor-node options)
|
(dwt/create-editor editor-node options)
|
||||||
|
|
||||||
|
update-name? (nil? content)
|
||||||
|
|
||||||
on-key-up
|
on-key-up
|
||||||
(fn [event]
|
(fn [event]
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
|
@ -60,7 +69,7 @@
|
||||||
on-blur
|
on-blur
|
||||||
(fn []
|
(fn []
|
||||||
(when-let [content (content/dom->cljs (dwt/get-editor-root instance))]
|
(when-let [content (content/dom->cljs (dwt/get-editor-root instance))]
|
||||||
(st/emit! (dwt/v2-update-text-shape-content shape-id content true)))
|
(st/emit! (dwt/v2-update-text-shape-content shape-id content update-name? (gen-name instance))))
|
||||||
|
|
||||||
(let [container-node (mf/ref-val container-ref)]
|
(let [container-node (mf/ref-val container-ref)]
|
||||||
(dom/set-style! container-node "opacity" 0)))
|
(dom/set-style! container-node "opacity" 0)))
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
;; height: number;
|
;; height: number;
|
||||||
;; mtype?: string;
|
;; mtype?: string;
|
||||||
;; id: string;
|
;; id: string;
|
||||||
;; keepApectRatio?: boolean;
|
;; keepAspectRatio?: boolean;
|
||||||
;; };
|
;; };
|
||||||
(defn format-image
|
(defn format-image
|
||||||
[{:keys [name width height mtype id keep-aspect-ratio] :as image}]
|
[{:keys [name width height mtype id keep-aspect-ratio] :as image}]
|
||||||
|
|
|
@ -66,7 +66,7 @@
|
||||||
;; height: number;
|
;; height: number;
|
||||||
;; mtype?: string;
|
;; mtype?: string;
|
||||||
;; id: string;
|
;; id: string;
|
||||||
;; keepApectRatio?: boolean;
|
;; keepAspectRatio?: boolean;
|
||||||
;;}
|
;;}
|
||||||
(defn parse-image-data
|
(defn parse-image-data
|
||||||
[^js image-data]
|
[^js image-data]
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
:width (obj/get image-data "width")
|
:width (obj/get image-data "width")
|
||||||
:height (obj/get image-data "height")
|
:height (obj/get image-data "height")
|
||||||
:mtype (obj/get image-data "mtype")
|
:mtype (obj/get image-data "mtype")
|
||||||
:keep-aspect-ratio (obj/get image-data "keepApectRatio")})))
|
:keep-aspect-ratio (obj/get image-data "keepAspectRatio")})))
|
||||||
|
|
||||||
;; export type Gradient = {
|
;; export type Gradient = {
|
||||||
;; type: 'linear' | 'radial';
|
;; type: 'linear' | 'radial';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue