0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-23 06:58:58 -05:00

Upgraded beicon version

This commit is contained in:
alonso.torres 2021-07-05 11:35:56 +02:00 committed by Andrés Moya
parent 2771cab71a
commit 96891a5e5c
5 changed files with 9 additions and 34 deletions

View file

@ -6,7 +6,7 @@
binaryage/devtools {:mvn/version "RELEASE"}
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/potok {:mvn/version "2021.06.07-0"}
funcool/rumext {:mvn/version "2021.05.12-1"}

View file

@ -482,7 +482,6 @@
padding-right: 1rem;
padding-top: 1rem;
padding-bottom: 1rem;
// margin-bottom: 12px;
cursor: pointer;
user-select: none;

View file

@ -22,9 +22,6 @@
(log/set-level! :debug)
(defn rx-delay-emit [ms ob]
(->> ob (rx/mapcat #(rx/delay ms (rx/of %)))))
(defn use-import-file
[project-id on-finish-import]
(mf/use-callback
@ -78,13 +75,13 @@
(assoc :status :analyze-error))))))
(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
(fn [file]
(if (and (= uri (:uri file) )
(= (:status file) :analyzing))
(->> (:files data)
(remove (comp exiting-files? first) )
(remove (comp existing-files? first) )
(mapv (fn [[file-id file-data]]
(-> file-data
(assoc :file-id file-id
@ -204,7 +201,7 @@
(->> (uw/ask-many!
{:cmd :analyze-import
:files (->> files (mapv :uri))})
(rx-delay-emit 1000)
(rx/delay-emit 1000)
(rx/subs
(fn [{:keys [uri data error] :as msg}]
(log/debug :msg msg)
@ -219,7 +216,7 @@
{:cmd :import-files
:project-id project-id
:files files})
(rx-delay-emit 1000)
(rx/delay-emit 1000)
(rx/subs
(fn [{:keys [file-id status] :as msg}]
(log/debug :msg msg)

View file

@ -19,12 +19,6 @@
[beicon.core :as rx]
[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
"Creates a manifest entry for the given files"
[team-id file-id export-type files]
@ -377,7 +371,7 @@
(let [files {}
pending [file-id]]
(->> (rx/of [files pending])
(rx-expand fetch-dependencies)
(rx/expand fetch-dependencies)
(rx/last)
(rx/map first)
(rx/map #(process-export file-id export-type %))))))

View file

@ -23,21 +23,6 @@
[cuerdas.core :as str]
[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
(def change-batch-size 100)
@ -297,7 +282,7 @@
(->> (rx/from children)
(rx/filter cip/shape?)
(rx/skip 1)
(rx-skip-last 1)
(rx/skip-last 1)
(rx/mapcat (partial resolve-media file-id))
(rx/reduce (partial process-import-node context) file)
(rx/map fb/finish-component))))
@ -316,7 +301,7 @@
(fn [[page-id page-name]]
(->> (get-file context :page page-id)
(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
[context file]
@ -380,7 +365,7 @@
(->> (get-file context :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)))
(defn process-file