mirror of https://github.com/logseq/logseq
Merge branch 'master' into enhance/graph-parser-part-four
commit
b74b64bc8b
|
@ -81,7 +81,7 @@
|
|||
(.unregisterProtocol protocol FILE_LSP_SCHEME)
|
||||
(.unregisterProtocol protocol "assets")))
|
||||
|
||||
(defn- handle-export-publish-assets [_event html custom-css-path repo-path asset-filenames output-path]
|
||||
(defn- handle-export-publish-assets [_event html custom-css-path export-css-path repo-path asset-filenames output-path]
|
||||
(p/let [app-path (. app getAppPath)
|
||||
asset-filenames (js->clj asset-filenames)
|
||||
root-dir (or output-path (handler/open-dir-dialog))]
|
||||
|
@ -89,7 +89,8 @@
|
|||
(let [static-dir (path/join root-dir "static")
|
||||
assets-from-dir (path/join repo-path "assets")
|
||||
assets-to-dir (path/join root-dir "assets")
|
||||
index-html-path (path/join root-dir "index.html")]
|
||||
index-html-path (path/join root-dir "index.html")
|
||||
export-or-custom-css-path (if (fs/existsSync export-css-path) export-css-path custom-css-path)]
|
||||
(p/let [_ (. fs ensureDir static-dir)
|
||||
_ (. fs ensureDir assets-to-dir)
|
||||
_ (p/all (concat
|
||||
|
@ -111,8 +112,8 @@
|
|||
(fn [part]
|
||||
(. fs copy (path/join app-path part) (path/join static-dir part)))
|
||||
["css" "fonts" "icons" "img" "js"])))
|
||||
custom-css (. fs readFile custom-css-path)
|
||||
_ (. fs writeFile (path/join static-dir "css" "custom.css") custom-css)
|
||||
export-css (. fs readFile export-or-custom-css-path)
|
||||
_ (. fs writeFile (path/join static-dir "css" "export.css") export-css)
|
||||
js-files ["main.js" "code-editor.js" "excalidraw.js"]
|
||||
_ (p/all (map (fn [file]
|
||||
(. fs removeSync (path/join static-dir "js" file)))
|
||||
|
|
|
@ -525,6 +525,7 @@
|
|||
|
||||
(when (= (state/sub :editor/record-status) "RECORDING")
|
||||
[:div#audio-record-toolbar
|
||||
{:style {:bottom (+ @util/keyboard-height 45)}}
|
||||
(footer/audio-record-cp)])
|
||||
|
||||
(ui/ls-textarea
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
#audio-record-toolbar {
|
||||
position: fixed;
|
||||
background-color: var(--ls-secondary-background-color);
|
||||
bottom: 45px;
|
||||
width: 88px;
|
||||
justify-content: left;
|
||||
left: 5px;
|
||||
|
|
|
@ -151,6 +151,14 @@
|
|||
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
|
||||
:-for "customize_css"}))
|
||||
|
||||
(defn edit-export-css []
|
||||
(row-with-button-action
|
||||
{:left-label (t :settings-page/export-theme)
|
||||
:button-label (t :settings-page/edit-export-css)
|
||||
:href (rfe/href :file {:path (config/get-export-css-path)})
|
||||
:on-click #(js/setTimeout (fn [] (ui-handler/toggle-settings-modal!)))
|
||||
:-for "customize_css"}))
|
||||
|
||||
(defn show-brackets-row [t show-brackets?]
|
||||
[:div.it.sm:grid.sm:grid-cols-3.sm:gap-4.sm:items-start
|
||||
[:label.block.text-sm.font-medium.leading-5.opacity-70
|
||||
|
@ -518,6 +526,7 @@
|
|||
(theme-modes-row t switch-theme system-theme? dark?)
|
||||
(when current-repo (edit-config-edn))
|
||||
(when current-repo (edit-custom-css))
|
||||
(when current-repo (edit-export-css))
|
||||
(keyboard-shortcuts-row t)]))
|
||||
|
||||
(rum/defcs settings-editor < rum/reactive
|
||||
|
|
|
@ -243,6 +243,7 @@
|
|||
(defonce recycle-dir ".recycle")
|
||||
(def config-file "config.edn")
|
||||
(def custom-css-file "custom.css")
|
||||
(def export-css-file "export.css")
|
||||
(def custom-js-file "custom.js")
|
||||
(def metadata-file "metadata.edn")
|
||||
(def pages-metadata-file "pages-metadata.edn")
|
||||
|
@ -359,6 +360,15 @@
|
|||
(get-file-path repo
|
||||
(str app-name "/" custom-css-file)))))
|
||||
|
||||
(defn get-export-css-path
|
||||
([]
|
||||
(get-export-css-path (state/get-current-repo)))
|
||||
([repo]
|
||||
(when repo
|
||||
(get-file-path repo
|
||||
(str app-name "/" export-css-file)))))
|
||||
|
||||
|
||||
(defn get-custom-js-path
|
||||
([]
|
||||
(get-custom-js-path (state/get-current-repo)))
|
||||
|
|
|
@ -147,8 +147,10 @@
|
|||
:settings-page/git-commit-delay "Git auto commit seconds"
|
||||
:settings-page/edit-config-edn "Edit config.edn"
|
||||
:settings-page/edit-custom-css "Edit custom.css"
|
||||
:settings-page/edit-export-css "Edit export.css"
|
||||
:settings-page/custom-configuration "Custom configuration"
|
||||
:settings-page/custom-theme "Custom theme"
|
||||
:settings-page/export-theme "Export theme"
|
||||
:settings-page/show-brackets "Show brackets"
|
||||
:settings-page/spell-checker "Spell checker"
|
||||
:settings-page/auto-updater "Auto updater"
|
||||
|
|
|
@ -2,46 +2,47 @@
|
|||
(:refer-clojure :exclude [run!])
|
||||
(:require [clojure.core.async :as async]
|
||||
[clojure.set :as set]
|
||||
[frontend.context.i18n :refer [t]]
|
||||
[clojure.string :as string]
|
||||
[frontend.commands :as commands]
|
||||
[frontend.components.diff :as diff]
|
||||
[frontend.handler.plugin :as plugin-handler]
|
||||
[frontend.fs.capacitor-fs :as capacitor-fs]
|
||||
[frontend.components.plugins :as plugin]
|
||||
[frontend.components.encryption :as encryption]
|
||||
[frontend.components.git :as git-component]
|
||||
[frontend.components.shell :as shell]
|
||||
[frontend.components.plugins :as plugin]
|
||||
[frontend.components.search :as search]
|
||||
[frontend.components.shell :as shell]
|
||||
[frontend.config :as config]
|
||||
[frontend.context.i18n :refer [t]]
|
||||
[frontend.db :as db]
|
||||
[logseq.graph-parser.db.schema :as db-schema]
|
||||
[frontend.encrypt :as encrypt]
|
||||
[frontend.extensions.srs :as srs]
|
||||
[frontend.fs :as fs]
|
||||
[frontend.fs.capacitor-fs :as capacitor-fs]
|
||||
[frontend.fs.nfs :as nfs]
|
||||
[frontend.fs.sync :as sync]
|
||||
[frontend.fs.watcher-handler :as fs-watcher]
|
||||
[frontend.handler.common :as common-handler]
|
||||
[frontend.handler.editor :as editor-handler]
|
||||
[frontend.handler.file :as file-handler]
|
||||
[frontend.handler.notification :as notification]
|
||||
[frontend.handler.page :as page-handler]
|
||||
[frontend.handler.plugin :as plugin-handler]
|
||||
[frontend.handler.repo :as repo-handler]
|
||||
[frontend.handler.route :as route-handler]
|
||||
[frontend.handler.search :as search-handler]
|
||||
[frontend.handler.ui :as ui-handler]
|
||||
[frontend.handler.repo :as repo-handler]
|
||||
[frontend.handler.file :as file-handler]
|
||||
[frontend.handler.route :as route-handler]
|
||||
[frontend.handler.web.nfs :as nfs-handler]
|
||||
[frontend.modules.shortcut.core :as st]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[frontend.modules.instrumentation.posthog :as posthog]
|
||||
[frontend.modules.outliner.file :as outliner-file]
|
||||
[frontend.commands :as commands]
|
||||
[frontend.modules.shortcut.core :as st]
|
||||
[frontend.state :as state]
|
||||
[frontend.ui :as ui]
|
||||
[frontend.util :as util]
|
||||
[rum.core :as rum]
|
||||
[frontend.modules.instrumentation.posthog :as posthog]
|
||||
[frontend.mobile.util :as mobile-util]
|
||||
[promesa.core :as p]
|
||||
[frontend.fs :as fs]
|
||||
[clojure.string :as string]
|
||||
[frontend.util.persist-var :as persist-var]
|
||||
[frontend.fs.sync :as sync]
|
||||
[frontend.components.encryption :as encryption]
|
||||
[frontend.encrypt :as encrypt]))
|
||||
[goog.dom :as gdom]
|
||||
[promesa.core :as p]
|
||||
[rum.core :as rum]))
|
||||
|
||||
;; TODO: should we move all events here?
|
||||
|
||||
|
@ -296,8 +297,15 @@
|
|||
(when (mobile-util/native-ios?)
|
||||
(reset! util/keyboard-height keyboard-height)
|
||||
(set! (.. main-node -style -marginBottom) (str keyboard-height "px"))
|
||||
(when-let [left-sidebar-node (gdom/getElement "left-sidebar")]
|
||||
(set! (.. left-sidebar-node -style -bottom) (str keyboard-height "px")))
|
||||
(when-let [right-sidebar-node (gdom/getElementByClass "sidebar-item-list")]
|
||||
(set! (.. right-sidebar-node -style -paddingBottom) (str (+ 150 keyboard-height) "px")))
|
||||
(when-let [card-preview-el (js/document.querySelector ".cards-review")]
|
||||
(set! (.. card-preview-el -style -marginBottom) (str keyboard-height "px")))
|
||||
(when (= (state/sub :editor/record-status) "RECORDING")
|
||||
(when-let [record-node (gdom/getElement "audio-record-toolbar")]
|
||||
(set! (.. record-node -style -bottom) (str (+ 45 keyboard-height) "px"))))
|
||||
(js/setTimeout (fn []
|
||||
(let [toolbar (.querySelector main-node "#mobile-editor-toolbar")]
|
||||
(set! (.. toolbar -style -bottom) (str keyboard-height "px"))))
|
||||
|
@ -310,7 +318,14 @@
|
|||
(when (mobile-util/native-ios?)
|
||||
(when-let [card-preview-el (js/document.querySelector ".cards-review")]
|
||||
(set! (.. card-preview-el -style -marginBottom) "0px"))
|
||||
(set! (.. main-node -style -marginBottom) "0px"))))
|
||||
(set! (.. main-node -style -marginBottom) "0px")
|
||||
(when-let [left-sidebar-node (gdom/getElement "left-sidebar")]
|
||||
(set! (.. left-sidebar-node -style -bottom) "0px"))
|
||||
(when-let [right-sidebar-node (gdom/getElementByClass "sidebar-item-list")]
|
||||
(set! (.. right-sidebar-node -style -paddingBottom) "150px"))
|
||||
(when (= (state/sub :editor/record-status) "RECORDING")
|
||||
(when-let [record-node (gdom/getElement "audio-record-toolbar")]
|
||||
(set! (.. record-node -style -bottom) "45px"))))))
|
||||
|
||||
(defmethod handle :plugin/consume-updates [[_ id pending? updated?]]
|
||||
(let [downloading? (:plugin/updates-downloading? @state/state)]
|
||||
|
|
|
@ -95,6 +95,7 @@
|
|||
(js/window.apis.exportPublishAssets
|
||||
raw-html-str
|
||||
(config/get-custom-css-path)
|
||||
(config/get-export-css-path)
|
||||
(config/get-repo-dir repo)
|
||||
(clj->js asset-filenames)
|
||||
(util/mocked-open-dir-path))
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
(editor-handler/remove-block-property! uuid :heading)
|
||||
(editor-handler/set-block-property! uuid :heading true)))))
|
||||
(action-command "infinity" "Card" #(srs/make-block-a-card! (:block/uuid block)))
|
||||
(action-command "copy" "Copy" #(editor-handler/copy-selection-blocks))
|
||||
(action-command "copy" "Copy" #(editor-handler/copy-selection-blocks false))
|
||||
(action-command "cut" "Cut" #(editor-handler/cut-selection-blocks true))
|
||||
(action-command "trash" "Delete" #(editor-handler/delete-block-aux! block true))
|
||||
(action-command "registered" "Copy ref"
|
||||
|
|
|
@ -43,7 +43,10 @@
|
|||
(reset! *record-start -1)
|
||||
(mobile-bar-command record/start-recording "microphone"))
|
||||
[:div.flex.flex-row.items-center
|
||||
(mobile-bar-command record/stop-recording "player-stop")
|
||||
(mobile-bar-command #(do
|
||||
(record/stop-recording)
|
||||
(reset! *record-start -1))
|
||||
"player-stop")
|
||||
[:div.timer.pl-2
|
||||
{:on-click record/stop-recording}
|
||||
(seconds->minutes:seconds @*record-start)]]))
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
(command #(do (viewport-fn) (commands/simple-insert! parent-id "#" {})) "tag" true)
|
||||
(command editor-handler/cycle-priority! "a-b" true)
|
||||
(command editor-handler/toggle-list! "list" true)
|
||||
(command editor-handler/toggle-list! "list" true)
|
||||
(command #(mobile-camera/embed-photo parent-id) "camera" true)
|
||||
(command record/start-recording "microphone" true)
|
||||
(command commands/insert-youtube-timestamp "brand-youtube" true)
|
||||
|
|
|
@ -56,12 +56,15 @@
|
|||
(log/error :file/write-failed {:path path
|
||||
:error error})))
|
||||
url (util/format "../assets/%s" filename)
|
||||
file-link (editor-handler/get-asset-file-link format url filename true)]
|
||||
file-link (editor-handler/get-asset-file-link format url filename true)
|
||||
args (merge (if (parse-uuid page)
|
||||
{:block-uuid (uuid page)}
|
||||
{:page page})
|
||||
{:edit-block? false
|
||||
:replace-empty-target? true})]
|
||||
(if edit-block
|
||||
(state/append-current-edit-content! file-link)
|
||||
(editor-handler/api-insert-new-block! file-link {:page page
|
||||
:edit-block? false
|
||||
:replace-empty-target? true}))))
|
||||
(editor-handler/api-insert-new-block! file-link args))))
|
||||
|
||||
(defn stop-recording []
|
||||
(p/catch
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
:name "viewport"}]
|
||||
[:link {:type "text/css", :href "static/css/tabler-icons.min.css", :rel "stylesheet"}]
|
||||
[:link {:type "text/css", :href "static/css/style.css", :rel "stylesheet"}]
|
||||
[:link {:type "text/css", :href "static/css/custom.css", :rel "stylesheet"}]
|
||||
[:link {:type "text/css", :href "static/css/export.css", :rel "stylesheet"}]
|
||||
[:link
|
||||
{:href icon
|
||||
:type "image/png",
|
||||
|
|
Loading…
Reference in New Issue