|
@@ -36,6 +36,11 @@
|
|
|
[ent]
|
|
[ent]
|
|
|
(or (:block/raw-title ent) (:block/title ent)))
|
|
(or (:block/raw-title ent) (:block/title ent)))
|
|
|
|
|
|
|
|
|
|
+;; nbb-compatible version of db-property/property-value-content
|
|
|
|
|
+(defn- property-value-content [pvalue]
|
|
|
|
|
+ (or (block-title pvalue)
|
|
|
|
|
+ (:logseq.property/value pvalue)))
|
|
|
|
|
+
|
|
|
(defn- shallow-copy-page
|
|
(defn- shallow-copy-page
|
|
|
"Given a page or journal entity, shallow copies it e.g. no properties or tags info included.
|
|
"Given a page or journal entity, shallow copies it e.g. no properties or tags info included.
|
|
|
Pages that are shallow copied are at the edges of export and help keep the export size reasonable and
|
|
Pages that are shallow copied are at the edges of export and help keep the export size reasonable and
|
|
@@ -59,9 +64,7 @@
|
|
|
{:keys [include-pvalue-uuid-fn]
|
|
{:keys [include-pvalue-uuid-fn]
|
|
|
:or {include-pvalue-uuid-fn (constantly false)}
|
|
:or {include-pvalue-uuid-fn (constantly false)}
|
|
|
:as options}]
|
|
:as options}]
|
|
|
- (let [;; nbb-compatible version of db-property/property-value-content
|
|
|
|
|
- property-value-content (or (block-title pvalue)
|
|
|
|
|
- (:logseq.property/value pvalue))
|
|
|
|
|
|
|
+ (let [property-value-content' (property-value-content pvalue)
|
|
|
;; TODO: Add support for ref properties here and in sqlite.build
|
|
;; TODO: Add support for ref properties here and in sqlite.build
|
|
|
build-properties
|
|
build-properties
|
|
|
(some->> ent-properties
|
|
(some->> ent-properties
|
|
@@ -72,7 +75,7 @@
|
|
|
(into {}))]
|
|
(into {}))]
|
|
|
(if (or (seq ent-properties) (seq (:block/tags pvalue)) (include-pvalue-uuid-fn (:block/uuid pvalue)))
|
|
(if (or (seq ent-properties) (seq (:block/tags pvalue)) (include-pvalue-uuid-fn (:block/uuid pvalue)))
|
|
|
(cond-> {:build/property-value :block
|
|
(cond-> {:build/property-value :block
|
|
|
- :block/title property-value-content}
|
|
|
|
|
|
|
+ :block/title property-value-content'}
|
|
|
(seq (:block/tags pvalue))
|
|
(seq (:block/tags pvalue))
|
|
|
(assoc :build/tags (->build-tags (:block/tags pvalue)))
|
|
(assoc :build/tags (->build-tags (:block/tags pvalue)))
|
|
|
|
|
|
|
@@ -84,7 +87,7 @@
|
|
|
|
|
|
|
|
(:include-timestamps? options)
|
|
(:include-timestamps? options)
|
|
|
(merge (select-keys pvalue [:block/created-at :block/updated-at])))
|
|
(merge (select-keys pvalue [:block/created-at :block/updated-at])))
|
|
|
- property-value-content)))
|
|
|
|
|
|
|
+ property-value-content')))
|
|
|
|
|
|
|
|
(defonce ignored-properties [:logseq.property/created-by-ref :logseq.property.embedding/hnsw-label-updated-at])
|
|
(defonce ignored-properties [:logseq.property/created-by-ref :logseq.property.embedding/hnsw-label-updated-at])
|
|
|
|
|
|
|
@@ -96,7 +99,8 @@
|
|
|
[db' property-ent pvalue properties-config' {:keys [property-value-uuids?] :as options'}]
|
|
[db' property-ent pvalue properties-config' {:keys [property-value-uuids?] :as options'}]
|
|
|
(if-let [build-page (and (not property-value-uuids?) (build-pvalue-entity-for-build-page pvalue))]
|
|
(if-let [build-page (and (not property-value-uuids?) (build-pvalue-entity-for-build-page pvalue))]
|
|
|
build-page
|
|
build-page
|
|
|
- (if (contains? #{:node :date} (:logseq.property/type property-ent))
|
|
|
|
|
|
|
+ (if (and (contains? #{:node :date :entity} (:logseq.property/type property-ent))
|
|
|
|
|
+ (not= :logseq.property/default-value (:db/ident property-ent)))
|
|
|
;; Idents take precedence over uuid because they keep data graph-agnostic
|
|
;; Idents take precedence over uuid because they keep data graph-agnostic
|
|
|
(if (:db/ident pvalue)
|
|
(if (:db/ident pvalue)
|
|
|
(:db/ident pvalue)
|
|
(:db/ident pvalue)
|
|
@@ -259,7 +263,7 @@
|
|
|
(build-node-properties db entity ent-properties (dissoc options :shallow-copy? :include-uuid-fn)))
|
|
(build-node-properties db entity ent-properties (dissoc options :shallow-copy? :include-uuid-fn)))
|
|
|
build-properties (when (and (not shallow-copy?) (seq ent-properties))
|
|
build-properties (when (and (not shallow-copy?) (seq ent-properties))
|
|
|
(buildable-properties db ent-properties (merge properties new-properties) options))
|
|
(buildable-properties db ent-properties (merge properties new-properties) options))
|
|
|
- build-node (cond-> {:block/title (block-title entity)}
|
|
|
|
|
|
|
+ build-node (cond-> {:block/title (property-value-content entity)}
|
|
|
(some? (:block/collapsed? entity))
|
|
(some? (:block/collapsed? entity))
|
|
|
(assoc :block/collapsed? (:block/collapsed? entity))
|
|
(assoc :block/collapsed? (:block/collapsed? entity))
|
|
|
(:block/link entity)
|
|
(:block/link entity)
|
|
@@ -1157,4 +1161,4 @@
|
|
|
(let [diff (->> (data/diff (prepare-export-to-diff export-map) (prepare-export-to-diff export-map2))
|
|
(let [diff (->> (data/diff (prepare-export-to-diff export-map) (prepare-export-to-diff export-map2))
|
|
|
butlast)]
|
|
butlast)]
|
|
|
(when-not (= [nil nil] diff)
|
|
(when-not (= [nil nil] diff)
|
|
|
- diff)))
|
|
|
|
|
|
|
+ diff)))
|