Feat: record audio on mobile (#4766)

* feat(audio): render audio link as component

* refactor frontend/component/block/inline

* fix audio component on mobile

* Fix(iOS): allow clock to replay audio

* feat(mobile): audio record

* add permission request code on record

* rename `editor/recording?` to `editor/record-status`

* move `get-asset-path` into handler/editor.cljs

* add android settings

* support sharing audio file from some apps

* enhance(record): insert audio link in a new block if non-editing

* feat(audio): allow cancelling record

* fix lints

* feat(iOS): add a tab bar

* tweak some css on mobile

* fix lints

* fix https://github.com/logseq/logseq/issues/4798

* enable tab bar on Android

* fix landscape height of tab bar

* add :reuse-last-block? option

* dont't show tab bar when editing mirror code

* tweak code-editor css

* increase width for more functional buttons

* fix card preview css on iPad

* add document-mode to tab bar

* remove tabbar when editing code and tweak textarea resize cursor behavior

* reduce SplashScreen launch screen duration

* don't show tabbar when editing page title

* enhance: float timer

* fix lint

* fix tabbar height on iPhone without notch

* remove .embed-page width

* fix lint

Co-authored-by: Andelf <andelf@gmail.com>
This commit is contained in:
llcc
2022-04-12 20:17:54 +08:00
committed by GitHub
parent 9f6aad98cf
commit f4985fd8ef
35 changed files with 1028 additions and 635 deletions

View File

@@ -54,7 +54,8 @@
[lambdaisland.glogi :as log]
[medley.core :as medley]
[promesa.core :as p]
[frontend.util.keycode :as keycode]))
[frontend.util.keycode :as keycode]
["path" :as path]))
;; FIXME: should support multiple images concurrently uploading
@@ -1525,6 +1526,13 @@
(fs/mkdir-if-not-exists (str repo-dir "/" assets-dir))
(fn [] [repo-dir assets-dir]))))
(defn get-asset-path [filename]
(p/let [[repo-dir assets-dir] (ensure-assets-dir! (state/get-current-repo))
path (path/join repo-dir assets-dir filename)]
(if (mobile-util/native-android?)
path
(js/encodeURI (js/decodeURI path)))))
(defn save-assets!
([_ repo files]
(p/let [[repo-dir assets-dir] (ensure-assets-dir! repo)]
@@ -3042,7 +3050,7 @@
(when (< vw-height (+ cursor-y mobile-toolbar-height))
(let [main-node (gdom/getElement "main-content-container")
scroll-top (.-scrollTop main-node)]
(set! (.-scrollTop main-node) (+ scroll-top (/ vw-height 2))))))))
(set! (.-scrollTop main-node) (+ scroll-top row-height)))))))
(defn editor-on-change!
[block id search-timeout]