mirror of
https://github.com/penpot/penpot.git
synced 2025-02-21 22:36:12 -05:00
Merge branch 'staging' into develop
This commit is contained in:
commit
44f6ec7a24
7 changed files with 50 additions and 16 deletions
|
@ -48,6 +48,7 @@
|
||||||
|
|
||||||
- Fix problem with some texts desynchronization [Taiga #9379](https://tree.taiga.io/project/penpot/issue/9379)
|
- Fix problem with some texts desynchronization [Taiga #9379](https://tree.taiga.io/project/penpot/issue/9379)
|
||||||
- Fix problem with reoder grid layers [#5446](https://github.com/penpot/penpot/issues/5446)
|
- Fix problem with reoder grid layers [#5446](https://github.com/penpot/penpot/issues/5446)
|
||||||
|
- Fix problem with swap component style [#9542](https://tree.taiga.io/project/penpot/issue/9542)
|
||||||
|
|
||||||
## 2.3.3
|
## 2.3.3
|
||||||
|
|
||||||
|
|
|
@ -143,6 +143,11 @@
|
||||||
(let [f (obj/get global "externalSessionId")]
|
(let [f (obj/get global "externalSessionId")]
|
||||||
(when (fn? f) (f))))
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
|
(defn external-context-info
|
||||||
|
[]
|
||||||
|
(let [f (obj/get global "externalContextInfo")]
|
||||||
|
(when (fn? f) (f))))
|
||||||
|
|
||||||
;; --- Helper Functions
|
;; --- Helper Functions
|
||||||
|
|
||||||
(defn ^boolean check-browser? [candidate]
|
(defn ^boolean check-browser? [candidate]
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
["ua-parser-js" :as ua]
|
["ua-parser-js" :as ua]
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
|
[app.common.json :as json]
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
|
@ -93,6 +94,11 @@
|
||||||
data
|
data
|
||||||
data))
|
data))
|
||||||
|
|
||||||
|
(defn add-external-context-info
|
||||||
|
[context]
|
||||||
|
(let [external-context-info (json/->clj (cf/external-context-info))]
|
||||||
|
(merge context external-context-info)))
|
||||||
|
|
||||||
(defn- process-event-by-proto
|
(defn- process-event-by-proto
|
||||||
[event]
|
[event]
|
||||||
(let [data (d/deep-merge (-data event) (meta event))
|
(let [data (d/deep-merge (-data event) (meta event))
|
||||||
|
@ -102,6 +108,7 @@
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
(assoc :event-namespace (namespace type))
|
(assoc :event-namespace (namespace type))
|
||||||
(assoc :event-symbol ev-name)
|
(assoc :event-symbol ev-name)
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
|
|
||||||
|
@ -119,6 +126,7 @@
|
||||||
(let [type (::type data "action")
|
(let [type (::type data "action")
|
||||||
context (-> (::context data)
|
context (-> (::context data)
|
||||||
(assoc :event-origin (::origin data))
|
(assoc :event-origin (::origin data))
|
||||||
|
(add-external-context-info)
|
||||||
(d/without-nils))
|
(d/without-nils))
|
||||||
props (-> data d/without-qualified simplify-props)]
|
props (-> data d/without-qualified simplify-props)]
|
||||||
{:type type
|
{:type type
|
||||||
|
|
|
@ -52,6 +52,11 @@
|
||||||
(defonce queue
|
(defonce queue
|
||||||
(q/create find-request (/ 1000 30)))
|
(q/create find-request (/ 1000 30)))
|
||||||
|
|
||||||
|
(defn clear-queue!
|
||||||
|
[]
|
||||||
|
(l/dbg :hint "clearing thumbnail queue")
|
||||||
|
(q/clear! queue))
|
||||||
|
|
||||||
;; This function first renders the HTML calling `render/render-frame` that
|
;; This function first renders the HTML calling `render/render-frame` that
|
||||||
;; returns HTML as a string, then we send that data to the iframe rasterizer
|
;; returns HTML as a string, then we send that data to the iframe rasterizer
|
||||||
;; that returns the image as a Blob. Finally we create a URI for that blob.
|
;; that returns the image as a Blob. Finally we create a URI for that blob.
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
[app.main.data.event :as ev]
|
[app.main.data.event :as ev]
|
||||||
[app.main.data.persistence :as dwp]
|
[app.main.data.persistence :as dwp]
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
|
[app.main.data.workspace.thumbnails :as th]
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
|
@ -95,24 +96,28 @@
|
||||||
(assert (uuid? id) "expected valid uuid for `id`")
|
(assert (uuid? id) "expected valid uuid for `id`")
|
||||||
(ptk/reify ::restore-version
|
(ptk/reify ::restore-version
|
||||||
ptk/WatchEvent
|
ptk/WatchEvent
|
||||||
(watch [_ state _]
|
(watch [_ _ _]
|
||||||
(let [file-id (:current-file-id state)]
|
(let [file-id (:current-file-id state)]
|
||||||
(rx/concat
|
(rx/concat
|
||||||
(rx/of ::dwp/force-persist
|
(rx/of ::dwp/force-persist
|
||||||
(dw/remove-layout-flag :document-history))
|
(dw/remove-layout-flag :document-history))
|
||||||
|
|
||||||
;; FIXME: we should abstract this
|
|
||||||
(->> (rx/from-atom refs/persistence-state {:emit-current-value? true})
|
(->> (rx/from-atom refs/persistence-state {:emit-current-value? true})
|
||||||
(rx/filter #(or (nil? %) (= :saved %)))
|
(rx/filter #(or (nil? %) (= :saved %)))
|
||||||
(rx/take 1)
|
(rx/take 1)
|
||||||
(rx/mapcat #(rp/cmd! :restore-file-snapshot {:file-id file-id :id id}))
|
(rx/mapcat #(rp/cmd! :restore-file-snapshot {:file-id file-id :id id}))
|
||||||
(rx/map #(dw/initialize-workspace file-id)))
|
(rx/tap #(th/clear-queue!))
|
||||||
|
(rx/map #(dw/initialize-file project-id file-id)))
|
||||||
|
(case origin
|
||||||
|
:version
|
||||||
|
(rx/of (ptk/event ::ev/event {::ev/name "restore-pin-version"}))
|
||||||
|
|
||||||
(when-let [name (case origin
|
:snapshot
|
||||||
:version "restore-pin-version"
|
(rx/of (ptk/event ::ev/event {::ev/name "restore-autosave"}))
|
||||||
:snapshot "restore-autosave"
|
|
||||||
nil)]
|
:plugin
|
||||||
(rx/of (ptk/event ::ev/event {::ev/name name}))))))))
|
(rx/of (ptk/event ::ev/event {::ev/name "restore-version-plugin"}))
|
||||||
|
|
||||||
|
(rx/empty)))))))
|
||||||
|
|
||||||
(defn delete-version
|
(defn delete-version
|
||||||
[id]
|
[id]
|
||||||
|
|
|
@ -402,6 +402,7 @@
|
||||||
|
|
||||||
.component-swap {
|
.component-swap {
|
||||||
padding-top: $s-12;
|
padding-top: $s-12;
|
||||||
|
max-width: $s-248;
|
||||||
}
|
}
|
||||||
|
|
||||||
.component-swap-content {
|
.component-swap-content {
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.logging :as l]
|
[app.common.logging :as l]
|
||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
|
[app.util.object :as obj]
|
||||||
[app.util.time :as t]
|
[app.util.time :as t]
|
||||||
[beicon.v2.core :as rx]))
|
[beicon.v2.core :as rx]))
|
||||||
|
|
||||||
|
@ -47,13 +48,14 @@
|
||||||
|
|
||||||
;; NOTE: Right now there are no cases where we need to cancel a process
|
;; NOTE: Right now there are no cases where we need to cancel a process
|
||||||
;; but if we do, we can use this function
|
;; but if we do, we can use this function
|
||||||
;; (defn- cancel-process
|
(defn- cancel-process!
|
||||||
;; [queue]
|
[queue]
|
||||||
;; (l/dbg :hint "queue::cancel-process")
|
(l/dbg :hint "queue::cancel-process")
|
||||||
;; (let [timeout (unchecked-get queue "timeout")]
|
(let [timeout (unchecked-get queue "timeout")]
|
||||||
;; (when (some? timeout)
|
(when (some? timeout)
|
||||||
;; (js/clearTimeout timeout))
|
(js/clearTimeout timeout))
|
||||||
;; (unchecked-set queue "timeout" nil)))
|
(unchecked-set queue "timeout" nil))
|
||||||
|
queue)
|
||||||
|
|
||||||
(defn- process
|
(defn- process
|
||||||
[queue iterations]
|
[queue iterations]
|
||||||
|
@ -131,3 +133,10 @@
|
||||||
(enqueue-last queue request))))
|
(enqueue-last queue request))))
|
||||||
|
|
||||||
(rx/to-observable result)))
|
(rx/to-observable result)))
|
||||||
|
|
||||||
|
(defn clear!
|
||||||
|
[queue]
|
||||||
|
(-> queue
|
||||||
|
(cancel-process!)
|
||||||
|
(obj/set! "items" #js [])
|
||||||
|
(obj/set! "time" 0)))
|
||||||
|
|
Loading…
Add table
Reference in a new issue