mirror of
https://github.com/penpot/penpot.git
synced 2026-01-07 05:49:03 -05:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f45fa95935 | ||
|
|
ce02cbc3f1 | ||
|
|
b386403fa8 | ||
|
|
0a6e884584 | ||
|
|
06f6a49bce | ||
|
|
afd309c62b |
15
CHANGES.md
15
CHANGES.md
@@ -1,5 +1,20 @@
|
||||
# CHANGELOG
|
||||
|
||||
## 2.5.2
|
||||
|
||||
### :rocket: Epics and highlights
|
||||
|
||||
### :boom: Breaking changes & Deprecations
|
||||
|
||||
### :heart: Community contributions (Thank you!)
|
||||
|
||||
### :sparkles: New features
|
||||
|
||||
### :bug: Bugs fixed
|
||||
|
||||
- Navigate tracking event firing multiple times [Taiga #10415](https://tree.taiga.io/project/penpot/issue/10415)
|
||||
- Fix problem with selection colors [Taiga #](https://tree.taiga.io/project/penpot/issue/10376)
|
||||
|
||||
## 2.5.1
|
||||
|
||||
### :rocket: Epics and highlights
|
||||
|
||||
@@ -62,18 +62,21 @@
|
||||
;; --- Navigate (Event)
|
||||
|
||||
(defn navigated
|
||||
[match]
|
||||
[match send-event-info?]
|
||||
(ptk/reify ::navigated
|
||||
IDeref
|
||||
(-deref [_] match)
|
||||
|
||||
ev/Event
|
||||
(-data [_]
|
||||
(let [route (dm/get-in match [:data :name])
|
||||
params (get match :path-params)]
|
||||
(assoc params
|
||||
::ev/name "navigate"
|
||||
:route (name route))))
|
||||
ptk/WatchEvent
|
||||
(watch [_ _ _]
|
||||
(when send-event-info?
|
||||
(let [route (dm/get-in match [:data :name])
|
||||
params (get match :query-params)]
|
||||
(rx/of (ptk/event
|
||||
::ev/event
|
||||
(assoc params
|
||||
::ev/name "navigate"
|
||||
:route (name route)))))))
|
||||
|
||||
ptk/UpdateEvent
|
||||
(update [_ state]
|
||||
@@ -186,6 +189,21 @@
|
||||
|
||||
;; --- History API
|
||||
|
||||
;; Check the urls to see if we need to send the navigated event.
|
||||
;; If two paths are the same we only send the event when there is a
|
||||
;; change in the parameters `file-id`, `page-id` or `team-id`
|
||||
(defn- send-event-info?
|
||||
[old-url new-url]
|
||||
(let [params [:file-id :page-id :team-id]
|
||||
new-uri (u/uri new-url)
|
||||
new-path (:path new-uri)
|
||||
new-params (-> new-uri :query u/query-string->map (select-keys params))
|
||||
old-uri (u/uri old-url)
|
||||
old-path (:path old-uri)
|
||||
old-params (-> old-uri :query u/query-string->map (select-keys params))]
|
||||
(or (not= old-path new-path)
|
||||
(not= new-params old-params))))
|
||||
|
||||
(defn initialize-history
|
||||
[on-change]
|
||||
(ptk/reify ::initialize-history
|
||||
@@ -200,11 +218,19 @@
|
||||
(let [stopper (rx/filter (ptk/type? ::initialize-history) stream)
|
||||
history (:history state)
|
||||
router (:router state)]
|
||||
(ts/schedule #(on-change router (.getToken ^js history)))
|
||||
(->> (rx/create (fn [subs]
|
||||
(let [key (e/listen history "navigate" (fn [o] (rx/push! subs (.-token ^js o))))]
|
||||
(fn []
|
||||
(bhistory/disable! history)
|
||||
(e/unlistenByKey key)))))
|
||||
(ts/schedule #(on-change router (.getToken ^js history) true))
|
||||
(->> (rx/concat
|
||||
(rx/of nil nil)
|
||||
(rx/create
|
||||
(fn [subs]
|
||||
(let [key (e/listen history "navigate" (fn [o] (rx/push! subs (.-token ^js o))))]
|
||||
(fn []
|
||||
(bhistory/disable! history)
|
||||
(e/unlistenByKey key))))))
|
||||
(rx/buffer 2 1)
|
||||
(rx/take-until stopper)
|
||||
(rx/subs! #(on-change router %)))))))
|
||||
(rx/subs!
|
||||
(fn [[old-url new-url]]
|
||||
(when (some? new-url)
|
||||
(let [send? (or (nil? old-url) (send-event-info? old-url new-url))]
|
||||
(on-change router new-url send?))))))))))
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
:plugin-url plugin))))
|
||||
|
||||
(defn on-navigate
|
||||
[router path]
|
||||
[router path send-event-info?]
|
||||
(let [location (.-location js/document)
|
||||
[base-path qs] (str/split path "?")
|
||||
location-path (dm/str (.-origin location) (.-pathname location))
|
||||
@@ -102,7 +102,7 @@
|
||||
(st/emit! (rt/assign-exception {:type :not-found}))
|
||||
|
||||
(some? match)
|
||||
(st/emit! (rt/navigated match))
|
||||
(st/emit! (rt/navigated match send-event-info?))
|
||||
|
||||
:else
|
||||
;; We just recheck with an additional profile request; this
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
[rumext.v2 :as mf]))
|
||||
|
||||
(mf/defc options*
|
||||
[{:keys [shape file-id shapes-with-children shared-libs] :as props}]
|
||||
[{:keys [shape file-id shapes-with-children libraries] :as props}]
|
||||
(let [shape-id (dm/get-prop shape :id)
|
||||
shape-type (dm/get-prop shape :type)
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
[:> color-selection-menu* {:type shape-type
|
||||
:shapes shapes-with-children
|
||||
:file-id file-id
|
||||
:libraries shared-libs}]
|
||||
:libraries libraries}]
|
||||
[:> shadow-menu* {:ids ids :values (get shape :shadow)}]
|
||||
[:& blur-menu {:ids ids
|
||||
:values (select-keys shape [:blur])}]
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
|
||||
page-id (unchecked-get props "page-id")
|
||||
file-id (unchecked-get props "file-id")
|
||||
shared-libs (unchecked-get props "shared-libs")
|
||||
shared-libs (unchecked-get props "libraries")
|
||||
|
||||
show-caps (some #(and (= :path (:type %)) (gsh/open-path? %)) shapes)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user