Merge branch 'master' into feat/db

This commit is contained in:
Tienson Qin
2023-06-21 14:09:16 +08:00
199 changed files with 4577 additions and 2565 deletions

View File

@@ -6,7 +6,6 @@
[datascript.core :as d]
[frontend.commands :as commands]
[frontend.config :as config]
[frontend.context.i18n :refer [t]]
[frontend.date :as date]
[frontend.db :as db]
[frontend.db.conn :as conn]
@@ -850,10 +849,6 @@
(fn [chosen _click?]
(state/clear-editor-action!)
(let [wrapped? (= page-ref/left-brackets (gp-util/safe-subs edit-content (- pos 2) pos))
prefix (str (t :new-page) ": ")
chosen (if (string/starts-with? chosen prefix) ;; FIXME: What if a page named "New page: XXX"?
(string/replace-first chosen prefix "")
chosen)
chosen (if (and (util/safe-re-find #"\s+" chosen) (not wrapped?))
(page-ref/->page-ref chosen)
chosen)
@@ -872,11 +867,7 @@
:command :page-ref})))
(fn [chosen _click?]
(state/clear-editor-action!)
(let [prefix (str (t :new-page) ": ")
chosen (if (string/starts-with? chosen prefix)
(string/replace-first chosen prefix "")
chosen)
page-ref-text (get-page-ref-text chosen)]
(let [page-ref-text (get-page-ref-text chosen)]
(editor-handler/insert-command! id
page-ref-text
format