mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 07:59:36 +00:00
Adapt the rest of the platform for actions api changes.
Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
parent
5d5a0c9ea0
commit
4dd97ca8ab
@ -63,8 +63,7 @@
|
|||||||
:else
|
:else
|
||||||
(do
|
(do
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(uuc/release-action! :draw/selrect)
|
(uuc/release-all-actions!))))
|
||||||
(uuc/release-action! :shape/movement))))
|
|
||||||
|
|
||||||
(declare handlers)
|
(declare handlers)
|
||||||
|
|
||||||
|
|||||||
@ -56,8 +56,7 @@
|
|||||||
:else
|
:else
|
||||||
(do
|
(do
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(uuc/release-action! :draw/selrect)
|
(uuc/release-all-actions!))))
|
||||||
(uuc/release-action! :shape/movement))))
|
|
||||||
|
|
||||||
(defn- text-component-did-mount
|
(defn- text-component-did-mount
|
||||||
[own]
|
[own]
|
||||||
|
|||||||
@ -87,6 +87,7 @@
|
|||||||
[own]
|
[own]
|
||||||
(letfn [(handle-scroll-interaction []
|
(letfn [(handle-scroll-interaction []
|
||||||
(let [stoper (->> uuc/actions-s
|
(let [stoper (->> uuc/actions-s
|
||||||
|
(rx/map :type)
|
||||||
(rx/filter #(not= % :scroll/viewport))
|
(rx/filter #(not= % :scroll/viewport))
|
||||||
(rx/take 1))
|
(rx/take 1))
|
||||||
local (:rum/local own)
|
local (:rum/local own)
|
||||||
@ -110,6 +111,7 @@
|
|||||||
|
|
||||||
(let [el (mx/get-ref-dom own "workspace-canvas")
|
(let [el (mx/get-ref-dom own "workspace-canvas")
|
||||||
sub (as-> uuc/actions-s $
|
sub (as-> uuc/actions-s $
|
||||||
|
(rx/map :type $)
|
||||||
(rx/dedupe $)
|
(rx/dedupe $)
|
||||||
(rx/filter #(= :scroll/viewport %) $)
|
(rx/filter #(= :scroll/viewport %) $)
|
||||||
(rx/on-value $ handle-scroll-interaction))]
|
(rx/on-value $ handle-scroll-interaction))]
|
||||||
|
|||||||
@ -88,8 +88,7 @@
|
|||||||
(uuc/acquire-action! :draw/selrect)))
|
(uuc/acquire-action! :draw/selrect)))
|
||||||
(on-mouse-up [event]
|
(on-mouse-up [event]
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(uuc/release-action! :draw/shape)
|
(uuc/release-all-actions!))]
|
||||||
(uuc/release-action! :draw/selrect))]
|
|
||||||
(html
|
(html
|
||||||
[:svg.viewport {:width uuwb/viewport-width
|
[:svg.viewport {:width uuwb/viewport-width
|
||||||
:height uuwb/viewport-height
|
:height uuwb/viewport-height
|
||||||
|
|||||||
@ -52,6 +52,7 @@
|
|||||||
(reset! +drawing-position+ (assoc point :lock false))
|
(reset! +drawing-position+ (assoc point :lock false))
|
||||||
|
|
||||||
(let [stoper (->> uuc/actions-s
|
(let [stoper (->> uuc/actions-s
|
||||||
|
(rx/map :type)
|
||||||
(rx/filter #(not= % :shape/movement))
|
(rx/filter #(not= % :shape/movement))
|
||||||
(rx/take 1))]
|
(rx/take 1))]
|
||||||
(as-> wb/mouse-canvas-s $
|
(as-> wb/mouse-canvas-s $
|
||||||
@ -87,6 +88,7 @@
|
|||||||
:builtin/line (init-shape shape))))]
|
:builtin/line (init-shape shape))))]
|
||||||
|
|
||||||
(as-> uuc/actions-s $
|
(as-> uuc/actions-s $
|
||||||
|
(rx/map :type $)
|
||||||
(rx/dedupe $)
|
(rx/dedupe $)
|
||||||
(rx/filter #(= :draw/shape %) $)
|
(rx/filter #(= :draw/shape %) $)
|
||||||
(rx/on-value $ init))))
|
(rx/on-value $ init))))
|
||||||
|
|||||||
@ -20,12 +20,14 @@
|
|||||||
|
|
||||||
(init []
|
(init []
|
||||||
(as-> uuc/actions-s $
|
(as-> uuc/actions-s $
|
||||||
|
(rx/map :type $)
|
||||||
(rx/filter #(not= % :shape/movement) $)
|
(rx/filter #(not= % :shape/movement) $)
|
||||||
(rx/take 1 $)
|
(rx/take 1 $)
|
||||||
(rx/take-until $ uuwb/mouse-delta-s)
|
(rx/take-until $ uuwb/mouse-delta-s)
|
||||||
(rx/on-value $ on-value)))]
|
(rx/on-value $ on-value)))]
|
||||||
|
|
||||||
(as-> uuc/actions-s $
|
(as-> uuc/actions-s $
|
||||||
|
(rx/map :type $)
|
||||||
(rx/dedupe $)
|
(rx/dedupe $)
|
||||||
(rx/filter #(= :shape/movement %) $)
|
(rx/filter #(= :shape/movement %) $)
|
||||||
(rx/on-value $ init))))
|
(rx/on-value $ init))))
|
||||||
|
|||||||
@ -76,6 +76,7 @@
|
|||||||
|
|
||||||
(init []
|
(init []
|
||||||
(let [stoper (->> uuc/actions-s
|
(let [stoper (->> uuc/actions-s
|
||||||
|
(rx/map :type)
|
||||||
(rx/filter #(not= % :draw/selrect))
|
(rx/filter #(not= % :draw/selrect))
|
||||||
(rx/take 1))
|
(rx/take 1))
|
||||||
pos @wb/mouse-viewport-a]
|
pos @wb/mouse-viewport-a]
|
||||||
@ -86,6 +87,7 @@
|
|||||||
(rx/subscribe $ on-value nil on-complete))))]
|
(rx/subscribe $ on-value nil on-complete))))]
|
||||||
|
|
||||||
(as-> uuc/actions-s $
|
(as-> uuc/actions-s $
|
||||||
|
(rx/map :type $)
|
||||||
(rx/dedupe $)
|
(rx/dedupe $)
|
||||||
(rx/filter #(= :draw/selrect %) $)
|
(rx/filter #(= :draw/selrect %) $)
|
||||||
(rx/on-value $ init))))
|
(rx/on-value $ init))))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user