mirror of
https://github.com/penpot/penpot.git
synced 2025-05-10 22:56:37 +02:00
⬆️ Upgrade to beicon2 (part1)
This commit is contained in:
parent
ecee15af5b
commit
96f5a33f5f
151 changed files with 482 additions and 433 deletions
|
@ -15,7 +15,7 @@
|
||||||
:hooks
|
:hooks
|
||||||
{:analyze-call
|
{:analyze-call
|
||||||
{app.common.data.macros/export hooks.export/export
|
{app.common.data.macros/export hooks.export/export
|
||||||
potok.core/reify hooks.export/potok-reify
|
potok.v2.core/reify hooks.export/potok-reify
|
||||||
app.util.services/defmethod hooks.export/service-defmethod
|
app.util.services/defmethod hooks.export/service-defmethod
|
||||||
app.common.record/defrecord hooks.export/penpot-defrecord
|
app.common.record/defrecord hooks.export/penpot-defrecord
|
||||||
app.db/with-atomic hooks.export/penpot-with-atomic
|
app.db/with-atomic hooks.export/penpot-with-atomic
|
||||||
|
|
|
@ -6,10 +6,17 @@
|
||||||
org.clojure/clojure {:mvn/version "1.11.1"}
|
org.clojure/clojure {:mvn/version "1.11.1"}
|
||||||
binaryage/devtools {:mvn/version "RELEASE"}
|
binaryage/devtools {:mvn/version "RELEASE"}
|
||||||
metosin/reitit-core {:mvn/version "0.5.18"}
|
metosin/reitit-core {:mvn/version "0.5.18"}
|
||||||
|
|
||||||
funcool/beicon {:mvn/version "2021.07.05-1"}
|
|
||||||
funcool/okulary {:mvn/version "2022.04.11-16"}
|
funcool/okulary {:mvn/version "2022.04.11-16"}
|
||||||
funcool/potok {:mvn/version "2022.12.16-71"}
|
|
||||||
|
funcool/potok2
|
||||||
|
{:git/tag "v2.0"
|
||||||
|
:git/sha "2bb377b"
|
||||||
|
:git/url "https://github.com/funcool/potok.git"}
|
||||||
|
|
||||||
|
funcool/beicon2
|
||||||
|
{:git/tag "v2.0"
|
||||||
|
:git/sha "e7135e0"
|
||||||
|
:git/url "https://github.com/funcool/beicon.git"}
|
||||||
|
|
||||||
funcool/rumext
|
funcool/rumext
|
||||||
{:git/tag "v2.7"
|
{:git/tag "v2.7"
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
"@storybook/react": "^7.5.3",
|
"@storybook/react": "^7.5.3",
|
||||||
"@storybook/react-vite": "^7.5.3",
|
"@storybook/react-vite": "^7.5.3",
|
||||||
"@storybook/testing-library": "^0.2.2",
|
"@storybook/testing-library": "^0.2.2",
|
||||||
|
"@types/node": "^20.10.5",
|
||||||
"animate.css": "^4.1.1",
|
"animate.css": "^4.1.1",
|
||||||
"autoprefixer": "^10.4.15",
|
"autoprefixer": "^10.4.15",
|
||||||
"concurrently": "^8.2.2",
|
"concurrently": "^8.2.2",
|
||||||
|
@ -73,6 +74,7 @@
|
||||||
"sass": "^1.66.1",
|
"sass": "^1.66.1",
|
||||||
"shadow-cljs": "2.26.2",
|
"shadow-cljs": "2.26.2",
|
||||||
"storybook": "^7.5.3",
|
"storybook": "^7.5.3",
|
||||||
|
"typescript": "^5.3.3",
|
||||||
"vite": "^5.0.2"
|
"vite": "^5.0.2"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -90,7 +92,7 @@
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-virtualized": "^9.22.3",
|
"react-virtualized": "^9.22.3",
|
||||||
"rxjs": "~7.8.1",
|
"rxjs": "8.0.0-alpha.13",
|
||||||
"sax": "^1.2.4",
|
"sax": "^1.2.4",
|
||||||
"source-map-support": "^0.5.21",
|
"source-map-support": "^0.5.21",
|
||||||
"tdigest": "^0.1.2",
|
"tdigest": "^0.1.2",
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[app.util.zip :as uz]
|
[app.util.zip :as uz]
|
||||||
[app.worker.export :as e]
|
[app.worker.export :as e]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defn parse-data [data]
|
(defn parse-data [data]
|
||||||
|
@ -55,7 +55,7 @@
|
||||||
|
|
||||||
(->> (rx/from (vals media))
|
(->> (rx/from (vals media))
|
||||||
(rx/map #(assoc % :file-id file-id))
|
(rx/map #(assoc % :file-id file-id))
|
||||||
(rx/flat-map
|
(rx/merge-map
|
||||||
(fn [media]
|
(fn [media]
|
||||||
(let [file-path (str/concat file-id "/media/" (:id media) (cm/mtype->extension (:mtype media)))
|
(let [file-path (str/concat file-id "/media/" (:id media) (cm/mtype->extension (:mtype media)))
|
||||||
blob (data-uri->blob (:uri media))]
|
blob (data-uri->blob (:uri media))]
|
||||||
|
@ -79,38 +79,38 @@
|
||||||
|
|
||||||
render-stream
|
render-stream
|
||||||
(->> files-stream
|
(->> files-stream
|
||||||
(rx/flat-map vals)
|
(rx/merge-map vals)
|
||||||
(rx/flat-map e/process-pages)
|
(rx/merge-map e/process-pages)
|
||||||
(rx/observe-on :async)
|
(rx/observe-on :async)
|
||||||
(rx/flat-map e/get-page-data)
|
(rx/merge-map e/get-page-data)
|
||||||
(rx/share))
|
(rx/share))
|
||||||
|
|
||||||
colors-stream
|
colors-stream
|
||||||
(->> files-stream
|
(->> files-stream
|
||||||
(rx/flat-map vals)
|
(rx/merge-map vals)
|
||||||
(rx/map #(vector (:id %) (get-in % [:data :colors])))
|
(rx/map #(vector (:id %) (get-in % [:data :colors])))
|
||||||
(rx/filter #(d/not-empty? (second %)))
|
(rx/filter #(d/not-empty? (second %)))
|
||||||
(rx/map e/parse-library-color))
|
(rx/map e/parse-library-color))
|
||||||
|
|
||||||
typographies-stream
|
typographies-stream
|
||||||
(->> files-stream
|
(->> files-stream
|
||||||
(rx/flat-map vals)
|
(rx/merge-map vals)
|
||||||
(rx/map #(vector (:id %) (get-in % [:data :typographies])))
|
(rx/map #(vector (:id %) (get-in % [:data :typographies])))
|
||||||
(rx/filter #(d/not-empty? (second %)))
|
(rx/filter #(d/not-empty? (second %)))
|
||||||
(rx/map e/parse-library-typographies))
|
(rx/map e/parse-library-typographies))
|
||||||
|
|
||||||
media-stream
|
media-stream
|
||||||
(->> files-stream
|
(->> files-stream
|
||||||
(rx/flat-map vals)
|
(rx/merge-map vals)
|
||||||
(rx/map #(vector (:id %) (get-in % [:data :media])))
|
(rx/map #(vector (:id %) (get-in % [:data :media])))
|
||||||
(rx/filter #(d/not-empty? (second %)))
|
(rx/filter #(d/not-empty? (second %)))
|
||||||
(rx/flat-map parse-library-media))
|
(rx/merge-map parse-library-media))
|
||||||
|
|
||||||
components-stream
|
components-stream
|
||||||
(->> files-stream
|
(->> files-stream
|
||||||
(rx/flat-map vals)
|
(rx/merge-map vals)
|
||||||
(rx/filter #(d/not-empty? (ctkl/components-seq (:data %))))
|
(rx/filter #(d/not-empty? (ctkl/components-seq (:data %))))
|
||||||
(rx/flat-map e/parse-library-components))
|
(rx/merge-map e/parse-library-components))
|
||||||
|
|
||||||
pages-stream
|
pages-stream
|
||||||
(->> render-stream
|
(->> render-stream
|
||||||
|
@ -132,7 +132,7 @@
|
||||||
typographies-stream)
|
typographies-stream)
|
||||||
(rx/reduce conj [])
|
(rx/reduce conj [])
|
||||||
(rx/with-latest-from files-stream)
|
(rx/with-latest-from files-stream)
|
||||||
(rx/flat-map (fn [[data _]]
|
(rx/merge-map (fn [[data _]]
|
||||||
(->> (uz/compress-files data)
|
(->> (uz/compress-files data)
|
||||||
(rx/map #(vector file %)))))))))
|
(rx/map #(vector file %)))))))))
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.main.render :as r]
|
[app.main.render :as r]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[promesa.core :as p]))
|
[promesa.core :as p]))
|
||||||
|
|
||||||
(defn render-page-export
|
(defn render-page-export
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
(fn [resolve reject]
|
(fn [resolve reject]
|
||||||
(->> (r/render-page data)
|
(->> (r/render-page data)
|
||||||
(rx/take 1)
|
(rx/take 1)
|
||||||
(rx/subs resolve reject))) )))
|
(rx/subs! resolve reject))) )))
|
||||||
|
|
||||||
(defn exports []
|
(defn exports []
|
||||||
#js {:renderPage render-page-export})
|
#js {:renderPage render-page-export})
|
||||||
|
|
|
@ -28,10 +28,10 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n]
|
[app.util.i18n :as i18n]
|
||||||
[app.util.theme :as theme]
|
[app.util.theme :as theme]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[debug]
|
[debug]
|
||||||
[features]
|
[features]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(log/setup! {:app :info})
|
(log/setup! {:app :info})
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.exceptions :as ex]
|
[app.common.exceptions :as ex]
|
||||||
[app.common.transit :as t]
|
[app.common.transit :as t]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defrecord BroadcastMessage [id type data]
|
(defrecord BroadcastMessage [id type data]
|
||||||
cljs.core/IDeref
|
cljs.core/IDeref
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def ^:private schema:comment-thread
|
(def ^:private schema:comment-thread
|
||||||
(sm/define
|
(sm/define
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
[app.main.features :as features]
|
[app.main.features :as features]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; SHARE LINK
|
;; SHARE LINK
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(log/set-level! :warn)
|
(log/set-level! :warn)
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@
|
||||||
(rx/map di/validate-file)
|
(rx/map di/validate-file)
|
||||||
(rx/map prepare)
|
(rx/map prepare)
|
||||||
(rx/mapcat #(rp/cmd! :update-team-photo %))
|
(rx/mapcat #(rp/cmd! :update-team-photo %))
|
||||||
(rx/do on-success)
|
(rx/tap on-success)
|
||||||
(rx/map du/fetch-teams)
|
(rx/map du/fetch-teams)
|
||||||
(rx/catch on-error))))))
|
(rx/catch on-error))))))
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,10 @@
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
[beicon.v2.operators :as rxo]
|
||||||
[lambdaisland.uri :as u]
|
[lambdaisland.uri :as u]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(l/set-level! :info)
|
(l/set-level! :info)
|
||||||
|
|
||||||
|
@ -238,7 +239,7 @@
|
||||||
profile (->> (rx/from-atom storage {:emit-current-value? true})
|
profile (->> (rx/from-atom storage {:emit-current-value? true})
|
||||||
(rx/map :profile)
|
(rx/map :profile)
|
||||||
(rx/map :id)
|
(rx/map :id)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
|
|
||||||
(l/debug :hint "event instrumentation initialized")
|
(l/debug :hint "event instrumentation initialized")
|
||||||
|
|
||||||
|
@ -259,7 +260,7 @@
|
||||||
(l/debug :hint "events chunk persisted" :total (count chunk))))
|
(l/debug :hint "events chunk persisted" :total (count chunk))))
|
||||||
(rx/map (constantly chunk))))))
|
(rx/map (constantly chunk))))))
|
||||||
(rx/take-until stoper)
|
(rx/take-until stoper)
|
||||||
(rx/subs (fn [chunk]
|
(rx/subs! (fn [chunk]
|
||||||
(swap! buffer remove-from-buffer (count chunk)))
|
(swap! buffer remove-from-buffer (count chunk)))
|
||||||
(fn [cause]
|
(fn [cause]
|
||||||
(l/error :hint "unexpected error on audit persistence" :cause cause))
|
(l/error :hint "unexpected error on audit persistence" :cause cause))
|
||||||
|
@ -290,7 +291,7 @@
|
||||||
|
|
||||||
(rx/switch-map #(rx/timer (inst-ms session-timeout)))
|
(rx/switch-map #(rx/timer (inst-ms session-timeout)))
|
||||||
(rx/take-until stoper)
|
(rx/take-until stoper)
|
||||||
(rx/subs (fn [_]
|
(rx/subs! (fn [_]
|
||||||
(l/debug :hint "session reinitialized")
|
(l/debug :hint "session reinitialized")
|
||||||
(reset! session nil))
|
(reset! session nil))
|
||||||
(fn [cause]
|
(fn [cause]
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[app.util.websocket :as ws]
|
[app.util.websocket :as ws]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def default-timeout 5000)
|
(def default-timeout 5000)
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[app.util.webapi :as wa]
|
[app.util.webapi :as wa]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; General purpose events & IMPL
|
;; General purpose events & IMPL
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
[app.main.data.messages :as dm]
|
[app.main.data.messages :as dm]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.common.schema :as sm]
|
[app.common.schema :as sm]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(declare hide)
|
(declare hide)
|
||||||
(declare show)
|
(declare show)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[cljs.core :as c]
|
[cljs.core :as c]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defonce components (atom {}))
|
(defonce components (atom {}))
|
||||||
|
|
||||||
|
|
|
@ -16,10 +16,10 @@
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.util.code-gen :as cg]
|
[app.util.code-gen :as cg]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def style-type "css")
|
(def style-type "css")
|
||||||
(def markup-type "html")
|
(def markup-type "html")
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
(rx/merge-map fonts/fetch-font-css)
|
(rx/merge-map fonts/fetch-font-css)
|
||||||
(rx/reduce conj [])
|
(rx/reduce conj [])
|
||||||
(rx/map #(str/join "\n" %))
|
(rx/map #(str/join "\n" %))
|
||||||
(rx/subs
|
(rx/subs!
|
||||||
(fn [fontfaces-css]
|
(fn [fontfaces-css]
|
||||||
(let [style-code
|
(let [style-code
|
||||||
(dm/str
|
(dm/str
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
[app.common.schema :as sm]
|
[app.common.schema :as sm]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(log/set-level! :warn)
|
(log/set-level! :warn)
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
[app.util.i18n :as i18n]
|
[app.util.i18n :as i18n]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; --- SCHEMAS
|
;; --- SCHEMAS
|
||||||
|
|
||||||
|
@ -434,7 +434,7 @@
|
||||||
(rx/map di/validate-file)
|
(rx/map di/validate-file)
|
||||||
(rx/map prepare)
|
(rx/map prepare)
|
||||||
(rx/mapcat #(rp/cmd! :update-profile-photo %))
|
(rx/mapcat #(rp/cmd! :update-profile-photo %))
|
||||||
(rx/do on-success)
|
(rx/tap on-success)
|
||||||
(rx/map (constantly (fetch-profile)))
|
(rx/map (constantly (fetch-profile)))
|
||||||
(rx/catch on-error))))))
|
(rx/catch on-error))))))
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[app.util.globals :as ug]
|
[app.util.globals :as ug]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; --- Local State Initialization
|
;; --- Local State Initialization
|
||||||
|
|
||||||
|
|
|
@ -11,8 +11,8 @@
|
||||||
[app.common.uri :as u]
|
[app.common.uri :as u]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.util.websocket :as ws]
|
[app.util.websocket :as ws]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(l/set-level! :error)
|
(l/set-level! :error)
|
||||||
|
|
||||||
|
|
|
@ -78,10 +78,10 @@
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def default-workspace-local {:zoom 1})
|
(def default-workspace-local {:zoom 1})
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@
|
||||||
uris (into #{} xform (wsh/lookup-page-objects state page-id))]
|
uris (into #{} xform (wsh/lookup-page-objects state page-id))]
|
||||||
|
|
||||||
(->> (rx/from uris)
|
(->> (rx/from uris)
|
||||||
(rx/subs #(http/fetch-data-uri % false)))))))
|
(rx/subs! #(http/fetch-data-uri % false)))))))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Workspace Page CRUD
|
;; Workspace Page CRUD
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.selection :as dws]
|
[app.main.data.workspace.selection :as dws]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn selected-shapes-idx
|
(defn selected-shapes-idx
|
||||||
[state]
|
[state]
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.worker :as uw]
|
[app.main.worker :as uw]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; Change this to :info :debug or :trace to debug this module
|
;; Change this to :info :debug or :trace to debug this module
|
||||||
(log/set-level! :warn)
|
(log/set-level! :warn)
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.files.helpers :as cfh]
|
[app.common.files.helpers :as cfh]
|
||||||
[app.common.uuid :as uuid]
|
[app.common.uuid :as uuid]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; --- Shape attrs (Layers Sidebar)
|
;; --- Shape attrs (Layers Sidebar)
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.util.color :as uc]
|
[app.util.color :as uc]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; A set of keys that are used for shared state identifiers
|
;; A set of keys that are used for shared state identifiers
|
||||||
(def ^:const colorpicker-selected-broadcast-key ::colorpicker-selected)
|
(def ^:const colorpicker-selected-broadcast-key ::colorpicker-selected)
|
||||||
|
@ -353,7 +353,7 @@
|
||||||
;; Stream that updates the stroke/width and stops if `esc` pressed
|
;; Stream that updates the stroke/width and stops if `esc` pressed
|
||||||
(->> sub
|
(->> sub
|
||||||
(rx/take-until stop?)
|
(rx/take-until stop?)
|
||||||
(rx/flat-map update-events))
|
(rx/merge-map update-events))
|
||||||
|
|
||||||
;; Hide the modal if the stop event is emitted
|
;; Hide the modal if the stop event is emitted
|
||||||
(->> stop?
|
(->> stop?
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(declare handle-interrupt)
|
(declare handle-interrupt)
|
||||||
(declare handle-comment-layer-click)
|
(declare handle-comment-layer-click)
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; Change this to :info :debug or :trace to debug this module
|
;; Change this to :info :debug or :trace to debug this module
|
||||||
(log/set-level! :warn)
|
(log/set-level! :warn)
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
[app.main.data.workspace.drawing.common :as common]
|
[app.main.data.workspace.drawing.common :as common]
|
||||||
[app.main.data.workspace.drawing.curve :as curve]
|
[app.main.data.workspace.drawing.curve :as curve]
|
||||||
[app.main.data.workspace.path :as path]
|
[app.main.data.workspace.path :as path]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(declare start-drawing)
|
(declare start-drawing)
|
||||||
(declare handle-drawing)
|
(declare handle-drawing)
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
[app.main.snap :as snap]
|
[app.main.snap :as snap]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn adjust-ratio
|
(defn adjust-ratio
|
||||||
[point initial]
|
[point initial]
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.worker :as uw]
|
[app.main.worker :as uw]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn clear-drawing
|
(defn clear-drawing
|
||||||
[]
|
[]
|
||||||
|
|
|
@ -23,8 +23,8 @@
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[app.util.path.simplify-curve :as ups]
|
[app.util.path.simplify-curve :as ups]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def simplify-tolerance 0.3)
|
(def simplify-tolerance 0.3)
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
[app.common.types.shape.layout :as ctl]
|
[app.common.types.shape.layout :as ctl]
|
||||||
[app.main.data.workspace.common :as dwc]
|
[app.main.data.workspace.common :as dwc]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn interrupt? [e] (= e :interrupt))
|
(defn interrupt? [e] (= e :interrupt))
|
||||||
|
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
[app.common.geom.shapes :as gsh]
|
[app.common.geom.shapes :as gsh]
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; This event will update the file so the boolean data has a pre-generated path data
|
;; This event will update the file so the boolean data has a pre-generated path data
|
||||||
;; to increase performance.
|
;; to increase performance.
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
(ns app.main.data.workspace.fix-broken-shapes
|
(ns app.main.data.workspace.fix-broken-shapes
|
||||||
(:require
|
(:require
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn- generate-broken-link-changes
|
(defn- generate-broken-link-changes
|
||||||
[attr {:keys [objects id] :as container}]
|
[attr {:keys [objects id] :as container}]
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.fonts :as fonts]
|
[app.main.fonts :as fonts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; This event will update the file so the texts with non existing custom fonts try to be fixed.
|
;; This event will update the file so the texts with non existing custom fonts try to be fixed.
|
||||||
;; This can happen when:
|
;; This can happen when:
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
[app.common.files.changes-builder :as pcb]
|
[app.common.files.changes-builder :as pcb]
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Grid
|
;; Grid
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
[app.common.geom.rect :as grc]
|
[app.common.geom.rect :as grc]
|
||||||
[app.common.types.shape.layout :as ctl]
|
[app.common.types.shape.layout :as ctl]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn hover-grid-cell
|
(defn hover-grid-cell
|
||||||
[grid-id cell-id add-to-set]
|
[grid-id cell-id add-to-set]
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.data.workspace.common :as dwc]
|
[app.main.data.workspace.common :as dwc]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Shortcuts
|
;; Shortcuts
|
||||||
|
|
|
@ -19,8 +19,8 @@
|
||||||
[app.main.data.workspace.selection :as dws]
|
[app.main.data.workspace.selection :as dws]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn shapes-for-grouping
|
(defn shapes-for-grouping
|
||||||
[objects selected]
|
[objects selected]
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
[app.common.types.page :as ctp]
|
[app.common.types.page :as ctp]
|
||||||
[app.main.data.workspace.changes :as dwc]
|
[app.main.data.workspace.changes :as dwc]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn make-update-guide [guide]
|
(defn make-update-guide [guide]
|
||||||
(fn [other]
|
(fn [other]
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; --- Manage shape's highlight status
|
;; --- Manage shape's highlight status
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,8 @@
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; --- Flows
|
;; --- Flows
|
||||||
|
|
||||||
|
|
|
@ -11,9 +11,9 @@
|
||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; -- Opacity ----------------------------------------------------------
|
;; -- Opacity ----------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
[app.common.data.macros :as dm]
|
[app.common.data.macros :as dm]
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def valid-flags
|
(def valid-flags
|
||||||
#{:sitemap
|
#{:sitemap
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default
|
;; Change this to :info :debug or :trace to debug this module, or :warn to reset to default
|
||||||
(log/set-level! :warn)
|
(log/set-level! :warn)
|
||||||
|
|
|
@ -30,9 +30,9 @@
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.util.http :as http]
|
[app.util.http :as http]
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[promesa.core :as p]
|
[promesa.core :as p]
|
||||||
[tubax.core :as tubax]))
|
[tubax.core :as tubax]))
|
||||||
|
|
||||||
|
@ -122,13 +122,13 @@
|
||||||
(->> (rx/from uris)
|
(->> (rx/from uris)
|
||||||
(rx/filter (comp not svg-url?))
|
(rx/filter (comp not svg-url?))
|
||||||
(rx/mapcat upload)
|
(rx/mapcat upload)
|
||||||
(rx/do on-image))
|
(rx/tap on-image))
|
||||||
|
|
||||||
(->> (rx/from uris)
|
(->> (rx/from uris)
|
||||||
(rx/filter svg-url?)
|
(rx/filter svg-url?)
|
||||||
(rx/merge-map (partial fetch-svg name))
|
(rx/merge-map (partial fetch-svg name))
|
||||||
(rx/merge-map svg->clj)
|
(rx/merge-map svg->clj)
|
||||||
(rx/do on-svg)))))
|
(rx/tap on-svg)))))
|
||||||
|
|
||||||
(defn- process-blobs
|
(defn- process-blobs
|
||||||
[{:keys [file-id local? name blobs force-media on-image on-svg]}]
|
[{:keys [file-id local? name blobs force-media on-image on-svg]}]
|
||||||
|
@ -154,14 +154,14 @@
|
||||||
(rx/filter (comp not svg-blob?))
|
(rx/filter (comp not svg-blob?))
|
||||||
(rx/map prepare-blob)
|
(rx/map prepare-blob)
|
||||||
(rx/mapcat #(rp/cmd! :upload-file-media-object %))
|
(rx/mapcat #(rp/cmd! :upload-file-media-object %))
|
||||||
(rx/do on-image))
|
(rx/tap on-image))
|
||||||
|
|
||||||
(->> (rx/from blobs)
|
(->> (rx/from blobs)
|
||||||
(rx/map dmm/validate-file)
|
(rx/map dmm/validate-file)
|
||||||
(rx/filter svg-blob?)
|
(rx/filter svg-blob?)
|
||||||
(rx/merge-map extract-content)
|
(rx/merge-map extract-content)
|
||||||
(rx/merge-map svg->clj)
|
(rx/merge-map svg->clj)
|
||||||
(rx/do on-svg)))))
|
(rx/tap on-svg)))))
|
||||||
|
|
||||||
(defn handle-media-error [error on-error]
|
(defn handle-media-error [error on-error]
|
||||||
(if (ex/ex-info? error)
|
(if (ex/ex-info? error)
|
||||||
|
@ -278,7 +278,7 @@
|
||||||
(rx/map dmm/validate-file)
|
(rx/map dmm/validate-file)
|
||||||
(rx/map prepare)
|
(rx/map prepare)
|
||||||
(rx/mapcat #(rp/cmd! :upload-file-media-object %))
|
(rx/mapcat #(rp/cmd! :upload-file-media-object %))
|
||||||
(rx/do on-upload-success)
|
(rx/tap on-upload-success)
|
||||||
(rx/catch handle-media-error))))))
|
(rx/catch handle-media-error))))))
|
||||||
|
|
||||||
;; --- Upload File Media objects
|
;; --- Upload File Media objects
|
||||||
|
@ -423,7 +423,7 @@
|
||||||
:timeout nil
|
:timeout nil
|
||||||
:tag :media-loading}))
|
:tag :media-loading}))
|
||||||
(->> (rp/cmd! :clone-file-media-object params)
|
(->> (rp/cmd! :clone-file-media-object params)
|
||||||
(rx/do on-success)
|
(rx/tap on-success)
|
||||||
(rx/catch on-error)
|
(rx/catch on-error)
|
||||||
(rx/finalize #(st/emit! (msg/hide-tag :media-loading)))))))))
|
(rx/finalize #(st/emit! (msg/hide-tag :media-loading)))))))))
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
[app.main.data.workspace.guides :as-alias dwg]
|
[app.main.data.workspace.guides :as-alias dwg]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; -- temporary modifiers -------------------------------------------
|
;; -- temporary modifiers -------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -20,9 +20,9 @@
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(declare process-message)
|
(declare process-message)
|
||||||
(declare handle-presence)
|
(declare handle-presence)
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
[app.main.data.workspace.path.helpers :as helpers]
|
[app.main.data.workspace.path.helpers :as helpers]
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn generate-path-changes
|
(defn generate-path-changes
|
||||||
"Generates changes to update the new content of the shape"
|
"Generates changes to update the new content of the shape"
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.schema :as sm]
|
[app.common.schema :as sm]
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def valid-commands
|
(def valid-commands
|
||||||
#{:move-to
|
#{:move-to
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
[app.main.data.workspace.path.undo :as undo]
|
[app.main.data.workspace.path.undo :as undo]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(declare change-edit-mode)
|
(declare change-edit-mode)
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[app.util.path.tools :as upt]
|
[app.util.path.tools :as upt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn modify-handler [id index prefix dx dy match-opposite?]
|
(defn modify-handler [id index prefix dx dy match-opposite?]
|
||||||
(ptk/reify ::modify-handler
|
(ptk/reify ::modify-handler
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
[app.common.svg.path.subpath :as ups]
|
[app.common.svg.path.subpath :as ups]
|
||||||
[app.main.data.workspace.path.common :as common]
|
[app.main.data.workspace.path.common :as common]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn end-path-event?
|
(defn end-path-event?
|
||||||
[event]
|
[event]
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn path-pointer-enter [position]
|
(defn path-pointer-enter [position]
|
||||||
(ptk/reify ::path-pointer-enter
|
(ptk/reify ::path-pointer-enter
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
[app.common.types.container :as ctn]
|
[app.common.types.container :as ctn]
|
||||||
[app.main.data.workspace.changes :as dch]
|
[app.main.data.workspace.changes :as dch]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn convert-selected-to-path []
|
(defn convert-selected-to-path []
|
||||||
(ptk/reify ::convert-selected-to-path
|
(ptk/reify ::convert-selected-to-path
|
||||||
|
|
|
@ -10,8 +10,8 @@
|
||||||
[app.main.data.workspace :as dw]
|
[app.main.data.workspace :as dw]
|
||||||
[app.main.data.workspace.path :as drp]
|
[app.main.data.workspace.path :as drp]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
;; Shortcuts
|
;; Shortcuts
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defonce drag-threshold 5)
|
(defonce drag-threshold 5)
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,8 @@
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.util.path.tools :as upt]
|
[app.util.path.tools :as upt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn process-path-tool
|
(defn process-path-tool
|
||||||
"Generic function that executes path transformations with the content and selected nodes"
|
"Generic function that executes path transformations with the content and selected nodes"
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
[app.main.data.workspace.path.changes :as changes]
|
[app.main.data.workspace.path.changes :as changes]
|
||||||
[app.main.data.workspace.path.state :as st]
|
[app.main.data.workspace.path.state :as st]
|
||||||
[app.main.store :as store]
|
[app.main.store :as store]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn undo-event?
|
(defn undo-event?
|
||||||
[event]
|
[event]
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(log/set-level! :info)
|
(log/set-level! :info)
|
||||||
|
|
||||||
|
|
|
@ -36,10 +36,11 @@
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.main.worker :as uw]
|
[app.main.worker :as uw]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
[beicon.v2.operators :as rxo]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[linked.set :as lks]
|
[linked.set :as lks]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn interrupt?
|
(defn interrupt?
|
||||||
[e]
|
[e]
|
||||||
|
@ -111,8 +112,8 @@
|
||||||
|
|
||||||
(->> selrect-stream
|
(->> selrect-stream
|
||||||
(rx/buffer-time 100)
|
(rx/buffer-time 100)
|
||||||
(rx/map #(last %))
|
(rx/map last)
|
||||||
(rx/dedupe)
|
(rx/pipe (rxo/distinct-contiguous))
|
||||||
(rx/map #(select-shapes-by-current-selrect preserve? ignore-groups?))))
|
(rx/map #(select-shapes-by-current-selrect preserve? ignore-groups?))))
|
||||||
|
|
||||||
(->> (rx/of (update-selrect nil))
|
(->> (rx/of (update-selrect nil))
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
[app.main.data.workspace.shapes :as dws]
|
[app.main.data.workspace.shapes :as dws]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def layout-keys
|
(def layout-keys
|
||||||
[:layout
|
[:layout
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.features :as features]
|
[app.main.features :as features]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn add-shape
|
(defn add-shape
|
||||||
([shape]
|
([shape]
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
[app.common.data :as d]
|
[app.common.data :as d]
|
||||||
[app.main.data.workspace.common :as-alias dwc]
|
[app.main.data.workspace.common :as-alias dwc]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn interrupt? [e] (or (= e :interrupt) (= e ::interrupt)))
|
(defn interrupt? [e] (or (= e :interrupt) (= e ::interrupt)))
|
||||||
|
|
||||||
|
|
|
@ -19,9 +19,9 @@
|
||||||
[app.main.data.workspace.undo :as dwu]
|
[app.main.data.workspace.undo :as dwu]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn extract-name [href]
|
(defn extract-name [href]
|
||||||
(let [query-idx (str/last-index-of href "?")
|
(let [query-idx (str/last-index-of href "?")
|
||||||
|
|
|
@ -29,9 +29,9 @@
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.text-editor :as ted]
|
[app.util.text-editor :as ted]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; -- Attrs
|
;; -- Attrs
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
[app.util.time :as tp]
|
[app.util.time :as tp]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(l/set-level! :info)
|
(l/set-level! :info)
|
||||||
|
|
||||||
|
@ -246,7 +246,7 @@
|
||||||
(rx/filter dch/commit-changes?)
|
(rx/filter dch/commit-changes?)
|
||||||
(rx/observe-on :async)
|
(rx/observe-on :async)
|
||||||
(rx/with-latest-from workspace-data-s)
|
(rx/with-latest-from workspace-data-s)
|
||||||
(rx/flat-map (partial extract-frame-changes page-id))
|
(rx/merge-map (partial extract-frame-changes page-id))
|
||||||
(rx/tap #(l/trc :hint "inconming change" :origin "local" :frame-id (dm/str %))))
|
(rx/tap #(l/trc :hint "inconming change" :origin "local" :frame-id (dm/str %))))
|
||||||
|
|
||||||
;; NOTIFICATIONS CHANGES
|
;; NOTIFICATIONS CHANGES
|
||||||
|
@ -254,7 +254,7 @@
|
||||||
(rx/filter (ptk/type? ::wnt/handle-file-change))
|
(rx/filter (ptk/type? ::wnt/handle-file-change))
|
||||||
(rx/observe-on :async)
|
(rx/observe-on :async)
|
||||||
(rx/with-latest-from workspace-data-s)
|
(rx/with-latest-from workspace-data-s)
|
||||||
(rx/flat-map (partial extract-frame-changes page-id))
|
(rx/merge-map (partial extract-frame-changes page-id))
|
||||||
(rx/tap #(l/trc :hint "inconming change" :origin "notifications" :frame-id (dm/str %))))
|
(rx/tap #(l/trc :hint "inconming change" :origin "notifications" :frame-id (dm/str %))))
|
||||||
|
|
||||||
;; PERSISTENCE CHANGES
|
;; PERSISTENCE CHANGES
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
;; -- Helpers --------------------------------------------------------
|
;; -- Helpers --------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,8 @@
|
||||||
[app.common.logging :as log]
|
[app.common.logging :as log]
|
||||||
[app.common.schema :as sm]
|
[app.common.schema :as sm]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(def discard-transaction-time-millis (* 20 1000))
|
(def discard-transaction-time-millis (* 20 1000))
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,8 @@
|
||||||
[app.common.math :as mth]
|
[app.common.math :as mth]
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn initialize-viewport
|
(defn initialize-viewport
|
||||||
[{:keys [width height] :as size}]
|
[{:keys [width height] :as size}]
|
||||||
|
|
|
@ -15,8 +15,8 @@
|
||||||
[app.main.data.workspace.state-helpers :as wsh]
|
[app.main.data.workspace.state-helpers :as wsh]
|
||||||
[app.main.streams :as ms]
|
[app.main.streams :as ms]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn- impl-update-zoom
|
(defn- impl-update-zoom
|
||||||
[{:keys [vbox] :as local} center zoom]
|
[{:keys [vbox] :as local} center zoom]
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(defn- print-data!
|
(defn- print-data!
|
||||||
[data]
|
[data]
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
[app.common.logging :as log]
|
[app.common.logging :as log]
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.main.store :as st]
|
[app.main.store :as st]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(log/set-level! :trace)
|
(log/set-level! :trace)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
(:require
|
(:require
|
||||||
[app.common.transit :as t]
|
[app.common.transit :as t]
|
||||||
[app.main.repo :as rp]
|
[app.main.repo :as rp]
|
||||||
[beicon.core :as rx]))
|
[beicon.v2.core :as rx]))
|
||||||
|
|
||||||
(defn resolve-file
|
(defn resolve-file
|
||||||
[{:keys [id data] :as file}]
|
[{:keys [id data] :as file}]
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
[app.util.globals :as globals]
|
[app.util.globals :as globals]
|
||||||
[app.util.http :as http]
|
[app.util.http :as http]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[lambdaisland.uri :as u]
|
[lambdaisland.uri :as u]
|
||||||
|
@ -144,7 +144,7 @@
|
||||||
(->> (fetch-gfont-css url)
|
(->> (fetch-gfont-css url)
|
||||||
(rx/map process-gfont-css)
|
(rx/map process-gfont-css)
|
||||||
(rx/tap #(on-loaded id))
|
(rx/tap #(on-loaded id))
|
||||||
(rx/subs (partial add-font-css! id)))
|
(rx/subs! (partial add-font-css! id)))
|
||||||
nil)))
|
nil)))
|
||||||
|
|
||||||
;; --- LOADER: CUSTOM
|
;; --- LOADER: CUSTOM
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.http :as http]
|
[app.util.http :as http]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defonce ready? false)
|
(defonce ready? false)
|
||||||
|
@ -123,7 +123,7 @@
|
||||||
(log/err :hint "rasterizer iframe blocked by adblocker" :origin origin :cause cause)
|
(log/err :hint "rasterizer iframe blocked by adblocker" :origin origin :cause cause)
|
||||||
(rx/of false)))
|
(rx/of false)))
|
||||||
|
|
||||||
(rx/subs (fn [allowed?]
|
(rx/subs! (fn [allowed?]
|
||||||
(if allowed?
|
(if allowed?
|
||||||
(do
|
(do
|
||||||
(dom/append-child! js/document.body iframe)
|
(dom/append-child! js/document.body iframe)
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
[app.util.strings :as ust]
|
[app.util.strings :as ust]
|
||||||
[app.util.thumbnails :as th]
|
[app.util.thumbnails :as th]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]
|
[clojure.set :as set]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
@ -550,7 +550,7 @@
|
||||||
(mapcat get-image-data))]
|
(mapcat get-image-data))]
|
||||||
(->> (rx/from images)
|
(->> (rx/from images)
|
||||||
(rx/map #(cfg/resolve-file-media %))
|
(rx/map #(cfg/resolve-file-media %))
|
||||||
(rx/flat-map http/fetch-data-uri))))
|
(rx/merge-map http/fetch-data-uri))))
|
||||||
|
|
||||||
(defn populate-fonts-cache [objects]
|
(defn populate-fonts-cache [objects]
|
||||||
(let [texts (->> objects
|
(let [texts (->> objects
|
||||||
|
@ -561,10 +561,10 @@
|
||||||
(->> (rx/from texts)
|
(->> (rx/from texts)
|
||||||
(rx/map fonts/get-content-fonts)
|
(rx/map fonts/get-content-fonts)
|
||||||
(rx/reduce set/union #{})
|
(rx/reduce set/union #{})
|
||||||
(rx/flat-map identity)
|
(rx/merge-map identity)
|
||||||
(rx/flat-map fonts/fetch-font-css)
|
(rx/merge-map fonts/fetch-font-css)
|
||||||
(rx/flat-map fonts/extract-fontface-urls)
|
(rx/merge-map fonts/extract-fontface-urls)
|
||||||
(rx/flat-map http/fetch-data-uri))))
|
(rx/merge-map http/fetch-data-uri))))
|
||||||
|
|
||||||
(defn render-page
|
(defn render-page
|
||||||
[data]
|
[data]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
[app.config :as cf]
|
[app.config :as cf]
|
||||||
[app.util.http :as http]
|
[app.util.http :as http]
|
||||||
[app.util.sse :as sse]
|
[app.util.sse :as sse]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]))
|
[cuerdas.core :as str]))
|
||||||
|
|
||||||
(defn handle-response
|
(defn handle-response
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
[app.main.refs :as refs]
|
[app.main.refs :as refs]
|
||||||
[app.main.worker :as uw]
|
[app.main.worker :as uw]
|
||||||
[app.util.range-tree :as rt]
|
[app.util.range-tree :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[clojure.set :as set]))
|
[clojure.set :as set]))
|
||||||
|
|
||||||
(def ^:const snap-accuracy 10)
|
(def ^:const snap-accuracy 10)
|
||||||
|
|
|
@ -9,9 +9,10 @@
|
||||||
[app.common.logging :as log]
|
[app.common.logging :as log]
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[app.util.timers :as tm]
|
[app.util.timers :as tm]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
[beicon.v2.operators :as rxo]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]))
|
[potok.v2.core :as ptk]))
|
||||||
|
|
||||||
(log/set-level! :info)
|
(log/set-level! :info)
|
||||||
|
|
||||||
|
@ -65,7 +66,7 @@
|
||||||
(->> stream
|
(->> stream
|
||||||
(rx/filter (ptk/type? :app.main.data.workspace.changes/commit-changes))
|
(rx/filter (ptk/type? :app.main.data.workspace.changes/commit-changes))
|
||||||
(rx/map #(-> % deref :hint-origin str))
|
(rx/map #(-> % deref :hint-origin str))
|
||||||
(rx/dedupe))
|
(rx/pipe (rxo/distinct-contiguous)))
|
||||||
(->> stream
|
(->> stream
|
||||||
(rx/map ptk/type)
|
(rx/map ptk/type)
|
||||||
(rx/filter #(contains? allowed %))
|
(rx/filter #(contains? allowed %))
|
||||||
|
@ -75,7 +76,7 @@
|
||||||
(> (count buffer) 20)
|
(> (count buffer) 20)
|
||||||
(pop)))
|
(pop)))
|
||||||
#queue [])
|
#queue [])
|
||||||
(rx/subs #(reset! buffer (vec %))))
|
(rx/subs! #(reset! buffer (vec %))))
|
||||||
buffer))
|
buffer))
|
||||||
|
|
||||||
(defn emit!
|
(defn emit!
|
||||||
|
|
|
@ -12,7 +12,8 @@
|
||||||
[app.util.globals :as globals]
|
[app.util.globals :as globals]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.mouse :as mse]
|
[app.util.mouse :as mse]
|
||||||
[beicon.core :as rx]))
|
[beicon.v2.core :as rx]
|
||||||
|
[beicon.v2.operators :as rxo]))
|
||||||
|
|
||||||
;; --- User Events
|
;; --- User Events
|
||||||
|
|
||||||
|
@ -33,23 +34,23 @@
|
||||||
ob (->> pointer
|
ob (->> pointer
|
||||||
(rx/filter #(= :viewport (mse/get-pointer-source %)))
|
(rx/filter #(= :viewport (mse/get-pointer-source %)))
|
||||||
(rx/map mse/get-pointer-position))]
|
(rx/map mse/get-pointer-position))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce mouse-position-ctrl
|
(defonce mouse-position-ctrl
|
||||||
(let [sub (rx/behavior-subject nil)
|
(let [sub (rx/behavior-subject nil)
|
||||||
ob (->> pointer
|
ob (->> pointer
|
||||||
(rx/map mse/get-pointer-ctrl-mod)
|
(rx/map mse/get-pointer-ctrl-mod)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce mouse-position-meta
|
(defonce mouse-position-meta
|
||||||
(let [sub (rx/behavior-subject nil)
|
(let [sub (rx/behavior-subject nil)
|
||||||
ob (->> pointer
|
ob (->> pointer
|
||||||
(rx/map mse/get-pointer-meta-mod)
|
(rx/map mse/get-pointer-meta-mod)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce mouse-position-mod
|
(defonce mouse-position-mod
|
||||||
|
@ -61,16 +62,16 @@
|
||||||
(let [sub (rx/behavior-subject nil)
|
(let [sub (rx/behavior-subject nil)
|
||||||
ob (->> pointer
|
ob (->> pointer
|
||||||
(rx/map mse/get-pointer-shift-mod)
|
(rx/map mse/get-pointer-shift-mod)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce mouse-position-alt
|
(defonce mouse-position-alt
|
||||||
(let [sub (rx/behavior-subject nil)
|
(let [sub (rx/behavior-subject nil)
|
||||||
ob (->> pointer
|
ob (->> pointer
|
||||||
(rx/map mse/get-pointer-alt-mod)
|
(rx/map mse/get-pointer-alt-mod)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce ^:private window-blur
|
(defonce ^:private window-blur
|
||||||
|
@ -93,8 +94,8 @@
|
||||||
;; registering the key pressed but on blurring the
|
;; registering the key pressed but on blurring the
|
||||||
;; window (unfocus) the key down is never arrived.
|
;; window (unfocus) the key down is never arrived.
|
||||||
(rx/merge window-blur)
|
(rx/merge window-blur)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce keyboard-ctrl
|
(defonce keyboard-ctrl
|
||||||
|
@ -107,8 +108,8 @@
|
||||||
;; registering the key pressed but on blurring the
|
;; registering the key pressed but on blurring the
|
||||||
;; window (unfocus) the key down is never arrived.
|
;; window (unfocus) the key down is never arrived.
|
||||||
(rx/merge window-blur)
|
(rx/merge window-blur)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce keyboard-meta
|
(defonce keyboard-meta
|
||||||
|
@ -121,8 +122,8 @@
|
||||||
;; registering the key pressed but on blurring the
|
;; registering the key pressed but on blurring the
|
||||||
;; window (unfocus) the key down is never arrived.
|
;; window (unfocus) the key down is never arrived.
|
||||||
(rx/merge window-blur)
|
(rx/merge window-blur)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
||||||
(defonce keyboard-mod
|
(defonce keyboard-mod
|
||||||
|
@ -136,6 +137,6 @@
|
||||||
(rx/filter kbd/space?)
|
(rx/filter kbd/space?)
|
||||||
(rx/filter (complement kbd/editing-event?))
|
(rx/filter (complement kbd/editing-event?))
|
||||||
(rx/map kbd/key-down-event?)
|
(rx/map kbd/key-down-event?)
|
||||||
(rx/dedupe))]
|
(rx/pipe (rxo/distinct-contiguous)))]
|
||||||
(rx/subscribe-with ob sub)
|
(rx/sub! ob sub)
|
||||||
sub))
|
sub))
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
[app.util.i18n :refer [tr]]
|
[app.util.i18n :refer [tr]]
|
||||||
[app.util.keyboard :as k]
|
[app.util.keyboard :as k]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@
|
||||||
[event provider params]
|
[event provider params]
|
||||||
(dom/prevent-default event)
|
(dom/prevent-default event)
|
||||||
(->> (rp/cmd! :login-with-oidc (assoc params :provider provider))
|
(->> (rp/cmd! :login-with-oidc (assoc params :provider provider))
|
||||||
(rx/subs (fn [{:keys [redirect-uri] :as rsp}]
|
(rx/subs! (fn [{:keys [redirect-uri] :as rsp}]
|
||||||
(if redirect-uri
|
(if redirect-uri
|
||||||
(.replace js/location redirect-uri)
|
(.replace js/location redirect-uri)
|
||||||
(log/error :hint "unexpected response from OIDC method"
|
(log/error :hint "unexpected response from OIDC method"
|
||||||
|
@ -60,7 +60,7 @@
|
||||||
(dom/stop-propagation event)
|
(dom/stop-propagation event)
|
||||||
(let [{:keys [on-error]} (meta params)]
|
(let [{:keys [on-error]} (meta params)]
|
||||||
(->> (rp/cmd! :login-with-ldap params)
|
(->> (rp/cmd! :login-with-ldap params)
|
||||||
(rx/subs (fn [profile]
|
(rx/subs! (fn [profile]
|
||||||
(if-let [token (:invitation-token profile)]
|
(if-let [token (:invitation-token profile)]
|
||||||
(st/emit! (rt/nav :auth-verify-token {} {:token token}))
|
(st/emit! (rt/nav :auth-verify-token {} {:token token}))
|
||||||
(st/emit! (du/login-from-token {:profile profile}))))
|
(st/emit! (du/login-from-token {:profile profile}))))
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
[app.main.ui.messages :as msgs]
|
[app.main.ui.messages :as msgs]
|
||||||
[app.util.i18n :refer [tr tr-html]]
|
[app.util.i18n :refer [tr tr-html]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@
|
||||||
(->> (rp/cmd! :prepare-register-profile cdata)
|
(->> (rp/cmd! :prepare-register-profile cdata)
|
||||||
(rx/map #(merge % params))
|
(rx/map #(merge % params))
|
||||||
(rx/finalize #(reset! submitted? false))
|
(rx/finalize #(reset! submitted? false))
|
||||||
(rx/subs
|
(rx/subs!
|
||||||
on-success
|
on-success
|
||||||
(partial handle-prepare-register-error form))))))]
|
(partial handle-prepare-register-error form))))))]
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@
|
||||||
(let [params (:clean-data @form)]
|
(let [params (:clean-data @form)]
|
||||||
(->> (rp/cmd! :register-profile params)
|
(->> (rp/cmd! :register-profile params)
|
||||||
(rx/finalize #(reset! submitted? false))
|
(rx/finalize #(reset! submitted? false))
|
||||||
(rx/subs on-success
|
(rx/subs! on-success
|
||||||
(partial handle-register-error form))))))]
|
(partial handle-register-error form))))))]
|
||||||
|
|
||||||
(if new-css-system
|
(if new-css-system
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(defmulti handle-token (fn [token] (:iss token)))
|
(defmulti handle-token (fn [token] (:iss token)))
|
||||||
|
@ -69,7 +69,7 @@
|
||||||
(mf/with-effect []
|
(mf/with-effect []
|
||||||
(dom/set-html-title (tr "title.default"))
|
(dom/set-html-title (tr "title.default"))
|
||||||
(->> (rp/cmd! :verify-token {:token token})
|
(->> (rp/cmd! :verify-token {:token token})
|
||||||
(rx/subs
|
(rx/subs!
|
||||||
(fn [tdata]
|
(fn [tdata]
|
||||||
(handle-token tdata))
|
(handle-token tdata))
|
||||||
(fn [{:keys [type code] :as error}]
|
(fn [{:keys [type code] :as error}]
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.timers :as timers]
|
[app.util.timers :as timers]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc copy-button [{:keys [data on-copied children class]}]
|
(mf/defc copy-button [{:keys [data on-copied children class]}]
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc comments-icon
|
(mf/defc comments-icon
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
[app.main.worker :as uw]
|
[app.main.worker :as uw]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(def ^:const options [:all :merge :detach])
|
(def ^:const options [:all :merge :detach])
|
||||||
|
@ -101,8 +101,9 @@
|
||||||
:features features
|
:features features
|
||||||
:export-type selected
|
:export-type selected
|
||||||
:files files})
|
:files files})
|
||||||
(rx/delay-emit 1000)
|
(rx/mapcat #(->> (rx/of %)
|
||||||
(rx/subs
|
(rx/delay 1000)))
|
||||||
|
(rx/subs!
|
||||||
(fn [msg]
|
(fn [msg]
|
||||||
(cond
|
(cond
|
||||||
(= :error (:type msg))
|
(= :error (:type msg))
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(defn get-project-name
|
(defn get-project-name
|
||||||
|
@ -195,7 +195,7 @@
|
||||||
(when show?
|
(when show?
|
||||||
(->> (rp/cmd! :get-all-projects)
|
(->> (rp/cmd! :get-all-projects)
|
||||||
(rx/map group-by-team)
|
(rx/map group-by-team)
|
||||||
(rx/subs #(when (mf/ref-val mounted-ref)
|
(rx/subs! #(when (mf/ref-val mounted-ref)
|
||||||
(reset! teams %)))))))
|
(reset! teams %)))))))
|
||||||
|
|
||||||
(when current-team
|
(when current-team
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
(mf/deps team installed-fonts)
|
(mf/deps team installed-fonts)
|
||||||
(fn [blobs]
|
(fn [blobs]
|
||||||
(->> (df/process-upload blobs (:id team))
|
(->> (df/process-upload blobs (:id team))
|
||||||
(rx/subs (fn [result]
|
(rx/subs! (fn [result]
|
||||||
(swap! fonts df/merge-and-group-fonts installed-fonts result))
|
(swap! fonts df/merge-and-group-fonts installed-fonts result))
|
||||||
(fn [error]
|
(fn [error]
|
||||||
(js/console.error "error" error))))))
|
(js/console.error "error" error))))))
|
||||||
|
@ -87,7 +87,7 @@
|
||||||
(swap! uploading conj (:id item))
|
(swap! uploading conj (:id item))
|
||||||
(->> (rp/cmd! :create-font-variant item)
|
(->> (rp/cmd! :create-font-variant item)
|
||||||
(rx/delay-at-least 2000)
|
(rx/delay-at-least 2000)
|
||||||
(rx/subs (fn [font]
|
(rx/subs! (fn [font]
|
||||||
(swap! fonts dissoc (:id item))
|
(swap! fonts dissoc (:id item))
|
||||||
(swap! uploading disj (:id item))
|
(swap! uploading disj (:id item))
|
||||||
(st/emit! (df/add-font font)))
|
(st/emit! (df/add-font font)))
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
(mf/with-effect [file-id revn visible? thumbnail-uri]
|
(mf/with-effect [file-id revn visible? thumbnail-uri]
|
||||||
(when (and visible? (not thumbnail-uri))
|
(when (and visible? (not thumbnail-uri))
|
||||||
(->> (ask-for-thumbnail file-id revn)
|
(->> (ask-for-thumbnail file-id revn)
|
||||||
(rx/subs (fn [url]
|
(rx/subs! (fn [url]
|
||||||
(st/emit! (dd/set-file-thumbnail file-id url)))
|
(st/emit! (dd/set-file-thumbnail file-id url)))
|
||||||
(fn [cause]
|
(fn [cause]
|
||||||
(log/error :hint "unable to render thumbnail"
|
(log/error :hint "unable to render thumbnail"
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(log/set-level! :debug)
|
(log/set-level! :debug)
|
||||||
|
@ -319,9 +319,9 @@
|
||||||
(->> (uw/ask-many!
|
(->> (uw/ask-many!
|
||||||
{:cmd :analyze-import
|
{:cmd :analyze-import
|
||||||
:files files})
|
:files files})
|
||||||
(rx/delay-emit emit-delay)
|
(rx/mapcat #(rx/delay emit-delay (rx/of %)))
|
||||||
(rx/filter some?)
|
(rx/filter some?)
|
||||||
(rx/subs
|
(rx/subs!
|
||||||
(fn [{:keys [uri data error type] :as msg}]
|
(fn [{:keys [uri data error type] :as msg}]
|
||||||
(if (some? error)
|
(if (some? error)
|
||||||
(swap! state update :files set-analyze-error uri)
|
(swap! state update :files set-analyze-error uri)
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
:project-id project-id
|
:project-id project-id
|
||||||
:files files
|
:files files
|
||||||
:features @features/features-ref})
|
:features @features/features-ref})
|
||||||
(rx/subs
|
(rx/subs!
|
||||||
(fn [{:keys [file-id status message errors] :as msg}]
|
(fn [{:keys [file-id status message errors] :as msg}]
|
||||||
(swap! state update :files update-status file-id status message errors))))))
|
(swap! state update :files update-status file-id status message errors))))))
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
[app.util.time :as dt]
|
[app.util.time :as dt]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc header
|
(mf/defc header
|
||||||
|
|
|
@ -33,10 +33,10 @@
|
||||||
[app.util.object :as obj]
|
[app.util.object :as obj]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[goog.functions :as f]
|
[goog.functions :as f]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(mf/defc sidebar-project
|
(mf/defc sidebar-project
|
||||||
|
|
|
@ -27,7 +27,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[cuerdas.core :as str]
|
[cuerdas.core :as str]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
[app.main.ui.icons :as i]
|
[app.main.ui.icons :as i]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[cljs.spec.alpha :as s]
|
[cljs.spec.alpha :as s]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
[app.util.keyboard :as kbd]
|
[app.util.keyboard :as kbd]
|
||||||
[app.util.router :as rt]
|
[app.util.router :as rt]
|
||||||
[okulary.core :as l]
|
[okulary.core :as l]
|
||||||
[potok.core :as ptk]
|
[potok.v2.core :as ptk]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
(def builtin-templates
|
(def builtin-templates
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
[app.util.dom :as dom]
|
[app.util.dom :as dom]
|
||||||
[app.util.i18n :as i18n :refer [tr]]
|
[app.util.i18n :as i18n :refer [tr]]
|
||||||
[app.util.keyboard :as k]
|
[app.util.keyboard :as k]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
[goog.events :as events]
|
[goog.events :as events]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@
|
||||||
(rx/mapcat identity)
|
(rx/mapcat identity)
|
||||||
(rx/map (juxt :id :name))
|
(rx/map (juxt :id :name))
|
||||||
(rx/reduce conj [])
|
(rx/reduce conj [])
|
||||||
(rx/subs #(reset! references* %))))
|
(rx/subs! #(reset! references* %))))
|
||||||
|
|
||||||
(mf/with-effect [accept-fn]
|
(mf/with-effect [accept-fn]
|
||||||
(letfn [(on-keydown [event]
|
(letfn [(on-keydown [event]
|
||||||
|
|
|
@ -19,7 +19,8 @@
|
||||||
[app.util.storage :refer [storage]]
|
[app.util.storage :refer [storage]]
|
||||||
[app.util.timers :as ts]
|
[app.util.timers :as ts]
|
||||||
[app.util.webapi :as wapi]
|
[app.util.webapi :as wapi]
|
||||||
[beicon.core :as rx]
|
[beicon.v2.core :as rx]
|
||||||
|
[beicon.v2.operators :as rxo]
|
||||||
[goog.functions :as f]
|
[goog.functions :as f]
|
||||||
[rumext.v2 :as mf]))
|
[rumext.v2 :as mf]))
|
||||||
|
|
||||||
|
@ -35,8 +36,8 @@
|
||||||
(let [[state reset-state!] (mf/useState #(if (satisfies? IDeref ob) @ob nil))]
|
(let [[state reset-state!] (mf/useState #(if (satisfies? IDeref ob) @ob nil))]
|
||||||
(mf/useEffect
|
(mf/useEffect
|
||||||
(fn []
|
(fn []
|
||||||
(let [sub (rx/subscribe ob #(reset-state! %))]
|
(let [sub (rx/sub! ob #(reset-state! %))]
|
||||||
#(rx/cancel! sub)))
|
#(rx/dispose! sub)))
|
||||||
#js [ob])
|
#js [ob])
|
||||||
state))
|
state))
|
||||||
|
|
||||||
|
@ -106,7 +107,7 @@
|
||||||
|
|
||||||
cleanup
|
cleanup
|
||||||
(fn []
|
(fn []
|
||||||
(some-> (:subscr @state) rx/unsub!)
|
(some-> (:subscr @state) rx/dispose!)
|
||||||
(swap! state (fn [state]
|
(swap! state (fn [state]
|
||||||
(-> state
|
(-> state
|
||||||
(cancel-timer)
|
(cancel-timer)
|
||||||
|
@ -217,7 +218,7 @@
|
||||||
(mf/use-effect
|
(mf/use-effect
|
||||||
deps
|
deps
|
||||||
(fn []
|
(fn []
|
||||||
(let [sub (->> stream (rx/subs on-subscribe))]
|
(let [sub (->> stream (rx/subs! on-subscribe))]
|
||||||
#(rx/dispose! sub))))))
|
#(rx/dispose! sub))))))
|
||||||
|
|
||||||
;; https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
;; https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
|
||||||
|
@ -339,8 +340,8 @@
|
||||||
|
|
||||||
intersecting?)))
|
intersecting?)))
|
||||||
|
|
||||||
(rx/dedupe))
|
(rx/pipe (rxo/distinct-contiguous)))
|
||||||
subs (rx/subscribe stream update-state!)]
|
subs (rx/sub! stream update-state!)]
|
||||||
(.observe ^js @intersection-observer node)
|
(.observe ^js @intersection-observer node)
|
||||||
(fn []
|
(fn []
|
||||||
(.unobserve ^js @intersection-observer node)
|
(.unobserve ^js @intersection-observer node)
|
||||||
|
@ -383,7 +384,7 @@
|
||||||
(let [node (mf/ref-val rowref)
|
(let [node (mf/ref-val rowref)
|
||||||
mnt? (volatile! true)
|
mnt? (volatile! true)
|
||||||
sub (->> (wapi/observe-resize node)
|
sub (->> (wapi/observe-resize node)
|
||||||
(rx/subs (fn [entries]
|
(rx/subs! (fn [entries]
|
||||||
(let [row (first entries)
|
(let [row (first entries)
|
||||||
row-rect (.-contentRect ^js row)
|
row-rect (.-contentRect ^js row)
|
||||||
row-width (.-width ^js row-rect)]
|
row-width (.-width ^js row-rect)]
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue