瀏覽代碼

Merge branch 'master' into enhance/mobile-silk

charlie 4 月之前
父節點
當前提交
5e6e5596aa

+ 1 - 1
.github/workflows/build-android.yml

@@ -42,7 +42,7 @@ on:
 
 env:
   CLOJURE_VERSION: '1.11.1.1413'
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   JAVA_VERSION: '17'
 
 jobs:

+ 1 - 1
.github/workflows/build-desktop-release.yml

@@ -48,7 +48,7 @@ on:
 
 env:
   CLOJURE_VERSION: '1.11.1.1413'
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   JAVA_VERSION: '11'
 
 jobs:

+ 1 - 1
.github/workflows/build-ios-release.yml

@@ -12,7 +12,7 @@ on:
 
 env:
   CLOJURE_VERSION: '1.11.1.1413'
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   JAVA_VERSION: '11'
 
 jobs:

+ 1 - 1
.github/workflows/build-ios.yml

@@ -17,7 +17,7 @@ on:
 
 env:
   CLOJURE_VERSION: '1.11.1.1413'
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   JAVA_VERSION: '11'
 
 jobs:

+ 1 - 1
.github/workflows/build.yml

@@ -14,7 +14,7 @@ env:
   CLOJURE_VERSION: '1.11.1.1413'
   JAVA_VERSION: '11'
   # This is the latest node version we can run.
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   BABASHKA_VERSION: '1.0.168'
 
 jobs:

+ 1 - 1
.github/workflows/db.yml

@@ -27,7 +27,7 @@ env:
   CLOJURE_VERSION: '1.11.1.1413'
   JAVA_VERSION: '11'
   # This is the latest node version we can run.
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   BABASHKA_VERSION: '1.0.168'
 
 jobs:

+ 1 - 1
.github/workflows/graph-parser.yml

@@ -31,7 +31,7 @@ env:
   # This is the same as 1.8.
   JAVA_VERSION: '11'
   # This is the latest node version we can run.
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   BABASHKA_VERSION: '1.0.168'
 
 jobs:

+ 1 - 1
.github/workflows/logseq-common.yml

@@ -23,7 +23,7 @@ env:
   CLOJURE_VERSION: '1.11.1.1413'
   JAVA_VERSION: '11'
   # This is the latest node version we can run.
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   BABASHKA_VERSION: '1.0.168'
 
 jobs:

+ 1 - 1
.github/workflows/publishing.yml

@@ -31,7 +31,7 @@ env:
   # This is the same as 1.8.
   JAVA_VERSION: '11'
   # This is the latest node version we can run.
-  NODE_VERSION: '20'
+  NODE_VERSION: '22'
   BABASHKA_VERSION: '1.0.168'
 
 jobs:

+ 25 - 24
deps/db/src/logseq/db/sqlite/export.cljs

@@ -104,30 +104,31 @@
                           ent-properties (when (and (not (:block/closed-value-property pvalue)) (seq ent-properties*))
                                            (buildable-properties db' ent-properties* properties-config' options'))]
                       (build-pvalue-entity-default db ent-properties pvalue options'))))))]
-    (->> ent-properties
-         (map (fn [[k v]]
-                [k
-                 ;; handle user closed value properties. built-ins have idents and shouldn't be handled here
-                 (if (and (not (db-property/logseq-property? k))
-                          (or (:block/closed-value-property v)
-                              (and (set? v) (:block/closed-value-property (first v)))))
-                   (let [find-closed-uuid (fn [val]
-                                            (or (some #(when (= (:value %) (db-property/property-value-content val))
-                                                         (:uuid %))
-                                                      (get-in properties-config [k :build/closed-values]))
-                                                (throw (ex-info (str "No closed value found for content: " (pr-str (db-property/property-value-content val))) {:properties properties-config}))))]
-                     (if (set? v)
-                       (set (map #(vector :block/uuid (find-closed-uuid %)) v))
-                       [:block/uuid (find-closed-uuid v)]))
-                   (cond
-                     (de/entity? v)
-                     (build-pvalue-entity db (d/entity db k) v properties-config options)
-                     (and (set? v) (every? de/entity? v))
-                     (let [property-ent (d/entity db k)]
-                       (set (map #(build-pvalue-entity db property-ent % properties-config options) v)))
-                     :else
-                     v))]))
-         (into {}))))
+    (let [ignored-properties [:logseq.property/created-by-ref]]
+      (->> (apply dissoc ent-properties ignored-properties)
+           (map (fn [[k v]]
+                  [k
+                   ;; handle user closed value properties. built-ins have idents and shouldn't be handled here
+                   (if (and (not (db-property/logseq-property? k))
+                            (or (:block/closed-value-property v)
+                                (and (set? v) (:block/closed-value-property (first v)))))
+                     (let [find-closed-uuid (fn [val]
+                                              (or (some #(when (= (:value %) (db-property/property-value-content val))
+                                                           (:uuid %))
+                                                        (get-in properties-config [k :build/closed-values]))
+                                                  (throw (ex-info (str "No closed value found for content: " (pr-str (db-property/property-value-content val))) {:properties properties-config}))))]
+                       (if (set? v)
+                         (set (map #(vector :block/uuid (find-closed-uuid %)) v))
+                         [:block/uuid (find-closed-uuid v)]))
+                     (cond
+                       (de/entity? v)
+                       (build-pvalue-entity db (d/entity db k) v properties-config options)
+                       (and (set? v) (every? de/entity? v))
+                       (let [property-ent (d/entity db k)]
+                         (set (map #(build-pvalue-entity db property-ent % properties-config options) v)))
+                       :else
+                       v))]))
+           (into {})))))
 
 (defn- build-export-properties
   "The caller of this fn is responsible for building :build/:property-classes unless shallow-copy?"

+ 5 - 11
deps/outliner/src/logseq/outliner/pipeline.cljs

@@ -184,18 +184,12 @@
                                              (and (coll? v) (every? page-or-object? v))
                                              (map :db/id v)
 
-                                             :else
-                                             (let [datetime? (= :datetime (:logseq.property/type (d/entity db property)))]
-                                               (cond
-                                                 (and datetime? (coll? v))
-                                                 (keep #(get-journal-day-from-long db %) v)
-
-                                                 datetime?
-                                                 (when-let [journal-day (get-journal-day-from-long db v)]
-                                                   [journal-day])
+                                             (contains? #{:logseq.property/scheduled :logseq.property/deadline} (:db/ident (d/entity db property)))
+                                             (when-let [journal-day (get-journal-day-from-long db v)]
+                                               [journal-day])
 
-                                                 :else
-                                                 nil))))))
+                                             :else
+                                             nil))))
 
         property-refs (concat property-key-refs property-value-refs)
         content-refs (block-content-refs db block)]

+ 11 - 8
src/electron/electron/handler.cljs

@@ -31,6 +31,7 @@
             [electron.window :as win]
             [goog.functions :refer [debounce]]
             [logseq.common.graph :as common-graph]
+            [logseq.db :as ldb]
             [logseq.db.common.sqlite :as common-sqlite]
             [logseq.db.sqlite.util :as sqlite-util]
             [promesa.core :as p]))
@@ -279,14 +280,16 @@
       (logger/error "[read txid meta] #" root (.-message e)))))
 
 (defmethod handle :inflateGraphsInfo [_win [_ graphs]]
-  (if (seq graphs)
-    (for [{:keys [root] :as graph} graphs]
-      (if-let [sync-meta (read-txid-info! root)]
-        (assoc graph
-               :sync-meta sync-meta
-               :GraphUUID (second sync-meta))
-        graph))
-    []))
+  (let [graphs (ldb/read-transit-str graphs)]
+    (-> (if (seq graphs)
+          (for [{:keys [root] :as graph} graphs]
+            (if-let [sync-meta (read-txid-info! root)]
+              (assoc graph
+                     :sync-meta sync-meta
+                     :GraphUUID (second sync-meta))
+              graph))
+          [])
+        ldb/write-transit-str)))
 
 (defmethod handle :readGraphTxIdInfo [_win [_ root]]
   (read-txid-info! root))

+ 1 - 0
src/main/electron/ipc.cljs

@@ -5,6 +5,7 @@
             [frontend.util :as util]))
 
 ;; TODO: handle errors
+;;; TODO: transit-write args, transit-read response
 (defn ipc
   [& args]
   (when (util/electron?)

+ 6 - 3
src/main/frontend/handler/repo.cljs

@@ -24,6 +24,7 @@
             [frontend.util :as util]
             [frontend.util.text :as text-util]
             [logseq.common.config :as common-config]
+            [logseq.db :as ldb]
             [logseq.db.frontend.schema :as db-schema]
             [promesa.core :as p]))
 
@@ -118,10 +119,12 @@
                        nfs-dbs)
           nfs-dbs (and (seq nfs-dbs)
                        (cond (util/electron?)
-                             (ipc/ipc :inflateGraphsInfo nfs-dbs)
+                             (p/chain
+                              (ipc/ipc :inflateGraphsInfo (ldb/write-transit-str nfs-dbs))
+                              ldb/read-transit-str)
 
-                             ;(mobile-util/native-platform?)
-                             ;(util-fs/inflate-graphs-info nfs-dbs)
+                                        ;(mobile-util/native-platform?)
+                                        ;(util-fs/inflate-graphs-info nfs-dbs)
 
                              :else
                              nfs-dbs))]