mirror of
https://github.com/penpot/penpot.git
synced 2025-05-14 20:46:37 +02:00
✨ Upgraded beicon version
This commit is contained in:
parent
2771cab71a
commit
96891a5e5c
5 changed files with 9 additions and 34 deletions
|
@ -6,7 +6,7 @@
|
||||||
binaryage/devtools {:mvn/version "RELEASE"}
|
binaryage/devtools {:mvn/version "RELEASE"}
|
||||||
metosin/reitit-core {:mvn/version "0.5.13"}
|
metosin/reitit-core {:mvn/version "0.5.13"}
|
||||||
|
|
||||||
funcool/beicon {:mvn/version "2021.06.03-0"}
|
funcool/beicon {:mvn/version "2021.07.05-1"}
|
||||||
funcool/okulary {:mvn/version "2020.04.14-0"}
|
funcool/okulary {:mvn/version "2020.04.14-0"}
|
||||||
funcool/potok {:mvn/version "2021.06.07-0"}
|
funcool/potok {:mvn/version "2021.06.07-0"}
|
||||||
funcool/rumext {:mvn/version "2021.05.12-1"}
|
funcool/rumext {:mvn/version "2021.05.12-1"}
|
||||||
|
|
|
@ -482,7 +482,6 @@
|
||||||
padding-right: 1rem;
|
padding-right: 1rem;
|
||||||
padding-top: 1rem;
|
padding-top: 1rem;
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
// margin-bottom: 12px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,6 @@
|
||||||
|
|
||||||
(log/set-level! :debug)
|
(log/set-level! :debug)
|
||||||
|
|
||||||
(defn rx-delay-emit [ms ob]
|
|
||||||
(->> ob (rx/mapcat #(rx/delay ms (rx/of %)))))
|
|
||||||
|
|
||||||
(defn use-import-file
|
(defn use-import-file
|
||||||
[project-id on-finish-import]
|
[project-id on-finish-import]
|
||||||
(mf/use-callback
|
(mf/use-callback
|
||||||
|
@ -78,13 +75,13 @@
|
||||||
(assoc :status :analyze-error))))))
|
(assoc :status :analyze-error))))))
|
||||||
|
|
||||||
(defn set-analyze-result [files uri data]
|
(defn set-analyze-result [files uri data]
|
||||||
(let [exiting-files? (into #{} (->> files (map :file-id) (filter some?)))
|
(let [existing-files? (into #{} (->> files (map :file-id) (filter some?)))
|
||||||
replace-file
|
replace-file
|
||||||
(fn [file]
|
(fn [file]
|
||||||
(if (and (= uri (:uri file) )
|
(if (and (= uri (:uri file) )
|
||||||
(= (:status file) :analyzing))
|
(= (:status file) :analyzing))
|
||||||
(->> (:files data)
|
(->> (:files data)
|
||||||
(remove (comp exiting-files? first) )
|
(remove (comp existing-files? first) )
|
||||||
(mapv (fn [[file-id file-data]]
|
(mapv (fn [[file-id file-data]]
|
||||||
(-> file-data
|
(-> file-data
|
||||||
(assoc :file-id file-id
|
(assoc :file-id file-id
|
||||||
|
@ -204,7 +201,7 @@
|
||||||
(->> (uw/ask-many!
|
(->> (uw/ask-many!
|
||||||
{:cmd :analyze-import
|
{:cmd :analyze-import
|
||||||
:files (->> files (mapv :uri))})
|
:files (->> files (mapv :uri))})
|
||||||
(rx-delay-emit 1000)
|
(rx/delay-emit 1000)
|
||||||
(rx/subs
|
(rx/subs
|
||||||
(fn [{:keys [uri data error] :as msg}]
|
(fn [{:keys [uri data error] :as msg}]
|
||||||
(log/debug :msg msg)
|
(log/debug :msg msg)
|
||||||
|
@ -219,7 +216,7 @@
|
||||||
{:cmd :import-files
|
{:cmd :import-files
|
||||||
:project-id project-id
|
:project-id project-id
|
||||||
:files files})
|
:files files})
|
||||||
(rx-delay-emit 1000)
|
(rx/delay-emit 1000)
|
||||||
(rx/subs
|
(rx/subs
|
||||||
(fn [{:keys [file-id status] :as msg}]
|
(fn [{:keys [file-id status] :as msg}]
|
||||||
(log/debug :msg msg)
|
(log/debug :msg msg)
|
||||||
|
|
|
@ -19,12 +19,6 @@
|
||||||
[beicon.core :as rx]
|
[beicon.core :as rx]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defn rx-expand
|
|
||||||
"Recursively projects each source value to an Observable
|
|
||||||
which is merged in the output Observable."
|
|
||||||
[f ob]
|
|
||||||
(.pipe ob (.expand ^js js/rxjsOperators f)))
|
|
||||||
|
|
||||||
(defn create-manifest
|
(defn create-manifest
|
||||||
"Creates a manifest entry for the given files"
|
"Creates a manifest entry for the given files"
|
||||||
[team-id file-id export-type files]
|
[team-id file-id export-type files]
|
||||||
|
@ -377,7 +371,7 @@
|
||||||
(let [files {}
|
(let [files {}
|
||||||
pending [file-id]]
|
pending [file-id]]
|
||||||
(->> (rx/of [files pending])
|
(->> (rx/of [files pending])
|
||||||
(rx-expand fetch-dependencies)
|
(rx/expand fetch-dependencies)
|
||||||
(rx/last)
|
(rx/last)
|
||||||
(rx/map first)
|
(rx/map first)
|
||||||
(rx/map #(process-export file-id export-type %))))))
|
(rx/map #(process-export file-id export-type %))))))
|
||||||
|
|
|
@ -23,21 +23,6 @@
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[tubax.core :as tubax]))
|
[tubax.core :as tubax]))
|
||||||
|
|
||||||
;;; TODO: Move to funcool/beicon
|
|
||||||
|
|
||||||
(defn rx-merge-reduce [f seed ob]
|
|
||||||
(let [current-acc (atom seed)]
|
|
||||||
(->> (rx/concat
|
|
||||||
(rx/of seed)
|
|
||||||
(->> ob
|
|
||||||
(rx/mapcat #(f @current-acc %))
|
|
||||||
(rx/tap #(reset! current-acc %))))
|
|
||||||
(rx/last))))
|
|
||||||
|
|
||||||
(defn rx-skip-last
|
|
||||||
[n ob]
|
|
||||||
(.pipe ob (.skipLast js/rxjsOperators (int n))))
|
|
||||||
|
|
||||||
;; Upload changes batches size
|
;; Upload changes batches size
|
||||||
(def change-batch-size 100)
|
(def change-batch-size 100)
|
||||||
|
|
||||||
|
@ -297,7 +282,7 @@
|
||||||
(->> (rx/from children)
|
(->> (rx/from children)
|
||||||
(rx/filter cip/shape?)
|
(rx/filter cip/shape?)
|
||||||
(rx/skip 1)
|
(rx/skip 1)
|
||||||
(rx-skip-last 1)
|
(rx/skip-last 1)
|
||||||
(rx/mapcat (partial resolve-media file-id))
|
(rx/mapcat (partial resolve-media file-id))
|
||||||
(rx/reduce (partial process-import-node context) file)
|
(rx/reduce (partial process-import-node context) file)
|
||||||
(rx/map fb/finish-component))))
|
(rx/map fb/finish-component))))
|
||||||
|
@ -316,7 +301,7 @@
|
||||||
(fn [[page-id page-name]]
|
(fn [[page-id page-name]]
|
||||||
(->> (get-file context :page page-id)
|
(->> (get-file context :page page-id)
|
||||||
(rx/map (fn [page-data] [page-id page-name page-data])))))
|
(rx/map (fn [page-data] [page-id page-name page-data])))))
|
||||||
(rx-merge-reduce (partial import-page context) file))))
|
(rx/concat-reduce (partial import-page context) file))))
|
||||||
|
|
||||||
(defn process-library-colors
|
(defn process-library-colors
|
||||||
[context file]
|
[context file]
|
||||||
|
@ -380,7 +365,7 @@
|
||||||
|
|
||||||
(->> (get-file context :components)
|
(->> (get-file context :components)
|
||||||
(rx/flat-map split-components)
|
(rx/flat-map split-components)
|
||||||
(rx-merge-reduce (partial import-component context) file)))
|
(rx/concat-reduce (partial import-component context) file)))
|
||||||
(rx/of file)))
|
(rx/of file)))
|
||||||
|
|
||||||
(defn process-file
|
(defn process-file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue