Browse Source

Refactor: rename :block/content to :block/title

Tienson Qin 1 year ago
parent
commit
d847023dc1
100 changed files with 566 additions and 572 deletions
  1. 2 2
      deps/common/resources/templates/config.edn
  2. 1 1
      deps/db/script/create_graph.cljs
  3. 2 2
      deps/db/script/query.cljs
  4. 2 2
      deps/db/script/validate_client_db.cljs
  5. 6 6
      deps/db/src/logseq/db.cljs
  6. 2 2
      deps/db/src/logseq/db/frontend/content.cljs
  7. 5 5
      deps/db/src/logseq/db/frontend/delete_blocks.cljs
  8. 3 7
      deps/db/src/logseq/db/frontend/entity_plus.cljc
  9. 7 7
      deps/db/src/logseq/db/frontend/malli_schema.cljs
  10. 2 2
      deps/db/src/logseq/db/frontend/property.cljs
  11. 2 2
      deps/db/src/logseq/db/frontend/property/build.cljs
  12. 3 3
      deps/db/src/logseq/db/frontend/property/type.cljs
  13. 3 3
      deps/db/src/logseq/db/frontend/rules.cljc
  14. 0 2
      deps/db/src/logseq/db/frontend/schema.cljs
  15. 6 6
      deps/db/src/logseq/db/sqlite/build.cljs
  16. 28 28
      deps/db/test/logseq/db/frontend/inputs_test.cljs
  17. 8 8
      deps/db/test/logseq/db/sqlite/build_test.cljs
  18. 1 1
      deps/db/test/logseq/db/sqlite/common_db_test.cljs
  19. 2 2
      deps/db/test/logseq/db/sqlite/create_graph_test.cljs
  20. 5 5
      deps/graph-parser/src/logseq/graph_parser/block.cljs
  21. 14 14
      deps/graph-parser/src/logseq/graph_parser/exporter.cljs
  22. 1 1
      deps/graph-parser/src/logseq/graph_parser/extract.cljc
  23. 1 1
      deps/graph-parser/src/logseq/graph_parser/test/docs_graph_helper.cljs
  24. 2 2
      deps/graph-parser/src/logseq/graph_parser/whiteboard.cljs
  25. 2 2
      deps/graph-parser/test/logseq/graph_parser/block_test.cljs
  26. 6 6
      deps/graph-parser/test/logseq/graph_parser/cli_test.cljs
  27. 5 5
      deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs
  28. 3 3
      deps/graph-parser/test/logseq/graph_parser/extract_test.cljs
  29. 9 9
      deps/graph-parser/test/logseq/graph_parser_test.cljs
  30. 2 2
      deps/graph-parser/test/resources/exporter-test-graph/logseq/config.edn
  31. 1 1
      deps/outliner/script/transact.cljs
  32. 13 13
      deps/outliner/src/logseq/outliner/core.cljs
  33. 2 2
      deps/outliner/src/logseq/outliner/pipeline.cljs
  34. 2 2
      deps/outliner/src/logseq/outliner/property.cljs
  35. 9 9
      deps/outliner/test/logseq/outliner/pipeline_test.cljs
  36. 24 24
      deps/outliner/test/logseq/outliner/property_test.cljs
  37. 1 1
      deps/publishing/src/logseq/publishing/db.cljs
  38. 2 2
      deps/publishing/test/logseq/publishing/db_test.cljs
  39. 3 3
      docs/dev-practices.md
  40. 3 3
      scripts/src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs
  41. 59 59
      scripts/src/logseq/tasks/db_graph/create_graph_with_properties.cljs
  42. 2 2
      src/main/frontend/commands.cljs
  43. 4 8
      src/main/frontend/common_keywords.cljs
  44. 49 43
      src/main/frontend/components/block.cljs
  45. 1 1
      src/main/frontend/components/block/macros.cljs
  46. 4 4
      src/main/frontend/components/cmdk/core.cljs
  47. 1 1
      src/main/frontend/components/content.cljs
  48. 2 2
      src/main/frontend/components/editor.cljs
  49. 2 2
      src/main/frontend/components/imports.cljs
  50. 1 1
      src/main/frontend/components/page.cljs
  51. 3 3
      src/main/frontend/components/property/value.cljs
  52. 1 1
      src/main/frontend/components/query/builder.cljs
  53. 6 6
      src/main/frontend/components/query_table.cljs
  54. 4 4
      src/main/frontend/components/views.cljs
  55. 2 2
      src/main/frontend/db/model.cljs
  56. 1 1
      src/main/frontend/extensions/pdf/assets.cljs
  57. 3 3
      src/main/frontend/extensions/srs.cljs
  58. 1 1
      src/main/frontend/extensions/tldraw.cljs
  59. 7 8
      src/main/frontend/external/roam_export.cljs
  60. 8 8
      src/main/frontend/format/block.cljs
  61. 2 2
      src/main/frontend/fs/diff_merge.cljs
  62. 2 2
      src/main/frontend/handler/block.cljs
  63. 1 1
      src/main/frontend/handler/code.cljs
  64. 2 2
      src/main/frontend/handler/common/developer.cljs
  65. 16 16
      src/main/frontend/handler/db_based/editor.cljs
  66. 50 50
      src/main/frontend/handler/editor.cljs
  67. 2 2
      src/main/frontend/handler/editor/lifecycle.cljs
  68. 1 1
      src/main/frontend/handler/events.cljs
  69. 1 1
      src/main/frontend/handler/export.cljs
  70. 18 18
      src/main/frontend/handler/file_based/editor.cljs
  71. 3 3
      src/main/frontend/handler/file_based/page_property.cljs
  72. 2 2
      src/main/frontend/handler/file_based/property.cljs
  73. 1 1
      src/main/frontend/handler/import.cljs
  74. 2 2
      src/main/frontend/handler/route.cljs
  75. 1 1
      src/main/frontend/handler/whiteboard.cljs
  76. 1 1
      src/main/frontend/schema/handler/common_config.cljc
  77. 1 1
      src/main/frontend/search/browser.cljs
  78. 4 1
      src/main/frontend/state.cljs
  79. 2 2
      src/main/frontend/util/drawer.cljs
  80. 1 1
      src/main/frontend/worker/export.cljs
  81. 3 3
      src/main/frontend/worker/file.cljs
  82. 3 3
      src/main/frontend/worker/file/core.cljs
  83. 4 4
      src/main/frontend/worker/handler/page.cljs
  84. 1 1
      src/main/frontend/worker/handler/page/db_based/page.cljs
  85. 2 2
      src/main/frontend/worker/handler/page/file_based/page.cljs
  86. 4 4
      src/main/frontend/worker/handler/page/file_based/rename.cljs
  87. 1 1
      src/main/frontend/worker/rtc/const.cljs
  88. 1 1
      src/main/frontend/worker/rtc/db_listener.cljs
  89. 2 2
      src/main/frontend/worker/rtc/remote_update.cljs
  90. 1 1
      src/main/frontend/worker/rtc/skeleton.cljs
  91. 8 12
      src/main/frontend/worker/search.cljs
  92. 10 10
      src/main/frontend/worker/undo_redo.cljs
  93. 1 1
      src/main/frontend/worker/undo_redo2.cljs
  94. 4 4
      src/test/frontend/components/query/result_test.cljs
  95. 2 2
      src/test/frontend/components/query_table_test.cljs
  96. 2 2
      src/test/frontend/db/model_test.cljs
  97. 6 6
      src/test/frontend/db/query_custom_test.cljs
  98. 33 33
      src/test/frontend/db/query_dsl_test.cljs
  99. 3 3
      src/test/frontend/db/query_react_test.cljs
  100. 6 6
      src/test/frontend/handler/editor_async_test.cljs

+ 2 - 2
deps/common/resources/templates/config.edn

@@ -179,10 +179,10 @@
  ;; Default value: false
  ;; Default value: false
  :shortcut/doc-mode-enter-for-new-block? false
  :shortcut/doc-mode-enter-for-new-block? false
 
 
- ;; Block content larger than `block/content-max-length` will not be searchable
+ ;; Block content larger than `block/title-max-length` will not be searchable
  ;; or editable for performance.
  ;; or editable for performance.
  ;; Default value: 10000
  ;; Default value: 10000
- :block/content-max-length 10000
+ :block/title-max-length 10000
 
 
  ;; Display command documentation on hover.
  ;; Display command documentation on hover.
  ;; Default value: true
  ;; Default value: true

+ 1 - 1
deps/db/script/create_graph.cljs

@@ -30,7 +30,7 @@
         conn (outliner-cli/init-conn dir db-name {:classpath (cp/get-classpath)})
         conn (outliner-cli/init-conn dir db-name {:classpath (cp/get-classpath)})
         {:keys [init-tx block-props-tx]} (outliner-cli/build-blocks-tx sqlite-build-edn)]
         {:keys [init-tx block-props-tx]} (outliner-cli/build-blocks-tx sqlite-build-edn)]
     (println "Generating" (count (filter :block/name init-tx)) "pages and"
     (println "Generating" (count (filter :block/name init-tx)) "pages and"
-             (count (filter :block/content init-tx)) "blocks ...")
+             (count (filter :block/title init-tx)) "blocks ...")
     (d/transact! conn init-tx)
     (d/transact! conn init-tx)
     (d/transact! conn block-props-tx)
     (d/transact! conn block-props-tx)
     (println "Created graph" (str db-name "!"))))
     (println "Created graph" (str db-name "!"))))

+ 2 - 2
deps/db/script/query.cljs

@@ -1,7 +1,7 @@
 (ns query
 (ns query
   "An example script that queries any db graph from the commandline e.g.
   "An example script that queries any db graph from the commandline e.g.
 
 
-  $ yarn -s nbb-logseq script/query.cljs db-name '[:find (pull ?b [:block/name :block/content]) :where [?b :block/created-at]]'"
+  $ yarn -s nbb-logseq script/query.cljs db-name '[:find (pull ?b [:block/name :block/title]) :where [?b :block/created-at]]'"
   (:require [datascript.core :as d]
   (:require [datascript.core :as d]
             [clojure.edn :as edn]
             [clojure.edn :as edn]
             [logseq.db.sqlite.cli :as sqlite-cli]
             [logseq.db.sqlite.cli :as sqlite-cli]
@@ -72,4 +72,4 @@
         (pprint/pprint results)))))
         (pprint/pprint results)))))
 
 
 (when (= nbb/*file* (:file (meta #'-main)))
 (when (= nbb/*file* (:file (meta #'-main)))
-  (-main *command-line-args*))
+  (-main *command-line-args*))

+ 2 - 2
deps/db/script/validate_client_db.cljs

@@ -80,7 +80,7 @@
     (println "Read graph" (str db-name " with " (count datoms) " datoms, "
     (println "Read graph" (str db-name " with " (count datoms) " datoms, "
                                (count ent-maps) " entities, "
                                (count ent-maps) " entities, "
                                (count (filter :block/name ent-maps)) " pages, "
                                (count (filter :block/name ent-maps)) " pages, "
-                               (count (filter :block/content ent-maps)) " blocks, "
+                               (count (filter :block/title ent-maps)) " blocks, "
                                (count (filter #(contains? (:block/type %) "class") ent-maps)) " classes, "
                                (count (filter #(contains? (:block/type %) "class") ent-maps)) " classes, "
                                (count (filter #(seq (:block/tags %)) ent-maps)) " objects, "
                                (count (filter #(seq (:block/tags %)) ent-maps)) " objects, "
                                (count (filter #(contains? (:block/type %) "property") ent-maps)) " properties and "
                                (count (filter #(contains? (:block/type %) "property") ent-maps)) " properties and "
@@ -97,4 +97,4 @@
       (validate-graph graph-dir opts))))
       (validate-graph graph-dir opts))))
 
 
 (when (= nbb/*file* (:file (meta #'-main)))
 (when (= nbb/*file* (:file (meta #'-main)))
-  (-main *command-line-args*))
+  (-main *command-line-args*))

+ 6 - 6
deps/db/src/logseq/db.cljs

@@ -28,7 +28,7 @@
     :block/path-refs
     :block/path-refs
     :block/tags
     :block/tags
     :block/link
     :block/link
-    :block/content
+    :block/title
     :block/marker
     :block/marker
     :block/priority
     :block/priority
     :block/properties
     :block/properties
@@ -60,7 +60,7 @@
    (let [tx-data (map (fn [m]
    (let [tx-data (map (fn [m]
                         (if (map? m)
                         (if (map? m)
                           (dissoc m :block/children :block/meta :block/top? :block/bottom? :block/anchor
                           (dissoc m :block/children :block/meta :block/top? :block/bottom? :block/anchor
-                                  :block/title :block/body :block/level :block/container :db/other-tx
+                                  :block.temp/ast-title :block.temp/ast-body :block/level :block/container :db/other-tx
                                   :block/unordered)
                                   :block/unordered)
                           m)) tx-data)
                           m)) tx-data)
          tx-data (->> (common-util/fast-remove-nils tx-data)
          tx-data (->> (common-util/fast-remove-nils tx-data)
@@ -245,7 +245,7 @@
                                    (and
                                    (and
                                     first-child
                                     first-child
                                     (= 1 (count children))
                                     (= 1 (count children))
-                                    (contains? #{"" "-" "*"} (string/trim (:block/content first-child))))))
+                                    (contains? #{"" "-" "*"} (string/trim (:block/title first-child))))))
                                 (not (contains? built-in-pages name))
                                 (not (contains? built-in-pages name))
                                 (not (whiteboard-page? page))
                                 (not (whiteboard-page? page))
                                 (not (:block/_namespace page))
                                 (not (:block/_namespace page))
@@ -432,7 +432,7 @@
                 (when-let [e (d/entity db eid)]
                 (when-let [e (d/entity db eid)]
                   (or (some alias (map :db/id (:block/refs e)))
                   (or (some alias (map :db/id (:block/refs e)))
                       (:block/link e)
                       (:block/link e)
-                      (nil? (:block/content e)))))
+                      (nil? (:block/title e)))))
               search-result-eids)]
               search-result-eids)]
     (when (seq eids)
     (when (seq eids)
       (d/pull-many db '[*] eids))))
       (d/pull-many db '[*] eids))))
@@ -481,7 +481,7 @@
   "Builds tx for a favorite block in favorite page"
   "Builds tx for a favorite block in favorite page"
   [favorite-uuid]
   [favorite-uuid]
   {:block/link [:block/uuid favorite-uuid]
   {:block/link [:block/uuid favorite-uuid]
-   :block/content ""
+   :block/title ""
    :block/format :markdown})
    :block/format :markdown})
 
 
 (defn create-views-page!
 (defn create-views-page!
@@ -498,7 +498,7 @@
         :block/format :markdown})
         :block/format :markdown})
       (sqlite-util/block-with-timestamps
       (sqlite-util/block-with-timestamps
        {:block/uuid (common-uuid/gen-uuid)
        {:block/uuid (common-uuid/gen-uuid)
-        :block/content ""
+        :block/title ""
         :block/format :markdown
         :block/format :markdown
         :block/parent [:block/uuid page-id]
         :block/parent [:block/uuid page-id]
         :block/order (db-order/gen-key nil)
         :block/order (db-order/gen-key nil)

+ 2 - 2
deps/db/src/logseq/db/frontend/content.cljs

@@ -93,9 +93,9 @@
   "Replace `[[internal-id]]` with `[[page name]]`"
   "Replace `[[internal-id]]` with `[[page name]]`"
   [repo db item eid]
   [repo db item eid]
   (if (sqlite-util/db-based-graph? repo)
   (if (sqlite-util/db-based-graph? repo)
-    (if-let [content (:block/content item)]
+    (if-let [content (:block/title item)]
       (let [refs (:block/refs (d/entity db eid))]
       (let [refs (:block/refs (d/entity db eid))]
-        (assoc item :block/content (special-id-ref->page-ref content refs)))
+        (assoc item :block/title (special-id-ref->page-ref content refs)))
       item)
       item)
     item))
     item))
 
 

+ 5 - 5
deps/db/src/logseq/db/frontend/delete_blocks.cljs

@@ -13,7 +13,7 @@
            (mapcat (fn [ref]
            (mapcat (fn [ref]
                      (if replacing-block-ref
                      (if replacing-block-ref
                        (let [id (:db/id ref)
                        (let [id (:db/id ref)
-                             new-content (some-> (:block/content ref)
+                             new-content (some-> (:block/title ref)
                                                  (string/replace (block-ref/->block-ref (str (:block/uuid block)))
                                                  (string/replace (block-ref/->block-ref (str (:block/uuid block)))
                                                                  (block-ref/->block-ref (str (:block/uuid replacing-block-ref)))))
                                                                  (block-ref/->block-ref (str (:block/uuid replacing-block-ref)))))
                              tx (cond->
                              tx (cond->
@@ -22,11 +22,11 @@
                                   [:db/add (:db/id ref) :block/refs (:db/id replacing-block-ref)]
                                   [:db/add (:db/id ref) :block/refs (:db/id replacing-block-ref)]
                                   [:db/add (:db/id ref) :block/path-refs (:db/id replacing-block-ref)]]
                                   [:db/add (:db/id ref) :block/path-refs (:db/id replacing-block-ref)]]
                                   new-content
                                   new-content
-                                  (conj [:db/add id :block/content new-content]))]
+                                  (conj [:db/add id :block/title new-content]))]
                          tx)
                          tx)
                        (let [id (:db/id ref)
                        (let [id (:db/id ref)
-                             block-content (:block/content block)
-                             new-content (some-> (:block/content ref)
+                             block-content (:block/title block)
+                             new-content (some-> (:block/title ref)
                                                  (string/replace (re-pattern (common-util/format "(?i){{embed \\(\\(%s\\)\\)\\s?}}" (str (:block/uuid block))))
                                                  (string/replace (re-pattern (common-util/format "(?i){{embed \\(\\(%s\\)\\)\\s?}}" (str (:block/uuid block))))
                                                                  block-content)
                                                                  block-content)
                                                  (string/replace (block-ref/->block-ref (str (:block/uuid block)))
                                                  (string/replace (block-ref/->block-ref (str (:block/uuid block)))
@@ -35,7 +35,7 @@
                                  [[:db/retract (:db/id ref) :block/refs (:db/id block)]
                                  [[:db/retract (:db/id ref) :block/refs (:db/id block)]
                                   [:db/retract (:db/id ref) :block/path-refs (:db/id block)]]
                                   [:db/retract (:db/id ref) :block/path-refs (:db/id block)]]
                                   new-content
                                   new-content
-                                  (conj [:db/add id :block/content new-content]))]
+                                  (conj [:db/add id :block/title new-content]))]
                          tx)))
                          tx)))
                    refs)))
                    refs)))
        (apply concat)))
        (apply concat)))

+ 3 - 7
deps/db/src/logseq/db/frontend/entity_plus.cljc

@@ -23,8 +23,8 @@
   ([^Entity e k default-value]
   ([^Entity e k default-value]
    (when k
    (when k
      (case k
      (case k
-       :block/raw-content
-       (lookup-entity e :block/content default-value)
+       :block/raw-title
+       (lookup-entity e :block/title default-value)
 
 
        :block/properties
        :block/properties
        (let [db (.-db e)]
        (let [db (.-db e)]
@@ -35,7 +35,7 @@
                                (into {})))
                                (into {})))
            (lookup-entity e :block/properties nil)))
            (lookup-entity e :block/properties nil)))
 
 
-       :block/content
+       :block/title
        (or
        (or
         (get (.-kv e) k)
         (get (.-kv e) k)
         (let [result (lookup-entity e k default-value)]
         (let [result (lookup-entity e k default-value)]
@@ -58,10 +58,6 @@
        (->> (lookup-entity e :block/_closed-value-property default-value)
        (->> (lookup-entity e :block/_closed-value-property default-value)
             (sort-by :block/order))
             (sort-by :block/order))
 
 
-       :object/name
-       (or (lookup-entity e :block/title nil)
-           (lookup-entity e :block/content nil))
-
        (or (get (.-kv e) k)
        (or (get (.-kv e) k)
            (lookup-entity e k default-value))))))
            (lookup-entity e k default-value))))))
 
 

+ 7 - 7
deps/db/src/logseq/db/frontend/malli_schema.cljs

@@ -331,7 +331,7 @@
 
 
 (def block-attrs
 (def block-attrs
   "Common attributes for normal blocks"
   "Common attributes for normal blocks"
-  [[:block/content :string]
+  [[:block/title :string]
    [:block/parent :int]
    [:block/parent :int]
    [:block/order block-order]
    [:block/order block-order]
    ;; refs
    ;; refs
@@ -346,7 +346,7 @@
   (vec
   (vec
    (concat
    (concat
     [:map]
     [:map]
-    [[:block/content :string]
+    [[:block/title :string]
      [:block/parent :int]
      [:block/parent :int]
      ;; These blocks only associate with pages of type "whiteboard"
      ;; These blocks only associate with pages of type "whiteboard"
      [:block/page :int]
      [:block/page :int]
@@ -359,7 +359,7 @@
    (concat
    (concat
     [:map]
     [:map]
     [[:property.value/content [:or :string :double :boolean]]]
     [[:property.value/content [:or :string :double :boolean]]]
-    (remove #(#{:block/content} (first %)) block-attrs)
+    (remove #(#{:block/title} (first %)) block-attrs)
     page-or-block-attrs)))
     page-or-block-attrs)))
 
 
 (def closed-value-block*
 (def closed-value-block*
@@ -369,22 +369,22 @@
     [[:block/type [:= #{"closed value"}]]
     [[:block/type [:= #{"closed value"}]]
      ;; for built-in properties
      ;; for built-in properties
      [:db/ident {:optional true} logseq-property-ident]
      [:db/ident {:optional true} logseq-property-ident]
-     [:block/content {:optional true} :string]
+     [:block/title {:optional true} :string]
      [:property.value/content {:optional true} [:or :string :double]]
      [:property.value/content {:optional true} [:or :string :double]]
      [:block/closed-value-property {:optional true} [:set :int]]
      [:block/closed-value-property {:optional true} [:set :int]]
      [:block/schema {:optional true}
      [:block/schema {:optional true}
       [:map
       [:map
        [:description {:optional true} :string]]]]
        [:description {:optional true} :string]]]]
-    (remove #(#{:block/content} (first %)) block-attrs)
+    (remove #(#{:block/title} (first %)) block-attrs)
     page-or-block-attrs)))
     page-or-block-attrs)))
 
 
 (def closed-value-block
 (def closed-value-block
   "A closed value for a property with closed/allowed values"
   "A closed value for a property with closed/allowed values"
   [:and closed-value-block*
   [:and closed-value-block*
-   [:fn {:error/message ":block/content or :property.value/content required"
+   [:fn {:error/message ":block/title or :property.value/content required"
          :error/path [:property.value/content]}
          :error/path [:property.value/content]}
     (fn [m]
     (fn [m]
-      (or (:block/content m) (:property.value/content m)))]])
+      (or (:block/title m) (:property.value/content m)))]])
 
 
 (def normal-block
 (def normal-block
   "A block with content and no special type or tag behavior"
   "A block with content and no special type or tag behavior"

+ 2 - 2
deps/db/src/logseq/db/frontend/property.cljs

@@ -249,14 +249,14 @@
 (defn closed-value-content
 (defn closed-value-content
   "Gets content/value of a given closed value ent/map. Works for all closed value types"
   "Gets content/value of a given closed value ent/map. Works for all closed value types"
   [ent]
   [ent]
-  (or (:block/content ent)
+  (or (:block/title ent)
       (:property.value/content ent)))
       (:property.value/content ent)))
 
 
 (defn property-value-content
 (defn property-value-content
   "Given an entity, gets the content for the property value of a ref type
   "Given an entity, gets the content for the property value of a ref type
   property i.e. what the user sees. For page types the content is the page name"
   property i.e. what the user sees. For page types the content is the page name"
   [ent]
   [ent]
-  (or (:block/content ent)
+  (or (:block/title ent)
       (if-some [content (:property.value/content ent)]
       (if-some [content (:property.value/content ent)]
         content
         content
         (:block/title ent))))
         (:block/title ent))))

+ 2 - 2
deps/db/src/logseq/db/frontend/property/build.cljs

@@ -17,7 +17,7 @@
             :block/parent property-id}
             :block/parent property-id}
            (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
            (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
              {:property.value/content value}
              {:property.value/content value}
-             {:block/content value}))))
+             {:block/title value}))))
 
 
 (defn build-closed-value-block
 (defn build-closed-value-block
   "Builds a closed value block to be transacted"
   "Builds a closed value block to be transacted"
@@ -73,7 +73,7 @@
         :block/order (db-order/gen-key)}
         :block/order (db-order/gen-key)}
        (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
        (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
          {:property.value/content value}
          {:property.value/content value}
-         {:block/content value}))
+         {:block/title value}))
       sqlite-util/block-with-timestamps))
       sqlite-util/block-with-timestamps))
 
 
 (defn build-property-values-tx-m
 (defn build-property-values-tx-m

+ 3 - 3
deps/db/src/logseq/db/frontend/property/type.cljs

@@ -37,13 +37,13 @@
 
 
 (def value-ref-property-types
 (def value-ref-property-types
   "Property value ref types where the refed entities either store their value in
   "Property value ref types where the refed entities either store their value in
-  :property.value/content or :block/content (for :default)"
+  :property.value/content or :block/title (for :default)"
   (into #{:default}
   (into #{:default}
         original-value-ref-property-types))
         original-value-ref-property-types))
 
 
 (def ref-property-types
 (def ref-property-types
   "User facing ref types. Property values that users see are stored in either
   "User facing ref types. Property values that users see are stored in either
-  :property.value/content, :block/content or :block/title.
+  :property.value/content, :block/title.
   :block/title is for all the page related types"
   :block/title is for all the page related types"
   (into #{:page :date :object} value-ref-property-types))
   (into #{:page :date :object} value-ref-property-types))
 
 
@@ -115,7 +115,7 @@
   (if new-closed-value?
   (if new-closed-value?
     (string? s)
     (string? s)
     (when-let [ent (d/entity db s)]
     (when-let [ent (d/entity db s)]
-      (string? (:block/content ent)))))
+      (string? (:block/title ent)))))
 
 
 (defn- page?
 (defn- page?
   [db val]
   [db val]

+ 3 - 3
deps/db/src/logseq/db/frontend/rules.cljc

@@ -120,7 +120,7 @@
 
 
    :block-content
    :block-content
    '[(block-content ?b ?query)
    '[(block-content ?b ?query)
-     [?b :block/content ?content]
+     [?b :block/title ?content]
      [(clojure.string/includes? ?content ?query)]]
      [(clojure.string/includes? ?content ?query)]]
 
 
    :page
    :page
@@ -171,7 +171,7 @@
     '[(page-property ?p ?prop ?val)
     '[(page-property ?p ?prop ?val)
       [?p :block/name]
       [?p :block/name]
       [?p ?prop ?pv]
       [?p ?prop ?pv]
-      (or [?pv :block/content ?val]
+      (or [?pv :block/title ?val]
           [?pv :property.value/content ?val]
           [?pv :property.value/content ?val]
           [?pv :block/title ?val])
           [?pv :block/title ?val])
       [?prop-e :db/ident ?prop]
       [?prop-e :db/ident ?prop]
@@ -187,7 +187,7 @@
     :property
     :property
     '[(property ?b ?prop ?val)
     '[(property ?b ?prop ?val)
       [?b ?prop ?pv]
       [?b ?prop ?pv]
-      (or [?pv :block/content ?val]
+      (or [?pv :block/title ?val]
           [?pv :property.value/content ?val]
           [?pv :property.value/content ?val]
           [?pv :block/title ?val])
           [?pv :block/title ?val])
       [(missing? $ ?b :block/name)]
       [(missing? $ ?b :block/name)]

+ 0 - 2
deps/db/src/logseq/db/frontend/schema.cljs

@@ -52,8 +52,6 @@
    :block/alias {:db/valueType :db.type/ref
    :block/alias {:db/valueType :db.type/ref
                  :db/cardinality :db.cardinality/many}
                  :db/cardinality :db.cardinality/many}
 
 
-   :block/content {}
-
    ;; todo keywords, e.g. "TODO", "DOING", "DONE"
    ;; todo keywords, e.g. "TODO", "DOING", "DONE"
    :block/marker {}
    :block/marker {}
 
 

+ 6 - 6
deps/db/src/logseq/db/sqlite/build.cljs

@@ -99,7 +99,7 @@
        (db-property-build/build-property-values-tx-m new-block)))
        (db-property-build/build-property-values-tx-m new-block)))
 
 
 (defn- extract-content-refs
 (defn- extract-content-refs
-  "Extracts basic refs from :block/content like `[[foo]]`. Adding more ref support would
+  "Extracts basic refs from :block/title like `[[foo]]`. Adding more ref support would
   require parsing each block with mldoc and extracting with text/extract-refs-from-mldoc-ast"
   require parsing each block with mldoc and extracting with text/extract-refs-from-mldoc-ast"
   [s]
   [s]
   ;; FIXME: Better way to ignore refs inside a macro
   ;; FIXME: Better way to ignore refs inside a macro
@@ -114,7 +114,7 @@
                    :block/order (db-order/gen-key nil)
                    :block/order (db-order/gen-key nil)
                    :block/parent (or (:block/parent m) {:db/id page-id})}
                    :block/parent (or (:block/parent m) {:db/id page-id})}
         pvalue-tx-m (->property-value-tx-m new-block properties properties-config all-idents)
         pvalue-tx-m (->property-value-tx-m new-block properties properties-config all-idents)
-        ref-names (extract-content-refs (:block/content m))]
+        ref-names (extract-content-refs (:block/title m))]
     (cond-> []
     (cond-> []
       ;; Place property values first since they are referenced by block
       ;; Place property values first since they are referenced by block
       (seq pvalue-tx-m)
       (seq pvalue-tx-m)
@@ -134,7 +134,7 @@
                                                            (throw (ex-info (str "No uuid for page ref name" (pr-str %)) {})))
                                                            (throw (ex-info (str "No uuid for page ref name" (pr-str %)) {})))
                                                        :block/title %)
                                                        :block/title %)
                                             ref-names)]
                                             ref-names)]
-                       {:block/content (db-content/page-ref->special-id-ref (:block/content m) block-refs)
+                       {:block/title (db-content/page-ref->special-id-ref (:block/title m) block-refs)
                         :block/refs block-refs})))))))
                         :block/refs block-refs})))))))
 
 
 (defn- build-properties-tx [properties page-uuids all-idents]
 (defn- build-properties-tx [properties page-uuids all-idents]
@@ -222,7 +222,7 @@
    {:closed true
    {:closed true
     ;; Define recursive :block schema
     ;; Define recursive :block schema
     :registry {::block [:map
     :registry {::block [:map
-                        [:block/content :string]
+                        [:block/title :string]
                         [:build/children {:optional true} [:vector [:ref ::block]]]
                         [:build/children {:optional true} [:vector [:ref ::block]]]
                         [:build/properties {:optional true} User-properties]
                         [:build/properties {:optional true} User-properties]
                         [:build/tags {:optional true} [:vector Class]]]}}
                         [:build/tags {:optional true} [:vector Class]]]}}
@@ -398,7 +398,7 @@
              (mapcat
              (mapcat
               (fn [{:keys [blocks]}]
               (fn [{:keys [blocks]}]
                 (->> blocks
                 (->> blocks
-                     (mapcat #(extract-content-refs (:block/content %)))
+                     (mapcat #(extract-content-refs (:block/title %)))
                      (remove existing-pages))))
                      (remove existing-pages))))
              distinct
              distinct
              (map #(hash-map :page {:block/title %})))]
              (map #(hash-map :page {:block/title %})))]
@@ -557,7 +557,7 @@
          is not required if using this since it generates one
          is not required if using this since it generates one
        * :build/properties - Defines properties on a page
        * :build/properties - Defines properties on a page
      * :blocks - This is a vec of datascript attribute maps for blocks with
      * :blocks - This is a vec of datascript attribute maps for blocks with
-       :block/content required. e.g. `{:block/content \"bar\"}`. Additional keys available:
+       :block/title required. e.g. `{:block/title \"bar\"}`. Additional keys available:
        * :build/children - A vec of blocks that are nested (indented) under the current block.
        * :build/children - A vec of blocks that are nested (indented) under the current block.
           Allows for outlines to be expressed to whatever depth
           Allows for outlines to be expressed to whatever depth
        * :build/properties - Defines properties on a block
        * :build/properties - Defines properties on a block

+ 28 - 28
deps/db/test/logseq/db/frontend/inputs_test.cljs

@@ -20,12 +20,12 @@
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
            [{:page {:block/title "page1"}
            [{:page {:block/title "page1"}
-             :blocks [{:block/content "parent"
+             :blocks [{:block/title "parent"
                        :build/children
                        :build/children
-                       [{:block/content "child 1"}
-                        {:block/content "child 2"}]}]}])]
+                       [{:block/title "child 1"}
+                        {:block/title "child 2"}]}]}])]
     (is (= ["child 2" "child 1" "parent"]
     (is (= ["child 2" "child 1" "parent"]
-           (map :block/content
+           (map :block/title
                 (custom-query @conn
                 (custom-query @conn
                               {:inputs [:current-page]
                               {:inputs [:current-page]
                                :query '[:find (pull ?b [*])
                                :query '[:find (pull ?b [*])
@@ -36,7 +36,7 @@
         ":current-page input resolves to current page name")
         ":current-page input resolves to current page name")
 
 
     (is (= []
     (is (= []
-           (map :block/content
+           (map :block/title
                 (custom-query @conn
                 (custom-query @conn
                               {:inputs [:current-page]
                               {:inputs [:current-page]
                                :query '[:find (pull ?b [*])
                                :query '[:find (pull ?b [*])
@@ -47,10 +47,10 @@
 
 
     (is (= ["child 1" "child 2"]
     (is (= ["child 1" "child 2"]
            (let [block-uuid (-> (d/q '[:find (pull ?b [:block/uuid])
            (let [block-uuid (-> (d/q '[:find (pull ?b [:block/uuid])
-                                       :where [?b :block/content "parent"]] @conn)
+                                       :where [?b :block/title "parent"]] @conn)
                                 ffirst
                                 ffirst
                                 :block/uuid)]
                                 :block/uuid)]
-             (map :block/content
+             (map :block/title
                   (custom-query @conn
                   (custom-query @conn
                                 {:inputs [:current-block]
                                 {:inputs [:current-block]
                                  :query '[:find (pull ?b [*])
                                  :query '[:find (pull ?b [*])
@@ -83,10 +83,10 @@
 
 
     (is (= ["parent"]
     (is (= ["parent"]
            (let [block-uuid (-> (d/q '[:find (pull ?b [:block/uuid])
            (let [block-uuid (-> (d/q '[:find (pull ?b [:block/uuid])
-                                       :where [?b :block/content "child 1"]] @conn)
+                                       :where [?b :block/title "child 1"]] @conn)
                                 ffirst
                                 ffirst
                                 :block/uuid)]
                                 :block/uuid)]
-             (map :block/content
+             (map :block/title
                   (custom-query @conn
                   (custom-query @conn
                                 {:inputs [:parent-block]
                                 {:inputs [:parent-block]
                                  :query '[:find (pull ?parent-block [*])
                                  :query '[:find (pull ?parent-block [*])
@@ -100,12 +100,12 @@
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
            [{:page {:build/journal 20230101}
            [{:page {:build/journal 20230101}
-             :blocks [{:block/content "b1"}]}
+             :blocks [{:block/title "b1"}]}
             {:page {:build/journal 20230107}
             {:page {:build/journal 20230107}
-             :blocks [{:block/content "b2"}]}])]
+             :blocks [{:block/title "b2"}]}])]
     (is (= ["b2"]
     (is (= ["b2"]
            (with-redefs [t/today (constantly (t/date-time 2023 1 7))]
            (with-redefs [t/today (constantly (t/date-time 2023 1 7))]
-             (map :block/content
+             (map :block/title
                   (custom-query @conn
                   (custom-query @conn
                                 {:inputs [:3d-before :today]
                                 {:inputs [:3d-before :today]
                                  :query '[:find (pull ?b [*])
                                  :query '[:find (pull ?b [*])
@@ -115,7 +115,7 @@
 
 
     (is (= ["b1"]
     (is (= ["b1"]
            (with-redefs [t/today (constantly (t/date-time 2022 12 31))]
            (with-redefs [t/today (constantly (t/date-time 2022 12 31))]
-             (map :block/content
+             (map :block/title
                   (custom-query @conn
                   (custom-query @conn
                                 {:inputs [:tomorrow :4d-after]
                                 {:inputs [:tomorrow :4d-after]
                                  :query '[:find (pull ?b [*])
                                  :query '[:find (pull ?b [*])
@@ -126,12 +126,12 @@
 (defn- block-with-content [db block-content]
 (defn- block-with-content [db block-content]
   (-> (d/q '[:find (pull ?b [:block/uuid])
   (-> (d/q '[:find (pull ?b [:block/uuid])
              :in $ ?content
              :in $ ?content
-             :where [?b :block/content ?content]]
+             :where [?b :block/title ?content]]
            db block-content)
            db block-content)
       ffirst))
       ffirst))
 
 
 (defn- blocks-on-journal-page-from-block-with-content [db page-input block-content current-page-date]
 (defn- blocks-on-journal-page-from-block-with-content [db page-input block-content current-page-date]
-  (map :block/content
+  (map :block/title
        (custom-query db
        (custom-query db
                      {:inputs [page-input]
                      {:inputs [page-input]
                       :query '[:find (pull ?b [*])
                       :query '[:find (pull ?b [*])
@@ -149,9 +149,9 @@
         conn (d/create-conn db-schema/schema-for-db-based-graph)
         conn (d/create-conn db-schema/schema-for-db-based-graph)
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
-           [{:page {:build/journal 20221231} :blocks [{:block/content "-1d"}]}
-            {:page {:build/journal 20230101} :blocks [{:block/content "now"}]}
-            {:page {:build/journal 20230102} :blocks [{:block/content "+1d"}]}])
+           [{:page {:build/journal 20221231} :blocks [{:block/title "-1d"}]}
+            {:page {:build/journal 20230101} :blocks [{:block/title "now"}]}
+            {:page {:build/journal 20230102} :blocks [{:block/title "+1d"}]}])
         db @conn]
         db @conn]
     (is (= ["now"] (blocks-on-journal-page-from-block-with-content db :current-page "now" current-date))
     (is (= ["now"] (blocks-on-journal-page-from-block-with-content db :current-page "now" current-date))
         ":current-page resolves to the stateful page when called from a block on the stateful page")
         ":current-page resolves to the stateful page when called from a block on the stateful page")
@@ -168,7 +168,7 @@
 (defn- blocks-journaled-between-inputs [db a b]
 (defn- blocks-journaled-between-inputs [db a b]
   ;; reverse is for sort order and may be brittle
   ;; reverse is for sort order and may be brittle
   (reverse
   (reverse
-   (map :block/content
+   (map :block/title
         (custom-query db
         (custom-query db
                       {:inputs [a b]
                       {:inputs [a b]
                        :query '[:find (pull ?b [*])
                        :query '[:find (pull ?b [*])
@@ -179,15 +179,15 @@
   (let [conn (d/create-conn db-schema/schema-for-db-based-graph)
   (let [conn (d/create-conn db-schema/schema-for-db-based-graph)
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
-           [{:page {:build/journal 20220101} :blocks [{:block/content "-1y"}]}
-            {:page {:build/journal 20221201} :blocks [{:block/content "-1m"}]}
-            {:page {:build/journal 20221225} :blocks [{:block/content "-1w"}]}
-            {:page {:build/journal 20221231} :blocks [{:block/content "-1d"}]}
-            {:page {:build/journal 20230101} :blocks [{:block/content "now"}]}
-            {:page {:build/journal 20230102} :blocks [{:block/content "+1d"}]}
-            {:page {:build/journal 20230108} :blocks [{:block/content "+1w"}]}
-            {:page {:build/journal 20230201} :blocks [{:block/content "+1m"}]}
-            {:page {:build/journal 20240101} :blocks [{:block/content "+1y"}]}])
+           [{:page {:build/journal 20220101} :blocks [{:block/title "-1y"}]}
+            {:page {:build/journal 20221201} :blocks [{:block/title "-1m"}]}
+            {:page {:build/journal 20221225} :blocks [{:block/title "-1w"}]}
+            {:page {:build/journal 20221231} :blocks [{:block/title "-1d"}]}
+            {:page {:build/journal 20230101} :blocks [{:block/title "now"}]}
+            {:page {:build/journal 20230102} :blocks [{:block/title "+1d"}]}
+            {:page {:build/journal 20230108} :blocks [{:block/title "+1w"}]}
+            {:page {:build/journal 20230201} :blocks [{:block/title "+1m"}]}
+            {:page {:build/journal 20240101} :blocks [{:block/title "+1y"}]}])
         db @conn]
         db @conn]
     (with-redefs [t/today (constantly (t/date-time 2023 1 1))]
     (with-redefs [t/today (constantly (t/date-time 2023 1 1))]
       (is (= ["now" "-1d" "-1w" "-1m" "-1y"] (blocks-journaled-between-inputs db :-365d :today))
       (is (= ["now" "-1d" "-1w" "-1m" "-1y"] (blocks-journaled-between-inputs db :-365d :today))

+ 8 - 8
deps/db/test/logseq/db/sqlite/build_test.cljs

@@ -12,11 +12,11 @@
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
            [{:page {:block/title "page1"}
            [{:page {:block/title "page1"}
-             :blocks [{:block/content "Jrue Holiday" :build/tags [:Person]}]}
+             :blocks [{:block/title "Jrue Holiday" :build/tags [:Person]}]}
             {:page {:block/title "Jayson Tatum" :build/tags [:Person]}}])]
             {:page {:block/title "Jayson Tatum" :build/tags [:Person]}}])]
     (is (= {:block/tags [{:block/title "Person", :block/type ["class" "page"]}]}
     (is (= {:block/tags [{:block/title "Person", :block/type ["class" "page"]}]}
            (first (d/q '[:find [(pull ?b [{:block/tags [:block/title :block/type]}]) ...]
            (first (d/q '[:find [(pull ?b [{:block/tags [:block/title :block/type]}]) ...]
-                         :where [?b :block/content "Jrue Holiday"]]
+                         :where [?b :block/title "Jrue Holiday"]]
                        @conn)))
                        @conn)))
         "Person class is created and correctly associated to a block")
         "Person class is created and correctly associated to a block")
 
 
@@ -32,12 +32,12 @@
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
            [{:page {:block/title "page1"}
            [{:page {:block/title "page1"}
-             :blocks [{:block/content "Jrue Holiday" :build/properties {:description "Clutch defense"}}]}
+             :blocks [{:block/title "Jrue Holiday" :build/properties {:description "Clutch defense"}}]}
             {:page {:block/title "Jayson Tatum" :build/properties {:description "Awesome selfless basketball"}}}])]
             {:page {:block/title "Jayson Tatum" :build/properties {:description "Awesome selfless basketball"}}}])]
     (is (= "Clutch defense"
     (is (= "Clutch defense"
            (->> @conn
            (->> @conn
                 (d/q '[:find [(pull ?b [*]) ...]
                 (d/q '[:find [(pull ?b [*]) ...]
-                       :where [?b :block/content "Jrue Holiday"]])
+                       :where [?b :block/title "Jrue Holiday"]])
                 first
                 first
                 :user.property/description
                 :user.property/description
                 (db-property/ref->property-value-contents @conn)))
                 (db-property/ref->property-value-contents @conn)))
@@ -58,14 +58,14 @@
         _ (sqlite-build/create-blocks
         _ (sqlite-build/create-blocks
            conn
            conn
            [{:page {:block/title "page1"}
            [{:page {:block/title "page1"}
-             :blocks [{:block/content "some todo"
+             :blocks [{:block/title "some todo"
                        :build/properties {:logseq.task/status :logseq.task/status.doing}}
                        :build/properties {:logseq.task/status :logseq.task/status.doing}}
-                      {:block/content "some slide"
+                      {:block/title "some slide"
                        :build/properties {:logseq.property/background-image "https://placekitten.com/200/300"}}]}])]
                        :build/properties {:logseq.property/background-image "https://placekitten.com/200/300"}}]}])]
     (is (= "Doing"
     (is (= "Doing"
            (->> @conn
            (->> @conn
                 (d/q '[:find [(pull ?b [*]) ...]
                 (d/q '[:find [(pull ?b [*]) ...]
-                       :where [?b :block/content "some todo"]])
+                       :where [?b :block/title "some todo"]])
                 first
                 first
                 :logseq.task/status
                 :logseq.task/status
                 (db-property/ref->property-value-contents @conn)))
                 (db-property/ref->property-value-contents @conn)))
@@ -74,7 +74,7 @@
     (is (= "https://placekitten.com/200/300"
     (is (= "https://placekitten.com/200/300"
            (->> @conn
            (->> @conn
                 (d/q '[:find [(pull ?b [*]) ...]
                 (d/q '[:find [(pull ?b [*]) ...]
-                       :where [?b :block/content "some slide"]])
+                       :where [?b :block/title "some slide"]])
                 first
                 first
                 :logseq.property/background-image
                 :logseq.property/background-image
                 (db-property/ref->property-value-contents @conn)))
                 (db-property/ref->property-value-contents @conn)))

+ 1 - 1
deps/db/test/logseq/db/sqlite/common_db_test.cljs

@@ -57,7 +57,7 @@
                    :block/created-at created-at
                    :block/created-at created-at
                    :block/updated-at created-at}
                    :block/updated-at created-at}
                   {:db/id 100002
                   {:db/id 100002
-                   :block/content "test"
+                   :block/title "test"
                    :block/uuid block-uuid
                    :block/uuid block-uuid
                    :block/page {:db/id 100001}
                    :block/page {:db/id 100001}
                    :block/created-at created-at
                    :block/created-at created-at

+ 2 - 2
deps/db/test/logseq/db/sqlite/create_graph_test.cljs

@@ -90,9 +90,9 @@
        {:properties {:url {:block/schema {:type :url}}}
        {:properties {:url {:block/schema {:type :url}}}
         :pages-and-blocks
         :pages-and-blocks
         [{:page {:block/title "page1"}
         [{:page {:block/title "page1"}
-          :blocks [{:block/content "b1" :build/properties {:url "https://logseq.com"}}
+          :blocks [{:block/title "b1" :build/properties {:url "https://logseq.com"}}
                    ;; :url macros are used for consistently building urls with the same hostname e.g. docs graph
                    ;; :url macros are used for consistently building urls with the same hostname e.g. docs graph
-                   {:block/content "b2" :build/properties {:url "{{docs-base-url test}}"}}]}]})
+                   {:block/title "b2" :build/properties {:url "{{docs-base-url test}}"}}]}]})
 
 
       (is (empty? (map :entity (:errors (db-validate/validate-db! @conn))))
       (is (empty? (map :entity (:errors (db-validate/validate-db! @conn))))
           "Graph with different :url blocks has no validation errors"))))
           "Graph with different :url blocks has no validation errors"))))

+ 5 - 5
deps/graph-parser/src/logseq/graph_parser/block.cljs

@@ -523,7 +523,7 @@
                                             (map :block/title))
                                             (map :block/title))
                          pre-block? (if (:heading properties) false true)
                          pre-block? (if (:heading properties) false true)
                          block {:block/uuid id
                          block {:block/uuid id
-                                :block/content content
+                                :block/title content
                                 :block/level 1
                                 :block/level 1
                                 :block/properties properties
                                 :block/properties properties
                                 :block/properties-order (vec properties-order)
                                 :block/properties-order (vec properties-order)
@@ -531,7 +531,7 @@
                                 :block/invalid-properties invalid-properties
                                 :block/invalid-properties invalid-properties
                                 :block/pre-block? pre-block?
                                 :block/pre-block? pre-block?
                                 :block/macros (extract-macros-from-ast body)
                                 :block/macros (extract-macros-from-ast body)
-                                :block/body body}
+                                :block.temp/ast-body body}
                          {:keys [tags refs]}
                          {:keys [tags refs]}
                          (with-page-block-refs {:body body :refs property-refs} db date-formatter)]
                          (with-page-block-refs {:body body :refs property-refs} db date-formatter)]
                      (cond-> block
                      (cond-> block
@@ -583,7 +583,7 @@
                     (update :properties-order (fn [keys] (vec (remove #{:collapsed} keys)))))
                     (update :properties-order (fn [keys] (vec (remove #{:collapsed} keys)))))
                 block)
                 block)
         block (assoc block
         block (assoc block
-                     :content (get-block-content encoded-content block format pos-meta block-pattern))
+                     :block/title (get-block-content encoded-content block format pos-meta block-pattern))
         block (if (seq timestamps)
         block (if (seq timestamps)
                 (merge block (timestamps->scheduled-and-deadline timestamps))
                 (merge block (timestamps->scheduled-and-deadline timestamps))
                 block)
                 block)
@@ -604,13 +604,13 @@
 
 
 (defn fix-duplicate-id
 (defn fix-duplicate-id
   [block]
   [block]
-  (println "Logseq will assign a new id for block with content:" (pr-str (:block/content block)))
+  (println "Logseq will assign a new id for block with content:" (pr-str (:block/title block)))
   (-> block
   (-> block
       (assoc :block/uuid (d/squuid))
       (assoc :block/uuid (d/squuid))
       (update :block/properties dissoc :id)
       (update :block/properties dissoc :id)
       (update :block/properties-text-values dissoc :id)
       (update :block/properties-text-values dissoc :id)
       (update :block/properties-order #(vec (remove #{:id} %)))
       (update :block/properties-order #(vec (remove #{:id} %)))
-      (update :block/content (fn [c]
+      (update :block/title (fn [c]
                          (let [replace-str (re-pattern
                          (let [replace-str (re-pattern
                                             (str
                                             (str
                                              "\n*\\s*"
                                              "\n*\\s*"

+ 14 - 14
deps/graph-parser/src/logseq/graph_parser/exporter.cljs

@@ -111,12 +111,12 @@
   (if (seq (:block/tags block))
   (if (seq (:block/tags block))
     (let [original-tags (remove :block.temp/new-class (:block/tags block))]
     (let [original-tags (remove :block.temp/new-class (:block/tags block))]
       (-> block
       (-> block
-          (update :block/content
+          (update :block/title
                   content-without-tags-ignore-case
                   content-without-tags-ignore-case
                   (->> original-tags
                   (->> original-tags
                        (filter #(tag-classes (:block/name %)))
                        (filter #(tag-classes (:block/name %)))
                        (map :block/title)))
                        (map :block/title)))
-          (update :block/content
+          (update :block/title
                   db-content/replace-tags-with-page-refs
                   db-content/replace-tags-with-page-refs
                   (->> original-tags
                   (->> original-tags
                        (remove #(tag-classes (:block/name %)))
                        (remove #(tag-classes (:block/name %)))
@@ -146,7 +146,7 @@
                              :logseq.task/status.todo))]
                              :logseq.task/status.todo))]
       (-> block
       (-> block
           (assoc :logseq.task/status status-ident)
           (assoc :logseq.task/status status-ident)
-          (update :block/content string/replace-first (re-pattern (str marker "\\s*")) "")
+          (update :block/title string/replace-first (re-pattern (str marker "\\s*")) "")
           (update :block/tags (fnil conj []) :logseq.class/task)
           (update :block/tags (fnil conj []) :logseq.class/task)
           (update :block/refs (fn [refs]
           (update :block/refs (fn [refs]
                                 (into (remove #(= marker (:block/title %)) refs)
                                 (into (remove #(= marker (:block/title %)) refs)
@@ -169,7 +169,7 @@
                                :logseq.task/priority.low))]
                                :logseq.task/priority.low))]
       (-> block
       (-> block
           (assoc :logseq.task/priority priority-value)
           (assoc :logseq.task/priority priority-value)
-          (update :block/content string/replace-first (re-pattern (str "\\[#" priority "\\]" "\\s*")) "")
+          (update :block/title string/replace-first (re-pattern (str "\\[#" priority "\\]" "\\s*")) "")
           (update :block/refs (fn [refs]
           (update :block/refs (fn [refs]
                                 (into (remove #(= priority (:block/title %)) refs)
                                 (into (remove #(= priority (:block/title %)) refs)
                                       [:logseq.task/priority priority-value])))
                                       [:logseq.task/priority priority-value])))
@@ -180,7 +180,7 @@
     block))
     block))
 
 
 (defn- update-block-deadline
 (defn- update-block-deadline
-  ":block/content doesn't contain DEADLINE.* text so unable to detect timestamp
+  ":block/title doesn't contain DEADLINE.* text so unable to detect timestamp
   or repeater usage and notify user that they aren't supported"
   or repeater usage and notify user that they aren't supported"
   [block db {:keys [user-config]}]
   [block db {:keys [user-config]}]
   (if-let [date-int (or (:block/deadline block) (:block/scheduled block))]
   (if-let [date-int (or (:block/deadline block) (:block/scheduled block))]
@@ -288,13 +288,13 @@
   (->> built-in-property-name-to-idents keys set))
   (->> built-in-property-name-to-idents keys set))
 
 
 (defn- update-built-in-property-values
 (defn- update-built-in-property-values
-  [props {:keys [ignored-properties all-idents]} {:block/keys [content name]}]
+  [props {:keys [ignored-properties all-idents]} {:block/keys [title name]}]
   (->> props
   (->> props
        (keep (fn [[prop val]]
        (keep (fn [[prop val]]
                (if (= :icon prop)
                (if (= :icon prop)
                  (do (swap! ignored-properties
                  (do (swap! ignored-properties
                             conj
                             conj
-                            {:property prop :value val :location (if name {:page name} {:block content})})
+                            {:property prop :value val :location (if name {:page name} {:block title})})
                      nil)
                      nil)
                  [(built-in-property-name-to-idents prop)
                  [(built-in-property-name-to-idents prop)
                   (case prop
                   (case prop
@@ -435,7 +435,7 @@
       (let [props' (-> (update-built-in-property-values
       (let [props' (-> (update-built-in-property-values
                         (select-keys props built-in-property-names)
                         (select-keys props built-in-property-names)
                         (select-keys import-state [:ignored-properties :all-idents])
                         (select-keys import-state [:ignored-properties :all-idents])
-                        (select-keys block [:block/name :block/content]))
+                        (select-keys block [:block/name :block/title]))
                        (merge (update-user-property-values user-properties page-names-to-uuids properties-text-values import-state options)))
                        (merge (update-user-property-values user-properties page-names-to-uuids properties-text-values import-state options)))
             pvalue-tx-m (->property-value-tx-m block props' #(get @property-schemas %) @all-idents)
             pvalue-tx-m (->property-value-tx-m block props' #(get @property-schemas %) @all-idents)
             block-properties (-> (merge props' (db-property-build/build-properties-with-ref-values pvalue-tx-m))
             block-properties (-> (merge props' (db-property-build/build-properties-with-ref-values pvalue-tx-m))
@@ -508,7 +508,7 @@
               options' (assoc options :property-changes property-changes)
               options' (assoc options :property-changes property-changes)
               {:keys [block-properties pvalues-tx]}
               {:keys [block-properties pvalues-tx]}
               (build-properties-and-values properties' db page-names-to-uuids
               (build-properties-and-values properties' db page-names-to-uuids
-                                           (select-keys block [:block/properties-text-values :block/name :block/content :block/uuid])
+                                           (select-keys block [:block/properties-text-values :block/name :block/title :block/uuid])
                                            options')]
                                            options')]
           {:block
           {:block
            (cond-> block
            (cond-> block
@@ -585,8 +585,8 @@
                        [:block/uuid (:block/uuid ref)])
                        [:block/uuid (:block/uuid ref)])
                      ref))
                      ref))
                  refs)))
                  refs)))
-        (:block/content block)
-        (update :block/content
+        (:block/title block)
+        (update :block/title
                 db-content/page-ref->special-id-ref
                 db-content/page-ref->special-id-ref
                 ;; TODO: Handle refs for whiteboard block which has none
                 ;; TODO: Handle refs for whiteboard block which has none
                 (->> (:block/refs block)
                 (->> (:block/refs block)
@@ -714,9 +714,9 @@
                                                           {:property-ident property-ident
                                                           {:property-ident property-ident
                                                            :block-uuid (:block-uuid m)})))
                                                            :block-uuid (:block-uuid m)})))
                         prop-value-content (get-pvalue-content (:block/uuid m) prop)]
                         prop-value-content (get-pvalue-content (:block/uuid m) prop)]
-                    ;; Switch to :block/content since :default is stored differently
+                    ;; Switch to :block/title since :default is stored differently
                     [[:db/retract prop-value-id :property.value/content]
                     [[:db/retract prop-value-id :property.value/content]
-                     [:db/add prop-value-id :block/content prop-value-content]]))
+                     [:db/add prop-value-id :block/title prop-value-content]]))
                 existing-blocks)
                 existing-blocks)
         ;; Look up blocks about to be transacted for current file a.k.a. pending
         ;; Look up blocks about to be transacted for current file a.k.a. pending
         ;; Map of property value uuids to their original block uuids
         ;; Map of property value uuids to their original block uuids
@@ -735,7 +735,7 @@
                     (let [prop-value-content (get-pvalue-content original-block-uuid prop)
                     (let [prop-value-content (get-pvalue-content original-block-uuid prop)
                           prop-value-id [:block/uuid (:block/uuid m)]]
                           prop-value-id [:block/uuid (:block/uuid m)]]
                       [[:db/retract prop-value-id :property.value/content]
                       [[:db/retract prop-value-id :property.value/content]
-                       [:db/add prop-value-id :block/content prop-value-content]])))
+                       [:db/add prop-value-id :block/title prop-value-content]])))
                 blocks-tx)]
                 blocks-tx)]
     (concat existing-blocks-tx pending-blocks-tx)))
     (concat existing-blocks-tx pending-blocks-tx)))
 
 

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/extract.cljc

@@ -261,7 +261,7 @@
                          (assoc page :block/uuid page-id)))
                          (assoc page :block/uuid page-id)))
                      pages)
                      pages)
           blocks (->> (remove nil? blocks)
           blocks (->> (remove nil? blocks)
-                      (map (fn [b] (dissoc b :block/body :block/level :block/children :block/meta))))]
+                      (map (fn [b] (dissoc b :block/title :block.temp/ast-body :block/level :block/children :block/meta))))]
       [pages blocks])
       [pages blocks])
     (catch :default e
     (catch :default e
       (log/error :exception e))))
       (log/error :exception e))))

+ 1 - 1
deps/graph-parser/src/logseq/graph_parser/test/docs_graph_helper.cljs

@@ -165,7 +165,7 @@
     (is (= 23
     (is (= 23
            (ffirst
            (ffirst
             (d/q '[:find (count ?b)
             (d/q '[:find (count ?b)
-                   :where [?b :block/content ?content]
+                   :where [?b :block/title ?content]
                    [(clojure.string/includes? ?content "+BEGIN_QUERY")]]
                    [(clojure.string/includes? ?content "+BEGIN_QUERY")]]
                  db)))
                  db)))
         "Advanced query count"))
         "Advanced query count"))

+ 2 - 2
deps/graph-parser/src/logseq/graph_parser/whiteboard.cljs

@@ -58,7 +58,7 @@
 (defn- with-whiteboard-content
 (defn- with-whiteboard-content
   "Main purpose of this function is to populate contents when shapes are used as references in outliner."
   "Main purpose of this function is to populate contents when shapes are used as references in outliner."
   [shape]
   [shape]
-  {:block/content (case (:type shape)
+  {:block/title (case (:type shape)
                     "text" (:text shape)
                     "text" (:text shape)
                     "logseq-portal" ""
                     "logseq-portal" ""
                     "line" (str "whiteboard arrow" (when-let [label (:label shape)] (str ": " label)))
                     "line" (str "whiteboard arrow" (when-let [label (:label shape)] (str ": " label)))
@@ -84,7 +84,7 @@
         properties {(db-property-util/get-pid repo :logseq.property/ls-type) :whiteboard-shape
         properties {(db-property-util/get-pid repo :logseq.property/ls-type) :whiteboard-shape
                     (db-property-util/get-pid repo :logseq.property.tldraw/shape) shape}
                     (db-property-util/get-pid repo :logseq.property.tldraw/shape) shape}
         block {:block/uuid block-uuid
         block {:block/uuid block-uuid
-               :block/content ""
+               :block/title ""
                :block/page page-id
                :block/page page-id
                :block/parent page-id}
                :block/parent page-id}
         block' (if (sqlite-util/db-based-graph? repo)
         block' (if (sqlite-util/db-based-graph? repo)

+ 2 - 2
deps/graph-parser/test/logseq/graph_parser/block_test.cljs

@@ -23,7 +23,7 @@
         (and (:block/uuid result)
         (and (:block/uuid result)
              (not= (:uuid x) (:block/uuid result))
              (not= (:uuid x) (:block/uuid result))
              (= (select-keys result
              (= (select-keys result
-                             [:block/properties :block/content :block/properties-text-values :block/properties-order]) (gp-block/block-keywordize y))))
+                             [:block/properties :block/title :block/properties-text-values :block/properties-order]) (gp-block/block-keywordize y))))
     {:properties {:id "63f199bc-c737-459f-983d-84acfcda14fe"}, :tags [], :format :markdown, :meta {:start_pos 51, :end_pos 101}, :macros [], :content "bar\nid:: 63f199bc-c737-459f-983d-84acfcda14fe", :properties-text-values {:id "63f199bc-c737-459f-983d-84acfcda14fe"}, :level 1, :uuid #uuid "63f199bc-c737-459f-983d-84acfcda14fe", :properties-order [:id]}
     {:properties {:id "63f199bc-c737-459f-983d-84acfcda14fe"}, :tags [], :format :markdown, :meta {:start_pos 51, :end_pos 101}, :macros [], :content "bar\nid:: 63f199bc-c737-459f-983d-84acfcda14fe", :properties-text-values {:id "63f199bc-c737-459f-983d-84acfcda14fe"}, :level 1, :uuid #uuid "63f199bc-c737-459f-983d-84acfcda14fe", :properties-order [:id]}
     {:properties {},
     {:properties {},
      :content "bar",
      :content "bar",
@@ -114,7 +114,7 @@
   [db content]
   [db content]
   (->> (d/q '[:find (pull ?b [* {:block/refs [:block/uuid]}])
   (->> (d/q '[:find (pull ?b [* {:block/refs [:block/uuid]}])
               :in $ ?content
               :in $ ?content
-              :where [?b :block/content ?content]]
+              :where [?b :block/title ?content]]
             db
             db
             content)
             content)
        (map first)
        (map first)

+ 6 - 6
deps/graph-parser/test/logseq/graph_parser/cli_test.cljs

@@ -92,7 +92,7 @@
                         ;; Hardcode journal name until more are added
                         ;; Hardcode journal name until more are added
                         (path/join graph-dir "journals" "2023_07_20.md")
                         (path/join graph-dir "journals" "2023_07_20.md")
                         (path/join graph-dir "pages" (str (:block/name page) ".md")))
                         (path/join graph-dir "pages" (str (:block/name page) ".md")))
-                      (string/join "\n" (map #(str "- " (:block/content %)) blocks))))
+                      (string/join "\n" (map #(str "- " (:block/title %)) blocks))))
   (let [{:keys [conn]} (gp-cli/parse-graph graph-dir {:verbose false})] @conn))
   (let [{:keys [conn]} (gp-cli/parse-graph graph-dir {:verbose false})] @conn))
 
 
 (defn- create-frontend-blocks
 (defn- create-frontend-blocks
@@ -151,28 +151,28 @@
         ;; pages and their blocks which are being tested
         ;; pages and their blocks which are being tested
         pages-to-blocks
         pages-to-blocks
         {{:block/name "page1" :block/type ["page"]}
         {{:block/name "page1" :block/type ["page"]}
-         [{:block/content "block 1"} {:block/content "block 2"}]
+         [{:block/title "block 1"} {:block/title "block 2"}]
          {:block/name "jul 20th, 2023" :block/type #{"journal"} :block/journal-day 20230720}
          {:block/name "jul 20th, 2023" :block/type #{"journal"} :block/journal-day 20230720}
-         [{:block/content "b1"} {:block/content "b2"}]}
+         [{:block/title "b1"} {:block/title "b2"}]}
         file-db (create-file-db graph-dir pages-to-blocks)
         file-db (create-file-db graph-dir pages-to-blocks)
         graph-db (create-graph-db "tmp" "file-and-db-graph" pages-to-blocks)
         graph-db (create-graph-db "tmp" "file-and-db-graph" pages-to-blocks)
         ;; Only test meaningful differences like content, name and set of block attributes.
         ;; Only test meaningful differences like content, name and set of block attributes.
         ;; Most attribute values won't be the same as they are random e.g. timestamps and db ids.
         ;; Most attribute values won't be the same as they are random e.g. timestamps and db ids.
         file-ents (->> (d/datoms file-db :eavt)
         file-ents (->> (d/datoms file-db :eavt)
                        datoms->entity-maps
                        datoms->entity-maps
-                       (map #(assoc (or (not-empty (select-keys % [:block/content :block/name]))
+                       (map #(assoc (or (not-empty (select-keys % [:block/title :block/name]))
                                         %)
                                         %)
                                     :attributes (disj (set (keys %)) :block/file :block/format)))
                                     :attributes (disj (set (keys %)) :block/file :block/format)))
                        set)
                        set)
         db-ents (->> (d/datoms graph-db :eavt)
         db-ents (->> (d/datoms graph-db :eavt)
                      datoms->entity-maps
                      datoms->entity-maps
-                     (map #(assoc (or (not-empty (select-keys % [:block/content :block/name]))
+                     (map #(assoc (or (not-empty (select-keys % [:block/title :block/name]))
                                       %)
                                       %)
                                   :attributes (cond-> (disj (set (keys %))
                                   :attributes (cond-> (disj (set (keys %))
                                                             ;; Don't compare :block/format as db graphs
                                                             ;; Don't compare :block/format as db graphs
                                                             ;; are purposely different
                                                             ;; are purposely different
                                                             :block/format)
                                                             :block/format)
-                                                (seq (:block/content %))
+                                                (seq (:block/title %))
                                                 (set/difference #{:block/created-at :block/updated-at}))))
                                                 (set/difference #{:block/created-at :block/updated-at}))))
                      set)]
                      set)]
     (println "Datom counts for file and db graphs are" (count (d/datoms file-db :eavt)) "and" (count (d/datoms graph-db :eavt)))
     (println "Datom counts for file and db graphs are" (count (d/datoms file-db :eavt)) "and" (count (d/datoms graph-db :eavt)))

+ 5 - 5
deps/graph-parser/test/logseq/graph_parser/exporter_test.cljs

@@ -26,13 +26,13 @@
     (->> content
     (->> content
          (d/q '[:find [(pull ?b [*]) ...]
          (d/q '[:find [(pull ?b [*]) ...]
                 :in $ ?pattern
                 :in $ ?pattern
-                :where [?b :block/content ?content] [(re-find ?pattern ?content)]]
+                :where [?b :block/title ?content] [(re-find ?pattern ?content)]]
               db)
               db)
          first)
          first)
     (->> content
     (->> content
          (d/q '[:find [(pull ?b [*]) ...]
          (d/q '[:find [(pull ?b [*]) ...]
                 :in $ ?content
                 :in $ ?content
-                :where [?b :block/content ?content]]
+                :where [?b :block/title ?content]]
               db)
               db)
          first)))
          first)))
 
 
@@ -289,7 +289,7 @@
       (let [block (find-block-by-content @conn #"Inception")
       (let [block (find-block-by-content @conn #"Inception")
             tag-page (find-page-by-name @conn "Movie")
             tag-page (find-page-by-name @conn "Movie")
             tagged-page (find-page-by-name @conn "Interstellar")]
             tagged-page (find-page-by-name @conn "Interstellar")]
-        (is (string/starts-with? (str (:block/content block)) "Inception [[")
+        (is (string/starts-with? (str (:block/title block)) "Inception [[")
             "tagged block tag converts tag to page ref")
             "tagged block tag converts tag to page ref")
         (is (= [(:db/id tag-page)] (map :db/id (:block/refs block)))
         (is (= [(:db/id tag-page)] (map :db/id (:block/refs block)))
             "tagged block has correct refs")
             "tagged block has correct refs")
@@ -309,7 +309,7 @@
     (let [block (find-block-by-content @conn #"Inception")
     (let [block (find-block-by-content @conn #"Inception")
           tag-page (find-page-by-name @conn "Movie")
           tag-page (find-page-by-name @conn "Movie")
           another-tag-page (find-page-by-name @conn "p0")]
           another-tag-page (find-page-by-name @conn "p0")]
-      (is (= (:block/content block) "Inception")
+      (is (= (:block/title block) "Inception")
           "tagged block with configured tag strips tag from content")
           "tagged block with configured tag strips tag from content")
       (is (= [:user.class/Movie]
       (is (= [:user.class/Movie]
              (:block/tags (readable-properties @conn block)))
              (:block/tags (readable-properties @conn block)))
@@ -332,7 +332,7 @@
           _ (import-files-to-db files conn {:property-classes ["type"]})]
           _ (import-files-to-db files conn {:property-classes ["type"]})]
     (let [block (find-block-by-content @conn #"The Creator")
     (let [block (find-block-by-content @conn #"The Creator")
           tag-page (find-page-by-name @conn "Movie")]
           tag-page (find-page-by-name @conn "Movie")]
-      (is (= (:block/content block) "The Creator")
+      (is (= (:block/title block) "The Creator")
           "tagged block with configured tag strips tag from content")
           "tagged block with configured tag strips tag from content")
       (is (= [:user.class/Movie]
       (is (= [:user.class/Movie]
              (:block/tags (readable-properties @conn block)))
              (:block/tags (readable-properties @conn block)))

+ 3 - 3
deps/graph-parser/test/logseq/graph_parser/extract_test.cljs

@@ -52,7 +52,7 @@
 (defn- extract-block-content
 (defn- extract-block-content
   [text]
   [text]
   (let [{:keys [blocks]} (extract "a.md" text)]
   (let [{:keys [blocks]} (extract "a.md" text)]
-    (mapv :block/content blocks)))
+    (mapv :block/title blocks)))
 
 
 (defn- extract-title [file text]
 (defn- extract-title [file text]
   (-> (extract file text) :pages first :block/properties :title))
   (-> (extract file text) :pages first :block/properties :title))
@@ -129,9 +129,9 @@
 (def foo-edn
 (def foo-edn
   "Example exported whiteboard page as an edn exportable."
   "Example exported whiteboard page as an edn exportable."
   '{:blocks
   '{:blocks
-    ({:block/content "foo content a",
+    ({:block/title "foo content a",
       :block/format :markdown},
       :block/format :markdown},
-     {:block/content "foo content b",
+     {:block/title "foo content b",
       :block/format :markdown}),
       :block/format :markdown}),
     :pages
     :pages
     ({:block/format :markdown,
     ({:block/format :markdown,

+ 9 - 9
deps/graph-parser/test/logseq/graph_parser_test.cljs

@@ -11,10 +11,10 @@
 (def foo-edn
 (def foo-edn
   "Example exported whiteboard page as an edn exportable."
   "Example exported whiteboard page as an edn exportable."
   '{:blocks
   '{:blocks
-    ({:block/content "foo content a",
+    ({:block/title "foo content a",
       :block/format :markdown
       :block/format :markdown
       :block/parent {:block/uuid #uuid "16c90195-6a03-4b3f-839d-095a496d9acd"}},
       :block/parent {:block/uuid #uuid "16c90195-6a03-4b3f-839d-095a496d9acd"}},
-     {:block/content "foo content b",
+     {:block/title "foo content b",
       :block/format :markdown
       :block/format :markdown
       :block/parent {:block/uuid #uuid "16c90195-6a03-4b3f-839d-095a496d9acd"}}),
       :block/parent {:block/uuid #uuid "16c90195-6a03-4b3f-839d-095a496d9acd"}}),
     :pages
     :pages
@@ -27,9 +27,9 @@
 (def foo-conflict-edn
 (def foo-conflict-edn
   "Example exported whiteboard page as an edn exportable."
   "Example exported whiteboard page as an edn exportable."
   '{:blocks
   '{:blocks
-    ({:block/content "foo content a",
+    ({:block/title "foo content a",
       :block/format :markdown},
       :block/format :markdown},
-     {:block/content "foo content b",
+     {:block/title "foo content b",
       :block/format :markdown}),
       :block/format :markdown}),
     :pages
     :pages
     ({:block/format :markdown,
     ({:block/format :markdown,
@@ -40,11 +40,11 @@
 (def bar-edn
 (def bar-edn
   "Example exported whiteboard page as an edn exportable."
   "Example exported whiteboard page as an edn exportable."
   '{:blocks
   '{:blocks
-    ({:block/content "foo content a",
+    ({:block/title "foo content a",
       :block/format :markdown
       :block/format :markdown
       :block/parent {:block/uuid #uuid "71515b7d-b5fc-496b-b6bf-c58004a34ee3"
       :block/parent {:block/uuid #uuid "71515b7d-b5fc-496b-b6bf-c58004a34ee3"
                      :block/name "foo"}},
                      :block/name "foo"}},
-     {:block/content "foo content b",
+     {:block/title "foo content b",
       :block/format :markdown
       :block/format :markdown
       :block/parent {:block/uuid #uuid "71515b7d-b5fc-496b-b6bf-c58004a34ee3"
       :block/parent {:block/uuid #uuid "71515b7d-b5fc-496b-b6bf-c58004a34ee3"
                      :block/name "foo"}}),
                      :block/name "foo"}}),
@@ -65,7 +65,7 @@
       (is (= [{:id "628953c1-8d75-49fe-a648-f4c612109098"}]
       (is (= [{:id "628953c1-8d75-49fe-a648-f4c612109098"}]
              (->> (d/q '[:find (pull ?b [*])
              (->> (d/q '[:find (pull ?b [*])
                          :in $
                          :in $
-                         :where [?b :block/content] [(missing? $ ?b :block/name)]]
+                         :where [?b :block/title] [(missing? $ ?b :block/name)]]
                        @conn)
                        @conn)
                   (map first)
                   (map first)
                   (map :block/properties)))
                   (map :block/properties)))
@@ -94,7 +94,7 @@
                                               {:block/file
                                               {:block/file
                                                [:file/path]}]}])
                                                [:file/path]}]}])
                           :in $
                           :in $
-                          :where [?b :block/content] [(missing? $ ?b :block/name)]]
+                          :where [?b :block/title] [(missing? $ ?b :block/name)]]
                         @conn)
                         @conn)
             parent (:block/page (ffirst blocks))]
             parent (:block/page (ffirst blocks))]
         (is (= {:block/name "foo"
         (is (= {:block/name "foo"
@@ -137,7 +137,7 @@
         _ (parse-file conn "foo.md" body)
         _ (parse-file conn "foo.md" body)
         properties-orders (->> (d/q '[:find (pull ?b [*])
         properties-orders (->> (d/q '[:find (pull ?b [*])
                                       :in $
                                       :in $
-                                      :where [?b :block/content] [(missing? $ ?b :block/name)]]
+                                      :where [?b :block/title] [(missing? $ ?b :block/name)]]
                                     @conn)
                                     @conn)
                                (map first)
                                (map first)
                                (map :block/properties-order))]
                                (map :block/properties-order))]

+ 2 - 2
deps/graph-parser/test/resources/exporter-test-graph/logseq/config.edn

@@ -176,10 +176,10 @@
  ;; Default value: false
  ;; Default value: false
  :shortcut/doc-mode-enter-for-new-block? false
  :shortcut/doc-mode-enter-for-new-block? false
 
 
- ;; Block content larger than `block/content-max-length` will not be searchable
+ ;; Block content larger than `block/title-max-length` will not be searchable
  ;; or editable for performance.
  ;; or editable for performance.
  ;; Default value: 10000
  ;; Default value: 10000
- :block/content-max-length 10000
+ :block/title-max-length 10000
 
 
  ;; Display command documentation on hover.
  ;; Display command documentation on hover.
  ;; Default value: true
  ;; Default value: true

+ 1 - 1
deps/outliner/script/transact.cljs

@@ -31,7 +31,7 @@
       (do (println "Would update" (count blocks-to-update) "blocks with the following tx:")
       (do (println "Would update" (count blocks-to-update) "blocks with the following tx:")
           (prn update-tx)
           (prn update-tx)
           (println "With the following blocks updated:")
           (println "With the following blocks updated:")
-          (prn (map #(select-keys (d/entity @conn %) [:block/name :block/content]) blocks-to-update)))
+          (prn (map #(select-keys (d/entity @conn %) [:block/name :block/title]) blocks-to-update)))
       (do
       (do
         (db-pipeline/add-listener conn)
         (db-pipeline/add-listener conn)
         (d/transact! conn update-tx)
         (d/transact! conn update-tx)

+ 13 - 13
deps/outliner/src/logseq/outliner/core.cljs

@@ -163,7 +163,7 @@
                                               :block/tags (:block/tags m)
                                               :block/tags (:block/tags m)
                                               :block/format :markdown)
                                               :block/format :markdown)
                                        {:db/id (:db/id block-entity)
                                        {:db/id (:db/id block-entity)
-                                        :block/content ""
+                                        :block/title ""
                                         :block/refs []
                                         :block/refs []
                                         :block/link [:block/uuid (:block/uuid page-m)]}]
                                         :block/link [:block/uuid (:block/uuid page-m)]}]
                                       merge-tx))))))
                                       merge-tx))))))
@@ -194,7 +194,7 @@
                            (map (fn [id-or-map] (if (uuid? id-or-map) {:block/uuid id-or-map} id-or-map)))
                            (map (fn [id-or-map] (if (uuid? id-or-map) {:block/uuid id-or-map} id-or-map)))
                            (remove (fn [b] (nil? (d/entity db [:block/uuid (:block/uuid b)])))))
                            (remove (fn [b] (nil? (d/entity db [:block/uuid (:block/uuid b)])))))
 
 
-        content-refs (when-let [content (:block/content block)]
+        content-refs (when-let [content (:block/title block)]
                        (gp-block/extract-refs-from-text repo db content date-formatter))]
                        (gp-block/extract-refs-from-text repo db content date-formatter))]
     (concat property-refs content-refs)))
     (concat property-refs content-refs)))
 
 
@@ -238,7 +238,7 @@
                   (dissoc :block/properties))
                   (dissoc :block/properties))
           m* (-> data'
           m* (-> data'
                  (dissoc :block/children :block/meta :block.temp/top? :block.temp/bottom? :block/unordered
                  (dissoc :block/children :block/meta :block.temp/top? :block.temp/bottom? :block/unordered
-                         :block/title :block/body :block/level :block.temp/fully-loaded?)
+                         :block.temp/ast-title :block.temp/ast-body :block/level :block.temp/fully-loaded?)
                  common-util/remove-nils
                  common-util/remove-nils
                  block-with-updated-at
                  block-with-updated-at
                  fix-tag-ids)
                  fix-tag-ids)
@@ -263,7 +263,7 @@
 
 
       (when eid
       (when eid
         ;; Retract attributes to prepare for tx which rewrites block attributes
         ;; Retract attributes to prepare for tx which rewrites block attributes
-        (when (or (and retract-attributes? (:block/content m))
+        (when (or (and retract-attributes? (:block/title m))
                   (seq retract-attributes))
                   (seq retract-attributes))
           (let [retract-attributes (concat
           (let [retract-attributes (concat
                                     (if db-based?
                                     (if db-based?
@@ -280,7 +280,7 @@
         ;; Update block's page attributes
         ;; Update block's page attributes
         (update-page-when-save-block txs-state block-entity m)
         (update-page-when-save-block txs-state block-entity m)
         ;; Remove orphaned refs from block
         ;; Remove orphaned refs from block
-        (when (and (:block/content m) (not= (:block/content m) (:block/content block-entity)))
+        (when (and (:block/title m) (not= (:block/title m) (:block/title block-entity)))
           (remove-orphaned-refs-when-save @conn txs-state block-entity m {:db-graph? db-based?})))
           (remove-orphaned-refs-when-save @conn txs-state block-entity m {:db-graph? db-based?})))
 
 
       ;; handle others txs
       ;; handle others txs
@@ -293,7 +293,7 @@
 
 
       ;; delete heading property for db-based-graphs
       ;; delete heading property for db-based-graphs
       (when (and db-based? (integer? (:logseq.property/heading block-entity))
       (when (and db-based? (integer? (:logseq.property/heading block-entity))
-                 (not (some-> (:block/content data) (string/starts-with? "#"))))
+                 (not (some-> (:block/title data) (string/starts-with? "#"))))
         (swap! txs-state (fn [txs] (conj (vec txs) [:db/retract (:db/id block-entity) :logseq.property/heading]))))
         (swap! txs-state (fn [txs] (conj (vec txs) [:db/retract (:db/id block-entity) :logseq.property/heading]))))
 
 
       this))
       this))
@@ -368,7 +368,7 @@
     ;; replace existing block
     ;; replace existing block
     (and (contains? #{:paste :insert-blocks} outliner-op)
     (and (contains? #{:paste :insert-blocks} outliner-op)
          replace-empty-target?
          replace-empty-target?
-         (string/blank? (:block/content target-block))
+         (string/blank? (:block/title target-block))
          (zero? idx))
          (zero? idx))
     (get-id (:block/parent target-block))
     (get-id (:block/parent target-block))
 
 
@@ -431,7 +431,7 @@
         db-based? (sqlite-util/db-based-graph? repo)]
         db-based? (sqlite-util/db-based-graph? repo)]
     (if-let [list-type (and target-block (list-type-fn target-block))]
     (if-let [list-type (and target-block (list-type-fn target-block))]
       (mapv
       (mapv
-       (fn [{:block/keys [content format] :as block}]
+       (fn [{:block/keys [title format] :as block}]
          (let [list? (and (some? (:block/uuid block))
          (let [list? (and (some? (:block/uuid block))
                           (nil? (list-type-fn block)))]
                           (nil? (list-type-fn block)))]
            (cond-> block
            (cond-> block
@@ -442,7 +442,7 @@
                   (update b :block/properties assoc (db-property-util/get-pid repo :logseq.property/order-list-type) list-type))))
                   (update b :block/properties assoc (db-property-util/get-pid repo :logseq.property/order-list-type) list-type))))
 
 
              (not db-based?)
              (not db-based?)
-             (assoc :block/content (gp-property/insert-property repo format content :logseq.order-list-type list-type)))))
+             (assoc :block/title (gp-property/insert-property repo format title :logseq.order-list-type list-type)))))
        blocks)
        blocks)
       blocks)))
       blocks)))
 
 
@@ -604,12 +604,12 @@
         _ (assert (some? target-block) (str "Invalid target: " target-block))
         _ (assert (some? target-block) (str "Invalid target: " target-block))
         sibling? (if (ldb/page? target-block) false sibling?)
         sibling? (if (ldb/page? target-block) false sibling?)
         replace-empty-target? (if (and (some? replace-empty-target?)
         replace-empty-target? (if (and (some? replace-empty-target?)
-                                       (:block/content target-block)
-                                       (string/blank? (:block/content target-block)))
+                                       (:block/title target-block)
+                                       (string/blank? (:block/title target-block)))
                                 replace-empty-target?
                                 replace-empty-target?
                                 (and sibling?
                                 (and sibling?
-                                     (:block/content target-block)
-                                     (string/blank? (:block/content target-block))
+                                     (:block/title target-block)
+                                     (string/blank? (:block/title target-block))
                                      (> (count blocks) 1)))
                                      (> (count blocks) 1)))
         blocks' (let [blocks' (blocks-with-level blocks)]
         blocks' (let [blocks' (blocks-with-level blocks)]
                   (cond->> (blocks-with-ordered-list-props repo blocks' target-block sibling?)
                   (cond->> (blocks-with-ordered-list-props repo blocks' target-block sibling?)

+ 2 - 2
deps/outliner/src/logseq/outliner/pipeline.cljs

@@ -133,8 +133,8 @@
 (defn block-content-refs
 (defn block-content-refs
   "Return ref block ids for given block"
   "Return ref block ids for given block"
   [db block]
   [db block]
-  (let [content (or (:block/raw-content block)
-                    (:block/content block))]
+  (let [content (or (:block/raw-title block)
+                    (:block/title block))]
     (when (string? content)
     (when (string? content)
       (->> (db-content/get-matched-special-ids content)
       (->> (db-content/get-matched-special-ids content)
            (map (fn [id]
            (map (fn [id]

+ 2 - 2
deps/outliner/src/logseq/outliner/property.cljs

@@ -202,7 +202,7 @@
           :in $ ?property-id ?raw-value
           :in $ ?property-id ?raw-value
           :where
           :where
           [?b ?property-id ?v]
           [?b ?property-id ?v]
-          (or [?v :block/content ?raw-value]
+          (or [?v :block/title ?raw-value]
               [?v :property.value/content ?raw-value])]
               [?v :property.value/content ?raw-value])]
         db
         db
         property-id
         property-id
@@ -417,7 +417,7 @@
                                          (dissoc schema :description))}
                                          (dissoc schema :description))}
                         (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
                         (if (db-property-type/original-value-ref-property-types (get-in property [:block/schema :type]))
                           {:property.value/content resolved-value}
                           {:property.value/content resolved-value}
-                          {:block/content resolved-value})))
+                          {:block/title resolved-value})))
                        icon
                        icon
                        (assoc :logseq.property/icon icon)))]
                        (assoc :logseq.property/icon icon)))]
                   (let [max-order (:block/order (last (:property/closed-values property)))
                   (let [max-order (:block/order (last (:property/closed-values property)))

+ 9 - 9
deps/outliner/test/logseq/outliner/pipeline_test.cljs

@@ -11,7 +11,7 @@
 (defn- get-blocks [db]
 (defn- get-blocks [db]
   (->> (d/q '[:find (pull ?b [* {:block/path-refs [:block/name :db/id]}])
   (->> (d/q '[:find (pull ?b [* {:block/path-refs [:block/name :db/id]}])
               :in $
               :in $
-              :where [?b :block/content] [(missing? $ ?b :logseq.property/built-in?)]]
+              :where [?b :block/title] [(missing? $ ?b :logseq.property/built-in?)]]
             db)
             db)
        (map first)))
        (map first)))
 
 
@@ -25,15 +25,15 @@
              conn
              conn
              [{:page {:block/title "bar"}}
              [{:page {:block/title "bar"}}
               {:page {:block/title "page1"}
               {:page {:block/title "page1"}
-               :blocks [{:block/content "parent [[foo]]"
+               :blocks [{:block/title "parent [[foo]]"
                          :build/children
                          :build/children
-                         [{:block/content "child [[baz]]"
+                         [{:block/title "child [[baz]]"
                            :build/children
                            :build/children
-                           [{:block/content "grandchild [[bing]]"}]}]}]}])
+                           [{:block/title "grandchild [[bing]]"}]}]}]}])
           blocks (get-blocks @conn)
           blocks (get-blocks @conn)
           ;; Update parent block to replace 'foo' with 'bar' ref
           ;; Update parent block to replace 'foo' with 'bar' ref
           new-tag-id (ffirst (d/q '[:find ?b :where [?b :block/title "bar"]] @conn))
           new-tag-id (ffirst (d/q '[:find ?b :where [?b :block/title "bar"]] @conn))
-          modified-blocks (map #(if (string/starts-with? (:block/content %) "parent")
+          modified-blocks (map #(if (string/starts-with? (:block/title %) "parent")
                                   (assoc %
                                   (assoc %
                                          :block/refs [{:db/id new-tag-id}]
                                          :block/refs [{:db/id new-tag-id}]
                                          :block/path-refs [{:db/id new-tag-id}])
                                          :block/path-refs [{:db/id new-tag-id}])
@@ -43,12 +43,12 @@
           _ (d/transact! conn refs-tx {:pipeline-replace? true})
           _ (d/transact! conn refs-tx {:pipeline-replace? true})
           updated-blocks (->> (get-blocks @conn)
           updated-blocks (->> (get-blocks @conn)
                               ;; Only keep enough of content to uniquely identify block
                               ;; Only keep enough of content to uniquely identify block
-                              (map #(hash-map :block/content (re-find #"\w+" (:block/content %))
+                              (map #(hash-map :block/title (re-find #"\w+" (:block/title %))
                                               :path-ref-names (set (map :block/name (:block/path-refs %))))))]
                                               :path-ref-names (set (map :block/name (:block/path-refs %))))))]
-      (is (= [{:block/content "parent"
+      (is (= [{:block/title "parent"
                :path-ref-names #{"page1" "bar"}}
                :path-ref-names #{"page1" "bar"}}
-              {:block/content "child"
+              {:block/title "child"
                :path-ref-names #{"page1" "bar" "baz"}}
                :path-ref-names #{"page1" "bar" "baz"}}
-              {:block/content "grandchild"
+              {:block/title "grandchild"
                :path-ref-names #{"page1" "bar" "baz" "bing"}}]
                :path-ref-names #{"page1" "bar" "baz" "bing"}}]
              updated-blocks)))))
              updated-blocks)))))

+ 24 - 24
deps/outliner/test/logseq/outliner/property_test.cljs

@@ -11,7 +11,7 @@
   (->> content
   (->> content
        (d/q '[:find [(pull ?b [*]) ...]
        (d/q '[:find [(pull ?b [*]) ...]
               :in $ ?content
               :in $ ?content
-              :where [?b :block/content ?content]]
+              :where [?b :block/title ?content]]
             @conn)
             @conn)
        first))
        first))
 
 
@@ -67,8 +67,8 @@
   (testing "Create a new :default property value"
   (testing "Create a new :default property value"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:default "foo"}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:default "foo"}}
+                           {:block/title "b2"}]}])
           block (find-block-by-content conn "b2")
           block (find-block-by-content conn "b2")
           ;; Use same args as outliner.op
           ;; Use same args as outliner.op
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/default "" {})
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/default "" {})
@@ -84,8 +84,8 @@
   (testing "Create cases for a new :one :number property value"
   (testing "Create cases for a new :one :number property value"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:num 2}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:num 2}}
+                           {:block/title "b2"}]}])
           block (find-block-by-content conn "b2")
           block (find-block-by-content conn "b2")
           ;; Use same args as outliner.op
           ;; Use same args as outliner.op
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/num "3" {})
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/num "3" {})
@@ -107,8 +107,8 @@
   (testing "Create new :many :number property values"
   (testing "Create new :many :number property values"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:num-many #{2}}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:num-many #{2}}}
+                           {:block/title "b2"}]}])
           block (find-block-by-content conn "b2")
           block (find-block-by-content conn "b2")
           ;; Use same args as outliner.op
           ;; Use same args as outliner.op
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/num-many "3" {})
           _ (outliner-property/create-property-text-block! conn (:db/id block) :user.property/num-many "3" {})
@@ -124,8 +124,8 @@
   (testing "Set a :number value with existing value"
   (testing "Set a :number value with existing value"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:num 2}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:num 2}}
+                           {:block/title "b2"}]}])
           property-value (:user.property/num (find-block-by-content conn "b1"))
           property-value (:user.property/num (find-block-by-content conn "b1"))
           _ (assert (:db/id property-value))
           _ (assert (:db/id property-value))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
@@ -137,8 +137,8 @@
   (testing "Update a :number value with existing value"
   (testing "Update a :number value with existing value"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:num 2}}
-                           {:block/content "b2" :build/properties {:num 3}}]}])
+                  :blocks [{:block/title "b1" :build/properties {:num 2}}
+                           {:block/title "b2" :build/properties {:num 3}}]}])
           property-value (:user.property/num (find-block-by-content conn "b1"))
           property-value (:user.property/num (find-block-by-content conn "b1"))
           _ (assert (:db/id property-value))
           _ (assert (:db/id property-value))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
@@ -151,8 +151,8 @@
   (testing "Setting :default with same property value reuses existing entity"
   (testing "Setting :default with same property value reuses existing entity"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:logseq.property/order-list-type "number"}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:logseq.property/order-list-type "number"}}
+                           {:block/title "b2"}]}])
           property-value (:logseq.property/order-list-type (find-block-by-content conn "b1"))
           property-value (:logseq.property/order-list-type (find-block-by-content conn "b1"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           ;; Use same args as outliner.op
           ;; Use same args as outliner.op
@@ -165,8 +165,8 @@
   (testing "Setting :checkbox with same property value reuses existing entity"
   (testing "Setting :checkbox with same property value reuses existing entity"
     (let [conn (create-conn-with-blocks
     (let [conn (create-conn-with-blocks
                 [{:page {:block/title "page1"}
                 [{:page {:block/title "page1"}
-                  :blocks [{:block/content "b1" :build/properties {:checkbox true}}
-                           {:block/content "b2"}]}])
+                  :blocks [{:block/title "b1" :build/properties {:checkbox true}}
+                           {:block/title "b2"}]}])
           property-value (:user.property/checkbox (find-block-by-content conn "b1"))
           property-value (:user.property/checkbox (find-block-by-content conn "b1"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           block-uuid (:block/uuid (find-block-by-content conn "b2"))
           ;; Use same args as outliner.op
           ;; Use same args as outliner.op
@@ -179,7 +179,7 @@
 (deftest remove-block-property!
 (deftest remove-block-property!
   (let [conn (create-conn-with-blocks
   (let [conn (create-conn-with-blocks
               [{:page {:block/title "page1"}
               [{:page {:block/title "page1"}
-                :blocks [{:block/content "b1" :build/properties {:default "foo"}}]}])
+                :blocks [{:block/title "b1" :build/properties {:default "foo"}}]}])
         block (find-block-by-content conn "b1")
         block (find-block-by-content conn "b1")
         _ (assert (:user.property/default block))
         _ (assert (:user.property/default block))
         ;; Use same args as outliner.op
         ;; Use same args as outliner.op
@@ -191,8 +191,8 @@
 (deftest batch-set-property!
 (deftest batch-set-property!
   (let [conn (create-conn-with-blocks
   (let [conn (create-conn-with-blocks
               [{:page {:block/title "page1"}
               [{:page {:block/title "page1"}
-                :blocks [{:block/content "item 1"}
-                         {:block/content "item 2"}]}])
+                :blocks [{:block/title "item 1"}
+                         {:block/title "item 2"}]}])
         block-ids (map #(-> (find-block-by-content conn %) :block/uuid) ["item 1" "item 2"])
         block-ids (map #(-> (find-block-by-content conn %) :block/uuid) ["item 1" "item 2"])
         _ (outliner-property/batch-set-property! conn block-ids :logseq.property/order-list-type "number")
         _ (outliner-property/batch-set-property! conn block-ids :logseq.property/order-list-type "number")
         updated-blocks (map #(find-block-by-content conn %) ["item 1" "item 2"])]
         updated-blocks (map #(find-block-by-content conn %) ["item 1" "item 2"])]
@@ -204,8 +204,8 @@
 (deftest batch-remove-property!
 (deftest batch-remove-property!
   (let [conn (create-conn-with-blocks
   (let [conn (create-conn-with-blocks
               [{:page {:block/title "page1"}
               [{:page {:block/title "page1"}
-                :blocks [{:block/content "item 1" :build/properties {:logseq.property/order-list-type "number"}}
-                         {:block/content "item 2" :build/properties {:logseq.property/order-list-type "number"}}]}])
+                :blocks [{:block/title "item 1" :build/properties {:logseq.property/order-list-type "number"}}
+                         {:block/title "item 2" :build/properties {:logseq.property/order-list-type "number"}}]}])
         block-ids (map #(-> (find-block-by-content conn %) :block/uuid) ["item 1" "item 2"])
         block-ids (map #(-> (find-block-by-content conn %) :block/uuid) ["item 1" "item 2"])
         _ (outliner-property/batch-remove-property! conn block-ids :logseq.property/order-list-type)
         _ (outliner-property/batch-remove-property! conn block-ids :logseq.property/order-list-type)
         updated-blocks (map #(find-block-by-content conn %) ["item 1" "item 2"])]
         updated-blocks (map #(find-block-by-content conn %) ["item 1" "item 2"])]
@@ -216,8 +216,8 @@
 (deftest add-existing-values-to-closed-values!
 (deftest add-existing-values-to-closed-values!
   (let [conn (create-conn-with-blocks
   (let [conn (create-conn-with-blocks
               [{:page {:block/title "page1"}
               [{:page {:block/title "page1"}
-                :blocks [{:block/content "b1" :build/properties {:num 1}}
-                         {:block/content "b2" :build/properties {:num 2}}]}])
+                :blocks [{:block/title "b1" :build/properties {:num 1}}
+                         {:block/title "b2" :build/properties {:num 2}}]}])
         values (map (fn [d] (:block/uuid (d/entity @conn (:v d)))) (d/datoms @conn :avet :user.property/num))
         values (map (fn [d] (:block/uuid (d/entity @conn (:v d)))) (d/datoms @conn :avet :user.property/num))
         _ (outliner-property/add-existing-values-to-closed-values! conn :user.property/num values)]
         _ (outliner-property/add-existing-values-to-closed-values! conn :user.property/num values)]
     (is (= [1 2]
     (is (= [1 2]
@@ -267,7 +267,7 @@
                                       :block/schema {:type :default}}}
                                       :block/schema {:type :default}}}
                :pages-and-blocks
                :pages-and-blocks
                [{:page {:block/title "page1"}
                [{:page {:block/title "page1"}
-                 :blocks [{:block/content "b1" :user.property/default [:block/uuid used-closed-value-uuid]}]}]})
+                 :blocks [{:block/title "b1" :user.property/default [:block/uuid used-closed-value-uuid]}]}]})
         _ (assert (:user.property/default (find-block-by-content conn "b1")))
         _ (assert (:user.property/default (find-block-by-content conn "b1")))
         property-uuid (:block/uuid (d/entity @conn :user.property-default))
         property-uuid (:block/uuid (d/entity @conn :user.property-default))
         _ (outliner-property/delete-closed-value! conn property-uuid [:block/uuid closed-value-uuid])]
         _ (outliner-property/delete-closed-value! conn property-uuid [:block/uuid closed-value-uuid])]
@@ -300,7 +300,7 @@
                          :c2 {:build/schema-properties [:p2 :p3]}}
                          :c2 {:build/schema-properties [:p2 :p3]}}
                :pages-and-blocks
                :pages-and-blocks
                [{:page {:block/title "p1"}
                [{:page {:block/title "p1"}
-                 :blocks [{:block/content "o1"
+                 :blocks [{:block/title "o1"
                            :build/tags [:c1 :c2]}]}]})
                            :build/tags [:c1 :c2]}]}]})
         block (find-block-by-content conn "o1")]
         block (find-block-by-content conn "o1")]
     (is (= [:user.property/p1 :user.property/p2 :user.property/p3]
     (is (= [:user.property/p1 :user.property/p2 :user.property/p3]

+ 1 - 1
deps/publishing/src/logseq/publishing/db.cljs

@@ -128,7 +128,7 @@
      (keep
      (keep
       (fn [datom]
       (fn [datom]
         (cond-> []
         (cond-> []
-          (= :block/content (:a datom))
+          (= :block/title (:a datom))
           (concat (let [matched (re-seq #"\([./]*/assets/([^)]+)\)" (:v datom))]
           (concat (let [matched (re-seq #"\([./]*/assets/([^)]+)\)" (:v datom))]
                     (when (seq matched)
                     (when (seq matched)
                       (for [[_ path] matched]
                       (for [[_ path] matched]

+ 2 - 2
deps/publishing/test/logseq/publishing/db_test.cljs

@@ -20,7 +20,7 @@
                             set)
                             set)
         exported-blocks (->> (d/q '[:find (pull ?p [*])
         exported-blocks (->> (d/q '[:find (pull ?p [*])
                                     :where
                                     :where
-                                    [?b :block/content]
+                                    [?b :block/title]
                                     [?b :block/page ?p]]
                                     [?b :block/page ?p]]
                                   filtered-db)
                                   filtered-db)
                              (map (comp :block/name first))
                              (map (comp :block/name first))
@@ -47,7 +47,7 @@
                             set)
                             set)
         exported-block-pages (->> (d/q '[:find (pull ?p [*])
         exported-block-pages (->> (d/q '[:find (pull ?p [*])
                                          :where
                                          :where
-                                         [?b :block/content]
+                                         [?b :block/title]
                                          [?b :block/page ?p]]
                                          [?b :block/page ?p]]
                                        filtered-db)
                                        filtered-db)
                                   (map (comp :block/name first))
                                   (map (comp :block/name first))

+ 3 - 3
docs/dev-practices.md

@@ -365,7 +365,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
   ```sh
   ```sh
   $ bb dev:db-query woot '[:find (pull ?b [*]) :where (block-content ?b "Dogma")]'
   $ bb dev:db-query woot '[:find (pull ?b [*]) :where (block-content ?b "Dogma")]'
   DB contains 833 datoms
   DB contains 833 datoms
-  [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/content "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
+  [{:block/tx-id 536870923, :block/link #:db{:id 100065}, :block/uuid #uuid "65565c26-f972-4400-bce4-a15df488784d", :block/updated-at 1700158508564, :block/order "a0", :block/refs [#:db{:id 100064}], :block/created-at 1700158502056, :block/format :markdown, :block/tags [#:db{:id 100064}], :block/title "Dogma #~^65565c2a-b1c5-4dc8-a0f0-81b786bc5c6d", :db/id 100090, :block/path-refs [#:db{:id 100051} #:db{:id 100064}], :block/parent #:db{:id 100051}, :block/page #:db{:id 100051}}]
   ```
   ```
 
 
 * `dev:db-transact` - Run a `d/transact!` against the queried results of a DB graph
 * `dev:db-transact` - Run a `d/transact!` against the queried results of a DB graph
@@ -413,7 +413,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
   # This snapshot correctly shows an added block with content "b7" and a property using a closed :default value
   # This snapshot correctly shows an added block with content "b7" and a property using a closed :default value
   $  bb dev:diff-datoms w2.edn w3.edn
   $  bb dev:diff-datoms w2.edn w3.edn
   [[]
   [[]
-  [[162 :block/content "b7" 536871039 true]
+  [[162 :block/title "b7" 536871039 true]
     [162 :block/created-at 1703004379103 536871037 true]
     [162 :block/created-at 1703004379103 536871037 true]
     [162 :block/format :markdown 536871037 true]
     [162 :block/format :markdown 536871037 true]
     [162 :block/page 149 536871037 true]
     [162 :block/page 149 536871037 true]
@@ -450,7 +450,7 @@ These tasks are specific to database graphs. For these tasks there is a one time
     [nil nil 1703004380918 536871039]
     [nil nil 1703004380918 536871039]
     [nil nil 162 536871037]
     [nil nil 162 536871037]
     [nil nil 536871037 536871038]
     [nil nil 536871037 536871038]
-    [162 :block/content "b7" 536871039 true]
+    [162 :block/title "b7" 536871039 true]
     [162 :block/created-at 1703004379103 536871037 true]
     [162 :block/created-at 1703004379103 536871037 true]
     [162 :block/format :markdown 536871037 true]
     [162 :block/format :markdown 536871037 true]
     [162 :block/order "a0" 536871037 true]
     [162 :block/order "a0" 536871037 true]

+ 3 - 3
scripts/src/logseq/tasks/db_graph/create_graph_with_large_sizes.cljs

@@ -34,7 +34,7 @@
                    (fn []
                    (fn []
                      (let [id (get-next-id)]
                      (let [id (get-next-id)]
                        {:block/uuid id
                        {:block/uuid id
-                        :block/content (str id)})))))
+                        :block/title (str id)})))))
 
 
 (defn- create-init-data
 (defn- create-init-data
   [options]
   [options]
@@ -70,14 +70,14 @@
         _ (println "Building tx ...")
         _ (println "Building tx ...")
         {:keys [init-tx]} (outliner-cli/build-blocks-tx (create-init-data options))]
         {:keys [init-tx]} (outliner-cli/build-blocks-tx (create-init-data options))]
     (println "Built" (count init-tx) "tx," (count (filter :block/title init-tx)) "pages and"
     (println "Built" (count init-tx) "tx," (count (filter :block/title init-tx)) "pages and"
-             (count (filter :block/content init-tx)) "blocks ...")
+             (count (filter :block/title init-tx)) "blocks ...")
     ;; Vary the chunking with page size up to a max to avoid OOM
     ;; Vary the chunking with page size up to a max to avoid OOM
     (let [tx-chunks (partition-all (min (:pages options) 30000) init-tx)]
     (let [tx-chunks (partition-all (min (:pages options) 30000) init-tx)]
       (loop [chunks tx-chunks
       (loop [chunks tx-chunks
              chunk-num 1]
              chunk-num 1]
         (when-let [chunk (first chunks)]
         (when-let [chunk (first chunks)]
           (println "Transacting chunk" chunk-num  "of" (count tx-chunks)
           (println "Transacting chunk" chunk-num  "of" (count tx-chunks)
-                   "starting with block:" (pr-str (select-keys (first chunk) [:block/content :block/title])))
+                   "starting with block:" (pr-str (select-keys (first chunk) [:block/title :block/title])))
           (d/transact! conn chunk)
           (d/transact! conn chunk)
           (recur (rest chunks) (inc chunk-num)))))
           (recur (rest chunks) (inc chunk-num)))))
     #_(d/transact! conn blocks-tx)
     #_(d/transact! conn blocks-tx)

+ 59 - 59
scripts/src/logseq/tasks/db_graph/create_graph_with_properties.cljs

@@ -73,7 +73,7 @@
                 :build/tags [:TestClass]}}
                 :build/tags [:TestClass]}}
         {:page {:block/title "Blocks"}
         {:page {:block/title "Blocks"}
          :blocks
          :blocks
-         [{:block/content "block object"
+         [{:block/title "block object"
            :block/uuid object-uuid
            :block/uuid object-uuid
            :build/tags [:TestClass]}]}]
            :build/tags [:TestClass]}]}]
 
 
@@ -81,55 +81,55 @@
        [{:page
        [{:page
          {:build/journal (date-time-util/date->int today)}
          {:build/journal (date-time-util/date->int today)}
          :blocks
          :blocks
-         [{:block/content "[[Block Properties]]"}
-          {:block/content "[[Block Property Queries]]"}
-          {:block/content "[[Page Property Queries]]"}]}
+         [{:block/title "[[Block Properties]]"}
+          {:block/title "[[Block Property Queries]]"}
+          {:block/title "[[Page Property Queries]]"}]}
         {:page {:build/journal (date-time-util/date->int yesterday)}}
         {:page {:build/journal (date-time-util/date->int yesterday)}}
         {:page {:build/journal (date-time-util/date->int two-days-ago)}}
         {:page {:build/journal (date-time-util/date->int two-days-ago)}}
 
 
         ;; Block property blocks and queries
         ;; Block property blocks and queries
         {:page {:block/title "Block Properties"}
         {:page {:block/title "Block Properties"}
          :blocks
          :blocks
-         [{:block/content "default property block" :build/properties {:default "haha"}}
-          {:block/content "default property block" :build/properties {:default-many #{"yee" "haw" "sir"}}}
-          {:block/content "default-closed property block" :build/properties {:default-closed (random-closed-value :default-closed)}}
-          {:block/content "url property block" :build/properties {:url "https://logseq.com"}}
-          {:block/content "url-many property block" :build/properties {:url-many #{"https://logseq.com" "https://docs.logseq.com"}}}
-          {:block/content "url-closed property block" :build/properties {:url-closed (random-closed-value :url-closed)}}
-          {:block/content "checkbox property block" :build/properties {:checkbox true}}
-          {:block/content "number property block" :build/properties {:number 5}}
-          {:block/content "number-many property block" :build/properties {:number-many #{5 10}}}
-          {:block/content "number-closed property block" :build/properties {:number-closed (random-closed-value :number-closed)}}
-          {:block/content "object property block" :build/properties {:object [:block/uuid object-uuid]}}
-          {:block/content "object-many property block" :build/properties {:object-many #{[:block/uuid object-uuid] [:page "Page object"]}}}
-          {:block/content "page property block" :build/properties {:page [:page "Page 1"]}}
-          {:block/content "page-many property block" :build/properties {:page-many #{[:page "Page 1"] [:page "Page 2"]}}}
+         [{:block/title "default property block" :build/properties {:default "haha"}}
+          {:block/title "default property block" :build/properties {:default-many #{"yee" "haw" "sir"}}}
+          {:block/title "default-closed property block" :build/properties {:default-closed (random-closed-value :default-closed)}}
+          {:block/title "url property block" :build/properties {:url "https://logseq.com"}}
+          {:block/title "url-many property block" :build/properties {:url-many #{"https://logseq.com" "https://docs.logseq.com"}}}
+          {:block/title "url-closed property block" :build/properties {:url-closed (random-closed-value :url-closed)}}
+          {:block/title "checkbox property block" :build/properties {:checkbox true}}
+          {:block/title "number property block" :build/properties {:number 5}}
+          {:block/title "number-many property block" :build/properties {:number-many #{5 10}}}
+          {:block/title "number-closed property block" :build/properties {:number-closed (random-closed-value :number-closed)}}
+          {:block/title "object property block" :build/properties {:object [:block/uuid object-uuid]}}
+          {:block/title "object-many property block" :build/properties {:object-many #{[:block/uuid object-uuid] [:page "Page object"]}}}
+          {:block/title "page property block" :build/properties {:page [:page "Page 1"]}}
+          {:block/title "page-many property block" :build/properties {:page-many #{[:page "Page 1"] [:page "Page 2"]}}}
           ;;  ;; :page-closed and :date-closed disabled for now since they're not supported
           ;;  ;; :page-closed and :date-closed disabled for now since they're not supported
-          ;;  #_{:block/content "page-closed property block" :build/properties {:page-closed (random-closed-value :page-closed)}}
-          {:block/content "date property block" :build/properties {:date [:page (date-journal-title today)]}}
-          {:block/content "date-many property block" :build/properties {:date-many #{[:page (date-journal-title today)]
+          ;;  #_{:block/title "page-closed property block" :build/properties {:page-closed (random-closed-value :page-closed)}}
+          {:block/title "date property block" :build/properties {:date [:page (date-journal-title today)]}}
+          {:block/title "date-many property block" :build/properties {:date-many #{[:page (date-journal-title today)]
                                                                                      [:page (date-journal-title yesterday)]}}}
                                                                                      [:page (date-journal-title yesterday)]}}}
-          #_{:block/content "date-closed property block" :build/properties {:date-closed (random-closed-value :date-closed)}}]}
+          #_{:block/title "date-closed property block" :build/properties {:date-closed (random-closed-value :date-closed)}}]}
         {:page {:block/title "Block Property Queries"}
         {:page {:block/title "Block Property Queries"}
          :blocks
          :blocks
-         [{:block/content "{{query (property :default \"haha\")}}"}
-          {:block/content "{{query (property :default-many \"haw\")}}"}
-          {:block/content (str "{{query (property :default-closed " (pr-str (get-closed-value :default-closed)) ")}}")}
-          {:block/content "{{query (property :url \"https://logseq.com\")}}"}
-          {:block/content "{{query (property :url-many \"https://logseq.com\")}}"}
-          {:block/content (str "{{query (property :url-closed " (pr-str (get-closed-value :url-closed)) ")}}")}
-          {:block/content "{{query (property :checkbox true)}}"}
-          {:block/content "{{query (property :number 5)}}"}
-          {:block/content "{{query (property :number-many 10)}}"}
-          {:block/content (str "{{query (property :number-closed " (pr-str (get-closed-value :number-closed)) ")}}")}
-          {:block/content "{{query (property :object \"block object\")}}"}
-          {:block/content "{{query (property :object-many [[Page object]])}}"}
-          {:block/content "{{query (property :page [[Page 1]])}}"}
-          {:block/content "{{query (property :page-many [[Page 2]])}}"}
-          #_{:block/content (str "{{query (property :page-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :page-closed))) ")}}")}
-          {:block/content (str "{{query (property :date " (page-ref/->page-ref (string/capitalize (date-journal-title today))) ")}}")}
-          {:block/content (str "{{query (property :date-many " (page-ref/->page-ref (string/capitalize (date-journal-title yesterday))) ")}}")}
-          #_{:block/content (str "{{query (property :date-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :date-closed))) ")}}")}]}
+         [{:block/title "{{query (property :default \"haha\")}}"}
+          {:block/title "{{query (property :default-many \"haw\")}}"}
+          {:block/title (str "{{query (property :default-closed " (pr-str (get-closed-value :default-closed)) ")}}")}
+          {:block/title "{{query (property :url \"https://logseq.com\")}}"}
+          {:block/title "{{query (property :url-many \"https://logseq.com\")}}"}
+          {:block/title (str "{{query (property :url-closed " (pr-str (get-closed-value :url-closed)) ")}}")}
+          {:block/title "{{query (property :checkbox true)}}"}
+          {:block/title "{{query (property :number 5)}}"}
+          {:block/title "{{query (property :number-many 10)}}"}
+          {:block/title (str "{{query (property :number-closed " (pr-str (get-closed-value :number-closed)) ")}}")}
+          {:block/title "{{query (property :object \"block object\")}}"}
+          {:block/title "{{query (property :object-many [[Page object]])}}"}
+          {:block/title "{{query (property :page [[Page 1]])}}"}
+          {:block/title "{{query (property :page-many [[Page 2]])}}"}
+          #_{:block/title (str "{{query (property :page-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :page-closed))) ")}}")}
+          {:block/title (str "{{query (property :date " (page-ref/->page-ref (string/capitalize (date-journal-title today))) ")}}")}
+          {:block/title (str "{{query (property :date-many " (page-ref/->page-ref (string/capitalize (date-journal-title yesterday))) ")}}")}
+          #_{:block/title (str "{{query (property :date-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :date-closed))) ")}}")}]}
 
 
         ;; Page property pages and queries
         ;; Page property pages and queries
         {:page {:block/title "default page" :build/properties {:default "yolo"}}}
         {:page {:block/title "default page" :build/properties {:default "yolo"}}}
@@ -153,24 +153,24 @@
         #_{:page {:block/title "date-closed page" :build/properties {:date-closed (random-closed-value :date-closed)}}}
         #_{:page {:block/title "date-closed page" :build/properties {:date-closed (random-closed-value :date-closed)}}}
         {:page {:block/title "Page Property Queries"}
         {:page {:block/title "Page Property Queries"}
          :blocks
          :blocks
-         [{:block/content "{{query (page-property :default \"yolo\")}}"}
-          {:block/content "{{query (page-property :default-many \"haw\")}}"}
-          {:block/content (str "{{query (page-property :default-closed " (pr-str (get-closed-value :default-closed)) ")}}")}
-          {:block/content "{{query (page-property :url \"https://logseq.com\")}}"}
-          {:block/content "{{query (page-property :url-many \"https://logseq.com\")}}"}
-          {:block/content (str "{{query (page-property :url-closed " (pr-str (get-closed-value :url-closed)) ")}}")}
-          {:block/content "{{query (page-property :checkbox true)}}"}
-          {:block/content "{{query (page-property :number 5)}}"}
-          {:block/content "{{query (page-property :number-many 10)}}"}
-          {:block/content (str "{{query (page-property :number-closed " (pr-str (get-closed-value :number-closed)) ")}}")}
-          {:block/content "{{query (page-property :object \"block object\")}}"}
-          {:block/content "{{query (page-property :object-many [[Page object]])}}"}
-          {:block/content "{{query (page-property :page [[Page 1]])}}"}
-          {:block/content "{{query (page-property :page-many [[Page 2]])}}"}
-          #_{:block/content (str "{{query (page-property :page-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :page-closed))) ")}}")}
-          {:block/content (str "{{query (page-property :date " (page-ref/->page-ref (string/capitalize (date-journal-title today))) ")}}")}
-          {:block/content (str "{{query (page-property :date-many " (page-ref/->page-ref (string/capitalize (date-journal-title yesterday))) ")}}")}
-          #_{:block/content (str "{{query (page-property :date-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :date-closed))) ")}}")}]}]))
+         [{:block/title "{{query (page-property :default \"yolo\")}}"}
+          {:block/title "{{query (page-property :default-many \"haw\")}}"}
+          {:block/title (str "{{query (page-property :default-closed " (pr-str (get-closed-value :default-closed)) ")}}")}
+          {:block/title "{{query (page-property :url \"https://logseq.com\")}}"}
+          {:block/title "{{query (page-property :url-many \"https://logseq.com\")}}"}
+          {:block/title (str "{{query (page-property :url-closed " (pr-str (get-closed-value :url-closed)) ")}}")}
+          {:block/title "{{query (page-property :checkbox true)}}"}
+          {:block/title "{{query (page-property :number 5)}}"}
+          {:block/title "{{query (page-property :number-many 10)}}"}
+          {:block/title (str "{{query (page-property :number-closed " (pr-str (get-closed-value :number-closed)) ")}}")}
+          {:block/title "{{query (page-property :object \"block object\")}}"}
+          {:block/title "{{query (page-property :object-many [[Page object]])}}"}
+          {:block/title "{{query (page-property :page [[Page 1]])}}"}
+          {:block/title "{{query (page-property :page-many [[Page 2]])}}"}
+          #_{:block/title (str "{{query (page-property :page-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :page-closed))) ")}}")}
+          {:block/title (str "{{query (page-property :date " (page-ref/->page-ref (string/capitalize (date-journal-title today))) ")}}")}
+          {:block/title (str "{{query (page-property :date-many " (page-ref/->page-ref (string/capitalize (date-journal-title yesterday))) ")}}")}
+          #_{:block/title (str "{{query (page-property :date-closed " (page-ref/->page-ref (string/capitalize (get-closed-value :date-closed))) ")}}")}]}]))
 
 
      :classes {:TestClass {}}
      :classes {:TestClass {}}
 
 
@@ -219,7 +219,7 @@
       (js/process.exit 1))
       (js/process.exit 1))
     (println "DB dir: " (node-path/join dir db-name))
     (println "DB dir: " (node-path/join dir db-name))
     (println "Generating" (count (filter :block/name init-tx)) "pages and"
     (println "Generating" (count (filter :block/name init-tx)) "pages and"
-             (count (filter :block/content init-tx)) "blocks ...")
+             (count (filter :block/title init-tx)) "blocks ...")
     (d/transact! conn init-tx)
     (d/transact! conn init-tx)
     (d/transact! conn block-props-tx)
     (d/transact! conn block-props-tx)
     (println "Created graph" (str db-name " with " (count (d/datoms @conn :eavt)) " datoms!"))))
     (println "Created graph" (str db-name " with " (count (d/datoms @conn :eavt)) " datoms!"))))

+ 2 - 2
src/main/frontend/commands.cljs

@@ -124,7 +124,7 @@
 
 
 (defn db-based-statuses
 (defn db-based-statuses
   []
   []
-  (map (fn [e] (:block/content e))
+  (map (fn [e] (:block/title e))
        (db-pu/get-closed-property-values :logseq.task/status)))
        (db-pu/get-closed-property-values :logseq.task/status)))
 
 
 (defn db-based-embed-page
 (defn db-based-embed-page
@@ -164,7 +164,7 @@
 
 
 (defn db-based-priorities
 (defn db-based-priorities
   []
   []
-  (map (fn [e] (:block/content e))
+  (map (fn [e] (:block/title e))
     (db-pu/get-closed-property-values :logseq.task/priority)))
     (db-pu/get-closed-property-values :logseq.task/priority)))
 
 
 (defn get-priorities
 (defn get-priorities

+ 4 - 8
src/main/frontend/common_keywords.cljs

@@ -11,10 +11,6 @@
   "block name, lowercase, only page-blocks have this attr"
   "block name, lowercase, only page-blocks have this attr"
   :string)
   :string)
 
 
-(sr/defkeyword :block/title
-  "like `:block/name`, but not unified into lowercase"
-  :string)
-
 (sr/defkeyword :block/type
 (sr/defkeyword :block/type
   "block type"
   "block type"
   [:set [:enum "page" "property" "class" "whiteboard" "hidden"]])
   [:set [:enum "page" "property" "class" "whiteboard" "hidden"]])
@@ -28,13 +24,13 @@
 - some no-order blocks don't have this attr too,
 - some no-order blocks don't have this attr too,
   TODO: list these types")
   TODO: list these types")
 
 
-(sr/defkeyword :block/content
-  "content string of the blocks.
+(sr/defkeyword :block/title
+  "Title or content string of the blocks.
 in db-version, page-references(e.g. [[page-name]]) are stored as [[~^uuid]]."
 in db-version, page-references(e.g. [[page-name]]) are stored as [[~^uuid]]."
   :string)
   :string)
 
 
-(sr/defkeyword :block/raw-content
-  "like `:block/content`,
+(sr/defkeyword :block/raw-title
+  "like `:block/title`,
 but when eval `(:block/raw-content block-entity)`, return raw-content of this block"
 but when eval `(:block/raw-content block-entity)`, return raw-content of this block"
   :string)
   :string)
 
 

+ 49 - 43
src/main/frontend/components/block.cljs

@@ -923,7 +923,7 @@
             hl-type (pu/lookup properties :logseq.property/hl-type)
             hl-type (pu/lookup properties :logseq.property/hl-type)
             repo (state/get-current-repo)
             repo (state/get-current-repo)
             stop-inner-events? (= block-type :whiteboard-shape)]
             stop-inner-events? (= block-type :whiteboard-shape)]
-        (if (and block (:block/content block))
+        (if (and block (:block/title block))
           (let [title [:span.block-ref
           (let [title [:span.block-ref
                        (block-content (assoc config :block-ref? true :stop-events? stop-inner-events?)
                        (block-content (assoc config :block-ref? true :stop-events? stop-inner-events?)
                                       block nil (:block/uuid block)
                                       block nil (:block/uuid block)
@@ -1805,16 +1805,18 @@
           (block-list config' children))]])))
           (block-list config' children))]])))
 
 
 (defn- block-content-empty?
 (defn- block-content-empty?
-  [{:block/keys [properties title body]}]
-  (and
-   (or
-    (empty? properties)
-    (and (not (config/db-based-graph? (state/get-current-repo)))
-         (property-file/properties-hidden? properties)))
+  [{:block/keys [properties] :as block}]
+  (let [ast-title (:block.temp/ast-title block)
+        ast-body (:block.temp/ast-body block)]
+    (and
+     (or
+      (empty? properties)
+      (and (not (config/db-based-graph? (state/get-current-repo)))
+           (property-file/properties-hidden? properties)))
 
 
-   (empty? title)
+     (empty? ast-title)
 
 
-   (every? #(= % ["Horizontal_Rule"]) body)))
+     (every? #(= % ["Horizontal_Rule"]) ast-body))))
 
 
 (rum/defcs block-control < rum/reactive
 (rum/defcs block-control < rum/reactive
   [state config block {:keys [uuid block-id collapsed? *control-show? edit? selected?]}]
   [state config block {:keys [uuid block-id collapsed? *control-show? edit? selected?]}]
@@ -1925,9 +1927,9 @@
 (declare block-content)
 (declare block-content)
 
 
 (defn build-block-title
 (defn build-block-title
-  [config {:block/keys [title marker pre-block? properties]
-           :as t}]
-  (let [config (assoc config :block t)
+  [config {:block/keys [marker pre-block? properties] :as t}]
+  (let [block-title (:block.temp/ast-title t)
+        config (assoc config :block t)
         level (:level config)
         level (:level config)
         slide? (boolean (:slide? config))
         slide? (boolean (:slide? config))
         block-ref? (:block-ref? config)
         block-ref? (:block-ref? config)
@@ -2007,7 +2009,7 @@
          (when-not area? [(hl-ref)])
          (when-not area? [(hl-ref)])
 
 
          (conj
          (conj
-          (map-inline config title)
+          (map-inline config block-title)
           (when (= block-type :whiteboard-shape) [:span.mr-1 (ui/icon "whiteboard-element" {:extension? true})]))
           (when (= block-type :whiteboard-shape) [:span.mr-1 (ui/icon "whiteboard-element" {:extension? true})]))
 
 
          ;; highlight ref block (area)
          ;; highlight ref block (area)
@@ -2226,10 +2228,10 @@
                                                   (dom/by-class "block-content-inner")
                                                   (dom/by-class "block-content-inner")
                                                   first
                                                   first
                                                   util/caret-range)
                                                   util/caret-range)
-                             {:block/keys [content format]} block
+                             {:block/keys [title format]} block
                              content (if (config/db-based-graph? (state/get-current-repo))
                              content (if (config/db-based-graph? (state/get-current-repo))
-                                       (or (:block/title block) content)
-                                       (->> content
+                                       (or (:block/title block) title)
+                                       (->> title
                                             (property-file/remove-built-in-properties-when-file-based
                                             (property-file/remove-built-in-properties-when-file-based
                                              (state/get-current-repo) format)
                                              (state/get-current-repo) format)
                                             (drawer/remove-logbook)))]
                                             (drawer/remove-logbook)))]
@@ -2282,7 +2284,7 @@
                             (or (not collapsed?)
                             (or (not collapsed?)
                                 (some? (mldoc/extract-first-query-from-ast body))))))
                                 (some? (mldoc/extract-first-query-from-ast body))))))
           [:div.block-body
           [:div.block-body
-           (let [body (block/trim-break-lines! (:block/body block))
+           (let [body (block/trim-break-lines! (:block.temp/ast-body block))
                  uuid (:block/uuid block)]
                  uuid (:block/uuid block)]
              (for [[idx child] (medley/indexed body)]
              (for [[idx child] (medley/indexed body)]
                (when-let [block (markup-element-cp config child)]
                (when-let [block (markup-element-cp config child)]
@@ -2326,20 +2328,22 @@
              (pv/property-value block property (get block pid) (assoc opts :show-tooltip? true))))]))))
              (pv/property-value block property (get block pid) (assoc opts :show-tooltip? true))))]))))
 
 
 (rum/defc ^:large-vars/cleanup-todo block-content < rum/reactive
 (rum/defc ^:large-vars/cleanup-todo block-content < rum/reactive
-  [config {:block/keys [uuid content properties scheduled deadline format pre-block?] :as block} edit-input-id block-id slide?]
+  [config {:block/keys [uuid title properties scheduled deadline format pre-block?] :as block} edit-input-id block-id slide?]
   (let [repo (state/get-current-repo)
   (let [repo (state/get-current-repo)
-        content (or (:block/title block)
-                    (if (config/db-based-graph? (state/get-current-repo))
-                      (:block/content block)
-                      (property-util/remove-built-in-properties format content)))
-        {:block/keys [title body] :as block} (if (:block/title block) block
-                                                 (merge block (block/parse-title-and-body uuid format pre-block? content)))
+        content (if (config/db-based-graph? (state/get-current-repo))
+                  (:block/title block)
+                  (property-util/remove-built-in-properties format title))
+        block (merge block (block/parse-title-and-body uuid format pre-block? content))
+        ;; _ (prn :debug :block block
+        ;;        :parsed-result (block/parse-title-and-body uuid format pre-block? content))
+        ast-body (:block.temp/ast-body block)
+        ast-title (:block.temp/ast-title block)
         collapsed? (util/collapsed? block)
         collapsed? (util/collapsed? block)
-        block (assoc block :block/content content)
+        block (assoc block :block/title content)
         plugin-slotted? (and config/lsp-enabled? (state/slot-hook-exist? uuid))
         plugin-slotted? (and config/lsp-enabled? (state/slot-hook-exist? uuid))
         block-ref? (:block-ref? config)
         block-ref? (:block-ref? config)
         stop-events? (:stop-events? config)
         stop-events? (:stop-events? config)
-        block-ref-with-title? (and block-ref? (not (state/show-full-blocks?)) (seq title))
+        block-ref-with-title? (and block-ref? (not (state/show-full-blocks?)) (seq ast-title))
         block-type (or
         block-type (or
                     (pu/lookup properties :logseq.property/ls-type)
                     (pu/lookup properties :logseq.property/ls-type)
                     :default)
                     :default)
@@ -2393,7 +2397,7 @@
             :else
             :else
             (build-block-title config block))])
             (build-block-title config block))])
 
 
-       (file-block/clock-summary-cp block body)]
+       (file-block/clock-summary-cp block ast-body)]
 
 
       (when deadline
       (when deadline
         (when-let [deadline-ast (block-handler/get-deadline-ast block)]
         (when-let [deadline-ast (block-handler/get-deadline-ast block)]
@@ -2410,13 +2414,13 @@
       (when (and (seq properties)
       (when (and (seq properties)
                  (let [hidden? (property-file/properties-hidden? properties)]
                  (let [hidden? (property-file/properties-hidden? properties)]
                    (not hidden?))
                    (not hidden?))
-                 (not (and block-ref? (or (seq title) (seq body))))
+                 (not (and block-ref? (or (seq ast-title) (seq ast-body))))
                  (not (:slide? config))
                  (not (:slide? config))
                  (not= block-type :whiteboard-shape)
                  (not= block-type :whiteboard-shape)
                  (not (config/db-based-graph? repo)))
                  (not (config/db-based-graph? repo)))
         (properties-cp config block))
         (properties-cp config block))
 
 
-      (block-content-inner config block body plugin-slotted? collapsed? block-ref-with-title?)
+      (block-content-inner config block ast-body plugin-slotted? collapsed? block-ref-with-title?)
 
 
       (case (:block/warning block)
       (case (:block/warning block)
         :multiple-blocks
         :multiple-blocks
@@ -2478,7 +2482,7 @@
         editor-id (str "editor-" edit-input-id)
         editor-id (str "editor-" edit-input-id)
         slide? (:slide? config)
         slide? (:slide? config)
         block-reference-only? (some->
         block-reference-only? (some->
-                               (:block/content block)
+                               (:block/title block)
                                string/trim
                                string/trim
                                block-ref/block-ref?)
                                block-ref/block-ref?)
         named? (some? (:block/name block))
         named? (some? (:block/name block))
@@ -2506,10 +2510,10 @@
          [:div.flex.flex-1.w-full.block-content-wrapper {:style {:display (if (:slide? config) "block" "flex")}}
          [:div.flex.flex-1.w-full.block-content-wrapper {:style {:display (if (:slide? config) "block" "flex")}}
           (ui/catch-error
           (ui/catch-error
            (ui/block-error "Block Render Error:"
            (ui/block-error "Block Render Error:"
-                           {:content (:block/content block)
+                           {:content (:block/title block)
                             :section-attrs
                             :section-attrs
                             {:on-click #(let [content (or (:block/title block)
                             {:on-click #(let [content (or (:block/title block)
-                                                          (:block/content block))]
+                                                          (:block/title block))]
                                           (editor-handler/clear-selection!)
                                           (editor-handler/clear-selection!)
                                           (editor-handler/unhighlight-blocks!)
                                           (editor-handler/unhighlight-blocks!)
                                           (state/set-editing! edit-input-id content block "" {:container-id (:container-id config)}))}})
                                           (state/set-editing! edit-input-id content block "" {:container-id (:container-id config)}))}})
@@ -2559,7 +2563,7 @@
                 :block? true
                 :block? true
                 :editor-box (state/get-component :editor/box)
                 :editor-box (state/get-component :editor/box)
                 :in-whiteboard? true}]
                 :in-whiteboard? true}]
-    (when (:block/content block)
+    (when (:block/title block)
       [:div.single-block
       [:div.single-block
        (block-container config block)])))
        (block-container config block)])))
 
 
@@ -2644,20 +2648,22 @@
                                  (page-cp (dissoc config :breadcrumb? true) page)
                                  (page-cp (dissoc config :breadcrumb? true) page)
                                  {:block/name (or page-title page-name)}])
                                  {:block/name (or page-title page-name)}])
               parents-props (doall
               parents-props (doall
-                             (for [{:block/keys [uuid name content] :as block} parents]
+                             (for [{:block/keys [uuid name title] :as block} parents]
                                (if name
                                (if name
                                  [block (page-cp {} block)]
                                  [block (page-cp {} block)]
-                                 (let [{:block/keys [title body]} (block/parse-title-and-body
+                                 (let [result (block/parse-title-and-body
                                                                    uuid
                                                                    uuid
                                                                    (:block/format block)
                                                                    (:block/format block)
                                                                    (:block/pre-block? block)
                                                                    (:block/pre-block? block)
-                                                                   content)
+                                                                   title)
+                                       ast-body (:block.temp/ast-body result)
+                                       ast-title (:block.temp/ast-title result)
                                        config (assoc config :block/uuid uuid)]
                                        config (assoc config :block/uuid uuid)]
                                    [block
                                    [block
-                                    (when title
-                                      (if (seq title)
-                                        (->elem :span.inline-wrap (map-inline config title))
-                                        (->elem :div (markup-elements-cp config body))))]))))
+                                    (when ast-title
+                                      (if (seq ast-title)
+                                        (->elem :span.inline-wrap (map-inline config ast-title))
+                                        (->elem :div (markup-elements-cp config ast-body))))]))))
               breadcrumb (->> (into [] parents-props)
               breadcrumb (->> (into [] parents-props)
                               (concat [page-name-props] (when more? [:more]))
                               (concat [page-name-props] (when more? [:more]))
                               (filterv identity)
                               (filterv identity)
@@ -2895,7 +2901,7 @@
         custom-query? (boolean (:custom-query? config*))
         custom-query? (boolean (:custom-query? config*))
         ref-or-custom-query? (or ref? custom-query?)
         ref-or-custom-query? (or ref? custom-query?)
         *navigating-block (get container-state ::navigating-block)
         *navigating-block (get container-state ::navigating-block)
-        {:block/keys [uuid pre-block? content]} block
+        {:block/keys [uuid pre-block? title]} block
         config (build-config config* block {:navigated? navigated? :navigating-block navigating-block})
         config (build-config config* block {:navigated? navigated? :navigating-block navigating-block})
         level (:level config)
         level (:level config)
         *control-show? (get container-state ::control-show?)
         *control-show? (get container-state ::control-show?)
@@ -2935,7 +2941,7 @@
                    (when selected? " selected")
                    (when selected? " selected")
                    (when pre-block? " pre-block")
                    (when pre-block? " pre-block")
                    (when order-list? " is-order-list")
                    (when order-list? " is-order-list")
-                   (when (string/blank? content) " is-blank")
+                   (when (string/blank? title) " is-blank")
                    (when original-block " embed-block"))
                    (when original-block " embed-block"))
        :haschild (str (boolean has-child?))}
        :haschild (str (boolean has-child?))}
 
 
@@ -2996,7 +3002,7 @@
         (block-reference {} (str uuid) nil)
         (block-reference {} (str uuid) nil)
         ;; Not embed self
         ;; Not embed self
         [:div.flex.flex-col.w-full
         [:div.flex.flex-col.w-full
-         (let [block (merge block (block/parse-title-and-body uuid (:block/format block) pre-block? content))
+         (let [block (merge block (block/parse-title-and-body uuid (:block/format block) pre-block? title))
                hide-block-refs-count? (or (and (:embed? config)
                hide-block-refs-count? (or (and (:embed? config)
                                            (= (:block/uuid block) (:embed-id config)))
                                            (= (:block/uuid block) (:embed-id config)))
                                           table?)]
                                           table?)]

+ 1 - 1
src/main/frontend/components/block/macros.cljs

@@ -33,7 +33,7 @@
          ;; These keyword aliases should be the same as those used in the query-table for sorting
          ;; These keyword aliases should be the same as those used in the query-table for sorting
          (case f
          (case f
            :block
            :block
-           :block/content
+           :block/title
 
 
            :page
            :page
            :block/name
            :block/name

+ 4 - 4
src/main/frontend/components/cmdk/core.cljs

@@ -281,7 +281,7 @@
                          (let [id (:block/uuid block)]
                          (let [id (:block/uuid block)]
                            {:icon "block"
                            {:icon "block"
                             :icon-theme :gray
                             :icon-theme :gray
-                            :text (highlight-content-query (:block/content block) @!input)
+                            :text (highlight-content-query (:block/title block) @!input)
                             :header (block/breadcrumb {:search? true} repo id {})
                             :header (block/breadcrumb {:search? true} repo id {})
                             :current-page? (when-let [page-id (:block/page block)]
                             :current-page? (when-let [page-id (:block/page block)]
                                              (= page-id (:block/uuid current-page)))
                                              (= page-id (:block/uuid current-page)))
@@ -367,7 +367,7 @@
                                       (uuid (:block/uuid block)))]
                                       (uuid (:block/uuid block)))]
                              {:icon "block"
                              {:icon "block"
                               :icon-theme :gray
                               :icon-theme :gray
-                              :text (highlight-content-query (:block/content block) @!input)
+                              :text (highlight-content-query (:block/title block) @!input)
                               :header (block/breadcrumb {:search? true} repo id {})
                               :header (block/breadcrumb {:search? true} repo id {})
                               :current-page? true
                               :current-page? true
                               :source-block block})) blocks)]
                               :source-block block})) blocks)]
@@ -705,7 +705,7 @@
               link (if (config/db-based-graph? repo)
               link (if (config/db-based-graph? repo)
                      (some (fn [[k v]]
                      (some (fn [[k v]]
                              (when (= :url (get-in (db/entity repo k) [:block/schema :type]))
                              (when (= :url (get-in (db/entity repo k) [:block/schema :type]))
-                               (:block/content v)))
+                               (:block/title v)))
                            (:block/properties page'))
                            (:block/properties page'))
                      (some #(re-find editor-handler/url-regex (val %)) (:block/properties page')))]
                      (some #(re-find editor-handler/url-regex (val %)) (:block/properties page')))]
         (if link
         (if link
@@ -716,7 +716,7 @@
       (p/let [block-id (:block/uuid (:source-block item))
       (p/let [block-id (:block/uuid (:source-block item))
               _ (db-async/<get-block repo block-id :children? false)
               _ (db-async/<get-block repo block-id :children? false)
               block (db/entity [:block/uuid block-id])
               block (db/entity [:block/uuid block-id])
-              link (re-find editor-handler/url-regex (:block/content block))]
+              link (re-find editor-handler/url-regex (:block/title block))]
         (if link
         (if link
           (js/window.open link)
           (js/window.open link)
           (notification/show! "No link found in this block's content." :warning)))
           (notification/show! "No link found in this block's content." :warning)))

+ 1 - 1
src/main/frontend/components/content.cljs

@@ -332,7 +332,7 @@
                {:key "(Dev) Show block AST"
                {:key "(Dev) Show block AST"
                 :on-click (fn []
                 :on-click (fn []
                             (let [block (db/pull [:block/uuid block-id])]
                             (let [block (db/pull [:block/uuid block-id])]
-                              (dev-common-handler/show-content-ast (:block/content block) (:block/format block))))}
+                              (dev-common-handler/show-content-ast (:block/title block) (:block/format block))))}
                (t :dev/show-block-ast))
                (t :dev/show-block-ast))
               (shui/dropdown-menu-item
               (shui/dropdown-menu-item
                {:key "(Dev) Show block content history"
                {:key "(Dev) Show block content history"

+ 2 - 2
src/main/frontend/components/editor.cljs

@@ -250,7 +250,7 @@
                  state)}
                  state)}
   [state _edit-block input id q format selected-text]
   [state _edit-block input id q format selected-text]
   (let [result (->> (rum/react (get state ::result))
   (let [result (->> (rum/react (get state ::result))
-                    (remove (fn [b] (string/blank? (:block/content (db-model/query-block-by-uuid (:block/uuid b)))))))
+                    (remove (fn [b] (string/blank? (:block/title (db-model/query-block-by-uuid (:block/uuid b)))))))
         db? (config/db-based-graph? (state/get-current-repo))
         db? (config/db-based-graph? (state/get-current-repo))
         embed? (and db? (= @commands/*current-command "Block embed"))
         embed? (and db? (= @commands/*current-command "Block embed"))
         chosen-handler (block-on-chosen-handler embed? input id q format selected-text)
         chosen-handler (block-on-chosen-handler embed? input id q format selected-text)
@@ -265,7 +265,7 @@
                            repo (state/sub :git/current-repo)
                            repo (state/sub :git/current-repo)
                            format (get page-entity :block/format :markdown)
                            format (get page-entity :block/format :markdown)
                            block (db-model/query-block-by-uuid uuid)
                            block (db-model/query-block-by-uuid uuid)
-                           content (:block/content block)]
+                           content (:block/title block)]
                        (when-not (string/blank? content)
                        (when-not (string/blank? content)
                          [:.py-2 (search/block-search-result-item repo uuid format content q :block)])))
                          [:.py-2 (search/block-search-result-item repo uuid format content q :block)])))
       :class       "ac-block-search"})))
       :class       "ac-block-search"})))

+ 2 - 2
src/main/frontend/components/imports.cljs

@@ -215,7 +215,7 @@
        :on-key-down (fn [e]
        :on-key-down (fn [e]
                       (when (= "Enter" (util/ekey e))
                       (when (= "Enter" (util/ekey e))
                         (on-submit)))})
                         (on-submit)))})
-     
+
      [:div.sm:flex.sm:items-start
      [:div.sm:flex.sm:items-start
       [:div.mt-3.text-center.sm:mt-0.sm:text-left
       [:div.mt-3.text-center.sm:mt-0.sm:text-left
        [:h3#modal-headline.leading-6.font-medium
        [:h3#modal-headline.leading-6.font-medium
@@ -237,7 +237,7 @@
   [entities]
   [entities]
   {:entities (count entities)
   {:entities (count entities)
    :pages (count (filter :block/name entities))
    :pages (count (filter :block/name entities))
-   :blocks (count (filter :block/content entities))
+   :blocks (count (filter :block/title entities))
    :classes (count (filter #(contains? (:block/type %) "class") entities))
    :classes (count (filter #(contains? (:block/type %) "class") entities))
    :objects (count (filter #(seq (:block/tags %)) entities))
    :objects (count (filter #(seq (:block/tags %)) entities))
    :properties (count (filter #(contains? (:block/type %) "property") entities))
    :properties (count (filter #(contains? (:block/type %) "property") entities))

+ 1 - 1
src/main/frontend/components/page.cljs

@@ -86,7 +86,7 @@
            (or preview?
            (or preview?
                (not (contains? #{:home :all-journals} (state/get-current-route))))
                (not (contains? #{:home :all-journals} (state/get-current-route))))
            (not sidebar?))
            (not sidebar?))
-      (when (and (string/blank? (:block/content block))
+      (when (and (string/blank? (:block/title block))
                  (not preview?))
                  (not preview?))
         (editor-handler/edit-block! block :max))))
         (editor-handler/edit-block! block :max))))
   state)
   state)

+ 3 - 3
src/main/frontend/components/property/value.cljs

@@ -310,7 +310,7 @@
 (defn- get-title
 (defn- get-title
   [e]
   [e]
   (or (:block/title e)
   (or (:block/title e)
-      (:block/content e)))
+      (:block/title e)))
 
 
 (rum/defc select-page < rum/reactive db-mixins/query
 (rum/defc select-page < rum/reactive db-mixins/query
   [property
   [property
@@ -612,7 +612,7 @@
        (when-some [content (if (some? (:property.value/content value))
        (when-some [content (if (some? (:property.value/content value))
                              ;; content needs to be a string for display purposes
                              ;; content needs to be a string for display purposes
                              (str (:property.value/content value))
                              (str (:property.value/content value))
-                             (:block/content value))]
+                             (:block/title value))]
          (inline-text-cp content))
          (inline-text-cp content))
 
 
        :else
        :else
@@ -682,7 +682,7 @@
                   (when (and (= type :default) (nil? value))
                   (when (and (= type :default) (nil? value))
                     (<create-new-block! block property "")))}
                     (<create-new-block! block property "")))}
      (cond
      (cond
-       (and (= type :default) (nil? (:block/content value)))
+       (and (= type :default) (nil? (:block/title value)))
        [:div.jtrigger (property-empty-btn-value)]
        [:div.jtrigger (property-empty-btn-value)]
 
 
        (= type :default)
        (= type :default)

+ 1 - 1
src/main/frontend/components/query/builder.cljs

@@ -521,7 +521,7 @@
                                                  repo (state/get-current-repo)
                                                  repo (state/get-current-repo)
                                                  block (db/pull [:block/uuid (:block/uuid block)])]
                                                  block (db/pull [:block/uuid (:block/uuid block)])]
                                              (when block
                                              (when block
-                                               (let [content (string/replace (:block/content block)
+                                               (let [content (string/replace (:block/title block)
                                                                              #"\{\{query[^}]+\}\}"
                                                                              #"\{\{query[^}]+\}\}"
                                                                              (util/format "{{query %s}}" q))]
                                                                              (util/format "{{query %s}}" q))]
                                                  (editor-handler/save-block! repo (:block/uuid block) content)))))))
                                                  (editor-handler/save-block! repo (:block/uuid block) content)))))))

+ 6 - 6
src/main/frontend/components/query_table.cljs

@@ -29,7 +29,7 @@
   (let [ks [:block/properties :clock-time]
   (let [ks [:block/properties :clock-time]
         result (map (fn [b]
         result (map (fn [b]
                       (let [b (block/parse-title-and-body b)]
                       (let [b (block/parse-title-and-body b)]
-                        (assoc-in b ks (or (clock/clock-summary (:block/body b) false) 0))))
+                        (assoc-in b ks (or (clock/clock-summary (:block.temp/ast-body b) false) 0))))
                     result)]
                     result)]
     (if (every? #(zero? (get-in % ks)) result)
     (if (every? #(zero? (get-in % ks)) result)
       (map #(medley/dissoc-in % ks) result)
       (map #(medley/dissoc-in % ks) result)
@@ -42,7 +42,7 @@
     :updated-at
     :updated-at
     (:block/updated-at item)
     (:block/updated-at item)
     :block
     :block
-    (:block/content item)
+    (:block/title item)
     :page
     :page
     (if page? (:block/name item) (get-in item [:block/page :block/name]))
     (if page? (:block/name item) (get-in item [:block/page :block/name]))
     (if db-graph?
     (if db-graph?
@@ -88,7 +88,7 @@
         ;; Starting with #6105, we started putting properties under namespaces.
         ;; Starting with #6105, we started putting properties under namespaces.
         nlp-date? (and (not db-graph?) (:logseq.query/nlp-date properties))
         nlp-date? (and (not db-graph?) (:logseq.query/nlp-date properties))
         sort-by-column (or (keyword query-sort-by)
         sort-by-column (or (keyword query-sort-by)
-                           (if (query-dsl/query-contains-filter? (:block/content current-block) "sort-by")
+                           (if (query-dsl/query-contains-filter? (:block/title current-block) "sort-by")
                              nil
                              nil
                              :updated-at))]
                              :updated-at))]
     {:sort-desc? desc?
     {:sort-desc? desc?
@@ -163,7 +163,7 @@
                    (get-in row [:block/page :block/name])))]
                    (get-in row [:block/page :block/name])))]
 
 
     :block       ; block title
     :block       ; block title
-    (let [content (:block/content row)
+    (let [content (:block/title row)
           uuid (:block/uuid row)
           uuid (:block/uuid row)
           {:block/keys [title]} (block/parse-title-and-body
           {:block/keys [title]} (block/parse-title-and-body
                                  (:block/uuid row)
                                  (:block/uuid row)
@@ -283,8 +283,8 @@
           result' (cond-> (if page? result (attach-clock-property result))
           result' (cond-> (if page? result (attach-clock-property result))
                     db-graph?
                     db-graph?
                     ((fn [res]
                     ((fn [res]
-                       (map #(if (:block/content %)
-                               (update % :block/content
+                       (map #(if (:block/title %)
+                               (update % :block/title
                                  db-content/special-id-ref->page-ref
                                  db-content/special-id-ref->page-ref
                                  ;; Lookup here instead of initial query as advanced queries
                                  ;; Lookup here instead of initial query as advanced queries
                                  ;; won't usually have a ref's name
                                  ;; won't usually have a ref's name

+ 4 - 4
src/main/frontend/components/views.cljs

@@ -140,7 +140,7 @@
                     (row-checkbox table row column))
                     (row-checkbox table row column))
             :column-list? false}
             :column-list? false}
            (when with-object-name?
            (when with-object-name?
-             {:id :object/name
+             {:id :block/title
               :name "Name"
               :name "Name"
               :type :string
               :type :string
               :header header-cp
               :header header-cp
@@ -226,7 +226,7 @@
   (case (:id column)
   (case (:id column)
     :select 32
     :select 32
     :add-property 160
     :add-property 160
-    (:object/name :block/title :block/name :block/content) 360
+    (:block/title :block/name) 360
     (:block/created-at :block/updated-at) 160
     (:block/created-at :block/updated-at) 160
     180))
     180))
 
 
@@ -713,7 +713,7 @@
        (map-indexed
        (map-indexed
         (fn [idx filter]
         (fn [idx filter]
           (let [[property-ident operator value] filter
           (let [[property-ident operator value] filter
-                property (if (= property-ident :object/name)
+                property (if (= property-ident :block/title)
                            {:db/ident property-ident
                            {:db/ident property-ident
                             :block/title "Name"}
                             :block/title "Name"}
                            (or (db/entity property-ident)
                            (or (db/entity property-ident)
@@ -751,7 +751,7 @@
    (if (string/blank? input)
    (if (string/blank? input)
      true
      true
      (when row
      (when row
-       (fuzzy-matched? input (:object/name row))))
+       (fuzzy-matched? input (:block/title row))))
    ;; filters check
    ;; filters check
    (every?
    (every?
     (fn [[property-ident operator match]]
     (fn [[property-ident operator match]]

+ 2 - 2
src/main/frontend/db/model.cljs

@@ -148,7 +148,7 @@ independent of format as format specific heading characters are stripped"
                   [?page :block/uuid ?page-uuid]
                   [?page :block/uuid ?page-uuid]
                   [?b :block/page ?page]
                   [?b :block/page ?page]
                   (has-property ?b :logseq.property/heading)
                   (has-property ?b :logseq.property/heading)
-                  [?b :block/content ?content]
+                  [?b :block/title ?content]
                   [(?content-matches ?content ?route-name ?b)]]
                   [(?content-matches ?content ?route-name ?b)]]
                 db
                 db
                 (uuid page-uuid-str)
                 (uuid page-uuid-str)
@@ -171,7 +171,7 @@ independent of format as format specific heading characters are stripped"
                   [?b :block/page ?page]
                   [?b :block/page ?page]
                   [?b :block/properties ?prop]
                   [?b :block/properties ?prop]
                   [(get ?prop :heading) _]
                   [(get ?prop :heading) _]
-                  [?b :block/content ?content]
+                  [?b :block/title ?content]
                   [(?content-matches ?content ?route-name)]]
                   [(?content-matches ?content ?route-name)]]
                 db
                 db
                 (uuid page-uuid-str)
                 (uuid page-uuid-str)

+ 1 - 1
src/main/frontend/extensions/pdf/assets.cljs

@@ -201,7 +201,7 @@
    (p/let [ref-page (when pdf-current (ensure-ref-page! pdf-current))]
    (p/let [ref-page (when pdf-current (ensure-ref-page! pdf-current))]
      (when ref-page
      (when ref-page
        (let [ref-block (db-model/query-block-by-uuid id)]
        (let [ref-block (db-model/query-block-by-uuid id)]
-         (if-not (nil? (:block/content ref-block))
+         (if-not (nil? (:block/title ref-block))
            (do
            (do
              (println "[existed ref block]" ref-block)
              (println "[existed ref block]" ref-block)
              ref-block)
              ref-block)

+ 3 - 3
src/main/frontend/extensions/srs.cljs

@@ -112,7 +112,7 @@
   (editor-handler/save-block-if-changed!
   (editor-handler/save-block-if-changed!
    block
    block
    (property-file/insert-properties-when-file-based
    (property-file/insert-properties-when-file-based
-    (state/get-current-repo) (:block/format block) (:block/content block) props)
+    (state/get-current-repo) (:block/format block) (:block/title block) props)
    {:force? true}))
    {:force? true}))
 
 
 (defn- reset-block-card-properties!
 (defn- reset-block-card-properties!
@@ -207,7 +207,7 @@
 
 
 (defn- has-cloze?
 (defn- has-cloze?
   [blocks]
   [blocks]
-  (->> (map :block/content blocks)
+  (->> (map :block/title blocks)
        (some #(string/includes? % "{{cloze "))))
        (some #(string/includes? % "{{cloze "))))
 
 
 (defn- clear-collapsed-property
 (defn- clear-collapsed-property
@@ -783,7 +783,7 @@
   "given a block struct, adds the #card to title and returns
   "given a block struct, adds the #card to title and returns
    a seq of [original-block new-content-string]"
    a seq of [original-block new-content-string]"
   [block]
   [block]
-    (when-let [content (:block/content block)]
+    (when-let [content (:block/title block)]
       (let [format (:block/format block)
       (let [format (:block/format block)
             content (-> (property-file/remove-built-in-properties-when-file-based
             content (-> (property-file/remove-built-in-properties-when-file-based
                          (state/get-current-repo) (:block/format block) content)
                          (state/get-current-repo) (:block/format block) content)

+ 1 - 1
src/main/frontend/extensions/tldraw.cljs

@@ -76,7 +76,7 @@
             blocks (map (fn [b]
             blocks (map (fn [b]
                           (-> b
                           (-> b
                               (update :block/uuid str)
                               (update :block/uuid str)
-                              (update :block/content #(->> (text-util/cut-by % "$pfts_2lqh>$" "$<pfts_2lqh$")
+                              (update :block/title #(->> (text-util/cut-by % "$pfts_2lqh>$" "$<pfts_2lqh$")
                                                            (apply str))))) blocks)
                                                            (apply str))))) blocks)
             pages (when pages? (search/page-search q))]
             pages (when pages? (search/page-search q))]
       (clj->js {:pages pages :blocks blocks}))))
       (clj->js {:pages pages :blocks blocks}))))

+ 7 - 8
src/main/frontend/external/roam_export.cljs

@@ -44,18 +44,18 @@
       content
       content
       uuids))))
       uuids))))
 
 
-(defn update-uid [{:block/keys [uuid content] :as b}
+(defn update-uid [{:block/keys [uuid title] :as b}
                   uuid->uid-map]
                   uuid->uid-map]
   (cond-> b
   (cond-> b
     (contains? uuid->uid-map uuid)
     (contains? uuid->uid-map uuid)
     (assoc :block/uid (get uuid->uid-map uuid))
     (assoc :block/uid (get uuid->uid-map uuid))
 
 
-    (some (fn [id] (str/includes? (str content) (str id))) (keys uuid->uid-map))
-    (update :block/content #(update-content % uuid->uid-map))))
+    (some (fn [id] (str/includes? (str title) (str id))) (keys uuid->uid-map))
+    (update :block/title #(update-content % uuid->uid-map))))
 
 
-(defn update-todo [{:block/keys [content] :as block}]
-  (if content
-    (update block :block/content
+(defn update-todo [{:block/keys [title] :as block}]
+  (if title
+    (update block :block/title
             (fn [c]
             (fn [c]
               (-> c
               (-> c
                   (str/replace todo-marker-regex "{{[[TODO]]}}")
                   (str/replace todo-marker-regex "{{[[TODO]]}}")
@@ -77,8 +77,7 @@
 
 
              (update-todo)
              (update-todo)
 
 
-             (s/rename-keys {:block/title :page/title
-                             :block/content :block/string})
+             (s/rename-keys {:block/title :page/title})
 
 
              (select-keys keyseq))
              (select-keys keyseq))
 
 

+ 8 - 8
src/main/frontend/format/block.cljs

@@ -68,19 +68,19 @@ and handles unexpected failure."
        (first)))
        (first)))
 
 
 (defn parse-block
 (defn parse-block
-  [{:block/keys [uuid content format] :as block}]
-  (when-not (string/blank? content)
+  [{:block/keys [uuid title format] :as block}]
+  (when-not (string/blank? title)
     (let [block (dissoc block :block/pre-block?)
     (let [block (dissoc block :block/pre-block?)
           format (or format :markdown)
           format (or format :markdown)
           parse-config (mldoc/get-default-config format)
           parse-config (mldoc/get-default-config format)
-          ast (format/to-edn content format parse-config)
-          blocks (extract-blocks ast content format {})
+          ast (format/to-edn title format parse-config)
+          blocks (extract-blocks ast title format {})
           new-block (first blocks)
           new-block (first blocks)
           block (cond->
           block (cond->
                  (merge block new-block)
                  (merge block new-block)
                   (> (count blocks) 1)
                   (> (count blocks) 1)
                   (assoc :block/warning :multiple-blocks))
                   (assoc :block/warning :multiple-blocks))
-          block (dissoc block :block/body :block/level)]
+          block (dissoc block :block.temp/ast-body :block/level)]
       (if uuid (assoc block :block/uuid uuid) block))))
       (if uuid (assoc block :block/uuid uuid) block))))
 
 
 (defn parse-title-and-body
 (defn parse-title-and-body
@@ -90,7 +90,7 @@ and handles unexpected failure."
             (parse-title-and-body (:block/uuid block)
             (parse-title-and-body (:block/uuid block)
                                   (:block/format block)
                                   (:block/format block)
                                   (:block/pre-block? block)
                                   (:block/pre-block? block)
-                                  (:block/content block)))))
+                                  (:block/title block)))))
   ([block-uuid format pre-block? content]
   ([block-uuid format pre-block? content]
    (when-not (string/blank? content)
    (when-not (string/blank? content)
      (let [content (if pre-block? content
      (let [content (if pre-block? content
@@ -105,9 +105,9 @@ and handles unexpected failure."
                body (vec (if title (rest ast) ast))
                body (vec (if title (rest ast) ast))
                body (drop-while gp-property/properties-ast? body)
                body (drop-while gp-property/properties-ast? body)
                result (cond->
                result (cond->
-                       (if (seq body) {:block/body body} {})
+                       (if (seq body) {:block.temp/ast-body body} {})
                         title
                         title
-                        (assoc :block/title title))]
+                        (assoc :block.temp/ast-title title))]
            (state/add-block-ast-cache! block-uuid content result)
            (state/add-block-ast-cache! block-uuid content result)
            result))))))
            result))))))
 
 

+ 2 - 2
src/main/frontend/fs/diff_merge.cljs

@@ -30,11 +30,11 @@
   [page-name]
   [page-name]
   {:pre (string? page-name)}
   {:pre (string? page-name)}
   (let [walked (db-model/get-sorted-page-block-ids-and-levels page-name)
   (let [walked (db-model/get-sorted-page-block-ids-and-levels page-name)
-        blocks (db-utils/pull-many [:block/uuid :block/content :block/level] (map :id walked))
+        blocks (db-utils/pull-many [:block/uuid :block/title :block/level] (map :id walked))
         levels (map :level walked)
         levels (map :level walked)
         blocks (map (fn [block level]
         blocks (map (fn [block level]
                       {:uuid   (str (:block/uuid block)) ;; Force to be string
                       {:uuid   (str (:block/uuid block)) ;; Force to be string
-                       :body   (:block/content block)
+                       :body   (:block/title block)
                        :level  level})
                        :level  level})
                     blocks levels)]
                     blocks levels)]
     blocks))
     blocks))

+ 2 - 2
src/main/frontend/handler/block.cljs

@@ -35,7 +35,7 @@
        (if (check? x)
        (if (check? x)
          (reset! result (transform x))
          (reset! result (transform x))
          x))
          x))
-     (:block/body block))
+     (:block.temp/ast-body block))
     @result))
     @result))
 
 
 (defn get-timestamp
 (defn get-timestamp
@@ -200,7 +200,7 @@
              block (or (db/entity [:block/uuid block-id]) block)
              block (or (db/entity [:block/uuid block-id]) block)
              content (if (and db-graph? (:block/name block))
              content (if (and db-graph? (:block/name block))
                        (:block/title block)
                        (:block/title block)
-                       (or custom-content (:block/content block) ""))
+                       (or custom-content (:block/title block) ""))
              content-length (count content)
              content-length (count content)
              text-range (cond
              text-range (cond
                           (vector? pos)
                           (vector? pos)

+ 1 - 1
src/main/frontend/handler/code.cljs

@@ -29,7 +29,7 @@
             ;; save block content
             ;; save block content
             (:block/uuid config)
             (:block/uuid config)
             (let [block (db/pull [:block/uuid (:block/uuid config)])
             (let [block (db/pull [:block/uuid (:block/uuid config)])
-                  content (:block/content block)
+                  content (:block/title block)
                   {:keys [start_pos end_pos]} (:pos_meta @(:code-options state))
                   {:keys [start_pos end_pos]} (:pos_meta @(:code-options state))
                   offset (if (:block/pre-block? block) 0 2)
                   offset (if (:block/pre-block? block) 0 2)
                   raw-content (utf8/encode content) ;; NOTE: :pos_meta is based on byte position
                   raw-content (utf8/encode content) ;; NOTE: :pos_meta is based on byte position

+ 2 - 2
src/main/frontend/handler/common/developer.cljs

@@ -70,8 +70,8 @@
     (notification/show! "No block found" :warning)))
     (notification/show! "No block found" :warning)))
 
 
 (defn ^:export show-block-ast []
 (defn ^:export show-block-ast []
-  (if-let [{:block/keys [content format]} (:block (first (state/get-editor-args)))]
-    (show-content-ast content format)
+  (if-let [{:block/keys [title format]} (:block (first (state/get-editor-args)))]
+    (show-content-ast title format)
     (notification/show! "No block found" :warning)))
     (notification/show! "No block found" :warning)))
 
 
 (defn ^:export show-page-data []
 (defn ^:export show-page-data []

+ 16 - 16
src/main/frontend/handler/db_based/editor.cljs

@@ -61,7 +61,7 @@
 
 
 (defn- replace-page-refs-with-ids
 (defn- replace-page-refs-with-ids
   [block]
   [block]
-  (let [content (:block/content block)
+  (let [content (:block/title block)
         content' (if (some :block/name (:block/refs block))
         content' (if (some :block/name (:block/refs block))
                    (reduce
                    (reduce
                     (fn [content {:block/keys [title uuid]}]
                     (fn [content {:block/keys [title uuid]}]
@@ -69,34 +69,34 @@
                     content
                     content
                     (filter :block/name (:block/refs block)))
                     (filter :block/name (:block/refs block)))
                    content)]
                    content)]
-    (assoc block :block/content content')))
+    (assoc block :block/title content')))
 
 
 (defn wrap-parse-block
 (defn wrap-parse-block
-  [{:block/keys [content level] :as block}]
+  [{:block/keys [title level] :as block}]
   (let [block (or (and (:db/id block) (db/pull (:db/id block))) block)
   (let [block (or (and (:db/id block) (db/pull (:db/id block))) block)
-        block (if (nil? content)
+        block (if (nil? title)
                 block
                 block
-                (let [ast (mldoc/->edn (string/trim content) :markdown)
+                (let [ast (mldoc/->edn (string/trim title) :markdown)
                       first-elem-type (first (ffirst ast))
                       first-elem-type (first (ffirst ast))
                       block-with-title? (mldoc/block-with-title? first-elem-type)
                       block-with-title? (mldoc/block-with-title? first-elem-type)
-                      content' (str (config/get-block-pattern :markdown) (if block-with-title? " " "\n") content)
-                      parsed-block (block/parse-block (assoc block :block/content content'))
+                      content' (str (config/get-block-pattern :markdown) (if block-with-title? " " "\n") title)
+                      parsed-block (block/parse-block (assoc block :block/title content'))
                       parsed-block' (cond-> (dissoc parsed-block :block/properties)
                       parsed-block' (cond-> (dissoc parsed-block :block/properties)
                                       (:block/properties parsed-block)
                                       (:block/properties parsed-block)
                                       (merge (update-keys (:block/properties parsed-block)
                                       (merge (update-keys (:block/properties parsed-block)
                                                           (fn [k]
                                                           (fn [k]
                                                             (or ({:heading :logseq.property/heading} k)
                                                             (or ({:heading :logseq.property/heading} k)
                                                                 (throw (ex-info (str "Don't know how to save graph-parser property " (pr-str k)) {})))))))
                                                                 (throw (ex-info (str "Don't know how to save graph-parser property " (pr-str k)) {})))))))
-                      block' (merge block parsed-block' {:block/content content})]
+                      block' (merge block parsed-block' {:block/title title})]
                   (update block' :block/refs remove-non-existed-refs!)))
                   (update block' :block/refs remove-non-existed-refs!)))
         result (-> block
         result (-> block
                    (merge (if level {:block/level level} {}))
                    (merge (if level {:block/level level} {}))
                    (replace-page-refs-with-ids))]
                    (replace-page-refs-with-ids))]
     (-> result
     (-> result
         ;; Remove tags from content
         ;; Remove tags from content
-        (assoc :block/content
+        (assoc :block/title
                (db-content/content-without-tags
                (db-content/content-without-tags
-                (:block/content result)
+                (:block/title result)
                 (->>
                 (->>
                  (map
                  (map
                   (fn [tag]
                   (fn [tag]
@@ -143,24 +143,24 @@
 
 
       (and (or (nil? heading) (true? heading))
       (and (or (nil? heading) (true? heading))
            (number? old-heading))
            (number? old-heading))
-      (let [content (commands/clear-markdown-heading (:block/content block))]
-        {:block/content content
+      (let [content (commands/clear-markdown-heading (:block/title block))]
+        {:block/title content
          :block/uuid (:block/uuid block)})
          :block/uuid (:block/uuid block)})
 
 
       (and (or (nil? old-heading) (true? old-heading))
       (and (or (nil? old-heading) (true? old-heading))
            (number? heading))
            (number? heading))
-      (let [content (commands/set-markdown-heading (:block/content block) heading)]
-        {:block/content content
+      (let [content (commands/set-markdown-heading (:block/title block) heading)]
+        {:block/title content
          :block/uuid (:block/uuid block)})
          :block/uuid (:block/uuid block)})
 
 
         ;; heading-num1 -> heading-num2
         ;; heading-num1 -> heading-num2
       :else
       :else
       (let [content (-> block
       (let [content (-> block
-                        :block/content
+                        :block/title
                         commands/clear-markdown-heading
                         commands/clear-markdown-heading
                         (commands/set-markdown-heading heading))]
                         (commands/set-markdown-heading heading))]
         {:block/uuid (:block/uuid block)
         {:block/uuid (:block/uuid block)
-         :block/content content}))))
+         :block/title content}))))
 
 
 (defn batch-set-heading!
 (defn batch-set-heading!
   [repo block-ids heading]
   [repo block-ids heading]

+ 50 - 50
src/main/frontend/handler/editor.cljs

@@ -261,7 +261,7 @@
   [block value opts]
   [block value opts]
   (let [block {:db/id (:db/id block)
   (let [block {:db/id (:db/id block)
                :block/uuid (:block/uuid block)
                :block/uuid (:block/uuid block)
-               :block/content value}
+               :block/title value}
         block' (-> (wrap-parse-block block)
         block' (-> (wrap-parse-block block)
                    ;; :block/uuid might be changed when backspace/delete
                    ;; :block/uuid might be changed when backspace/delete
                    ;; a block that has been refed
                    ;; a block that has been refed
@@ -284,15 +284,15 @@
   ([block value
   ([block value
     {:keys [force?]
     {:keys [force?]
      :as opts}]
      :as opts}]
-   (let [{:block/keys [uuid page format repo content properties]} block
+   (let [{:block/keys [uuid page format repo title properties]} block
          repo (or repo (state/get-current-repo))
          repo (or repo (state/get-current-repo))
          format (or format (state/get-preferred-format))
          format (or format (state/get-preferred-format))
          page (db/entity repo (:db/id page))
          page (db/entity repo (:db/id page))
          block-id (when (and (not (config/db-based-graph? repo)) (map? properties))
          block-id (when (and (not (config/db-based-graph? repo)) (map? properties))
                     (get properties :id))
                     (get properties :id))
          content (if (config/db-based-graph? repo)
          content (if (config/db-based-graph? repo)
-                   content
-                   (-> (property-file/remove-built-in-properties-when-file-based repo format content)
+                   title
+                   (-> (property-file/remove-built-in-properties-when-file-based repo format title)
                      (drawer/remove-logbook)))]
                      (drawer/remove-logbook)))]
      (cond
      (cond
        (another-block-with-same-id-exists? uuid block-id)
        (another-block-with-same-id-exists? uuid block-id)
@@ -359,7 +359,7 @@
         input (gdom/getElement edit-input-id)
         input (gdom/getElement edit-input-id)
         input-text-selected? (util/input-text-selected? input)
         input-text-selected? (util/input-text-selected? input)
         new-m {:block/uuid (db/new-block-id)
         new-m {:block/uuid (db/new-block-id)
-               :block/content ""}
+               :block/title ""}
         prev-block (-> (merge (select-keys block [:block/parent :block/format :block/page])
         prev-block (-> (merge (select-keys block [:block/parent :block/format :block/page])
                               new-m)
                               new-m)
                        (wrap-parse-block))
                        (wrap-parse-block))
@@ -385,10 +385,10 @@
         selection-start (util/get-selection-start input)
         selection-start (util/get-selection-start input)
         selection-end (util/get-selection-end input)
         selection-end (util/get-selection-end input)
         [fst-block-text snd-block-text] (compute-fst-snd-block-text value selection-start selection-end)
         [fst-block-text snd-block-text] (compute-fst-snd-block-text value selection-start selection-end)
-        current-block (assoc block :block/content fst-block-text)
+        current-block (assoc block :block/title fst-block-text)
         current-block (apply dissoc current-block db-schema/retract-attributes)
         current-block (apply dissoc current-block db-schema/retract-attributes)
         new-m {:block/uuid (db/new-block-id)
         new-m {:block/uuid (db/new-block-id)
-               :block/content snd-block-text}
+               :block/title snd-block-text}
         next-block (-> (merge (select-keys block [:block/parent :block/format :block/page])
         next-block (-> (merge (select-keys block [:block/parent :block/format :block/page])
                               new-m)
                               new-m)
                        (wrap-parse-block))
                        (wrap-parse-block))
@@ -518,7 +518,7 @@
                  container-id (get-new-container-id :insert {:sibling? sibling?})]
                  container-id (get-new-container-id :insert {:sibling? sibling?})]
              (edit-block! next-block' (+ pos (count unsaved-chars))
              (edit-block! next-block' (+ pos (count unsaved-chars))
                           {:container-id container-id
                           {:container-id container-id
-                           :custom-content (str unsaved-chars (:block/content next-block'))}))))))
+                           :custom-content (str unsaved-chars (:block/title next-block'))}))))))
     (p/finally (fn []
     (p/finally (fn []
                  (state/set-state! :editor/async-unsaved-chars nil))))))
                  (state/set-state! :editor/async-unsaved-chars nil))))))
 
 
@@ -552,7 +552,7 @@
                         (property-file/insert-properties-when-file-based repo format content properties)
                         (property-file/insert-properties-when-file-based repo format content properties)
                         content)
                         content)
               new-block (-> (select-keys block [:block/page])
               new-block (-> (select-keys block [:block/page])
-                            (assoc :block/content content
+                            (assoc :block/title content
                                    :block/format format))
                                    :block/format format))
               new-block (assoc new-block :block/page
               new-block (assoc new-block :block/page
                                (if page
                                (if page
@@ -594,7 +594,7 @@
                   (property-handler/set-block-properties! repo (:block/uuid new-block) properties)))
                   (property-handler/set-block-properties! repo (:block/uuid new-block) properties)))
               (when edit-block?
               (when edit-block?
                 (if (and replace-empty-target?
                 (if (and replace-empty-target?
-                      (string/blank? (:block/content last-block)))
+                      (string/blank? (:block/title last-block)))
                   (edit-block! last-block :max)
                   (edit-block! last-block :max)
                   (edit-block! new-block :max)))
                   (edit-block! new-block :max)))
               new-block)))))))
               new-block)))))))
@@ -606,7 +606,7 @@
       (when-let [page (db/get-page page-title)]
       (when-let [page (db/get-page page-title)]
         (when (db/page-empty? (state/get-current-repo) (:db/id page))
         (when (db/page-empty? (state/get-current-repo) (:db/id page))
           (let [format (or (:block/format page) (state/get-preferred-format))
           (let [format (or (:block/format page) (state/get-preferred-format))
-                new-block {:block/content ""
+                new-block {:block/title ""
                            :block/format format}]
                            :block/format format}]
             (ui-outliner-tx/transact!
             (ui-outliner-tx/transact!
              {:outliner-op :insert-blocks}
              {:outliner-op :insert-blocks}
@@ -645,10 +645,10 @@
     content))
     content))
 
 
 (defn check
 (defn check
-  [{:block/keys [marker content repeated? uuid] :as block}]
-  (let [new-content (string/replace-first content marker "DONE")
+  [{:block/keys [marker title repeated? uuid] :as block}]
+  (let [new-content (string/replace-first title marker "DONE")
         new-content (if repeated?
         new-content (if repeated?
-                      (update-timestamps-content! block content)
+                      (update-timestamps-content! block title)
                       new-content)
                       new-content)
         input-id (state/get-edit-input-id)]
         input-id (state/get-edit-input-id)]
     (if (and input-id
     (if (and input-id
@@ -657,11 +657,11 @@
       (save-block-if-changed! block new-content))))
       (save-block-if-changed! block new-content))))
 
 
 (defn uncheck
 (defn uncheck
-  [{:block/keys [content uuid] :as block}]
+  [{:block/keys [title uuid] :as block}]
   (let [marker (if (= :now (state/get-preferred-workflow))
   (let [marker (if (= :now (state/get-preferred-workflow))
                  "LATER"
                  "LATER"
                  "TODO")
                  "TODO")
-        new-content (string/replace-first content "DONE" marker)
+        new-content (string/replace-first title "DONE" marker)
         input-id (state/get-edit-input-id)]
         input-id (state/get-edit-input-id)]
     (if (and input-id
     (if (and input-id
              (string/ends-with? input-id (str uuid)))
              (string/ends-with? input-id (str uuid)))
@@ -677,13 +677,13 @@
   if the `new-marker` is nil, it will generate it automatically."
   if the `new-marker` is nil, it will generate it automatically."
   ([block]
   ([block]
    (set-marker block nil))
    (set-marker block nil))
-  ([{:block/keys [marker content format] :as block} new-marker]
-   (let [[new-content _] (status/cycle-marker content marker new-marker format (state/get-preferred-workflow))]
+  ([{:block/keys [marker title format] :as block} new-marker]
+   (let [[new-content _] (status/cycle-marker title marker new-marker format (state/get-preferred-workflow))]
      (save-block-if-changed! block new-content))))
      (save-block-if-changed! block new-content))))
 
 
 (defn file-based-cycle-todo!
 (defn file-based-cycle-todo!
   [block]
   [block]
-  (when (not-empty (:block/content block))
+  (when (not-empty (:block/title block))
     (set-marker block)))
     (set-marker block)))
 
 
 (defn db-based-cycle-todo!
 (defn db-based-cycle-todo!
@@ -746,9 +746,9 @@
               (cursor/move-cursor-to current-input new-pos))))))))
               (cursor/move-cursor-to current-input new-pos))))))))
 
 
 (defn set-priority
 (defn set-priority
-  [{:block/keys [priority content] :as block} new-priority]
+  [{:block/keys [priority title] :as block} new-priority]
   (when-not (config/db-based-graph? (state/get-current-repo))
   (when-not (config/db-based-graph? (state/get-current-repo))
-    (let [new-content (string/replace-first content
+    (let [new-content (string/replace-first title
                                            (util/format "[#%s]" priority)
                                            (util/format "[#%s]" priority)
                                            (util/format "[#%s]" new-priority))]
                                            (util/format "[#%s]" new-priority))]
      (save-block-if-changed! block new-content))))
      (save-block-if-changed! block new-content))))
@@ -774,7 +774,7 @@
           (let [db? (config/db-based-graph? repo)
           (let [db? (config/db-based-graph? repo)
                 original-content (if (= (:db/id sibling-entity) (:db/id (state/get-edit-block)))
                 original-content (if (= (:db/id sibling-entity) (:db/id (state/get-edit-block)))
                                    (state/get-edit-content)
                                    (state/get-edit-content)
-                                   (:block/content sibling-entity))
+                                   (:block/title sibling-entity))
                 value' (if db?
                 value' (if db?
                          original-content
                          original-content
                          (-> (property-file/remove-built-in-properties-when-file-based repo format original-content)
                          (-> (property-file/remove-built-in-properties-when-file-based repo format original-content)
@@ -855,7 +855,7 @@
                           transact-opts
                           transact-opts
                           (delete-block-aux! prev-block)
                           (delete-block-aux! prev-block)
                           (save-block! repo block new-content {}))
                           (save-block! repo block new-content {}))
-                         (edit-block! (assoc block :block/content new-content) (count (:block/content prev-block))))
+                         (edit-block! (assoc block :block/title new-content) (count (:block/title prev-block))))
                         (p/do!
                         (p/do!
                           (ui-outliner-tx/transact!
                           (ui-outliner-tx/transact!
                            transact-opts
                            transact-opts
@@ -923,8 +923,8 @@
         block-id (if (string? block-id) (uuid block-id) block-id)
         block-id (if (string? block-id) (uuid block-id) block-id)
         value (str value)]
         value (str value)]
     (when-let [block (db/entity [:block/uuid block-id])]
     (when-let [block (db/entity [:block/uuid block-id])]
-      (let [{:block/keys [content]} block
-            content (or content (state/get-edit-content))
+      (let [{:block/keys [title]} block
+            content (or title (state/get-edit-content))
             new-content (-> (text-util/remove-timestamp content key)
             new-content (-> (text-util/remove-timestamp content key)
                             (text-util/add-timestamp key value))]
                             (text-util/add-timestamp key value))]
         (when (not= content new-content)
         (when (not= content new-content)
@@ -1304,7 +1304,7 @@
       (let [value (string/trim value)]
       (let [value (string/trim value)]
         ;; FIXME: somehow frontend.components.editor's will-unmount event will loop forever
         ;; FIXME: somehow frontend.components.editor's will-unmount event will loop forever
         ;; maybe we shouldn't save the block/file in "will-unmount" event?
         ;; maybe we shouldn't save the block/file in "will-unmount" event?
-        (if (:block/title entity)
+        (if (ldb/page? entity)
           (let [existing-tags (:block/tags block)
           (let [existing-tags (:block/tags block)
                 tags (mldoc/extract-tags value)]
                 tags (mldoc/extract-tags value)]
             (when (seq tags)
             (when (seq tags)
@@ -1357,11 +1357,11 @@
                db-block (when-let [block-id (:block/uuid block)]
                db-block (when-let [block-id (:block/uuid block)]
                           (db/entity [:block/uuid block-id]))
                           (db/entity [:block/uuid block-id]))
                elem (and input-id (gdom/getElement input-id))
                elem (and input-id (gdom/getElement input-id))
-               db-content (:block/content db-block)
+               db-content (:block/title db-block)
                db-content-without-heading (and db-content
                db-content-without-heading (and db-content
                                                (common-util/safe-subs db-content (:block/level db-block)))
                                                (common-util/safe-subs db-content (:block/level db-block)))
                value (if (= (:block/uuid current-block) (:block/uuid block))
                value (if (= (:block/uuid current-block) (:block/uuid block))
-                       (:block/content current-block)
+                       (:block/title current-block)
                        (and elem (gobj/get elem "value")))]
                        (and elem (gobj/get elem "value")))]
            (when value
            (when value
              (cond
              (cond
@@ -1493,7 +1493,7 @@
   [{:keys [repo href full-text block-id local? delete-local?] :as _opts}]
   [{:keys [repo href full-text block-id local? delete-local?] :as _opts}]
   (let [block (db-model/query-block-by-uuid block-id)
   (let [block (db-model/query-block-by-uuid block-id)
         _ (or block (throw (str block-id " not exists")))
         _ (or block (throw (str block-id " not exists")))
-        text (:block/content block)
+        text (:block/title block)
         content (string/replace text full-text "")]
         content (string/replace text full-text "")]
     (save-block! repo block content)
     (save-block! repo block content)
     (when (and local? delete-local?)
     (when (and local? delete-local?)
@@ -1762,7 +1762,7 @@
                          result))]
                          result))]
       (if edit-block-id
       (if edit-block-id
         (when-let [block (db/entity [:block/uuid edit-block-id])]
         (when-let [block (db/entity [:block/uuid edit-block-id])]
-          (let [blocks [(assoc block :block/content (state/get-edit-content))]
+          (let [blocks [(assoc block :block/title (state/get-edit-content))]
                 container-id (get-new-container-id (if up? :move-up :move-down) {})]
                 container-id (get-new-container-id (if up? :move-up :move-down) {})]
             (p/do!
             (p/do!
              (save-current-block!)
              (save-current-block!)
@@ -1858,7 +1858,7 @@
         image-part (first (string/split full_text #"\{"))
         image-part (first (string/split full_text #"\{"))
         new-full-text (str image-part (pr-str new-meta))
         new-full-text (str image-part (pr-str new-meta))
         block (db/entity [:block/uuid block-id])
         block (db/entity [:block/uuid block-id])
-        value (:block/content block)
+        value (:block/title block)
         new-value (string/replace value full_text new-full-text)]
         new-value (string/replace value full_text new-full-text)]
     (save-block-aux! block new-value {})))
     (save-block-aux! block new-value {})))
 
 
@@ -2000,8 +2000,8 @@
   (let [db-based? (config/db-based-graph? (state/get-current-repo))
   (let [db-based? (config/db-based-graph? (state/get-current-repo))
         new-content
         new-content
         (if content-update-fn
         (if content-update-fn
-          (content-update-fn (:block/content block))
-          (:block/content block))
+          (content-update-fn (:block/title block))
+          (:block/title block))
         new-content
         new-content
         (cond->> new-content
         (cond->> new-content
           (not keep-uuid?) (property-file/remove-property-when-file-based repo format "id")
           (not keep-uuid?) (property-file/remove-property-when-file-based repo format "id")
@@ -2018,7 +2018,7 @@
                                          (when-not keep-uuid? [:id])
                                          (when-not keep-uuid? [:id])
                                          [:custom_id :custom-id]
                                          [:custom_id :custom-id]
                                          exclude-properties)))
                                          exclude-properties)))
-             :block/content new-content}
+             :block/title new-content}
              (not db-based?)
              (not db-based?)
              (assoc :block/properties-text-values (apply dissoc (:block/properties-text-values block)
              (assoc :block/properties-text-values (apply dissoc (:block/properties-text-values block)
                                                          (concat
                                                          (concat
@@ -2052,16 +2052,16 @@
            :or {exclude-properties []}}]
            :or {exclude-properties []}}]
   (let [editing-block (when-let [editing-block (state/get-edit-block)]
   (let [editing-block (when-let [editing-block (state/get-edit-block)]
                         (some-> (db/entity [:block/uuid (:block/uuid editing-block)])
                         (some-> (db/entity [:block/uuid (:block/uuid editing-block)])
-                                (assoc :block/content (state/get-edit-content))))
+                                (assoc :block/title (state/get-edit-content))))
         has-unsaved-edits (and editing-block
         has-unsaved-edits (and editing-block
-                               (not= (:block/content (db/entity (:db/id editing-block)))
+                               (not= (:block/title (db/entity (:db/id editing-block)))
                                      (state/get-edit-content)))
                                      (state/get-edit-content)))
         target-block (or target-block editing-block)
         target-block (or target-block editing-block)
         block (db/entity (:db/id target-block))
         block (db/entity (:db/id target-block))
         page (if (:block/name block) block
         page (if (:block/name block) block
                  (when target-block (:block/page (db/entity (:db/id target-block)))))
                  (when target-block (:block/page (db/entity (:db/id target-block)))))
         empty-target? (if (true? skip-empty-target?) false
         empty-target? (if (true? skip-empty-target?) false
-                          (string/blank? (:block/content target-block)))
+                          (string/blank? (:block/title target-block)))
         paste-nested-blocks? (nested-blocks blocks)
         paste-nested-blocks? (nested-blocks blocks)
         target-block-has-children? (db/has-children? (:block/uuid target-block))
         target-block-has-children? (db/has-children? (:block/uuid target-block))
         replace-empty-target? (and empty-target?
         replace-empty-target? (and empty-target?
@@ -2356,14 +2356,14 @@
             (insert "\n")))))))
             (insert "\n")))))))
 
 
 (defn toggle-list-checkbox
 (defn toggle-list-checkbox
-  [{:block/keys [content] :as block} item-content]
+  [{:block/keys [title] :as block} item-content]
   (let [toggle-fn (fn [m x-mark]
   (let [toggle-fn (fn [m x-mark]
                     (case (string/lower-case x-mark)
                     (case (string/lower-case x-mark)
                       "[ ]" (str "[x] " item-content)
                       "[ ]" (str "[x] " item-content)
                       "[x]" (str "[ ] " item-content)
                       "[x]" (str "[ ] " item-content)
                       m))
                       m))
         pattern (re-pattern (str "(\\[[xX ]\\])\\s+?" (gstring/regExpEscape item-content)))
         pattern (re-pattern (str "(\\[[xX ]\\])\\s+?" (gstring/regExpEscape item-content)))
-        new-content (string/replace-first content pattern toggle-fn)]
+        new-content (string/replace-first title pattern toggle-fn)]
     (save-block-if-changed! block new-content)))
     (save-block-if-changed! block new-content)))
 
 
 (defn- dwim-in-list
 (defn- dwim-in-list
@@ -2588,13 +2588,13 @@
               :down util/get-next-block-non-collapsed)
               :down util/get-next-block-non-collapsed)
           current-block (util/rec-get-node input "ls-block")
           current-block (util/rec-get-node input "ls-block")
           sibling-block (f current-block)
           sibling-block (f current-block)
-          {:block/keys [uuid content format]} (state/get-edit-block)]
+          {:block/keys [uuid title format]} (state/get-edit-block)]
       (if sibling-block
       (if sibling-block
         (when-let [sibling-block-id (dom/attr sibling-block "blockid")]
         (when-let [sibling-block-id (dom/attr sibling-block "blockid")]
           (let [container-id (some-> (dom/attr sibling-block "containerid") js/parseInt)
           (let [container-id (some-> (dom/attr sibling-block "containerid") js/parseInt)
                 value (state/get-edit-content)]
                 value (state/get-edit-content)]
             (p/do!
             (p/do!
-             (when (not= (clean-content! repo format content)
+             (when (not= (clean-content! repo format title)
                          (string/trim value))
                          (string/trim value))
                (save-block! repo uuid value))
                (save-block! repo uuid value))
 
 
@@ -2642,7 +2642,7 @@
         sibling-block (f editing-block)]
         sibling-block (f editing-block)]
     (when sibling-block
     (when sibling-block
       (when-let [sibling-block-id (dom/attr sibling-block "blockid")]
       (when-let [sibling-block-id (dom/attr sibling-block "blockid")]
-        (let [content (:block/content block)
+        (let [content (:block/title block)
               value (state/get-edit-content)]
               value (state/get-edit-content)]
           (when (and value (not= (clean-content! repo format content) (string/trim value)))
           (when (and value (not= (clean-content! repo format content) (string/trim value)))
             (save-block! repo uuid value)))
             (save-block! repo uuid value)))
@@ -2699,7 +2699,7 @@
       (let [repo (state/get-current-repo)
       (let [repo (state/get-current-repo)
             editor-state (assoc (get-state)
             editor-state (assoc (get-state)
                                 :block-id (:block/uuid next-block)
                                 :block-id (:block/uuid next-block)
-                                :value (:block/content next-block))]
+                                :value (:block/title next-block))]
         (delete-block-inner! repo editor-state)))))
         (delete-block-inner! repo editor-state)))))
 
 
 (defn keydown-delete-handler
 (defn keydown-delete-handler
@@ -3387,7 +3387,7 @@
   "Whether block has a valid custom query."
   "Whether block has a valid custom query."
   [block]
   [block]
   (let [entity (db/entity (:db/id block))
   (let [entity (db/entity (:db/id block))
-        content (:block/content entity)]
+        content (:block/title entity)]
     (when content
     (when content
       (when (and (string/includes? content "#+BEGIN_QUERY")
       (when (and (string/includes? content "#+BEGIN_QUERY")
                  (string/includes? content "#+END_QUERY"))
                  (string/includes? content "#+END_QUERY"))
@@ -3422,7 +3422,7 @@
                (and
                (and
                 (:outliner/block-title-collapse-enabled? (state/get-config))
                 (:outliner/block-title-collapse-enabled? (state/get-config))
                 (block-with-title? (:block/format block)
                 (block-with-title? (:block/format block)
-                                   (:block/content block)
+                                   (:block/title block)
                                    semantic?))))
                                    semantic?))))
          false)))))
          false)))))
 
 
@@ -3773,7 +3773,7 @@
   (let [repo (state/get-current-repo)]
   (let [repo (state/get-current-repo)]
     (when-let [{:keys [start end link]} (thingatpt/block-ref-at-point)]
     (when-let [{:keys [start end link]} (thingatpt/block-ref-at-point)]
       (when-let [block (db/entity [:block/uuid link])]
       (when-let [block (db/entity [:block/uuid link])]
-        (let [block-content (:block/content block)
+        (let [block-content (:block/title block)
               format (or (:block/format block) :markdown)
               format (or (:block/format block) :markdown)
               block-content-without-prop (-> (property-file/remove-properties-when-file-based repo format block-content)
               block-content-without-prop (-> (property-file/remove-properties-when-file-based repo format block-content)
                                              (drawer/remove-logbook))]
                                              (drawer/remove-logbook))]
@@ -3794,7 +3794,7 @@
   (when (and block ref-id)
   (when (and block ref-id)
     (let [match (re-pattern (str "\\s?"
     (let [match (re-pattern (str "\\s?"
                                  (string/replace (block-ref/->block-ref ref-id) #"([\(\)])" "\\$1")))
                                  (string/replace (block-ref/->block-ref ref-id) #"([\(\)])" "\\$1")))
-          content (string/replace-first (:block/content block) match "")]
+          content (string/replace-first (:block/title block) match "")]
       (save-block! (state/get-current-repo)
       (save-block! (state/get-current-repo)
                    (:block/uuid block)
                    (:block/uuid block)
                    content))))
                    content))))
@@ -3805,10 +3805,10 @@
     (let [repo (state/get-current-repo)
     (let [repo (state/get-current-repo)
           match (block-ref/->block-ref ref-id)
           match (block-ref/->block-ref ref-id)
           ref-block (db/entity [:block/uuid ref-id])
           ref-block (db/entity [:block/uuid ref-id])
-          block-ref-content (->> (or (:block/content ref-block) "")
+          block-ref-content (->> (or (:block/title ref-block) "")
                                  (property-file/remove-built-in-properties-when-file-based repo (:block/format ref-block))
                                  (property-file/remove-built-in-properties-when-file-based repo (:block/format ref-block))
                                  (drawer/remove-logbook))
                                  (drawer/remove-logbook))
-          content (string/replace-first (:block/content block) match
+          content (string/replace-first (:block/title block) match
                                         block-ref-content)]
                                         block-ref-content)]
       (save-block! (state/get-current-repo)
       (save-block! (state/get-current-repo)
                    (:block/uuid block)
                    (:block/uuid block)
@@ -3818,7 +3818,7 @@
   [block ref-id]
   [block ref-id]
   (when (and block ref-id)
   (when (and block ref-id)
     (let [match (block-ref/->block-ref ref-id)
     (let [match (block-ref/->block-ref ref-id)
-          content (string/replace-first (:block/content block) match
+          content (string/replace-first (:block/title block) match
                                         (util/format "{{embed ((%s))}}"
                                         (util/format "{{embed ((%s))}}"
                                                      (str ref-id)))]
                                                      (str ref-id)))]
       (save-block! (state/get-current-repo)
       (save-block! (state/get-current-repo)

+ 2 - 2
src/main/frontend/handler/editor/lifecycle.cljs

@@ -52,10 +52,10 @@
 ;;            (= (:block/uuid new-block)
 ;;            (= (:block/uuid new-block)
 ;;               (:block/uuid edit-block))
 ;;               (:block/uuid edit-block))
 ;;            (not= (some-> edit-block string/trim)
 ;;            (not= (some-> edit-block string/trim)
-;;                  (some-> (:block/content new-block) string/trim)))
+;;                  (some-> (:block/title new-block) string/trim)))
 ;;       (when-let [input (state/get-input)]
 ;;       (when-let [input (state/get-input)]
 ;;         (util/set-change-value input
 ;;         (util/set-change-value input
-;;                                (block-handler/sanity-block-content repo (get new-block :block/format :markdown) (:block/content new-block))))))
+;;                                (block-handler/sanity-block-content repo (get new-block :block/format :markdown) (:block/title new-block))))))
 ;;   state)
 ;;   state)
 
 
 
 

+ 1 - 1
src/main/frontend/handler/events.cljs

@@ -984,7 +984,7 @@
                         :edit-original-block
                         :edit-original-block
                         (fn [{:keys [editing-default-property?]}]
                         (fn [{:keys [editing-default-property?]}]
                           (when editing-block
                           (when editing-block
-                            (let [content (:block/content (db/entity (:db/id editing-block)))
+                            (let [content (:block/title (db/entity (:db/id editing-block)))
                                   esc? (= "Escape" (state/get-ui-last-key-code))
                                   esc? (= "Escape" (state/get-ui-last-key-code))
                                   [content' pos] (cond
                                   [content' pos] (cond
                                                    esc?
                                                    esc?

+ 1 - 1
src/main/frontend/handler/export.cljs

@@ -108,7 +108,7 @@
                           :block/properties
                           :block/properties
                           :block/format
                           :block/format
                           :block/children
                           :block/children
-                          :block/content
+                          :block/title
                           :block/created-at
                           :block/created-at
                           :block/updated-at]
                           :block/updated-at]
                          pages)}))
                          pages)}))

+ 18 - 18
src/main/frontend/handler/file_based/editor.cljs

@@ -32,7 +32,7 @@
   [content block format new-marker old-marker]
   [content block format new-marker old-marker]
   (if (and (state/enable-timetracking?) new-marker)
   (if (and (state/enable-timetracking?) new-marker)
     (try
     (try
-      (let [logbook-exists? (and (:block/body block) (drawer/get-logbook (:block/body block)))
+      (let [logbook-exists? (and (:block.temp/ast-body block) (drawer/get-logbook (:block.temp/ast-body block)))
             new-marker (string/trim (string/lower-case (name new-marker)))
             new-marker (string/trim (string/lower-case (name new-marker)))
             old-marker (when old-marker (string/trim (string/lower-case (name old-marker))))
             old-marker (when old-marker (string/trim (string/lower-case (name old-marker))))
             new-content (cond
             new-content (cond
@@ -61,7 +61,7 @@
 (defn- with-timetracking
 (defn- with-timetracking
   [block value]
   [block value]
   (if (and (state/enable-timetracking?)
   (if (and (state/enable-timetracking?)
-           (not= (:block/content block) value))
+           (not= (:block/title block) value))
     (let [format (:block/format block)
     (let [format (:block/format block)
           new-marker (last (util/safe-re-find (status/marker-pattern format) (or value "")))
           new-marker (last (util/safe-re-find (status/marker-pattern format) (or value "")))
           new-value (with-marker-time value block format
           new-value (with-marker-time value block format
@@ -71,22 +71,22 @@
     value))
     value))
 
 
 (defn wrap-parse-block
 (defn wrap-parse-block
-  [{:block/keys [content format uuid level pre-block?] :as block
+  [{:block/keys [title format uuid level pre-block?] :as block
     :or {format :markdown}}]
     :or {format :markdown}}]
   (let [repo (state/get-current-repo)
   (let [repo (state/get-current-repo)
         block (or (and (:db/id block) (db/pull (:db/id block))) block)
         block (or (and (:db/id block) (db/pull (:db/id block))) block)
         page (:block/page block)
         page (:block/page block)
         block (merge block
         block (merge block
-                     (block/parse-title-and-body uuid format pre-block? (:block/content block)))
+                     (block/parse-title-and-body uuid format pre-block? (:block/title block)))
         properties (:block/properties block)
         properties (:block/properties block)
         properties (if (and (= format :markdown)
         properties (if (and (= format :markdown)
                             (number? (:heading properties)))
                             (number? (:heading properties)))
                      (dissoc properties :heading)
                      (dissoc properties :heading)
                      properties)
                      properties)
-        real-content (:block/content block)
-        content (if (and (seq properties) real-content (not= real-content content))
-                  (property-file/with-built-in-properties-when-file-based repo properties content format)
-                  content)
+        real-content (:block/title block)
+        content (if (and (seq properties) real-content (not= real-content title))
+                  (property-file/with-built-in-properties-when-file-based repo properties title format)
+                  title)
         content (drawer/with-logbook block content)
         content (drawer/with-logbook block content)
         content (with-timetracking block content)
         content (with-timetracking block content)
         first-block? (= (:block/uuid (ldb/get-first-child (db/get-db) (:db/id page)))
         first-block? (= (:block/uuid (ldb/get-first-child (db/get-db) (:db/id page)))
@@ -112,7 +112,7 @@
                              (let [content' (str (config/get-block-pattern format) (if block-with-title? " " "\n") content)]
                              (let [content' (str (config/get-block-pattern format) (if block-with-title? " " "\n") content)]
                                [content content']))
                                [content content']))
         block (assoc block
         block (assoc block
-                     :block/content content'
+                     :block/title content'
                      :block/format format)
                      :block/format format)
         block (apply dissoc block (remove #{:block/pre-block?} db-schema/retract-attributes))
         block (apply dissoc block (remove #{:block/pre-block?} db-schema/retract-attributes))
         block (block/parse-block block)
         block (block/parse-block block)
@@ -126,7 +126,7 @@
     (-> block
     (-> block
         (dissoc :block.temp/top?
         (dissoc :block.temp/top?
                 :block.temp/bottom?)
                 :block.temp/bottom?)
-        (assoc :block/content content
+        (assoc :block/title content
                :block/properties new-properties)
                :block/properties new-properties)
         (merge (if level {:block/level level} {})))))
         (merge (if level {:block/level level} {})))))
 
 
@@ -136,7 +136,7 @@
                          (uuid? block-or-id) (db/entity [:block/uuid block-or-id])
                          (uuid? block-or-id) (db/entity [:block/uuid block-or-id])
                          :else block-or-id)]
                          :else block-or-id)]
     (let [format (:block/format block)
     (let [format (:block/format block)
-          content (:block/content block)
+          content (:block/title block)
           properties (:block/properties block)
           properties (:block/properties block)
           properties (if (nil? value)
           properties (if (nil? value)
                        (dissoc properties key)
                        (dissoc properties key)
@@ -148,7 +148,7 @@
       {:block/uuid (:block/uuid block)
       {:block/uuid (:block/uuid block)
        :block/properties properties
        :block/properties properties
        :block/properties-order (or (keys properties) [])
        :block/properties-order (or (keys properties) [])
-       :block/content content})))
+       :block/title content})))
 
 
 (defn- set-heading-aux!
 (defn- set-heading-aux!
   [block-id heading]
   [block-id heading]
@@ -170,26 +170,26 @@
         (and (or (nil? heading) (true? heading))
         (and (or (nil? heading) (true? heading))
              (number? old-heading))
              (number? old-heading))
         (let [block' (set-block-property-aux! block :heading heading)
         (let [block' (set-block-property-aux! block :heading heading)
-              content (commands/clear-markdown-heading (:block/content block'))]
-          (merge block' {:block/content content}))
+              content (commands/clear-markdown-heading (:block/title block'))]
+          (merge block' {:block/title content}))
 
 
         (and (or (nil? old-heading) (true? old-heading))
         (and (or (nil? old-heading) (true? old-heading))
              (number? heading))
              (number? heading))
         (let [block' (set-block-property-aux! block :heading nil)
         (let [block' (set-block-property-aux! block :heading nil)
               properties (assoc (:block/properties block) :heading heading)
               properties (assoc (:block/properties block) :heading heading)
-              content (commands/set-markdown-heading (:block/content block') heading)]
-          (merge block' {:block/content content :block/properties properties}))
+              content (commands/set-markdown-heading (:block/title block') heading)]
+          (merge block' {:block/title content :block/properties properties}))
 
 
         ;; heading-num1 -> heading-num2
         ;; heading-num1 -> heading-num2
         :else
         :else
         (let [properties (assoc (:block/properties block) :heading heading)
         (let [properties (assoc (:block/properties block) :heading heading)
               content (-> block
               content (-> block
-                          :block/content
+                          :block/title
                           commands/clear-markdown-heading
                           commands/clear-markdown-heading
                           (commands/set-markdown-heading heading))]
                           (commands/set-markdown-heading heading))]
           {:block/uuid (:block/uuid block)
           {:block/uuid (:block/uuid block)
            :block/properties properties
            :block/properties properties
-           :block/content content}))
+           :block/title content}))
       (set-block-property-aux! block :heading heading))))
       (set-block-property-aux! block :heading heading))))
 
 
 (defn batch-set-heading! [block-ids heading]
 (defn batch-set-heading! [block-ids heading]

+ 3 - 3
src/main/frontend/handler/file_based/page_property.cljs

@@ -61,11 +61,11 @@
     (if pre-block
     (if pre-block
       (let [properties (:block/properties pre-block)
       (let [properties (:block/properties pre-block)
             new-properties (assoc properties key value)
             new-properties (assoc properties key value)
-            content (:block/content pre-block)
+            content (:block/title pre-block)
             new-content (insert-property format content key value)
             new-content (insert-property format content key value)
             block {:db/id (:db/id pre-block)
             block {:db/id (:db/id pre-block)
                    :block/properties new-properties
                    :block/properties new-properties
-                   :block/content new-content
+                   :block/title new-content
                    :block/page page-id}
                    :block/page page-id}
             tx [(assoc page-id :block/properties new-properties)
             tx [(assoc page-id :block/properties new-properties)
                 block]]
                 block]]
@@ -73,7 +73,7 @@
       (let [block {:block/uuid (db/new-block-id)
       (let [block {:block/uuid (db/new-block-id)
                    :block/parent page-id
                    :block/parent page-id
                    :block/page page-id
                    :block/page page-id
-                   :block/content (if org?
+                   :block/title (if org?
                                     (str "#+" (string/upper-case (name key)) ": " value)
                                     (str "#+" (string/upper-case (name key)) ": " value)
                                     (str (name key) ":: " value))
                                     (str (name key) ":: " value))
                    :block/format format
                    :block/format format

+ 2 - 2
src/main/frontend/handler/file_based/property.cljs

@@ -33,7 +33,7 @@
                                      (map last items))]
                                      (map last items))]
           (when-let [block (db/entity [:block/uuid block-id])]
           (when-let [block (db/entity [:block/uuid block-id])]
             (let [format (:block/format block)
             (let [format (:block/format block)
-                  content (:block/content block)
+                  content (:block/title block)
                   properties (:block/properties block)
                   properties (:block/properties block)
                   properties-text-values (:block/properties-text-values block)
                   properties-text-values (:block/properties-text-values block)
                   properties (-> (merge properties new-properties)
                   properties (-> (merge properties new-properties)
@@ -54,7 +54,7 @@
                          :block/properties properties
                          :block/properties properties
                          :block/properties-order property-ks
                          :block/properties-order property-ks
                          :block/properties-text-values properties-text-values
                          :block/properties-text-values properties-text-values
-                         :block/content content}]
+                         :block/title content}]
               (outliner-op/save-block! block {:retract-attributes? false}))))))
               (outliner-op/save-block! block {:retract-attributes? false}))))))
      (let [block-id (ffirst col)
      (let [block-id (ffirst col)
            block-id (if (string? block-id) (uuid block-id) block-id)
            block-id (if (string? block-id) (uuid block-id) block-id)

+ 1 - 1
src/main/frontend/handler/import.cljs

@@ -106,7 +106,7 @@
              blocks (db/sort-by-order children)
              blocks (db/sort-by-order children)
              last-block (last blocks)
              last-block (last blocks)
              snd-last-block (last (butlast blocks))
              snd-last-block (last (butlast blocks))
-             [target-block sibling?] (if (and last-block (seq (:block/content last-block)))
+             [target-block sibling?] (if (and last-block (seq (:block/title last-block)))
                                        [last-block true]
                                        [last-block true]
                                        (if snd-last-block
                                        (if snd-last-block
                                          [snd-last-block true]
                                          [snd-last-block true]

+ 2 - 2
src/main/frontend/handler/route.cljs

@@ -59,7 +59,7 @@
       (if (pu/lookup properties :logseq.property/heading)
       (if (pu/lookup properties :logseq.property/heading)
         {:to :page-block
         {:to :page-block
          :path-params {:name (get-in block [:block/page :block/name])
          :path-params {:name (get-in block [:block/page :block/name])
-                       :block-route-name (model/heading-content->route-name (:block/content block))}}
+                       :block-route-name (model/heading-content->route-name (:block/title block))}}
         {:to :page
         {:to :page
          :path-params {:name (if (string? page-name-or-block-uuid)
          :path-params {:name (if (string? page-name-or-block-uuid)
                                (util/page-name-sanity-lc page-name-or-block-uuid)
                                (util/page-name-sanity-lc page-name-or-block-uuid)
@@ -134,7 +134,7 @@
           block? (util/uuid-string? name)
           block? (util/uuid-string? name)
           block-title (when (and block? (not page))
           block-title (when (and block? (not page))
                         (when-let [block (db/entity [:block/uuid (uuid name)])]
                         (when-let [block (db/entity [:block/uuid (uuid name)])]
-                          (let [content (text/remove-level-spaces (:block/content block)
+                          (let [content (text/remove-level-spaces (:block/title block)
                                                                   (:block/format block) (config/get-block-pattern (:block/format block)))]
                                                                   (:block/format block) (config/get-block-pattern (:block/format block)))]
                             (if (> (count content) 48)
                             (if (> (count content) 48)
                               (str (subs content 0 48) "...")
                               (str (subs content 0 48) "...")

+ 1 - 1
src/main/frontend/handler/whiteboard.cljs

@@ -321,7 +321,7 @@
           page-entity (model/get-page page-uuid)
           page-entity (model/get-page page-uuid)
           tx (sqlite-util/block-with-timestamps
           tx (sqlite-util/block-with-timestamps
               {:block/uuid new-block-id
               {:block/uuid new-block-id
-               :block/content (or content "")
+               :block/title (or content "")
                :block/format :markdown
                :block/format :markdown
                :block/page (:db/id page-entity)
                :block/page (:db/id page-entity)
                :block/parent (:db/id page-entity)})
                :block/parent (:db/id page-entity)})

+ 1 - 1
src/main/frontend/schema/handler/common_config.cljc

@@ -38,7 +38,7 @@
                  :keyword
                  :keyword
                  [:or :string false? [:vector :string]]]]
                  [:or :string false? [:vector :string]]]]
     [:shortcut/doc-mode-enter-for-new-block? :boolean]
     [:shortcut/doc-mode-enter-for-new-block? :boolean]
-    [:block/content-max-length :int]
+    [:block/title-max-length :int]
     [:ui/show-command-doc? :boolean]
     [:ui/show-command-doc? :boolean]
     [:ui/show-empty-bullets? :boolean]
     [:ui/show-empty-bullets? :boolean]
     [:ui/show-full-blocks? :boolean]
     [:ui/show-full-blocks? :boolean]

+ 1 - 1
src/main/frontend/search/browser.cljs

@@ -19,7 +19,7 @@
         (keep (fn [{:keys [content page] :as block}]
         (keep (fn [{:keys [content page] :as block}]
                 {:page? (= (:uuid block) page)
                 {:page? (= (:uuid block) page)
                  :block/uuid (uuid (:uuid block))
                  :block/uuid (uuid (:uuid block))
-                 :block/content content
+                 :block/title content
                  :block/page (uuid page)}) result))
                  :block/page (uuid page)}) result))
       (p/resolved nil)))
       (p/resolved nil)))
   (rebuild-pages-indice! [_this]
   (rebuild-pages-indice! [_this]

+ 4 - 1
src/main/frontend/state.cljs

@@ -772,7 +772,10 @@ Similar to re-frame subscriptions"
 
 
 (defn block-content-max-length
 (defn block-content-max-length
   [repo]
   [repo]
-  (or (:block/content-max-length (sub-config repo)) 10000))
+  (or (:block/title-max-length (sub-config repo))
+      ;; backward compatible
+      (:block/content-max-length (sub-config repo))
+      10000))
 
 
 (defn mobile?
 (defn mobile?
   []
   []

+ 2 - 2
src/main/frontend/util/drawer.cljs

@@ -125,7 +125,7 @@
 (defn with-logbook
 (defn with-logbook
   [block content]
   [block content]
   (let [new-clocks (last (get-drawer-ast (:block/format block) content "logbook"))
   (let [new-clocks (last (get-drawer-ast (:block/format block) content "logbook"))
-        logbook (get-logbook (:block/body block))]
+        logbook (get-logbook (:block.temp/ast-body block))]
     (if logbook
     (if logbook
       (let [content (remove-logbook content)
       (let [content (remove-logbook content)
             clocks (->> (concat new-clocks (when-not new-clocks (last logbook)))
             clocks (->> (concat new-clocks (when-not new-clocks (last logbook)))
@@ -133,7 +133,7 @@
             clocks (->> (map string/trim clocks)
             clocks (->> (map string/trim clocks)
                         (remove string/blank?)
                         (remove string/blank?)
                         (string/join "\n"))]
                         (string/join "\n"))]
-        (if (:block/title block)
+        (if (:block.temp/ast-title block)
           (insert-drawer (:block/format block) content "LOGBOOK" clocks)
           (insert-drawer (:block/format block) content "LOGBOOK" clocks)
           content))
           content))
       content)))
       content)))

+ 1 - 1
src/main/frontend/worker/export.cljs

@@ -45,7 +45,7 @@
                               blocks
                               blocks
                               (map (fn [b]
                               (map (fn [b]
                                      (let [b' (if (seq (:block/properties b))
                                      (let [b' (if (seq (:block/properties b))
-                                                (update b :block/content
+                                                (update b :block/title
                                                         (fn [content]
                                                         (fn [content]
                                                           (gp-property/remove-properties (:block/format b) content)))
                                                           (gp-property/remove-properties (:block/format b) content)))
                                                 b)]
                                                 b)]

+ 3 - 3
src/main/frontend/worker/file.cljs

@@ -35,7 +35,7 @@
   '[:block/properties
   '[:block/properties
     :block/uuid
     :block/uuid
     :block/order
     :block/order
-    :block/content
+    :block/title
     :block/format
     :block/format
     :block/created-at
     :block/created-at
     :block/updated-at
     :block/updated-at
@@ -50,7 +50,7 @@
             :db/id
             :db/id
             :block/uuid ;; shape block uuid is read from properties
             :block/uuid ;; shape block uuid is read from properties
             :block/collapsed?
             :block/collapsed?
-            :block/content
+            :block/title
             :block/format
             :block/format
             :block/order
             :block/order
             :block/page
             :block/page
@@ -73,7 +73,7 @@
               blocks (ldb/get-page-blocks @conn (:db/id page-block) {:pull-keys pull-keys})
               blocks (ldb/get-page-blocks @conn (:db/id page-block) {:pull-keys pull-keys})
               blocks (if whiteboard? (map cleanup-whiteboard-block blocks) blocks)]
               blocks (if whiteboard? (map cleanup-whiteboard-block blocks) blocks)]
           (if (and (= 1 (count blocks))
           (if (and (= 1 (count blocks))
-                   (string/blank? (:block/content (first blocks)))
+                   (string/blank? (:block/title (first blocks)))
                    (nil? (:block/file page-block))
                    (nil? (:block/file page-block))
                    (not whiteboard?))
                    (not whiteboard?))
             (dissoc-request! request-id)
             (dissoc-request! request-id)

+ 3 - 3
src/main/frontend/worker/file/core.cljs

@@ -48,13 +48,13 @@
     content))
     content))
 
 
 (defn- transform-content
 (defn- transform-content
-  [repo db {:block/keys [collapsed? format pre-block? content page properties] :as b} level {:keys [heading-to-list?]} context]
+  [repo db {:block/keys [collapsed? format pre-block? title page properties] :as b} level {:keys [heading-to-list?]} context]
   (let [block-ref-not-saved? (and (seq (:block/_refs (d/entity db (:db/id b))))
   (let [block-ref-not-saved? (and (seq (:block/_refs (d/entity db (:db/id b))))
-                                  (not (string/includes? content (str (:block/uuid b))))
+                                  (not (string/includes? title (str (:block/uuid b))))
                                   (not (sqlite-util/db-based-graph? repo)))
                                   (not (sqlite-util/db-based-graph? repo)))
         heading (:heading properties)
         heading (:heading properties)
         markdown? (= :markdown format)
         markdown? (= :markdown format)
-        content (or content "")
+        content (or title "")
         page-first-child? (= (:db/id b) (ldb/get-first-child db (:db/id page)))
         page-first-child? (= (:db/id b) (ldb/get-first-child db (:db/id page)))
         pre-block? (or pre-block?
         pre-block? (or pre-block?
                        (and page-first-child?
                        (and page-first-child?

+ 4 - 4
src/main/frontend/worker/handler/page.cljs

@@ -46,12 +46,12 @@
     (let [refs (:block/_refs page-entity)
     (let [refs (:block/_refs page-entity)
           id-ref->page #(db-content/special-id-ref->page % [page-entity])]
           id-ref->page #(db-content/special-id-ref->page % [page-entity])]
       (when (seq refs)
       (when (seq refs)
-        (let [tx-data (mapcat (fn [{:block/keys [raw-content] :as ref}]
+        (let [tx-data (mapcat (fn [{:block/keys [raw-title] :as ref}]
                                 ;; block content
                                 ;; block content
-                                (let [content' (id-ref->page raw-content)
-                                      content-tx (when (not= raw-content content')
+                                (let [content' (id-ref->page raw-title)
+                                      content-tx (when (not= raw-title content')
                                                    {:db/id (:db/id ref)
                                                    {:db/id (:db/id ref)
-                                                    :block/content content'})
+                                                    :block/title content'})
                                       tx content-tx]
                                       tx content-tx]
                                   (concat
                                   (concat
                                    [[:db/retract (:db/id ref) :block/refs (:db/id page-entity)]]
                                    [[:db/retract (:db/id ref) :block/refs (:db/id page-entity)]]

+ 1 - 1
src/main/frontend/worker/handler/page/db_based/page.cljs

@@ -59,7 +59,7 @@
        :block/page page-id
        :block/page page-id
        :block/parent page-id
        :block/parent page-id
        :block/order (db-order/gen-key nil nil)
        :block/order (db-order/gen-key nil nil)
-       :block/content ""
+       :block/title ""
        :block/format format})]))
        :block/format format})]))
 
 
 (defn create!
 (defn create!

+ 2 - 2
src/main/frontend/worker/handler/page/file_based/page.cljs

@@ -23,7 +23,7 @@
      :block/refs refs
      :block/refs refs
      :block/order (db-order/gen-key nil nil)
      :block/order (db-order/gen-key nil nil)
      :block/format format
      :block/format format
-     :block/content content
+     :block/title content
      :block/parent page
      :block/parent page
      :block/page page}))
      :block/page page}))
 
 
@@ -61,7 +61,7 @@
        :block/page page-id
        :block/page page-id
        :block/parent page-id
        :block/parent page-id
        :block/order (db-order/gen-key nil nil)
        :block/order (db-order/gen-key nil nil)
-       :block/content ""
+       :block/title ""
        :block/format format})]))
        :block/format format})]))
 
 
 (defn create!
 (defn create!

+ 4 - 4
src/main/frontend/worker/handler/page/file_based/rename.cljs

@@ -116,9 +116,9 @@
   (let [to-page (ldb/get-page db new-name)
   (let [to-page (ldb/get-page db new-name)
         old-title (:block/title page)
         old-title (:block/title page)
         blocks (:block/_refs (d/entity db (:db/id page)))
         blocks (:block/_refs (d/entity db (:db/id page)))
-        tx     (->> (map (fn [{:block/keys [uuid content properties format] :as block}]
-                           (let [content    (let [content' (replace-old-page! config content old-title new-name format)]
-                                              (when-not (= content' content)
+        tx     (->> (map (fn [{:block/keys [uuid title properties format] :as block}]
+                           (let [content    (let [content' (replace-old-page! config title old-title new-name format)]
+                                              (when-not (= content' title)
                                                 content'))
                                                 content'))
                                  properties (let [properties' (walk-replace-old-page! config properties old-title new-name format)]
                                  properties (let [properties' (walk-replace-old-page! config properties old-title new-name format)]
                                               (when-not (= properties' properties)
                                               (when-not (= properties' properties)
@@ -126,7 +126,7 @@
                              (when (or content properties)
                              (when (or content properties)
                                (common-util/remove-nils-non-nested
                                (common-util/remove-nils-non-nested
                                 {:block/uuid       uuid
                                 {:block/uuid       uuid
-                                 :block/content    content
+                                 :block/title    content
                                  :block/properties properties
                                  :block/properties properties
                                  :block/properties-order (when (seq properties)
                                  :block/properties-order (when (seq properties)
                                                            (map first properties))
                                                            (map first properties))

+ 1 - 1
src/main/frontend/worker/rtc/const.cljs

@@ -228,7 +228,7 @@
                           [:block/parent {:optional true} :uuid]
                           [:block/parent {:optional true} :uuid]
                           [:block/type {:optional true} [:set :string]]
                           [:block/type {:optional true} [:set :string]]
                           [:block/order {:optional true} :string]
                           [:block/order {:optional true} :string]
-                          [:block/content {:optional true} :string]]]]]]
+                          [:block/title {:optional true} :string]]]]]]
 
 
     ["get-assets-upload-urls"
     ["get-assets-upload-urls"
      [:map
      [:map

+ 1 - 1
src/main/frontend/worker/rtc/db_listener.cljs

@@ -20,7 +20,7 @@
       :else                                           {false (conj {} latest-retract)})))
       :else                                           {false (conj {} latest-retract)})))
 
 
 (def ^:private watched-attrs
 (def ^:private watched-attrs
-  #{:block/content :block/created-at :block/updated-at :block/alias
+  #{:block/title :block/created-at :block/updated-at :block/alias
     :block/tags :block/type :block/schema :block/link :block/journal-day
     :block/tags :block/type :block/schema :block/link :block/journal-day
     :class/parent :class/schema.properties :property/schema.classes :property.value/content
     :class/parent :class/schema.properties :property/schema.classes :property.value/content
     :db/index :db/valueType :db/cardinality})
     :db/index :db/valueType :db/cardinality})

+ 2 - 2
src/main/frontend/worker/rtc/remote_update.cljs

@@ -194,7 +194,7 @@
               (transact-db! :move-blocks repo conn [b] local-parent false)
               (transact-db! :move-blocks repo conn [b] local-parent false)
               (transact-db! :insert-blocks repo conn
               (transact-db! :insert-blocks repo conn
                             [{:block/uuid block-uuid
                             [{:block/uuid block-uuid
-                              :block/content ""
+                              :block/title ""
                               :block/format :markdown}]
                               :block/format :markdown}]
                             local-parent {:sibling? false :keep-uuid? true}))
                             local-parent {:sibling? false :keep-uuid? true}))
             (transact-db! :update-block-order-directly repo conn block-uuid first-remote-parent remote-block-order))
             (transact-db! :update-block-order-directly repo conn block-uuid first-remote-parent remote-block-order))
@@ -330,7 +330,7 @@
         (transact-db! :upsert-whiteboard-block conn [(gp-whiteboard/shape->block repo shape page-id)])))))
         (transact-db! :upsert-whiteboard-block conn [(gp-whiteboard/shape->block repo shape page-id)])))))
 
 
 (def ^:private update-op-watched-attrs
 (def ^:private update-op-watched-attrs
-  #{:block/content
+  #{:block/title
     :block/updated-at
     :block/updated-at
     :block/created-at
     :block/created-at
     :block/alias
     :block/alias

+ 1 - 1
src/main/frontend/worker/rtc/skeleton.cljs

@@ -13,7 +13,7 @@
                                               {:block/parent [:block/uuid]}
                                               {:block/parent [:block/uuid]}
                                               :block/order
                                               :block/order
                                               :block/type
                                               :block/type
-                                              :block/content])
+                                              :block/title])
                              (filter :block/uuid))]
                              (filter :block/uuid))]
     (map
     (map
      (fn [block]
      (fn [block]

+ 8 - 12
src/main/frontend/worker/search.cljs

@@ -188,7 +188,7 @@
     "Returns property value if the given entity is type 'closed value' or nil"
     "Returns property value if the given entity is type 'closed value' or nil"
     [ent]
     [ent]
     (when (contains? (:block/type ent) "closed value")
     (when (contains? (:block/type ent) "closed value")
-      (:block/content ent))))
+      (:block/title ent))))
 
 
 (comment
 (comment
   (defn- get-db-properties-str
   (defn- get-db-properties-str
@@ -208,13 +208,9 @@
                                              (property-value-when-closed e)
                                              (property-value-when-closed e)
                                            ;; :page or :date properties
                                            ;; :page or :date properties
                                              (:block/title e)
                                              (:block/title e)
-                                           ;; block generated by template
-                                             (and
-                                              (:logseq.property/created-from-template e)
-                                              (:block/content e))
-                                           ;; first child
+                                             ;; first child
                                              (let [parent-id (:db/id e)]
                                              (let [parent-id (:db/id e)]
-                                               (:block/content (ldb/get-first-child db parent-id))))]
+                                               (:block/title (ldb/get-first-child db parent-id))))]
                                   value)
                                   value)
                                 val)))
                                 val)))
                        (remove string/blank?))
                        (remove string/blank?))
@@ -227,12 +223,12 @@
 
 
 (defn block->index
 (defn block->index
   "Convert a block to the index for searching"
   "Convert a block to the index for searching"
-  [{:block/keys [uuid page content format] :as block}]
+  [{:block/keys [uuid page title format] :as block}]
   (when-not (or
   (when-not (or
              (:block/name block)
              (:block/name block)
              (ldb/closed-value? block)
              (ldb/closed-value? block)
-             (and (string? content) (> (count content) 10000))
-             (string/blank? content))        ; empty page or block
+             (and (string? title) (> (count title) 10000))
+             (string/blank? title))        ; empty page or block
       ;; Should properties be included in the search indice?
       ;; Should properties be included in the search indice?
       ;; It could slow down the search indexing, also it can be confusing
       ;; It could slow down the search indexing, also it can be confusing
       ;; if the showing properties are not useful to users.
       ;; if the showing properties are not useful to users.
@@ -242,7 +238,7 @@
     (when uuid
     (when uuid
       {:id (str uuid)
       {:id (str uuid)
        :page (str (or (:block/uuid page) uuid))
        :page (str (or (:block/uuid page) uuid))
-       :content (sanitize content)
+       :content (sanitize title)
        :format format})))
        :format format})))
 
 
 
 
@@ -328,7 +324,7 @@
         datoms (filter
         datoms (filter
                 (fn [datom]
                 (fn [datom]
                   ;; Capture any direct change on page display title, page ref or block content
                   ;; Capture any direct change on page display title, page ref or block content
-                  (contains? #{:block/uuid :block/name :block/title :block/content :block/properties :block/schema} (:a datom)))
+                  (contains? #{:block/uuid :block/name :block/title :block/properties :block/schema} (:a datom)))
                 data)]
                 data)]
     (when (seq datoms)
     (when (seq datoms)
       (get-blocks-from-datoms-impl repo tx-report datoms))))
       (get-blocks-from-datoms-impl repo tx-report datoms))))

+ 10 - 10
src/main/frontend/worker/undo_redo.cljs

@@ -78,7 +78,7 @@ when undo this op, this original entity-map will be transacted back into db")
          [:block/uuid :uuid]
          [:block/uuid :uuid]
          [:block/left :uuid]
          [:block/left :uuid]
          [:block/parent :uuid]
          [:block/parent :uuid]
-         [:block/content :string]
+         [:block/title :string]
          [:block/created-at {:optional true} :int]
          [:block/created-at {:optional true} :int]
          [:block/updated-at {:optional true} :int]
          [:block/updated-at {:optional true} :int]
          [:block/format {:optional true} :any]
          [:block/format {:optional true} :any]
@@ -112,7 +112,7 @@ when undo this op, this original entity-map will be transacted back into db")
   [:block/uuid
   [:block/uuid
    {:block/left [:block/uuid]}
    {:block/left [:block/uuid]}
    {:block/parent [:block/uuid]}
    {:block/parent [:block/uuid]}
-   :block/content
+   :block/title
    :block/created-at
    :block/created-at
    :block/updated-at
    :block/updated-at
    :block/format
    :block/format
@@ -161,7 +161,7 @@ when undo this op, this original entity-map will be transacted back into db")
       (let [value-keys             (set (keys (second op)))
       (let [value-keys             (set (keys (second op)))
             block-entity           (d/entity db [:block/uuid block-uuid])
             block-entity           (d/entity db [:block/uuid block-uuid])
             block-origin-content   (when (contains? value-keys :block-origin-content)
             block-origin-content   (when (contains? value-keys :block-origin-content)
-                                     (:block/content block-entity))
+                                     (:block/title block-entity))
             block-origin-tags      (when (contains? value-keys :block-origin-tags)
             block-origin-tags      (when (contains? value-keys :block-origin-tags)
                                      (mapv :block/uuid (:block/tags block-entity)))
                                      (mapv :block/uuid (:block/tags block-entity)))
             block-origin-collapsed (when (contains? value-keys :block-origin-collapsed)
             block-origin-collapsed (when (contains? value-keys :block-origin-collapsed)
@@ -272,7 +272,7 @@ when undo this op, this original entity-map will be transacted back into db")
                             :conn conn}}
                             :conn conn}}
            (outliner-core/insert-blocks! repo conn
            (outliner-core/insert-blocks! repo conn
                                          [(cond-> {:block/uuid block-uuid
                                          [(cond-> {:block/uuid block-uuid
-                                                   :block/content (:block/content block-entity-map)
+                                                   :block/title (:block/title block-entity-map)
                                                    :block/format :markdown}
                                                    :block/format :markdown}
                                             (:block/created-at block-entity-map)
                                             (:block/created-at block-entity-map)
                                             (assoc :block/created-at (:block/created-at block-entity-map))
                                             (assoc :block/created-at (:block/created-at block-entity-map))
@@ -357,7 +357,7 @@ when undo this op, this original entity-map will be transacted back into db")
                   (ldb/transact! conn retract-attrs-tx-data {:gen-undo-ops? false}))
                   (ldb/transact! conn retract-attrs-tx-data {:gen-undo-ops? false}))
               new-block (cond-> block-entity
               new-block (cond-> block-entity
                           (some? block-origin-content)
                           (some? block-origin-content)
-                          (assoc :block/content block-origin-content)
+                          (assoc :block/title block-origin-content)
                           (some? block-origin-tags)
                           (some? block-origin-tags)
                           (assoc :block/tags (some->> block-origin-tags
                           (assoc :block/tags (some->> block-origin-tags
                                                       (map (partial vector :block/uuid))
                                                       (map (partial vector :block/uuid))
@@ -420,7 +420,7 @@ when undo this op, this original entity-map will be transacted back into db")
       (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) ops)
       (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) ops)
                                 (map second)
                                 (map second)
                                 (reverse))
                                 (reverse))
-            block-content (:block/content (d/entity @conn [:block/uuid (:block-uuid (first editor-cursors))]))]
+            block-content (:block/title (d/entity @conn [:block/uuid (:block-uuid (first editor-cursors))]))]
         {:undo? true
         {:undo? true
          :editor-cursors editor-cursors
          :editor-cursors editor-cursors
          :block-content block-content}))
          :block-content block-content}))
@@ -445,7 +445,7 @@ when undo this op, this original entity-map will be transacted back into db")
         (push-undo-ops repo page-block-uuid (vec (cons boundary rev-ops))))
         (push-undo-ops repo page-block-uuid (vec (cons boundary rev-ops))))
       (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) ops)
       (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) ops)
                                 (map second))
                                 (map second))
-            block-content (:block/content (d/entity @conn [:block/uuid (:block-uuid (last editor-cursors))]))]
+            block-content (:block/title (d/entity @conn [:block/uuid (:block-uuid (last editor-cursors))]))]
         {:redo? true
         {:redo? true
          :editor-cursors editor-cursors
          :editor-cursors editor-cursors
          :block-content block-content}))
          :block-content block-content}))
@@ -499,15 +499,15 @@ when undo this op, this original entity-map will be transacted back into db")
               other-ops
               other-ops
               (let [updated-attrs (seq (set/intersection
               (let [updated-attrs (seq (set/intersection
                                         updated-key-set
                                         updated-key-set
-                                        #{:block/content :block/tags :block/collapsed? :block/link}))]
+                                        #{:block/title :block/tags :block/collapsed? :block/link}))]
                 (when-let [update-block-op-value
                 (when-let [update-block-op-value
                            (when (normal-block? entity-after)
                            (when (normal-block? entity-after)
                              (some->> updated-attrs
                              (some->> updated-attrs
                                       (keep
                                       (keep
                                        (fn [attr-name]
                                        (fn [attr-name]
                                          (case attr-name
                                          (case attr-name
-                                           :block/content
-                                           (when-let [origin-content (:block/content entity-before)]
+                                           :block/title
+                                           (when-let [origin-content (:block/title entity-before)]
                                              [:block-origin-content origin-content])
                                              [:block-origin-content origin-content])
 
 
                                            :block/tags
                                            :block/tags

+ 1 - 1
src/main/frontend/worker/undo_redo2.cljs

@@ -295,7 +295,7 @@
               ((if undo? push-redo-op push-undo-op) repo op)
               ((if undo? push-redo-op push-undo-op) repo op)
               (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) op)
               (let [editor-cursors (->> (filter #(= ::record-editor-info (first %)) op)
                                         (map second))
                                         (map second))
-                    block-content (:block/content (d/entity @conn [:block/uuid (:block-uuid
+                    block-content (:block/title (d/entity @conn [:block/uuid (:block-uuid
                                                                                 (if undo?
                                                                                 (if undo?
                                                                                   (first editor-cursors)
                                                                                   (first editor-cursors)
                                                                                   (last editor-cursors)))]))]
                                                                                   (last editor-cursors)))]))]

+ 4 - 4
src/test/frontend/components/query/result_test.cljs

@@ -67,9 +67,9 @@
             "Current block is not included in results")))))
             "Current block is not included in results")))))
 
 
 (deftest get-query-result-with-remove-block-children-option
 (deftest get-query-result-with-remove-block-children-option
-  (let [result [{:db/id 1 :block/content "parent" :block/uuid 1}
-                {:db/id 2 :block/content "child" :block/uuid 2 :block/parent {:db/id 1}}]]
-    (is (= [{:db/id 1 :block/content "parent" :block/uuid 1}]
+  (let [result [{:db/id 1 :block/title "parent" :block/uuid 1}
+                {:db/id 2 :block/title "child" :block/uuid 2 :block/parent {:db/id 1}}]]
+    (is (= [{:db/id 1 :block/title "parent" :block/uuid 1}]
            (mock-get-query-result result {:remove-block-children? true} {:table? true}))
            (mock-get-query-result result {:remove-block-children? true} {:table? true}))
         "Removes children when :remove-block-children? is true")
         "Removes children when :remove-block-children? is true")
     (is (= result
     (is (= result
@@ -77,7 +77,7 @@
         "Doesn't remove children when :remove-block-children? is false")))
         "Doesn't remove children when :remove-block-children? is false")))
 
 
 (deftest get-query-result-sets-result-in-config
 (deftest get-query-result-sets-result-in-config
-  (let [result [{:db/id 1 :block/content "parent" :block/uuid 1}]
+  (let [result [{:db/id 1 :block/title "parent" :block/uuid 1}]
         config {:query-result (atom nil)}]
         config {:query-result (atom nil)}]
     (is (= result
     (is (= result
            (mock-get-query-result result {} {:table? true :config config})))
            (mock-get-query-result result {} {:table? true :config config})))

+ 2 - 2
src/test/frontend/components/query_table_test.cljs

@@ -22,8 +22,8 @@
 
 
   (testing "sort by block column"
   (testing "sort by block column"
     (are [sort-state result sorted-result]
     (are [sort-state result sorted-result]
-         (= (mapv #(hash-map :block/content %) sorted-result)
-            (#'query-table/sort-result (mapv #(hash-map :block/content %) result) sort-state))
+         (= (mapv #(hash-map :block/title %) sorted-result)
+            (#'query-table/sort-result (mapv #(hash-map :block/title %) result) sort-state))
          {:sort-desc? true :sort-by-column :block}
          {:sort-desc? true :sort-by-column :block}
          ["abc" "cde"] ["cde" "abc"]
          ["abc" "cde"] ["cde" "abc"]
 
 

+ 2 - 2
src/test/frontend/db/model_test.cljs

@@ -162,9 +162,9 @@ foo:: bar"}])
   - child 2
   - child 2
     - grandchild 2
     - grandchild 2
   - child 3"}])
   - child 3"}])
-  (let [parent (-> (d/q '[:find (pull ?b [*]) :where [?b :block/content "parent"]]
+  (let [parent (-> (d/q '[:find (pull ?b [*]) :where [?b :block/title "parent"]]
                         (conn/get-db test-helper/test-db))
                         (conn/get-db test-helper/test-db))
                    ffirst)]
                    ffirst)]
     (is (= ["child 1" "child 2" "child 3"]
     (is (= ["child 1" "child 2" "child 3"]
-           (map :block/content
+           (map :block/title
                 (model/get-block-immediate-children test-helper/test-db (:block/uuid parent)))))))
                 (model/get-block-immediate-children test-helper/test-db (:block/uuid parent)))))))

+ 6 - 6
src/test/frontend/db/query_custom_test.cljs

@@ -23,7 +23,7 @@
 
 
   (testing "advanced datalog queries"
   (testing "advanced datalog queries"
     (is (= ["LATER b3"]
     (is (= ["LATER b3"]
-           (map :block/content
+           (map :block/title
                 (custom-query {:query '[:find (pull ?b [*])
                 (custom-query {:query '[:find (pull ?b [*])
                                         :where
                                         :where
                                         (block-content ?b "b")
                                         (block-content ?b "b")
@@ -31,7 +31,7 @@
         "basic advanced query works")
         "basic advanced query works")
 
 
     (is (= ["LATER b3"]
     (is (= ["LATER b3"]
-           (map :block/content
+           (map :block/title
                 (custom-query {:query '[:find (pull ?b [*])
                 (custom-query {:query '[:find (pull ?b [*])
                                         :in $
                                         :in $
                                         :where
                                         :where
@@ -40,7 +40,7 @@
         "advanced query with an :in works")
         "advanced query with an :in works")
 
 
     (is (= ["foo:: bar\n" "b3"]
     (is (= ["foo:: bar\n" "b3"]
-           (map :block/content
+           (map :block/title
                 (custom-query {:query '[:find (pull ?b [*])
                 (custom-query {:query '[:find (pull ?b [*])
                                         :in $ ?query %
                                         :in $ ?query %
                                         :where
                                         :where
@@ -52,14 +52,14 @@
         "advanced query that uses rule from logseq and rule from :inputs")
         "advanced query that uses rule from logseq and rule from :inputs")
 
 
     (is (= ["LATER b3"]
     (is (= ["LATER b3"]
-           (map :block/content
+           (map :block/title
                 (custom-query {:query '[:find (pull ?b [*])
                 (custom-query {:query '[:find (pull ?b [*])
                                         :in $ %
                                         :in $ %
                                         :where
                                         :where
                                         (starts-with ?b "LA")
                                         (starts-with ?b "LA")
                                         (task ?b #{"LATER"})]
                                         (task ?b #{"LATER"})]
                                :rules '[[(starts-with ?b ?substr)
                                :rules '[[(starts-with ?b ?substr)
-                                         [?b :block/content ?content]
+                                         [?b :block/title ?content]
                                          [(clojure.string/starts-with? ?content ?substr)]]]})))
                                          [(clojure.string/starts-with? ?content ?substr)]]]})))
         "advanced query that uses :rules and rules from logseq")
         "advanced query that uses :rules and rules from logseq")
 
 
@@ -74,6 +74,6 @@
         "advanced query with bound :in argument works"))
         "advanced query with bound :in argument works"))
 
 
   (is (= ["LATER b3"]
   (is (= ["LATER b3"]
-         (map :block/content
+         (map :block/title
               (custom-query {:query (list 'and '(task later) "b")})))
               (custom-query {:query (list 'and '(task later) "b")})))
       "Simple query returns correct results"))
       "Simple query returns correct results"))

+ 33 - 33
src/test/frontend/db/query_dsl_test.cljs

@@ -72,9 +72,9 @@
      "(and \"for #clojure\" #tag foo)")))
      "(and \"for #clojure\" #tag foo)")))
 
 
 (defn- testable-content
 (defn- testable-content
-  "Only test :block/content up to page-ref as page-ref content varies between db and file graphs"
-  [{:block/keys [content]}]
-  (some->> content
+  "Only test :block/title up to page-ref as page-ref content varies between db and file graphs"
+  [{:block/keys [title]}]
+  (some->> title
            (re-find #"[^\[]+")
            (re-find #"[^\[]+")
            str/trim))
            str/trim))
 
 
@@ -97,51 +97,51 @@ prop-d:: [[nada]]"}])
 
 
   (testing "Blocks have given property value"
   (testing "Blocks have given property value"
     (is (= #{"b1" "b2"}
     (is (= #{"b1" "b2"}
-           (set (map (comp first str/split-lines :block/content)
+           (set (map (comp first str/split-lines :block/title)
                      (dsl-query "(property prop-a val-a)")))))
                      (dsl-query "(property prop-a val-a)")))))
 
 
     (is (= ["b2"]
     (is (= ["b2"]
-           (map (comp first str/split-lines :block/content)
+           (map (comp first str/split-lines :block/title)
                 (dsl-query "(property prop-b val-b)")))))
                 (dsl-query "(property prop-b val-b)")))))
 
 
   (is (= ["b2"]
   (is (= ["b2"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(and (property prop-b val-b))")))
               (dsl-query "(and (property prop-b val-b))")))
       "Blocks have property value with empty AND")
       "Blocks have property value with empty AND")
 
 
   (is (= ["b3"]
   (is (= ["b3"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(and (property prop-c \"page c\"))")))
               (dsl-query "(and (property prop-c \"page c\"))")))
       "Blocks have property value from a set of values")
       "Blocks have property value from a set of values")
 
 
   (is (= ["b3"]
   (is (= ["b3"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(and (property prop-c \"page c\") (property prop-c \"page b\"))")))
               (dsl-query "(and (property prop-c \"page c\") (property prop-c \"page b\"))")))
       "Blocks have ANDed property values")
       "Blocks have ANDed property values")
 
 
   (is (= #{"b2" "b3"}
   (is (= #{"b2" "b3"}
          (set
          (set
-          (map (comp first str/split-lines :block/content)
+          (map (comp first str/split-lines :block/title)
                (dsl-query "(or (property prop-c \"page c\") (property prop-b val-b))"))))
                (dsl-query "(or (property prop-c \"page c\") (property prop-b val-b))"))))
       "Blocks have ORed property values")
       "Blocks have ORed property values")
 
 
   (is (= ["b1"]
   (is (= ["b1"]
-           (map (comp first str/split-lines :block/content)
+           (map (comp first str/split-lines :block/title)
                 (dsl-query "(property prop-num 2000)")))
                 (dsl-query "(property prop-num 2000)")))
         "Blocks have integer property value")
         "Blocks have integer property value")
 
 
   (is (= ["b3"]
   (is (= ["b3"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(property prop-linked-num 3000)")))
               (dsl-query "(property prop-linked-num 3000)")))
       "Blocks have property with integer page value")
       "Blocks have property with integer page value")
 
 
   (is (= ["b3"]
   (is (= ["b3"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(property prop-d no-space-link)")))
               (dsl-query "(property prop-d no-space-link)")))
       "Blocks have property value with no space")
       "Blocks have property value with no space")
 
 
   (is (= ["b3" "b4"]
   (is (= ["b3" "b4"]
-         (map (comp first str/split-lines :block/content)
+         (map (comp first str/split-lines :block/title)
               (dsl-query "(property prop-d)")))
               (dsl-query "(property prop-d)")))
       "Blocks that have a property"))
       "Blocks that have a property"))
 
 
@@ -155,16 +155,16 @@ prop-d:: [[nada]]"}])
  (deftest db-only-block-property-queries
  (deftest db-only-block-property-queries
    (load-test-files-for-db-graph
    (load-test-files-for-db-graph
     [{:page {:block/title "page1"}
     [{:page {:block/title "page1"}
-      :blocks [{:block/content "b1"
+      :blocks [{:block/title "b1"
                 :build/properties {:Foo "bar"}}
                 :build/properties {:Foo "bar"}}
-               {:block/content "b2"
+               {:block/title "b2"
                 :build/properties {:foo "bar"}}]}])
                 :build/properties {:foo "bar"}}]}])
 
 
    (is (= ["b1"]
    (is (= ["b1"]
-          (map :block/content (dsl-query "(property Foo)")))
+          (map :block/title (dsl-query "(property Foo)")))
        "filter is case sensitive")
        "filter is case sensitive")
    (is (= ["b2"]
    (is (= ["b2"]
-          (map :block/content (dsl-query "(property :user.property/foo)")))
+          (map :block/title (dsl-query "(property :user.property/foo)")))
        "filter can handle qualified keyword properties")))
        "filter can handle qualified keyword properties")))
 
 
 (deftest block-property-query-performance
 (deftest block-property-query-performance
@@ -312,11 +312,11 @@ prop-d:: [[nada]]"}])
 (deftest priority-queries
 (deftest priority-queries
   (load-test-files (if js/process.env.DB_GRAPH
   (load-test-files (if js/process.env.DB_GRAPH
                      [{:page {:block/title "page1"}
                      [{:page {:block/title "page1"}
-                       :blocks [{:block/content "[#A] b1"
+                       :blocks [{:block/title "[#A] b1"
                                  :build/properties {:logseq.task/priority :logseq.task/priority.high}}
                                  :build/properties {:logseq.task/priority :logseq.task/priority.high}}
-                                {:block/content "[#B] b2"
+                                {:block/title "[#B] b2"
                                  :build/properties {:logseq.task/priority :logseq.task/priority.medium}}
                                  :build/properties {:logseq.task/priority :logseq.task/priority.medium}}
-                                {:block/content "[#A] b3"
+                                {:block/title "[#A] b3"
                                  :build/properties {:logseq.task/priority :logseq.task/priority.high}}]}]
                                  :build/properties {:logseq.task/priority :logseq.task/priority.high}}]}]
 
 
                      [{:file/path "pages/page1.md"
                      [{:file/path "pages/page1.md"
@@ -327,23 +327,23 @@ prop-d:: [[nada]]"}])
 
 
   (testing "one arg queries"
   (testing "one arg queries"
     (is (= #{"[#A] b1" "[#A] b3"}
     (is (= #{"[#A] b1" "[#A] b3"}
-           (set (map :block/content
+           (set (map :block/title
                      (dsl-query (if js/process.env.DB_GRAPH "(priority high)" "(priority a)"))))))
                      (dsl-query (if js/process.env.DB_GRAPH "(priority high)" "(priority a)"))))))
     (is (= #{"[#A] b1" "[#A] b3"}
     (is (= #{"[#A] b1" "[#A] b3"}
-           (set (map :block/content
+           (set (map :block/title
                  (dsl-query (if js/process.env.DB_GRAPH "(priority high)" "(priority a)")))))))
                  (dsl-query (if js/process.env.DB_GRAPH "(priority high)" "(priority a)")))))))
 
 
   (testing "two arg queries"
   (testing "two arg queries"
       (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
       (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
-             (set (map :block/content
+             (set (map :block/title
                        (dsl-query (if js/process.env.DB_GRAPH "(priority high medium)" "(priority a b)"))))))
                        (dsl-query (if js/process.env.DB_GRAPH "(priority high medium)" "(priority a b)"))))))
       (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
       (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
-             (set (map :block/content
+             (set (map :block/title
                        (dsl-query (if js/process.env.DB_GRAPH "(priority [high medium])" "(priority [a b])")))))
                        (dsl-query (if js/process.env.DB_GRAPH "(priority [high medium])" "(priority [a b])")))))
           "Arguments with vector notation"))
           "Arguments with vector notation"))
 
 
   (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
   (is (= #{"[#A] b1" "[#B] b2" "[#A] b3"}
-           (set (map :block/content
+           (set (map :block/title
                      (dsl-query (if js/process.env.DB_GRAPH "(priority high medium low)" "(priority a b c)")))))
                      (dsl-query (if js/process.env.DB_GRAPH "(priority high medium low)" "(priority a b c)")))))
         "Three arg queries and args that have no match"))
         "Three arg queries and args that have no match"))
 
 
@@ -431,10 +431,10 @@ prop-d:: [[nada]]"}])
                      :file/content "- b1 Hit\n- b2 Another"}])
                      :file/content "- b1 Hit\n- b2 Another"}])
 
 
   (is (= ["b1 Hit"]
   (is (= ["b1 Hit"]
-         (map :block/content (dsl-query "\"Hit\""))))
+         (map :block/title (dsl-query "\"Hit\""))))
 
 
   (is (= []
   (is (= []
-         (map :block/content (dsl-query "\"miss\"")))
+         (map :block/title (dsl-query "\"miss\"")))
       "Correctly returns no results"))
       "Correctly returns no results"))
 
 
 (deftest page-queries
 (deftest page-queries
@@ -508,10 +508,10 @@ prop-d:: [[nada]]"}])
 (deftest nested-page-ref-queries
 (deftest nested-page-ref-queries
   (load-test-files (if js/process.env.DB_GRAPH
   (load-test-files (if js/process.env.DB_GRAPH
                      [{:page {:block/title "page1"}
                      [{:page {:block/title "page1"}
-                       :blocks [{:block/content "p1 [[Parent page]]"
-                                 :build/children [{:block/content "[[Child page]]"}]}
-                                {:block/content "p2 [[Parent page]]"
-                                 :build/children [{:block/content "Non linked content"}]}]}]
+                       :blocks [{:block/title "p1 [[Parent page]]"
+                                 :build/children [{:block/title "[[Child page]]"}]}
+                                {:block/title "p2 [[Parent page]]"
+                                 :build/children [{:block/title "Non linked content"}]}]}]
                      [{:file/path "pages/page1.md"
                      [{:file/path "pages/page1.md"
                        :file/content "foo:: bar
                        :file/content "foo:: bar
 - p1 [[Parent page]]
 - p1 [[Parent page]]
@@ -563,10 +563,10 @@ created-at:: 1608968448116
                      '(task doing)
                      '(task doing)
                      '(task now))]
                      '(task now))]
     (is (= ["NOW b1"]
     (is (= ["NOW b1"]
-           (map :block/content (custom-query {:query task-query}))))
+           (map :block/title (custom-query {:query task-query}))))
 
 
     (is (= ["NOW b1"]
     (is (= ["NOW b1"]
-           (map :block/content (custom-query {:query (list 'and task-query "b")})))
+           (map :block/title (custom-query {:query (list 'and task-query "b")})))
         "Query with rule that can't be derived from the form itself")))
         "Query with rule that can't be derived from the form itself")))
 
 
 (if js/process.env.DB_GRAPH
 (if js/process.env.DB_GRAPH

+ 3 - 3
src/test/frontend/db/query_react_test.cljs

@@ -19,19 +19,19 @@ adds rules that users often use"
 
 
 (defn- blocks-created-between-inputs [a b]
 (defn- blocks-created-between-inputs [a b]
   (sort
   (sort
-   (map #(-> % :block/content string/split-lines first)
+   (map #(-> % :block/title string/split-lines first)
         (custom-query {:inputs [a b]
         (custom-query {:inputs [a b]
                        :query '[:find (pull ?b [*])
                        :query '[:find (pull ?b [*])
                                 :in $ ?start ?end
                                 :in $ ?start ?end
                                 :where
                                 :where
-                                [?b :block/content]
+                                [?b :block/title]
                                 [?b :block/created-at ?timestamp]
                                 [?b :block/created-at ?timestamp]
                                 [(>= ?timestamp ?start)]
                                 [(>= ?timestamp ?start)]
                                 [(<= ?timestamp ?end)]]}))))
                                 [(<= ?timestamp ?end)]]}))))
 
 
 
 
 (defn- blocks-with-tag-on-specified-current-page [& {:keys [current-page tag]}]
 (defn- blocks-with-tag-on-specified-current-page [& {:keys [current-page tag]}]
-  (map :block/content (custom-query {:title "Query title"
+  (map :block/title (custom-query {:title "Query title"
                                      :inputs [:current-page tag]
                                      :inputs [:current-page tag]
                                      :query '[:find (pull ?b [*])
                                      :query '[:find (pull ?b [*])
                                               :in $ ?current-page ?tag-name
                                               :in $ ?current-page ?tag-name

+ 6 - 6
src/test/frontend/handler/editor_async_test.cljs

@@ -60,7 +60,7 @@
 -"}])
 -"}])
     (p/let [conn (db/get-db test-helper/test-db false)
     (p/let [conn (db/get-db test-helper/test-db false)
             block (->> (d/q '[:find (pull ?b [*])
             block (->> (d/q '[:find (pull ?b [*])
-                              :where [?b :block/content ""]
+                              :where [?b :block/title ""]
                               [?p :block/name "page1"]
                               [?p :block/name "page1"]
                               [?b :block/page ?p]]
                               [?b :block/page ?p]]
                             @conn)
                             @conn)
@@ -68,9 +68,9 @@
       (delete-block @conn block
       (delete-block @conn block
                     {:on-delete (fn []
                     {:on-delete (fn []
                                   (let [updated-blocks (->> (d/q '[:find (pull ?b [*])
                                   (let [updated-blocks (->> (d/q '[:find (pull ?b [*])
-                                                                   :where [?b :block/content] [(missing? $ ?b :block/pre-block?)]]
+                                                                   :where [?b :block/title] [(missing? $ ?b :block/pre-block?)]]
                                                                  @conn)
                                                                  @conn)
-                                                            (map (comp :block/content first)))]
+                                                            (map (comp :block/title first)))]
                                     (is (= ["b1" "b2"] updated-blocks) "Block is deleted")))})))
                                     (is (= ["b1" "b2"] updated-blocks) "Block is deleted")))})))
 
 
   (testing "backspace deletes empty block in embedded context"
   (testing "backspace deletes empty block in embedded context"
@@ -83,7 +83,7 @@
 -"}])
 -"}])
     (p/let [conn (db/get-db test-helper/test-db false)
     (p/let [conn (db/get-db test-helper/test-db false)
             block (->> (d/q '[:find (pull ?b [*])
             block (->> (d/q '[:find (pull ?b [*])
-                              :where [?b :block/content ""]
+                              :where [?b :block/title ""]
                               [?p :block/name "page1"]
                               [?p :block/name "page1"]
                               [?b :block/page ?p]]
                               [?b :block/page ?p]]
                             @conn)
                             @conn)
@@ -92,7 +92,7 @@
                     {:embed? true
                     {:embed? true
                      :on-delete (fn []
                      :on-delete (fn []
                                   (let [updated-blocks (->> (d/q '[:find (pull ?b [*])
                                   (let [updated-blocks (->> (d/q '[:find (pull ?b [*])
-                                                                   :where [?b :block/content] [(missing? $ ?b :block/pre-block?)]]
+                                                                   :where [?b :block/title] [(missing? $ ?b :block/pre-block?)]]
                                                                  @conn)
                                                                  @conn)
-                                                            (map (comp :block/content first)))]
+                                                            (map (comp :block/title first)))]
                                     (is (= ["b1" "b2"] updated-blocks) "Block is deleted")))}))))
                                     (is (= ["b1" "b2"] updated-blocks) "Block is deleted")))}))))

Some files were not shown because too many files changed in this diff