Browse Source

fix: stop shadowing vars for components

Turn on kondo :shadowed-var lint and fix failures.  If this lint had
been turned on, it would have caught logseq/db-test#38 and saved us time
from debugging which random component was accidentally shadowed by a var
and failing with 'Objects are not valid as a React child'. Also fixed a
few outside components but stopped b/c there are too many to do right
now
Gabriel Horner 1 year ago
parent
commit
5ff364ba1e
32 changed files with 163 additions and 156 deletions
  1. 11 1
      .clj-kondo/config.edn
  2. 3 3
      src/main/frontend/components/all_pages.cljs
  3. 29 29
      src/main/frontend/components/block.cljs
  4. 8 8
      src/main/frontend/components/cmdk/core.cljs
  5. 12 12
      src/main/frontend/components/container.cljs
  6. 1 2
      src/main/frontend/components/content.cljs
  7. 4 4
      src/main/frontend/components/dnd.cljs
  8. 4 4
      src/main/frontend/components/editor.cljs
  9. 22 22
      src/main/frontend/components/icon.cljs
  10. 1 1
      src/main/frontend/components/journal.cljs
  11. 2 2
      src/main/frontend/components/lazy_editor.cljs
  12. 3 3
      src/main/frontend/components/page.cljs
  13. 4 5
      src/main/frontend/components/plugins.cljs
  14. 9 9
      src/main/frontend/components/property/closed_value.cljs
  15. 2 2
      src/main/frontend/components/property/value.cljs
  16. 2 2
      src/main/frontend/components/property_v2.cljs
  17. 5 5
      src/main/frontend/components/query/builder.cljs
  18. 5 5
      src/main/frontend/components/query_table.cljs
  19. 1 1
      src/main/frontend/components/repo.cljs
  20. 4 4
      src/main/frontend/components/right_sidebar.cljs
  21. 4 4
      src/main/frontend/components/rtc/indicator.cljs
  22. 2 2
      src/main/frontend/components/settings.cljs
  23. 2 2
      src/main/frontend/components/user/login.cljs
  24. 3 3
      src/main/frontend/components/views.cljs
  25. 6 6
      src/main/frontend/config.cljs
  26. 0 1
      src/main/frontend/db/model.cljs
  27. 7 7
      src/main/frontend/db/query_dsl.cljs
  28. 1 1
      src/main/frontend/extensions/tldraw.cljs
  29. 1 1
      src/main/frontend/handler.cljs
  30. 1 1
      src/main/frontend/publishing.cljs
  31. 3 3
      src/main/frontend/routes.cljs
  32. 1 1
      src/main/logseq/sdk/experiments.cljs

+ 11 - 1
.clj-kondo/config.edn

@@ -3,7 +3,17 @@
  :config-in-ns
  :config-in-ns
  ;; :used-underscored-binding is turned off for components because of false positive
  ;; :used-underscored-binding is turned off for components because of false positive
  ;; for rum/defcs and _state.
  ;; for rum/defcs and _state.
- {all-components {:linters {:used-underscored-binding {:level :off}}}
+ {all-components
+  {:linters {:used-underscored-binding {:level :off}
+             ;; TODO: Apply this to all of frontend
+             :shadowed-var {:level :warning
+                            ;; FIXME: Remove most of these as shadowing core fns isn't a good practice
+                            :exclude [t name binding type uuid key val time fn ex-data list
+                                      keys vals sort-by namespace count parents int? hash subs
+                                      load-file exists? rest object? min max class array range string? delay?
+                                      new var re-pattern update iter ns char resolve sequence identity
+                                      dispatch-fn identity comp max-key vec meta next delay str vector list? chars
+                                      chunk test]}}}
   ;; false positive with match/match and _
   ;; false positive with match/match and _
   frontend.handler.paste {:linters {:used-underscored-binding {:level :off}}}
   frontend.handler.paste {:linters {:used-underscored-binding {:level :off}}}
   frontend.db {:linters {:aliased-namespace-symbol
   frontend.db {:linters {:aliased-namespace-symbol

+ 3 - 3
src/main/frontend/components/all_pages.cljs

@@ -46,8 +46,8 @@
   []
   []
   (let [db (db/get-db)
   (let [db (db/get-db)
         [data set-data!] (rum/use-state (get-all-pages))
         [data set-data!] (rum/use-state (get-all-pages))
-        columns (views/build-columns {} (columns db)
-                                     {:with-object-name? false})
+        columns' (views/build-columns {} (columns db)
+                                      {:with-object-name? false})
         view-entity (first (ldb/get-all-pages-views db))]
         view-entity (first (ldb/get-all-pages-views db))]
     (rum/use-effect!
     (rum/use-effect!
      (fn []
      (fn []
@@ -61,7 +61,7 @@
      (views/view view-entity {:data data
      (views/view view-entity {:data data
                               :set-data! set-data!
                               :set-data! set-data!
                               :title-key :all-pages/table-title
                               :title-key :all-pages/table-title
-                              :columns columns
+                              :columns columns'
                               :on-delete-rows (fn [table selected-rows]
                               :on-delete-rows (fn [table selected-rows]
                                                 (shui/dialog-open!
                                                 (shui/dialog-open!
                                                  (component-page/batch-delete-dialog
                                                  (component-page/batch-delete-dialog

+ 29 - 29
src/main/frontend/components/block.cljs

@@ -1637,8 +1637,8 @@
             (youtube/youtube-video youtube-id nil))))
             (youtube/youtube-video youtube-id nil))))
 
 
       (= name "youtube-timestamp")
       (= name "youtube-timestamp")
-      (when-let [timestamp (first arguments)]
-        (when-let [seconds (youtube/parse-timestamp timestamp)]
+      (when-let [timestamp' (first arguments)]
+        (when-let [seconds (youtube/parse-timestamp timestamp')]
           (youtube/timestamp seconds)))
           (youtube/timestamp seconds)))
 
 
       (= name "zotero-imported-file")
       (= name "zotero-imported-file")
@@ -2370,12 +2370,12 @@
   "Tags without inline tags"
   "Tags without inline tags"
   [config block hover?]
   [config block hover?]
   (when (:block/raw-title block)
   (when (:block/raw-title block)
-    (let [tags (->>
+    (let [tags' (->>
                 (:block/tags block)
                 (:block/tags block)
                 (remove (fn [t] (ldb/inline-tag? (:block/raw-title block) t))))
                 (remove (fn [t] (ldb/inline-tag? (:block/raw-title block) t))))
-          block-tags (if (and (not hover?) (= [:logseq.class/Task] (map :db/ident tags)))
-                       (remove (fn [t] (= (:db/ident t) :logseq.class/Task)) tags)
-                       tags)]
+          block-tags (if (and (not hover?) (= [:logseq.class/Task] (map :db/ident tags')))
+                       (remove (fn [t] (= (:db/ident t) :logseq.class/Task)) tags')
+                       tags')]
       (when (seq block-tags)
       (when (seq block-tags)
         [:div.block-tags.flex.flex-row.flex-wrap.items-center.gap-1
         [:div.block-tags.flex.flex-row.flex-wrap.items-center.gap-1
          (for [tag block-tags]
          (for [tag block-tags]
@@ -2504,8 +2504,8 @@
         nil)]]))
         nil)]]))
 
 
 (rum/defc block-refs-count < rum/static
 (rum/defc block-refs-count < rum/static
-  [block block-refs-count *hide-block-refs?]
-  (when (> block-refs-count 0)
+  [block block-refs-count' *hide-block-refs?]
+  (when (> block-refs-count' 0)
     (shui/button {:variant :ghost
     (shui/button {:variant :ghost
                   :title "Open block references"
                   :title "Open block references"
                   :class "px-2 py-0 w-6 h-6 opacity-70 hover:opacity-100"
                   :class "px-2 py-0 w-6 h-6 opacity-70 hover:opacity-100"
@@ -2517,7 +2517,7 @@
                                  (:db/id block)
                                  (:db/id block)
                                  :block-ref)
                                  :block-ref)
                                 (swap! *hide-block-refs? not)))}
                                 (swap! *hide-block-refs? not)))}
-      [:span.text-sm block-refs-count])))
+      [:span.text-sm block-refs-count'])))
 
 
 (rum/defc block-left-menu < rum/reactive
 (rum/defc block-left-menu < rum/reactive
   [_config {:block/keys [uuid] :as _block}]
   [_config {:block/keys [uuid] :as _block}]
@@ -2747,7 +2747,7 @@
                                       (if (seq ast-title)
                                       (if (seq ast-title)
                                         (->elem :span.inline-wrap (map-inline config ast-title))
                                         (->elem :span.inline-wrap (map-inline config ast-title))
                                         (->elem :div (markup-elements-cp config ast-body))))]))))
                                         (->elem :div (markup-elements-cp config ast-body))))]))))
-              breadcrumb (->> (into [] parents-props)
+              breadcrumbs (->> (into [] parents-props)
                               (concat [page-name-props] (when more? [:more]))
                               (concat [page-name-props] (when more? [:more]))
                               (filterv identity)
                               (filterv identity)
                               (map (fn [x]
                               (map (fn [x]
@@ -2756,9 +2756,9 @@
                                          (rum/with-key (breadcrumb-fragment config block label opts) (:block/uuid block)))
                                          (rum/with-key (breadcrumb-fragment config block label opts) (:block/uuid block)))
                                        [:span.opacity-70 "⋯"])))
                                        [:span.opacity-70 "⋯"])))
                               (interpose (breadcrumb-separator)))]
                               (interpose (breadcrumb-separator)))]
-          (when (seq breadcrumb)
+          (when (seq breadcrumbs)
             [:div.breadcrumb.block-parents
             [:div.breadcrumb.block-parents
-             {:class (when (seq breadcrumb)
+             {:class (when (seq breadcrumbs)
                        (str (when-not (:search? config)
                        (str (when-not (:search? config)
                               " my-2")
                               " my-2")
                             (when indent?
                             (when indent?
@@ -2766,11 +2766,11 @@
              (when (and (false? (:top-level? config))
              (when (and (false? (:top-level? config))
                         (seq parents))
                         (seq parents))
                (breadcrumb-separator))
                (breadcrumb-separator))
-             breadcrumb
+             breadcrumbs
              (when end-separator? (breadcrumb-separator))]))))))
              (when end-separator? (breadcrumb-separator))]))))))
 
 
 (defn- block-drag-over
 (defn- block-drag-over
-  [event uuid top? block-id *move-to]
+  [event uuid top? block-id *move-to']
   (util/stop event)
   (util/stop event)
   (when-not (dnd-same-block? uuid)
   (when-not (dnd-same-block? uuid)
     (let [over-block (gdom/getElement block-id)
     (let [over-block (gdom/getElement block-id)
@@ -2789,25 +2789,25 @@
                           :else
                           :else
                           :sibling)]
                           :sibling)]
       (reset! *drag-to-block block-id)
       (reset! *drag-to-block block-id)
-      (reset! *move-to move-to-value))))
+      (reset! *move-to' move-to-value))))
 
 
 (defn- block-drag-leave
 (defn- block-drag-leave
-  [*move-to]
-  (reset! *move-to nil))
+  [*move-to']
+  (reset! *move-to' nil))
 
 
 (defn block-drag-end
 (defn block-drag-end
   ([_event]
   ([_event]
    (block-drag-end _event *move-to))
    (block-drag-end _event *move-to))
-  ([_event *move-to]
+  ([_event *move-to']
    (reset! *dragging? false)
    (reset! *dragging? false)
    (reset! *dragging-block nil)
    (reset! *dragging-block nil)
    (reset! *drag-to-block nil)
    (reset! *drag-to-block nil)
-   (reset! *move-to nil)
+   (reset! *move-to' nil)
    (editor-handler/unhighlight-blocks!)))
    (editor-handler/unhighlight-blocks!)))
 
 
 (defn- block-drop
 (defn- block-drop
   "Block on-drop handler"
   "Block on-drop handler"
-  [^js event uuid target-block original-block *move-to]
+  [^js event uuid target-block original-block *move-to']
   (util/stop event)
   (util/stop event)
   (when-not (dnd-same-block? uuid)
   (when-not (dnd-same-block? uuid)
     (let [block-uuids (state/get-selection-block-ids)
     (let [block-uuids (state/get-selection-block-ids)
@@ -2817,7 +2817,7 @@
           blocks (remove-nils blocks)]
           blocks (remove-nils blocks)]
       (if (seq blocks)
       (if (seq blocks)
         ;; dnd block moving in current Logseq instance
         ;; dnd block moving in current Logseq instance
-        (dnd/move-blocks event blocks target-block original-block @*move-to)
+        (dnd/move-blocks event blocks target-block original-block @*move-to')
         ;; handle DataTransfer
         ;; handle DataTransfer
         (let [repo (state/get-current-repo)
         (let [repo (state/get-current-repo)
               data-transfer (.-dataTransfer event)
               data-transfer (.-dataTransfer event)
@@ -2829,8 +2829,8 @@
                text
                text
                {:block-uuid  uuid
                {:block-uuid  uuid
                 :edit-block? false
                 :edit-block? false
-                :sibling?    (= @*move-to :sibling)
-                :before?     (= @*move-to :top)}))
+                :sibling?    (= @*move-to' :sibling)
+                :before?     (= @*move-to' :top)}))
 
 
             (contains? transfer-types "Files")
             (contains? transfer-types "Files")
             (let [files (.-files data-transfer)
             (let [files (.-files data-transfer)
@@ -2862,7 +2862,7 @@
 
 
             :else
             :else
             (prn ::unhandled-drop-data-transfer-type transfer-types))))))
             (prn ::unhandled-drop-data-transfer-type transfer-types))))))
-  (block-drag-end event *move-to))
+  (block-drag-end event *move-to'))
 
 
 (defn- block-mouse-over
 (defn- block-mouse-over
   [e *control-show? block-id doc-mode?]
   [e *control-show? block-id doc-mode?]
@@ -2893,15 +2893,15 @@
     (state/into-selection-mode!)))
     (state/into-selection-mode!)))
 
 
 (defn- on-drag-and-mouse-attrs
 (defn- on-drag-and-mouse-attrs
-  [block original-block uuid top? block-id *move-to]
+  [block original-block uuid top? block-id *move-to']
   {:on-drag-over (fn [event]
   {:on-drag-over (fn [event]
-                   (block-drag-over event uuid top? block-id *move-to))
+                   (block-drag-over event uuid top? block-id *move-to'))
    :on-drag-leave (fn [_event]
    :on-drag-leave (fn [_event]
-                    (block-drag-leave *move-to))
+                    (block-drag-leave *move-to'))
    :on-drop (fn [event]
    :on-drop (fn [event]
-              (block-drop event uuid block original-block *move-to))
+              (block-drop event uuid block original-block *move-to'))
    :on-drag-end (fn [event]
    :on-drag-end (fn [event]
-                  (block-drag-end event *move-to))})
+                  (block-drag-end event *move-to'))})
 
 
 (defn- root-block?
 (defn- root-block?
   [config block]
   [config block]

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

@@ -86,8 +86,8 @@
   (let [sidebar? (:sidebar? (last (:rum/args state)))
   (let [sidebar? (:sidebar? (last (:rum/args state)))
         results @(::results state)
         results @(::results state)
         input @(::input state)
         input @(::input state)
-        filter @(::filter state)
-        filter-group (:group filter)
+        filter' @(::filter state)
+        filter-group (:group filter')
         index (volatile! -1)
         index (volatile! -1)
         visible-items (fn [group]
         visible-items (fn [group]
                         (let [{:keys [items show]} (get results group)]
                         (let [{:keys [items show]} (get results group)]
@@ -556,7 +556,7 @@
         highlighted-item (or @(::highlighted-item state) first-item)
         highlighted-item (or @(::highlighted-item state) first-item)
         highlighted-group @(::highlighted-group state)
         highlighted-group @(::highlighted-group state)
         *mouse-active? (::mouse-active? state')
         *mouse-active? (::mouse-active? state')
-        filter @(::filter state)
+        filter' @(::filter state)
         can-show-less? (< GROUP-LIMIT (count visible-items))
         can-show-less? (< GROUP-LIMIT (count visible-items))
         can-show-more? (< (count visible-items) (count items))
         can-show-more? (< (count visible-items) (count items))
         show-less #(swap! (::results state) assoc-in [group :show] :less)
         show-less #(swap! (::results state) assoc-in [group :show] :less)
@@ -586,7 +586,7 @@
 
 
          (when (and (= group highlighted-group)
          (when (and (= group highlighted-group)
                     (or can-show-more? can-show-less?)
                     (or can-show-more? can-show-less?)
-                    (empty? filter)
+                    (empty? filter')
                     (not sidebar?))
                     (not sidebar?))
            [:a.text-link.select-node.opacity-50.hover:opacity-90
            [:a.text-link.select-node.opacity-50.hover:opacity-90
             {:on-click (if (= show :more) show-less show-more)}
             {:on-click (if (= show :more) show-less show-more)}
@@ -737,11 +737,11 @@
       (and enter? (not composing?)) (do
       (and enter? (not composing?)) (do
                                       (handle-action :default state e)
                                       (handle-action :default state e)
                                       (util/stop-propagation e))
                                       (util/stop-propagation e))
-      esc? (let [filter @(::filter state)]
+      esc? (let [filter' @(::filter state)]
              (when-not (string/blank? input)
              (when-not (string/blank? input)
                (util/stop e)
                (util/stop e)
                (handle-input-change state nil ""))
                (handle-input-change state nil ""))
-             (when (and filter (string/blank? input))
+             (when (and filter' (string/blank? input))
                (util/stop e)
                (util/stop e)
                (reset! (::filter state) nil)
                (reset! (::filter state) nil)
                (load-results :default state)))
                (load-results :default state)))
@@ -830,9 +830,9 @@
   {:init (fn [state]
   {:init (fn [state]
            (assoc state ::rand-tip (rand-tip)))}
            (assoc state ::rand-tip (rand-tip)))}
   [inner-state state]
   [inner-state state]
-  (let [filter @(::filter state)]
+  (let [filter' @(::filter state)]
     (cond
     (cond
-      filter
+      filter'
       [:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
       [:div.flex.flex-row.gap-1.items-center.opacity-50.hover:opacity-100
        [:div "Type"]
        [:div "Type"]
        (shui/shortcut "esc" {:tiled false})
        (shui/shortcut "esc" {:tiled false})

+ 12 - 12
src/main/frontend/components/container.cljs

@@ -167,16 +167,16 @@
         (rfe/push-state :page {:name "Favorites"})
         (rfe/push-state :page {:name "Favorites"})
         (util/stop e))}
         (util/stop e))}
      (when (seq favorite-entities)
      (when (seq favorite-entities)
-       (let [favorites (map
-                        (fn [e]
-                          (let [icon (icon/get-node-icon e {})]
-                            {:id (str (:db/id e))
-                             :value (:block/uuid e)
-                             :content [:li.favorite-item (page-name e icon false)]}))
-                        favorite-entities)]
-         (dnd-component/items favorites
-                              {:on-drag-end (fn [favorites]
-                                              (page-handler/<reorder-favorites! favorites))
+       (let [favorite-items (map
+                             (fn [e]
+                               (let [icon (icon/get-node-icon e {})]
+                                 {:id (str (:db/id e))
+                                  :value (:block/uuid e)
+                                  :content [:li.favorite-item (page-name e icon false)]}))
+                             favorite-entities)]
+         (dnd-component/items favorite-items
+                              {:on-drag-end (fn [favorites']
+                                              (page-handler/<reorder-favorites! favorites'))
                                :parent-node :ul.favorites.text-sm}))))))
                                :parent-node :ul.favorites.text-sm}))))))
 
 
 (rum/defc recent-pages < rum/reactive db-mixins/query
 (rum/defc recent-pages < rum/reactive db-mixins/query
@@ -845,7 +845,7 @@
      (mixins/listen state js/window "keyup"
      (mixins/listen state js/window "keyup"
                     (fn [_e]
                     (fn [_e]
                       (state/set-state! :editor/latest-shortcut nil)))))
                       (state/set-state! :editor/latest-shortcut nil)))))
-  [state route-match main-content]
+  [state route-match main-content']
   (let [{:keys [open-fn]} state
   (let [{:keys [open-fn]} state
         current-repo (state/sub :git/current-repo)
         current-repo (state/sub :git/current-repo)
         granted? (state/sub [:nfs/user-granted? (state/get-current-repo)])
         granted? (state/sub [:nfs/user-granted? (state/get-current-repo)])
@@ -939,7 +939,7 @@
                :indexeddb-support?  indexeddb-support?
                :indexeddb-support?  indexeddb-support?
                :light?              light?
                :light?              light?
                :db-restoring?       db-restoring?
                :db-restoring?       db-restoring?
-               :main-content        main-content
+               :main-content        main-content'
                :show-action-bar?    show-action-bar?
                :show-action-bar?    show-action-bar?
                :show-recording-bar? show-recording-bar?})]
                :show-recording-bar? show-recording-bar?})]
 
 

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

@@ -454,7 +454,6 @@
   [state id {:keys [format
   [state id {:keys [format
                     config
                     config
                     hiccup
                     hiccup
-                    content
                     on-click
                     on-click
                     on-hide]
                     on-hide]
              :as option}]
              :as option}]
@@ -463,4 +462,4 @@
      (hiccup-content id option)]
      (hiccup-content id option)]
     ;; TODO: remove this
     ;; TODO: remove this
     (let [format (common-util/normalize-format format)]
     (let [format (common-util/normalize-format format)]
-      (non-hiccup-content id content on-click on-hide config format))))
+      (non-hiccup-content id (:content option) on-click on-hide config format))))

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

@@ -39,7 +39,7 @@
   (let [ids (mapv :id col)
   (let [ids (mapv :id col)
         items' (bean/->js ids)
         items' (bean/->js ids)
         id->item (zipmap ids col)
         id->item (zipmap ids col)
-        [items set-items] (rum/use-state items')
+        [items-state set-items] (rum/use-state items')
         _ (rum/use-effect! (fn [] (set-items items')) [col])
         _ (rum/use-effect! (fn [] (set-items items')) [col])
         [_active-id set-active-id] (rum/use-state nil)
         [_active-id set-active-id] (rum/use-state nil)
         sensors (useSensors (useSensor PointerSensor (bean/->js {:activationConstraint {:distance 8}})))
         sensors (useSensors (useSensor PointerSensor (bean/->js {:activationConstraint {:distance 8}})))
@@ -55,7 +55,7 @@
                                    (when-not (= active-id over-id)
                                    (when-not (= active-id over-id)
                                      (let [old-index (.indexOf ids active-id)
                                      (let [old-index (.indexOf ids active-id)
                                            new-index (.indexOf ids over-id)
                                            new-index (.indexOf ids over-id)
-                                           new-items (arrayMove items old-index new-index)]
+                                           new-items (arrayMove items-state old-index new-index)]
                                        (when (fn? on-drag-end)
                                        (when (fn? on-drag-end)
                                          (let [new-values (->> (map (fn [id]
                                          (let [new-values (->> (map (fn [id]
                                                                       (let [item (id->item id)]
                                                                       (let [item (id->item id)]
@@ -66,7 +66,7 @@
                                            (if (not= (count new-values) (count ids))
                                            (if (not= (count new-values) (count ids))
                                              (do
                                              (do
                                                (js/console.error "Dnd length not matched: ")
                                                (js/console.error "Dnd length not matched: ")
-                                               {:old-items items
+                                               {:old-items items-state
                                                 :new-items new-items})
                                                 :new-items new-items})
                                              (do
                                              (do
                                                (set-items new-items)
                                                (set-items new-items)
@@ -76,7 +76,7 @@
                                                                                      :down
                                                                                      :down
                                                                                      :up)}))))))))
                                                                                      :up)}))))))))
                                  (set-active-id nil)))}
                                  (set-active-id nil)))}
-        sortable-opts {:items items
+        sortable-opts {:items items-state
                        :strategy (if vertical?
                        :strategy (if vertical?
                                    verticalListSortingStrategy
                                    verticalListSortingStrategy
                                    horizontalListSortingStrategy)}
                                    horizontalListSortingStrategy)}

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

@@ -501,11 +501,11 @@
    {:not-matched-handler (editor-handler/keydown-not-matched-handler format)}))
    {:not-matched-handler (editor-handler/keydown-not-matched-handler format)}))
 
 
 (defn- set-up-key-up!
 (defn- set-up-key-up!
-  [state input input-id]
+  [state input' input-id]
   (mixins/on-key-up
   (mixins/on-key-up
    state
    state
    {}
    {}
-   (editor-handler/keyup-handler state input input-id)))
+   (editor-handler/keyup-handler state input' input-id)))
 
 
 (def search-timeout (atom nil))
 (def search-timeout (atom nil))
 
 
@@ -513,9 +513,9 @@
   [state]
   [state]
   (let [{:keys [id format]} (get-state)
   (let [{:keys [id format]} (get-state)
         input-id id
         input-id id
-        input (gdom/getElement input-id)]
+        input' (gdom/getElement input-id)]
     (set-up-key-down! state format)
     (set-up-key-down! state format)
-    (set-up-key-up! state input input-id)))
+    (set-up-key-up! state input' input-id)))
 
 
 (defn get-editor-style-class
 (defn get-editor-style-class
   "Get textarea css class according to it's content"
   "Get textarea css class according to it's content"

+ 22 - 22
src/main/frontend/components/icon.cljs

@@ -21,14 +21,14 @@
 (defonce emojis (vals (bean/->clj (gobj/get emoji-data "emojis"))))
 (defonce emojis (vals (bean/->clj (gobj/get emoji-data "emojis"))))
 
 
 (defn icon
 (defn icon
-  [icon & [opts]]
+  [icon' & [opts]]
   (cond
   (cond
-    (and (= :emoji (:type icon)) (:id icon))
-    [:em-emoji (merge {:id (:id icon)}
+    (and (= :emoji (:type icon')) (:id icon'))
+    [:em-emoji (merge {:id (:id icon')}
                       opts)]
                       opts)]
 
 
-    (and (= :tabler-icon (:type icon)) (:id icon))
-    (ui/icon (:id icon) opts)))
+    (and (= :tabler-icon (:type icon')) (:id icon'))
+    (ui/icon (:id icon') opts)))
 
 
 (defn get-node-icon
 (defn get-node-icon
   [node-entity opts]
   [node-entity opts]
@@ -76,9 +76,9 @@
 (defn- search
 (defn- search
   [q tab]
   [q tab]
   (p/let [icons (when (not= tab :emoji) (search-tabler-icons q))
   (p/let [icons (when (not= tab :emoji) (search-tabler-icons q))
-          emojis (when (not= tab :icon) (search-emojis q))]
+          emojis' (when (not= tab :icon) (search-emojis q))]
     {:icons icons
     {:icons icons
-     :emojis emojis}))
+     :emojis emojis'}))
 
 
 (rum/defc icons-row
 (rum/defc icons-row
   [items]
   [items]
@@ -136,38 +136,38 @@
    [:em-emoji {:id id}]])
    [:em-emoji {:id id}]])
 
 
 (rum/defc emojis-cp < rum/static
 (rum/defc emojis-cp < rum/static
-  [emojis {:keys [searching?] :as opts}]
+  [emojis' {:keys [searching?] :as opts}]
   (pane-section
   (pane-section
-    (util/format "Emojis (%s)" (count emojis))
-    (for [emoji emojis]
+    (util/format "Emojis (%s)" (count emojis'))
+    (for [emoji emojis']
       (rum/with-key (emoji-cp emoji opts) (:id emoji)))
       (rum/with-key (emoji-cp emoji opts) (:id emoji)))
     {:virtual-list? true
     {:virtual-list? true
      :searching? searching?}))
      :searching? searching?}))
 
 
 (rum/defc icon-cp < rum/static
 (rum/defc icon-cp < rum/static
-  [icon {:keys [on-chosen hover]}]
+  [icon' {:keys [on-chosen hover]}]
   [:button.w-9.h-9.transition-opacity
   [:button.w-9.h-9.transition-opacity
-   (when-let [icon (cond-> icon (string? icon) (string/replace " " ""))]
-     {:key icon
+   (when-let [icon' (cond-> icon' (string? icon') (string/replace " " ""))]
+     {:key icon'
       :tabIndex "0"
       :tabIndex "0"
-      :title icon
+      :title icon'
       :on-click (fn [e]
       :on-click (fn [e]
                   (on-chosen e {:type :tabler-icon
                   (on-chosen e {:type :tabler-icon
-                                :id icon
-                                :name icon}))
+                                :id icon'
+                                :name icon'}))
       :on-mouse-over #(reset! hover {:type :tabler-icon
       :on-mouse-over #(reset! hover {:type :tabler-icon
-                                     :id icon
-                                     :name icon
-                                     :icon icon})
+                                     :id icon'
+                                     :name icon'
+                                     :icon icon'})
       :on-mouse-out #()})
       :on-mouse-out #()})
-   (ui/icon icon {:size 24})])
+   (ui/icon icon' {:size 24})])
 
 
 (rum/defc icons-cp < rum/static
 (rum/defc icons-cp < rum/static
   [icons {:keys [searching?] :as opts}]
   [icons {:keys [searching?] :as opts}]
   (pane-section
   (pane-section
     (util/format "Icons (%s)" (count icons))
     (util/format "Icons (%s)" (count icons))
-    (for [icon icons]
-      (icon-cp icon opts))
+    (for [icon' icons]
+      (icon-cp icon' opts))
     {:virtual-list? true
     {:virtual-list? true
      :searching? searching?}))
      :searching? searching?}))
 
 

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

@@ -13,7 +13,7 @@
   [page]
   [page]
   [:div.journal-item.content {:key (:db/id page)}
   [:div.journal-item.content {:key (:db/id page)}
    (let [repo (state/sub :git/current-repo)]
    (let [repo (state/sub :git/current-repo)]
-     (page/page {:repo repo
+     (page/page-cp {:repo repo
                  :page-name (str (:block/uuid page))}))])
                  :page-name (str (:block/uuid page))}))])
 
 
 (defn on-scroll
 (defn on-scroll

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

@@ -32,10 +32,10 @@
                     (reset! loaded? true))))
                     (reset! loaded? true))))
      state)}
      state)}
   [config id attr code options]
   [config id attr code options]
-  (let [loaded? (rum/react loaded?)
+  (let [loaded?' (rum/react loaded?)
         theme   (state/sub :ui/theme)
         theme   (state/sub :ui/theme)
         code    (or code "")
         code    (or code "")
         code    (string/replace-first code #"\n$" "")]      ;; See-also: #3410
         code    (string/replace-first code #"\n$" "")]      ;; See-also: #3410
-    (if loaded?
+    (if loaded?'
       (@lazy-editor config id attr code theme options)
       (@lazy-editor config id attr code theme options)
       (ui/loading "CodeMirror"))))
       (ui/loading "CodeMirror"))))

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

@@ -104,7 +104,7 @@
                            :sidebar? sidebar?})
                            :sidebar? sidebar?})
          (str (:block/uuid page-e) "-hiccup"))])))
          (str (:block/uuid page-e) "-hiccup"))])))
 
 
-(declare page)
+(declare page-cp)
 
 
 (if config/publishing?
 (if config/publishing?
   (rum/defc dummy-block
   (rum/defc dummy-block
@@ -245,7 +245,7 @@
                (query/custom-query (component-block/wrap-query-components
                (query/custom-query (component-block/wrap-query-components
                                      {:attr {:class "mt-10"}
                                      {:attr {:class "mt-10"}
                                       :editor-box editor/box
                                       :editor-box editor/box
-                                      :page page})
+                                      :page page-cp})
                  query))
                  query))
              (str repo "-custom-query-" (:query query))))]))))
              (str repo "-custom-query-" (:query query))))]))))
 
 
@@ -653,7 +653,7 @@
   [state option]
   [state option]
   (page-inner (assoc option :*loading? (::loading? state))))
   (page-inner (assoc option :*loading? (::loading? state))))
 
 
-(rum/defcs page
+(rum/defcs page-cp
   [state option]
   [state option]
   (rum/with-key
   (rum/with-key
     (page-aux option)
     (page-aux option)

+ 4 - 5
src/main/frontend/components/plugins.cljs

@@ -802,8 +802,7 @@
     (rum/local 1 ::current-page)
     (rum/local 1 ::current-page)
   [state]
   [state]
   (let [*list-node-ref        (rum/create-ref)
   (let [*list-node-ref        (rum/create-ref)
-        installed-plugins     (state/sub [:plugin/installed-plugins])
-        installed-plugins     (vals installed-plugins)
+        installed-plugins'    (vals (state/sub [:plugin/installed-plugins]))
         updating              (state/sub :plugin/installing)
         updating              (state/sub :plugin/installing)
         develop-mode?         (state/sub :ui/developer-mode?)
         develop-mode?         (state/sub :ui/developer-mode?)
         selected-unpacked-pkg (state/sub :plugin/selected-unpacked-pkg)
         selected-unpacked-pkg (state/sub :plugin/selected-unpacked-pkg)
@@ -816,9 +815,9 @@
         *cached-query-flag    (::cached-query-flag state)
         *cached-query-flag    (::cached-query-flag state)
         *current-page         (::current-page state)
         *current-page         (::current-page state)
         default-filter-by?    (= :default @*filter-by)
         default-filter-by?    (= :default @*filter-by)
-        theme-plugins         (filter #(:theme %) installed-plugins)
-        normal-plugins        (filter #(not (:theme %)) installed-plugins)
-        filtered-plugins      (when (seq installed-plugins)
+        theme-plugins         (filter #(:theme %) installed-plugins')
+        normal-plugins        (filter #(not (:theme %)) installed-plugins')
+        filtered-plugins      (when (seq installed-plugins')
                                 (if (= @*category :themes) theme-plugins normal-plugins))
                                 (if (= @*category :themes) theme-plugins normal-plugins))
         total-nums            [(count normal-plugins) (count theme-plugins)]
         total-nums            [(count normal-plugins) (count theme-plugins)]
         filtered-plugins      (if-not default-filter-by?
         filtered-plugins      (if-not default-filter-by?

+ 9 - 9
src/main/frontend/components/property/closed_value.cljs

@@ -200,15 +200,15 @@
         dropdown-opts {:modal-class (util/hiccup->class
         dropdown-opts {:modal-class (util/hiccup->class
                                      "origin-top-right.absolute.left-0.rounded-md.shadow-lg")}]
                                      "origin-top-right.absolute.left-0.rounded-md.shadow-lg")}]
     [:div.closed-values.flex.flex-col
     [:div.closed-values.flex.flex-col
-     (let [choices (doall
-                    (keep (fn [value]
-                            (when-let [block (db/sub-block (:db/id value))]
-                              (let [id (:block/uuid block)]
-                                {:id (str id)
-                                 :value id
-                                 :content (choice-item-content property block (merge opts dropdown-opts))})))
-                          values))]
-       (dnd/items choices
+     (let [choice-items (doall
+                         (keep (fn [value]
+                                 (when-let [block (db/sub-block (:db/id value))]
+                                   (let [id (:block/uuid block)]
+                                     {:id (str id)
+                                      :value id
+                                      :content (choice-item-content property block (merge opts dropdown-opts))})))
+                               values))]
+       (dnd/items choice-items
                   {:on-drag-end (fn [_ {:keys [active-id over-id direction]}]
                   {:on-drag-end (fn [_ {:keys [active-id over-id direction]}]
                                   (let [move-down? (= direction :down)
                                   (let [move-down? (= direction :down)
                                         over (db/entity [:block/uuid (uuid over-id)])
                                         over (db/entity [:block/uuid (uuid over-id)])

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

@@ -767,7 +767,7 @@
         editing? (or editing?
         editing? (or editing?
                      (and (state/sub-editing? [container-id (:block/uuid block)])
                      (and (state/sub-editing? [container-id (:block/uuid block)])
                           (= (:db/id property) (:db/id (:property (state/get-editor-action-data))))))
                           (= (:db/id property) (:db/id (:property (state/get-editor-action-data))))))
-        select-type? (select-type? property type)
+        select-type?' (select-type? property type)
         closed-values? (seq (:property/closed-values property))
         closed-values? (seq (:property/closed-values property))
         select-opts {:on-chosen on-chosen}
         select-opts {:on-chosen on-chosen}
         value (if (and (de/entity? value*) (= (:db/ident value*) :logseq.property/empty-placeholder))
         value (if (and (de/entity? value*) (= (:db/ident value*) :logseq.property/empty-placeholder))
@@ -775,7 +775,7 @@
                 value*)]
                 value*)]
     (if (= :logseq.property/icon (:db/ident property))
     (if (= :logseq.property/icon (:db/ident property))
       (icon-row block)
       (icon-row block)
-      (if (and select-type?
+      (if (and select-type?'
                (not (and (not closed-values?) (= type :date))))
                (not (and (not closed-values?) (= type :date))))
         (single-value-select block property value
         (single-value-select block property value
                              (fn [] (select-item property type value opts))
                              (fn [] (select-item property type value opts))

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

@@ -290,7 +290,7 @@
   [_popup-id property opts]
   [_popup-id property opts]
   (let [title (:block/title property)
   (let [title (:block/title property)
         property-type (get-in property [:block/schema :type])
         property-type (get-in property [:block/schema :type])
-        property-type-label (some-> property-type (property-type-label))
+        property-type-label' (some-> property-type (property-type-label))
         enable-closed-values? (contains? db-property-type/closed-value-property-types
         enable-closed-values? (contains? db-property-type/closed-value-property-types
                                 (or property-type :default))
                                 (or property-type :default))
         icon (:logseq.property/icon property)
         icon (:logseq.property/icon property)
@@ -301,7 +301,7 @@
     [:<>
     [:<>
      (dropdown-editor-menuitem {:icon :edit :title "Property name" :desc [:span.flex.items-center.gap-1 icon title]
      (dropdown-editor-menuitem {:icon :edit :title "Property name" :desc [:span.flex.items-center.gap-1 icon title]
                                 :submenu-content (fn [ops] (name-edit-pane property (assoc ops :disabled? disabled?)))})
                                 :submenu-content (fn [ops] (name-edit-pane property (assoc ops :disabled? disabled?)))})
-     (dropdown-editor-menuitem {:icon :hash :title "Property type" :desc (str property-type-label) :disabled? true})
+     (dropdown-editor-menuitem {:icon :hash :title "Property type" :desc (str property-type-label') :disabled? true})
 
 
      (when enable-closed-values? (empty? (:property/schema.classes property))
      (when enable-closed-values? (empty? (:property/schema.classes property))
        (let [values (:property/closed-values property)]
        (let [values (:property/closed-values property)]

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

@@ -449,16 +449,16 @@
                   "origin-top-right.absolute.left-0.mt-2.ml-2.rounded-md.shadow-lg.w-64")}))
                   "origin-top-right.absolute.left-0.mt-2.ml-2.rounded-md.shadow-lg.w-64")}))
 
 
 (rum/defc clause
 (rum/defc clause
-  [*tree *find loc clause]
-  (when (seq clause)
+  [*tree *find loc clauses]
+  (when (seq clauses)
     [:div.query-builder-clause
     [:div.query-builder-clause
-     (let [kind (keyword (first clause))]
+     (let [kind (keyword (first clauses))]
        (if (query-builder/operators-set kind)
        (if (query-builder/operators-set kind)
          [:div.operator-clause.flex.flex-row.items-center {:data-level (count loc)}
          [:div.operator-clause.flex.flex-row.items-center {:data-level (count loc)}
           [:div.clause-bracket "("]
           [:div.clause-bracket "("]
-          (clauses-group *tree *find (conj loc 0) kind (rest clause))
+          (clauses-group *tree *find (conj loc 0) kind (rest clauses))
           [:div.clause-bracket ")"]]
           [:div.clause-bracket ")"]]
-         (clause-inner *tree loc clause)))]))
+         (clause-inner *tree loc clauses)))]))
 
 
 (rum/defc clauses-group
 (rum/defc clauses-group
   [*tree *find loc kind clauses]
   [*tree *find loc kind clauses]

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

@@ -219,11 +219,11 @@
 (rum/defcs result-table-v1 < rum/reactive
 (rum/defcs result-table-v1 < rum/reactive
   (rum/local false ::select?)
   (rum/local false ::select?)
   (rum/local false ::mouse-down?)
   (rum/local false ::mouse-down?)
-  [state config current-block sort-result sort-state columns {:keys [page?]} map-inline page-cp ->elem inline-text]
+  [state config current-block sort-result' sort-state columns {:keys [page?]} map-inline page-cp ->elem inline-text]
   (let [select? (get state ::select?)
   (let [select? (get state ::select?)
         *mouse-down? (::mouse-down? state)
         *mouse-down? (::mouse-down? state)
         clock-time-total (when-not page?
         clock-time-total (when-not page?
-                           (->> (map #(get-in % [:block/properties :clock-time] 0) sort-result)
+                           (->> (map #(get-in % [:block/properties :clock-time] 0) sort-result')
                                 (apply +)))
                                 (apply +)))
         property-separated-by-commas? (partial text/separated-by-commas? (state/get-config))
         property-separated-by-commas? (partial text/separated-by-commas? (state/get-config))
         db-graph? (config/db-based-graph? (state/get-current-repo))
         db-graph? (config/db-based-graph? (state/get-current-repo))
@@ -243,7 +243,7 @@
                           (name column)))]
                           (name column)))]
             (sortable-title title column sort-state (:block/uuid current-block) {:db-graph? db-graph?})))]]
             (sortable-title title column sort-state (:block/uuid current-block) {:db-graph? db-graph?})))]]
       [:tbody
       [:tbody
-       (for [row sort-result]
+       (for [row sort-result']
          (let [format (:block/format row)]
          (let [format (:block/format row)]
            [:tr.cursor
            [:tr.cursor
             (for [column columns]
             (for [column columns]
@@ -297,5 +297,5 @@
           ;; Sort state needs to be in sync between final result and sortable title
           ;; Sort state needs to be in sync between final result and sortable title
           ;; as user needs to know if there result is sorted
           ;; as user needs to know if there result is sorted
           sort-state (get-sort-state current-block {:db-graph? db-graph?})
           sort-state (get-sort-state current-block {:db-graph? db-graph?})
-          sort-result (sort-result result' (assoc sort-state :page? page? :db-graph? db-graph?))]
-      (result-table-v1 config current-block sort-result sort-state columns options map-inline page-cp ->elem inline-text))))
+          sort-result' (sort-result result' (assoc sort-state :page? page? :db-graph? db-graph?))]
+      (result-table-v1 config current-block sort-result' sort-state columns options map-inline page-cp ->elem inline-text))))

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

@@ -144,7 +144,7 @@
                              (unlink-or-remote-fn!))))}
                              (unlink-or-remote-fn!))))}
             (if only-cloud? "Remove (server)" "Unlink (local)")]))]]]))
             (if only-cloud? "Remove (server)" "Unlink (local)")]))]]]))
 
 
-(rum/defc repos < rum/reactive
+(rum/defc repos-cp < rum/reactive
   []
   []
   (let [login? (boolean (state/sub :auth/id-token))
   (let [login? (boolean (state/sub :auth/id-token))
         repos (state/sub [:me :repos])
         repos (state/sub [:me :repos])

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

@@ -37,22 +37,22 @@
 (rum/defc block-cp < rum/reactive
 (rum/defc block-cp < rum/reactive
   [repo idx block]
   [repo idx block]
   (let [id (:block/uuid block)]
   (let [id (:block/uuid block)]
-    (page/page {:parameters  {:path {:name (str id)}}
+    (page/page-cp {:parameters  {:path {:name (str id)}}
                 :sidebar?    true
                 :sidebar?    true
                 :sidebar/idx idx
                 :sidebar/idx idx
                 :repo        repo})))
                 :repo        repo})))
 
 
 (rum/defc page-cp < rum/reactive
 (rum/defc page-cp < rum/reactive
   [repo page-name]
   [repo page-name]
-  (page/page {:parameters {:path {:name page-name}}
+  (page/page-cp {:parameters {:path {:name page-name}}
               :sidebar?   true
               :sidebar?   true
               :repo       repo}))
               :repo       repo}))
 
 
 (rum/defc contents < rum/reactive db-mixins/query
 (rum/defc contents < rum/reactive db-mixins/query
   []
   []
   [:div.contents.flex-col.flex.ml-3
   [:div.contents.flex-col.flex.ml-3
-   (when-let [contents (db/get-page "contents")]
-     (page/contents-page contents))])
+   (when-let [contents-page (db/get-page "contents")]
+     (page/contents-page contents-page))])
 
 
 (rum/defc shortcut-settings
 (rum/defc shortcut-settings
   []
   []

+ 4 - 4
src/main/frontend/components/rtc/indicator.cljs

@@ -108,19 +108,19 @@
           (let [detail-info                 (rum/react *detail-info)
           (let [detail-info                 (rum/react *detail-info)
                 _                           (state/sub :auth/id-token)
                 _                           (state/sub :auth/id-token)
                 online?                     (state/sub :network/online?)
                 online?                     (state/sub :network/online?)
-                uploading?                  (uploading? detail-info)
-                downloading?                (downloading? detail-info)
+                uploading?'                  (uploading? detail-info)
+                downloading?'                (downloading? detail-info)
                 rtc-state                   (:rtc-state detail-info)
                 rtc-state                   (:rtc-state detail-info)
                 unpushed-block-update-count (:pending-local-ops detail-info)]
                 unpushed-block-update-count (:pending-local-ops detail-info)]
             [:div.cp__rtc-sync
             [:div.cp__rtc-sync
              [:div.cp__rtc-sync-indicator.flex.flex-row.items-center.gap-1
              [:div.cp__rtc-sync-indicator.flex.flex-row.items-center.gap-1
-              (when downloading?
+              (when downloading?'
                 (shui/button
                 (shui/button
                  {:class   "opacity-50"
                  {:class   "opacity-50"
                   :variant :ghost
                   :variant :ghost
                   :size    :sm}
                   :size    :sm}
                  "Downloading..."))
                  "Downloading..."))
-              (when uploading?
+              (when uploading?'
                 (shui/button
                 (shui/button
                  {:class   "opacity-50"
                  {:class   "opacity-50"
                   :variant :ghost
                   :variant :ghost

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

@@ -29,7 +29,7 @@
             [frontend.storage :as storage]
             [frontend.storage :as storage]
             [frontend.ui :as ui]
             [frontend.ui :as ui]
             [frontend.util :refer [classnames web-platform?] :as util]
             [frontend.util :refer [classnames web-platform?] :as util]
-            [frontend.version :refer [version]]
+            [frontend.version :as fv]
             [goog.object :as gobj]
             [goog.object :as gobj]
             [goog.string :as gstring]
             [goog.string :as gstring]
             [promesa.core :as p]
             [promesa.core :as p]
@@ -718,7 +718,7 @@
   (let [preferred-language (state/sub [:preferred-language])
   (let [preferred-language (state/sub [:preferred-language])
         show-radix-themes? true]
         show-radix-themes? true]
     [:div.panel-wrap.is-general
     [:div.panel-wrap.is-general
-     (version-row t version)
+     (version-row t fv/version)
      (language-row t preferred-language)
      (language-row t preferred-language)
      (theme-modes-row t)
      (theme-modes-row t)
      (when (and (util/electron?) (not util/mac?)) (native-titlebar-row t))
      (when (and (util/electron?) (not util/mac?)) (native-titlebar-row t))

+ 2 - 2
src/main/frontend/components/user/login.cljs

@@ -86,13 +86,13 @@
        (LSAuthenticator
        (LSAuthenticator
          {:termsLink "https://blog.logseq.com/terms/"}
          {:termsLink "https://blog.logseq.com/terms/"}
          (fn [^js op]
          (fn [^js op]
-           (let [sign-out!      (.-signOut op)
+           (let [sign-out!'      (.-signOut op)
                  ^js user-proxy (.-user op)
                  ^js user-proxy (.-user op)
                  ^js user       (try (js/JSON.parse (js/JSON.stringify user-proxy))
                  ^js user       (try (js/JSON.parse (js/JSON.stringify user-proxy))
                                      (catch js/Error e
                                      (catch js/Error e
                                        (js/console.error "Error: Amplify user payload:" e)))
                                        (js/console.error "Error: Amplify user payload:" e)))
                  user'          (bean/->clj user)]
                  user'          (bean/->clj user)]
-             (user-pane sign-out! user')))))]))
+             (user-pane sign-out!' user')))))]))
 
 
 (rum/defcs modal-inner <
 (rum/defcs modal-inner <
   shortcut/disable-all-shortcuts
   shortcut/disable-all-shortcuts

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

@@ -734,8 +734,8 @@
     (when (seq filters)
     (when (seq filters)
       [:div.filters-row.flex.flex-row.items-center.gap-4.flex-wrap.pb-2
       [:div.filters-row.flex.flex-row.items-center.gap-4.flex-wrap.pb-2
        (map-indexed
        (map-indexed
-        (fn [idx filter]
-          (let [[property-ident operator value] filter
+        (fn [idx filter']
+          (let [[property-ident operator value] filter'
                 property (if (= property-ident :block/title)
                 property (if (= property-ident :block/title)
                            {:db/ident property-ident
                            {:db/ident property-ident
                             :block/title "Name"}
                             :block/title "Name"}
@@ -757,7 +757,7 @@
                :variant "ghost"
                :variant "ghost"
                :size :sm
                :size :sm
                :on-click (fn [_e]
                :on-click (fn [_e]
-                           (let [new-filters (vec (remove #{filter} filters))]
+                           (let [new-filters (vec (remove #{filter'} filters))]
                              (set-filters! new-filters)))}
                              (set-filters! new-filters)))}
               (ui/icon "x"))]))
               (ui/icon "x"))]))
         filters)])))
         filters)])))

+ 6 - 6
src/main/frontend/config.cljs

@@ -162,17 +162,17 @@
   ([s] (ext-of-video? s true))
   ([s] (ext-of-video? s true))
   ([s html5?]
   ([s html5?]
    (when-let [s (and (string? s) (util/get-file-ext s))]
    (when-let [s (and (string? s) (util/get-file-ext s))]
-     (let [video-formats (cond-> video-formats
-                                 html5? (disj :mkv))]
-       (extname-of-supported? s [video-formats])))))
+     (let [video-formats' (cond-> video-formats
+                            html5? (disj :mkv))]
+       (extname-of-supported? s [video-formats'])))))
 
 
 (defn ext-of-audio?
 (defn ext-of-audio?
   ([s] (ext-of-audio? s true))
   ([s] (ext-of-audio? s true))
   ([s html5?]
   ([s html5?]
    (when-let [s (and (string? s) (util/get-file-ext s))]
    (when-let [s (and (string? s) (util/get-file-ext s))]
-     (let [audio-formats (cond-> audio-formats
-                                 html5? (disj :wma :ogg))]
-       (extname-of-supported? s [audio-formats])))))
+     (let [audio-formats' (cond-> audio-formats
+                            html5? (disj :wma :ogg))]
+       (extname-of-supported? s [audio-formats'])))))
 
 
 (defn ext-of-image?
 (defn ext-of-image?
   [s]
   [s]

+ 0 - 1
src/main/frontend/db/model.cljs

@@ -613,7 +613,6 @@ independent of format as format specific heading characters are stripped"
    (when repo
    (when repo
      (when (conn/get-db repo)
      (when (conn/get-db repo)
        (let [entity (db-utils/entity eid)
        (let [entity (db-utils/entity eid)
-             page? (ldb/page? entity)
              ids (page-alias-set repo eid)]
              ids (page-alias-set repo eid)]
          (->>
          (->>
           (react/q repo
           (react/q repo

+ 7 - 7
src/main/frontend/db/query_dsl.cljs

@@ -661,10 +661,10 @@ Some bindings in this fn:
    (query repo query-string {}))
    (query repo query-string {}))
   ([repo query-string query-opts]
   ([repo query-string query-opts]
    (when (and (string? query-string) (not= "\"\"" query-string))
    (when (and (string? query-string) (not= "\"\"" query-string))
-     (let [{:keys [query rules sort-by blocks? sample]} (parse-query query-string)]
-       (when-let [query' (some-> query (query-wrapper {:blocks? blocks?
-                                                       :block-attrs (when (config/db-based-graph? repo)
-                                                                      db-block-attrs)}))]
+     (let [{query* :query :keys [rules sort-by blocks? sample]} (parse-query query-string)]
+       (when-let [query' (some-> query* (query-wrapper {:blocks? blocks?
+                                                        :block-attrs (when (config/db-based-graph? repo)
+                                                                       db-block-attrs)}))]
          (let [random-samples (if @sample
          (let [random-samples (if @sample
                                 (fn [col]
                                 (fn [col]
                                   (take @sample (shuffle col)))
                                   (take @sample (shuffle col)))
@@ -690,9 +690,9 @@ Some bindings in this fn:
   (when (seq (:query query-m))
   (when (seq (:query query-m))
     (let [query-string (template/resolve-dynamic-template! (pr-str (:query query-m)))
     (let [query-string (template/resolve-dynamic-template! (pr-str (:query query-m)))
           db-graph? (config/db-based-graph? repo)
           db-graph? (config/db-based-graph? repo)
-          {:keys [query sort-by blocks? rules]} (parse query-string {:db-graph? db-graph?})]
-      (when-let [query' (some-> query (query-wrapper {:blocks? blocks?
-                                                      :block-attrs (when db-graph? db-block-attrs)}))]
+          {query* :query :keys [sort-by blocks? rules]} (parse query-string {:db-graph? db-graph?})]
+      (when-let [query' (some-> query* (query-wrapper {:blocks? blocks?
+                                                       :block-attrs (when db-graph? db-block-attrs)}))]
         (query-react/react-query repo
         (query-react/react-query repo
                                  (merge
                                  (merge
                                   query-m
                                   query-m

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

@@ -36,7 +36,7 @@
 
 
 (rum/defc page-cp
 (rum/defc page-cp
   [props]
   [props]
-  (page/page {:page-name (gobj/get props "pageName") :whiteboard? true}))
+  (page/page-cp {:page-name (gobj/get props "pageName") :whiteboard? true}))
 
 
 (rum/defc block-cp
 (rum/defc block-cp
   [props]
   [props]

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

@@ -130,7 +130,7 @@
 
 
 (defn- register-components-fns!
 (defn- register-components-fns!
   []
   []
-  (state/set-page-blocks-cp! page/page)
+  (state/set-page-blocks-cp! page/page-cp)
   (state/set-component! :block/linked-references reference/block-linked-references)
   (state/set-component! :block/linked-references reference/block-linked-references)
   (state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
   (state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
   (state/set-component! :block/single-block block/single-block-cp)
   (state/set-component! :block/single-block block/single-block-cp)

+ 1 - 1
src/main/frontend/publishing.cljs

@@ -87,7 +87,7 @@
 
 
 (defn- register-components-fns!
 (defn- register-components-fns!
   []
   []
-  (state/set-page-blocks-cp! page-component/page)
+  (state/set-page-blocks-cp! page-component/page-cp)
   (state/set-component! :block/linked-references reference/block-linked-references)
   (state/set-component! :block/linked-references reference/block-linked-references)
   (state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
   (state/set-component! :whiteboard/tldraw-preview whiteboard/tldraw-preview)
   (state/set-component! :block/single-block block/single-block-cp)
   (state/set-component! :block/single-block block/single-block-cp)

+ 3 - 3
src/main/frontend/routes.cljs

@@ -27,7 +27,7 @@
 
 
    ["/graphs"
    ["/graphs"
     {:name :graphs
     {:name :graphs
-     :view repo/repos}]
+     :view repo/repos-cp}]
 
 
    ["/whiteboards"
    ["/whiteboards"
     {:name :whiteboards
     {:name :whiteboards
@@ -40,11 +40,11 @@
                    whiteboard? (ldb/whiteboard? (db/get-page page-name))]
                    whiteboard? (ldb/whiteboard? (db/get-page page-name))]
                (if whiteboard?
                (if whiteboard?
                  (whiteboard/whiteboard-route route-match)
                  (whiteboard/whiteboard-route route-match)
-                 (page/page route-match))))}]
+                 (page/page-cp route-match))))}]
 
 
    ["/page/:name/block/:block-route-name"
    ["/page/:name/block/:block-route-name"
     {:name :page-block
     {:name :page-block
-     :view page/page}]
+     :view page/page-cp}]
 
 
    ["/all-pages"
    ["/all-pages"
     {:name :all-pages
     {:name :all-pages

+ 1 - 1
src/main/logseq/sdk/experiments.cljs

@@ -13,7 +13,7 @@
         unlinked-refs? (some-> props1 :include-unlinked-refs)
         unlinked-refs? (some-> props1 :include-unlinked-refs)
         config (some-> props1 (dissoc :page :include-linked-refs :include-unlinked-refs))]
         config (some-> props1 (dissoc :page :include-linked-refs :include-unlinked-refs))]
     (when-let [_entity (page/get-page-entity page-name)]
     (when-let [_entity (page/get-page-entity page-name)]
-      (page/page
+      (page/page-cp
         {:repo (state/get-current-repo)
         {:repo (state/get-current-repo)
          :page-name page-name
          :page-name page-name
          :preview? false
          :preview? false