From e09612ab336b7e3cadda4ac71318bfc9bb9f954b Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 23 Apr 2026 23:27:57 +0800 Subject: [PATCH 0001/1400] enhance(ux): property compact display --- .../src/logseq/outliner/property.cljs | 37 +++++++++-- .../test/logseq/outliner/property_test.cljs | 64 +++++++++++++++++++ src/main/frontend/components/block.cljs | 27 ++++++-- src/main/frontend/components/block.css | 34 ++++++++++ src/main/frontend/components/property.cljs | 52 +++++++++++---- .../frontend/components/property/config.cljs | 2 +- .../components/property/property_test.cljs | 8 +++ 7 files changed, 201 insertions(+), 23 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index 767cc6fc4abf..8886ad272d0c 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -760,22 +760,51 @@ (:classes-properties (get-block-classes-properties db eid))) (common-util/distinct-by :db/id)))) +(defn- schema-or-tag-related-property? + [property-id] + (let [property-ns (some-> property-id namespace)] + (or (= :block/tags property-id) + (= "logseq.property.class" property-ns) + (contains? db-property/schema-properties property-id)))) + +(defn- bottom-position-property? + [property] + (let [property-id (:db/ident property) + property-type (:logseq.property/type property)] + (and (not= :url property-type) + (or (not= :default property-type) + (seq (:property/closed-values property))) + (not (schema-or-tag-related-property? property-id))))) + +(defn- resolved-property-position + [property] + (let [ui-position (:logseq.property/ui-position property)] + (cond + (contains? #{:block-left :block-right :block-below} ui-position) + ui-position + + (bottom-position-property? property) + :block-below + + :else + :properties))) + (defn- property-with-position? [db property-id block position] (when-let [property (entity-plus/entity-memoized db property-id)] - (let [property-position (:logseq.property/ui-position property)] + (let [property-position' (resolved-property-position property)] (and - (= property-position position) + (= property-position' position) (not (and (:logseq.property/hide-empty-value property) (nil? (get block property-id)))) (not (:logseq.property/hide? property)) (not (and - (= property-position :block-below) + (= property-position' :block-below) (nil? (get block property-id)))))))) (defn property-with-other-position? [property] - (not (contains? #{:properties nil} (:logseq.property/ui-position property)))) + (not= :properties (resolved-property-position property))) (defn get-block-positioned-properties [db eid position] diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index 336d68296128..2a6053c88da4 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -346,6 +346,70 @@ (is (= [:user.property/p1 :user.property/p2 :user.property/p3] (map :db/ident (:classes-properties (outliner-property/get-block-classes-properties @conn (:db/id block)))))))) +(deftest property-with-other-position-default-bottom-rules + (testing "explicit non-properties ui-position remains other-position" + (is (true? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :number + :logseq.property/ui-position :block-left})))) + + (testing "number property without explicit ui-position defaults to bottom position" + (is (true? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :number})))) + + (testing "default property without closed values stays in normal property rows" + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :default + :property/closed-values []})))) + + (testing "default property with closed values is positioned in bottom row" + (is (true? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :default + :property/closed-values [{:db/id 1}]})))) + + (testing "url property without explicit ui-position stays in normal property rows" + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :url})))) + + (testing "explicit left/right ui-position remains in positioned rows" + (is (true? + (outliner-property/property-with-other-position? + {:db/ident :user.property/p1 + :logseq.property/type :url + :logseq.property/ui-position :block-left})))) + + (testing "bidirectional config property stays in normal property rows" + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :logseq.property.class/enable-bidirectional? + :logseq.property/type :checkbox})))) + + (testing "tag properties and schema-related properties stay in normal property rows" + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :block/tags + :logseq.property/type :class}))) + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :logseq.property.class/properties + :logseq.property/type :property}))) + (is (false? + (outliner-property/property-with-other-position? + {:db/ident :logseq.property/public? + :logseq.property/type :checkbox})))) + + (testing "a schema property is part of the shared schema set" + (is (contains? db-property/schema-properties :logseq.property/public?)))) + (deftest extends-cycle (testing "Fail when creating a cycle of extends" (let [conn (db-test/create-conn-with-blocks diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 09ef01968283..0627ef4364f1 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2595,16 +2595,33 @@ (when (seq properties) (case position :block-below - [:div.positioned-properties.block-below.flex.flex-row.gap-2.item-center.flex-wrap.text-sm.overflow-x-hidden - (for [property properties] - [:div.flex.flex-row.items-center.gap-1 + [:div.positioned-properties.block-below.flex.flex-row.gap-2.items-center.flex-wrap.text-sm.overflow-x-hidden + (for [[idx property] (map-indexed vector properties)] + [:div.bottom-property-pair.flex.flex-row.items-center.gap-1 {:key (str (:db/id block) "-" (:db/id property))} [:div.flex.flex-row.items-center (property-component/property-key-cp block property opts) [:div.select-none ":"]] - [:div.ls-block.property-value-container + [:div.bottom-property-content.ls-block.property-value-container {:style {:min-height 20}} - (pv/property-value block property opts)]])] + (pv/property-value block property opts) + (when (and (contains? #{:date :number} (:logseq.property/type property)) + (not config/publishing?)) + [:button.bottom-property-edit-icon.select-none + {:type "button" + :on-click (fn [e] + (util/stop e) + (when-let [trigger + (some-> (.-currentTarget e) + (.closest ".bottom-property-content") + (.querySelector ".jtrigger"))] + (.click trigger) + (some-> trigger .focus)))} + (ui/icon "edit" {:size 14})])] + (when (< idx (dec (count properties))) + [:div.bottom-property-separator.select-none ","])]) + (when (and (ldb/page? block) (not config/publishing?)) + (property-component/hidden-properties-toggle-button block))] [:div.positioned-properties.flex.flex-row.gap-1.select-none.h-6.self-start {:class (name position)} (for [property properties] diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 62933023ca43..9e6311186cfe 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1062,6 +1062,40 @@ html.is-mac { .property-k { color: var(--ls-primary-text-color); } + + .bottom-property-pair { + @apply min-w-0; + } + + .bottom-property-content { + @apply flex items-center gap-1 min-w-0; + } + + .bottom-property-separator { + @apply text-muted-foreground; + } + + .bottom-property-edit-icon { + @apply text-muted-foreground inline-flex items-center justify-center p-0 bg-transparent border-0 cursor-pointer; + } + + .ls-block.property-value-container { + min-width: 0; + flex-shrink: 1; + } + + .property-value-inner, + .select-item, + [role="checkbox"] { + @apply items-center; + vertical-align: middle; + } + + svg, + [role="checkbox"] { + @apply self-center; + vertical-align: middle; + } } .block-tags { diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index eecc1a98af1b..892272f8029e 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -680,15 +680,40 @@ properties' (keep (fn [ent] (find prop-kv-map (:db/ident ent))) sorted-prop-entities)] (ordered-properties block properties' sorted-prop-entities opts)))) +(defonce ^:private *show-hidden-properties-block-ids + (atom #{})) + +(defn toggle-hidden-properties-visibility! + [block-uuid] + (when block-uuid + (swap! *show-hidden-properties-block-ids + (fn [ids] + (if (contains? ids block-uuid) + (disj ids block-uuid) + (conj ids block-uuid)))))) + +(defn hidden-properties-visible? + [block-uuid] + (contains? @*show-hidden-properties-block-ids block-uuid)) + +(rum/defc hidden-properties-toggle-button + [block] + (let [block-uuid (:block/uuid block)] + (when block-uuid + (shui/button + {:variant :ghost + :size :sm + :class "px-1 text-muted-foreground h-6 text-xs" + :on-click (fn [e] + (util/stop e) + (toggle-hidden-properties-visibility! block-uuid))} + (t :property/hidden-properties))))) + (rum/defc hidden-properties-cp - [block hidden-properties {:keys [root-block? sidebar-properties?] :as opts}] - (when (and (seq hidden-properties) (or root-block? sidebar-properties?)) - [:details.my-1 - [:summary.text-sm.opacity-50.hover:opacity-90.cursor-pointer - {:style {:margin-left 11}} - [:span.ml-1 (t :property/hidden-properties)]] - [:div.mt-1 - (properties-section block hidden-properties opts)]])) + [block hidden-properties {:keys [show-hidden-properties?] :as opts}] + (when (and show-hidden-properties? (seq hidden-properties)) + [:div.mt-1 + (properties-section block hidden-properties opts)])) (rum/defc load-bidirectional-properties < rum/static [block root-block? set-bidirectional-properties!] @@ -708,13 +733,15 @@ (assoc state ::id (str (random-uuid)) ::block block)))} - [state _target-block {:keys [page-title? journal-page? sidebar-properties? tag-dialog?] :as opts}] + [state _target-block {:keys [sidebar-properties? tag-dialog?] :as opts}] (let [*bidirectional-properties (::bidirectional-properties state) bidirectional-properties @*bidirectional-properties id (::id state) db-id (:db/id (::block state)) block (db/sub-block db-id) show-properties? (or sidebar-properties? tag-dialog?) + show-hidden-properties? (let [shown-block-ids (rum/react *show-hidden-properties-block-ids)] + (contains? shown-block-ids (:block/uuid block))) show-empty-and-hidden-properties? (let [{:keys [mode show? ids]} (state/sub :ui/show-empty-and-hidden-properties?)] (and show? (or (= mode :global) @@ -739,8 +766,6 @@ (ldb/built-in? ent)) ;; other position (when-not (or - sidebar-properties? - (and page-title? (not journal-page?)) show-empty-and-hidden-properties? show-in-hidden-properties?) (outliner-property/property-with-other-position? ent)) @@ -817,6 +842,7 @@ (let [has-bidirectional-properties? (seq bidirectional-properties)] (cond (and (empty? full-properties) (seq hidden-properties) (not root-block?) (not sidebar-properties?) + (not show-hidden-properties?) (not has-bidirectional-properties?)) nil @@ -841,7 +867,7 @@ (when-not class? (hidden-properties-cp block hidden-properties - (assoc opts :root-block? root-block?))) + (assoc opts :show-hidden-properties? show-hidden-properties?))) (when (and page? (not class?)) (rum/with-key (new-property block opts) (str id "-add-property"))) @@ -860,5 +886,5 @@ [:div.ml-4 (properties-section block properties opts') (hidden-properties-cp block hidden-properties - (assoc opts :root-block? root-block?)) + (assoc opts :show-hidden-properties? show-hidden-properties?)) (rum/with-key (new-property block opts') (str id "-class-add-property"))]]))]])))])) diff --git a/src/main/frontend/components/property/config.cljs b/src/main/frontend/components/property/config.cljs index 4eb9b13e5f99..3587fb1dce14 100644 --- a/src/main/frontend/components/property/config.cljs +++ b/src/main/frontend/components/property/config.cljs @@ -674,7 +674,7 @@ special-built-in-prop? (contains? #{:block/title :block/tags :block/created-at :block/updated-at} (:db/ident property))] (->> [(when with-title? - [:h3.font-medium.px-2.py-2.opacity-80.flex.items-center.gap-1 + [:h3.px-2.py-2.opacity-80.flex.items-center.gap-1 (t :property/configure)]) (when-not special-built-in-prop? (dropdown-editor-menuitem {:icon :pencil :title (t :property/name) :desc [:span.flex.items-center.gap-1 icon title] diff --git a/src/test/frontend/components/property/property_test.cljs b/src/test/frontend/components/property/property_test.cljs index 402e919c043b..f41e64de6c01 100644 --- a/src/test/frontend/components/property/property_test.cljs +++ b/src/test/frontend/components/property/property_test.cljs @@ -33,3 +33,11 @@ (is (nil? (:user.property/nodes properties))) (is (= #{:user.property/nodes} recycled-only-property-ids)))) + +(deftest toggle-hidden-properties-visibility-test + (let [block-uuid (random-uuid)] + (is (false? (property-component/hidden-properties-visible? block-uuid))) + (property-component/toggle-hidden-properties-visibility! block-uuid) + (is (true? (property-component/hidden-properties-visible? block-uuid))) + (property-component/toggle-hidden-properties-visibility! block-uuid) + (is (false? (property-component/hidden-properties-visible? block-uuid))))) From 19450bcc778993d720b0d169c87ec08c8ebb5387 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 24 Apr 2026 00:02:53 +0800 Subject: [PATCH 0002/1400] enhance(ux): bottom properties --- .../src/logseq/outliner/property.cljs | 54 ++- .../test/logseq/outliner/property_test.cljs | 20 ++ src/main/frontend/components/block.cljs | 87 +++-- src/main/frontend/components/block.css | 50 ++- src/main/frontend/components/property.cljs | 312 +++++++++++------- src/main/frontend/components/property.css | 100 +++++- .../frontend/components/property/value.cljs | 31 +- src/main/frontend/handler/editor.cljs | 2 +- 8 files changed, 458 insertions(+), 198 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index 8886ad272d0c..a42751db4eb1 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -767,23 +767,37 @@ (= "logseq.property.class" property-ns) (contains? db-property/schema-properties property-id)))) +(defn- tag-class-page? + [db block] + (or (= :logseq.class/Tag (:db/ident block)) + (and db + (ldb/class-instance? (entity-plus/entity-memoized db :logseq.class/Tag) block)))) + (defn- bottom-position-property? - [property] + [db block property] (let [property-id (:db/ident property) property-type (:logseq.property/type property)] - (and (not= :url property-type) - (or (not= :default property-type) - (seq (:property/closed-values property))) - (not (schema-or-tag-related-property? property-id))))) + (if (tag-class-page? db block) + (or (contains? #{:logseq.property.class/extends + :logseq.property.class/enable-bidirectional?} + property-id) + (and (not= :url property-type) + (or (not= :default property-type) + (seq (:property/closed-values property))) + (not (schema-or-tag-related-property? property-id)))) + (and (not= :url property-type) + (or (not= :default property-type) + (seq (:property/closed-values property))) + (not (schema-or-tag-related-property? property-id)))))) (defn- resolved-property-position - [property] + [db block property] (let [ui-position (:logseq.property/ui-position property)] (cond (contains? #{:block-left :block-right :block-below} ui-position) ui-position - (bottom-position-property? property) + (bottom-position-property? db block property) :block-below :else @@ -792,7 +806,7 @@ (defn- property-with-position? [db property-id block position] (when-let [property (entity-plus/entity-memoized db property-id)] - (let [property-position' (resolved-property-position property)] + (let [property-position' (resolved-property-position db block property)] (and (= property-position' position) (not (and (:logseq.property/hide-empty-value property) @@ -800,20 +814,28 @@ (not (:logseq.property/hide? property)) (not (and (= property-position' :block-below) - (nil? (get block property-id)))))))) + (nil? (get block property-id)) + (not (tag-class-page? db block)))))))) (defn property-with-other-position? - [property] - (not= :properties (resolved-property-position property))) + [db block property] + (not= :properties (resolved-property-position db block property))) (defn get-block-positioned-properties [db eid position] (let [block (d/entity db eid) - own-properties (:block.temp/property-keys block)] - (->> (:classes-properties (get-block-classes-properties db eid)) - (map :db/ident) - (concat own-properties) - (distinct) + own-properties (:block.temp/property-keys block) + tag-page-pill-properties (when (tag-class-page? db block) + [:logseq.property.class/extends + :logseq.property.class/enable-bidirectional?]) + positioned-property-ids (if (tag-class-page? db block) + (->> (concat own-properties tag-page-pill-properties) + distinct) + (->> (:classes-properties (get-block-classes-properties db eid)) + (map :db/ident) + (concat own-properties) + distinct))] + (->> positioned-property-ids (filter (fn [id] (property-with-position? db id block position))) (map #(d/entity db %)) (ldb/sort-by-order)))) diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index 2a6053c88da4..575fffa350ed 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -350,6 +350,8 @@ (testing "explicit non-properties ui-position remains other-position" (is (true? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :number :logseq.property/ui-position :block-left})))) @@ -357,12 +359,16 @@ (testing "number property without explicit ui-position defaults to bottom position" (is (true? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :number})))) (testing "default property without closed values stays in normal property rows" (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :default :property/closed-values []})))) @@ -370,6 +376,8 @@ (testing "default property with closed values is positioned in bottom row" (is (true? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :default :property/closed-values [{:db/id 1}]})))) @@ -377,12 +385,16 @@ (testing "url property without explicit ui-position stays in normal property rows" (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :url})))) (testing "explicit left/right ui-position remains in positioned rows" (is (true? (outliner-property/property-with-other-position? + nil + {} {:db/ident :user.property/p1 :logseq.property/type :url :logseq.property/ui-position :block-left})))) @@ -390,20 +402,28 @@ (testing "bidirectional config property stays in normal property rows" (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :logseq.property.class/enable-bidirectional? :logseq.property/type :checkbox})))) (testing "tag properties and schema-related properties stay in normal property rows" (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :block/tags :logseq.property/type :class}))) (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :logseq.property.class/properties :logseq.property/type :property}))) (is (false? (outliner-property/property-with-other-position? + nil + {} {:db/ident :logseq.property/public? :logseq.property/type :checkbox})))) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 0627ef4364f1..914d32f7f299 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2585,49 +2585,64 @@ (rum/defc block-positioned-properties [config block position] (let [properties (outliner-property/get-block-positioned-properties (db/get-db) (:db/id block) position) + has-viewable-properties? (seq properties) opts (merge config {:icon? true :page-cp page-cp :block-cp blocks-container :inline-text inline-text :other-position? true - :property-position position})] - (when (seq properties) - (case position + :property-position position}) + show-page-hidden-properties-toggle? (and (ldb/page? block) + (not config/publishing?)) + show-hidden-properties-toggle? (and has-viewable-properties? + show-page-hidden-properties-toggle? + (property-component/has-hidden-properties? block config)) + show-page-add-property? (and (ldb/page? block) + (not (ldb/class? block)) + (not config/publishing?)) + show-add-property-button? (and has-viewable-properties? + show-page-add-property?)] + (case position :block-below - [:div.positioned-properties.block-below.flex.flex-row.gap-2.items-center.flex-wrap.text-sm.overflow-x-hidden - (for [[idx property] (map-indexed vector properties)] - [:div.bottom-property-pair.flex.flex-row.items-center.gap-1 - {:key (str (:db/id block) "-" (:db/id property))} - [:div.flex.flex-row.items-center - (property-component/property-key-cp block property opts) - [:div.select-none ":"]] - [:div.bottom-property-content.ls-block.property-value-container - {:style {:min-height 20}} - (pv/property-value block property opts) - (when (and (contains? #{:date :number} (:logseq.property/type property)) - (not config/publishing?)) - [:button.bottom-property-edit-icon.select-none - {:type "button" - :on-click (fn [e] - (util/stop e) - (when-let [trigger - (some-> (.-currentTarget e) - (.closest ".bottom-property-content") - (.querySelector ".jtrigger"))] - (.click trigger) - (some-> trigger .focus)))} - (ui/icon "edit" {:size 14})])] - (when (< idx (dec (count properties))) - [:div.bottom-property-separator.select-none ","])]) - (when (and (ldb/page? block) (not config/publishing?)) - (property-component/hidden-properties-toggle-button block))] - [:div.positioned-properties.flex.flex-row.gap-1.select-none.h-6.self-start - {:class (name position)} - (for [property properties] - (rum/with-key - (pv/property-value block property (assoc opts :show-tooltip? true)) - (str (:db/id block) "-" (:db/id property))))])))) + (when has-viewable-properties? + [:div.positioned-properties.block-below.flex.flex-col.gap-1.text-sm.overflow-x-hidden + [:div.bottom-properties-row.flex.flex-row.gap-2.items-center.flex-wrap.overflow-x-hidden + (for [property properties] + [:div.bottom-property-pill + {:key (str (:db/id block) "-" (:db/id property))} + [:div.flex.flex-row.items-center + (property-component/property-key-cp block property opts) + [:div.select-none ":"]] + [:div.bottom-property-content.ls-block.property-value-container + {:style {:min-height 20}} + (pv/property-value block property opts) + (when (contains? #{:number :date :datetime} (:logseq.property/type property)) + [:button.bottom-property-edit-icon.select-none + {:type "button" + :on-click (fn [e] + (util/stop e) + (when-let [trigger + (some-> (.-currentTarget e) + (.closest ".bottom-property-content") + (.querySelector ".jtrigger"))] + (.click trigger) + (some-> trigger .focus)))} + (ui/icon "edit" {:size 14})])]]) + (when show-hidden-properties-toggle? + (property-component/hidden-properties-toggle-button block {:icon-only? true})) + (when show-add-property-button? + (property-component/new-property block (assoc opts + :property-position :block-below + :icon-only? true)))]]) + + (when (seq properties) + [:div.positioned-properties.flex.flex-row.gap-1.select-none.h-6.self-start + {:class (name position)} + (for [property properties] + (rum/with-key + (pv/property-value block property (assoc opts :show-tooltip? true)) + (str (:db/id block) "-" (:db/id property))))])))) (rum/defc block-reactions < rum/reactive db-mixins/query [block] diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 9e6311186cfe..32a54c5e1c8f 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1059,29 +1059,58 @@ html.is-mac { @apply flex; } - .property-k { - color: var(--ls-primary-text-color); + .bottom-properties-row { + @apply gap-1.5 py-1; } - .bottom-property-pair { - @apply min-w-0; + .bottom-property-pill { + @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full; + background-color: var(--ls-secondary-background-color); + box-shadow: inset 0 0 0 1px var(--ls-border-color); } .bottom-property-content { @apply flex items-center gap-1 min-w-0; } - .bottom-property-separator { - @apply text-muted-foreground; + .bottom-property-pill .property-key-inner { + @apply flex items-center min-w-0; + } + + .bottom-property-pill .property-k { + @apply w-auto flex-none whitespace-nowrap leading-[20px]; + max-width: none; + color: var(--ls-primary-text-color); + } + + .bottom-property-pill a.property-k, + .bottom-property-pill .property-key-inner a { + color: var(--ls-primary-text-color); + } + + .ls-new-property { + @apply m-0; + } + + .ls-new-property .jtrigger, + .bottom-property-control-btn { + @apply inline-flex items-center rounded-full px-1.5 py-0.5 h-6 text-xs text-muted-foreground; + box-shadow: inset 0 0 0 1px var(--ls-border-color); } .bottom-property-edit-icon { - @apply text-muted-foreground inline-flex items-center justify-center p-0 bg-transparent border-0 cursor-pointer; + @apply inline-flex items-center justify-center p-0 bg-transparent border-0 text-muted-foreground cursor-pointer; } .ls-block.property-value-container { min-width: 0; - flex-shrink: 1; + flex: 0 1 auto; + width: auto; + min-height: 20px; + } + + .property-value { + @apply pl-0 min-h-[20px]; } .property-value-inner, @@ -1096,6 +1125,11 @@ html.is-mac { @apply self-center; vertical-align: middle; } + + .bullet-container, + .property-icon { + display: none; + } } .block-tags { diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 892272f8029e..98e8eb20f296 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -3,7 +3,6 @@ (:require [clojure.set :as set] [clojure.string :as string] [frontend.components.dnd :as dnd] - [frontend.components.icon :as icon-component] [frontend.components.property.config :as property-config] [frontend.components.property.value :as pv] [frontend.components.select :as select] @@ -307,48 +306,13 @@ (db-property/built-in-display-title property t))) (rum/defc property-key-cp < rum/static - [block property {:keys [other-position? class-schema?]}] - (let [icon (:logseq.property/icon property)] - [:div.property-key-inner.jtrigger-view - ;; icon picker - (when-not other-position? - (let [content-fn (fn [{:keys [id]}] - (icon-component/icon-search - {:on-chosen - (fn [_e icon] - (if icon - (db-property-handler/set-block-property! (:db/id property) - :logseq.property/icon icon) - (db-property-handler/remove-block-property! (:db/id property) - :logseq.property/icon)) - (shui/popup-hide! id)) - :icon-value icon - :del-btn? (boolean icon)}))] - - [:div.property-icon - (shui/trigger-as - :button.property-m - (-> (when-not config/publishing? - {:on-click (fn [^js e] - (shui/popup-show! (.-target e) content-fn - {:as-dropdown? true :auto-focus? true - :content-props {:onEscapeKeyDown #(.preventDefault %)}}))}) - (assoc :class "flex items-center")) - (if icon - (icon-component/icon icon {:size 15 :color? true}) - (property-icon property nil)))])) - - (if config/publishing? - [:a.property-k.flex.select-none.jtrigger - {:on-click #(route-handler/redirect-to-page! (:block/uuid property))} - (db-property/built-in-display-title property t)] - (property-key-title block property class-schema?))])) - -(defn- bidirectional-property-icon-cp - [property] - (if-let [icon (:logseq.property/icon property)] - (icon-component/icon icon {:size 15 :color? true}) - (ui/icon "letter-b" {:class "opacity-50" :size 15}))) + [block property {:keys [class-schema?]}] + [:div.property-key-inner.jtrigger-view + (if config/publishing? + [:a.property-k.flex.select-none.jtrigger + {:on-click #(route-handler/redirect-to-page! (:block/uuid property))} + (db-property/built-in-display-title property t)] + (property-key-title block property class-schema?))]) (rum/defcs bidirectional-values-cp < rum/static {:init (fn [state] @@ -370,11 +334,9 @@ [bidirectional-properties] (when (seq bidirectional-properties) (for [{:keys [class title entities]} bidirectional-properties] - [:div.property-pair.items-start {:key (str "bidirectional-" title)} - [:div.property-key + [:div.property-pair.property-panel-row {:key (str "bidirectional-" title)} + [:div.property-key-panel [:div.property-key-inner - [:div.property-icon - (bidirectional-property-icon-cp class)] (if class [:a.property-k.flex.select-none.w-full.jtrigger {:on-click (fn [e] @@ -382,8 +344,11 @@ (route-handler/redirect-to-page! (:block/uuid class)))} title] [:div.property-k.flex.select-none.w-full title])]] - [:div.ls-block.property-value-container.flex.flex-row.gap-1.items-start - [:div.property-value.flex.flex-1 + [:div.ls-block.property-value-container.property-value-panel + [:div.property-panel-bullet {:aria-hidden true} + [:span.bullet-container + [:span.bullet]]] + [:div.property-value.property-value-panel-inner.flex.flex-1 (bidirectional-values-cp entities)]]]))) (rum/defcs ^:large-vars/cleanup-todo property-input < rum/reactive @@ -481,21 +446,25 @@ (rum/defcs new-property < rum/reactive [state block opts] (when-not config/publishing? - (let [add-new-property! (fn [e] + (let [icon-only? (:icon-only? opts) + add-new-property! (fn [e] (state/pub-event! [:editor/new-property (merge opts {:block block :target (.-target e)})]))] - [:div.ls-new-property {:style {:margin-left 7 :margin-top 1 :font-size 15}} - [:a.flex.jtrigger - {:tab-index 0 - :on-click add-new-property! - :on-key-press (fn [e] - (when (contains? #{"Enter" " "} (util/ekey e)) - (.preventDefault e) - (add-new-property! e)))} - [:div.flex.flex-row.items-center.shrink-0 - (ui/icon "plus" {:size 15 :class "opacity-50"}) - [:div.ml-1 {:style {:margin-top 1}} - (t :property/add-new)]]]]))) + [:div.ls-new-property + (shui/button + {:variant :outline + :size :small + :class "jtrigger flex !px-2 !py-1" + :tab-index 0 + :title (t :property/add-new) + :on-click add-new-property! + :on-key-press (fn [e] + (when (contains? #{"Enter" " "} (util/ekey e)) + (.preventDefault e) + (add-new-property! e)))} + (ui/icon "plus") + (when-not icon-only? + (t :property/add-new)))]))) (defn- resolve-linked-block-if-exists "Properties will be updated for the linked page instead of the refed block. @@ -511,59 +480,64 @@ (db/sub-block (:db/id linked-block)) (db/sub-block (:db/id block)))) +(defn- empty-panel-property-value? + [value] + (or (nil? value) + (and (map? value) + (= :logseq.property/empty-placeholder (:db/ident value))) + (and (coll? value) + (or (empty? value) + (every? (fn [item] + (and (map? item) + (= :logseq.property/empty-placeholder (:db/ident item)))) + value))))) + (rum/defc property-cp < rum/reactive db-mixins/query - [block k v {:keys [inline-text page-cp sortable-opts] :as opts}] + [block k v {:keys [sortable-opts] :as opts}] (when (keyword? k) (when-let [property (db/sub-block (:db/id (db/entity k)))] (let [type (get property :logseq.property/type :default) - closed-values? (seq (:property/closed-values property)) - block? (and v - (not closed-values?) - (or (and (map? v) (:block/page v)) - (and (coll? v) - (map? (first v)) - (or (:block/page (first v)) - (= :logseq.property/empty-placeholder (:db/ident (first v)))))) - (contains? #{:default :url} type)) - date? (= type :date) - datetime? (= type :datetime) - checkbox? (= type :checkbox) - number-type? (= type :number) - property-key-cp' (property-key-cp block property (assoc (select-keys opts [:class-schema?]) - :block? block? - :inline-text inline-text - :page-cp page-cp))] + default-or-url? (contains? #{:default :url} type) + empty-value? (empty-panel-property-value? v) + show-panel-bullet? (or (not default-or-url?) + empty-value?) + property-key-cp' (property-key-cp block property (select-keys opts [:class-schema?]))] [:div {:key (str "property-pair-" (:db/id block) "-" (:db/id property)) - :class (cond - (or date? datetime? checkbox? number-type?) - "property-pair items-center" - :else - "property-pair items-start") + :class (util/classnames ["property-pair property-panel-row" + {:property-panel-row-empty empty-value?}]) :data-property-title (:block/title property) :data-property-type (name type)} (if (seq sortable-opts) - (dnd/sortable-item (assoc sortable-opts :class "property-key") property-key-cp') - [:div.property-key property-key-cp']) - - (let [property-desc (when-not (= (:db/ident property) :logseq.property/description) - (:logseq.property/description property)) - block' (assoc block (:db/ident property) v)] - [:div.ls-block.property-value-container.flex.flex-row.gap-1 - {:class (if (contains? #{:checkbox :date :datetime} type) - "items-center" - "items-start")} - - (when-not (or block? (and property-desc (:class-schema? opts))) - [:div.flex.items-center {:style {:height 28}} - [:div {:class "pl-1.5 -mr-[3px] opacity-60"} - [:span.bullet-container [:span.bullet]]]]) - [:div.flex.flex-1 - [:div.property-value.flex.flex-1 - (if (:class-schema? opts) - (pv/property-value property (db/entity :logseq.property/description) opts) - (pv/property-value block' property opts))]]])])))) + (dnd/sortable-item + (assoc sortable-opts :class "property-key-panel") + property-key-cp') + [:div.property-key-panel + property-key-cp']) + + (let [block' (assoc block (:db/ident property) v)] + [:div.ls-block.property-value-container.property-value-panel + (when show-panel-bullet? + [:div.property-panel-bullet {:aria-hidden true} + [:span.bullet-container + [:span.bullet]]]) + [:div.property-value.property-value-panel-inner.flex.flex-1 + (if (:class-schema? opts) + (pv/property-value property (db/entity :logseq.property/description) opts) + (pv/property-value block' property (assoc opts :suppress-inline-edit-icon? true)))] + (when (contains? #{:number :date :datetime} type) + [:button.property-panel-edit-btn.select-none + {:type "button" + :on-click (fn [e] + (util/stop e) + (when-let [trigger + (some-> (.-currentTarget e) + (.closest ".property-value-panel") + (.querySelector ".jtrigger"))] + (.click trigger) + (some-> trigger .focus)))} + (ui/icon "edit" {:size 14})])])])))) (defn- entity-ref-value? [value] @@ -696,24 +670,120 @@ [block-uuid] (contains? @*show-hidden-properties-block-ids block-uuid)) +(defn has-hidden-properties? + [block {:keys [gallery-view?]}] + (let [current-db (db/get-db) + show-empty-and-hidden-state (some-> @state/state + (get :ui/show-empty-and-hidden-properties?) + deref) + {:keys [mode show? ids]} show-empty-and-hidden-state + show-empty-and-hidden-properties? (and show? + (or (= mode :global) + (and (set? ids) (contains? ids (:block/uuid block))))) + properties* (cond-> (:block/properties block) + (and (ldb/class? block) + (not (ldb/built-in? block))) + (assoc :logseq.property.class/enable-bidirectional? + (:logseq.property.class/enable-bidirectional? block))) + {:keys [properties recycled-only-property-ids]} + (sanitize-property-values-for-display properties*) + remove-built-in-or-other-position-properties + (fn [property-pairs show-in-hidden-properties?] + (remove (fn [property] + (let [id (if (vector? property) (first property) property)] + (or + (= id :block/tags) + (when-let [ent (db/entity id)] + (or + ;; built-in + (and (not (ldb/public-built-in-property? ent)) + (ldb/built-in? ent)) + ;; other position + (when-not (or + show-empty-and-hidden-properties? + show-in-hidden-properties?) + (outliner-property/property-with-other-position? current-db block ent)) + (and gallery-view? + (contains? #{:logseq.property.class/properties} (:db/ident ent)))))))) + property-pairs)) + {:keys [all-classes classes-properties]} (outliner-property/get-block-classes-properties current-db (:db/id block)) + classes-properties-set (set (map :db/ident classes-properties)) + block-own-properties (->> properties + (remove (fn [[id _]] (contains? recycled-only-property-ids id))) + (remove (fn [[id _]] (classes-properties-set id)))) + state-hide-empty-properties? (:ui/hide-empty-properties? (state/get-config)) + hide-with-property-id (fn [property-id] + (let [property (db/entity property-id)] + (boolean + (cond + show-empty-and-hidden-properties? + false + state-hide-empty-properties? + (nil? (get properties property-id)) + (and (:logseq.property/hide-empty-value property) + (nil? (get properties property-id))) + true + :else + (boolean (:logseq.property/hide? property)))))) + property-hide-f (cond + config/publishing? + ;; Publishing is read only so hide all blank properties as they + ;; won't be edited and distract from properties that have values + (fn [[property-id property-value]] + (or (nil? property-value) + (hide-with-property-id property-id))) + state-hide-empty-properties? + (fn [[property-id property-value]] + ;; User's selection takes precedence over config + (if (:logseq.property/hide? (db/entity property-id)) + (hide-with-property-id property-id) + (nil? property-value))) + :else + (comp hide-with-property-id first)) + {block-hidden-properties true + block-own-properties' false} (group-by property-hide-f block-own-properties) + class-properties (loop [classes all-classes + existing-properties (set (map first block-own-properties')) + result []] + (if-let [class (first classes)] + (let [cur-properties (->> (db-property/get-class-ordered-properties class) + (map :db/ident) + (remove existing-properties))] + (recur (rest classes) + (set/union existing-properties (set cur-properties)) + (if (seq cur-properties) + (into result cur-properties) + result))) + result)) + class-property-pairs (->> class-properties + (map (fn [p] [p (get properties p)])) + (remove (fn [[property-id _]] + (contains? recycled-only-property-ids property-id)))) + hidden-properties (-> (concat block-hidden-properties + (filter property-hide-f class-property-pairs)) + (remove-built-in-or-other-position-properties true))] + (boolean (seq hidden-properties)))) + (rum/defc hidden-properties-toggle-button - [block] + [block {:keys [icon-only?] :as _opts}] (let [block-uuid (:block/uuid block)] (when block-uuid (shui/button {:variant :ghost :size :sm - :class "px-1 text-muted-foreground h-6 text-xs" + :class "bottom-property-control-btn px-1 text-muted-foreground h-6 text-xs" + :title (t :property/hidden-properties) :on-click (fn [e] (util/stop e) (toggle-hidden-properties-visibility! block-uuid))} - (t :property/hidden-properties))))) + (if icon-only? + [:span.select-none "⋯"] + (t :property/hidden-properties)))))) (rum/defc hidden-properties-cp [block hidden-properties {:keys [show-hidden-properties?] :as opts}] (when (and show-hidden-properties? (seq hidden-properties)) - [:div.mt-1 - (properties-section block hidden-properties opts)])) + (properties-section block hidden-properties opts))) (rum/defc load-bidirectional-properties < rum/static [block root-block? set-bidirectional-properties!] @@ -737,6 +807,7 @@ (let [*bidirectional-properties (::bidirectional-properties state) bidirectional-properties @*bidirectional-properties id (::id state) + current-db (db/get-db) db-id (:db/id (::block state)) block (db/sub-block db-id) show-properties? (or sidebar-properties? tag-dialog?) @@ -768,7 +839,7 @@ (when-not (or show-empty-and-hidden-properties? show-in-hidden-properties?) - (outliner-property/property-with-other-position? ent)) + (outliner-property/property-with-other-position? current-db block ent)) (and (:gallery-view? opts) (contains? #{:logseq.property.class/properties} (:db/ident ent)))))))) @@ -846,15 +917,12 @@ (not has-bidirectional-properties?)) nil - (and (empty? full-properties) (empty? hidden-properties) (not has-bidirectional-properties?)) - (when show-properties? - (rum/with-key (new-property block opts) (str id "-add-property"))) - :else (let [remove-properties #{:logseq.property/icon :logseq.property/query} properties' (->> (remove (fn [[k _v]] (contains? remove-properties k)) full-properties) (remove (fn [[k _v]] (= k :logseq.property.class/properties)))) + show-properties-panel? (or (seq properties') (seq bidirectional-properties)) page? (entity-util/page? block) class? (entity-util/class? block)] [:div.ls-properties-area @@ -862,16 +930,15 @@ :class (util/classnames [{:ls-page-properties page?}]) :tab-index 0} [:<> - (properties-section block properties' opts) - (bidirectional-properties-section bidirectional-properties) + (when show-properties-panel? + [:div.properties-panel + (properties-section block properties' opts) + (bidirectional-properties-section bidirectional-properties)]) (when-not class? (hidden-properties-cp block hidden-properties (assoc opts :show-hidden-properties? show-hidden-properties?))) - (when (and page? (not class?)) - (rum/with-key (new-property block opts) (str id "-add-property"))) - (when class? (let [properties (->> (:logseq.property.class/properties block) (map (fn [e] [(:db/ident e)]))) @@ -883,8 +950,9 @@ (property-key-cp block (db/entity :logseq.property.class/properties) {})]] [:div.text-muted-foreground {:style {:margin-left 26}} (t :class/tag-properties-desc)]] - [:div.ml-4 + [:div.ml-4.gap-1.flex.flex-col (properties-section block properties opts') (hidden-properties-cp block hidden-properties (assoc opts :show-hidden-properties? show-hidden-properties?)) - (rum/with-key (new-property block opts') (str id "-class-add-property"))]]))]])))])) + [:div.ml-3 + (rum/with-key (new-property block opts') (str id "-class-add-property"))]]]))]])))])) diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index 8efe9d199e0b..bf12ab8ac081 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -62,9 +62,70 @@ } .ls-properties-area { - .property-pair { - @apply flex flex-row flex-wrap space-x-1; + .properties-panel { + @apply rounded-md overflow-hidden; + } + + .properties-panel-header { + @apply px-3 py-2 text-xs font-medium text-muted-foreground border-b border-gray-04; + } + + .property-pair.property-panel-row { + @apply grid items-start px-3 gap-3 w-full; + grid-template-columns: fit-content(260px) minmax(0, 1fr); + margin-left: 0; + } + + .property-key-panel { + @apply flex items-center min-w-0; + min-height: 28px; + min-width: 150px; + font-size: inherit; + color: var(--ls-primary-text-color); + } + + .property-key-panel .property-key-inner { + @apply w-full min-w-0; + } + + .property-key-panel .property-k { + @apply block min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap; + } + + .property-value-panel.ls-block.property-value-container { + @apply flex flex-row items-start gap-1 w-full; + min-width: 0; + flex-shrink: 1; + min-height: 28px; + } + + .property-pair.property-panel-row.property-panel-row-empty .property-value-panel.ls-block.property-value-container { + @apply items-center; + } + + .property-pair.property-panel-row[data-property-type=node] .property-value-panel.ls-block.property-value-container, + .property-pair.property-panel-row[data-property-type=node] .property-value.property-value-panel-inner { + @apply items-center; + } + + .property-pair.property-panel-row .property-icon { + display: none; + } + + .property-panel-bullet { + @apply inline-flex items-center opacity-60; + margin-left: 2px; + } + .property-panel-bullet .bullet-container { + @apply relative left-0 top-0; + } + + .property-panel-edit-btn { + @apply inline-flex items-center justify-center p-0 bg-transparent border-0 text-muted-foreground cursor-pointer; + } + + .property-pair { .jtrigger-view { > .jtrigger-id { @apply left-[-11px]; @@ -122,6 +183,39 @@ } } + .property-pair.property-panel-row .property-k { + @apply leading-[20px]; + font-size: inherit; + color: var(--ls-primary-text-color); + } + + .property-pair.property-panel-row a.property-k, + .property-key-panel a { + color: var(--ls-primary-text-color); + } + + .property-value.property-value-panel-inner { + @apply pl-0 min-h-[20px] w-full min-w-0; + color: var(--ls-primary-text-color); + } + + .property-value.property-value-panel-inner > .property-value-inner { + @apply w-full min-w-0; + } + + .property-value.property-value-panel-inner .jtrigger { + @apply w-full min-w-0; + } + + .property-value.property-value-panel-inner .select-item { + @apply min-w-0; + } + + .property-pair.property-panel-row[data-property-type=node] .property-value.property-value-panel-inner .page-reference, + .property-pair.property-panel-row[data-property-type=node] .property-value.property-value-panel-inner .page-ref { + line-height: 20px; + } + .add-button-link { opacity: 0.5; } @@ -474,4 +568,4 @@ a.control-link { @apply py-1; } } -} \ No newline at end of file +} diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 6090e50f5731..4ddd2c375e8e 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -431,7 +431,7 @@ :else nil))) (rum/defc datetime-value - [value property-id repeated-task?] + [value property-id repeated-task? {:keys [datetime? other-position? suppress-inline-edit-icon?]}] (when-let [date (t/to-default-time-zone (tc/from-long value))] (let [content [:div.ls-datetime.flex.flex-row.gap-1.items-center (when-let [page-cp (state/get-component :block/page-cp)] @@ -442,15 +442,17 @@ :label (human-date-label value)} {:block/name page-title}) page-title))) - (let [date (js/Date. value) - hours (.getHours date) - minutes (.getMinutes date)] - [:span.select-none - (if (= 0 hours minutes) - (ui/icon "edit" {:size 14 :class "text-muted-foreground hover:text-foreground align-middle"}) - (str (util/zero-pad hours) - ":" - (util/zero-pad minutes)))])]] + (when datetime? + (let [date (js/Date. value) + hours (.getHours date) + minutes (.getMinutes date)] + [:span.select-none + (if (= 0 hours minutes) + (when-not (or other-position? suppress-inline-edit-icon?) + (ui/icon "edit" {:size 14 :class "text-muted-foreground hover:text-foreground align-middle"})) + (str (util/zero-pad hours) + ":" + (util/zero-pad minutes)))]))]] (if (or repeated-task? (contains? #{:logseq.property/deadline :logseq.property/scheduled} property-id)) (overdue date content) content)))) @@ -462,7 +464,7 @@ (:db/ident property))) (rum/defc date-picker - [value {:keys [block property datetime? on-change on-delete del-btn? editing? multiple-values? other-position?]}] + [value {:keys [block property datetime? on-change on-delete del-btn? editing? multiple-values? other-position? suppress-inline-edit-icon?]}] (let [*el (hooks/use-ref nil) content-fn (fn [{:keys [id]}] (calendar-inner id {:block block @@ -526,7 +528,12 @@ content)) (number? value) - (datetime-value value (:db/ident property) repeated-task?) + (datetime-value value + (:db/ident property) + repeated-task? + {:datetime? datetime? + :other-position? other-position? + :suppress-inline-edit-icon? suppress-inline-edit-icon?}) :else (property-empty-btn-value nil))]))))) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 107491684043..49b8a02a4736 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -3039,7 +3039,7 @@ (remove (fn [e] (attributes (:db/ident e)))) (remove (fn [k] (when-not page-title? - (outliner-property/property-with-other-position? k)))) + (outliner-property/property-with-other-position? db block k)))) (remove (fn [e] (:logseq.property/hide? e))) (remove nil?))] (or (seq properties) From b392e1d5144306dca99624aa4ed652e98cf1f829 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 24 Apr 2026 04:45:02 +0800 Subject: [PATCH 0003/1400] fix: css hot-reload --- shadow-cljs.edn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index d4bcc78474dc..36ddeba5561e 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -50,7 +50,8 @@ :devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function :after-load frontend.core/start ;; after live-reloading finishes call this function - :watch-path "/static" + :watch-path "" + :watch-dir "static" :preloads [devtools.preload shadow.remote.runtime.cljs.browser] :loader-mode :eval @@ -128,7 +129,8 @@ :devtools {:before-load mobile.core/stop! ;; before live-reloading any code call this function :after-load mobile.core/render! ;; after live-reloading finishes call this function - :watch-path "/static/mobile" + :watch-path "" + :watch-dir "static/mobile" :preloads [devtools.preload shadow.remote.runtime.cljs.browser] :loader-mode :eval}} From fa5f2479690e0304675522c897eb94bfbd82930f Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 24 Apr 2026 06:31:19 +0800 Subject: [PATCH 0004/1400] fix(properties): improve bottom row keyboard navigation and focus behavior --- src/main/frontend/components/block.cljs | 225 ++++++++++++++++++--- src/main/frontend/components/block.css | 45 ++++- src/main/frontend/components/property.cljs | 29 ++- src/main/frontend/components/property.css | 22 +- src/main/frontend/handler/editor.cljs | 55 ++--- src/main/frontend/state.cljs | 11 +- 6 files changed, 317 insertions(+), 70 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 914d32f7f299..1e607b8634ac 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2579,9 +2579,164 @@ :tag? true :disable-preview? true :disable-click? true) tag)]) - [:div.text-sm.opacity-50.ml-1 + [:div.text-sm.opacity-50.ml-1 (str "+" (- tags-count 2))]]))))) +(defn- bottom-row-focus-elements + [^js row] + (->> (array-seq (.querySelectorAll row "[data-bottom-row-nav='true']")) + vec)) + +(defn- focus-bottom-row-item! + [^js row index] + (when-let [el (nth (bottom-row-focus-elements row) index nil)] + (.focus el) + true)) + +(defn- move-bottom-row-focus! + [^js el direction] + (when-let [^js row (.closest el ".bottom-properties-row")] + (let [items (bottom-row-focus-elements row) + current-index (or (first (keep-indexed (fn [idx item] + (when (identical? item el) idx)) + items)) + 0) + last-index (max 0 (dec (count items))) + next-index (case direction + :prev (max 0 (dec current-index)) + :next (min last-index (inc current-index)) + current-index)] + (focus-bottom-row-item! row next-index)))) + +(defn- trigger-bottom-pill-edit! + [^js pill] + (when-let [trigger (some-> pill + (.querySelector ".bottom-property-content .jtrigger"))] + (.click trigger) + (some-> trigger .focus) + true)) + +(defn- current-bottom-pill + [^js el] + (some-> el (.closest ".bottom-property-pill-focusable"))) + +(defn- input-cursor-at-boundary? + [^js input key] + (let [start (.-selectionStart input) + end (.-selectionEnd input) + value (or (.-value input) "")] + (and (number? start) + (number? end) + (= start end) + (case key + "ArrowUp" (zero? start) + "ArrowDown" (= start (count value)) + false)))) + +(defn- focus-block-editor-from-bottom-row! + [^js row] + (when-let [^js current-block (.closest row ".ls-block")] + (.blur row) + (when-let [block-id (some-> (dom/attr current-block "blockid") uuid)] + (let [container-id (some-> (dom/attr current-block "containerid") js/parseInt)] + (editor-handler/edit-block! {:block/uuid block-id} + :max + {:container-id container-id}))))) + +(defn- handle-bottom-properties-row-key-down! + [e] + (let [key (util/ekey e) + ^js row (.-currentTarget e) + ^js active-el (.-activeElement js/document)] + (cond + (= "ArrowUp" key) + (do + (util/stop e) + (focus-block-editor-from-bottom-row! row)) + + (= "ArrowDown" key) + (do + (util/stop e) + (editor-handler/move-cross-boundary-up-down :down {:exclude-property? true})) + + (contains? #{"ArrowLeft" "ArrowRight"} key) + (do + (util/stop e) + (if (and active-el + (= "true" (.getAttribute active-el "data-bottom-row-nav"))) + (move-bottom-row-focus! active-el (if (= key "ArrowLeft") :prev :next)) + (let [items (bottom-row-focus-elements row)] + (when (seq items) + (.focus (first items)))))) + + :else + nil))) + +(defn- handle-bottom-pill-key-down! + [e] + (let [key (util/ekey e) + ^js pill (.-currentTarget e)] + (cond + (contains? #{"ArrowUp" "ArrowDown"} key) + (do + (util/stop e) + (some-> (.closest pill ".bottom-properties-row") (.focus))) + + (contains? #{" " "Enter"} key) + (do + (util/stop e) + (trigger-bottom-pill-edit! pill)) + + :else + nil))) + +(defn- bottom-property-pill-cp + [block property opts] + [:div.bottom-property-pill.bottom-property-pill-focusable + {:key (str (:db/id block) "-" (:db/id property)) + :data-bottom-pill-focusable true + :data-bottom-row-nav true + :tab-index -1 + :on-key-down handle-bottom-pill-key-down!} + [:div.flex.flex-row.items-center + (property-component/property-key-cp block property opts) + [:div.select-none ":"]] + [:div {:class "bottom-property-content ls-block property-value-container" + :style {:min-height 20}} + (pv/property-value block property opts) + (when (contains? #{:date :datetime} (:logseq.property/type property)) + [:button.bottom-property-edit-icon.select-none + {:type "button" + :on-click (fn [e] + (util/stop e) + (when-let [trigger + (some-> (.-currentTarget e) + (.closest ".bottom-property-content") + (.querySelector ".jtrigger"))] + (.click trigger) + (some-> trigger .focus)))} + (ui/icon "edit" {:size 15})])]]) + +(defn- block-below-positioned-properties-cp + [block properties opts show-hidden-properties-toggle? show-add-property-button?] + [:div.positioned-properties.block-below.flex.flex-col.gap-1.text-sm.overflow-x-hidden + [:div.bottom-properties-row.flex.flex-row.gap-2.items-center.flex-wrap.overflow-x-hidden + {:data-bottom-properties-row (:block/uuid block) + :tab-index -1 + :on-key-down handle-bottom-properties-row-key-down!} + (for [property properties] + (bottom-property-pill-cp block property opts)) + (when show-hidden-properties-toggle? + (property-component/hidden-properties-toggle-button block {:icon-only? true + :bottom-row-nav? true + :tab-index 0})) + (when show-add-property-button? + (property-component/new-property block (assoc opts + :property-position :block-below + :bottom-row-nav? true + :icon-only? true + :tab-index 0)))]]) + (rum/defc block-positioned-properties [config block position] (let [properties (outliner-property/get-block-positioned-properties (db/get-db) (:db/id block) position) @@ -2603,38 +2758,48 @@ (not config/publishing?)) show-add-property-button? (and has-viewable-properties? show-page-add-property?)] + (when (= position :block-below) + (hooks/use-effect! + (fn [] + (let [block-uuid (:block/uuid block) + listener (fn [^js e] + (let [key (util/ekey e) + ^js active-el (.-activeElement js/document) + edit-input-id (str "edit-block-" block-uuid) + row (when block-uuid + (.querySelector js/document + (str "[data-bottom-properties-row=\"" block-uuid "\"]")))] + (when (and row + has-viewable-properties? + block-uuid + (contains? #{"ArrowUp" "ArrowDown"} key) + (not (or (.-metaKey e) + (.-ctrlKey e) + (.-altKey e))) + active-el + (= (.-id active-el) edit-input-id) + (input-cursor-at-boundary? active-el key)) + (util/stop e) + (.focus row)) + + (when (and row + (= key "Escape") + active-el + (.contains row active-el)) + (when-let [pill (current-bottom-pill active-el)] + (js/setTimeout (fn [] (.focus pill)) 0)))))] + (.addEventListener js/document "keydown" listener) + (fn [] + (.removeEventListener js/document "keydown" listener)))) + [(:block/uuid block) has-viewable-properties?])) (case position :block-below (when has-viewable-properties? - [:div.positioned-properties.block-below.flex.flex-col.gap-1.text-sm.overflow-x-hidden - [:div.bottom-properties-row.flex.flex-row.gap-2.items-center.flex-wrap.overflow-x-hidden - (for [property properties] - [:div.bottom-property-pill - {:key (str (:db/id block) "-" (:db/id property))} - [:div.flex.flex-row.items-center - (property-component/property-key-cp block property opts) - [:div.select-none ":"]] - [:div.bottom-property-content.ls-block.property-value-container - {:style {:min-height 20}} - (pv/property-value block property opts) - (when (contains? #{:number :date :datetime} (:logseq.property/type property)) - [:button.bottom-property-edit-icon.select-none - {:type "button" - :on-click (fn [e] - (util/stop e) - (when-let [trigger - (some-> (.-currentTarget e) - (.closest ".bottom-property-content") - (.querySelector ".jtrigger"))] - (.click trigger) - (some-> trigger .focus)))} - (ui/icon "edit" {:size 14})])]]) - (when show-hidden-properties-toggle? - (property-component/hidden-properties-toggle-button block {:icon-only? true})) - (when show-add-property-button? - (property-component/new-property block (assoc opts - :property-position :block-below - :icon-only? true)))]]) + (block-below-positioned-properties-cp block + properties + opts + show-hidden-properties-toggle? + show-add-property-button?)) (when (seq properties) [:div.positioned-properties.flex.flex-row.gap-1.select-none.h-6.self-start diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 32a54c5e1c8f..83a594af2dbd 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1063,14 +1063,34 @@ html.is-mac { @apply gap-1.5 py-1; } + .bottom-properties-row:focus { + outline: none; + box-shadow: inset 0 0 0 1px var(--ls-link-text-color); + border-radius: 9999px; + } + .bottom-property-pill { @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full; background-color: var(--ls-secondary-background-color); box-shadow: inset 0 0 0 1px var(--ls-border-color); + position: relative; + } + + .bottom-property-pill-focusable:focus { + outline: none; + box-shadow: inset 0 0 0 1px var(--ls-link-text-color); + } + + .bottom-property-control-btn:focus, + .bottom-property-control-btn:focus-visible, + .bottom-property-add-btn:focus, + .bottom-property-add-btn:focus-visible { + outline: none; + box-shadow: inset 0 0 0 1px var(--ls-link-text-color); } .bottom-property-content { - @apply flex items-center gap-1 min-w-0; + @apply flex items-center gap-1 min-w-0 relative; } .bottom-property-pill .property-key-inner { @@ -1098,8 +1118,29 @@ html.is-mac { box-shadow: inset 0 0 0 1px var(--ls-border-color); } + .bottom-property-add-btn { + @apply justify-center w-6 h-6 p-0 rounded-full; + } + + .ls-new-property .jtrigger.bottom-property-add-btn:focus, + .ls-new-property .jtrigger.bottom-property-add-btn:focus-visible { + outline: none; + box-shadow: inset 0 0 0 1px var(--ls-link-text-color); + } + .bottom-property-edit-icon { - @apply inline-flex items-center justify-center p-0 bg-transparent border-0 text-muted-foreground cursor-pointer; + @apply inline-flex items-center justify-end pr-0 py-2 px-2 border-0 cursor-pointer opacity-0 pointer-events-none; + position: absolute; + right: -10px; + top: 0; + height: 100%; + color: var(--ls-primary-text-color); + background: linear-gradient(to left, var(--ls-primary-background-color) 65%, transparent); + } + + .bottom-property-pill:hover .bottom-property-edit-icon, + .bottom-property-edit-icon:focus-visible { + @apply opacity-100 pointer-events-auto; } .ls-block.property-value-container { diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 98e8eb20f296..0d65fb0a593c 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -447,6 +447,9 @@ [state block opts] (when-not config/publishing? (let [icon-only? (:icon-only? opts) + bottom-property-add-button? (= :block-below (:property-position opts)) + tab-index (:tab-index opts) + bottom-row-nav? (:bottom-row-nav? opts) add-new-property! (fn [e] (state/pub-event! [:editor/new-property (merge opts {:block block :target (.-target e)})]))] @@ -454,8 +457,11 @@ (shui/button {:variant :outline :size :small - :class "jtrigger flex !px-2 !py-1" - :tab-index 0 + :class (util/classnames + ["jtrigger flex !px-2 !py-1" + {:bottom-property-add-btn bottom-property-add-button?}]) + :tab-index (or tab-index 0) + :data-bottom-row-nav (when bottom-row-nav? true) :title (t :property/add-new) :on-click add-new-property! :on-key-press (fn [e] @@ -526,7 +532,7 @@ (if (:class-schema? opts) (pv/property-value property (db/entity :logseq.property/description) opts) (pv/property-value block' property (assoc opts :suppress-inline-edit-icon? true)))] - (when (contains? #{:number :date :datetime} type) + (when (contains? #{:date :datetime} type) [:button.property-panel-edit-btn.select-none {:type "button" :on-click (fn [e] @@ -537,7 +543,7 @@ (.querySelector ".jtrigger"))] (.click trigger) (some-> trigger .focus)))} - (ui/icon "edit" {:size 14})])])])))) + (ui/icon "edit" {:size 15})])])])))) (defn- entity-ref-value? [value] @@ -765,13 +771,17 @@ (boolean (seq hidden-properties)))) (rum/defc hidden-properties-toggle-button - [block {:keys [icon-only?] :as _opts}] + [block {:keys [icon-only? tab-index bottom-row-nav?] :as _opts}] (let [block-uuid (:block/uuid block)] (when block-uuid (shui/button - {:variant :ghost - :size :sm - :class "bottom-property-control-btn px-1 text-muted-foreground h-6 text-xs" + {:variant :outline + :size :small + :class (util/classnames + ["bottom-property-control-btn" + {:bottom-property-add-btn icon-only?}]) + :tab-index (or tab-index 0) + :data-bottom-row-nav (when bottom-row-nav? true) :title (t :property/hidden-properties) :on-click (fn [e] (util/stop e) @@ -803,14 +813,13 @@ (assoc state ::id (str (random-uuid)) ::block block)))} - [state _target-block {:keys [sidebar-properties? tag-dialog?] :as opts}] + [state _target-block {:keys [sidebar-properties?] :as opts}] (let [*bidirectional-properties (::bidirectional-properties state) bidirectional-properties @*bidirectional-properties id (::id state) current-db (db/get-db) db-id (:db/id (::block state)) block (db/sub-block db-id) - show-properties? (or sidebar-properties? tag-dialog?) show-hidden-properties? (let [shown-block-ids (rum/react *show-hidden-properties-block-ids)] (contains? shown-block-ids (:block/uuid block))) show-empty-and-hidden-properties? (let [{:keys [mode show? ids]} (state/sub :ui/show-empty-and-hidden-properties?)] diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index bf12ab8ac081..adbd9740b25f 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -122,7 +122,23 @@ } .property-panel-edit-btn { - @apply inline-flex items-center justify-center p-0 bg-transparent border-0 text-muted-foreground cursor-pointer; + @apply inline-flex items-center justify-center p-0 border-0 cursor-pointer opacity-0 pointer-events-none; + position: absolute; + right: 2px; + top: 50%; + transform: translateY(-50%); + width: 18px; + height: 18px; + border-radius: 9999px; + color: var(--ls-primary-text-color); + background-color: var(--ls-primary-background-color); + box-shadow: inset 0 0 0 1px var(--ls-border-color); + } + + .property-value-panel:has(.property-value-panel-inner:hover) .property-panel-edit-btn, + .property-value-panel:has(.property-value-panel-inner:focus-within) .property-panel-edit-btn, + .property-panel-edit-btn:focus-visible { + @apply opacity-100 pointer-events-auto; } .property-pair { @@ -199,6 +215,10 @@ color: var(--ls-primary-text-color); } + .property-value-panel { + position: relative; + } + .property-value.property-value-panel-inner > .property-value-inner { @apply w-full min-w-0; } diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 49b8a02a4736..5ce55dfb474b 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -2146,22 +2146,25 @@ (util/scroll-to-block sibling-block) (state/exit-editing-and-set-selected-blocks! [sibling-block])))) -(defn- active-jtrigger? - [] - (some-> js/document.activeElement (dom/has-class? "jtrigger"))) - (defn- property-value-node? [node] (some-> node (dom/has-class? "property-value-container"))) +(defn- bottom-properties-row-node + [node] + (some-> node (.closest ".bottom-properties-row"))) + (defn- focus-trigger [_current-block sibling-block] - (when-let [trigger (first (dom/by-class sibling-block "jtrigger"))] - (state/clear-edit!) - (if (or (dom/has-class? trigger "ls-number") - (dom/has-class? trigger "ls-empty-text-property")) - (.click trigger) - (.focus trigger)))) + (if-let [trigger (first (dom/by-class sibling-block "jtrigger"))] + (do + (state/clear-edit!) + (if (or (dom/has-class? trigger "ls-number") + (dom/has-class? trigger "ls-empty-text-property")) + (.click trigger) + (.focus trigger))) + (when-let [row (bottom-properties-row-node sibling-block)] + (.focus row)))) (defn move-cross-boundary-up-down [direction move-opts] @@ -2174,11 +2177,14 @@ :up util/get-prev-block-non-collapsed :down util/get-next-block-non-collapsed) current-block (util/rec-get-node input-or-active-element "ls-block") - sibling-block (f current-block {:up-down? true}) + sibling-block (f current-block (cond-> {:up-down? true} + (:exclude-property? move-opts) + (assoc :exclude-property? true))) {:block/keys [uuid title]} (state/get-edit-block) sibling-block (or (when (property-value-node? sibling-block) (first (dom/by-class sibling-block "ls-block"))) sibling-block) + bottom-properties-row (bottom-properties-row-node sibling-block) property-value-container? (property-value-node? sibling-block)] (if sibling-block (let [sibling-block-id (dom/attr sibling-block "blockid") @@ -2196,6 +2202,11 @@ (util/rec-get-node current-block "ls-page-title")) (.click sibling-block) + bottom-properties-row + (do + (state/clear-edit!) + (.focus bottom-properties-row)) + property-value-container? (focus-trigger current-block sibling-block) @@ -2209,8 +2220,13 @@ {:container-id container-id :direction direction}))))) (case direction - :up (cursor/move-cursor-to input 0) - :down (cursor/move-cursor-to-end input))))))) + :up (if input + (cursor/move-cursor-to input 0) + (when current-block + (util/scroll-to-block current-block) + (state/exit-editing-and-set-selected-blocks! [current-block]))) + :down (when input + (cursor/move-cursor-to-end input)))))))) (defn keydown-up-down-handler [direction {:keys [_pos] :as move-opts}] @@ -2220,9 +2236,6 @@ up? (= direction :up) down? (= direction :down)] (cond - (active-jtrigger?) - (move-cross-boundary-up-down direction move-opts) - (not= selected-start selected-end) (if up? (cursor/move-cursor-to input selected-start) @@ -2297,14 +2310,6 @@ (and property? left? (not (cursor/start? input))) (cursor/move-cursor-to-start input) - (and property? right? (cursor/end? input) - (or (not= (:logseq.property/type block) :default) - (seq (:property/closed-values block)))) - (let [pair (util/rec-get-node input "property-pair") - jtrigger (when pair (dom/sel1 pair ".property-value-container .jtrigger"))] - (when jtrigger - (.focus jtrigger))) - (not= selected-start selected-end) (cond left? @@ -2908,7 +2913,7 @@ (not (state/get-timestamp-block))) (util/stop e) (cond - (or (state/editing?) (active-jtrigger?)) + (state/editing?) (keydown-up-down-handler direction {}) (state/selection?) diff --git a/src/main/frontend/state.cljs b/src/main/frontend/state.cljs index 6dc1b42c4774..88a81384be59 100644 --- a/src/main/frontend/state.cljs +++ b/src/main/frontend/state.cljs @@ -1060,11 +1060,18 @@ Similar to re-frame subscriptions" selected-ids (set (get-selected-block-ids selected-blocks)) _ (set-state! :selection/blocks blocks) new-ids (set (get-selection-block-ids)) - removed (set/difference selected-ids new-ids)] + removed (set/difference selected-ids new-ids) + next-blocks (set (remove nil? blocks)) + removed-nodes-without-blockid (->> selected-blocks + (remove nil?) + (remove #(contains? next-blocks %)) + (remove #(dom/attr % "blockid")))] (mark-dom-blocks-as-selected blocks) (doseq [id removed] (doseq [node (dom/sel (util/format "[blockid='%s']" id))] - (unselect-node node))))) + (unselect-node node))) + (doseq [node removed-nodes-without-blockid] + (unselect-node node)))) (defn set-selection-blocks! ([blocks] From 555f87e55f8b3024918e153be27503b2e59f4a33 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Fri, 24 Apr 2026 06:59:22 +0800 Subject: [PATCH 0005/1400] wip: fix e2e tests --- clj-e2e/src/logseq/e2e/block.clj | 2 +- clj-e2e/test/logseq/e2e/editor_basic_test.clj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clj-e2e/src/logseq/e2e/block.clj b/clj-e2e/src/logseq/e2e/block.clj index 05639e272843..b445d89db87a 100644 --- a/clj-e2e/src/logseq/e2e/block.clj +++ b/clj-e2e/src/logseq/e2e/block.clj @@ -127,7 +127,7 @@ (util/wait-timeout 100) (util/input property-value) (w/wait-for (format "#ac-0.menu-link:has-text('%s')" property-value)) - (k/enter)) + (w/click (first (w/query (format ".menu-link:has-text('%s')" property-value))))) (defn select-blocks [n] diff --git a/clj-e2e/test/logseq/e2e/editor_basic_test.clj b/clj-e2e/test/logseq/e2e/editor_basic_test.clj index d337233974bf..d27ff08bddb1 100644 --- a/clj-e2e/test/logseq/e2e/editor_basic_test.clj +++ b/clj-e2e/test/logseq/e2e/editor_basic_test.clj @@ -50,20 +50,20 @@ (testing "Convert block to page and back" (b/new-block "b1") (util/set-tag "Page" {:hidden? true}) - (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 1) (b/toggle-property "Tags" "Page") - (assert/assert-is-hidden ".ls-page-blocks .ls-block .ls-icon-file"))) + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 0))) (deftest toggle-between-page-and-block-for-selected-blocks (testing "Convert selected blocks to pages and back" (b/new-blocks ["b1" "b2" "b3"]) (b/select-blocks 3) (b/toggle-property "Tags" "Page") - (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 3) (w/wait-for (format ".menu-link:has-text('%s')" "Page")) (k/esc) (b/toggle-property "Tags" "Page") - (w/wait-for-not-visible ".ls-page-blocks .ls-block .ls-icon-file"))) + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 0))) (deftest disallow-adding-page-tag-to-normal-pages (testing "Disallow adding #Page to normal pages" @@ -107,7 +107,7 @@ (b/new-blocks ["block1" "block2" "block3"]) (b/select-blocks 3) (b/toggle-property "Tags" "Page") - (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 3) (k/press "ControlOrMeta+Shift+m") (w/fill "input[placeholder=\"Move blocks to\"]" "Library") (w/wait-for (w/get-by-test-id "Library")) @@ -120,7 +120,7 @@ (b/new-blocks ["block4" "block5"]) (b/select-blocks 2) (b/toggle-property "Tags" "Page") - (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") + (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 2) (k/press "ControlOrMeta+Shift+m") (w/fill "input[placeholder=\"Move blocks to\"]" "Library") (w/wait-for (w/get-by-test-id "Library")) From fe651961e40e2ddef7cdc8a43d9ae3b1c3819a27 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 16:00:48 +0800 Subject: [PATCH 0006/1400] Improve property pill behavior and property editing UX --- deps/db/src/logseq/db.cljs | 3 ++- .../src/logseq/outliner/property.cljs | 21 ++++++++++--------- .../test/logseq/outliner/property_test.cljs | 18 ++++++++++++++++ src/main/frontend/components/block.cljs | 21 ++++++++++++------- src/main/frontend/components/block.css | 19 +++++++++++++++-- src/main/frontend/components/property.css | 4 +++- .../frontend/components/property/value.cljs | 11 ++++++---- .../frontend/components/property/value.css | 3 ++- 8 files changed, 73 insertions(+), 27 deletions(-) diff --git a/deps/db/src/logseq/db.cljs b/deps/db/src/logseq/db.cljs index 7e3758709fe2..f249a698b2e6 100644 --- a/deps/db/src/logseq/db.cljs +++ b/deps/db/src/logseq/db.cljs @@ -873,7 +873,8 @@ * :title - pluralized class title * :entities - node entities that reference the target via ref properties" [db target-id] - (when (and db target-id (d/entity db target-id)) + (when (and db target-id + (not (:logseq.property/created-from-property (d/entity db target-id)))) (let [*attr->bidirectional? (volatile! {}) bidirectional-property-attr-cached? (fn [attr] diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index a42751db4eb1..61790771be19 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -776,25 +776,26 @@ (defn- bottom-position-property? [db block property] (let [property-id (:db/ident property) - property-type (:logseq.property/type property)] + property-type (:logseq.property/type property) + node-many? (and (= :node property-type) + (= :db.cardinality/many (:db/cardinality property))) + default-bottom? (and (not= :url property-type) + (or node-many? + (not= :default property-type) + (seq (:property/closed-values property))) + (not (schema-or-tag-related-property? property-id)))] (if (tag-class-page? db block) (or (contains? #{:logseq.property.class/extends :logseq.property.class/enable-bidirectional?} property-id) - (and (not= :url property-type) - (or (not= :default property-type) - (seq (:property/closed-values property))) - (not (schema-or-tag-related-property? property-id)))) - (and (not= :url property-type) - (or (not= :default property-type) - (seq (:property/closed-values property))) - (not (schema-or-tag-related-property? property-id)))))) + default-bottom?) + default-bottom?))) (defn- resolved-property-position [db block property] (let [ui-position (:logseq.property/ui-position property)] (cond - (contains? #{:block-left :block-right :block-below} ui-position) + (contains? #{:properties :block-left :block-right :block-below} ui-position) ui-position (bottom-position-property? db block property) diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index 575fffa350ed..d67bc3ca90fe 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -399,6 +399,24 @@ :logseq.property/type :url :logseq.property/ui-position :block-left})))) + (testing "explicit properties ui-position keeps property in normal property rows" + (is (false? + (outliner-property/property-with-other-position? + nil + {} + {:db/ident :user.property/p1 + :logseq.property/type :number + :logseq.property/ui-position :properties})))) + + (testing "many node property without explicit ui-position defaults to bottom position" + (is (true? + (outliner-property/property-with-other-position? + nil + {} + {:db/ident :user.property/p1 + :logseq.property/type :node + :db/cardinality :db.cardinality/many})))) + (testing "bidirectional config property stays in normal property rows" (is (false? (outliner-property/property-with-other-position? diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 1e607b8634ac..34a69001516a 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2692,16 +2692,21 @@ (defn- bottom-property-pill-cp [block property opts] - [:div.bottom-property-pill.bottom-property-pill-focusable - {:key (str (:db/id block) "-" (:db/id property)) - :data-bottom-pill-focusable true - :data-bottom-row-nav true - :tab-index -1 - :on-key-down handle-bottom-pill-key-down!} + (let [many-node? (and (= :node (:logseq.property/type property)) + (= :db.cardinality/many (:db/cardinality property)))] + [:div.bottom-property-pill.bottom-property-pill-focusable + {:key (str (:db/id block) "-" (:db/id property)) + :class (util/classnames [{:bottom-property-pill-wrap many-node?}]) + :data-bottom-pill-focusable true + :data-bottom-row-nav true + :tab-index -1 + :on-key-down handle-bottom-pill-key-down!} [:div.flex.flex-row.items-center (property-component/property-key-cp block property opts) [:div.select-none ":"]] - [:div {:class "bottom-property-content ls-block property-value-container" + [:div {:class (util/classnames + ["bottom-property-content ls-block property-value-container" + {:bottom-property-content-wrap many-node?}]) :style {:min-height 20}} (pv/property-value block property opts) (when (contains? #{:date :datetime} (:logseq.property/type property)) @@ -2715,7 +2720,7 @@ (.querySelector ".jtrigger"))] (.click trigger) (some-> trigger .focus)))} - (ui/icon "edit" {:size 15})])]]) + (ui/icon "edit" {:size 15})])]])) (defn- block-below-positioned-properties-cp [block properties opts show-hidden-properties-toggle? show-add-property-button?] diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 83a594af2dbd..4930819ce9c9 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1070,12 +1070,19 @@ html.is-mac { } .bottom-property-pill { - @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full; + @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full text-base; background-color: var(--ls-secondary-background-color); box-shadow: inset 0 0 0 1px var(--ls-border-color); position: relative; } + .bottom-property-pill.bottom-property-pill-wrap { + @apply h-auto; + min-height: 1.5rem; /* keep default 24px baseline, allow growth only when wrapped */ + padding-top: 0; + padding-bottom: 0; + } + .bottom-property-pill-focusable:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ls-link-text-color); @@ -1090,7 +1097,15 @@ html.is-mac { } .bottom-property-content { - @apply flex items-center gap-1 min-w-0 relative; + @apply flex items-center gap-1 min-w-0 relative text-base; + } + + .bottom-property-content.bottom-property-content-wrap { + @apply flex-1 flex-wrap min-w-0; + } + + .bottom-property-pill-wrap .multi-values.jtrigger { + @apply min-w-0; } .bottom-property-pill .property-key-inner { diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index adbd9740b25f..66b32b0b33c7 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -291,7 +291,9 @@ } .ui__button.empty-btn, .empty-text-btn { - @apply !h-6 !px-0 !text-base opacity-50 font-normal; + @apply !h-6 !px-0 opacity-50 font-normal; + font-size: inherit; + line-height: inherit; } .ui__button.empty-btn:hover, .empty-text-btn:hover { diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 4ddd2c375e8e..7555f686b62e 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -1359,7 +1359,8 @@ *ref (hooks/use-ref nil) *input-ref (hooks/use-ref nil) number-value (db-property/property-value-content value-block) - [value set-value!] (hooks/use-state number-value) + number-value-str (if (some? number-value) (str number-value) "") + [value set-value!] (hooks/use-state number-value-str) [*value _] (hooks/use-state (atom value)) set-property-value! (fn [value & {:keys [exit-editing?] :or {exit-editing? true}}] @@ -1385,9 +1386,9 @@ (hooks/use-effect! (fn [] - (set-value! number-value) + (set-value! number-value-str) #()) - [number-value]) + [number-value-str]) [:div.ls-number.flex.flex-1.jtrigger {:ref *ref @@ -1433,7 +1434,9 @@ (.focus (rum/deref *ref))) nil))))}) - value)])) + (if (string/blank? value) + (property-empty-btn-value property) + value))])) (rum/defcs property-scalar-value-aux < rum/static rum/reactive [state block property value* {:keys [editing? on-chosen] diff --git a/src/main/frontend/components/property/value.css b/src/main/frontend/components/property/value.css index 666a4daf8567..ba8bd75648bc 100644 --- a/src/main/frontend/components/property/value.css +++ b/src/main/frontend/components/property/value.css @@ -51,6 +51,7 @@ min-width: 3em; } -.ls-properties-area .empty-btn { +.ls-properties-area .empty-btn, +.ls-properties-area .empty-text-btn { @apply !text-base; } From ac884716f3ee31308ae6b67d8534bbd8d336417c Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 16:41:00 +0800 Subject: [PATCH 0007/1400] add hover effect --- src/main/frontend/components/block.css | 27 ++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 4930819ce9c9..5107345a59d6 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1072,8 +1072,18 @@ html.is-mac { .bottom-property-pill { @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full text-base; background-color: var(--ls-secondary-background-color); - box-shadow: inset 0 0 0 1px var(--ls-border-color); + box-shadow: none; position: relative; + overflow: hidden; + } + + .bottom-property-pill::after { + content: ""; + position: absolute; + inset: 0; + border-radius: 9999px; + box-shadow: inset 0 0 0 1px var(--ls-border-color); + pointer-events: none; } .bottom-property-pill.bottom-property-pill-wrap { @@ -1085,6 +1095,10 @@ html.is-mac { .bottom-property-pill-focusable:focus { outline: none; + box-shadow: none; + } + + .bottom-property-pill-focusable:focus::after { box-shadow: inset 0 0 0 1px var(--ls-link-text-color); } @@ -1108,6 +1122,11 @@ html.is-mac { @apply min-w-0; } + .bottom-property-content .property-value-inner[data-type="node"] .jtrigger:hover .page-ref, + .bottom-property-content .property-value-inner[data-type="node"] .jtrigger:focus-visible .page-ref { + color: var(--ls-link-text-hover-color); + } + .bottom-property-pill .property-key-inner { @apply flex items-center min-w-0; } @@ -1147,10 +1166,10 @@ html.is-mac { @apply inline-flex items-center justify-end pr-0 py-2 px-2 border-0 cursor-pointer opacity-0 pointer-events-none; position: absolute; right: -10px; - top: 0; - height: 100%; + top: 1px; + height: calc(100% - 2px); color: var(--ls-primary-text-color); - background: linear-gradient(to left, var(--ls-primary-background-color) 65%, transparent); + background: linear-gradient(to left, var(--ls-secondary-background-color) 65%, transparent); } .bottom-property-pill:hover .bottom-property-edit-icon, From a8591650bf9178259af2e2e8473d78c44bdd0e56 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 17:07:11 +0800 Subject: [PATCH 0008/1400] fix: e2e tests --- clj-e2e/src/logseq/e2e/block.clj | 2 +- clj-e2e/test/logseq/e2e/editor_basic_test.clj | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/clj-e2e/src/logseq/e2e/block.clj b/clj-e2e/src/logseq/e2e/block.clj index b445d89db87a..05639e272843 100644 --- a/clj-e2e/src/logseq/e2e/block.clj +++ b/clj-e2e/src/logseq/e2e/block.clj @@ -127,7 +127,7 @@ (util/wait-timeout 100) (util/input property-value) (w/wait-for (format "#ac-0.menu-link:has-text('%s')" property-value)) - (w/click (first (w/query (format ".menu-link:has-text('%s')" property-value))))) + (k/enter)) (defn select-blocks [n] diff --git a/clj-e2e/test/logseq/e2e/editor_basic_test.clj b/clj-e2e/test/logseq/e2e/editor_basic_test.clj index d27ff08bddb1..d337233974bf 100644 --- a/clj-e2e/test/logseq/e2e/editor_basic_test.clj +++ b/clj-e2e/test/logseq/e2e/editor_basic_test.clj @@ -50,20 +50,20 @@ (testing "Convert block to page and back" (b/new-block "b1") (util/set-tag "Page" {:hidden? true}) - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 1) + (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") (b/toggle-property "Tags" "Page") - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 0))) + (assert/assert-is-hidden ".ls-page-blocks .ls-block .ls-icon-file"))) (deftest toggle-between-page-and-block-for-selected-blocks (testing "Convert selected blocks to pages and back" (b/new-blocks ["b1" "b2" "b3"]) (b/select-blocks 3) (b/toggle-property "Tags" "Page") - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 3) + (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") (w/wait-for (format ".menu-link:has-text('%s')" "Page")) (k/esc) (b/toggle-property "Tags" "Page") - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 0))) + (w/wait-for-not-visible ".ls-page-blocks .ls-block .ls-icon-file"))) (deftest disallow-adding-page-tag-to-normal-pages (testing "Disallow adding #Page to normal pages" @@ -107,7 +107,7 @@ (b/new-blocks ["block1" "block2" "block3"]) (b/select-blocks 3) (b/toggle-property "Tags" "Page") - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 3) + (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") (k/press "ControlOrMeta+Shift+m") (w/fill "input[placeholder=\"Move blocks to\"]" "Library") (w/wait-for (w/get-by-test-id "Library")) @@ -120,7 +120,7 @@ (b/new-blocks ["block4" "block5"]) (b/select-blocks 2) (b/toggle-property "Tags" "Page") - (assert/assert-have-count ".ls-page-blocks .ls-block .block-tags :text('Template')" 2) + (assert/assert-is-visible ".ls-page-blocks .ls-block .ls-icon-file") (k/press "ControlOrMeta+Shift+m") (w/fill "input[placeholder=\"Move blocks to\"]" "Library") (w/wait-for (w/get-by-test-id "Library")) From 5b27b879d870dcad454697b4136e37c9d15ee43d Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 17:45:01 +0800 Subject: [PATCH 0009/1400] Fix positioned property visibility and bottom pill wrapping --- .../src/logseq/outliner/property.cljs | 1 + .../test/logseq/outliner/property_test.cljs | 8 +++++++ src/main/frontend/components/block.css | 4 ++-- src/main/frontend/components/property.cljs | 13 +++++------ src/main/frontend/components/property.css | 23 +++++++++++++++++++ 5 files changed, 40 insertions(+), 9 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index 61790771be19..325d7e043320 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -809,6 +809,7 @@ (when-let [property (entity-plus/entity-memoized db property-id)] (let [property-position' (resolved-property-position db block property)] (and + (not (false? (:logseq.property/public? property))) (= property-position' position) (not (and (:logseq.property/hide-empty-value property) (nil? (get block property-id)))) diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index d67bc3ca90fe..a8a5acbf7fe6 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -448,6 +448,14 @@ (testing "a schema property is part of the shared schema set" (is (contains? db-property/schema-properties :logseq.property/public?)))) +(deftest get-block-positioned-properties-filters-non-public + (let [conn (db-test/create-conn-with-blocks []) + journal-class (d/entity @conn :logseq.class/Journal) + positioned-properties (outliner-property/get-block-positioned-properties @conn (:db/id journal-class) :block-below)] + (is (every? #(not (false? (:logseq.property/public? %))) positioned-properties)) + (is (not-any? #(= :logseq.property.journal/title-format (:db/ident %)) + positioned-properties)))) + (deftest extends-cycle (testing "Fail when creating a cycle of extends" (let [conn (db-test/create-conn-with-blocks diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 5107345a59d6..c3125a9e7e1c 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1070,7 +1070,7 @@ html.is-mac { } .bottom-property-pill { - @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full text-base; + @apply inline-flex items-center gap-1 rounded-full px-2 py-0.5 h-6 max-w-full text-sm; background-color: var(--ls-secondary-background-color); box-shadow: none; position: relative; @@ -1111,7 +1111,7 @@ html.is-mac { } .bottom-property-content { - @apply flex items-center gap-1 min-w-0 relative text-base; + @apply flex items-center gap-1 min-w-0 relative text-sm; } .bottom-property-content.bottom-property-content-wrap { diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 0d65fb0a593c..7f6a438951e7 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -952,16 +952,15 @@ (let [properties (->> (:logseq.property.class/properties block) (map (fn [e] [(:db/ident e)]))) opts' (assoc opts :class-schema? true)] - [:div.flex.flex-col.gap-1 + [:div.flex.flex-col.gap-1.ml-3.mt-2 [:div {:style {:font-size 15}} - [:div.property-pair - [:div.property-key.text-sm - (property-key-cp block (db/entity :logseq.property.class/properties) {})]] - [:div.text-muted-foreground {:style {:margin-left 26}} + [:div.property-key.text-sm + (property-key-cp block (db/entity :logseq.property.class/properties) {})] + [:div.text-muted-foreground (t :class/tag-properties-desc)]] - [:div.ml-4.gap-1.flex.flex-col + [:div.gap-1.flex.flex-col (properties-section block properties opts') (hidden-properties-cp block hidden-properties (assoc opts :show-hidden-properties? show-hidden-properties?)) - [:div.ml-3 + [:div.mt-1 (rum/with-key (new-property block opts') (str id "-class-add-property"))]]]))]])))])) diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index 66b32b0b33c7..957742ddd6ce 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -333,6 +333,29 @@ } } +/* Bottom property pills need wrapping for long node references. + Keep this override in property.css so it wins against the default + `.property-value-inner .select-item { whitespace-nowrap; }` rule. */ +.positioned-properties.block-below .bottom-property-content .property-value-inner[data-type=node] .multi-values.jtrigger { + min-width: 0; + max-width: 100%; + width: 100%; +} + +.positioned-properties.block-below .bottom-property-content .property-value-inner[data-type=node] .select-item, +.positioned-properties.block-below .bottom-property-content .property-value-inner[data-type=node] .page-ref, +.positioned-properties.block-below .bottom-property-content .property-value-inner[data-type=node] .block-title-wrap { + white-space: normal; + overflow-wrap: anywhere; + word-break: break-word; + min-width: 0; + max-width: 100%; +} + +.positioned-properties.block-below .bottom-property-content .property-value-inner[data-type=node] .select-item { + display: block; +} + .block-main-container .ls-properties-area { margin-top: 0.25em; } From 796f785e55ed46eb65d861e7d8550d3b9e76486e Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 17:58:42 +0800 Subject: [PATCH 0010/1400] Optimize bidirectional property lookup with AVET datoms --- deps/db/src/logseq/db.cljs | 72 ++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 38 deletions(-) diff --git a/deps/db/src/logseq/db.cljs b/deps/db/src/logseq/db.cljs index f249a698b2e6..6b02c5e985a6 100644 --- a/deps/db/src/logseq/db.cljs +++ b/deps/db/src/logseq/db.cljs @@ -825,24 +825,29 @@ (def get-class-title-with-extends db-db/get-class-title-with-extends) (defn- bidirectional-property-attr? - [db attr] + [attr] (when (qualified-keyword? attr) (let [attr-ns (namespace attr)] - (and (or (db-property/user-property-namespace? attr-ns) - (db-property/plugin-property? attr)) - (when-let [property (d/entity db attr)] - (= :db.type/ref (:db/valueType property))))))) + (or (db-property/user-property-namespace? attr-ns) + (db-property/plugin-property? attr))))) + +(defn- get-bidirectional-property-attrs + [db] + (->> (d/q '[:find [?a ...] + :where + [?property :db/ident ?a] + [?property :db/valueType :db.type/ref] + [?property :logseq.property/classes ?class]] + db) + (filter bidirectional-property-attr?))) (defn- get-ea-by-v - [db v] - (d/q '[:find ?e ?a - :in $ ?v - :where - [?e ?a ?v] - [?ea :db/ident ?a] - [?ea :logseq.property/classes ?c]] - db - v)) + [db attrs v] + (->> attrs + (mapcat (fn [attr] + (map (fn [datom] + [(:e datom) attr]) + (d/datoms db :avet attr v)))))) (defn- add-entity [acc class-id entity] @@ -875,30 +880,21 @@ [db target-id] (when (and db target-id (not (:logseq.property/created-from-property (d/entity db target-id)))) - (let [*attr->bidirectional? (volatile! {}) - bidirectional-property-attr-cached? - (fn [attr] - (let [cache @*attr->bidirectional?] - (if (contains? cache attr) - (get cache attr) - (let [result (bidirectional-property-attr? db attr)] - (vswap! *attr->bidirectional? assoc attr result) - result))))] - (->> (get-ea-by-v db target-id) - (keep (fn [[e a]] - (when (bidirectional-property-attr-cached? a) - (when-let [entity (d/entity db e)] - (when (and (not= (:db/id entity) target-id) - (not (entity-util/recycled? entity)) - (not (entity-util/class? entity)) - (not (entity-util/property? entity))) - (let [classes (filter entity-util/class? (:block/tags entity))] - (when (seq classes) - (keep (fn [class-ent] - (when (and (not (built-in? class-ent)) - (not (entity-util/recycled? class-ent))) - [(:db/id class-ent) entity])) - classes)))))))) + (let [bidirectional-attrs (get-bidirectional-property-attrs db)] + (->> (get-ea-by-v db bidirectional-attrs target-id) + (keep (fn [[e _a]] + (when-let [entity (d/entity db e)] + (when (and (not= (:db/id entity) target-id) + (not (entity-util/recycled? entity)) + (not (entity-util/class? entity)) + (not (entity-util/property? entity))) + (let [classes (filter entity-util/class? (:block/tags entity))] + (when (seq classes) + (keep (fn [class-ent] + (when (and (not (built-in? class-ent)) + (not (entity-util/recycled? class-ent))) + [(:db/id class-ent) entity])) + classes))))))) (mapcat identity) (reduce (fn [acc [class-ent entity]] (add-entity acc class-ent entity)) From 59e4277e9bc052b06717ed62167b551c24fec9d4 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 18:24:48 +0800 Subject: [PATCH 0011/1400] fix: tag properties not displayed --- .../src/logseq/outliner/property.cljs | 13 +++++++-- .../test/logseq/outliner/property_test.cljs | 13 +++++++++ src/main/frontend/components/block.cljs | 8 +++-- .../frontend/components/property/value.cljs | 29 +++++++++++-------- 4 files changed, 46 insertions(+), 17 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index 325d7e043320..6331e191937c 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -805,7 +805,7 @@ :properties))) (defn- property-with-position? - [db property-id block position] + [db property-id block position {:keys [allow-empty-block-below?]}] (when-let [property (entity-plus/entity-memoized db property-id)] (let [property-position' (resolved-property-position db block property)] (and @@ -817,6 +817,7 @@ (not (and (= property-position' :block-below) (nil? (get block property-id)) + (not allow-empty-block-below?) (not (tag-class-page? db block)))))))) (defn property-with-other-position? @@ -827,18 +828,24 @@ [db eid position] (let [block (d/entity db eid) own-properties (:block.temp/property-keys block) + classes-properties (when-not (tag-class-page? db block) + (:classes-properties (get-block-classes-properties db eid))) + classes-properties-set (set (map :db/ident classes-properties)) tag-page-pill-properties (when (tag-class-page? db block) [:logseq.property.class/extends :logseq.property.class/enable-bidirectional?]) positioned-property-ids (if (tag-class-page? db block) (->> (concat own-properties tag-page-pill-properties) distinct) - (->> (:classes-properties (get-block-classes-properties db eid)) + (->> classes-properties (map :db/ident) (concat own-properties) distinct))] (->> positioned-property-ids - (filter (fn [id] (property-with-position? db id block position))) + (filter (fn [id] + (property-with-position? db id block position + {:allow-empty-block-below? + (contains? classes-properties-set id)}))) (map #(d/entity db %)) (ldb/sort-by-order)))) diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index a8a5acbf7fe6..9d945bd762c5 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -456,6 +456,19 @@ (is (not-any? #(= :logseq.property.journal/title-format (:db/ident %)) positioned-properties)))) +(deftest get-block-positioned-properties-keeps-empty-inherited-tag-properties + (let [conn (db-test/create-conn-with-blocks + {:properties {:authors {:logseq.property/type :node + :db/cardinality :db.cardinality/many}} + :classes {:Paper {:build/class-properties [:authors]}} + :pages-and-blocks [{:page {:block/title "page1"} + :blocks [{:block/title "paper1" + :build/tags [:Paper]}]}]}) + paper1 (db-test/find-block-by-content @conn "paper1") + positioned-properties (outliner-property/get-block-positioned-properties @conn (:db/id paper1) :block-below) + positioned-idents (set (map :db/ident positioned-properties))] + (is (contains? positioned-idents :user.property/authors)))) + (deftest extends-cycle (testing "Fail when creating a cycle of extends" (let [conn (db-test/create-conn-with-blocks diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 34a69001516a..b2bd99a7d6a2 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2693,7 +2693,10 @@ (defn- bottom-property-pill-cp [block property opts] (let [many-node? (and (= :node (:logseq.property/type property)) - (= :db.cardinality/many (:db/cardinality property)))] + (= :db.cardinality/many (:db/cardinality property))) + property-value (get block (:db/ident property)) + empty-placeholder? (= :logseq.property/empty-placeholder (:db/ident property-value)) + has-value? (and (some? property-value) (not empty-placeholder?))] [:div.bottom-property-pill.bottom-property-pill-focusable {:key (str (:db/id block) "-" (:db/id property)) :class (util/classnames [{:bottom-property-pill-wrap many-node?}]) @@ -2709,7 +2712,8 @@ {:bottom-property-content-wrap many-node?}]) :style {:min-height 20}} (pv/property-value block property opts) - (when (contains? #{:date :datetime} (:logseq.property/type property)) + (when (and has-value? + (contains? #{:date :datetime} (:logseq.property/type property))) [:button.bottom-property-edit-icon.select-none {:type "button" :on-click (fn [e] diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 7555f686b62e..b6f54284ee32 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -54,11 +54,13 @@ (and (map? m) (:db/id m))) (rum/defc property-empty-btn-value - [property & opts] - (let [text (if (= (:db/ident property) :logseq.property/description) + [property & [opts]] + (let [text (if (= (:property-position opts) :block-below) + (ui/icon "line-dashed") + (if (= (:db/ident property) :logseq.property/description) (t :property/add-description) - (t :ui/empty))] - (shui/button (merge {:class "empty-btn" :variant :text} opts) + (t :ui/empty)))] + (shui/button (merge {:class "empty-btn" :variant :text} (or opts {})) text))) (rum/defc property-empty-text-value @@ -66,11 +68,13 @@ [:span.inline-flex.items-center.cursor-pointer.w-full (merge {:class "empty-text-btn" :variant :text}) (when-not table-view? - (if property-position - (if-let [icon (:logseq.property/icon property)] - (icon-component/icon icon {:color? true}) - (ui/icon "line-dashed")) - (t :ui/empty)))]) + (if (= property-position :block-below) + (ui/icon "line-dashed") + (if property-position + (if-let [icon (:logseq.property/icon property)] + (icon-component/icon icon {:color? true}) + (ui/icon "line-dashed")) + (t :ui/empty))))]) (defn- get-selected-blocks [] @@ -464,7 +468,8 @@ (:db/ident property))) (rum/defc date-picker - [value {:keys [block property datetime? on-change on-delete del-btn? editing? multiple-values? other-position? suppress-inline-edit-icon?]}] + [value {:keys [block property datetime? on-change on-delete del-btn? editing? multiple-values? other-position? + suppress-inline-edit-icon? property-position]}] (let [*el (hooks/use-ref nil) content-fn (fn [{:keys [id]}] (calendar-inner id {:block block @@ -536,7 +541,7 @@ :suppress-inline-edit-icon? suppress-inline-edit-icon?}) :else - (property-empty-btn-value nil))]))))) + (property-empty-btn-value nil {:property-position property-position}))]))))) (rum/defc property-value-date-picker [block property value opts] @@ -1198,7 +1203,7 @@ [:div.select-item.cursor-pointer (cond (= value :logseq.property/empty-placeholder) - (property-empty-btn-value property) + (property-empty-btn-value property opts) closed-values? (closed-value-item value opts) From a5bee4a5fb55ca4bb7b0a8e7985d299c54e6f14e Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 19:40:44 +0800 Subject: [PATCH 0012/1400] fix: refine bidirectional and bottom property behaviors --- gulpfile.js | 16 +++- packages/ui/@/components/ui/tabs.tsx | 96 +++++++++++++++++----- src/main/frontend/components/block.cljs | 8 +- src/main/frontend/components/block.css | 4 - src/main/frontend/components/property.cljs | 51 +++++++----- src/main/frontend/components/property.css | 8 +- src/main/frontend/components/views.cljs | 8 +- src/main/frontend/handler/editor.cljs | 79 ++++++++++++------ 8 files changed, 188 insertions(+), 82 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 7f31d5efc494..f9fdc109ecc5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -80,6 +80,13 @@ const common = { return rawCopySrc(resourceFilePath).pipe(gulp.dest(outputPath)) }, + syncUIAssetFile (...params) { + return gulp.series( + () => rawCopySrc(['packages/ui/dist/ui.js']).pipe(gulp.dest(path.join(outputPath, 'js'))), + () => rawCopySrc(['packages/ui/dist/ui.js']).pipe(gulp.dest(path.join(outputPath, 'mobile', 'js'))), + )(...params) + }, + // NOTE: All assets from node_modules are copied to the output directory syncAssetFiles (...params) { return gulp.series( @@ -160,6 +167,11 @@ const common = { common.syncResourceFile) }, + keepSyncUIAssetFile () { + return gulp.watch(['packages/ui/dist/ui.js'], { ignoreInitial: true }, + common.syncUIAssetFile) + }, + syncAllStatic () { return rawCopySrc([ outputFilePath, @@ -306,10 +318,10 @@ exports.clean = common.clean exports.watch = gulp.series( common.syncResourceFile, common.syncAssetFiles, common.switchReactDevelopmentMode, - gulp.parallel(common.keepSyncResourceFile, css.watchCSS)) + gulp.parallel(common.keepSyncResourceFile, common.keepSyncUIAssetFile, css.watchCSS)) exports.watchMobile = gulp.series( common.syncResourceFile, common.syncAssetFiles, - gulp.parallel(common.keepSyncResourceFile, common.keepSyncWorkersToMobile, css.watchMobileCSS)) + gulp.parallel(common.keepSyncResourceFile, common.keepSyncUIAssetFile, common.keepSyncWorkersToMobile, css.watchMobileCSS)) exports.build = gulp.series(common.clean, common.syncResourceFile, common.syncAssetFiles, css.buildCSS) exports.buildMobile = gulp.series(common.clean, common.syncResourceFile, diff --git a/packages/ui/@/components/ui/tabs.tsx b/packages/ui/@/components/ui/tabs.tsx index f57fffdb5a07..72f12ce2ecf3 100644 --- a/packages/ui/@/components/ui/tabs.tsx +++ b/packages/ui/@/components/ui/tabs.tsx @@ -1,38 +1,90 @@ import * as React from "react" import * as TabsPrimitive from "@radix-ui/react-tabs" +import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const Tabs = TabsPrimitive.Root +const tabsListVariants = cva( + "inline-flex items-center justify-center text-muted-foreground", + { + variants: { + variant: { + default: "h-10 rounded-md bg-muted p-1", + line: "h-auto justify-start gap-1 rounded-none bg-transparent p-0", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +const tabsTriggerVariants = cva( + "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background transition-all " + + "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 " + + "disabled:pointer-events-none disabled:opacity-50", + { + variants: { + variant: { + default: + "rounded-sm px-3 py-1.5 data-[state=active]:bg-background data-[state=active]:text-foreground " + + "data-[state=active]:shadow-sm", + line: + "rounded-none border-b-2 border-transparent px-3 py-2 text-muted-foreground " + + "data-[state=active]:border-foreground data-[state=active]:text-foreground", + }, + }, + defaultVariants: { + variant: "default", + }, + } +) + +type TabsVariant = NonNullable["variant"]> + +const TabsVariantContext = React.createContext("default") + +export interface TabsListProps + extends React.ComponentPropsWithoutRef, + VariantProps {} + const TabsList = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) + TabsListProps +>(({ className, variant, ...props }, ref) => { + const resolvedVariant = variant ?? "default" + return ( + + + + ) +}) TabsList.displayName = TabsPrimitive.List.displayName +export interface TabsTriggerProps + extends React.ComponentPropsWithoutRef, + VariantProps {} + const TabsTrigger = React.forwardRef< React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) + TabsTriggerProps +>(({ className, variant, ...props }, ref) => { + const listVariant = React.useContext(TabsVariantContext) + const resolvedVariant = variant ?? listVariant + return ( + + ) +}) TabsTrigger.displayName = TabsPrimitive.Trigger.displayName const TabsContent = React.forwardRef< diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index b2bd99a7d6a2..f2b24c54562e 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2006,9 +2006,10 @@ order-list? (boolean own-number-list?) order-list-idx (:own-order-list-index config) page-title? (:page-title? config) + collapsable-page-title? (or page-title? (:collapsable-page-title? config)) collapsable? (editor-handler/collapsable? uuid {:semantic? true :ignore-children? page-title? - :page-title? page-title?}) + :page-title? collapsable-page-title?}) link? (boolean (:original-block config)) icon-size (if collapsed? 12 14) icon (icon-component/get-node-icon-cp block {:size icon-size :color? true :link? link?}) @@ -2748,7 +2749,10 @@ (rum/defc block-positioned-properties [config block position] - (let [properties (outliner-property/get-block-positioned-properties (db/get-db) (:db/id block) position) + (let [properties (cond->> (outliner-property/get-block-positioned-properties (db/get-db) (:db/id block) position) + (= position :block-below) + (remove (fn [property] + (= (:db/ident property) :logseq.property/icon)))) has-viewable-properties? (seq properties) opts (merge config {:icon? true diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index c3125a9e7e1c..f11521a73aea 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1278,10 +1278,6 @@ html.is-mac { height: 24px; } -.ls-page-title .positioned-properties.block-below { - margin-left: 7px; -} - .ls-page-title .ls-properties-area .positioned-properties.block-left svg, .ls-page-title .ls-properties-area .positioned-properties.block-right svg { width: initial; diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 7f6a438951e7..9900d16df6b1 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -324,32 +324,45 @@ :container-id container-id :editor-box (state/get-component :editor/box) :default-collapsed? true + :bidirectional? true + :collapsable-page-title? true + :page-title? false :ref? true}] (if (and blocks-container (seq entities)) - [:div.property-block-container.content.w-full + [:div.ls-bidirectional-block-container.w-full (blocks-container config entities)] [:span.opacity-60 (t :view.filter/empty)]))) (rum/defc bidirectional-properties-section < rum/static [bidirectional-properties] (when (seq bidirectional-properties) - (for [{:keys [class title entities]} bidirectional-properties] - [:div.property-pair.property-panel-row {:key (str "bidirectional-" title)} - [:div.property-key-panel - [:div.property-key-inner - (if class - [:a.property-k.flex.select-none.w-full.jtrigger - {:on-click (fn [e] - (util/stop e) - (route-handler/redirect-to-page! (:block/uuid class)))} - title] - [:div.property-k.flex.select-none.w-full title])]] - [:div.ls-block.property-value-container.property-value-panel - [:div.property-panel-bullet {:aria-hidden true} - [:span.bullet-container - [:span.bullet]]] - [:div.property-value.property-value-panel-inner.flex.flex-1 - (bidirectional-values-cp entities)]]]))) + (let [normalized-items (map-indexed + (fn [idx {:keys [class title entities]}] + (let [value (str (or (:db/id class) (str "idx-" idx)))] + {:value value + :class class + :title title + :entities entities})) + bidirectional-properties) + default-value (:value (first normalized-items))] + [:div.w-full.ls-bidirectional-properties.mt-8 + (shui/tabs + {:defaultValue default-value + :class "w-full"} + (shui/tabs-list + {:variant :line + :class "h-8 gap-3"} + (for [{:keys [value title]} normalized-items] + (shui/tabs-trigger + {:key (str "bidirectional-tab-" value) + :value value + :class "px-0 py-1 text-base text-foreground"} + [:span title]))) + (for [{:keys [value entities]} normalized-items] + (shui/tabs-content + {:key (str "bidirectional-tab-content-" value) + :value value} + (bidirectional-values-cp entities))))]))) (rum/defcs ^:large-vars/cleanup-todo property-input < rum/reactive (rum/local false ::show-new-property-config?) @@ -940,7 +953,7 @@ :tab-index 0} [:<> (when show-properties-panel? - [:div.properties-panel + [:div.properties-panel.gap-8 (properties-section block properties' opts) (bidirectional-properties-section bidirectional-properties)]) diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index 957742ddd6ce..addfd72fcbe8 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -21,6 +21,10 @@ @apply -ml-5 flex flex-1; } +.ls-bidirectional-block-container { + @apply w-full; +} + .ls-page-properties > .ls-properties-area > .property-block { margin-left: -22px; } @@ -29,10 +33,6 @@ margin-left: 0; } -.ls-block .property-pair, .ls-sidebar-page-properties .property-pair, .property-block .property-value, .block-property-value { - margin-left: 7px; -} - .grid-auto-fit { grid-template-columns: repeat(auto-fit, 120px); } diff --git a/src/main/frontend/components/views.cljs b/src/main/frontend/components/views.cljs index ef8d8fd5918e..de40e25c547b 100644 --- a/src/main/frontend/components/views.cljs +++ b/src/main/frontend/components/views.cljs @@ -1672,7 +1672,9 @@ (rum/defcs list-view < rum/static mixins/container-id [state {:keys [config ref-matched-children-ids disable-virtualized?] :as option} view-entity {:keys [rows]} *scroller-ref] - (let [config (assoc config :container-id (:container-id state)) + (let [view-feature-type (:logseq.property.view/feature-type view-entity) + references-view? (contains? #{:linked-references :unlinked-references} view-feature-type) + config (assoc config :container-id (:container-id state)) lazy-item-render (fn [rows idx] (lazy-item rows idx (assoc option :list-view? true) (fn [block] @@ -1680,7 +1682,9 @@ (assoc config :list-view? true :block-level 1) - (= :linked-references (:logseq.property.view/feature-type view-entity)) + references-view? + (assoc :ref? true) + (= :linked-references view-feature-type) (assoc :ref-matched-children-ids ref-matched-children-ids))] (block-container config' block))))) list-cp (fn [rows] diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 5ce55dfb474b..28d7c094945a 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -3038,13 +3038,18 @@ (let [class-properties (:classes-properties (outliner-property/get-block-classes-properties (db/get-db) (:db/id block))) db (db/get-db) attributes (set (remove #{:block/alias} db-property/db-attribute-properties)) + bottom-positioned-property-idents (when-not page-title? + (->> (outliner-property/get-block-positioned-properties db (:db/id block) :block-below) + (map :db/ident) + set)) properties (->> (:block.temp/property-keys block) (map (partial entity-plus/entity-memoized db)) (concat class-properties) (remove (fn [e] (attributes (:db/ident e)))) - (remove (fn [k] + (remove (fn [property] (when-not page-title? - (outliner-property/property-with-other-position? db block k)))) + (and (outliner-property/property-with-other-position? db block property) + (not (contains? bottom-positioned-property-idents (:db/ident property))))))) (remove (fn [e] (:logseq.property/hide? e))) (remove nil?))] (or (seq properties) @@ -3146,6 +3151,17 @@ (let [config (last (state/get-editor-args))] (:ref? config))) +(defn- collapse-block-opts + [] + (let [config (last (state/get-editor-args)) + collapsable-page-title? (or (:page-title? config) + (:collapsable-page-title? config))] + {:page-title? collapsable-page-title?})) + +(defn- current-editor-container-id + [] + (some-> (state/get-editor-args) last :container-id)) + (defn set-blocks-collapsed! [block-ids value] (let [block-ids (map (fn [block-id] (if (string? block-id) (uuid block-id) block-id)) block-ids) @@ -3162,19 +3178,22 @@ (doseq [block-id block-ids] (state/set-collapsed-block! block-id value))))) -(defn collapse-block! [block-id] - (when (collapsable? block-id) - (when-not (skip-collapsing-in-db?) - (set-blocks-collapsed! [block-id] true)) - (state/set-collapsed-block! block-id true))) - -(defn expand-block! [block-id & {:keys [skip-db-collpsing?]}] +(defn collapse-block! + ([block-id] + (collapse-block! block-id nil)) + ([block-id container-id] + (when (collapsable? block-id (collapse-block-opts)) + (when-not (skip-collapsing-in-db?) + (set-blocks-collapsed! [block-id] true)) + (state/set-collapsed-block! block-id true (or container-id (current-editor-container-id)))))) + +(defn expand-block! [block-id & {:keys [skip-db-collpsing? container-id]}] (let [repo (state/get-current-repo)] (p/do! (db-async/> (get-selected-blocks) (map (fn [dom] - (-> (dom/attr dom "blockid") - uuid - expand-block!))) + (let [block-id (some-> (dom/attr dom "blockid") uuid) + container-id (dom/attr dom "containerid")] + (when block-id + (expand-block! block-id :container-id container-id))))) doall) (and clear-selection? (clear-selection!))) @@ -3223,9 +3243,10 @@ (do (->> (get-selected-blocks) (map (fn [dom] - (-> (dom/attr dom "blockid") - uuid - collapse-block!))) + (let [block-id (some-> (dom/attr dom "blockid") uuid) + container-id (dom/attr dom "containerid")] + (when block-id + (collapse-block! block-id container-id))))) doall) (and clear-selection? (clear-selection!))) @@ -3459,17 +3480,21 @@ Currently, this handles all the kinds of views." [block config] (let [block (or (db/entity (:db/id block)) block)] - (or - (util/collapsed? block) - (and (util/mobile?) (ldb/class-instance? (entity-plus/entity-memoized (db/get-db) :logseq.class/Query) block)) - (and (or (:list-view? config) (:ref? config)) - (or (:block/_parent block) (:block.temp/has-children? block)) - (integer? (:block-level config)) - (>= (:block-level config) (state/get-ref-open-blocks-level))) - (:default-collapsed? config) - (and (or (:view? config) (:popup? config)) - (or (ldb/page? block) - (:table-block-title? config)))))) + (if (:bidirectional? config) + (if (:ref-query-child? config) + (util/collapsed? block) + true) + (or + (util/collapsed? block) + (and (util/mobile?) (ldb/class-instance? (entity-plus/entity-memoized (db/get-db) :logseq.class/Query) block)) + (and (or (:list-view? config) (:ref? config)) + (or (:block/_parent block) (:block.temp/has-children? block)) + (integer? (:block-level config)) + (>= (:block-level config) (state/get-ref-open-blocks-level))) + (:default-collapsed? config) + (and (or (:view? config) (:popup? config)) + (or (ldb/page? block) + (:table-block-title? config))))))) (defn batch-set-heading! [block-ids heading] From 27414fb604dbb3ee7209ed235dd3718f8ea5479a Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 19:52:04 +0800 Subject: [PATCH 0013/1400] put hidden properties at top of bidirectional properties --- src/main/frontend/components/property.cljs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 9900d16df6b1..92ab5a9ca402 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -952,15 +952,15 @@ :class (util/classnames [{:ls-page-properties page?}]) :tab-index 0} [:<> + (when-not class? + (hidden-properties-cp block hidden-properties + (assoc opts :show-hidden-properties? show-hidden-properties?))) + (when show-properties-panel? [:div.properties-panel.gap-8 (properties-section block properties' opts) (bidirectional-properties-section bidirectional-properties)]) - (when-not class? - (hidden-properties-cp block hidden-properties - (assoc opts :show-hidden-properties? show-hidden-properties?))) - (when class? (let [properties (->> (:logseq.property.class/properties block) (map (fn [e] [(:db/ident e)]))) From ce0ffc0ea22239abf121b73cadecf981215caff9 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 20:31:16 +0800 Subject: [PATCH 0014/1400] fix: restore bottom property keyboard navigation --- src/main/frontend/components/block.cljs | 4 +--- src/main/frontend/components/container.cljs | 8 +++---- src/main/frontend/components/container.css | 8 +++---- src/main/frontend/components/editor.cljs | 2 -- src/main/frontend/handler/editor.cljs | 24 +++++++++++++++++++-- 5 files changed, 29 insertions(+), 17 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index f2b24c54562e..8fbbb7c3c150 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2709,7 +2709,7 @@ (property-component/property-key-cp block property opts) [:div.select-none ":"]] [:div {:class (util/classnames - ["bottom-property-content ls-block property-value-container" + ["bottom-property-content property-value-container" {:bottom-property-content-wrap many-node?}]) :style {:min-height 20}} (pv/property-value block property opts) @@ -3380,8 +3380,6 @@ (when doc-mode? (dom/remove-class! node "hide-inner-bullet")))) (when (non-dragging? e) - (when-let [container (gdom/getElement "app-container-wrapper")] - (dom/add-class! container "blocks-selection-mode")) (editor-handler/highlight-selection-area! block-id block-dom-node {:append? true}))))) (defn- block-mouse-leave diff --git a/src/main/frontend/components/container.cljs b/src/main/frontend/components/container.cljs index 47de27a509eb..986d9111cdfc 100644 --- a/src/main/frontend/components/container.cljs +++ b/src/main/frontend/components/container.cljs @@ -440,11 +440,9 @@ :ls-fold-button-on-right fold-button-on-right? :ls-hl-colored ls-block-hl-colored?}]) :on-pointer-up (fn [] - (when-let [container (gdom/getElement "app-container-wrapper")] - (d/remove-class! container "blocks-selection-mode") - (when (and (> (count (state/get-selection-blocks)) 1) - (not (util/input? js/document.activeElement))) - (util/clear-selection!))))} + (when (and (> (count (state/get-selection-blocks)) 1) + (not (util/input? js/document.activeElement))) + (util/clear-selection!)))} [:button#skip-to-main {:on-click #(ui/focus-element (ui/main-node)) diff --git a/src/main/frontend/components/container.css b/src/main/frontend/components/container.css index 8f87d4191a05..8bf022638918 100644 --- a/src/main/frontend/components/container.css +++ b/src/main/frontend/components/container.css @@ -765,9 +765,7 @@ html[data-theme='dark'] { } } -.blocks-selection-mode .page-title, -.blocks-selection-mode .block-content-inner, -.blocks-selection-mode .block-body, -.blocks-selection-mode .ls-properties-area { - @apply select-none; +.ls-block.selected, +.ls-block.selected * { + user-select: none; } diff --git a/src/main/frontend/components/editor.cljs b/src/main/frontend/components/editor.cljs index 5104eb75bece..23b322a0215c 100644 --- a/src/main/frontend/components/editor.cljs +++ b/src/main/frontend/components/editor.cljs @@ -691,8 +691,6 @@ ;; exit editing mode :else (let [select? (= type :esc)] - (when-let [container (gdom/getElement "app-container")] - (dom/remove-class! container "blocks-selection-mode")) (p/do! (editor-handler/escape-editing {:select? select? :editing-another-block? editing-another-block?}) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index 28d7c094945a..3c9cbb69d6cd 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -2154,6 +2154,10 @@ [node] (some-> node (.closest ".bottom-properties-row"))) +(defn- bottom-properties-row-in-block + [block-node] + (some-> block-node (.querySelector ".bottom-properties-row"))) + (defn- focus-trigger [_current-block sibling-block] (if-let [trigger (first (dom/by-class sibling-block "jtrigger"))] @@ -2182,9 +2186,11 @@ (assoc :exclude-property? true))) {:block/keys [uuid title]} (state/get-edit-block) sibling-block (or (when (property-value-node? sibling-block) - (first (dom/by-class sibling-block "ls-block"))) + (util/rec-get-node sibling-block "ls-block")) sibling-block) + current-bottom-properties-row (bottom-properties-row-in-block current-block) bottom-properties-row (bottom-properties-row-node sibling-block) + sibling-bottom-properties-row (bottom-properties-row-in-block sibling-block) property-value-container? (property-value-node? sibling-block)] (if sibling-block (let [sibling-block-id (dom/attr sibling-block "blockid") @@ -2198,6 +2204,20 @@ (save-block! repo uuid value)) (cond + (and (= :down direction) + input + (= active-element input) + current-bottom-properties-row) + (do + (state/clear-edit!) + (.focus current-bottom-properties-row)) + + (and (= :up direction) + sibling-bottom-properties-row) + (do + (state/clear-edit!) + (.focus sibling-bottom-properties-row)) + (and (dom/has-class? sibling-block "block-add-button") (util/rec-get-node current-block "ls-page-title")) (.click sibling-block) @@ -2264,7 +2284,7 @@ sibling-block (or (when (and sibling-block (property-value-node? sibling-block)) (if (and up? editing-block (gdom/contains sibling-block editing-block)) (f sibling-block) - (first (dom/by-class sibling-block "ls-block")))) + (util/rec-get-node sibling-block "ls-block"))) sibling-block)] (when sibling-block (let [content (:block/title block) From 89e1133d37dc7b37c85be5f002b73699494ccf32 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 20:37:13 +0800 Subject: [PATCH 0015/1400] fix: adjust bottom property date edit button visibility --- src/main/frontend/components/block.css | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index f11521a73aea..9cdf7a867c19 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1163,13 +1163,12 @@ html.is-mac { } .bottom-property-edit-icon { - @apply inline-flex items-center justify-end pr-0 py-2 px-2 border-0 cursor-pointer opacity-0 pointer-events-none; - position: absolute; - right: -10px; - top: 1px; - height: calc(100% - 2px); + @apply inline-flex items-center justify-center p-0 border-0 cursor-pointer opacity-50 pointer-events-auto; + width: 18px; + height: 18px; + flex-shrink: 0; color: var(--ls-primary-text-color); - background: linear-gradient(to left, var(--ls-secondary-background-color) 65%, transparent); + background: transparent; } .bottom-property-pill:hover .bottom-property-edit-icon, From cec50138a3f152fcfa78173777871ae4cac14afa Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 21:00:14 +0800 Subject: [PATCH 0016/1400] fix: unify bottom property action buttons --- src/main/frontend/components/block.css | 17 ++++- src/main/frontend/components/property.cljs | 84 +++++++++++++--------- 2 files changed, 65 insertions(+), 36 deletions(-) diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 9cdf7a867c19..c57088a7e5f6 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1148,12 +1148,27 @@ html.is-mac { .ls-new-property .jtrigger, .bottom-property-control-btn { - @apply inline-flex items-center rounded-full px-1.5 py-0.5 h-6 text-xs text-muted-foreground; + @apply inline-flex items-center justify-center w-6 h-6 p-0 rounded-full text-xs; + color: var(--ls-secondary-text-color); + background-color: var(--ls-secondary-background-color); + border: 0; box-shadow: inset 0 0 0 1px var(--ls-border-color); } + .ls-new-property .jtrigger:hover, + .bottom-property-control-btn:hover { + color: var(--ls-secondary-text-color); + background-color: var(--ls-secondary-background-color); + } + .bottom-property-add-btn { @apply justify-center w-6 h-6 p-0 rounded-full; + border-radius: 9999px; + } + + .bottom-property-action-icon { + width: 16px; + height: 16px; } .ls-new-property .jtrigger.bottom-property-add-btn:focus, diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index 92ab5a9ca402..e0b36735bb42 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -465,25 +465,28 @@ bottom-row-nav? (:bottom-row-nav? opts) add-new-property! (fn [e] (state/pub-event! [:editor/new-property (merge opts {:block block - :target (.-target e)})]))] + :target (.-target e)})])) + button + (shui/button + {:variant :secondary + :size :sm + :class (str "jtrigger flex" + (when bottom-property-add-button? " bottom-property-add-btn")) + :tab-index (or tab-index 0) + :data-bottom-row-nav (when bottom-row-nav? true) + :aria-label (t :property/add-new) + :on-click add-new-property! + :on-key-press (fn [e] + (when (contains? #{"Enter" " "} (util/ekey e)) + (.preventDefault e) + (add-new-property! e)))} + (ui/icon "plus" {:size 16 :class "bottom-property-action-icon"}) + (when-not icon-only? + (t :property/add-new)))] [:div.ls-new-property - (shui/button - {:variant :outline - :size :small - :class (util/classnames - ["jtrigger flex !px-2 !py-1" - {:bottom-property-add-btn bottom-property-add-button?}]) - :tab-index (or tab-index 0) - :data-bottom-row-nav (when bottom-row-nav? true) - :title (t :property/add-new) - :on-click add-new-property! - :on-key-press (fn [e] - (when (contains? #{"Enter" " "} (util/ekey e)) - (.preventDefault e) - (add-new-property! e)))} - (ui/icon "plus") - (when-not icon-only? - (t :property/add-new)))]))) + (if icon-only? + (ui/tooltip button [:span (t :property/add-new)]) + button)]))) (defn- resolve-linked-block-if-exists "Properties will be updated for the linked page instead of the refed block. @@ -689,6 +692,12 @@ [block-uuid] (contains? @*show-hidden-properties-block-ids block-uuid)) +(defn- hidden-properties-toggle-label + [show-hidden-properties?] + (if show-hidden-properties? + "Collapse hidden properties" + "Show hidden properties")) + (defn has-hidden-properties? [block {:keys [gallery-view?]}] (let [current-db (db/get-db) @@ -783,25 +792,30 @@ (remove-built-in-or-other-position-properties true))] (boolean (seq hidden-properties)))) -(rum/defc hidden-properties-toggle-button +(rum/defc hidden-properties-toggle-button < rum/reactive [block {:keys [icon-only? tab-index bottom-row-nav?] :as _opts}] - (let [block-uuid (:block/uuid block)] + (let [block-uuid (:block/uuid block) + shown-block-ids (rum/react *show-hidden-properties-block-ids) + show-hidden-properties? (contains? shown-block-ids block-uuid) + label (hidden-properties-toggle-label show-hidden-properties?)] (when block-uuid - (shui/button - {:variant :outline - :size :small - :class (util/classnames - ["bottom-property-control-btn" - {:bottom-property-add-btn icon-only?}]) - :tab-index (or tab-index 0) - :data-bottom-row-nav (when bottom-row-nav? true) - :title (t :property/hidden-properties) - :on-click (fn [e] - (util/stop e) - (toggle-hidden-properties-visibility! block-uuid))} - (if icon-only? - [:span.select-none "⋯"] - (t :property/hidden-properties)))))) + (let [button + (shui/button + {:variant :outline + :size :small + :class (str "bottom-property-control-btn" + (when icon-only? " bottom-property-add-btn")) + :tab-index (or tab-index 0) + :data-bottom-row-nav (when bottom-row-nav? true) + :aria-label label + :on-click (fn [e] + (util/stop e) + (toggle-hidden-properties-visibility! block-uuid))} + (ui/icon (if show-hidden-properties? "chevron-up" "chevron-down") + {:size 16 :class "bottom-property-action-icon"}) + (when-not icon-only? + label))] + (ui/tooltip button [:span label]))))) (rum/defc hidden-properties-cp [block hidden-properties {:keys [show-hidden-properties?] :as opts}] From f46b95131930a6781aac3f0241065a3511f2dd75 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 21:03:28 +0800 Subject: [PATCH 0017/1400] fix: update property value interactions --- src/main/frontend/components/property/value.cljs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index b6f54284ee32..b82648be4bba 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -55,11 +55,9 @@ (rum/defc property-empty-btn-value [property & [opts]] - (let [text (if (= (:property-position opts) :block-below) - (ui/icon "line-dashed") - (if (= (:db/ident property) :logseq.property/description) + (let [text (if (= (:db/ident property) :logseq.property/description) (t :property/add-description) - (t :ui/empty)))] + (ui/icon "line-dashed"))] (shui/button (merge {:class "empty-btn" :variant :text} (or opts {})) text))) @@ -70,11 +68,9 @@ (when-not table-view? (if (= property-position :block-below) (ui/icon "line-dashed") - (if property-position - (if-let [icon (:logseq.property/icon property)] - (icon-component/icon icon {:color? true}) - (ui/icon "line-dashed")) - (t :ui/empty))))]) + (if-let [icon (:logseq.property/icon property)] + (icon-component/icon icon {:color? true}) + (ui/icon "line-dashed"))))]) (defn- get-selected-blocks [] From eccd23a0e77268e1564a9ac5c2e179d7e98aee33 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Sat, 25 Apr 2026 21:12:40 +0800 Subject: [PATCH 0018/1400] fix: remove hidden properties translation key and update labels --- src/main/frontend/components/property.cljs | 4 ++-- src/resources/dicts/af.edn | 1 - src/resources/dicts/ar.edn | 1 - src/resources/dicts/ca.edn | 1 - src/resources/dicts/cs.edn | 1 - src/resources/dicts/de.edn | 1 - src/resources/dicts/en.edn | 1 - src/resources/dicts/es.edn | 1 - src/resources/dicts/fa.edn | 1 - src/resources/dicts/fr.edn | 1 - src/resources/dicts/id.edn | 1 - src/resources/dicts/it.edn | 1 - src/resources/dicts/ja.edn | 1 - src/resources/dicts/ko.edn | 1 - src/resources/dicts/nb-no.edn | 1 - src/resources/dicts/nl.edn | 1 - src/resources/dicts/pl.edn | 1 - src/resources/dicts/pt-br.edn | 1 - src/resources/dicts/pt-pt.edn | 1 - src/resources/dicts/ru.edn | 1 - src/resources/dicts/sk.edn | 1 - src/resources/dicts/tr.edn | 1 - src/resources/dicts/uk.edn | 1 - src/resources/dicts/zh-cn.edn | 1 - src/resources/dicts/zh-hant.edn | 1 - 25 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index e0b36735bb42..5d024e169e3a 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -801,8 +801,8 @@ (when block-uuid (let [button (shui/button - {:variant :outline - :size :small + {:variant :secondary + :size :sm :class (str "bottom-property-control-btn" (when icon-only? " bottom-property-add-btn")) :tab-index (or tab-index 0) diff --git a/src/resources/dicts/af.edn b/src/resources/dicts/af.edn index ade3dd9ec724..97f01f8e5687 100644 --- a/src/resources/dicts/af.edn +++ b/src/resources/dicts/af.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Sleep om te herordenen" :property/existing-values "Bestaande waarden" :property/go-to-this-property "Ga na eienskapsbladsy" - :property/hidden-properties "Versteekte eienskappe" :property/hide-by-default "Versteek by verstek" :property/hide-choice-for-tag "Keuze versteek vir tag" :property/hide-empty-value "Lege waarden versteek" diff --git a/src/resources/dicts/ar.edn b/src/resources/dicts/ar.edn index b3c800159edf..99f1d7c3fbb6 100644 --- a/src/resources/dicts/ar.edn +++ b/src/resources/dicts/ar.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "اسحب لإعادة الترتيب" :property/existing-values "القيم الموجودة" :property/go-to-this-property "الانتقال إلى صفحة الخاصية" - :property/hidden-properties "خصائص مخفية" :property/hide-by-default "إخفاء افتراضياً" :property/hide-choice-for-tag "إخفاء الخيار للوسم" :property/hide-empty-value "إخفاء القيم الفارغة" diff --git a/src/resources/dicts/ca.edn b/src/resources/dicts/ca.edn index 24a161a40e39..d7f7dc0ac3f6 100644 --- a/src/resources/dicts/ca.edn +++ b/src/resources/dicts/ca.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Arrossegueu per reordenar" :property/existing-values "Valors existents" :property/go-to-this-property "Anar a la pàgina de la propietat" - :property/hidden-properties "Propietats ocultes" :property/hide-by-default "Amagar per defecte" :property/hide-choice-for-tag "Amagar opció per etiqueta" :property/hide-empty-value "Amagar valors buits" diff --git a/src/resources/dicts/cs.edn b/src/resources/dicts/cs.edn index 0fa5ff4ac197..ea9077643aac 100644 --- a/src/resources/dicts/cs.edn +++ b/src/resources/dicts/cs.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Přetáhněte pro změnu pořadí" :property/existing-values "Existující hodnoty" :property/go-to-this-property "Přejít na stránku vlastnosti" - :property/hidden-properties "Skryté vlastnosti" :property/hide-by-default "Skrýt ve výchozím nastavení" :property/hide-choice-for-tag "Skrýt volbu pro štítek" :property/hide-empty-value "Skrýt prázdné hodnoty" diff --git a/src/resources/dicts/de.edn b/src/resources/dicts/de.edn index 77f4cec302f5..6d2257db7ff8 100644 --- a/src/resources/dicts/de.edn +++ b/src/resources/dicts/de.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Ziehen zum Umordnen" :property/existing-values "Vorhandene Werte" :property/go-to-this-property "Zur Eigenschaftsseite" - :property/hidden-properties "Versteckte Eigenschaften" :property/hide-by-default "Standardmäßig ausblenden" :property/hide-choice-for-tag "Auswahl für Tag ausblenden" :property/hide-empty-value "Leere Werte ausblenden" diff --git a/src/resources/dicts/en.edn b/src/resources/dicts/en.edn index 02664c4638e2..2e080748f574 100644 --- a/src/resources/dicts/en.edn +++ b/src/resources/dicts/en.edn @@ -1268,7 +1268,6 @@ :property/drag-to-reorder "Drag && Drop to reorder" :property/existing-values "Existing values:" :property/go-to-this-property "Go to this property" - :property/hidden-properties "Hidden properties" :property/hide-by-default "Hide by default" :property/hide-choice-for-tag "Hide choice for this tag" :property/hide-empty-value "Hide empty value" diff --git a/src/resources/dicts/es.edn b/src/resources/dicts/es.edn index ee4eb5f936ea..80708134ce6f 100644 --- a/src/resources/dicts/es.edn +++ b/src/resources/dicts/es.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Arrastrar para reordenar" :property/existing-values "Valores existentes" :property/go-to-this-property "Ir a la página de propiedad" - :property/hidden-properties "Propiedades ocultas" :property/hide-by-default "Ocultar por defecto" :property/hide-choice-for-tag "Ocultar opción para etiqueta" :property/hide-empty-value "Ocultar valores vacíos" diff --git a/src/resources/dicts/fa.edn b/src/resources/dicts/fa.edn index be73542b933e..5ad2d4b1d14f 100644 --- a/src/resources/dicts/fa.edn +++ b/src/resources/dicts/fa.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "برای مرتب‌سازی بکشید" :property/existing-values "مقادیر موجود" :property/go-to-this-property "رفتن به صفحه ویژگی" - :property/hidden-properties "ویژگی‌های پنهان" :property/hide-by-default "مخفی به‌طور پیش‌فرض" :property/hide-choice-for-tag "مخفی کردن گزینه برای برچسب" :property/hide-empty-value "مخفی کردن مقادیر خالی" diff --git a/src/resources/dicts/fr.edn b/src/resources/dicts/fr.edn index 9319c7621ba5..d38e99d2fb04 100644 --- a/src/resources/dicts/fr.edn +++ b/src/resources/dicts/fr.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Glisser pour réordonner" :property/existing-values "Valeurs existantes" :property/go-to-this-property "Aller à la page de propriété" - :property/hidden-properties "Propriétés masquées" :property/hide-by-default "Masquer par défaut" :property/hide-choice-for-tag "Masquer le choix pour le tag" :property/hide-empty-value "Masquer les valeurs vides" diff --git a/src/resources/dicts/id.edn b/src/resources/dicts/id.edn index 123d78908d6b..c99f901291ef 100644 --- a/src/resources/dicts/id.edn +++ b/src/resources/dicts/id.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Seret untuk mengurutkan" :property/existing-values "Nilai yang ada" :property/go-to-this-property "Buka halaman properti" - :property/hidden-properties "Properti tersembunyi" :property/hide-by-default "Sembunyikan secara default" :property/hide-choice-for-tag "Sembunyikan pilihan untuk tag" :property/hide-empty-value "Sembunyikan nilai kosong" diff --git a/src/resources/dicts/it.edn b/src/resources/dicts/it.edn index c2f40a02524b..b68716aefb75 100644 --- a/src/resources/dicts/it.edn +++ b/src/resources/dicts/it.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Trascina per riordinare" :property/existing-values "Valori esistenti" :property/go-to-this-property "Vai alla pagina della proprietà" - :property/hidden-properties "Proprietà nascoste" :property/hide-by-default "Nascondi per impostazione predefinita" :property/hide-choice-for-tag "Nascondi opzione per tag" :property/hide-empty-value "Nascondi valori vuoti" diff --git a/src/resources/dicts/ja.edn b/src/resources/dicts/ja.edn index dc3298a141f0..4fc47082b6d2 100644 --- a/src/resources/dicts/ja.edn +++ b/src/resources/dicts/ja.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "ドラッグで並び替え" :property/existing-values "既存の値" :property/go-to-this-property "このプロパティのページへ" - :property/hidden-properties "非表示のプロパティ" :property/hide-by-default "デフォルトで非表示" :property/hide-choice-for-tag "タグの選択肢を非表示" :property/hide-empty-value "空の値を非表示" diff --git a/src/resources/dicts/ko.edn b/src/resources/dicts/ko.edn index 0b7fff880c19..726f016c18cb 100644 --- a/src/resources/dicts/ko.edn +++ b/src/resources/dicts/ko.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "드래그로 재정렬" :property/existing-values "기존 값" :property/go-to-this-property "이 속성의 페이지로" - :property/hidden-properties "숨겨진 속성" :property/hide-by-default "기본적으로 숨기기" :property/hide-choice-for-tag "태그의 선택지 숨기기" :property/hide-empty-value "빈 값 숨기기" diff --git a/src/resources/dicts/nb-no.edn b/src/resources/dicts/nb-no.edn index a4380bb92cec..b6e478454730 100644 --- a/src/resources/dicts/nb-no.edn +++ b/src/resources/dicts/nb-no.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Dra for å omorganisere" :property/existing-values "Eksisterende verdier" :property/go-to-this-property "Gå til egenskapsside" - :property/hidden-properties "Skjulte egenskaper" :property/hide-by-default "Skjul som standard" :property/hide-choice-for-tag "Skjul valg for tagg" :property/hide-empty-value "Skjul tomme verdier" diff --git a/src/resources/dicts/nl.edn b/src/resources/dicts/nl.edn index dd1273c56b0e..c16dbd8a3142 100644 --- a/src/resources/dicts/nl.edn +++ b/src/resources/dicts/nl.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Sleep om te herordenen" :property/existing-values "Bestaande waarden" :property/go-to-this-property "Ga naar eigenschapspagina" - :property/hidden-properties "Verborgen eigenschappen" :property/hide-by-default "Standaard verbergen" :property/hide-choice-for-tag "Keuze verbergen voor tag" :property/hide-empty-value "Lege waarden verbergen" diff --git a/src/resources/dicts/pl.edn b/src/resources/dicts/pl.edn index 070202a5f792..62c2da8b59c7 100644 --- a/src/resources/dicts/pl.edn +++ b/src/resources/dicts/pl.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Przeciągnij aby zmienić kolejność" :property/existing-values "Istniejące wartości" :property/go-to-this-property "Przejdź do strony właściwości" - :property/hidden-properties "Ukryte właściwości" :property/hide-by-default "Ukryj domyślnie" :property/hide-choice-for-tag "Ukryj opcję dla tagu" :property/hide-empty-value "Ukryj puste wartości" diff --git a/src/resources/dicts/pt-br.edn b/src/resources/dicts/pt-br.edn index b91080b6b14a..65017b20fc23 100644 --- a/src/resources/dicts/pt-br.edn +++ b/src/resources/dicts/pt-br.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Arraste para reordenar" :property/existing-values "Valores existentes" :property/go-to-this-property "Ir para a página da propriedade" - :property/hidden-properties "Propriedades ocultas" :property/hide-by-default "Ocultar por padrão" :property/hide-choice-for-tag "Ocultar opção para tag" :property/hide-empty-value "Ocultar valores vazios" diff --git a/src/resources/dicts/pt-pt.edn b/src/resources/dicts/pt-pt.edn index 12dc682d7ce0..dd20f8cd0382 100644 --- a/src/resources/dicts/pt-pt.edn +++ b/src/resources/dicts/pt-pt.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Arraste para reordenar" :property/existing-values "Valores existentes" :property/go-to-this-property "Ir para a página da propriedade" - :property/hidden-properties "Propriedades ocultas" :property/hide-by-default "Ocultar por padrão" :property/hide-choice-for-tag "Ocultar opção para tag" :property/hide-empty-value "Ocultar valores vazios" diff --git a/src/resources/dicts/ru.edn b/src/resources/dicts/ru.edn index 348fd9afc179..5a51ea2d4a9e 100644 --- a/src/resources/dicts/ru.edn +++ b/src/resources/dicts/ru.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Перетащите для изменения порядка" :property/existing-values "Существующие значения" :property/go-to-this-property "Перейти к странице свойства" - :property/hidden-properties "Скрытые свойства" :property/hide-by-default "Скрывать по умолчанию" :property/hide-choice-for-tag "Скрыть вариант для тега" :property/hide-empty-value "Скрыть пустые значения" diff --git a/src/resources/dicts/sk.edn b/src/resources/dicts/sk.edn index bad4a21e51d0..421d6f6a0f16 100644 --- a/src/resources/dicts/sk.edn +++ b/src/resources/dicts/sk.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Přetáhněte pro změnu pořadí" :property/existing-values "Existující hodnoty" :property/go-to-this-property "Prejsť na stránku vlastnosťi" - :property/hidden-properties "Skryté vlastnosti" :property/hide-by-default "Skryť ve predvoleným nastavenia" :property/hide-choice-for-tag "Skryť volbu pro štítok" :property/hide-empty-value "Skryť prázdné hodnoty" diff --git a/src/resources/dicts/tr.edn b/src/resources/dicts/tr.edn index b295d53dca67..49d3f81fc7c5 100644 --- a/src/resources/dicts/tr.edn +++ b/src/resources/dicts/tr.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Sıralamak için sürükleyin" :property/existing-values "Mevcut değerler" :property/go-to-this-property "Özellik sayfasına git" - :property/hidden-properties "Gizli özellikler" :property/hide-by-default "Varsayılan olarak gizle" :property/hide-choice-for-tag "Etiket için seçeneği gizle" :property/hide-empty-value "Boş değerleri gizle" diff --git a/src/resources/dicts/uk.edn b/src/resources/dicts/uk.edn index a3c93f6019b8..7f292ebac3dc 100644 --- a/src/resources/dicts/uk.edn +++ b/src/resources/dicts/uk.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "Перетащите для изменения порядка" :property/existing-values "Существующие значения" :property/go-to-this-property "Перейти к сторіноке властивості" - :property/hidden-properties "Приховані властивості" :property/hide-by-default "Скрывать по умолчанию" :property/hide-choice-for-tag "Сховати вариант для тега" :property/hide-empty-value "Сховати пустые значения" diff --git a/src/resources/dicts/zh-cn.edn b/src/resources/dicts/zh-cn.edn index 4697853c110c..86395346b680 100644 --- a/src/resources/dicts/zh-cn.edn +++ b/src/resources/dicts/zh-cn.edn @@ -1268,7 +1268,6 @@ :property/drag-to-reorder "拖拽以重新排序" :property/existing-values "已有值:" :property/go-to-this-property "跳转到此属性" - :property/hidden-properties "隐藏属性" :property/hide-by-default "默认隐藏" :property/hide-choice-for-tag "对此标签隐藏选项" :property/hide-empty-value "隐藏空值" diff --git a/src/resources/dicts/zh-hant.edn b/src/resources/dicts/zh-hant.edn index 7bd1689a994c..7ac5101bfc00 100644 --- a/src/resources/dicts/zh-hant.edn +++ b/src/resources/dicts/zh-hant.edn @@ -1264,7 +1264,6 @@ :property/drag-to-reorder "拖曳以重新排序" :property/existing-values "現有值:" :property/go-to-this-property "跳至此屬性" - :property/hidden-properties "隱藏的屬性" :property/hide-by-default "預設隱藏" :property/hide-choice-for-tag "對此標籤隱藏選項" :property/hide-empty-value "隱藏空值" From f7b80cb09dcfe1707733395d99c73ef8dc7bd4c8 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 30 Apr 2026 18:16:44 +0800 Subject: [PATCH 0019/1400] fix: e2e tests --- clj-e2e/src/logseq/e2e/util.clj | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/clj-e2e/src/logseq/e2e/util.clj b/clj-e2e/src/logseq/e2e/util.clj index 02643a7fce7b..bf16d77b888f 100644 --- a/clj-e2e/src/logseq/e2e/util.clj +++ b/clj-e2e/src/logseq/e2e/util.clj @@ -87,9 +87,11 @@ (if (w/visible? ".cp__cmdk-search-input") (w/fill ".cp__cmdk-search-input" text) (do - (double-esc) - (assert/assert-in-normal-mode?) - (w/click :#search-button) + (k/press "ControlOrMeta+k") + (when-not (w/visible? ".cp__cmdk-search-input") + (double-esc) + (assert/assert-in-normal-mode?) + (w/click :#search-button)) (w/wait-for ".cp__cmdk-search-input") (w/fill ".cp__cmdk-search-input" text)))) From 2e07fe1b8a1617a3137da422ae66dce0216e8eee Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 30 Apr 2026 21:40:54 +0800 Subject: [PATCH 0020/1400] fix: bottom property edit popup --- src/main/frontend/components/block.cljs | 14 ++++++-------- src/main/frontend/components/block.css | 2 +- src/main/frontend/components/property/value.cljs | 10 +++++++++- .../frontend/components/property/value_test.cljs | 13 +++++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index cad7c9fd0b48..acc7bca0f87d 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2616,8 +2616,9 @@ [^js pill] (when-let [trigger (some-> pill (.querySelector ".bottom-property-content .jtrigger"))] - (.click trigger) - (some-> trigger .focus) + (if (some-> pill (.querySelector ".bottom-property-content [data-popup-active]")) + (shui/popup-hide!) + (.click trigger)) true)) (defn- current-bottom-pill @@ -2722,12 +2723,9 @@ {:type "button" :on-click (fn [e] (util/stop e) - (when-let [trigger - (some-> (.-currentTarget e) - (.closest ".bottom-property-content") - (.querySelector ".jtrigger"))] - (.click trigger) - (some-> trigger .focus)))} + (some-> (.-currentTarget e) + (.closest ".bottom-property-pill") + trigger-bottom-pill-edit!))} (ui/icon "edit" {:size 15})])]])) (defn- block-below-positioned-properties-cp diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 3883002054e1..4dec0154084f 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1066,7 +1066,7 @@ html.is-mac { .bottom-properties-row:focus { outline: none; box-shadow: inset 0 0 0 1px var(--ls-link-text-color); - border-radius: 9999px; + border-radius: 6px; } .bottom-property-pill { diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index b82648be4bba..7c359c428c0d 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -463,6 +463,12 @@ (property-handler/remove-block-property! (:db/id block) (:db/ident property))) +(defn- prevent-bottom-property-edit-pointer-dismiss + [^js e] + (when (some-> (.-target e) (.closest ".bottom-property-edit-icon")) + (.preventDefault e) + false)) + (rum/defc date-picker [value {:keys [block property datetime? on-change on-delete del-btn? editing? multiple-values? other-position? suppress-inline-edit-icon? property-position]}] @@ -481,7 +487,9 @@ (editor-handler/save-current-block!) (when-not config/publishing? (shui/popup-show! (.-target e) content-fn - {:align "start" :auto-focus? true})))) + {:align "start" + :auto-focus? true + :content-props {:onPointerDownOutside prevent-bottom-property-edit-pointer-dismiss}})))) repeated-task? (:logseq.property.repeat/repeated? block)] (if editing? (content-fn {:id :date-picker}) diff --git a/src/test/frontend/components/property/value_test.cljs b/src/test/frontend/components/property/value_test.cljs index cfd3fa30a742..9e97ed13a35b 100644 --- a/src/test/frontend/components/property/value_test.cljs +++ b/src/test/frontend/components/property/value_test.cljs @@ -65,3 +65,16 @@ :block/uuid #uuid "11111111-1111-1111-1111-111111111111"}] (is (= (:logseq.property/default-value property) (#'property-value/resolved-property-value-for-render loaded-block property false))))) + +(deftest bottom-property-edit-pointer-dismiss-handler-test + (let [edit-button (js-obj "closest" (fn [selector] + (when (= selector ".bottom-property-edit-icon") + #js {}))) + other-target (js-obj "closest" (constantly nil)) + prevent-default-called? (atom false) + edit-event (js-obj "target" edit-button + "preventDefault" #(reset! prevent-default-called? true)) + other-event (js-obj "target" other-target)] + (is (false? (#'property-value/prevent-bottom-property-edit-pointer-dismiss edit-event))) + (is (true? @prevent-default-called?)) + (is (nil? (#'property-value/prevent-bottom-property-edit-pointer-dismiss other-event))))) From 3d96bf9fe3e2540f64c5f72a6ab5335da1efb89c Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 4 May 2026 09:10:14 +0800 Subject: [PATCH 0021/1400] fix(property): show route-root hidden toggle and gate date edit icon --- src/main/frontend/components/property.cljs | 25 +++++++++++++------ .../components/property/property_test.cljs | 14 +++++++++++ 2 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/main/frontend/components/property.cljs b/src/main/frontend/components/property.cljs index f3d478b53a46..af0bf507b5bb 100644 --- a/src/main/frontend/components/property.cljs +++ b/src/main/frontend/components/property.cljs @@ -510,6 +510,11 @@ (db/sub-block (:db/id linked-block)) (db/sub-block (:db/id block)))) +(defn- show-property-panel-edit-button? + [property opts] + (and (contains? #{:date :datetime} (:logseq.property/type property)) + (= :block-below (:property-position opts)))) + (defn- empty-panel-property-value? [value] (or (nil? value) @@ -556,7 +561,7 @@ (if (:class-schema? opts) (pv/property-value property (db/entity :logseq.property/description) opts) (pv/property-value block' property (assoc opts :suppress-inline-edit-icon? true)))] - (when (contains? #{:date :datetime} type) + (when (show-property-panel-edit-button? property opts) [:button.property-panel-edit-btn.select-none {:type "button" :on-click (fn [e] @@ -948,10 +953,12 @@ hidden-properties (-> (concat block-hidden-properties (filter property-hide-f class-property-pairs)) (remove-built-in-or-other-position-properties true)) - root-block? (or (= (str (:block/uuid block)) - (state/get-current-page)) - (and (= (str (:block/uuid block)) (:id opts)) - (not (entity-util/page? block))))] + current-route-page? (= (str (:block/uuid block)) (state/get-current-page)) + root-block? (and (= (str (:block/uuid block)) (:id opts)) + (not (entity-util/page? block))) + show-hidden-properties-toggle-button? (and (seq hidden-properties) + (or current-route-page? + root-block?))] [:<> (load-bidirectional-properties block root-block? #(reset! *bidirectional-properties %)) (let [has-bidirectional-properties? (seq bidirectional-properties)] @@ -1007,8 +1014,12 @@ nil) (when-not class? - (hidden-properties-cp block hidden-properties - (assoc opts :show-hidden-properties? show-hidden-properties?))) + [:<> + (when show-hidden-properties-toggle-button? + [:div.mb-1 + (hidden-properties-toggle-button block {})]) + (hidden-properties-cp block hidden-properties + (assoc opts :show-hidden-properties? show-hidden-properties?))]) (when (and show-properties-panel? (not replace-renderer)) [:div.properties-panel.gap-8 diff --git a/src/test/frontend/components/property/property_test.cljs b/src/test/frontend/components/property/property_test.cljs index f41e64de6c01..34fae9f5c894 100644 --- a/src/test/frontend/components/property/property_test.cljs +++ b/src/test/frontend/components/property/property_test.cljs @@ -41,3 +41,17 @@ (is (true? (property-component/hidden-properties-visible? block-uuid))) (property-component/toggle-hidden-properties-visibility! block-uuid) (is (false? (property-component/hidden-properties-visible? block-uuid))))) + +(deftest show-property-panel-edit-button-test + (is (false? (#'property-component/show-property-panel-edit-button? + {:logseq.property/type :date} + {})) + "Date edit button should be hidden outside bottom properties") + (is (false? (#'property-component/show-property-panel-edit-button? + {:logseq.property/type :datetime} + {})) + "Datetime edit button should be hidden outside bottom properties") + (is (true? (#'property-component/show-property-panel-edit-button? + {:logseq.property/type :datetime} + {:property-position :block-below})) + "Datetime edit button should be shown for bottom properties")) From 67b73507a9b6b02d2aa46f867203cd7b84b0fbb7 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 5 May 2026 12:57:11 +0800 Subject: [PATCH 0022/1400] style tweaks --- src/main/frontend/components/block.cljs | 2 +- src/main/frontend/components/property.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index c07cc056d5d4..b80f42acf861 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -3986,7 +3986,7 @@ (and (not collapsed?) (not (or table? property?))))) - [:div (when-not (:page-title? config) {:style {:padding-left (if (util/mobile?) 12 45)}}) + [:div (when-not (:page-title? config) {:style {:padding-left (if (util/mobile?) 12 42)}}) (db-properties-cp config block {:in-block-container? true})]) (when (and show-query? (not (:table? config))) diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index addfd72fcbe8..8ba872326639 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -71,7 +71,7 @@ } .property-pair.property-panel-row { - @apply grid items-start px-3 gap-3 w-full; + @apply grid items-start pr-3 gap-3 w-full; grid-template-columns: fit-content(260px) minmax(0, 1fr); margin-left: 0; } From 09f1d2c57dfe10099fd26e1d8f38ea30357510a5 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 11 May 2026 19:15:41 +0800 Subject: [PATCH 0023/1400] fix: show page column in reference tables Fixes https://github.com/logseq/db-test/issues/786 Fixes https://github.com/logseq/db-test/issues/765 --- src/main/frontend/components/objects.cljs | 45 +++++++----- src/main/frontend/components/reference.cljs | 4 +- src/main/frontend/components/views.cljs | 69 ++++++++++++------- .../frontend/components/objects_test.cljs | 13 ++++ src/test/frontend/components/views_test.cljs | 10 ++- 5 files changed, 94 insertions(+), 47 deletions(-) create mode 100644 src/test/frontend/components/objects_test.cljs diff --git a/src/main/frontend/components/objects.cljs b/src/main/frontend/components/objects.cljs index 723bc794f7bd..228f89553a0d 100644 --- a/src/main/frontend/components/objects.cljs +++ b/src/main/frontend/components/objects.cljs @@ -39,6 +39,31 @@ (asset-cp (assoc config :disable-resize? true) row)])) :disable-hide? true}) +(defn build-class-object-columns + [config class properties] + (let [properties' (remove nil? properties) + columns* (views/build-columns config properties' {:add-tags-column? true + :add-page-column? true}) + columns (cond + (= (:db/ident class) :logseq.class/Pdf-annotation) + (remove #(contains? #{:logseq.property/ls-type} (:id %)) columns*) + (= (:db/ident class) :logseq.class/Asset) + (remove #(contains? #{:logseq.property.asset/checksum} (:id %)) columns*) + :else + columns*)] + (if (= (:db/ident class) :logseq.class/Asset) + ;; Insert in front of tag's properties + (let [[before-cols after-cols] (split-with #(not (db-property/logseq-property? (:id %))) columns)] + (concat before-cols [(build-asset-file-column config)] after-cols)) + columns))) + +(defn build-property-object-columns + [config property properties] + (let [tags? (= :block/tags (:db/ident property))] + (views/build-columns config properties + (cond-> {:add-page-column? true} + tags? (assoc :add-tags-column? false))))) + (comment (defn- edit-new-object [ref id] @@ -62,23 +87,9 @@ (rum/defc class-objects-inner < rum/static [config class properties] (let [*ref (hooks/use-ref nil) - ;; Properties can be nil for published private graphs - properties' (remove nil? properties) - columns* (views/build-columns config properties' {:add-tags-column? true}) - columns (cond - (= (:db/ident class) :logseq.class/Pdf-annotation) - (remove #(contains? #{:logseq.property/ls-type} (:id %)) columns*) - (= (:db/ident class) :logseq.class/Asset) - (remove #(contains? #{:logseq.property.asset/checksum} (:id %)) columns*) - :else - columns*) db-ident (:db/ident class) asset? (= db-ident :logseq.class/Asset) - columns (if asset? - ;; Insert in front of tag's properties - (let [[before-cols after-cols] (split-with #(not (db-property/logseq-property? (:id %))) columns)] - (concat before-cols [(build-asset-file-column config)] after-cols)) - columns) + columns (build-class-object-columns config class properties) add-new-object! (when (or asset? (not (ldb/private-tags (:db/ident class)))) (fn [view table {:keys [properties]}] (if (= :logseq.class/Asset (:db/ident class)) @@ -135,9 +146,7 @@ (rum/defc property-related-objects-inner < rum/static [config property properties] - (let [tags? (= :block/tags (:db/ident property)) - columns (views/build-columns config properties - (when tags? {:add-tags-column? false}))] + (let [columns (build-property-object-columns config property properties)] (views/view {:config config :view-parent property :view-feature-type :property-objects diff --git a/src/main/frontend/components/reference.cljs b/src/main/frontend/components/reference.cljs index 04a370027063..c952ca882857 100644 --- a/src/main/frontend/components/reference.cljs +++ b/src/main/frontend/components/reference.cljs @@ -48,7 +48,7 @@ :view-feature-type :linked-references :show-items-count? true :additional-actions [reference-filter] - :columns (views/build-columns config [] {}) + :columns (views/build-columns config [] {:add-page-column? true}) :config config :foldable-options (when (and (:linked-refs-section? config) (zero? open-blocks-level)) @@ -93,6 +93,6 @@ (views/view {:view-parent entity :view-feature-type :unlinked-references - :columns (views/build-columns config [] {}) + :columns (views/build-columns config [] {:add-page-column? true}) :foldable-options {:default-collapsed? true} :config config})]))))) diff --git a/src/main/frontend/components/views.cljs b/src/main/frontend/components/views.cljs index 1be22cdf9719..82d0aae1872d 100644 --- a/src/main/frontend/components/views.cljs +++ b/src/main/frontend/components/views.cljs @@ -147,6 +147,7 @@ (defn header-cp [{:keys [view-entity column-set-sorting! state]} column] (let [sorting (:sorting state) + sortable? (not (false? (:sortable? column))) [asc?] (some (fn [item] (when (= (:id item) (:id column)) (when-some [asc? (:asc? item)] [asc?]))) sorting) @@ -155,18 +156,20 @@ (contains? (set (map :db/id (:logseq.property.table/pinned-columns view-entity))) (:db/id property))) sub-content (fn [{:keys [id]}] - (let [table-options [(shui/dropdown-menu-item - {:key "asc" - :on-click #(column-set-sorting! sorting column true)} - [:div.flex.flex-row.items-center.gap-1 - (ui/icon "arrow-up" {:size 15}) - [:div (t :view.table/sort-ascending)]]) - (shui/dropdown-menu-item - {:key "desc" - :on-click #(column-set-sorting! sorting column false)} - [:div.flex.flex-row.items-center.gap-1 - (ui/icon "arrow-down" {:size 15}) - [:div (t :view.table/sort-descending)]]) + (let [table-options [(when sortable? + (shui/dropdown-menu-item + {:key "asc" + :on-click #(column-set-sorting! sorting column true)} + [:div.flex.flex-row.items-center.gap-1 + (ui/icon "arrow-up" {:size 15}) + [:div (t :view.table/sort-ascending)]])) + (when sortable? + (shui/dropdown-menu-item + {:key "desc" + :on-click #(column-set-sorting! sorting column false)} + [:div.flex.flex-row.items-center.gap-1 + (ui/icon "arrow-down" {:size 15}) + [:div (t :view.table/sort-descending)]])) (when property (shui/dropdown-menu-item {:on-click (fn [_e] @@ -360,8 +363,20 @@ (add-to-sidebar!))} (ui/icon "layout-sidebar-right"))]]))])) +(defn- page-column + [] + {:id :block/page + :name (t :view.table/page) + :type :node + :sortable? false + :header header-cp + :cell (fn [_table row _column] + (when-let [page (:block/page row)] + (when-let [page-cp (state/get-component :block/page-cp)] + (page-cp {:disable-preview? true} page))))}) + (defn build-columns - [config properties & {:keys [with-object-name? with-id? add-tags-column? advanced-query?] + [config properties & {:keys [with-object-name? with-id? add-tags-column? add-page-column? advanced-query?] :or {with-object-name? true with-id? true add-tags-column? true}}] @@ -447,7 +462,9 @@ :name (t :page/updated-at) :type :datetime :header header-cp - :cell timestamp-cell-cp})]) + :cell timestamp-cell-cp}) + (when add-page-column? + (page-column))]) (remove nil?)))) (defn sort-columns @@ -519,18 +536,18 @@ [view-entity columns {:keys [column-visible? rows column-toggle-visibility]} {:keys [group-by-property-ident]}] (let [display-type (:db/ident (:logseq.property.view/type view-entity)) table? (= display-type :logseq.property.view/type.table) - group-by-columns (concat (when (or - (contains? #{:linked-references :unlinked-references} - (:logseq.property.view/feature-type view-entity)) - (:logseq.property/query view-entity)) - [{:id :block/page - :name (t :view.table/page)}]) - (filter (fn [column] - (when (:id column) - (when-let [p (db/entity (:id column))] - (and (not (db-property/many? p)) - (contains? #{:default :number :checkbox :url :node :date} - (:logseq.property/type p)))))) columns)) + group-by-columns (->> (concat (when (or + (contains? #{:linked-references :unlinked-references} + (:logseq.property.view/feature-type view-entity)) + (:logseq.property/query view-entity)) + [(page-column)]) + (filter (fn [column] + (when (:id column) + (when-let [p (db/entity (:id column))] + (and (not (db-property/many? p)) + (contains? #{:default :number :checkbox :url :node :date} + (:logseq.property/type p)))))) columns)) + (medley/distinct-by :id)) group-by-page? (some #{:block/page} (map :id group-by-columns))] (shui/dropdown-menu (shui/dropdown-menu-trigger diff --git a/src/test/frontend/components/objects_test.cljs b/src/test/frontend/components/objects_test.cljs new file mode 100644 index 000000000000..fc440c0ee8a6 --- /dev/null +++ b/src/test/frontend/components/objects_test.cljs @@ -0,0 +1,13 @@ +(ns frontend.components.objects-test + (:require [cljs.test :refer [deftest is]] + [frontend.components.objects :as objects])) + +(deftest class-object-columns-include-page + (let [columns (objects/build-class-object-columns {} {:db/ident :user.class/task} [])] + (is (some #(= :block/page (:id %)) columns)) + (is (false? (:sortable? (some #(when (= :block/page (:id %)) %) columns)))))) + +(deftest property-object-columns-include-page + (let [columns (objects/build-property-object-columns {} {:db/ident :user.property/status} [])] + (is (some #(= :block/page (:id %)) columns)) + (is (false? (:sortable? (some #(when (= :block/page (:id %)) %) columns)))))) diff --git a/src/test/frontend/components/views_test.cljs b/src/test/frontend/components/views_test.cljs index db023f939970..9e06bad16aa5 100644 --- a/src/test/frontend/components/views_test.cljs +++ b/src/test/frontend/components/views_test.cljs @@ -8,10 +8,18 @@ :block/title "Name" :logseq.property/type :default}] columns (views/build-columns {} mock-properties {:with-object-name? false - :add-tags-column? false})] + :add-tags-column? false})] ;; Without built-in title column, user 'Name' property should exist (is (some #(= :user.property/name-abc (:id %)) columns)))) +(deftest build-columns-should-include-page-column-when-requested + (let [columns (views/build-columns {} [] {:add-tags-column? false + :add-page-column? true})] + (is (some #(= :block/page (:id %)) columns)) + (is (false? (:sortable? (some #(when (= :block/page (:id %)) %) columns)))) + (is (not (some #(= :block/page (:id %)) + (views/build-columns {} [] {:add-tags-column? false})))))) + (deftest sort-columns-should-deduplicate-ordered-ids "Reproduces db-test#837 amplification: When ordered-column-ids contains duplicates (e.g., from corrupted drag-and-drop state), sort-columns From 292f5d3925d28702100ccde3db01d6d682d71ac6 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 25 May 2026 23:15:51 +0800 Subject: [PATCH 0024/1400] fix: keep asset properties in normal area --- deps/outliner/src/logseq/outliner/property.cljs | 2 +- src/test/logseq/outliner/property_position_test.cljs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 src/test/logseq/outliner/property_position_test.cljs diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index 09ac82d9262c..f1d27972900d 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -921,7 +921,7 @@ property-type (:logseq.property/type property) node-many? (and (= :node property-type) (= :db.cardinality/many (:db/cardinality property))) - default-bottom? (and (not= :url property-type) + default-bottom? (and (not (contains? #{:url :asset} property-type)) (or node-many? (not= :default property-type) (seq (:property/closed-values property))) diff --git a/src/test/logseq/outliner/property_position_test.cljs b/src/test/logseq/outliner/property_position_test.cljs new file mode 100644 index 000000000000..cb980f91937e --- /dev/null +++ b/src/test/logseq/outliner/property_position_test.cljs @@ -0,0 +1,11 @@ +(ns logseq.outliner.property-position-test + (:require [cljs.test :refer [deftest is]] + [logseq.outliner.property :as outliner-property])) + +(deftest asset-property-uses-normal-property-position-by-default + (is (false? + (outliner-property/property-with-other-position? + nil + {} + {:db/ident :user.property/attachment + :logseq.property/type :asset})))) From a3b8ec418cfe55155677c030eacc0f573decffe3 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 26 May 2026 00:13:42 +0800 Subject: [PATCH 0025/1400] fix: improve property value navigation --- src/main/frontend/components/property.css | 1 + .../frontend/components/property/value.cljs | 53 +++++++- src/main/frontend/handler/editor.cljs | 120 ++++++++++++++---- 3 files changed, 144 insertions(+), 30 deletions(-) diff --git a/src/main/frontend/components/property.css b/src/main/frontend/components/property.css index 8ba872326639..32d5f757a5c5 100644 --- a/src/main/frontend/components/property.css +++ b/src/main/frontend/components/property.css @@ -115,6 +115,7 @@ .property-panel-bullet { @apply inline-flex items-center opacity-60; margin-left: 2px; + min-height: 24px; } .property-panel-bullet .bullet-container { diff --git a/src/main/frontend/components/property/value.cljs b/src/main/frontend/components/property/value.cljs index 6618e9bae99e..9cef1f574b51 100644 --- a/src/main/frontend/components/property/value.cljs +++ b/src/main/frontend/components/property/value.cljs @@ -50,6 +50,46 @@ (when-not (string/starts-with? (get block (:db/ident property)) "zotero://") (state/pub-event! [:asset/dialog-edit-external-url block])))}) +(def ^:private editor-navigation-trigger-class "jtrigger") + +(defn- property-value-block-container-class + [] + (str "property-block-container content w-full " editor-navigation-trigger-class)) + +(defn- editing-navigation? + [e] + (= "edit" (some-> (.-currentTarget e) (.getAttribute "data-property-nav-mode")))) + +(defn- move-property-value-boundary! + [e direction] + (util/stop e) + (if (editing-navigation? e) + (editor-handler/move-cross-boundary-up-down direction {:input nil}) + (editor-handler/move-property-focus-up-down direction))) + +(defn- property-value-block-container-props + [property] + {:class (property-value-block-container-class) + :tabIndex 0 + :on-key-down (fn [e] + (when (= (.-currentTarget e) js/document.activeElement) + (case (util/ekey e) + "ArrowUp" + (move-property-value-boundary! e :up) + + "ArrowDown" + (move-property-value-boundary! e :down) + + nil))) + :style (if (= (:db/ident property) :logseq.property/default-value) + {:min-width 300} + {})}) + +(defn- show-inline-asset-picker? + [editing? value] + (and editing? + (not (and value (:db/id value))))) + (defn- entity-map? [m] (and (map? m) (:db/id m))) @@ -1130,10 +1170,7 @@ :property-ident (:db/ident property)}) (cond (seq value-block) - [:div.property-block-container.content.w-full - {:style (if (= (:db/ident property) :logseq.property/default-value) - {:min-width 300} - {})} + [:div (property-value-block-container-props property) (let [config {:id (str (if multiple-values? (:block/uuid block) (:block/uuid value-block))) @@ -1836,7 +1873,7 @@ asset-embedded-control-selector))) (util/stop e) (show-grid! (or (.-currentTarget e) (rum/deref *el)))))] - (if editing? + (if (show-inline-asset-picker? editing? value) [:div.property-select.w-full (asset-grid-popup-content block property opts)] (shui/trigger-as @@ -1848,6 +1885,12 @@ :on-click show-grid-from-click! :on-key-down (fn [e] (case (util/ekey e) + "ArrowUp" + (move-property-value-boundary! e :up) + + "ArrowDown" + (move-property-value-boundary! e :down) + ("Backspace" "Delete") (when-not config/publishing? (delete-block-property! block property)) diff --git a/src/main/frontend/handler/editor.cljs b/src/main/frontend/handler/editor.cljs index d0fc4477c62c..803c316bb4b5 100644 --- a/src/main/frontend/handler/editor.cljs +++ b/src/main/frontend/handler/editor.cljs @@ -2285,6 +2285,8 @@ (util/scroll-to-block block) (state/exit-editing-and-set-selected-blocks! [block])))) +(declare property-value-node? property-value-inner-block focus-trigger) + (defn- select-up-down [direction] (let [selected-blocks (state/get-selection-blocks) selected (case direction @@ -2296,17 +2298,39 @@ sibling-block (navigable-sibling-block selected f {:up-down? true - :direction direction - :exclude-property? true})] - (when (and sibling-block - (or (dom/attr sibling-block "blockid") (dom/attr sibling-block "parentblockid"))) - (util/scroll-to-block sibling-block) - (state/exit-editing-and-set-selected-blocks! [sibling-block])))) + :direction direction}) + property-value-container (when (property-value-node? sibling-block) + sibling-block) + sibling-block (or (property-value-inner-block property-value-container) + sibling-block)] + (cond + property-value-container + (do + (state/clear-selection!) + (util/scroll-to-block property-value-container) + (focus-trigger selected property-value-container {:edit-navigation? false})) + + (and sibling-block + (or (dom/attr sibling-block "blockid") (dom/attr sibling-block "parentblockid"))) + (do + (util/scroll-to-block sibling-block) + (state/exit-editing-and-set-selected-blocks! [sibling-block]))))) (defn- property-value-node? [node] (some-> node (dom/has-class? "property-value-container"))) +(defn- property-value-inner-block + [node] + (when (property-value-node? node) + (some-> node (.querySelector ".ls-block[blockid]")))) + +(defn- property-value-container-node + [node] + (or (when (property-value-node? node) + node) + (some-> node (.closest ".property-value-container")))) + (defn- bottom-properties-row-node [node] (some-> node (.closest ".bottom-properties-row"))) @@ -2444,20 +2468,62 @@ (state/exit-editing-and-set-selected-blocks! [comments-node]))))) (defn- focus-trigger - [_current-block sibling-block] - (if-let [trigger (first (dom/by-class sibling-block "jtrigger"))] - (do - (state/clear-edit!) - (if (or (dom/has-class? trigger "ls-number") - (dom/has-class? trigger "ls-empty-text-property")) - (.click trigger) - (.focus trigger))) - (when-let [row (bottom-properties-row-node sibling-block)] - (.focus row)))) + ([current-block sibling-block] + (focus-trigger current-block sibling-block {:edit-navigation? true})) + ([_current-block sibling-block {:keys [edit-navigation?]}] + (if-let [trigger (first (dom/by-class sibling-block "jtrigger"))] + (do + (.setAttribute trigger "data-property-nav-mode" (if edit-navigation? "edit" "focus")) + (state/clear-edit!) + (if (or (dom/has-class? trigger "ls-number") + (dom/has-class? trigger "ls-empty-text-property")) + (.click trigger) + (.focus trigger))) + (when-let [row (bottom-properties-row-node sibling-block)] + (.focus row))))) + +(defn move-property-focus-up-down + [direction] + (let [active-element js/document.activeElement + f (case direction + :up util/get-prev-block-non-collapsed + :down util/get-next-block-non-collapsed) + current-block (util/rec-get-node active-element "ls-block") + sibling-block (navigable-sibling-block current-block + f + {:up-down? true + :direction direction}) + property-value-container (property-value-container-node sibling-block) + sibling-block (or (property-value-inner-block property-value-container) + sibling-block) + bottom-properties-row (bottom-properties-row-node sibling-block)] + (cond + property-value-container + (do + (state/clear-selection!) + (util/scroll-to-block property-value-container) + (focus-trigger current-block property-value-container {:edit-navigation? false})) + + bottom-properties-row + (do + (state/clear-edit!) + (.focus bottom-properties-row)) + + (comments-area-node? sibling-block) + (enter-comments-area-node! sibling-block) + + :else + (when-let [sibling-block-id (node-attr sibling-block "blockid")] + (let [container-id (some-> (node-attr sibling-block "containerid") js/parseInt) + block (db/entity [:block/uuid (cljs.core/uuid sibling-block-id)])] + (edit-block! block 0 {:container-id container-id + :direction direction})))))) (defn move-cross-boundary-up-down [direction move-opts] - (let [input (or (:input move-opts) (state/get-input)) + (let [input (if (contains? move-opts :input) + (:input move-opts) + (state/get-input)) active-element js/document.activeElement input-or-active-element (or input active-element)] (when input-or-active-element @@ -2473,13 +2539,15 @@ (:exclude-property? move-opts) (assoc :exclude-property? true))) {:block/keys [uuid title]} (state/get-edit-block) - sibling-block (or (when (property-value-node? sibling-block) - (util/rec-get-node sibling-block "ls-block")) + property-value-container (when (property-value-node? sibling-block) + sibling-block) + sibling-block (or (property-value-inner-block property-value-container) sibling-block) current-bottom-properties-row (bottom-properties-row-in-block current-block) bottom-properties-row (bottom-properties-row-node sibling-block) sibling-bottom-properties-row (bottom-properties-row-in-block sibling-block) - property-value-container? (property-value-node? sibling-block)] + property-value-container? (and property-value-container + (nil? (property-value-inner-block property-value-container)))] (if sibling-block (let [value (state/get-edit-content)] (p/do! @@ -2514,7 +2582,7 @@ (.focus bottom-properties-row)) property-value-container? - (focus-trigger current-block sibling-block) + (focus-trigger current-block sibling-block {:edit-navigation? true}) (comments-area-node? sibling-block) (enter-comments-area-node! sibling-block) @@ -2572,10 +2640,12 @@ editing-block (state/get-editor-block-container) f (if up? util/get-prev-block-non-collapsed util/get-next-block-non-collapsed) sibling-block (navigable-sibling-block editing-block f {:direction direction}) - sibling-block (or (when (and sibling-block (property-value-node? sibling-block)) - (if (and up? editing-block (gdom/contains sibling-block editing-block)) - (navigable-sibling-block sibling-block f {:direction direction}) - (util/rec-get-node sibling-block "ls-block"))) + property-value-container (when (and sibling-block (property-value-node? sibling-block)) + sibling-block) + sibling-block (or (when (and up? editing-block property-value-container + (gdom/contains property-value-container editing-block)) + (navigable-sibling-block property-value-container f {:direction direction})) + (property-value-inner-block property-value-container) sibling-block)] (when sibling-block (let [content (:block/title block) From 64d9bb23da1947267c2dc2b9f83be7c10f2449c9 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Tue, 26 May 2026 08:25:59 +0800 Subject: [PATCH 0026/1400] fix: limit bottom property pills per line --- src/main/frontend/components/block.cljs | 19 +++++++++++++++++-- src/main/frontend/components/block.css | 8 ++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index c0f6ff51fab3..30c545646cb4 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2956,6 +2956,22 @@ trigger-bottom-pill-edit!))} (ui/icon "edit" {:size 15})])]])) +(def ^:private max-bottom-property-pills-per-line 3) + +(defn- bottom-property-pill-items + [block properties opts] + (let [last-index (dec (count properties))] + (mapcat + (fn [index property] + (cond-> [(bottom-property-pill-cp block property opts)] + (and (< index last-index) + (zero? (mod (inc index) max-bottom-property-pills-per-line))) + (conj [:div.bottom-property-pill-line-break + {:key (str "bottom-property-pill-line-break-" (:db/id block) "-" index) + :aria-hidden true}]))) + (cljs.core/range) + properties))) + (defn- block-below-positioned-properties-cp [block properties opts show-hidden-properties-toggle? show-add-property-button?] [:div.positioned-properties.block-below.flex.flex-col.gap-1.text-sm.overflow-x-hidden @@ -2963,8 +2979,7 @@ {:data-bottom-properties-row (:block/uuid block) :tab-index -1 :on-key-down handle-bottom-properties-row-key-down!} - (for [property properties] - (bottom-property-pill-cp block property opts)) + (bottom-property-pill-items block properties opts) (when show-hidden-properties-toggle? (property-component/hidden-properties-toggle-button block {:icon-only? true :bottom-row-nav? true diff --git a/src/main/frontend/components/block.css b/src/main/frontend/components/block.css index 8b078f57943e..257d3e9c49af 100644 --- a/src/main/frontend/components/block.css +++ b/src/main/frontend/components/block.css @@ -1573,6 +1573,14 @@ html.is-mac { padding-bottom: 0; } + .bottom-property-pill-line-break { + flex-basis: 100%; + width: 0; + height: 0; + padding: 0; + margin: 0; + } + .bottom-property-pill-focusable:focus { outline: none; box-shadow: none; From 05961293df68f73ef423504c80f1b55fd7d05b09 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Wed, 27 May 2026 15:55:06 +0800 Subject: [PATCH 0027/1400] fix: prevent block selection after released click --- src/main/frontend/components/block.cljs | 3 +++ .../frontend/components/block/selection.cljs | 16 ++++++++++++++++ src/main/frontend/components/container.cljs | 4 ++++ .../components/block/selection_test.cljs | 11 +++++++++++ 4 files changed, 34 insertions(+) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 1c3fed2e071a..7fd6e43166da 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2604,6 +2604,8 @@ util/caret-range) mobile-range (when mobile? (get-cursor-range))] (when (and (not forbidden-edit?) (contains? #{1 0} button)) + (when (= 1 button) + (block-selection/set-pointer-down-block! block-dom-element)) (cond (and meta? shift?) (when-not (empty? selection-blocks) @@ -3673,6 +3675,7 @@ (defn- select-block-under-pointer! [selection-block-ids scroll-direction] (when (and (seq selection-block-ids) + (block-selection/pointer-down?) (or (state/get-selection-start-block) (seq (state/get-selection-blocks)))) (when-let [block-dom-node (or (visible-selection-boundary-block selection-block-ids scroll-direction) diff --git a/src/main/frontend/components/block/selection.cljs b/src/main/frontend/components/block/selection.cljs index 1467eda63c7f..0907bafaa258 100644 --- a/src/main/frontend/components/block/selection.cljs +++ b/src/main/frontend/components/block/selection.cljs @@ -1,5 +1,21 @@ (ns frontend.components.block.selection) +(defonce *pointer-down? (atom false)) + +(defn set-pointer-down-block! + [_block] + (reset! *pointer-down? true)) + +(defn clear-pointer-down-block! + ([] + (reset! *pointer-down? false)) + ([_] + (clear-pointer-down-block!))) + +(defn pointer-down? + [] + (true? @*pointer-down?)) + (defn select-on-hover? [{:keys [last-client-y client-y dragging? editing-same-block? active-selection?]}] (and (or (not= last-client-y client-y) diff --git a/src/main/frontend/components/container.cljs b/src/main/frontend/components/container.cljs index ee6d3cbf54e7..01b232487fc5 100644 --- a/src/main/frontend/components/container.cljs +++ b/src/main/frontend/components/container.cljs @@ -2,6 +2,7 @@ (:require [cljs-drag-n-drop.core :as dnd] [clojure.string :as string] [dommy.core :as d] + [frontend.components.block.selection :as block-selection] [frontend.components.content :as cp-content] [frontend.components.find-in-page :as find-in-page] [frontend.components.handbooks :as handbooks] @@ -382,6 +383,9 @@ (mixins/event-mixin (fn [state] (mixins/listen state js/window "pointerdown" hide-context-menu-and-clear-selection) + (mixins/listen state js/window "pointerup" block-selection/clear-pointer-down-block!) + (mixins/listen state js/window "pointercancel" block-selection/clear-pointer-down-block!) + (mixins/listen state js/window "blur" block-selection/clear-pointer-down-block!) (mixins/listen state js/window "keydown" (fn [e] (cond diff --git a/src/test/frontend/components/block/selection_test.cljs b/src/test/frontend/components/block/selection_test.cljs index cb3da56fb05c..ea4876778dca 100644 --- a/src/test/frontend/components/block/selection_test.cljs +++ b/src/test/frontend/components/block/selection_test.cljs @@ -2,6 +2,17 @@ (:require [cljs.test :refer [are deftest is]] [frontend.components.block.selection :as selection])) +(deftest pointer-down-state-lifecycle + (selection/clear-pointer-down-block!) + (is (false? (selection/pointer-down?))) + (selection/set-pointer-down-block! :block) + (is (true? (selection/pointer-down?))) + (selection/clear-pointer-down-block!) + (is (false? (selection/pointer-down?))) + (selection/set-pointer-down-block! :block) + (selection/clear-pointer-down-block! #js {:type "pointerup"}) + (is (false? (selection/pointer-down?)))) + (deftest select-on-hover-keeps-active-selection-while-scroll-moves-block-under-pointer (is (true? (selection/select-on-hover? From d921807274ef761ca7e6ec755d97ffbaf84ee2ce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 27 May 2026 08:09:17 +0000 Subject: [PATCH 0028/1400] refactor: rename pointer-down state APIs --- src/main/frontend/components/block.cljs | 2 +- .../frontend/components/block/selection.cljs | 16 ++++++++-------- src/main/frontend/components/container.cljs | 6 +++--- .../components/block/selection_test.cljs | 10 +++++----- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 7fd6e43166da..473abe5699d3 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -2605,7 +2605,7 @@ mobile-range (when mobile? (get-cursor-range))] (when (and (not forbidden-edit?) (contains? #{1 0} button)) (when (= 1 button) - (block-selection/set-pointer-down-block! block-dom-element)) + (block-selection/set-pointer-down!)) (cond (and meta? shift?) (when-not (empty? selection-blocks) diff --git a/src/main/frontend/components/block/selection.cljs b/src/main/frontend/components/block/selection.cljs index 0907bafaa258..bf8e7377a8ca 100644 --- a/src/main/frontend/components/block/selection.cljs +++ b/src/main/frontend/components/block/selection.cljs @@ -1,20 +1,20 @@ (ns frontend.components.block.selection) -(defonce *pointer-down? (atom false)) +(defonce *pointer-is-down? (atom false)) -(defn set-pointer-down-block! - [_block] - (reset! *pointer-down? true)) +(defn set-pointer-down! + [] + (reset! *pointer-is-down? true)) -(defn clear-pointer-down-block! +(defn clear-pointer-down! ([] - (reset! *pointer-down? false)) + (reset! *pointer-is-down? false)) ([_] - (clear-pointer-down-block!))) + (clear-pointer-down!))) (defn pointer-down? [] - (true? @*pointer-down?)) + (true? @*pointer-is-down?)) (defn select-on-hover? [{:keys [last-client-y client-y dragging? editing-same-block? active-selection?]}] diff --git a/src/main/frontend/components/container.cljs b/src/main/frontend/components/container.cljs index 01b232487fc5..95825fe7fffa 100644 --- a/src/main/frontend/components/container.cljs +++ b/src/main/frontend/components/container.cljs @@ -383,9 +383,9 @@ (mixins/event-mixin (fn [state] (mixins/listen state js/window "pointerdown" hide-context-menu-and-clear-selection) - (mixins/listen state js/window "pointerup" block-selection/clear-pointer-down-block!) - (mixins/listen state js/window "pointercancel" block-selection/clear-pointer-down-block!) - (mixins/listen state js/window "blur" block-selection/clear-pointer-down-block!) + (mixins/listen state js/window "pointerup" block-selection/clear-pointer-down!) + (mixins/listen state js/window "pointercancel" block-selection/clear-pointer-down!) + (mixins/listen state js/window "blur" block-selection/clear-pointer-down!) (mixins/listen state js/window "keydown" (fn [e] (cond diff --git a/src/test/frontend/components/block/selection_test.cljs b/src/test/frontend/components/block/selection_test.cljs index ea4876778dca..25e2ce04fd49 100644 --- a/src/test/frontend/components/block/selection_test.cljs +++ b/src/test/frontend/components/block/selection_test.cljs @@ -3,14 +3,14 @@ [frontend.components.block.selection :as selection])) (deftest pointer-down-state-lifecycle - (selection/clear-pointer-down-block!) + (selection/clear-pointer-down!) (is (false? (selection/pointer-down?))) - (selection/set-pointer-down-block! :block) + (selection/set-pointer-down!) (is (true? (selection/pointer-down?))) - (selection/clear-pointer-down-block!) + (selection/clear-pointer-down!) (is (false? (selection/pointer-down?))) - (selection/set-pointer-down-block! :block) - (selection/clear-pointer-down-block! #js {:type "pointerup"}) + (selection/set-pointer-down!) + (selection/clear-pointer-down! #js {:type "pointerup"}) (is (false? (selection/pointer-down?)))) (deftest select-on-hover-keeps-active-selection-while-scroll-moves-block-under-pointer From fd1906a0c84135f30c34ae84a20876cc46057dbe Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 11:58:42 +0800 Subject: [PATCH 0029/1400] feat: semantic search with zvec (#12710) * enhance(search): add zvec desktop hybrid search * enhance(search): use transformers embeddings * enhance(search): bound vector result work * enhance(search): show vector index progress * fix(search): create missing zvec collection * fix(search): call transformers extractor from cljs * fix(search): bound vector index storage and embedding * fix(search): truncate vector embedding text * fix(search): reduce onnx embedding memory pressure * enhance(search): add vector embedding context * fix(search): tune vector ranking and index context * enhance(search): improve vector index quality * tune(search): increase vector embedding batch size * feat(search): add benchmark harness * fix(search): adapt page vector query topk * fix(search): refresh vector context dependents * fix(search): adapt vector embedding batch fallback * tune(search): weight keyword results in RRF * fix: search results sort order * fix: refine vector search indexing * perf: speed up embedding indexing * fix: avoid webgpu embedding crash * fix: use cpu embeddings by default * fix: keep search progress visible * fix: show search rebuild progress promptly * fix: search index progress ui * code cleanup * prefer coreml on mac * still use cpu * fix: lint and tests * enhance: start local embedding sidecar * fix: harden desktop vector search startup * fix: satisfy embedding server lint * fix: avoid electron logger in test bundle * fix: avoid native vector binding in platform tests * increase ready timeout * fix: dimension * add more models * fix: stabilize zvec CI checks * fix: pass empty rules to datalog queries * fix: stabilize flashcards e2e open flow --- .../test/logseq/e2e/flashcards_basic_test.clj | 9 +- .../077-vector-embedding-context.md | 63 ++ package.json | 3 +- pnpm-lock.yaml | 47 ++ resources/electron-builder.yml | 2 + resources/package.json | 2 + resources/pnpm-lock.yaml | 59 ++ scripts/build-db-worker-node-bundle.mjs | 1 + sidecar/embedding_server.py | 146 +++++ src/electron/electron/core.cljs | 21 +- src/electron/electron/db_worker.cljs | 25 +- src/electron/electron/embedding_server.cljs | 292 +++++++++ src/electron/electron/handler.cljs | 7 +- src/main/frontend/components/header.cljs | 4 +- src/main/frontend/db/query_react.cljs | 12 +- src/main/frontend/handler/worker.cljs | 5 + .../frontend/modules/shortcut/config.cljs | 2 +- src/main/frontend/persist_db/browser.cljs | 77 ++- src/main/frontend/worker/db_core.cljs | 346 +++++++++-- src/main/frontend/worker/db_worker_node.cljs | 10 +- src/main/frontend/worker/platform.cljs | 23 + src/main/frontend/worker/platform/node.cljs | 369 +++++++++-- src/main/frontend/worker/search.cljs | 576 +++++++++++++++--- .../frontend/worker/search_benchmark.cljs | 106 ++++ src/main/frontend/worker/state.cljs | 6 + src/main/logseq/cli/server.cljs | 10 +- src/main/logseq/db_worker/daemon.cljs | 6 +- src/test/electron/embedding_server_test.cljs | 228 +++++++ src/test/frontend/db/query_react_test.cljs | 10 + src/test/frontend/persist_db_test.cljs | 53 ++ src/test/frontend/worker/db_core_test.cljs | 448 +++++++++++++- .../frontend/worker/db_worker_node_test.cljs | 81 +++ .../frontend/worker/platform_node_test.cljs | 206 +++++++ .../worker/search_benchmark_test.cljs | 53 ++ src/test/frontend/worker/search_test.cljs | 496 +++++++++++++++ 35 files changed, 3538 insertions(+), 266 deletions(-) create mode 100644 docs/agent-guide/077-vector-embedding-context.md create mode 100644 sidecar/embedding_server.py create mode 100644 src/electron/electron/embedding_server.cljs create mode 100644 src/main/frontend/worker/search_benchmark.cljs create mode 100644 src/test/electron/embedding_server_test.cljs create mode 100644 src/test/frontend/worker/search_benchmark_test.cljs diff --git a/clj-e2e/test/logseq/e2e/flashcards_basic_test.clj b/clj-e2e/test/logseq/e2e/flashcards_basic_test.clj index dc3849004e48..373418186b08 100644 --- a/clj-e2e/test/logseq/e2e/flashcards_basic_test.clj +++ b/clj-e2e/test/logseq/e2e/flashcards_basic_test.clj @@ -3,11 +3,9 @@ [logseq.e2e.api :refer [ls-api-call!]] [logseq.e2e.assert :as assert] [logseq.e2e.fixtures :as fixtures] - [logseq.e2e.keyboard :as k] [logseq.e2e.locator :as loc] [logseq.e2e.util :as util] - [wally.main :as w] - [wally.repl :as repl])) + [wally.main :as w])) (use-fixtures :once fixtures/open-page) @@ -17,7 +15,10 @@ (defn- open-flashcards [] (util/double-esc) - (k/press ["t" "c"]) + (when-not (w/visible? ".flashcards-nav") + (w/click "#left-menu") + (w/wait-for ".flashcards-nav")) + (w/eval-js "selector => document.querySelector(selector)?.click()" ".flashcards-nav a") (assert/assert-is-visible "#cards-modal")) (defn- select-cards-option diff --git a/docs/agent-guide/077-vector-embedding-context.md b/docs/agent-guide/077-vector-embedding-context.md new file mode 100644 index 000000000000..f94502b6b88f --- /dev/null +++ b/docs/agent-guide/077-vector-embedding-context.md @@ -0,0 +1,63 @@ +# 077 — Vector embedding context chunks for cross-block search + +Goal: Improve desktop vector search so semantic queries can match ideas that span adjacent or related blocks. + +Goal: Preserve the current result model where a search hit resolves to a single anchor block UUID. + +Goal: Keep vector index size and rebuild time close to the current one-vector-per-block design. + +Related: +- `src/main/frontend/worker/search.cljs` +- `src/main/frontend/worker/db_core.cljs` +- `src/main/frontend/worker/platform/node.cljs` +- `src/test/frontend/worker/search_test.cljs` +- `src/test/frontend/worker/db_core_test.cljs` + +## Context + +The current vector index embeds one text value per searchable block. That keeps index size predictable, but misses queries where the meaning is split across a parent, a child, or neighboring sibling blocks. + +Increasing recall by creating rolling windows for every block would multiply vector count. On large graphs this would increase zvec index size, rebuild time, and ONNX embedding work. + +## Decision + +Use one bounded context chunk per anchor block. + +Each searchable block keeps one vector document whose id is the anchor block UUID. The embedding text is built from bounded local context: + +- page title +- up to three nearest non-page parent titles +- previous sibling title +- current block title +- up to two direct child titles +- next sibling title + +SQLite keyword search continues to index only the existing per-block `:title`. The richer context is vector-only. + +Full index rebuilds must build the local-context cache once and reuse it across index batches. Do not compute sibling or child context by sorting the same parent children for every block. + +Hybrid ranking should keep vector similarity as an auxiliary signal. Exact or strong keyword matches must not be displaced by weak vector hits. + +## Constraints + +- Do not increase vector document count. +- Do not change search result ids or rendering contracts. +- Do not put unbounded subtree text into an embedding input. +- Keep the final embedding input capped by `db_core` before it reaches Transformers. +- Preserve existing keyword index behavior and exact-match precision. +- Keep full-rebuild context preparation close to linear in block count. + +## Rationale + +This design improves cross-block semantic recall without multiplying index size. It also keeps incremental search updates simple: an updated block can still be represented as a block-shaped search document, while richer dependency-aware incremental refresh can be added later if needed. + +The tradeoff is that context may become slightly stale for neighboring block edits until the next rebuild or a broader incremental refresh. This is acceptable for the first phase because full rebuild correctness is the priority and result ids remain stable. + +## Future Work + +- Rebuild affected neighbor anchor chunks on incremental updates: + - the changed block + - its previous and next sibling + - its parent + - direct children that include the changed block as context +- Add optional section-level chunks only if recall remains insufficient, with a hard cap on extra vectors. diff --git a/package.json b/package.json index b69f6cfdc115..6ffecb2df750 100644 --- a/package.json +++ b/package.json @@ -154,6 +154,7 @@ "@sentry/react": "^10.51.0", "@sqlite.org/sqlite-wasm": "3.51.2-build9", "@tabler/icons-react": "2.47.0", + "@zvec/zvec": "0.4.0", "bignumber.js": "^9.3.1", "chrono-node": "2.9.0", "codemirror": "5.65.18", @@ -198,11 +199,11 @@ "ignoredBuiltDependencies": [ "canvas", "core-js", - "onnxruntime-node", "protobufjs", "sharp" ], "onlyBuiltDependencies": [ + "@zvec/zvec", "better-sqlite3", "electron", "keytar" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 226232e35c67..f076d6327f2b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -113,6 +113,9 @@ importers: '@tabler/icons-react': specifier: 2.47.0 version: 2.47.0(react@18.3.1) + '@zvec/zvec': + specifier: 0.4.0 + version: 0.4.0 bignumber.js: specifier: ^9.3.1 version: 9.3.1 @@ -1062,6 +1065,29 @@ packages: '@xtuc/long@4.2.2': resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} + '@zvec/bindings-darwin-arm64@0.4.0': + resolution: {integrity: sha512-Yw2KA8U8N6qqoFmahFsM7CmDv+WviViBBv5XiiY4m+p+s1mOlo/PStgcrBVCclt6N5PCTuO4ZiHfShGxfvOMrg==} + cpu: [arm64] + os: [darwin] + + '@zvec/bindings-linux-arm64@0.4.0': + resolution: {integrity: sha512-aKA8jAjv6f/5xvZ+1TeafdLm+VNVRyR4vHgQfaGccX/GnKLklASKDEQaECkTyGggPEO8ET/MnfavN8eZSCiL8Q==} + cpu: [arm64] + os: [linux] + + '@zvec/bindings-linux-x64@0.4.0': + resolution: {integrity: sha512-RrlBiF5Z4dmMdP0RDomkxnRl4+mmuvYiYGYfq9frRvcgHYav7MPO+tpwGHv7XZ/ZeR7/Yv7G9SIF4qedd2hlng==} + cpu: [x64] + os: [linux] + + '@zvec/bindings-win32-x64@0.4.0': + resolution: {integrity: sha512-YN0fEBAv3Bi0w8PTtIKRKgHEKVJzVAqxKm3bjGvOyiX+SqBoTjhO9waSboLjaDbFmVXmetOplGCmnPMSuIs+Mg==} + cpu: [x64] + os: [win32] + + '@zvec/zvec@0.4.0': + resolution: {integrity: sha512-1ctdMjhYybs6HLpBO7nelTOnE3Pdewor+XHIRAe+c3uM41L3fB4qh2IH5JD1HmIXcYHS5p75q2vwYUkBTXlKHg==} + JSONStream@1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -5782,6 +5808,27 @@ snapshots: '@xtuc/long@4.2.2': {} + '@zvec/bindings-darwin-arm64@0.4.0': + optional: true + + '@zvec/bindings-linux-arm64@0.4.0': + optional: true + + '@zvec/bindings-linux-x64@0.4.0': + optional: true + + '@zvec/bindings-win32-x64@0.4.0': + optional: true + + '@zvec/zvec@0.4.0': + dependencies: + bindings: 1.5.0 + optionalDependencies: + '@zvec/bindings-darwin-arm64': 0.4.0 + '@zvec/bindings-linux-arm64': 0.4.0 + '@zvec/bindings-linux-x64': 0.4.0 + '@zvec/bindings-win32-x64': 0.4.0 + JSONStream@1.3.5: dependencies: jsonparse: 1.3.1 diff --git a/resources/electron-builder.yml b/resources/electron-builder.yml index 5940870dca84..3b47b078cb99 100644 --- a/resources/electron-builder.yml +++ b/resources/electron-builder.yml @@ -18,6 +18,8 @@ publish: extraResources: - from: .agents/skills/logseq-cli/SKILL.md to: .agents/skills/logseq-cli/SKILL.md + - from: ../sidecar + to: sidecar mac: artifactName: ${productName}-darwin-${arch}-${version}.${ext} diff --git a/resources/package.json b/resources/package.json index ff5e8ee5f69a..c5f031aeec42 100644 --- a/resources/package.json +++ b/resources/package.json @@ -23,6 +23,7 @@ "@fastify/cors": "11.2.0", "@js-joda/core": "3.2.0", "@modelcontextprotocol/sdk": "^1.27.1", + "@zvec/zvec": "0.4.0", "abort-controller": "3.0.0", "command-exists": "1.2.9", "diff-match-patch": "1.0.5", @@ -58,6 +59,7 @@ }, "pnpm": { "onlyBuiltDependencies": [ + "@zvec/zvec", "electron", "electron-winstaller", "keytar" diff --git a/resources/pnpm-lock.yaml b/resources/pnpm-lock.yaml index d8cc6fc0655a..f9d4dd0accae 100644 --- a/resources/pnpm-lock.yaml +++ b/resources/pnpm-lock.yaml @@ -20,6 +20,9 @@ importers: '@modelcontextprotocol/sdk': specifier: ^1.27.1 version: 1.29.0(zod@4.3.6) + '@zvec/zvec': + specifier: 0.4.0 + version: 0.4.0 abort-controller: specifier: 3.0.0 version: 3.0.0 @@ -275,6 +278,29 @@ packages: engines: {node: '>=10.0.0'} deprecated: this version has critical issues, please update to the latest version + '@zvec/bindings-darwin-arm64@0.4.0': + resolution: {integrity: sha512-Yw2KA8U8N6qqoFmahFsM7CmDv+WviViBBv5XiiY4m+p+s1mOlo/PStgcrBVCclt6N5PCTuO4ZiHfShGxfvOMrg==} + cpu: [arm64] + os: [darwin] + + '@zvec/bindings-linux-arm64@0.4.0': + resolution: {integrity: sha512-aKA8jAjv6f/5xvZ+1TeafdLm+VNVRyR4vHgQfaGccX/GnKLklASKDEQaECkTyGggPEO8ET/MnfavN8eZSCiL8Q==} + cpu: [arm64] + os: [linux] + + '@zvec/bindings-linux-x64@0.4.0': + resolution: {integrity: sha512-RrlBiF5Z4dmMdP0RDomkxnRl4+mmuvYiYGYfq9frRvcgHYav7MPO+tpwGHv7XZ/ZeR7/Yv7G9SIF4qedd2hlng==} + cpu: [x64] + os: [linux] + + '@zvec/bindings-win32-x64@0.4.0': + resolution: {integrity: sha512-YN0fEBAv3Bi0w8PTtIKRKgHEKVJzVAqxKm3bjGvOyiX+SqBoTjhO9waSboLjaDbFmVXmetOplGCmnPMSuIs+Mg==} + cpu: [x64] + os: [win32] + + '@zvec/zvec@0.4.0': + resolution: {integrity: sha512-1ctdMjhYybs6HLpBO7nelTOnE3Pdewor+XHIRAe+c3uM41L3fB4qh2IH5JD1HmIXcYHS5p75q2vwYUkBTXlKHg==} + abbrev@3.0.1: resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} engines: {node: ^18.17.0 || >=20.5.0} @@ -393,6 +419,9 @@ packages: base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} + bindings@1.5.0: + resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} + bl@4.1.0: resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} @@ -892,6 +921,9 @@ packages: resolution: {integrity: sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==} engines: {node: ^12.20 || >= 14.13} + file-uri-to-path@1.0.0: + resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} + filelist@1.0.6: resolution: {integrity: sha512-5giy2PkLYY1cP39p17Ech+2xlpTRL9HLspOfEgm0L6CwBXBTgsK5ou0JtzYuepxkaQ/tvhCFIJ5uXo0OrM2DxA==} @@ -2482,6 +2514,27 @@ snapshots: '@xmldom/xmldom@0.8.12': {} + '@zvec/bindings-darwin-arm64@0.4.0': + optional: true + + '@zvec/bindings-linux-arm64@0.4.0': + optional: true + + '@zvec/bindings-linux-x64@0.4.0': + optional: true + + '@zvec/bindings-win32-x64@0.4.0': + optional: true + + '@zvec/zvec@0.4.0': + dependencies: + bindings: 1.5.0 + optionalDependencies: + '@zvec/bindings-darwin-arm64': 0.4.0 + '@zvec/bindings-linux-arm64': 0.4.0 + '@zvec/bindings-linux-x64': 0.4.0 + '@zvec/bindings-win32-x64': 0.4.0 + abbrev@3.0.1: {} abort-controller@3.0.0: @@ -2609,6 +2662,10 @@ snapshots: base64-js@1.5.1: {} + bindings@1.5.0: + dependencies: + file-uri-to-path: 1.0.0 + bl@4.1.0: dependencies: buffer: 5.7.1 @@ -3221,6 +3278,8 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 + file-uri-to-path@1.0.0: {} + filelist@1.0.6: dependencies: minimatch: 5.1.9 diff --git a/scripts/build-db-worker-node-bundle.mjs b/scripts/build-db-worker-node-bundle.mjs index 28e428ff51d1..220b45fc199c 100644 --- a/scripts/build-db-worker-node-bundle.mjs +++ b/scripts/build-db-worker-node-bundle.mjs @@ -19,6 +19,7 @@ const builtinModuleSet = new Set([ ...builtinModules.map((moduleName) => `node:${moduleName}`), ]); const externalModuleSet = new Set([ + "@zvec/zvec", "keytar", "ws", ]); diff --git a/sidecar/embedding_server.py b/sidecar/embedding_server.py new file mode 100644 index 000000000000..2b588bb003c4 --- /dev/null +++ b/sidecar/embedding_server.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python3 +import argparse +import json +import logging +import os +from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer + +from sentence_transformers import SentenceTransformer + + +DEFAULT_MODEL = "all-MiniLM-L6-v2" +WARMUP_INPUT = "Logseq embedding server warmup" +_MODELS = {} + + +def configure_logging(log_file): + if not log_file: + return + + log_dir = os.path.dirname(log_file) + if log_dir: + os.makedirs(log_dir, exist_ok=True) + logging.basicConfig( + filename=log_file, + level=logging.INFO, + format="%(asctime)s %(levelname)s %(message)s", + ) + + +def load_model(model_name): + if model_name not in _MODELS: + logging.info("Loading embedding model: %s", model_name) + _MODELS[model_name] = SentenceTransformer(model_name) + return _MODELS[model_name] + + +def warm_model(model_name): + logging.info("Warming embedding model: %s", model_name) + model = load_model(model_name) + model.encode([WARMUP_INPUT], normalize_embeddings=True) + logging.info("Embedding model warmup finished: %s", model_name) + + +def normalize_input(value): + if isinstance(value, str): + return [value] + if isinstance(value, list) and all(isinstance(item, str) for item in value): + return value + raise ValueError("input must be a string or a list of strings") + + +class EmbeddingHandler(BaseHTTPRequestHandler): + server_version = "LogseqEmbeddingServer/1.0" + + def do_GET(self): + if self.path == "/healthz": + self.send_json({"status": "ok"}) + return + + self.send_json({"error": "not found"}, status=404) + + def do_POST(self): + if self.path != "/v1/embeddings": + self.send_json({"error": "not found"}, status=404) + return + + try: + length = int(self.headers.get("Content-Length", "0")) + payload = json.loads(self.rfile.read(length).decode("utf-8")) + model_name = payload.get("model") or self.server.default_model + texts = normalize_input(payload.get("input")) + model = load_model(model_name) + vectors = model.encode(texts, normalize_embeddings=True).tolist() + self.send_json( + { + "object": "list", + "model": model_name, + "data": [ + { + "object": "embedding", + "index": index, + "embedding": vector, + } + for index, vector in enumerate(vectors) + ], + } + ) + except Exception as error: + logging.exception("Embedding request failed") + self.send_json({"error": str(error)}, status=400) + + def log_message(self, _format, *_args): + return + + def send_json(self, payload, status=200): + body = json.dumps(payload).encode("utf-8") + try: + self.send_response(status) + self.send_header("Content-Type", "application/json") + self.send_header("Content-Length", str(len(body))) + self.end_headers() + self.wfile.write(body) + except BrokenPipeError: + logging.exception("Embedding response write failed") + raise + + +class EmbeddingServer(ThreadingHTTPServer): + def __init__(self, server_address, handler_class, default_model): + super().__init__(server_address, handler_class) + self.default_model = default_model + + def handle_error(self, request, client_address): + logging.exception("Unhandled embedding server error from %s", client_address) + super().handle_error(request, client_address) + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument("--host", default="127.0.0.1") + parser.add_argument("--port", type=int, default=8765) + parser.add_argument("--model", default=DEFAULT_MODEL) + parser.add_argument("--log-file") + args = parser.parse_args() + + configure_logging(args.log_file) + try: + warm_model(args.model) + server = EmbeddingServer((args.host, args.port), EmbeddingHandler, args.model) + logging.info( + "Embedding server listening on http://%s:%s/v1/embeddings", + args.host, + args.port, + ) + print( + f"Embedding server listening on http://{args.host}:{args.port}/v1/embeddings", + flush=True, + ) + server.serve_forever() + except Exception: + logging.exception("Embedding server failed") + raise + + +if __name__ == "__main__": + main() diff --git a/src/electron/electron/core.cljs b/src/electron/electron/core.cljs index 1aaf96088cef..8b24d019b399 100644 --- a/src/electron/electron/core.cljs +++ b/src/electron/electron/core.cljs @@ -9,6 +9,7 @@ [clojure.string :as string] [electron.cli-install :as cli-install] [electron.db :as db] + [electron.embedding-server :as embedding-server] [electron.exceptions :as exceptions] [electron.handler :as handler] [electron.i18n :as i18n :refer [t]] @@ -378,11 +379,15 @@ t2 (setup-app-manager! win) t3 (handler/set-ipc-handler! win) t4 (server/setup! win) + t5 (embedding-server/setup! app') tt (exceptions/setup-exception-listeners!)] (vreset! *teardown-fn - #(doseq [f [t0 t1 t2 t3 t4 tt]] - (and f (f))))))) + #(-> (handler/stop-all-db-workers!) + (p/finally + (fn [] + (doseq [f [t0 t1 t2 t3 t4 t5 tt]] + (and f (f)))))))))) ;; setup effects (@*setup-fn) @@ -412,7 +417,10 @@ nil))))) (.on app' "before-quit" (fn [_e] (reset! win/*quitting? true) - (handler/stop-all-db-workers!))) + (-> (handler/stop-all-db-workers!) + (p/finally + (fn [] + (embedding-server/stop!)))))) (.on app' "activate" #(when @*win (.show win))))))) @@ -449,8 +457,11 @@ (.on app "window-all-closed" (fn [] (logger/debug "window-all-closed" "Quitting...") - (handler/stop-all-db-workers!) - (.quit app))) + (-> (handler/stop-all-db-workers!) + (p/finally + (fn [] + (embedding-server/stop!) + (.quit app)))))) (on-app-ready! app)))) (defn start [] diff --git a/src/electron/electron/db_worker.cljs b/src/electron/electron/db_worker.cljs index 2b8e8686fba2..b2745b39951a 100644 --- a/src/electron/electron/db_worker.cljs +++ b/src/electron/electron/db_worker.cljs @@ -233,13 +233,21 @@ (p/resolved true)) (p/resolved false)))) +(defonce ^:private *runtime-opts (atom {})) + (defn- start-managed-daemon! [repo] - (p/let [config (cli-server/ensure-server! {:owner-source :electron} repo)] - {:repo repo - :base-url (:base-url config) - :auth-token nil - :owned? (:owned? config)})) + (let [config (merge {:owner-source :electron} + @*runtime-opts)] + (p/let [_ (when (seq (:embedding-endpoint config)) + (-> (cli-server/stop-server! config repo) + (p/catch (fn [_] nil)))) + config (cli-server/ensure-server! config + repo)] + {:repo repo + :base-url (:base-url config) + :auth-token nil + :owned? (:owned? config)}))) (defn- stop-managed-daemon! [{:keys [repo]}] @@ -253,8 +261,11 @@ :runtime-ready? runtime-ready-default?})) (defn ensure-runtime! - [repo window-id] - (ensure-started! manager repo window-id)) + ([repo window-id] + (ensure-started! manager repo window-id)) + ([repo window-id opts] + (reset! *runtime-opts opts) + (ensure-started! manager repo window-id))) (defn release-window! [window-id] diff --git a/src/electron/electron/embedding_server.cljs b/src/electron/electron/embedding_server.cljs new file mode 100644 index 000000000000..b7d14ac0fbca --- /dev/null +++ b/src/electron/electron/embedding_server.cljs @@ -0,0 +1,292 @@ +(ns electron.embedding-server + (:require ["child_process" :as child-process] + ["fs-extra" :as fs] + ["path" :as node-path] + [promesa.core :as p])) + +(def ^:private default-host "127.0.0.1") +(def ^:private default-model-id "all-MiniLM-L6-v2") +(def ^:private embedding-url-env "LOGSEQ_EMBEDDINGS_URL") +(def ^:private runtime-dir-name "embedding-server") +(def ^:private venv-name ".venv") +(def ^:private dependency "sentence-transformers") +(def ^:private deps-stamp-name "deps-v1.ok") +(def ^:private log-file-name "embedding-server.log") +(def ^:private ready-timeout-ms 120000) +(def ^:private ready-poll-ms 100) + +(defonce ^:private *server-process (atom nil)) +(defonce ^:private *startup-promise (atom nil)) +(defonce ^:private *endpoint-promise (atom nil)) +(defonce ^:private *endpoint (atom nil)) + +(declare find-port! run-command! spawn-server! wait-ready! stop!) + +(defn- default-logger + [] + (let [logger (js/require "electron-log")] + {:debug (.-debug logger) + :info (.-info logger) + :warn (.-warn logger) + :error (.-error logger)})) + +(defn- macos? + [platform] + (= "darwin" platform)) + +(defn- sidecar-dir + [{:keys [packaged? resources-path dirname]}] + (if packaged? + (node-path/join resources-path "sidecar") + (node-path/join dirname ".." "sidecar"))) + +(defn- config + [^js app' opts] + (let [platform (or (:platform opts) (.-platform js/process)) + user-data-dir (or (:user-data-dir opts) (.getPath app' "userData")) + packaged? (if (contains? opts :packaged?) + (:packaged? opts) + (boolean (.-isPackaged app'))) + runtime-dir (node-path/join user-data-dir runtime-dir-name) + venv-dir (node-path/join runtime-dir venv-name) + venv-python (node-path/join venv-dir "bin" "python") + sidecar-root (sidecar-dir {:packaged? packaged? + :resources-path (or (:resources-path opts) + (.-resourcesPath js/process)) + :dirname (or (:dirname opts) js/__dirname)}) + script-path (node-path/join sidecar-root "embedding_server.py")] + {:platform platform + :runtime-dir runtime-dir + :venv-dir venv-dir + :venv-python venv-python + :deps-stamp (node-path/join runtime-dir deps-stamp-name) + :log-file (node-path/join runtime-dir log-file-name) + :sidecar-dir sidecar-root + :script-path script-path + :python-command (or (:python-command opts) + (.-LOGSEQ_EMBEDDINGS_PYTHON js/process.env) + "python3") + :host (or (:host opts) default-host) + :port (:port opts) + :model-id (or (:model-id opts) + (.-LOGSEQ_EMBEDDING_MODEL js/process.env) + default-model-id) + :exists? (or (:exists? opts) #(fs/existsSync %)) + :ensure-dir! (or (:ensure-dir! opts) #(fs/ensureDirSync %)) + :write-file! (or (:write-file! opts) #(.writeFileSync fs %1 %2 "utf8")) + :logger (:logger opts) + :find-port! (or (:find-port! opts) find-port!) + :set-env! (or (:set-env! opts) #(aset js/process.env %1 %2)) + :run-command! (or (:run-command! opts) run-command!) + :wait-ready! (or (:wait-ready! opts) wait-ready!) + :spawn-server! (or (:spawn-server! opts) spawn-server!)})) + +(defn- log-stream! + [^js stream log-fn label] + (when stream + (.on stream "data" + (fn [data] + (log-fn label (.toString data)))))) + +(defn- run-command! + [cmd args {:keys [cwd logger]}] + (js/Promise. + (fn [resolve reject] + (let [proc (.spawn child-process cmd (clj->js args) #js {:cwd cwd + :stdio "pipe"})] + (log-stream! (.-stdout proc) (:debug logger) :embedding-server/setup) + (log-stream! (.-stderr proc) (:warn logger) :embedding-server/setup) + (.on proc "error" reject) + (.on proc "close" + (fn [code] + (if (zero? code) + (resolve nil) + (reject (js/Error. (str "Embedding server setup command failed: " + cmd " " (pr-str args) + " exited with " code)))))))))) + +(defn- find-port! + [host] + (js/Promise. + (fn [resolve reject] + (let [node-net (js/require "node:net") + server (.createServer node-net)] + (.once server "error" reject) + (.listen server 0 host + (fn [] + (let [port (.-port (.address server))] + (.close server + (fn [error] + (if error + (reject error) + (resolve port))))))))))) + +(defn- embedding-endpoint + [host port] + (str "http://" host ":" port "/v1/embeddings")) + +(defn- embedding-health-endpoint + [host port] + (str "http://" host ":" port "/healthz")) + +(defn- publish-endpoint! + [{:keys [host port set-env!]}] + (let [endpoint-url (embedding-endpoint host port)] + (reset! *endpoint endpoint-url) + (set-env! embedding-url-env endpoint-url) + endpoint-url)) + +(defn- allocate-port! + [{:keys [host port] :as cfg}] + (let [find-port-fn (:find-port! cfg)] + (p/let [port (or port (find-port-fn host))] + (assoc cfg :port port)))) + +(defn- wait-ready! + [endpoint-url] + (let [deadline (+ (js/Date.now) ready-timeout-ms)] + (letfn [(poll! [] + (-> (js/fetch endpoint-url) + (p/then (fn [resp] + (when-not (.-ok resp) + (throw (js/Error. (str "Embedding server health check failed: " (.-status resp))))))) + (p/catch (fn [error] + (if (< (js/Date.now) deadline) + (p/let [_ (p/delay ready-poll-ms)] + (poll!)) + (throw error))))))] + (poll!)))) + +(defn- attach-exit-handler! + [^js proc logger] + (when (and proc (fn? (.-on proc))) + (.on proc "exit" + (fn [code signal] + (when (identical? proc @*server-process) + (reset! *server-process nil)) + ((:info logger) :embedding-server/exited {:code code + :signal signal}))))) + +(defn- spawn-server! + [{:keys [venv-python script-path host port model-id log-file logger] + sidecar-root :sidecar-dir}] + (let [proc (.spawn child-process + venv-python + (clj->js [script-path + "--host" host + "--port" (str port) + "--model" model-id + "--log-file" log-file]) + #js {:cwd sidecar-root + :stdio "pipe"})] + (log-stream! (.-stdout proc) (:info logger) :embedding-server) + (log-stream! (.-stderr proc) (:warn logger) :embedding-server) + (.on proc "error" + (fn [error] + ((:error logger) :embedding-server/start-failed error))) + proc)) + +(defn- install-runtime! + [{:keys [runtime-dir venv-python deps-stamp python-command + ensure-dir! exists? write-file! logger] :as cfg}] + (ensure-dir! runtime-dir) + (let [run-command-fn (:run-command! cfg) + needs-venv? (not (exists? venv-python)) + needs-deps? (or needs-venv? + (not (exists? deps-stamp)))] + (p/let [_ (when needs-venv? + (run-command-fn python-command ["-m" "venv" venv-name] {:cwd runtime-dir + :logger logger})) + _ (when needs-deps? + (run-command-fn venv-python ["-m" "pip" "install" dependency] {:cwd runtime-dir + :logger logger}))] + (when needs-deps? + (write-file! deps-stamp (str dependency "\n"))) + cfg))) + +(defn start! + ([app'] (start! app' {})) + ([app' opts] + (let [cfg (config app' opts)] + (cond + (not (macos? (:platform cfg))) + (p/resolved :skipped) + + @*startup-promise + @*startup-promise + + @*server-process + (if-let [endpoint-url @*endpoint] + (do + ((:set-env! cfg) embedding-url-env endpoint-url) + (p/resolved :already-started)) + (p/rejected (js/Error. "Embedding server endpoint is missing"))) + + :else + (let [cfg (assoc cfg :logger (or (:logger cfg) (default-logger))) + endpoint-resolve (atom nil) + endpoint-reject (atom nil) + endpoint-promise (js/Promise. + (fn [resolve reject] + (reset! endpoint-resolve resolve) + (reset! endpoint-reject reject))) + _ (reset! *endpoint-promise endpoint-promise) + startup (-> (p/let [cfg (allocate-port! cfg) + endpoint-url (publish-endpoint! cfg) + _ (@endpoint-resolve endpoint-url) + cfg (install-runtime! cfg) + proc ((:spawn-server! cfg) cfg) + _ (do + (reset! *server-process proc) + (attach-exit-handler! proc (:logger cfg))) + _ ((:wait-ready! cfg) (embedding-health-endpoint (:host cfg) (:port cfg)))] + :started) + (p/catch (fn [error] + (when @endpoint-reject + (@endpoint-reject error)) + (stop!) + ((:error (:logger cfg)) :embedding-server/setup-failed error) + (throw error))) + (p/finally (fn [] + (reset! *startup-promise nil))))] + (reset! *startup-promise startup) + startup))))) + +(defn ensure-endpoint! + ([app'] (ensure-endpoint! app' {})) + ([app' opts] + (let [cfg (config app' opts)] + (cond + (not (macos? (:platform cfg))) + (p/resolved nil) + + @*endpoint + (do + ((:set-env! cfg) embedding-url-env @*endpoint) + (p/resolved @*endpoint)) + + @*endpoint-promise + @*endpoint-promise + + :else + (do + (start! app' opts) + @*endpoint-promise))))) + +(defn stop! + [] + (reset! *startup-promise nil) + (reset! *endpoint-promise nil) + (reset! *endpoint nil) + (when-let [^js proc @*server-process] + (reset! *server-process nil) + (when (fn? (.-kill proc)) + (.kill proc)))) + +(defn setup! + [app'] + (let [logger (default-logger)] + (-> (start! app') + (p/catch (fn [error] + ((:error logger) :embedding-server/setup-failed error))))) + stop!) diff --git a/src/electron/electron/handler.cljs b/src/electron/electron/handler.cljs index 5061e60c28de..1dd29dd32b90 100644 --- a/src/electron/electron/handler.cljs +++ b/src/electron/electron/handler.cljs @@ -17,6 +17,7 @@ [electron.configs :as cfgs] [electron.db :as db] [electron.db-worker :as db-worker] + [electron.embedding-server :as embedding-server] [electron.find-in-page :as find] [electron.handler-interface :refer [handle]] [electron.i18n :as i18n] @@ -239,7 +240,11 @@ (defmethod handle :db-worker-runtime [^js window [_ repo]] (if (string/blank? repo) (p/rejected (ex-info "repo is required" {:code :missing-repo})) - (db-worker/ensure-runtime! (canonical-repo repo) (.-id window)))) + (p/let [embedding-endpoint (embedding-server/ensure-endpoint! app)] + (db-worker/ensure-runtime! (canonical-repo repo) + (.-id window) + {:embedding-endpoint embedding-endpoint + :embedding-model-id (.-LOGSEQ_EMBEDDING_MODEL js/process.env)})))) (defmethod handle :releaseDbWorkerRuntime [^js window [_ repo]] (if (string/blank? repo) diff --git a/src/main/frontend/components/header.cljs b/src/main/frontend/components/header.cljs index 4f91dc89aa22..289692854394 100644 --- a/src/main/frontend/components/header.cljs +++ b/src/main/frontend/components/header.cljs @@ -390,11 +390,11 @@ (rum/defc search-index-progress < rum/reactive [] (let [current-repo (state/get-current-repo) - {:keys [running? repo progress]} (or (state/sub :search/index-build) {}) + {:keys [visible? running? repo progress]} (or (state/sub :search/index-build) {}) progress' (-> (or progress 0) (max 0) (min 100))] - (when (and running? (= repo current-repo)) + (when (and (or visible? running?) (= repo current-repo)) [:div.search-index-progress [ui/loading ""] [:span.search-index-progress__text (t :search/index-progress progress')] diff --git a/src/main/frontend/db/query_react.cljs b/src/main/frontend/db/query_react.cljs index c731c80c9a87..4f441e3a7fe6 100644 --- a/src/main/frontend/db/query_react.cljs +++ b/src/main/frontend/db/query_react.cljs @@ -8,6 +8,7 @@ [frontend.db.utils :as db-utils] [frontend.extensions.sci :as sci] [frontend.state :as state] + [frontend.util.datalog :as datalog-util] [lambdaisland.glogi :as log] [logseq.common.util.page-ref :as page-ref] [logseq.db.frontend.inputs :as db-inputs])) @@ -73,6 +74,10 @@ :else f)) query))) +(defn- query-expects-rules? + [query] + (contains? (set (:in (datalog-util/query-vec->map query))) '%)) + (defn react-query [repo {:keys [query inputs rules] :as query'} query-opts] (let [query (resolve-query query) @@ -80,9 +85,12 @@ db (conn/get-db repo) resolve-with (select-keys query-opts [:current-page-fn :current-block-uuid]) resolved-inputs (mapv #(resolve-input db % resolve-with) inputs) + rules-input (cond + (some? rules) rules + (query-expects-rules? query) []) inputs (cond-> resolved-inputs - rules - (conj rules)) + (some? rules-input) + (conj rules-input)) k [:custom (or (:query-string query') (dissoc query' :title)) (:today-query? query-opts) diff --git a/src/main/frontend/handler/worker.cljs b/src/main/frontend/handler/worker.cljs index 7079e591e9be..c7c993b71033 100644 --- a/src/main/frontend/handler/worker.cljs +++ b/src/main/frontend/handler/worker.cljs @@ -2,6 +2,7 @@ "Handle messages received from the webworkers" (:require [cljs-bean.core :as bean] [clojure.string :as string] + [frontend.common.thread-api :as thread-api] [frontend.common.crypt :as crypt] [frontend.context.i18n :as i18n] [frontend.handler.e2ee :as e2ee-handler] @@ -57,6 +58,10 @@ :assets/asset-file-write-finish (fn [m] (assoc-in m [repo asset-id] (or ts (.now js/Date))))))) +(defmethod handle :thread-api/search-index-build-progress [_ _worker args] + (when-let [f (get @thread-api/*thread-apis :thread-api/search-index-build-progress)] + (apply f args))) + (defmethod handle :sync-db-changes [_ _worker data] (state/pub-event! [:db/sync-changes data])) diff --git a/src/main/frontend/modules/shortcut/config.cljs b/src/main/frontend/modules/shortcut/config.cljs index 61e6aca7e1c2..c2b6a6efca76 100644 --- a/src/main/frontend/modules/shortcut/config.cljs +++ b/src/main/frontend/modules/shortcut/config.cljs @@ -643,7 +643,6 @@ :graph/remove :graph/add :graph/db-add - :graph/db-save :editor/cycle-todo :editor/up :editor/down @@ -690,6 +689,7 @@ :go/backward :go/forward :search/re-index + :graph/db-save :sidebar/open-today-page :sidebar/clear :shell/run diff --git a/src/main/frontend/persist_db/browser.cljs b/src/main/frontend/persist_db/browser.cljs index eedcb0de6744..4a9243074320 100644 --- a/src/main/frontend/persist_db/browser.cljs +++ b/src/main/frontend/persist_db/browser.cljs @@ -22,35 +22,78 @@ [repo diff] (state/input-idle? repo :diff diff)) +(defonce ^:private *search-index-progress-hide-timeout (atom nil)) + +(defn- clear-search-index-progress-hide-timeout! + [] + (when-let [timeout-id @*search-index-progress-hide-timeout] + (js/clearTimeout timeout-id) + (reset! *search-index-progress-hide-timeout nil))) + +(defn- hide-search-index-progress-later! + [repo build-id] + (clear-search-index-progress-hide-timeout!) + (reset! *search-index-progress-hide-timeout + (js/setTimeout + (fn [] + (let [{current-repo :repo current-build-id :build-id} + (get @state/state :search/index-build)] + (when (and (= repo current-repo) + (= build-id current-build-id)) + (state/set-state! :search/index-build + (assoc (get @state/state :search/index-build) + :visible? false))))) + 1500))) + (def-thread-api :thread-api/search-index-build-progress - [repo {:keys [status progress processed total]}] + [repo {:keys [build-id status progress processed total]}] (let [prev-state (get @state/state :search/index-build) current-repo (state/get-current-repo) + stage :search-index visible-repo? (or (= repo current-repo) (= repo (:repo prev-state)))] (when visible-repo? (case status :idle - (state/set-state! :search/index-build - (assoc (or prev-state {}) - :running? false - :repo repo)) + (when-not (= :completed (:status prev-state)) + (clear-search-index-progress-hide-timeout!) + (state/set-state! :search/index-build + (cond-> (assoc (or prev-state {}) + :visible? false + :running? false + :status status + :stage stage + :repo repo) + build-id (assoc :build-id build-id)))) :running - (state/set-state! :search/index-build - {:running? true - :repo repo - :progress (or progress 0) - :processed (or processed 0) - :total (or total 0)}) + (do + (clear-search-index-progress-hide-timeout!) + (state/set-state! :search/index-build + (cond-> {:visible? true + :running? true + :status status + :repo repo + :stage stage + :progress (or progress 0) + :processed (or processed 0) + :total (or total 0)} + build-id (assoc :build-id build-id)))) :completed - (state/set-state! :search/index-build - {:running? false - :repo repo - :progress (or progress 0) - :processed (or processed 0) - :total (or total 0)}) + (do + (state/set-state! :search/index-build + (cond-> {:visible? true + :running? false + :status status + :repo repo + :stage stage + :progress (or progress 0) + :processed (or processed 0) + :total (or total 0)} + build-id (assoc :build-id build-id))) + (hide-search-index-progress-later! repo build-id)) + nil)) nil)) diff --git a/src/main/frontend/worker/db_core.cljs b/src/main/frontend/worker/db_core.cljs index aa4ca51552f8..df5261974116 100644 --- a/src/main/frontend/worker/db_core.cljs +++ b/src/main/frontend/worker/db_core.cljs @@ -59,6 +59,7 @@ (defonce *sqlite worker-state/*sqlite) (defonce *sqlite-conns worker-state/*sqlite-conns) +(defonce *vector-indexes worker-state/*vector-indexes) (defonce *datascript-conns worker-state/*datascript-conns) (defonce *client-ops-conns worker-state/*client-ops-conns) (defonce *opfs-pools worker-state/*opfs-pools) @@ -68,10 +69,14 @@ (def search-db-version "Current search index version, stored in PRAGMA user_version. Bump to force a rebuild when the index format changes." - 1) + 2) (def ^:private recycle-gc-kv :logseq.kv/recycle-last-gc-at) (def ^:private search-index-build-batch-size 200) +(def ^:private vector-embedding-batch-size 32) +(def ^:private vector-embedding-parallelism 2) +(def ^:private vector-embedding-max-batch-chars (* vector-embedding-batch-size 2048)) +(def ^:private vector-embedding-max-title-length 2048) (def ^:private search-index-build-time-budget-ms 8) (def ^:private search-index-build-idle-status-ttl-ms 2000) (def ^:private search-index-build-pause-ms 300) @@ -87,7 +92,6 @@ config default-graph-config-content)) - (defn- node-runtime? [] (= :node (platform/env-flag (platform/current) :runtime))) @@ -268,6 +272,10 @@ (js/clearInterval timer)) (swap! *client-ops-cleanup-timers dissoc repo) (swap! *sqlite-conns dissoc repo) + (when-let [vector-index (worker-state/get-vector-index repo)] + (when-let [close-fn (:close! vector-index)] + (close-fn))) + (swap! *vector-indexes dissoc repo) (swap! *datascript-conns dissoc repo) (swap! *client-ops-conns dissoc repo) (swap! client-op/*repo->pending-local-tx-count dissoc repo) @@ -296,6 +304,7 @@ (if-let [search-db (worker-state/get-sqlite-conn repo :search)] (do (search/truncate-table! search-db) + (search/truncate-vector-index! (worker-state/get-vector-index repo)) (p/resolved nil)) (when-not @*publishing? (p/let [pool ( [db search-db] + client-ops-db (conj client-ops-db)) storage (new-sqlite-storage db)] (swap! *sqlite-conns assoc repo {:db db :search search-db :client-ops client-ops-db}) + (when vector-index + (swap! *vector-indexes assoc repo vector-index)) (doseq [db' dbs] (enable-sqlite-wal-mode! db')) (common-sqlite/create-kvs-table! db) @@ -602,6 +625,25 @@ [^js search-db] (aget (aget (.exec search-db #js {:sql "PRAGMA user_version" :rowMode "array"}) 0) 0)) +(defn- expected-vector-index-metadata + [] + {:embedding-model-id (platform/embedding-model-id (platform/current)) + :embedding-dimension (platform/embedding-dimension (platform/current)) + :context-version search/vector-context-version}) + +(defn- vector-index-current? + [repo] + (if-let [vector-index (worker-state/get-vector-index repo)] + (if-let [metadata-fn (:metadata vector-index)] + (= (expected-vector-index-metadata) (metadata-fn)) + false) + true)) + +(defn- persist-vector-index-metadata! + [repo] + (when-let [set-metadata! (:set-metadata! (worker-state/get-vector-index repo))] + (set-metadata! (expected-vector-index-metadata)))) + (defn- start-search-index-build! [repo] (let [build-id (str (random-uuid))] @@ -626,8 +668,14 @@ (defn- report-search-index-progress! [repo payload] - (-> (worker-state/ (worker-state/ (count title) vector-embedding-max-title-length) + (subs title 0 vector-embedding-max-title-length) + title))) + +(defn- vector-embedding-batches + [blocks] + (loop [remaining (seq blocks) + batch [] + batch-chars 0 + result []] + (if-let [block (first remaining)] + (let [text (vector-embedding-title block) + text-chars (count text) + full? (or (>= (count batch) vector-embedding-batch-size) + (and (seq batch) + (> (+ batch-chars text-chars) + vector-embedding-max-batch-chars)))] + (if full? + (recur remaining [] 0 (conj result batch)) + (recur (next remaining) + (conj batch block) + (+ batch-chars text-chars) + result))) + (cond-> result + (seq batch) (conj batch))))) + +(defn- ( ( ( (p/let [embeddings (platform/embed-texts (platform/current) [q]) + _ (validate-embedding-count! [{:title q}] embeddings)] + (search-blocks repo q (assoc option :query-embedding (first embeddings)))) + (p/catch (fn [error] + (log/warn :search/query-embedding-failed {:repo repo + :error error}) + (search-blocks repo q option)))) + (p/resolved (search-blocks repo q option))))) (def-thread-api :thread-api/block-refs-check [repo id {:keys [unlinked?]}] @@ -1040,23 +1232,26 @@ (def-thread-api :thread-api/search-blocks [repo q option] - (search-blocks repo q option)) + (js blocks)) + (schedule-vector-index-upsert! repo blocks) nil)) (def-thread-api :thread-api/search-delete-blocks [repo ids] (when-let [db (get-search-db repo)] + (search/delete-vector-blocks! (worker-state/get-vector-index repo) ids) (search/delete-blocks! db ids) nil)) (def-thread-api :thread-api/search-truncate-tables [repo] (when-let [db (get-search-db repo)] + (search/truncate-vector-index! (worker-state/get-vector-index repo)) (search/truncate-table! db) nil)) @@ -1065,11 +1260,11 @@ (when-let [conn (worker-state/get-datascript-conn repo)] (search/build-blocks-indice @conn))) -(defn- take-block-datoms-batch - [datoms batch-size time-budget-ms] +(defn- take-search-index-batch + [items batch-size time-budget-ms] (let [deadline (+ (common-util/time-ms) time-budget-ms)] (loop [batch (transient []) - remaining (seq datoms) + remaining (seq items) n 0] (if (or (nil? remaining) (>= n batch-size) @@ -1101,75 +1296,122 @@ (p/let [_ (js/Promise. (fn [resolve] (js/setTimeout resolve search-index-build-pause-ms)))] (p/recur))))) -(defn- > (d/datoms db :avet :block/uuid) + (keep #(d/entity db (:e %))) + (remove search/hidden-entity?) + vec) + vector-context (search/build-vector-context-cache blocks) + total (count blocks) + vector-index (worker-state/get-vector-index repo) + vector-index? (boolean vector-index) + fts-progress-scale (if vector-index? 50 100) + vector-progress-base (if vector-index? 50 100) + progress-for-fts (fn [processed] + (if (zero? total) + vector-progress-base + (min vector-progress-base + (int (* fts-progress-scale (/ processed total)))))) + report-progress! (fn [progress processed total] + (report-search-index-progress! repo {:build-id build-id + :status :running + :stage :search-index + :progress progress + :processed processed + :total total}))] (p/do! (report-search-index-progress! repo {:build-id build-id :status :running + :stage :search-index :progress 0 :processed 0 :total total}) (> batch - (keep #(d/entity db (:e %))) - (remove search/hidden-entity?) - (keep search/block->index)) - progress (if (zero? total) - 100 - (min 100 (int (* 100 (/ processed' total))))) + indexed (vec (keep #(search/block->index-with-context vector-context %) batch)) + indexed-blocks' (into indexed-blocks indexed) + progress (progress-for-fts processed') should-report? (> progress last-progress)] - (when (seq indexed) - (search/upsert-blocks! search-db (bean/->js indexed))) - (when should-report? - (report-search-index-progress! repo {:build-id build-id - :status :running - :progress progress - :processed processed' - :total total})) - (p/let [_ (js/Promise. (fn [resolve] (js/setTimeout resolve 0)))] - (p/recur remaining' processed' (if should-report? progress last-progress)))) + (p/let [_ (when (seq indexed) + (search/upsert-blocks! search-db (bean/->js indexed))) + _ (when should-report? + (report-progress! progress processed' total)) + _ (js/Promise. (fn [resolve] (js/setTimeout resolve 0)))] + (p/recur remaining' processed' (if should-report? progress last-progress) indexed-blocks'))) (do (ensure-active-search-index-build! repo build-id) - (.exec search-db (str "PRAGMA user_version = " search-db-version)) - (report-search-index-progress! repo {:build-id build-id - :status :completed - :progress 100 - :processed total - :total total}))))))) + (p/let [_ (when (and vector-index? (seq indexed-blocks)) + (let [vector-total (count indexed-blocks) + vector-processed (atom 0) + vector-batches (vector-embedding-batches indexed-blocks)] + (p/let [vector-blocks ( (required)")) (println (str " " (style/bold "--repo") " (required)")) (println (str " " (style/bold "--create-empty-db") " (start with empty initial datoms)")) + (println (str " " (style/bold "--embedding-endpoint") " ")) + (println (str " " (style/bold "--embedding-model-id") " ")) (println (str " " (style/bold "--log-level") " (default info)")) (println (str " " (style/bold "--version") " (print build metadata and exit)")) (println " logs: /graphs//db-worker-node-YYYYMMDD.log (retains 7)")) @@ -555,7 +559,9 @@ :event-fn handle-event! :write-guard-fn assert-lock-owner! :owner-source owner-source - :recreate-lock-fn recreate-lock!}) + :recreate-lock-fn recreate-lock! + :embedding-endpoint (:embedding-endpoint opts) + :embedding-model-id (:embedding-model-id opts)}) proxy (db-core/init-core! platform) _ (vectors + [response] + (let [data (-> (js->clj response :keywordize-keys true) + :data)] + (->> data + (sort-by #(or (:index %) 0)) + (mapv (comp vec :embedding))))) + +(defn- (js/fetch endpoint request) + (p/catch + (fn [error] + (if (< (js/Date.now) deadline) + (p/let [_ (p/delay embedding-fetch-retry-ms)] + (attempt!)) + (throw (ex-info "embedding server fetch failed" + {:endpoint endpoint + :model-id model-id} + error)))))))] + (attempt!)))) + +(defn- js {:model model-id + :input texts}))}) + _ (when-not (.-ok resp) + (throw (ex-info "embedding server request failed" + {:endpoint endpoint + :status (.-status resp) + :model-id model-id}))) + body (.json resp)] + (embedding-response->vectors body))))) + +(defonce ^:private *zvec-module (atom nil)) +(defonce ^:private *zvec-initialized? (atom false)) + +(def ^:private zvec-vector-field "embedding") +(def ^:private zvec-page-field "page") +(def ^:private zvec-title-field "title") + +(defn- zvec-enum-value + [enum-name value-name] + (gobj/get (gobj/get @*zvec-module enum-name) value-name)) + +(defn- zvec-module [] + (or @*zvec-module + (let [module (js/require "@zvec/zvec")] + (reset! *zvec-module module) + module))) + +(defn- initialize-zvec! [] + (zvec-module) + (when (compare-and-set! *zvec-initialized? false true) + ((gobj/get @*zvec-module "ZVecInitialize") + #js {:logLevel (zvec-enum-value "ZVecLogLevel" "WARN")}))) + +(defn- zvec-schema + [dimension] + (let [Schema (gobj/get @*zvec-module "ZVecCollectionSchema")] + (new Schema + #js {:name "blocks" + :vectors #js [#js {:name zvec-vector-field + :dataType (zvec-enum-value "ZVecDataType" "VECTOR_FP32") + :dimension dimension + :indexParams #js {:indexType (zvec-enum-value "ZVecIndexType" "HNSW") + :metricType (zvec-enum-value "ZVecMetricType" "COSINE")}}] + :fields #js [#js {:name zvec-page-field + :dataType (zvec-enum-value "ZVecDataType" "STRING") + :indexParams #js {:indexType (zvec-enum-value "ZVecIndexType" "INVERT")}} + #js {:name zvec-title-field + :dataType (zvec-enum-value "ZVecDataType" "STRING")}]}))) + +(defn- create-zvec-collection! + [path dimension] + ((gobj/get @*zvec-module "ZVecCreateAndOpen") + path + (zvec-schema dimension) + #js {:enableMMAP true})) + +(defn- zvec-collection-missing-error? + [error] + (or (= "ZVEC_NOT_FOUND" (gobj/get error "code")) + (and (= "ZVEC_INVALID_ARGUMENT" (gobj/get error "code")) + (string/includes? (str error) " not exist")))) + +(defn- open-zvec-collection! + [path dimension] + (initialize-zvec!) + (try + ((gobj/get @*zvec-module "ZVecOpen") path #js {:enableMMAP true}) + (catch :default error + (if (zvec-collection-missing-error? error) + (create-zvec-collection! path dimension) + (throw error))))) + +(defn- zvec-doc + [{:keys [id page embedding vector-title]}] + (let [vectors (js-obj) + fields (js-obj)] + (gobj/set vectors zvec-vector-field (clj->js embedding)) + (gobj/set fields zvec-page-field page) + (gobj/set fields zvec-title-field (or vector-title "")) + #js {:id id + :vectors vectors + :fields fields})) + +(defn- zvec-result->map + [doc] + (let [fields (gobj/get doc "fields") + distance (gobj/get doc "score")] + {:id (gobj/get doc "id") + :page (gobj/get fields zvec-page-field) + :vector-title (gobj/get fields zvec-title-field) + :vector-score (if (number? distance) + (/ 1 (+ 1 distance)) + 0.0)})) + +(defn- vector-metadata-path + [path] + (node-path/join path "metadata.json")) + +(defn- read-vector-metadata + [path] + (let [metadata-path (vector-metadata-path path)] + (when (.existsSync node-fs metadata-path) + (-> (.readFileSync node-fs metadata-path "utf8") + js/JSON.parse + (js->clj :keywordize-keys true))))) + +(defn- write-vector-metadata! + [path metadata] + (.mkdirSync node-fs path #js {:recursive true}) + (.writeFileSync node-fs + (vector-metadata-path path) + (js/JSON.stringify (clj->js metadata)) + "utf8")) + +(def ^:private vector-page-filter-topk-multipliers [4 16 64]) + +(defn- vector-query-topks + [limit page] + (let [limit (or limit 100)] + (if page + (mapv #(* limit %) vector-page-filter-topk-multipliers) + [limit]))) + +(defn- query-zvec + [collection embedding topk] + (.querySync ^js collection + #js {:fieldName zvec-vector-field + :topk topk + :vector (clj->js embedding) + :outputFields #js [zvec-page-field zvec-title-field] + :params #js {:indexType (zvec-enum-value "ZVecIndexType" "HNSW") + :ef 300}})) + +(defn- enough-vector-results? + [results limit page] + (or (nil? page) + (>= (count results) limit))) + +(defn- open-vector-index + [{:keys [path dimension]}] + (p/let [_ (ensure-dir! (node-path/dirname path))] + (let [collection* (atom (open-zvec-collection! path dimension)) + reopen! (fn [] + (reset! collection* (open-zvec-collection! path dimension)))] + {:query (fn [embedding limit page] + (let [limit (or limit 100) + topks (vector-query-topks limit page)] + (loop [remaining-topks (seq topks) + latest-results []] + (if-let [topk (first remaining-topks)] + (let [docs (query-zvec @collection* embedding topk) + results (->> (array-seq docs) + (map zvec-result->map) + (filter (fn [result] + (or (nil? page) + (= page (:page result))))) + (take limit) + vec)] + (if (or (enough-vector-results? results limit page) + (nil? (next remaining-topks))) + results + (recur (next remaining-topks) results))) + latest-results)))) + :upsert! (fn [docs] + (.upsertSync ^js @collection* (clj->js (mapv zvec-doc docs))) + nil) + :delete! (fn [ids] + (.deleteSync ^js @collection* (clj->js (vec ids))) + nil) + :truncate! (fn [] + (.destroySync ^js @collection*) + (reopen!) + nil) + :metadata (fn [] + (read-vector-metadata path)) + :set-metadata! (fn [metadata] + (write-vector-metadata! path metadata) + nil) + :close! (fn [] + (.closeSync ^js @collection*) + nil)}))) + (defn- install-opfs-pool [data-dir _sqlite pool-name] (p/let [repo-dir-path (repo-dir data-dir pool-name) @@ -428,58 +682,73 @@ (fs/writeFile kv-path payload "utf8")))})) (defn node-platform - [{:keys [root-dir event-fn write-guard-fn owner-source recreate-lock-fn]}] + [{:keys [root-dir event-fn write-guard-fn owner-source recreate-lock-fn + embedding-endpoint embedding-model-id open-vector-index-fn]}] (let [root-dir (db-lock/resolve-root-dir root-dir) data-dir (db-lock/graphs-dir root-dir) owner-source (db-lock/normalize-owner-source owner-source) - kv (kv-store root-dir)] + embedding-endpoint (resolve-embedding-endpoint embedding-endpoint) + embedding-model-id (resolve-embedding-model-id embedding-model-id) + embedding-dimension (resolve-embedding-dimension embedding-model-id) + open-vector-index-fn (or open-vector-index-fn open-vector-index) + kv (kv-store root-dir) + vector-embedding-enabled? (macos-arm64?)] (p/do! (ensure-dir! root-dir) (ensure-dir! data-dir) - (log/info :db-worker-node-platform {:root-dir root-dir}) - {:env {:publishing? false - :runtime :node - :root-dir root-dir - :owner-source owner-source - :recreate-lock-fn recreate-lock-fn} - :storage {:install-opfs-pool (fn [sqlite-module pool-name] - (install-opfs-pool data-dir sqlite-module pool-name)) - :list-graphs (fn [] (list-graphs data-dir)) - :db-exists? (fn [graph] (db-exists? data-dir graph)) - :resolve-db-path (fn [_repo pool path] - (pool-path pool path)) - :export-file export-file - :import-db (fn [pool path data] (import-db write-guard-fn pool path data)) - :remove-vfs! (fn [pool] (remove-vfs! pool)) - :read-text! (fn [path] (read-text! data-dir path)) - :write-text! (fn [path text] (write-text! write-guard-fn data-dir path text)) - :write-text-atomic! (fn [path text] (write-text-atomic! write-guard-fn data-dir path text)) - :delete-file! (fn [path] (delete-file! write-guard-fn data-dir path)) - :asset-read-bytes! (fn [repo file-name] - (asset-read-bytes! data-dir repo file-name)) - :asset-write-bytes! (fn [repo file-name payload] - (asset-write-bytes! write-guard-fn data-dir repo file-name payload)) - :asset-stat (fn [repo file-name] - (asset-stat data-dir repo file-name)) - :asset-delete! (fn [repo file-name] - (asset-delete! write-guard-fn data-dir repo file-name))} - :kv {:get (:get kv) - :set! (:set! kv)} - :broadcast {:post-message! (fn [type payload] - (when event-fn - (event-fn type payload)))} - :websocket {:connect websocket-connect} - :sqlite {:init! (fn [] nil) - :open-db (fn [opts] (open-sqlite-db write-guard-fn opts)) - :close-db (fn [db] (.close db)) - :exec (fn [db sql-or-opts] (.exec db sql-or-opts)) - :transaction (fn [db f] (.transaction db f)) - :backup-db (fn [^js db path] - (.backup db path))} - :crypto {:save-secret-text! (fn [key text] - ( + {:env {:publishing? false + :runtime :node + :root-dir root-dir + :owner-source owner-source + :recreate-lock-fn recreate-lock-fn} + :storage {:install-opfs-pool (fn [sqlite-module pool-name] + (install-opfs-pool data-dir sqlite-module pool-name)) + :list-graphs (fn [] (list-graphs data-dir)) + :db-exists? (fn [graph] (db-exists? data-dir graph)) + :resolve-db-path (fn [_repo pool path] + (pool-path pool path)) + :export-file export-file + :import-db (fn [pool path data] (import-db write-guard-fn pool path data)) + :remove-vfs! (fn [pool] (remove-vfs! pool)) + :read-text! (fn [path] (read-text! data-dir path)) + :write-text! (fn [path text] (write-text! write-guard-fn data-dir path text)) + :write-text-atomic! (fn [path text] (write-text-atomic! write-guard-fn data-dir path text)) + :delete-file! (fn [path] (delete-file! write-guard-fn data-dir path)) + :asset-read-bytes! (fn [repo file-name] + (asset-read-bytes! data-dir repo file-name)) + :asset-write-bytes! (fn [repo file-name payload] + (asset-write-bytes! write-guard-fn data-dir repo file-name payload)) + :asset-stat (fn [repo file-name] + (asset-stat data-dir repo file-name)) + :asset-delete! (fn [repo file-name] + (asset-delete! write-guard-fn data-dir repo file-name))} + :kv {:get (:get kv) + :set! (:set! kv)} + :broadcast {:post-message! (fn [type payload] + (when event-fn + (event-fn type payload)))} + :websocket {:connect websocket-connect} + :sqlite {:init! (fn [] nil) + :open-db (fn [opts] (open-sqlite-db write-guard-fn opts)) + :close-db (fn [db] (.close db)) + :exec (fn [db sql-or-opts] (.exec db sql-or-opts)) + :transaction (fn [db f] (.transaction db f)) + :backup-db (fn [^js db path] + (.backup db path))} + :crypto {:save-secret-text! (fn [key text] + (terms [q] @@ -535,6 +549,162 @@ DROP TRIGGER IF EXISTS blocks_au; (string/join " ")) title))) +(def ^:private vector-context-parent-depth 3) +(def ^:private vector-context-child-limit 2) +(def ^:private vector-context-segment-max-length 320) + +(defn- truncate-vector-context-segment + [text] + (let [text (str text)] + (if (> (count text) vector-context-segment-max-length) + (subs text 0 vector-context-segment-max-length) + text))) + +(defn- vector-context-title + [block] + (let [title (some-> (:block/title block) + str + string/trim)] + (when-not (string/blank? title) + (truncate-vector-context-segment title)))) + +(defn- vector-context-segment + [label text] + (when-not (string/blank? text) + (str label ": " text))) + +(defn- vector-context-page-title + [block] + (vector-context-title (:block/page block))) + +(defn- vector-context-parent-path + [block] + (->> (loop [parent (:block/parent block) + result []] + (cond + (nil? parent) + result + + (ldb/page? parent) + result + + (>= (count result) vector-context-parent-depth) + result + + :else + (recur (:block/parent parent) (conj result parent)))) + reverse + (keep vector-context-title) + (string/join " > "))) + +(defn- vector-context-block-id + [block] + (or (:db/id block) (:block/uuid block))) + +(defn- same-vector-context-block? + [a b] + (let [a-id (vector-context-block-id a)] + (and a-id + (= a-id (vector-context-block-id b))))) + +(defn- vector-context-siblings + [block] + (some->> (:block/_parent (:block/parent block)) + seq + ldb/sort-by-order + vec)) + +(defn- vector-context-sibling + [block offset] + (let [siblings (vector-context-siblings block) + idx (some->> siblings + (keep-indexed (fn [i sibling] + (when (same-vector-context-block? sibling block) + i))) + first) + sibling-idx (when idx (+ idx offset))] + (when (and sibling-idx + (<= 0 sibling-idx) + (< sibling-idx (count siblings))) + (nth siblings sibling-idx)))) + +(defn- vector-context-child-titles + [block] + (some->> (:block/_parent block) + seq + ldb/sort-by-order + (take vector-context-child-limit) + (keep vector-context-title) + (string/join " | "))) + +(defn- vector-context-child-titles-from-cache + [children-by-parent-id block] + (some->> (get children-by-parent-id (vector-context-block-id block)) + seq + (take vector-context-child-limit) + (keep vector-context-title) + (string/join " | "))) + +(defn- vector-context-children-by-parent-id + [blocks] + (let [children-by-parent-id (reduce (fn [result block] + (if-let [parent-id (some-> (:block/parent block) + vector-context-block-id)] + (update result parent-id (fnil conj []) block) + result)) + {} + blocks)] + (into {} + (map (fn [[parent-id children]] + [parent-id (vec (ldb/sort-by-order children))])) + children-by-parent-id))) + +(defn- vector-context-neighbor-title-by-id + [children-by-parent-id] + (reduce-kv + (fn [result _parent-id children] + (reduce (fn [result [idx child]] + (let [block-id (vector-context-block-id child)] + (if block-id + (assoc result block-id + {:previous-title (vector-context-title (get children (dec idx))) + :next-title (vector-context-title (get children (inc idx)))}) + result))) + result + (map-indexed vector children))) + {} + children-by-parent-id)) + +(defn build-vector-context-cache + [blocks] + (let [children-by-parent-id (vector-context-children-by-parent-id blocks)] + {:children-by-parent-id children-by-parent-id + :neighbor-title-by-id (vector-context-neighbor-title-by-id children-by-parent-id)})) + +(defn- block->vector-title + ([block title] + (block->vector-title nil block title)) + ([context block title] + (let [block-id (vector-context-block-id block) + neighbor-titles (get-in context [:neighbor-title-by-id block-id]) + previous-title (if context + (:previous-title neighbor-titles) + (vector-context-title (vector-context-sibling block -1))) + next-title (if context + (:next-title neighbor-titles) + (vector-context-title (vector-context-sibling block 1))) + child-titles (if context + (vector-context-child-titles-from-cache (:children-by-parent-id context) block) + (vector-context-child-titles block))] + (->> [(vector-context-segment "Page" (vector-context-page-title block)) + (vector-context-segment "Path" (vector-context-parent-path block)) + (vector-context-segment "Previous" previous-title) + (vector-context-segment "Block" (truncate-vector-context-segment title)) + (vector-context-segment "Children" child-titles) + (vector-context-segment "Next" next-title)] + (keep identity) + (string/join "\n"))))) + (defn- block-result-title [block] (db-content/recur-replace-uuid-in-block-title block)) @@ -551,9 +721,8 @@ DROP TRIGGER IF EXISTS blocks_au; first)] (select-keys alias [:block/uuid :block/title]))))) -(defn block->index - "Convert a block to the index for searching" - [{:block/keys [uuid page title] :as block}] +(defn- block->index* + [context {:block/keys [uuid page title] :as block}] (when-not (or (ldb/closed-value? block) (and (string? title) (> (count title) 10000)) @@ -563,11 +732,22 @@ DROP TRIGGER IF EXISTS blocks_au; (when uuid {:id (str uuid) :page (str (or (:block/uuid page) uuid)) - :title (if (page-or-object? block) title (sanitize title))})) + :title (if (page-or-object? block) title (sanitize title)) + :vector-title (block->vector-title context block title)})) (catch :default e (prn "Error: failed to run block->index on block " (:db/id block)) (js/console.error e))))) +(defn block->index + "Convert a block to the index for searching" + [block] + (block->index* nil block)) + +(defn block->index-with-context + "Convert a block with a precomputed vector context cache." + [context block] + (block->index* context block)) + (def ^:private search-result-block-key ::block) (def ^:private search-result-pull-selector @@ -599,39 +779,171 @@ DROP TRIGGER IF EXISTS blocks_au; (into {})) {}))) -;; Combine and re-rank keyword results +(defn- merge-score + [left right score-key] + (let [left-score (get left score-key) + right-score (get right score-key)] + (cond + (and (number? left-score) (number? right-score)) (max left-score right-score) + (some? right-score) right-score + :else left-score))) + +(defn- merge-search-result + [left right] + (merge left right + {:keyword-score (merge-score left right :keyword-score) + :vector-score (merge-score left right :vector-score)})) + +(defn- unique-search-results + [results] + (->> (or results []) + (reduce (fn [{:keys [by-id] :as acc} {:keys [id] :as result}] + (if (nil? id) + acc + (cond-> acc + (not (contains? by-id id)) + (update :order conj id) + + true + (update :by-id + (fn [m] + (update m id + #(if % + (merge-search-result % result) + result))))))) + {:order [] + :by-id {}}) + ((fn [{:keys [order by-id]}] + (mapv by-id order))))) + +(defn reciprocal-rank-fusion + ([result-lists] + (reciprocal-rank-fusion result-lists nil)) + ([result-lists weights] + (let [scores (reduce-kv + (fn [scores list-idx results] + (let [weight (or (get weights list-idx) 1.0)] + (reduce-kv + (fn [scores rank {:keys [id] :as result}] + (if id + (update scores id + (fn [{existing-result :result + :keys [score top-rank]}] + {:result (or existing-result result) + :score (+ (or score 0) + (/ weight (+ rrf-k rank 1))) + :top-rank (min (or top-rank js/Infinity) rank)})) + scores)) + scores + (vec results)))) + {} + (vec result-lists))] + (->> scores + vals + (sort-by (juxt (comp - :score) + :top-rank + (comp :id :result))) + (mapv (fn [{:keys [result score]}] + (assoc result :rrf-score score))))))) + +(defn- rrf-score-by-id + [result-lists weights] + (reduce-kv + (fn [scores list-idx results] + (let [weight (or (get weights list-idx) 1.0)] + (reduce-kv + (fn [scores rank {:keys [id]}] + (if id + (update scores id (fnil + 0) (/ weight (+ rrf-k rank 1))) + scores)) + scores + (vec results)))) + {} + (vec result-lists))) + +(defn- matched-term-set + [text terms] + (if (string/blank? text) + #{} + (->> (find-matches text terms) + (map (comp string/lower-case :term)) + set))) + +(defn- vector-term-match-score + [q result block] + (if (and (not (string/blank? q)) + (:vector-score result)) + (let [terms (vec (query->terms q)) + title-matches (matched-term-set (or (:title result) (:block/title block)) terms) + context-matches (matched-term-set (:vector-title result) terms) + score (->> terms + (map-indexed + (fn [idx term] + (let [term (string/lower-case term)] + (cond + (contains? title-matches term) + (if (zero? idx) + primary-title-term-match-boost + title-term-match-boost) + + (contains? context-matches term) + context-term-match-boost + + :else + 0)))) + (reduce + 0))] + (min max-vector-term-match-boost score)) + 0)) + +;; Combine and re-rank keyword and vector results (defn combine-results - [db keyword-results] - (let [unique-results (loop [seen #{} - results [] - remaining (seq keyword-results)] - (if-let [{:keys [id] :as result} (first remaining)] - (if (or (nil? id) (contains? seen id)) - (recur seen results (next remaining)) - (recur (conj seen id) (conj results result) (next remaining))) - results)) - block-by-id (pull-search-result-blocks db unique-results) - merged (keep (fn [{:keys [id] :as result}] - (let [block (get block-by-id id)] - (when-not (ldb/hidden? block) - (let [keyword-score (if (ldb/page? block) - (+ (or (:keyword-score result) 0.0) 2) - (or (:keyword-score result) 0.0)) - combined-score (+ keyword-score - (cond - (ldb/page? block) - 0.02 - (:block/tags block) - 0.01 - :else - 0))] - (assoc result - search-result-block-key block - :combined-score combined-score - :keyword-score keyword-score))))) - unique-results) - sorted-result (sort-by :combined-score #(compare %2 %1) merged)] - sorted-result)) + ([db keyword-results] + (combine-results db keyword-results nil)) + ([db keyword-results vector-results] + (combine-results db keyword-results vector-results nil)) + ([db keyword-results vector-results q] + (let [keyword-results (vec (or keyword-results [])) + vector-results (vec (or vector-results [])) + use-rrf? (seq vector-results) + fused-score-by-id (when use-rrf? + (rrf-score-by-id [keyword-results vector-results] + [keyword-rrf-weight vector-rrf-weight])) + unique-results (unique-search-results (concat keyword-results vector-results)) + block-by-id (pull-search-result-blocks db unique-results) + merged (keep (fn [{:keys [id] :as result}] + (let [block (get block-by-id id)] + (when-not (ldb/hidden? block) + (let [keyword-score (if (ldb/page? block) + (+ (or (:keyword-score result) 0.0) 2) + (or (:keyword-score result) 0.0)) + vector-score (or (:vector-score result) 0.0) + base-score (if use-rrf? + (or (get fused-score-by-id id) 0.0) + keyword-score) + vector-match-score (if use-rrf? + (vector-term-match-score q result block) + 0) + combined-score (+ base-score + vector-match-score + (* source-score-tie-break-weight + (+ keyword-score vector-score)) + (if-not use-rrf? + (cond + (ldb/page? block) + 0.02 + (:block/tags block) + 0.01 + :else + 0) + 0))] + (assoc result + search-result-block-key block + :title (or (:title result) (:block/title block)) + :combined-score combined-score + :keyword-score keyword-score))))) + unique-results) + sorted-result (sort-by :combined-score #(compare %2 %1) merged)] + sorted-result))) (defn- code-block? [code-class block] @@ -658,8 +970,7 @@ DROP TRIGGER IF EXISTS blocks_au; (or (not (ldb/built-in? block)) (not (ldb/private-built-in-page? block)) (ldb/class? block)) - (or (not (ldb/built-in? block)) - (ldb/class? block)))) + (not (ldb/built-in? block)))) (or (not code-only?) (code-block? code-class block)))) @@ -673,12 +984,14 @@ DROP TRIGGER IF EXISTS blocks_au; (select-keys [:block/uuid :block/title])) alias-match (matched-alias q block) page-or-object-result? (page-or-object? block) - result-title (if page-or-object-result? (block-result-title block) title) + result-title (if page-or-object-result? + (block-result-title block) + (or title (:block/title block))) display-title (if (:enable-snippet? option) (ensure-highlighted-snippet snippet result-title q) (if page-or-object-result? result-title - (or snippet title))) + (or snippet result-title))) block-page (or (:block/uuid (:block/page block)) (when (and page (common-util/uuid-string? page)) @@ -721,6 +1034,23 @@ DROP TRIGGER IF EXISTS blocks_au; (d/entity @conn [:block/uuid block-id]))] (include-search-block? conn block code-class option)))) +(defn- vector-search-blocks + [vector-index {:keys [limit page query-embedding]}] + (when-let [query-fn (:query vector-index)] + (when (seq query-embedding) + (let [limit' (min max-vector-search-results + (or limit max-vector-search-results))] + (->> (query-fn query-embedding limit' page) + (take limit') + (keep (fn [{:keys [id page vector-score score] :as result}] + (let [vector-score' (or vector-score score 0.0)] + (when (and id (> vector-score' min-vector-search-score)) + (cond-> {:id id + :vector-score vector-score'} + page (assoc :page page) + (:title result) (assoc :title (:title result)) + (:vector-title result) (assoc :vector-title (:vector-title result)))))))))))) + (defn search-blocks "Options: * :page - the page to specifically search on @@ -730,54 +1060,90 @@ DROP TRIGGER IF EXISTS blocks_au; * :dev? - Allow all nodes to be seen for development. Defaults to false * :code-only? - Whether to return only code blocks. Defaults to false * :built-in? - Whether to return public built-in nodes for db graphs. Defaults to false" - [conn search-db q {:keys [limit search-limit page enable-snippet? page-only? code-only? include-matched-count?] - :as option - :or {enable-snippet? true}}] - (when-not (string/blank? q) - (let [option (assoc option :enable-snippet? enable-snippet?) - match-input (get-match-input q) - non-match-input (when (<= (count q) 2) - (str "%" (string/replace q #"\s+" "%") "%")) - limit (or limit 100) - limit-p (or search-limit limit) - exact-title-result (when (and (not page-only?) - (exact-title-query? q)) - (search-blocks-exact-title-aux search-db q page limit-p)) - enough-exact-title-results? (>= (count exact-title-result) limit-p) - ;; don't use sqlite snippet function anymore, all snippets will be handled by ensure-highlighted-snippet - select "select id, page, title, rank from blocks_fts where " - pg-sql (if page "page = ? and" "") - match-sql (if (ns-util/namespace-page? q) - (str select pg-sql " title match ? or title match ? limit ?") - (str select pg-sql " title match ? limit ?")) - non-match-sql (str select pg-sql " title like ? limit ?") - matched-result (when (and (not page-only?) - (not enough-exact-title-results?)) - (search-blocks-aux search-db match-sql q match-input page limit-p (ns-util/namespace-page? q))) - non-match-result (when (and (not page-only?) non-match-input) - (->> (search-blocks-aux search-db non-match-sql q non-match-input page limit-p) - (map (fn [result] - (assoc result :keyword-score (fuzzy/score q (:title result))))))) - skip-fuzzy? (or enough-exact-title-results? - (and (multi-term-query? q) - (seq matched-result))) - fuzzy-result (when-not skip-fuzzy? - (search-blocks-fuzzy-aux search-db q page limit)) - ;; _ (prn :debug "Search results before combine:" enable-snippet? (map :snippet matched-result)) - ;; _ (doseq [item (concat fuzzy-result matched-result)] - ;; (prn :debug :keyword-search-result item)) - combined-result (combine-results @conn (concat exact-title-result fuzzy-result matched-result non-match-result)) - code-class (when code-only? - (d/entity @conn :logseq.class/Code-block)) - matched-count (when include-matched-count? - (count (filter #(search-result-visible? conn code-class option %) combined-result))) - result (->> combined-result - (common-util/distinct-by :id) - (keep #(search-result->block-result conn q code-class option %)))] - (if include-matched-count? - {:items (take limit result) - :matched-count matched-count} - (take limit result))))) + ([conn search-db q option] + (search-blocks conn search-db nil q option)) + ([conn search-db vector-index q {:keys [limit search-limit page enable-snippet? page-only? code-only? include-matched-count?] + :as option + :or {enable-snippet? true}}] + (when-not (string/blank? q) + (let [option (assoc option :enable-snippet? enable-snippet?) + match-input (get-match-input q) + non-match-input (when (<= (count q) 2) + (str "%" (string/replace q #"\s+" "%") "%")) + limit (or limit 100) + limit-p (or search-limit limit) + exact-title-result (when (and (not page-only?) + (exact-title-query? q)) + (search-blocks-exact-title-aux search-db q page limit-p)) + enough-exact-title-results? (>= (count exact-title-result) limit-p) + ;; don't use sqlite snippet function anymore, all snippets will be handled by ensure-highlighted-snippet + select "select id, page, title, rank from blocks_fts where " + pg-sql (if page "page = ? and" "") + match-sql (if (ns-util/namespace-page? q) + (str select pg-sql " title match ? or title match ? limit ?") + (str select pg-sql " title match ? limit ?")) + non-match-sql (str select pg-sql " title like ? limit ?") + matched-result (when (and (not page-only?) + (not enough-exact-title-results?)) + (search-blocks-aux search-db match-sql q match-input page limit-p (ns-util/namespace-page? q))) + non-match-result (when (and (not page-only?) non-match-input) + (->> (search-blocks-aux search-db non-match-sql q non-match-input page limit-p) + (map (fn [result] + (assoc result :keyword-score (fuzzy/score q (:title result))))))) + skip-fuzzy? (or enough-exact-title-results? + (and (multi-term-query? q) + (seq matched-result))) + fuzzy-result (when-not skip-fuzzy? + (search-blocks-fuzzy-aux search-db q page limit)) + vector-result (when-not page-only? + (vector-search-blocks vector-index {:limit limit-p + :page page + :query-embedding (:query-embedding option)})) + ;; _ (prn :debug "Search results before combine:" enable-snippet? (map :snippet matched-result)) + ;; _ (doseq [item (concat fuzzy-result matched-result)] + ;; (prn :debug :keyword-search-result item)) + combined-result (combine-results @conn + (concat exact-title-result fuzzy-result matched-result non-match-result) + vector-result + q) + code-class (when code-only? + (d/entity @conn :logseq.class/Code-block)) + matched-count (when include-matched-count? + (count (filter #(search-result-visible? conn code-class option %) combined-result))) + result (->> combined-result + (common-util/distinct-by :id) + (keep #(search-result->block-result conn q code-class option %)))] + (if include-matched-count? + {:items (take limit result) + :matched-count matched-count} + (take limit result)))))) + +(defn upsert-vector-blocks! + [vector-index blocks] + (when-let [upsert-fn (:upsert! vector-index)] + (let [docs (->> blocks + (keep (fn [{:keys [id page embedding vector-title]}] + (when (and id page (seq embedding)) + (cond-> {:id id + :page page + :embedding embedding} + vector-title + (assoc :vector-title vector-title))))) + vec)] + (when (seq docs) + (doseq [batch (partition-all vector-upsert-batch-size docs)] + (upsert-fn (vec batch))))))) + +(defn delete-vector-blocks! + [vector-index ids] + (when-let [delete-fn (:delete! vector-index)] + (when (seq ids) + (delete-fn ids)))) + +(defn truncate-vector-index! + [vector-index] + (when-let [truncate-fn (:truncate! vector-index)] + (truncate-fn))) (defn truncate-table! [db] @@ -795,8 +1161,26 @@ DROP TRIGGER IF EXISTS blocks_au; (defn build-blocks-indice [db] - (->> (get-all-blocks db) - (keep block->index))) + (let [blocks (vec (get-all-blocks db)) + context (build-vector-context-cache blocks)] + (->> blocks + (keep #(block->index* context %))))) + +(defn expand-vector-context-blocks + [blocks] + (->> blocks + (mapcat (fn [block] + (let [parent (:block/parent block)] + (concat [block + parent + (vector-context-sibling block -1) + (vector-context-sibling block 1)] + (some->> (:block/_parent block) + seq + ldb/sort-by-order))))) + (remove nil?) + (remove hidden-entity?) + (common-util/distinct-by vector-context-block-id))) (defn- get-blocks-from-datoms-impl [{:keys [db-after db-before]} datoms] @@ -847,7 +1231,7 @@ DROP TRIGGER IF EXISTS blocks_au; (remove nil?))))] (when (seq datoms) (let [ref-affecting-attrs #{:block/uuid :block/name :block/title :block/properties :block/alias} - visibility-affecting-attrs #{:logseq.property/deleted-at :block/parent :block/page} + visibility-affecting-attrs #{:logseq.property/deleted-at :block/parent :block/page :block/order} ref-eids (->> datoms (filter #(contains? ref-affecting-attrs (:a %))) (mapcat (fn [{:keys [a e v]}] @@ -870,8 +1254,11 @@ DROP TRIGGER IF EXISTS blocks_au; (let [data (:tx-data tx-report) datoms (filter (fn [datom] - ;; Capture direct changes on searchable block content, refs, and aliases. - (contains? #{:block/uuid :block/name :block/title :block/properties :block/alias} (:a datom))) + ;; Capture direct changes on searchable content and outline structure + ;; because vector embeddings include parent, child, and sibling context. + (contains? #{:block/uuid :block/name :block/title :block/properties :block/alias + :block/parent :block/page :block/order} + (:a datom))) data)] (when (seq datoms) (get-blocks-from-datoms-impl tx-report datoms)))) @@ -881,7 +1268,8 @@ DROP TRIGGER IF EXISTS blocks_au; (let [{:keys [blocks-to-add blocks-to-remove]} (get-affected-blocks tx-report)] ;; update block indice (when (or (seq blocks-to-add) (seq blocks-to-remove)) - (let [blocks-to-add' (keep block->index blocks-to-add) + (let [blocks-to-add (expand-vector-context-blocks blocks-to-add) + blocks-to-add' (keep block->index blocks-to-add) blocks-to-remove (set (concat (map (comp str :block/uuid) blocks-to-remove) (->> (set/difference diff --git a/src/main/frontend/worker/search_benchmark.cljs b/src/main/frontend/worker/search_benchmark.cljs new file mode 100644 index 000000000000..37950b62264f --- /dev/null +++ b/src/main/frontend/worker/search_benchmark.cljs @@ -0,0 +1,106 @@ +(ns frontend.worker.search-benchmark + "Small benchmark helpers for comparing worker search result quality." + (:require [promesa.core :as p])) + +(defn- result-id + [result] + (if (map? result) + (:id result) + result)) + +(defn- hits-within + [result-ids expected-ids k] + (let [top-ids (set (take k result-ids))] + (count (filter top-ids expected-ids)))) + +(defn score-results + [results expected-ids top-k] + (let [result-ids (mapv result-id results) + expected-ids (vec expected-ids) + expected-set (set expected-ids) + matched-ids (filterv (set result-ids) expected-ids) + hits-at-k (hits-within result-ids expected-ids top-k) + precision-denominator (min top-k (count expected-ids)) + precision-at-k (if (pos? precision-denominator) + (/ hits-at-k precision-denominator) + 0) + recall (if (seq expected-ids) + (/ (count matched-ids) (count expected-ids)) + 0) + recall-at-1 (if (seq expected-ids) + (/ (hits-within result-ids expected-ids 1) (count expected-ids)) + 0) + recall-at-3 (if (seq expected-ids) + (/ (hits-within result-ids expected-ids 3) (count expected-ids)) + 0) + recall-at-5 (if (seq expected-ids) + (/ (hits-within result-ids expected-ids 5) (count expected-ids)) + 0) + first-match-rank (some (fn [[idx id]] + (when (expected-set id) + (inc idx))) + (map-indexed vector result-ids)) + mrr (if first-match-rank + (/ 1 first-match-rank) + 0) + f1 (if (pos? (+ precision-at-k recall)) + (/ (* 2 precision-at-k recall) + (+ precision-at-k recall)) + 0)] + {:precision-at-k precision-at-k + :recall recall + :recall-at-1 recall-at-1 + :recall-at-3 recall-at-3 + :recall-at-5 recall-at-5 + :mrr mrr + :f1 f1 + :hits-at-k hits-at-k + :matched-ids matched-ids + :unmatched-expected-ids (filterv (complement (set matched-ids)) expected-ids)})) + +(defn- run-backend-case + [{search :search backend-id :id} {:keys [expected-ids expected-in-top-k] :as benchmark-case}] + (let [start (.now js/Date)] + (-> (search benchmark-case) + (p/then (fn [results] + (assoc (score-results results expected-ids (or expected-in-top-k 5)) + :case-id (:id benchmark-case) + :backend-id backend-id + :query (:query benchmark-case) + :latency-ms (- (.now js/Date) start) + :result-ids (mapv result-id results))))))) + +(defn- avg + [values] + (let [values (vec values)] + (if (seq values) + (/ (reduce + values) (count values)) + 0))) + +(defn- summarize-backend + [results] + {:avg-precision-at-k (avg (map :precision-at-k results)) + :avg-recall (avg (map :recall results)) + :avg-recall-at-1 (avg (map :recall-at-1 results)) + :avg-recall-at-3 (avg (map :recall-at-3 results)) + :avg-recall-at-5 (avg (map :recall-at-5 results)) + :avg-mrr (avg (map :mrr results)) + :avg-f1 (avg (map :f1 results)) + :avg-latency-ms (avg (map :latency-ms results))}) + +(defn summarize-results + [results] + (->> results + (group-by :backend-id) + (map (fn [[backend-id backend-results]] + [backend-id (summarize-backend backend-results)])) + (into {}))) + +(defn run-benchmark + [cases backends] + (p/let [results (p/all + (for [benchmark-case cases + backend backends] + (run-backend-case backend benchmark-case)))] + {:results (vec results) + :summary (summarize-results results)})) diff --git a/src/main/frontend/worker/state.cljs b/src/main/frontend/worker/state.cljs index b79e7272bace..d33a653e7976 100644 --- a/src/main/frontend/worker/state.cljs +++ b/src/main/frontend/worker/state.cljs @@ -46,6 +46,8 @@ (defonce *sqlite (atom nil)) ;; repo -> {:db conn :search conn :client-ops conn} (defonce *sqlite-conns (atom {})) +;; repo -> platform vector search index +(defonce *vector-indexes (atom {})) ;; repo -> conn (defonce *datascript-conns (atom nil)) @@ -62,6 +64,10 @@ (assert (contains? #{:db :search :client-ops} which-db) which-db) (get-in @*sqlite-conns [repo which-db]))) +(defn get-vector-index + [repo] + (get @*vector-indexes repo)) + (defn get-datascript-conn [repo] (get @*datascript-conns repo)) diff --git a/src/main/logseq/cli/server.cljs b/src/main/logseq/cli/server.cljs index 9364c9b9c5c6..02c6f543bc0f 100644 --- a/src/main/logseq/cli/server.cljs +++ b/src/main/logseq/cli/server.cljs @@ -185,12 +185,14 @@ (assoc payload :http-status status))) (defn- spawn-server! - [{:keys [repo root-dir owner-source create-empty-db?]}] + [{:keys [repo root-dir owner-source create-empty-db? embedding-endpoint embedding-model-id]}] (daemon/spawn-server! {:script (db-worker-script-path) :repo repo :root-dir root-dir :owner-source owner-source - :create-empty-db? create-empty-db?})) + :create-empty-db? create-empty-db? + :embedding-endpoint embedding-endpoint + :embedding-model-id embedding-model-id})) (defn- rewrite-lock-owner-source! [path lock owner-source] @@ -289,7 +291,9 @@ (spawn-server! {:repo repo :root-dir root-dir :owner-source requester-owner - :create-empty-db? (:create-empty-db? config)}))) + :create-empty-db? (:create-empty-db? config) + :embedding-endpoint (:embedding-endpoint config) + :embedding-model-id (:embedding-model-id config)}))) (-> (profile/time! profile-session "server.wait-lock" (fn [] diff --git a/src/main/logseq/db_worker/daemon.cljs b/src/main/logseq/db_worker/daemon.cljs index 5c03bed1b984..b0d3ca2b2b21 100644 --- a/src/main/logseq/db_worker/daemon.cljs +++ b/src/main/logseq/db_worker/daemon.cljs @@ -222,11 +222,13 @@ :interval-ms 50})) (defn spawn-server! - [{:keys [script repo root-dir owner-source create-empty-db?]}] + [{:keys [script repo root-dir owner-source create-empty-db? embedding-endpoint embedding-model-id]}] (let [owner-source (normalize-owner-source owner-source) detached? (not= owner-source :electron) args (clj->js (cond-> [script "--repo" repo "--root-dir" root-dir "--owner-source" (name owner-source)] - create-empty-db? (conj "--create-empty-db"))) + create-empty-db? (conj "--create-empty-db") + (seq embedding-endpoint) (conj "--embedding-endpoint" embedding-endpoint) + (seq embedding-model-id) (conj "--embedding-model-id" embedding-model-id))) env (js/Object.assign #js {} (.-env js/process) #js {:ELECTRON_RUN_AS_NODE "1"})] (if-not script (do diff --git a/src/test/electron/embedding_server_test.cljs b/src/test/electron/embedding_server_test.cljs new file mode 100644 index 000000000000..9c90b5baacb4 --- /dev/null +++ b/src/test/electron/embedding_server_test.cljs @@ -0,0 +1,228 @@ +(ns electron.embedding-server-test + (:require ["fs" :as fs] + ["path" :as node-path] + [cljs.test :refer [async deftest is]] + [clojure.string :as string] + [electron.embedding-server :as embedding-server] + [promesa.core :as p])) + +(defn- fake-app + [user-data-dir packaged?] + #js {:isPackaged packaged? + :getPath (fn [path-name] + (case path-name + "userData" user-data-dir))}) + +(defn- fake-runtime + [{:keys [existing-paths allocated-port run-command! wait-ready!]}] + (let [ensured-dirs (atom []) + commands (atom []) + writes (atom []) + spawns (atom []) + events (atom []) + env (atom {}) + killed? (atom false) + proc #js {:kill (fn [] + (reset! killed? true) + true)}] + {:runtime {:platform "darwin" + :arch "x64" + :dirname "/repo/static" + :resources-path "/app/Contents/Resources" + :python-command "python3" + :exists? #(contains? existing-paths %) + :ensure-dir! #(swap! ensured-dirs conj %) + :find-port! (fn [_host] + (p/resolved (or allocated-port 54321))) + :logger {:debug (fn [& _args]) + :info (fn [& _args]) + :warn (fn [& _args]) + :error (fn [& _args])} + :set-env! (fn [k v] + (swap! events conj [:set-env k v]) + (swap! env assoc k v)) + :run-command! (or run-command! + (fn [cmd args opts] + (swap! commands conj {:cmd cmd + :args args + :cwd (:cwd opts)}) + (p/resolved nil))) + :wait-ready! (or wait-ready! + (fn [endpoint] + (swap! events conj [:wait-ready endpoint]) + (p/resolved nil))) + :write-file! (fn [file content] + (swap! writes conj {:file file + :content content})) + :spawn-server! (fn [cfg] + (swap! events conj [:spawn-server (:port cfg)]) + (swap! spawns conj (select-keys cfg [:runtime-dir + :venv-dir + :venv-python + :sidecar-dir + :script-path + :host + :port + :model-id])) + proc)} + :ensured-dirs ensured-dirs + :commands commands + :writes writes + :spawns spawns + :events events + :env env + :killed? killed?})) + +(deftest start-skips-unsupported-platforms + (async done + (let [{:keys [runtime commands spawns]} (fake-runtime {:existing-paths #{}}) + app (fake-app "/users/me/logseq" false)] + (-> (p/let [result (embedding-server/start! app (assoc runtime + :platform "linux" + :arch "x64"))] + (is (= :skipped result)) + (is (empty? @commands)) + (is (empty? @spawns))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest start-allocates-port-creates-local-venv-installs-deps-and-spawns-server + (async done + (embedding-server/stop!) + (let [{:keys [runtime ensured-dirs commands writes spawns env killed?]} (fake-runtime {:existing-paths #{} + :allocated-port 56789}) + app (fake-app "/users/me/logseq" false) + runtime-dir "/users/me/logseq/embedding-server" + venv-dir "/users/me/logseq/embedding-server/.venv" + venv-python "/users/me/logseq/embedding-server/.venv/bin/python" + deps-stamp "/users/me/logseq/embedding-server/deps-v1.ok" + script "/repo/sidecar/embedding_server.py"] + (-> (p/let [result (embedding-server/start! app runtime)] + (is (= :started result)) + (is (= [runtime-dir] @ensured-dirs)) + (is (= [{:cmd "python3" + :args ["-m" "venv" ".venv"] + :cwd runtime-dir} + {:cmd venv-python + :args ["-m" "pip" "install" "sentence-transformers"] + :cwd runtime-dir}] + @commands)) + (is (= [{:file deps-stamp + :content "sentence-transformers\n"}] + @writes)) + (is (= [{:runtime-dir runtime-dir + :venv-dir venv-dir + :venv-python venv-python + :sidecar-dir "/repo/sidecar" + :script-path script + :host "127.0.0.1" + :port 56789 + :model-id "all-MiniLM-L6-v2"}] + @spawns)) + (is (= {"LOGSEQ_EMBEDDINGS_URL" "http://127.0.0.1:56789/v1/embeddings"} + @env)) + (embedding-server/stop!) + (is @killed?)) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest start-sets-embedding-env-after-server-is-ready + (async done + (embedding-server/stop!) + (let [{:keys [runtime events env]} (fake-runtime {:existing-paths #{"/users/me/logseq/embedding-server/.venv/bin/python" + "/users/me/logseq/embedding-server/deps-v1.ok"} + :allocated-port 56789}) + app (fake-app "/users/me/logseq" false)] + (-> (p/let [result (embedding-server/start! app runtime)] + (is (= :started result)) + (is (= [[:set-env "LOGSEQ_EMBEDDINGS_URL" "http://127.0.0.1:56789/v1/embeddings"] + [:spawn-server 56789] + [:wait-ready "http://127.0.0.1:56789/healthz"]] + @events)) + (is (= {"LOGSEQ_EMBEDDINGS_URL" "http://127.0.0.1:56789/v1/embeddings"} + @env)) + (embedding-server/stop!)) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest start-publishes-embedding-env-before-setup-completes + (async done + (embedding-server/stop!) + (let [{:keys [runtime env spawns]} (fake-runtime {:existing-paths #{} + :allocated-port 56789 + :run-command! (fn [_cmd _args _opts] + (p/rejected (js/Error. "venv failed")))}) + app (fake-app "/users/me/logseq" false)] + (-> (embedding-server/start! app runtime) + (p/then (fn [_] + (is false "start should fail"))) + (p/catch (fn [_] + (is (= {"LOGSEQ_EMBEDDINGS_URL" "http://127.0.0.1:56789/v1/embeddings"} + @env)) + (is (empty? @spawns)))) + (p/finally done))))) + +(deftest start-reuses-existing-venv-and-installed-deps-with-allocated-port + (async done + (embedding-server/stop!) + (let [runtime-dir "/users/me/logseq/embedding-server" + venv-python "/users/me/logseq/embedding-server/.venv/bin/python" + deps-stamp "/users/me/logseq/embedding-server/deps-v1.ok" + {:keys [runtime commands spawns env]} (fake-runtime {:existing-paths #{venv-python deps-stamp} + :allocated-port 45678}) + app (fake-app "/users/me/logseq" true)] + (-> (p/let [result (embedding-server/start! app runtime)] + (is (= :started result)) + (is (empty? @commands)) + (is (= [{:runtime-dir runtime-dir + :venv-dir "/users/me/logseq/embedding-server/.venv" + :venv-python venv-python + :sidecar-dir "/app/Contents/Resources/sidecar" + :script-path "/app/Contents/Resources/sidecar/embedding_server.py" + :host "127.0.0.1" + :port 45678 + :model-id "all-MiniLM-L6-v2"}] + @spawns)) + (is (= {"LOGSEQ_EMBEDDINGS_URL" "http://127.0.0.1:45678/v1/embeddings"} + @env)) + (embedding-server/stop!)) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest start-default-port-allocator-uses-node-net + (async done + (embedding-server/stop!) + (let [_runtime-dir "/users/me/logseq/embedding-server" + venv-python "/users/me/logseq/embedding-server/.venv/bin/python" + deps-stamp "/users/me/logseq/embedding-server/deps-v1.ok" + {:keys [runtime spawns env]} (fake-runtime {:existing-paths #{venv-python deps-stamp}}) + app (fake-app "/users/me/logseq" true) + runtime (dissoc runtime :find-port!)] + (-> (p/let [result (embedding-server/start! app runtime) + port (:port (first @spawns))] + (is (= :started result)) + (is (integer? port)) + (is (<= 1 port 65535)) + (is (= {"LOGSEQ_EMBEDDINGS_URL" (str "http://127.0.0.1:" port "/v1/embeddings")} + @env)) + (embedding-server/stop!)) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest electron-builder-bundles-only-sidecar-python-file + (let [repo-root (.cwd js/process) + sidecar-dir (node-path/join repo-root "sidecar") + builder-config (.toString (fs/readFileSync (node-path/join repo-root + "resources" + "electron-builder.yml")) + "utf8") + sidecar-files (when (fs/existsSync sidecar-dir) + (js->clj (fs/readdirSync sidecar-dir)))] + (is (string/includes? builder-config "from: ../sidecar")) + (is (string/includes? builder-config "to: sidecar")) + (is (= ["embedding_server.py"] sidecar-files)))) diff --git a/src/test/frontend/db/query_react_test.cljs b/src/test/frontend/db/query_react_test.cljs index a23fc01e4d1a..09302ff3f362 100644 --- a/src/test/frontend/db/query_react_test.cljs +++ b/src/test/frontend/db/query_react_test.cljs @@ -41,6 +41,16 @@ adds rules that users often use" [?t :block/name ?tag-name]]} {:current-page-fn (constantly current-page)}))) +(deftest query-with-empty-rules-input + (load-test-files [{:page {:block/title "rules-input"} + :blocks [{:block/title "block with empty rules input"}]}]) + (is (= ["block with empty rules input"] + (map :block/title + (custom-query {:query '[:find (pull ?b [*]) + :in $ % + :where + [?b :block/title "block with empty rules input"]]}))))) + ;; TODO: Move this test to inputs-test (deftest resolve-input-for-timestamp-inputs (load-test-files diff --git a/src/test/frontend/persist_db_test.cljs b/src/test/frontend/persist_db_test.cljs index a086ed72df16..a850bd8a58e7 100644 --- a/src/test/frontend/persist_db_test.cljs +++ b/src/test/frontend/persist_db_test.cljs @@ -1,6 +1,7 @@ (ns frontend.persist-db-test (:require [cljs.test :refer [async deftest is use-fixtures]] [electron.ipc :as ipc] + [frontend.common.thread-api :as thread-api] [frontend.config :as config] [frontend.handler.notification :as notification] [frontend.persist-db.browser :as browser] @@ -188,6 +189,58 @@ [& graphs] (mapv (fn [graph] {:url graph}) graphs)) +(deftest search-index-build-progress-normalizes-index-stages-in-ui-state + (let [repo "logseq_db_graph_a" + progress! (get @thread-api/*thread-apis :thread-api/search-index-build-progress) + original-state @state/state] + (try + (reset! state/state (assoc original-state :git/current-repo repo)) + (progress! repo {:status :running + :stage :vector-index + :progress 42 + :processed 420 + :total 1000}) + (is (= {:visible? true + :running? true + :status :running + :repo repo + :stage :search-index + :progress 42 + :processed 420 + :total 1000} + (:search/index-build @state/state))) + (finally + (reset! state/state original-state))))) + +(deftest search-index-build-progress-keeps-completed-build-visible-through-idle + (let [repo "logseq_db_graph_a" + build-id "build-1" + progress! (get @thread-api/*thread-apis :thread-api/search-index-build-progress) + original-state @state/state] + (try + (reset! state/state (assoc original-state :git/current-repo repo)) + (progress! repo {:build-id build-id + :status :completed + :progress 100 + :processed 1 + :total 1}) + (progress! repo {:build-id build-id + :status :idle}) + (is (= {:visible? true + :running? false + :status :completed + :repo repo + :build-id build-id + :stage :search-index + :progress 100 + :processed 1 + :total 1} + (:search/index-build @state/state))) + (finally + (progress! repo {:build-id build-id + :status :running}) + (reset! state/state original-state))))) + (deftest electron-fetch-init-data-starts-remote-runtime (async done (let [ipc-calls (atom []) diff --git a/src/test/frontend/worker/db_core_test.cljs b/src/test/frontend/worker/db_core_test.cljs index ef93b5f5a4e9..658ccb66e818 100644 --- a/src/test/frontend/worker/db_core_test.cljs +++ b/src/test/frontend/worker/db_core_test.cljs @@ -68,13 +68,24 @@ (assert (fn? f) (str "thread api not registered: " k)) f)) +(defn- index (fn [_entity] - {:id "block-1" - :page "page-1" - :title "Hello"})] + search/block->index-with-context (fn [_context _entity] + {:id "block-1" + :page "page-1" + :title "Hello"})] (-> (p/let [_ (build-index! test-repo true) - _ (p/loop [remaining 20] - (if (or (seq @progress-calls) - (zero? remaining)) - nil - (p/let [_ (p/delay 5)] - (p/recur (dec remaining)))))] + _ ( + (restoring-worker-state + (fn [] + (let [repo (str test-repo "-progress-" (random-uuid)) + build-index! #'db-core/index-with-context (fn [_context _entity] + {:id "block-1" + :page "page-1" + :title "Hello"})] + (let [build-id (#'db-core/start-search-index-build! repo)] + (-> (build-index! repo search-db conn build-id) + (p/then (fn [_] + (is @progress-seen-before-rebuild-work? + "Progress should be emitted before rebuild prep starts") + (is (= :running (get-in (first @progress-calls) [:payload :status]))))) + (p/catch (fn [error] + (is false (str error)))))))))) + (p/finally done)))) + +(deftest search-upsert-blocks-does-not-wait-for-vector-embedding-test + (async done + (-> + (restoring-worker-state + (fn [] + (let [upsert-blocks! (get @thread-api/*thread-apis :thread-api/search-upsert-blocks) + sqlite-upserts (atom 0) + vector-upserts (atom []) + block-id (str (random-uuid)) + page-id (str (random-uuid)) + search-db #js {:transaction (fn [f] + (swap! sqlite-upserts inc) + (f #js {:exec (fn [_opts] nil)}))}] + (platform/set-platform! (build-test-platform + {:runtime :node + :embed-texts (fn [_texts] + (js/Promise. (fn [_resolve _reject])))})) + (reset! worker-state/*sqlite-conns {test-repo {:search search-db}}) + (reset! worker-state/*vector-indexes {test-repo {:upsert! (fn [docs] + (swap! vector-upserts conj docs))}}) + (p/let [result (js/Promise.race + #js [(upsert-blocks! test-repo [{:id block-id + :page page-id + :title "which team is Manu in?"}]) + (p/delay 20 ::timeout)])] + (is (nil? result)) + (is (= 1 @sqlite-upserts)) + (is (empty? @vector-upserts)))))) + (p/catch (fn [error] + (is false (str "unexpected error: " error)))) + (p/finally done)))) + +(deftest search-blocks-falls-back-to-keyword-search-when-query-embedding-fails-test + (async done + (-> + (restoring-worker-state + (fn [] + (let [search! (get @thread-api/*thread-apis :thread-api/search-blocks) + conn (d/create-conn db-schema/schema) + search-db #js {:exec (fn [_opts] #js [])}] + (platform/set-platform! (build-test-platform + {:runtime :node + :embed-texts (fn [_texts] + (p/rejected (js/Error. "embedding unavailable")))})) + (reset! worker-state/*sqlite-conns {test-repo {:search search-db}}) + (reset! worker-state/*datascript-conns {test-repo conn}) + (reset! worker-state/*vector-indexes {test-repo {:query (fn [& _] [])}}) + (p/let [result (search! test-repo "alpha" {:limit 5})] + (is (empty? result)))))) + (p/catch (fn [error] + (is false (str "unexpected error: " error)))) + (p/finally done)))) + +(deftest search-build-blocks-indice-in-worker-reports-unified-progress-test + (async done + (-> + (restoring-worker-state + (fn [] + (let [build-index! (get @thread-api/*thread-apis :thread-api/search-build-blocks-indice-in-worker) + conn (d/create-conn db-schema/schema) + search-db (fake-db) + progress-calls (atom []) + idle-status-atom (:thread-atom/search-input-idle-status @worker-state/*state)] + (d/transact! conn [{:block/uuid (random-uuid)}]) + (platform/set-platform! (build-test-platform + {:runtime :node + :post-message! (fn [type payload] + (when (= type :thread-api/search-index-build-progress) + (let [[repo payload'] payload] + (swap! progress-calls conj {:repo repo + :payload payload'})))) + :embed-texts (fn [_texts] + (p/resolved [[0.1 0.2 0.3]]))})) + (reset! worker-state/*sqlite-conns {test-repo {:search search-db}}) + (reset! worker-state/*datascript-conns {test-repo conn}) + (reset! worker-state/*vector-indexes {test-repo {:upsert! (fn [_docs] nil) + :truncate! (fn [] nil)}}) + (reset! idle-status-atom {test-repo {:idle? true + :ts (.now js/Date)}}) + (reset! worker-state/*main-thread + (fn [qkw & args] + (when (= qkw :thread-api/search-index-build-progress) + (let [[repo payload] args] + (swap! progress-calls conj {:repo repo + :payload payload}))) + (p/resolved nil))) + (with-redefs [search/truncate-table! (fn [_db] nil) + search/upsert-blocks! (fn [_db _blocks] nil) + search/hidden-entity? (constantly false) + search/block->index-with-context (fn [_context _entity] + {:id "block-1" + :page "page-1" + :title "Hello"})] + (p/let [_ (build-index! test-repo true) + _ ( + (restoring-worker-state + (fn [] + (let [build-index! (get @thread-api/*thread-apis :thread-api/search-build-blocks-indice-in-worker) + conn (d/create-conn db-schema/schema) + search-db (fake-db) + page-id (random-uuid) + sort-calls (atom 0) + idle-status-atom (:thread-atom/search-input-idle-status @worker-state/*state) + block-count 40] + (set! (.-transaction search-db) (fn [f] (f search-db))) + (d/transact! conn + (into [{:block/uuid page-id + :block/name "search perf" + :block/title "Search Perf"}] + (map (fn [idx] + {:block/uuid (random-uuid) + :block/title (str "Sibling " idx) + :block/order idx + :block/parent [:block/uuid page-id] + :block/page [:block/uuid page-id]})) + (range block-count))) + (reset! worker-state/*sqlite-conns {test-repo {:search search-db}}) + (reset! worker-state/*datascript-conns {test-repo conn}) + (reset! idle-status-atom {test-repo {:idle? true + :ts (.now js/Date)}}) + (reset! worker-state/*main-thread (fn [& _args] (p/resolved nil))) + (with-redefs [search/truncate-table! (fn [_db] nil) + search/upsert-blocks! (fn [_db _blocks] nil) + search/hidden-entity? (constantly false) + ldb/sort-by-order (fn [children] + (swap! sort-calls inc) + (sort-by :block/order children)) + ldb/page? (fn [entity] + (= page-id (:block/uuid entity))) + ldb/object? (constantly false) + ldb/journal? (constantly false) + ldb/closed-value? (constantly false) + ldb/hidden? (constantly false) + ldb/get-title-with-parents (fn [entity] (:block/title entity))] + (p/let [_ (build-index! test-repo true)] + (is (<= @sort-calls 2))))))) + (p/catch (fn [error] + (is false (str "unexpected error: " error)))) + (p/finally done)))) + +(deftest search-index-blocks-use-platform-embeddings-for-vector-index-test + (async done + (-> + (restoring-worker-state + (fn [] + (platform/set-platform! (build-test-platform {:runtime :node})) + (reset! worker-state/*vector-indexes {test-repo {:upsert! (fn [_] nil)}}) + (p/let [result (#'db-core/ + (restoring-worker-state + (fn [] + (let [batch-sizes (atom []) + blocks (mapv (fn [n] + {:id (str "block-" n) + :page "page-1" + :title (str "Block " n)}) + (range 65))] + (platform/set-platform! + (build-test-platform + {:runtime :node + :embed-texts (fn [texts] + (swap! batch-sizes conj (count texts)) + (p/resolved (mapv (fn [_] [0]) texts)))})) + (reset! worker-state/*vector-indexes {test-repo {:upsert! (fn [_] nil)}}) + (p/let [result (#'db-core/ + (restoring-worker-state + (fn [] + (let [active-batches (atom 0) + max-active-batches (atom 0) + batch-sizes (atom []) + blocks (mapv (fn [n] + {:id (str "block-" n) + :page "page-1" + :title (str "Block " n)}) + (range 96))] + (platform/set-platform! + (build-test-platform + {:runtime :node + :embed-texts (fn [texts] + (let [active (swap! active-batches inc)] + (swap! max-active-batches max active) + (swap! batch-sizes conj (count texts)) + (p/let [_ (p/delay 10)] + (swap! active-batches dec) + (mapv (fn [_] [0]) texts))))})) + (reset! worker-state/*vector-indexes {test-repo {:upsert! (fn [_] nil)}}) + (p/let [result (#'db-core/ + (restoring-worker-state + (fn [] + (let [batch-sizes (atom []) + blocks (mapv (fn [n] + {:id (str "block-" n) + :page "page-1" + :title (str "Block " n)}) + (range 8)) + embed-texts (fn [texts] + (swap! batch-sizes conj (count texts)) + (if (> (count texts) 2) + (p/rejected (js/Error. "batch too large")) + (p/resolved (mapv (fn [_] [0]) texts))))] + (p/let [result (#'db-core/ + (restoring-worker-state + (fn [] + (let [build-index! (get @thread-api/*thread-apis :thread-api/search-build-blocks-indice-in-worker) + conn (d/create-conn db-schema/schema) + search-db (fake-db {:user-version db-core/search-db-version}) + truncate-calls (atom 0) + metadata-writes (atom []) + idle-status-atom (:thread-atom/search-input-idle-status @worker-state/*state)] + (d/transact! conn [{:block/uuid (random-uuid)}]) + (platform/set-platform! (build-test-platform {:runtime :node})) + (reset! worker-state/*sqlite-conns {test-repo {:search search-db}}) + (reset! worker-state/*datascript-conns {test-repo conn}) + (reset! worker-state/*vector-indexes + {test-repo {:upsert! (fn [_docs] nil) + :truncate! (fn [] (swap! truncate-calls inc)) + :metadata (fn [] + {:embedding-model-id "old-model" + :embedding-dimension search/vector-embedding-dimension + :context-version search/vector-context-version}) + :set-metadata! (fn [metadata] + (swap! metadata-writes conj metadata))}}) + (reset! idle-status-atom {test-repo {:idle? true + :ts (.now js/Date)}}) + (reset! worker-state/*main-thread (fn [& _] (p/resolved nil))) + (with-redefs [search/truncate-table! (fn [_db] nil) + search/upsert-blocks! (fn [_db _blocks] nil) + search/hidden-entity? (constantly false) + search/block->index-with-context (fn [_context _entity] + {:id "block-1" + :page "page-1" + :title "Hello"})] + (p/let [result (build-index! test-repo false) + _ (p/delay 10)] + (is (= :started result)) + (is (= 1 @truncate-calls)) + (is (= [{:embedding-model-id "test-model" + :embedding-dimension search/vector-embedding-dimension + :context-version search/vector-context-version}] + @metadata-writes))))))) + (p/catch (fn [error] + (is false (str "unexpected error: " error)))) + (p/finally done)))) + +(deftest vector-embedding-title-truncates-long-text-test + (let [vector-embedding-title #'db-core/vector-embedding-title + long-title (apply str (repeat 6000 "x"))] + (is (= 2048 (count (vector-embedding-title long-title)))) + (is (= "short title" (vector-embedding-title "short title"))))) + +(deftest vector-embedding-title-prefers-vector-title-test + (let [vector-embedding-title #'db-core/vector-embedding-title] + (is (= "Page context\nBlock: Alpha" + (vector-embedding-title {:title "Alpha" + :vector-title "Page context\nBlock: Alpha"}))) + (is (= "Alpha" + (vector-embedding-title {:title "Alpha"}))))) + (deftest release-access-handles-clears-active-import-state-test (restoring-worker-state (fn [] @@ -641,6 +1029,18 @@ (is (= (str test-repo "-/db.sqlite") (resolve-db-path test-repo pool "/db.sqlite"))))))) +(deftest vector-index-path-resolves-under-search-vector-dir-test + (restoring-worker-state + (fn [] + (let [vector-index-path #'db-core/vector-index-path + pool #js {:id "pool"}] + (platform/set-platform! + (assoc-in (build-test-platform) [:storage :resolve-db-path] + (fn [_repo _pool path] + (str "/graph/" path)))) + (is (= "/graph/search/vector" + (vector-index-path test-repo pool))))))) + ;; ---- checkpoint-db! tests ---- (deftest checkpoint-db-executes-wal-checkpoint @@ -727,25 +1127,25 @@ ;; Stale build-id should throw (is (thrown? js/Error (ensure-active-search-index-build! test-repo "stale-id"))))))) -;; ---- take-block-datoms-batch tests ---- +;; ---- take-search-index-batch tests ---- -(deftest take-block-datoms-batch-returns-all-for-small-input - (let [take-block-datoms-batch #'db-core/take-block-datoms-batch - datoms [{:e 1} {:e 2} {:e 3}] - [batch remaining] (take-block-datoms-batch datoms 10 1000)] +(deftest take-search-index-batch-returns-all-for-small-input + (let [take-search-index-batch #'db-core/take-search-index-batch + blocks [{:e 1} {:e 2} {:e 3}] + [batch remaining] (take-search-index-batch blocks 10 1000)] (is (= 3 (count batch))) (is (nil? remaining)))) -(deftest take-block-datoms-batch-respects-batch-size - (let [take-block-datoms-batch #'db-core/take-block-datoms-batch - datoms (vec (for [i (range 100)] {:e i})) - [batch remaining] (take-block-datoms-batch datoms 10 1000)] +(deftest take-search-index-batch-respects-batch-size + (let [take-search-index-batch #'db-core/take-search-index-batch + blocks (vec (for [i (range 100)] {:e i})) + [batch remaining] (take-search-index-batch blocks 10 1000)] (is (= 10 (count batch))) (is (= 90 (count remaining))))) -(deftest take-block-datoms-batch-returns-empty-for-empty-input - (let [take-block-datoms-batch #'db-core/take-block-datoms-batch - [batch remaining] (take-block-datoms-batch [] 10 1000)] +(deftest take-search-index-batch-returns-empty-for-empty-input + (let [take-search-index-batch #'db-core/take-search-index-batch + [batch remaining] (take-search-index-batch [] 10 1000)] (is (empty? batch)) (is (nil? remaining)))) diff --git a/src/test/frontend/worker/db_worker_node_test.cljs b/src/test/frontend/worker/db_worker_node_test.cljs index dbd2beac53f7..57a190e28062 100644 --- a/src/test/frontend/worker/db_worker_node_test.cljs +++ b/src/test/frontend/worker/db_worker_node_test.cljs @@ -112,6 +112,11 @@ [opts] (db-worker-node/start-daemon! (update opts :log-level #(or % "error")))) +(defn- semantic-search-integration-enabled? + [] + (and (= "darwin" (.-platform js/process)) + (some? (gobj/get (.-env js/process) "LOGSEQ_EMBEDDINGS_URL")))) + (defn- noisy-debug-line? [line] (or (string/includes? line ":listen-db-changes!") @@ -967,6 +972,82 @@ (done))))) (done)))))))) +(deftest db-worker-node-vector-search-finds-outline-context-after-rebuild + (if-not (semantic-search-integration-enabled?) + (is true "Skipping semantic search integration test without a macOS embedding endpoint") + (async done + (let [daemon (atom nil) + data-dir (node-helper/create-tmp-dir "db-worker-vector-search") + repo (str "logseq_db_vector_search_" (subs (str (random-uuid)) 0 8)) + now (js/Date.now) + page-uuid (random-uuid) + manu-uuid (random-uuid) + manu-team-uuid (random-uuid) + tony-uuid (random-uuid) + tony-team-uuid (random-uuid)] + (-> (p/let [{:keys [host port stop!]} + (start-daemon! {:root-dir data-dir + :repo repo}) + _ (reset! daemon {:stop! stop!}) + _ (invoke host port "thread-api/create-or-open-db" [repo {}]) + _ (invoke host port "thread-api/transact" + [repo + [{:block/uuid page-uuid + :block/title "Teams" + :block/name "teams" + :block/tags #{:logseq.class/Page} + :block/created-at now + :block/updated-at now} + {:block/uuid manu-uuid + :block/title "which team is Manu in?" + :block/page [:block/uuid page-uuid] + :block/parent [:block/uuid page-uuid] + :block/order "a0" + :block/created-at now + :block/updated-at now} + {:block/uuid manu-team-uuid + :block/title "Spurs" + :block/page [:block/uuid page-uuid] + :block/parent [:block/uuid manu-uuid] + :block/order "a0" + :block/created-at now + :block/updated-at now} + {:block/uuid tony-uuid + :block/title "Which team is Tony in?" + :block/page [:block/uuid page-uuid] + :block/parent [:block/uuid page-uuid] + :block/order "b0" + :block/created-at now + :block/updated-at now} + {:block/uuid tony-team-uuid + :block/title "Spurs" + :block/page [:block/uuid page-uuid] + :block/parent [:block/uuid page-uuid] + :block/order "c0" + :block/created-at now + :block/updated-at now}] + {} + nil]) + _ (invoke host port "thread-api/search-build-blocks-indice-in-worker" [repo true]) + manu-results (invoke host port "thread-api/search-blocks" [repo "manu spurs" {:limit 10}]) + tony-results (invoke host port "thread-api/search-blocks" [repo "tony spurs" {:limit 10}])] + (is (some #(= manu-uuid (:block/uuid %)) manu-results) + (str "Expected Manu vector result, got: " (pr-str (map :block/title manu-results)))) + (is (= manu-uuid (:block/uuid (first manu-results))) + (str "Expected Manu vector result first, got: " (pr-str (map :block/title manu-results)))) + (is (some #(= tony-uuid (:block/uuid %)) tony-results) + (str "Expected Tony vector result, got: " (pr-str (map :block/title tony-results)))) + (is (= tony-uuid (:block/uuid (first tony-results))) + (str "Expected Tony vector result first, got: " (pr-str (map :block/title tony-results))))) + (p/catch (fn [e] + (println "[db-worker-node-test] vector-search error:" e) + (is false (str e)))) + (p/finally (fn [] + (if-let [stop! (:stop! @daemon)] + (-> (stop!) + (p/finally done)) + (done))))))))) + (deftest db-worker-node-import-edn (async done (let [daemon-a (atom nil) diff --git a/src/test/frontend/worker/platform_node_test.cljs b/src/test/frontend/worker/platform_node_test.cljs index b381aadd8923..4f6b42657fc8 100644 --- a/src/test/frontend/worker/platform_node_test.cljs +++ b/src/test/frontend/worker/platform_node_test.cljs @@ -27,6 +27,51 @@ (gobj/set bind k v)) bind)) +(defn- set-process-platform-arch! + [platform arch] + (let [platform-descriptor (js/Object.getOwnPropertyDescriptor js/process "platform") + arch-descriptor (js/Object.getOwnPropertyDescriptor js/process "arch")] + (js/Object.defineProperty js/process "platform" + #js {:value platform + :enumerable true + :configurable true}) + (js/Object.defineProperty js/process "arch" + #js {:value arch + :enumerable true + :configurable true}) + (fn [] + (js/Object.defineProperty js/process "platform" platform-descriptor) + (js/Object.defineProperty js/process "arch" arch-descriptor)))) + +(defn- fake-open-vector-index + [metadata*] + (fn [{:keys [path]}] + (.mkdirSync fs path #js {:recursive true}) + (let [docs* (atom [])] + (p/resolved + {:query (fn [_embedding limit page] + (->> @docs* + (filter #(or (nil? page) + (= page (:page %)))) + (take (or limit 100)) + (mapv #(select-keys % [:id :page :vector-title :vector-score])))) + :upsert! (fn [docs] + (reset! docs* (vec docs)) + nil) + :delete! (fn [ids] + (let [ids (set ids)] + (swap! docs* #(vec (remove (comp ids :id) %)))) + nil) + :truncate! (fn [] + (reset! docs* []) + nil) + :metadata (fn [] + (get @metadata* path)) + :set-metadata! (fn [metadata] + (swap! metadata* assoc path metadata) + nil) + :close! (fn [] nil)})))) + (defn- (p/let [platform (platform-node/node-platform {:root-dir root-dir}) + embedding (:embedding platform)] + (is (= "all-MiniLM-L6-v2" (:model-id embedding))) + (is (fn? (:embed-texts embedding)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-disables-vector-embedding-off-macos + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-no-vector-embedding") + restore! (set-process-platform-arch! "linux" "x64")] + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir})] + (is (nil? (:embedding platform))) + (is (nil? (:vector platform)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-enables-vector-embedding-on-macos-arm64 + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-vector-embedding") + restore! (set-process-platform-arch! "darwin" "arm64")] + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir})] + (is (= "all-MiniLM-L6-v2" (get-in platform [:embedding :model-id]))) + (is (fn? (get-in platform [:embedding :embed-texts]))) + (is (fn? (get-in platform [:vector :open-index])))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-disables-vector-embedding-on-macos-x64 + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-vector-embedding-x64") + restore! (set-process-platform-arch! "darwin" "x64")] + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir})] + (is (nil? (:embedding platform))) + (is (nil? (:vector platform)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-embedding-backend-calls-local-server + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-embedding-text") + restore-platform! (set-process-platform-arch! "darwin" "arm64") + original-fetch js/fetch + calls (atom [])] + (set! js/fetch + (fn [url opts] + (swap! calls conj {:url url + :method (gobj/get opts "method") + :headers (js->clj (gobj/get opts "headers")) + :body (js->clj (js/JSON.parse (gobj/get opts "body")) + :keywordize-keys true)}) + (p/resolved #js {:ok true + :status 200 + :json (fn [] + (p/resolved + (clj->js {:data [{:index 1 + :embedding [4 5 6]} + {:index 0 + :embedding [1 2 3]}]})))}))) + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir + :embedding-endpoint "http://127.0.0.1:8765/v1/embeddings"}) + embeddings ((get-in platform [:embedding :embed-texts]) ["hello" "world"])] + (is (= [[1 2 3] [4 5 6]] embeddings)) + (is (= [{:url "http://127.0.0.1:8765/v1/embeddings" + :method "POST" + :headers {"Content-Type" "application/json"} + :body {:model "all-MiniLM-L6-v2" + :input ["hello" "world"]}}] + @calls))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (set! js/fetch original-fetch) + (restore-platform!) + (done))))))) + +(deftest node-platform-vector-index-creates-missing-collection-path + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-vector") + vector-path (node-path/join root-dir "graphs" "graph-a" "search" "vector") + restore! (set-process-platform-arch! "darwin" "arm64")] + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir + :open-vector-index-fn (fake-open-vector-index (atom {}))}) + vector-index ((get-in platform [:vector :open-index]) + {:path vector-path + :dimension 3}) + _ ((:upsert! vector-index) [{:id "block-1" + :page "page-1" + :embedding [1 0 0]}]) + result ((:query vector-index) [1 0 0] 10 nil)] + (is (.existsSync fs vector-path)) + (is (= [{:id "block-1" + :page "page-1"}] + (mapv #(select-keys % [:id :page]) result))) + ((:close! vector-index))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-vector-index-persists-metadata + (async done + (let [root-dir (node-helper/create-tmp-dir "platform-node-vector-metadata") + vector-path (node-path/join root-dir "graphs" "graph-a" "search" "vector") + restore! (set-process-platform-arch! "darwin" "arm64") + metadata* (atom {}) + metadata {:embedding-model-id "test-model" + :embedding-dimension 3 + :context-version 1}] + (-> (p/let [platform (platform-node/node-platform {:root-dir root-dir + :open-vector-index-fn (fake-open-vector-index metadata*)}) + open-index (get-in platform [:vector :open-index]) + vector-index (open-index {:path vector-path + :dimension 3}) + _ ((:set-metadata! vector-index) metadata) + _ ((:close! vector-index)) + reopened (open-index {:path vector-path + :dimension 3})] + (is (= metadata ((:metadata reopened)))) + ((:close! reopened))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (restore!) + (done))))))) + +(deftest node-platform-vector-page-query-topks-expand-adaptively + (let [topks #'platform-node/vector-query-topks] + (is (= [10] (topks 10 nil))) + (is (= [40 160 640] (topks 10 "page-1"))))) + (deftest node-platform-backup-uses-shared-sqlite-backup-implementation (let [source (node-platform-source)] (is (string/includes? source "logseq.db.sqlite.backup")) diff --git a/src/test/frontend/worker/search_benchmark_test.cljs b/src/test/frontend/worker/search_benchmark_test.cljs new file mode 100644 index 000000000000..247746394564 --- /dev/null +++ b/src/test/frontend/worker/search_benchmark_test.cljs @@ -0,0 +1,53 @@ +(ns frontend.worker.search-benchmark-test + (:require [cljs.test :refer [async deftest is]] + [frontend.worker.search-benchmark :as search-benchmark] + [promesa.core :as p])) + +(deftest score-results-computes-retrieval-metrics-test + (let [score (search-benchmark/score-results + ["wrong" "expected-b" "expected-a"] + ["expected-a" "expected-b"] + 3)] + (is (= {:precision-at-k 1 + :recall 1 + :recall-at-1 0 + :recall-at-3 1 + :recall-at-5 1 + :mrr 0.5 + :f1 1 + :hits-at-k 2 + :matched-ids ["expected-a" "expected-b"] + :unmatched-expected-ids []} + score)))) + +(deftest run-benchmark-compares-backends-and-summarizes-test + (async done + (let [cases [{:id "exact-title" + :query "alpha" + :expected-ids ["a"] + :expected-in-top-k 3} + {:id "cross-block" + :query "distributed idea" + :expected-ids ["b"] + :expected-in-top-k 3}] + backends [{:id :keyword + :search (fn [{:keys [id]}] + (p/resolved + (case id + "exact-title" [{:id "a"}] + "cross-block" [{:id "wrong"}])))} + {:id :hybrid + :search (fn [{:keys [id]}] + (p/resolved + (case id + "exact-title" [{:id "a"}] + "cross-block" [{:id "b"}])))}]] + (-> (search-benchmark/run-benchmark cases backends) + (p/then (fn [{:keys [summary results]}] + (is (= 4 (count results))) + (is (= 0.5 (get-in summary [:keyword :avg-recall-at-1]))) + (is (= 1 (get-in summary [:hybrid :avg-recall-at-1]))) + (is (= 1 (get-in summary [:hybrid :avg-mrr]))))) + (p/catch (fn [error] + (is false (str "unexpected error: " error)))) + (p/finally done))))) diff --git a/src/test/frontend/worker/search_test.cljs b/src/test/frontend/worker/search_test.cljs index 5e1188ea915e..d30e41ff6674 100644 --- a/src/test/frontend/worker/search_test.cljs +++ b/src/test/frontend/worker/search_test.cljs @@ -3,6 +3,7 @@ [clojure.string :as string] [datascript.core :as d] [frontend.worker.search :as search] + [frontend.worker.search-benchmark :as search-benchmark] [logseq.db :as ldb] [logseq.db.test.helper :as db-test])) @@ -534,6 +535,501 @@ (is (= (str page-id) (:id indexed))) (is (= "Artificial Intelligence ai" (:title indexed)))))))) +(deftest block-index-does-not-generate-vector-embedding + (testing "desktop vector embeddings are supplied by the platform embedding backend" + (let [block-id #uuid "00000000-0000-0000-0000-000000000238" + page-id #uuid "00000000-0000-0000-0000-000000000239" + block {:db/id 1 + :block/uuid block-id + :block/title "Local-first semantic search" + :block/page {:block/uuid page-id}}] + (with-redefs [ldb/page? (constantly false) + ldb/object? (constantly false) + ldb/journal? (constantly false) + ldb/closed-value? (constantly false) + ldb/get-title-with-parents (fn [entity] (:block/title entity))] + (let [indexed (search/block->index block)] + (is (= "Local-first semantic search" (:title indexed))) + (is (not (contains? indexed :embedding)))))))) + +(deftest block-index-includes-bounded-vector-context + (testing "vector-only text includes local block context without changing the keyword title" + (let [page-id #uuid "00000000-0000-0000-0000-000000000240" + block-id #uuid "00000000-0000-0000-0000-000000000241" + page {:db/id 1 + :page? true + :block/uuid page-id + :block/title "Search Design"} + grandparent {:db/id 2 + :block/uuid #uuid "00000000-0000-0000-0000-000000000242" + :block/title "Architecture" + :block/parent page} + parent {:db/id 3 + :block/uuid #uuid "00000000-0000-0000-0000-000000000243" + :block/title "Vector index" + :block/parent grandparent} + prev-sibling {:db/id 4 + :block/uuid #uuid "00000000-0000-0000-0000-000000000244" + :block/title "Keyword search" + :block/order "a"} + sibling-anchor {:db/id 5 + :block/uuid block-id + :block/title "Hybrid retrieval" + :block/order "b"} + next-sibling {:db/id 6 + :block/uuid #uuid "00000000-0000-0000-0000-000000000245" + :block/title "Ranking policy" + :block/order "c"} + child {:db/id 7 + :block/uuid #uuid "00000000-0000-0000-0000-000000000246" + :block/title "Cross block context" + :block/order "a"} + block (assoc sibling-anchor + :block/page page + :block/parent (assoc parent :block/_parent [prev-sibling sibling-anchor next-sibling]) + :block/_parent [child])] + (with-redefs [ldb/page? (fn [entity] (true? (:page? entity))) + ldb/object? (constantly false) + ldb/journal? (constantly false) + ldb/closed-value? (constantly false) + ldb/hidden? (constantly false) + ldb/get-title-with-parents (fn [entity] (:block/title entity))] + (let [indexed (search/block->index block) + vector-title (:vector-title indexed)] + (is (= "Hybrid retrieval" (:title indexed))) + (is (string/includes? vector-title "Page: Search Design")) + (is (string/includes? vector-title "Path: Architecture > Vector index")) + (is (string/includes? vector-title "Previous: Keyword search")) + (is (string/includes? vector-title "Block: Hybrid retrieval")) + (is (string/includes? vector-title "Children: Cross block context")) + (is (string/includes? vector-title "Next: Ranking policy"))))))) + +(deftest build-blocks-indice-reuses-sorted-vector-context + (testing "large pages do not sort the same sibling set once per indexed block" + (let [page-id #uuid "00000000-0000-0000-0000-000000000250" + page {:db/id 1 + :page? true + :block/uuid page-id + :block/title "Search Perf"} + blocks (mapv (fn [idx] + {:db/id (+ 100 idx) + :block/uuid (uuid (test-uuid-string (+ 250 idx))) + :block/title (str "Sibling " idx) + :block/order idx + :block/parent page + :block/page page}) + (range 40)) + page (assoc page :block/_parent blocks) + blocks (mapv #(assoc % :block/parent page) blocks) + sort-calls (atom 0)] + (with-redefs [search/get-all-blocks (fn [_db] blocks) + ldb/sort-by-order (fn [children] + (swap! sort-calls inc) + (sort-by :block/order children)) + ldb/page? (fn [entity] (true? (:page? entity))) + ldb/object? (constantly false) + ldb/journal? (constantly false) + ldb/closed-value? (constantly false) + ldb/hidden? (constantly false) + ldb/get-title-with-parents (fn [entity] (:block/title entity))] + (is (= 40 (count (search/build-blocks-indice :db)))) + (is (<= @sort-calls 2)))))) + +(deftest expand-vector-context-blocks-includes-neighbor-anchors + (testing "incremental vector updates refresh anchors whose context includes the changed block" + (let [page {:db/id 1 + :page? true + :block/uuid #uuid "00000000-0000-0000-0000-000000000290" + :block/title "Search"} + parent {:db/id 2 + :block/uuid #uuid "00000000-0000-0000-0000-000000000291" + :block/title "Parent" + :block/page page} + prev {:db/id 3 + :block/uuid #uuid "00000000-0000-0000-0000-000000000292" + :block/title "Previous" + :block/order 1 + :block/page page} + current {:db/id 4 + :block/uuid #uuid "00000000-0000-0000-0000-000000000293" + :block/title "Current" + :block/order 2 + :block/page page} + next {:db/id 5 + :block/uuid #uuid "00000000-0000-0000-0000-000000000294" + :block/title "Next" + :block/order 3 + :block/page page} + child {:db/id 6 + :block/uuid #uuid "00000000-0000-0000-0000-000000000295" + :block/title "Child" + :block/order 1 + :block/page page} + parent (assoc parent :block/_parent [prev current next]) + current (assoc current + :block/parent parent + :block/_parent [child])] + (with-redefs [ldb/sort-by-order (fn [children] (sort-by :block/order children)) + ldb/hidden? (constantly false)] + (is (= [(uuid "00000000-0000-0000-0000-000000000293") + (uuid "00000000-0000-0000-0000-000000000291") + (uuid "00000000-0000-0000-0000-000000000292") + (uuid "00000000-0000-0000-0000-000000000294") + (uuid "00000000-0000-0000-0000-000000000295")] + (mapv :block/uuid (search/expand-vector-context-blocks [current])))))))) + +(deftest sync-search-indice-refreshes-vector-context-on-structure-change + (testing "moving a block under a parent re-embeds the parent with child context" + (let [conn (db-test/create-conn-with-blocks + {:pages-and-blocks [{:page {:block/title "Teams"} + :blocks [{:block/title "which team is Manu in?"} + {:block/title "Spurs"}]}]}) + manu (db-test/find-block-by-content @conn "which team is Manu in?") + spurs (db-test/find-block-by-content @conn "Spurs") + tx-report (d/transact! conn [[:db/add (:db/id spurs) :block/parent (:db/id manu)]]) + blocks-to-add (:blocks-to-add (search/sync-search-indice tx-report)) + manu-index (some #(when (= "which team is Manu in?" (:title %)) %) blocks-to-add)] + (is (some? manu-index)) + (is (true? (some-> (:vector-title manu-index) + (string/includes? "Children: Spurs")))))) + + (testing "reordering a sibling re-embeds the previous block with next-sibling context" + (let [conn (db-test/create-conn-with-blocks + {:pages-and-blocks [{:page {:block/title "Teams"} + :blocks [{:block/title "Spurs" + :block/order "a"} + {:block/title "Which team is Tony in?" + :block/order "b"}]}]}) + spurs (db-test/find-block-by-content @conn "Spurs") + tx-report (d/transact! conn [[:db/add (:db/id spurs) :block/order "c"]]) + blocks-to-add (:blocks-to-add (search/sync-search-indice tx-report)) + tony-index (some #(when (= "Which team is Tony in?" (:title %)) %) blocks-to-add)] + (is (some? tony-index)) + (is (true? (some-> (:vector-title tony-index) + (string/includes? "Next: Spurs"))))))) + +(deftest search-blocks-includes-vector-only-results + (testing "zvec vector hits are merged into desktop search even when SQLite has no keyword hit" + (let [page-id (test-uuid-string 900) + vector-id (test-uuid-string 901) + blocks {vector-id {:db/id 901 + :block/uuid (uuid vector-id) + :block/title "Semantic only result" + :block/page {:block/uuid (uuid page-id)}}} + query-embedding [0.1 0.2 0.3] + vector-queries (atom []) + vector-index {:query (fn [embedding limit page] + (swap! vector-queries conj {:embedding embedding + :limit limit + :page page}) + [{:id vector-id + :page page-id + :vector-score 0.91}])}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false) + ldb/built-in? (constantly false)] + (let [result (vec (search/search-blocks (atom :db) + (checking-db) + vector-index + "meaning based query" + {:limit 10 + :enable-snippet? false + :query-embedding query-embedding}))] + (is (= [{:db/id 901 + :block/title "Semantic only result"}] + (mapv #(select-keys % [:db/id :block/title]) result))) + (is (= 1 (count @vector-queries))) + (is (= query-embedding + (:embedding (first @vector-queries))))))))) + +(deftest search-blocks-excludes-built-in-class-vector-results-when-built-ins-disabled + (testing "built-in classes do not hide user block vector matches in block reference search" + (let [built-in-id (test-uuid-string 905) + user-id (test-uuid-string 906) + page-id (test-uuid-string 907) + blocks {built-in-id {:db/id 905 + :block/uuid (uuid built-in-id) + :block/title "Cards" + :block/page {:block/uuid (uuid page-id)} + :logseq.property/built-in? true} + user-id {:db/id 906 + :block/uuid (uuid user-id) + :block/title "which team is Manu in?" + :block/page {:block/uuid (uuid page-id)}}} + vector-index {:query (fn [_embedding _limit _page] + [{:id built-in-id + :page page-id + :vector-score 0.99} + {:id user-id + :page page-id + :vector-score 0.98}])}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false) + ldb/built-in? (fn [block] + (true? (:logseq.property/built-in? block))) + ldb/class? (fn [block] + (= (:db/id block) 905))] + (let [result (vec (search/search-blocks (atom :db) + (checking-db) + vector-index + "manu spurs" + {:limit 10 + :built-in? false + :enable-snippet? false + :query-embedding [0.1 0.2 0.3]}))] + (is (= ["which team is Manu in?"] + (mapv :block/title result)))))))) + +(deftest search-blocks-limits-vector-results-before-combining + (testing "large graph vector search caps semantic hits and drops low scores before merging" + (let [page-id (test-uuid-string 930) + vector-ids (mapv test-uuid-string (range 931 1931)) + blocks (into {} + (map-indexed (fn [idx id] + [id {:db/id (+ 931 idx) + :block/uuid (uuid id) + :block/title (if (even? idx) + (str "Strong vector result " idx) + (str "Weak vector result " idx)) + :block/page {:block/uuid (uuid page-id)}}]) + vector-ids)) + consumed (atom 0) + query-limits (atom []) + vector-results (fn vector-results [ids] + (lazy-seq + (when-let [ids (seq ids)] + (let [id (first ids) + idx @consumed] + (cons (do + (swap! consumed inc) + {:id id + :page page-id + :vector-score (if (even? idx) 0.51 0.5)}) + (vector-results (rest ids))))))) + vector-index {:query (fn [_embedding limit _page] + (swap! query-limits conj limit) + (take limit (vector-results vector-ids)))}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false) + ldb/built-in? (constantly false)] + (let [result (doall (search/search-blocks (atom :db) + (checking-db) + vector-index + "semantic large graph" + {:limit 50 + :enable-snippet? false + :query-embedding [0.1 0.2 0.3]}))] + (is (= [10] @query-limits)) + (is (= 5 (count result))) + (is (every? #(string/starts-with? % "Strong") + (map :block/title result))) + (is (= 10 @consumed))))))) + +(deftest reciprocal-rank-fusion-promotes-cross-source-agreement + (testing "a result found by both keyword and vector search outranks a vector-only top hit" + (let [rrf #'search/reciprocal-rank-fusion + result (rrf [[{:id "keyword-only"} + {:id "shared"}] + [{:id "vector-only"} + {:id "shared"}]])] + (is (= ["shared" "keyword-only" "vector-only"] + (mapv :id result)))))) + +(deftest search-blocks-hybrid-ranks-keyword-and-vector-results + (testing "SQLite keyword hits and zvec vector hits share the final ranking" + (let [keyword-id (test-uuid-string 910) + vector-id (test-uuid-string 911) + page-id (test-uuid-string 912) + blocks {keyword-id {:db/id 910 + :block/uuid (uuid keyword-id) + :block/title "alpha keyword" + :block/page {:block/uuid (uuid page-id)}} + vector-id {:db/id 911 + :block/uuid (uuid vector-id) + :block/title "related semantic result" + :block/page {:block/uuid (uuid page-id)}}} + db #js {:exec (fn [opts] + (let [sql (aget opts "sql")] + (cond + (string/includes? sql "title match ?") + (clj->js [[keyword-id page-id "alpha keyword" -16 nil]]) + + :else + #js [])))} + vector-index {:query (fn [_embedding _limit _page] + [{:id vector-id + :page page-id + :vector-score 4.0}])}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false) + ldb/built-in? (constantly false)] + (let [result (vec (search/search-blocks (atom :db) + db + vector-index + "alpha" + {:limit 10 + :enable-snippet? false + :query-embedding [0.4 0.5 0.6]}))] + (is (= ["alpha keyword" "related semantic result"] + (mapv :block/title result)))))))) + +(deftest search-blocks-filters-weak-vector-result + (testing "weak semantic hits are dropped even when exact keyword hits exist" + (let [keyword-id (test-uuid-string 920) + vector-id (test-uuid-string 921) + page-id (test-uuid-string 922) + blocks {keyword-id {:db/id 920 + :block/uuid (uuid keyword-id) + :block/title "alpha" + :block/page {:block/uuid (uuid page-id)}} + vector-id {:db/id 921 + :block/uuid (uuid vector-id) + :block/title "contextually adjacent but weak" + :block/page {:block/uuid (uuid page-id)}}} + db #js {:exec (fn [opts] + (let [sql (aget opts "sql")] + (cond + (string/includes? sql "title = ?") + (clj->js [[keyword-id page-id "alpha"]]) + + :else + #js [])))} + vector-index {:query (fn [_embedding _limit _page] + [{:id vector-id + :page page-id + :vector-score 0.34}])}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false) + ldb/built-in? (constantly false)] + (let [result (vec (search/search-blocks (atom :db) + db + vector-index + "alpha" + {:limit 10 + :enable-snippet? false + :query-embedding [0.4 0.5 0.6]}))] + (is (= ["alpha"] + (mapv :block/title result)))))))) + +(deftest combine-results-uses-vector-context-terms-as-semantic-tie-breaker + (testing "embedded context terms can promote a lower raw vector hit without page/tag boosts inverting rank" + (let [unrelated-id (test-uuid-string 930) + page-id (test-uuid-string 931) + semantic-id (test-uuid-string 932) + tag-id (test-uuid-string 933) + blocks {unrelated-id {:db/id 930 + :block/uuid (uuid unrelated-id) + :block/title "Which team is Tony in?"} + page-id {:db/id 931 + :block/uuid (uuid page-id) + :block/title "nba" + :page? true} + semantic-id {:db/id 932 + :block/uuid (uuid semantic-id) + :block/title "which team is Manu in?"} + tag-id {:db/id 933 + :block/uuid (uuid tag-id) + :block/title "generic tagged result" + :block/tags [{:db/id 934}]}}] + (with-redefs [d/entity (fn [_db [_attr id]] + (get blocks (str id))) + d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? :page?] + (let [db #js {:exec (constantly #js [])} + vector-index {:query (fn [_embedding _limit _page] + [{:id unrelated-id + :vector-score 0.72 + :title "Which team is Tony in?" + :vector-title "Previous: which team is Manu in?\nBlock: Which team is Tony in?\nNext: Spurs"} + {:id page-id + :vector-score 0.70 + :title "nba" + :vector-title "Page: nba\nBlock: nba"} + {:id semantic-id + :vector-score 0.69 + :title "which team is Manu in?" + :vector-title "Block: which team is Manu in?\nChildren: Spurs"} + {:id tag-id + :vector-score 0.68 + :title "generic tagged result" + :vector-title "Block: generic tagged result"}])} + result (vec (search/search-blocks (atom :db) + db + vector-index + "manu spurs" + {:limit 10 + :enable-snippet? false + :query-embedding [0.4 0.5 0.6]}))] + (is (= ["which team is Manu in?" + "Which team is Tony in?" + "nba" + "generic tagged result"] + (mapv :block/title result)))))))) + +(deftest benchmark-scoring-keeps-keyword-result-ahead-of-strong-vector-only-hit + (testing "hybrid RRF weighting preserves keyword precision at rank 1" + (let [keyword-id (test-uuid-string 940) + vector-id (test-uuid-string 941) + page-id (test-uuid-string 942) + blocks {keyword-id {:db/id 940 + :block/uuid (uuid keyword-id) + :block/title "keyword hit" + :block/page {:block/uuid (uuid page-id)}} + vector-id {:db/id 941 + :block/uuid (uuid vector-id) + :block/title "semantic only" + :block/page {:block/uuid (uuid page-id)}}}] + (with-redefs [d/pull-many (fn [_db _selector lookup-refs] + (mapv (fn [[_attr id]] + (get blocks (str id))) + lookup-refs)) + ldb/hidden? (constantly false) + ldb/page? (constantly false)] + (let [result (search/combine-results + :db + [{:id keyword-id + :keyword-score 0.1 + :title "keyword hit"}] + [{:id vector-id + :vector-score 1000 + :title "semantic only"}]) + score (search-benchmark/score-results result [keyword-id] 1)] + (is (= 1 (:recall-at-1 score)))))))) + (deftest search-result-keeps-page-title-when-alias-matches (testing "alias matches annotate the page result without replacing its title" (let [page-id #uuid "00000000-0000-0000-0000-000000000236" From 6b8e9d1708b43c9825da1a3134c66a02b1fa58bf Mon Sep 17 00:00:00 2001 From: charlie Date: Thu, 28 May 2026 12:23:07 +0800 Subject: [PATCH 0030/1400] chore(dev): upgrade shadow cljs --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- shadow-cljs.edn | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 6ffecb2df750..f164f8b2b0b4 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "postcss-nested": "7.0.2", "process": "^0.11.10", "semver": "7.7.4", - "shadow-cljs": "^3.4.6", + "shadow-cljs": "^3.4.11", "source-map-loader": "^5.0.0", "stylelint": "^13.13.1", "stylelint-config-standard": "^20.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f076d6327f2b..8796a77949b4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -304,8 +304,8 @@ importers: specifier: 7.7.4 version: 7.7.4 shadow-cljs: - specifier: ^3.4.6 - version: 3.4.6 + specifier: ^3.4.11 + version: 3.4.11 source-map-loader: specifier: ^5.0.0 version: 5.0.0(webpack@5.106.2) @@ -4055,8 +4055,8 @@ packages: shadow-cljs-jar@1.3.4: resolution: {integrity: sha512-cZB2pzVXBnhpJ6PQdsjO+j/MksR28mv4QD/hP/2y1fsIa9Z9RutYgh3N34FZ8Ktl4puAXaIGlct+gMCJ5BmwmA==} - shadow-cljs@3.4.6: - resolution: {integrity: sha512-4IyEN00b38MEGBBAhSJJmilkCvSK/t/TPxsqhPBDWDLO6Xpt8zn0TiCO0eIhcR8AbmJ5V02Qzc4N3mffl61MFA==} + shadow-cljs@3.4.11: + resolution: {integrity: sha512-996uqtadZItXdD80Vtoh9IoE8oUOKoXOXd48gOxkZWUAHcxgcBlcRqMmPYiy4A1QqvSUQkdNGpv9AIWOgLx9Vg==} engines: {node: '>=6.0.0'} hasBin: true @@ -8771,7 +8771,7 @@ snapshots: shadow-cljs-jar@1.3.4: {} - shadow-cljs@3.4.6: + shadow-cljs@3.4.11: dependencies: buffer: 6.0.3 process: 0.11.10 diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 690f47c69205..62f4522183c6 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -47,7 +47,7 @@ :devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function :after-load frontend.core/start ;; after live-reloading finishes call this function - :watch-path "/static" + :watch-dir "static" :preloads [devtools.preload shadow.remote.runtime.cljs.browser] :loader-mode :eval From b23dd71230c379ae258afbbeced098d4a87c73e4 Mon Sep 17 00:00:00 2001 From: charlie Date: Thu, 28 May 2026 12:27:31 +0800 Subject: [PATCH 0031/1400] Revert "chore(dev): upgrade shadow cljs" This reverts commit 6b8e9d1708b43c9825da1a3134c66a02b1fa58bf. --- package.json | 2 +- pnpm-lock.yaml | 10 +++++----- shadow-cljs.edn | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index f164f8b2b0b4..6ffecb2df750 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "postcss-nested": "7.0.2", "process": "^0.11.10", "semver": "7.7.4", - "shadow-cljs": "^3.4.11", + "shadow-cljs": "^3.4.6", "source-map-loader": "^5.0.0", "stylelint": "^13.13.1", "stylelint-config-standard": "^20.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8796a77949b4..f076d6327f2b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -304,8 +304,8 @@ importers: specifier: 7.7.4 version: 7.7.4 shadow-cljs: - specifier: ^3.4.11 - version: 3.4.11 + specifier: ^3.4.6 + version: 3.4.6 source-map-loader: specifier: ^5.0.0 version: 5.0.0(webpack@5.106.2) @@ -4055,8 +4055,8 @@ packages: shadow-cljs-jar@1.3.4: resolution: {integrity: sha512-cZB2pzVXBnhpJ6PQdsjO+j/MksR28mv4QD/hP/2y1fsIa9Z9RutYgh3N34FZ8Ktl4puAXaIGlct+gMCJ5BmwmA==} - shadow-cljs@3.4.11: - resolution: {integrity: sha512-996uqtadZItXdD80Vtoh9IoE8oUOKoXOXd48gOxkZWUAHcxgcBlcRqMmPYiy4A1QqvSUQkdNGpv9AIWOgLx9Vg==} + shadow-cljs@3.4.6: + resolution: {integrity: sha512-4IyEN00b38MEGBBAhSJJmilkCvSK/t/TPxsqhPBDWDLO6Xpt8zn0TiCO0eIhcR8AbmJ5V02Qzc4N3mffl61MFA==} engines: {node: '>=6.0.0'} hasBin: true @@ -8771,7 +8771,7 @@ snapshots: shadow-cljs-jar@1.3.4: {} - shadow-cljs@3.4.11: + shadow-cljs@3.4.6: dependencies: buffer: 6.0.3 process: 0.11.10 diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 62f4522183c6..690f47c69205 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -47,7 +47,7 @@ :devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function :after-load frontend.core/start ;; after live-reloading finishes call this function - :watch-dir "static" + :watch-path "/static" :preloads [devtools.preload shadow.remote.runtime.cljs.browser] :loader-mode :eval From 9f618d918602592d94c7e053672b182c6f9e788c Mon Sep 17 00:00:00 2001 From: charlie Date: Thu, 28 May 2026 12:29:27 +0800 Subject: [PATCH 0032/1400] fix(dev): shadow-cljs.edn --- shadow-cljs.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 690f47c69205..62f4522183c6 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -47,7 +47,7 @@ :devtools {:before-load frontend.core/stop ;; before live-reloading any code call this function :after-load frontend.core/start ;; after live-reloading finishes call this function - :watch-path "/static" + :watch-dir "static" :preloads [devtools.preload shadow.remote.runtime.cljs.browser] :loader-mode :eval From a3837bc654ef2fe248d125af82af0b0a0eb18745 Mon Sep 17 00:00:00 2001 From: megayu Date: Thu, 28 May 2026 14:29:05 +0800 Subject: [PATCH 0033/1400] clean redundant class extends (#12735) * fix(outliner): clean redundant class extends * perf(outliner): query redundant extends cleanup directly * fix(log): improve function signatures for clarity * fix(outliner): handle lookup-ref vectors in class extends normalization * fix lint * fix(outliner): clean redundant class extends --------- Co-authored-by: Tienson Qin --- .../src/logseq/outliner/property.cljs | 115 ++++++++++++++++-- .../test/logseq/outliner/property_test.cljs | 72 +++++++++++ 2 files changed, 174 insertions(+), 13 deletions(-) diff --git a/deps/outliner/src/logseq/outliner/property.cljs b/deps/outliner/src/logseq/outliner/property.cljs index a14589085047..ea5066774ae8 100644 --- a/deps/outliner/src/logseq/outliner/property.cljs +++ b/deps/outliner/src/logseq/outliner/property.cljs @@ -112,6 +112,76 @@ (ldb/internal-page? block) (not (block-classes-provide-property? @conn block property-id))))) +(defn- class-lookup-ref? + [value] + ;; Class extends accepts only entity refs that can point at class blocks. + ;; Keep this narrow to avoid per-value schema/entity lookups while parsing vectors. + (and (vector? value) + (= 2 (count value)) + (contains? #{:db/ident :block/uuid} (first value)))) + +(defn- single-entity-ref? + [value] + (or (de/entity? value) + (integer? value) + (keyword? value) + (class-lookup-ref? value))) + +(defn- ->entity-ids + [db value] + (letfn [(entity-id [item] + (or (cond + (de/entity? item) (:db/id item) + (integer? item) item + (keyword? item) (:db/id (d/entity db item)) + (class-lookup-ref? item) (:db/id (d/entity db item))) + (throw (ex-info "Unsupported class extends entity reference" + {:value item}))))] + (->> (cond + (nil? value) [] + (single-entity-ref? value) [value] + (coll? value) value + :else [value]) + (map entity-id)))) + +(defn- class-ancestor-ids + [db class-ids] + (set (mapcat (fn [class-id] + (some->> (d/entity db class-id) + ldb/get-class-extends + (map :db/id))) + class-ids))) + +(defn- direct-extends-retraction-tx-data + [class redundant-parent-ids] + (when (and (ldb/class? class) (seq redundant-parent-ids)) + (keep (fn [parent] + (when (contains? redundant-parent-ids (:db/id parent)) + [:db/retract (:db/id class) :logseq.property.class/extends (:db/id parent)])) + (:logseq.property.class/extends class)))) + +(defn- canonical-extends-ids + [db value] + (let [parent-ids (vec (->entity-ids db value))] + (remove (class-ancestor-ids db parent-ids) parent-ids))) + +(defn- normalize-extends-value + [db value] + (let [ids (vec (canonical-extends-ids db value))] + (if (single-entity-ref? value) + (first ids) + ids))) + +(defn- redundant-extends-retraction-tx-data + [db class value] + (let [parent-ids (set (->entity-ids db value)) + ancestor-ids (class-ancestor-ids db parent-ids) + inherited-parent-ids (set/union parent-ids ancestor-ids)] + (concat + (direct-extends-retraction-tx-data class ancestor-ids) + (mapcat #(direct-extends-retraction-tx-data (d/entity db %) inherited-parent-ids) + (db-class/get-structured-children db (:db/id class)))))) + (defn- build-property-value-tx-data [conn block property-id value] (when (some? value) @@ -122,9 +192,13 @@ multiple-values-empty? (and (sequential? old-value) (contains? (set (map :db/ident old-value)) :logseq.property/empty-placeholder)) extends? (= property-id :logseq.property.class/extends) + tx-value (if extends? + (let [value' (normalize-extends-value @conn value)] + (if (coll? value') (set value') value')) + value) update-block-tx (cond-> (outliner-core/block-with-updated-at {:db/id (:db/id block)}) true - (assoc property-id value) + (assoc property-id tx-value) (should-add-task-tag-for-property? conn block property-id) (assoc :block/tags :logseq.class/Task) (= :logseq.property/template-applied-to property-id) @@ -135,9 +209,7 @@ retract-multiple-values? (conj [:db/retract (:db/id update-block-tx) property-id]) extends? - (concat - (let [extends (ldb/get-class-extends (d/entity @conn value))] - (map (fn [extend] [:db/retract (:db/id block) property-id (:db/id extend)]) extends))) + (into (redundant-extends-retraction-tx-data @conn block value)) true (conj update-block-tx))))) @@ -535,10 +607,11 @@ (when (= property-id :block/tags) (outliner-validate/validate-tags-property @conn block-eids v)) (when (= property-id :logseq.property.class/extends) - (outliner-validate/validate-extends-property - @conn - (if (number? v) (d/entity @conn v) v) - (map #(d/entity @conn %) block-eids)))) + (doseq [parent-id (->entity-ids @conn v)] + (outliner-validate/validate-extends-property + @conn + (d/entity @conn parent-id) + (map #(d/entity @conn %) block-eids))))) (defn- normalize-default-url-property-value [conn property value] @@ -601,7 +674,7 @@ :i18n-key :page.validation/alias-batch-multiple-owners :message "Aliases can't be batch-set on multiple pages."}})))) -(defn batch-set-property! +(defn ^:large-vars/cleanup-todo batch-set-property! "Sets properties for multiple blocks. Automatically handles property value refs. Does no validation of property values. For :many properties, passing a collection replaces existing values in one call, while passing a scalar preserves add-single-value behavior." @@ -622,12 +695,20 @@ many? (= :db.cardinality/many (:db/cardinality property)) entity-id? (and (:entity-id? options) (number? v)) ref? (contains? db-property-type/all-ref-property-types property-type) + extends? (= property-id :logseq.property.class/extends) default-url-not-closed? (and (contains? #{:default :url} property-type) + (not extends?) (not (seq (entity-plus/lookup-kv-then-entity property :property/closed-values)))) - v' (if (and ref? (not entity-id?)) + v' (cond + extends? + (normalize-extends-value @conn v) + + (and ref? (not entity-id?)) (if default-url-not-closed? (normalize-and-validate-default-url-property-values conn property v many?) (convert-ref-property-values conn property-id v property-type {:many? many?})) + + :else v) _ (when (nil? v') (throw (ex-info "Property value must be not nil" {:v v}))) @@ -730,8 +811,15 @@ property (d/entity @conn property-id) property-type (get property :logseq.property/type :default) ref? (db-property-type/all-ref-property-types property-type) - v' (if ref? + extends? (= property-id :logseq.property.class/extends) + v' (cond + extends? + (normalize-extends-value @conn v) + + ref? (convert-ref-property-value conn property-id v property-type block-eid) + + :else v)] (when-not (and block property) (throw (ex-info "Set block property failed: block or property doesn't exist" @@ -744,8 +832,9 @@ (do (when (= property-id :block/tags) (outliner-validate/validate-tags-property @conn [block-eid] v')) - (when (= property-id :logseq.property.class/extends) - (outliner-validate/validate-extends-property @conn v' [block])) + (when extends? + (doseq [parent-id (->entity-ids @conn v')] + (outliner-validate/validate-extends-property @conn (d/entity @conn parent-id) [block]))) (cond db-attribute? (set-block-db-attribute! conn block property property-id v v') diff --git a/deps/outliner/test/logseq/outliner/property_test.cljs b/deps/outliner/test/logseq/outliner/property_test.cljs index ed0cec52f8f6..c1e35bf71ec7 100644 --- a/deps/outliner/test/logseq/outliner/property_test.cljs +++ b/deps/outliner/test/logseq/outliner/property_test.cljs @@ -481,6 +481,78 @@ (outliner-property/set-block-property! conn (:db/id class3) :logseq.property.class/extends (:db/id class1))) "Extends cycle")))) +(deftest extends-redundant-direct-parent-cleanup + (testing "Clean redundant direct parents from descendants when a class gets a new parent" + (let [conn (db-test/create-conn-with-blocks + {:classes {:A {} + :B {} + :C {:build/class-extends [:B]} + :D {:build/class-extends [:A :C]}}}) + b (d/entity @conn :user.class/B)] + (outliner-property/set-block-property! conn + (:db/id b) + :logseq.property.class/extends + (:db/id (d/entity @conn :user.class/A))) + (is (= [:user.class/C] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/D)))) + "D keeps only the nearest direct parent")))) + +(deftest extends-redundant-cleanup-with-lookup-ref-parent + (testing "Treat lookup refs as a single parent reference" + (let [conn (db-test/create-conn-with-blocks + {:classes {:A {} + :B {} + :C {:build/class-extends [:B]} + :D {:build/class-extends [:A :C]}}})] + (outliner-property/set-block-property! conn + (:db/id (d/entity @conn :user.class/B)) + :logseq.property.class/extends + [:db/ident :user.class/A]) + (is (= [:user.class/A] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/B)))) + "B uses the lookup ref as one parent") + (is (= [:user.class/C] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/D)))) + "D removes the direct parent inherited through C")))) + +(deftest extends-redundant-cleanup-with-keyword-vector-parents + (testing "Treat a vector of class idents as multiple parents" + (let [conn (db-test/create-conn-with-blocks + {:classes {:A {} + :B {} + :C {:build/class-extends [:A]} + :D {:build/class-extends [:A :B]}}})] + (outliner-property/batch-set-property! conn + [(:db/id (d/entity @conn :user.class/B))] + :logseq.property.class/extends + [:user.class/A :user.class/C]) + (is (= [:user.class/C] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/B)))) + "B keeps only the nearest parent") + (is (= [:user.class/B] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/D)))) + "D removes the direct parent inherited through B")))) + +(deftest extends-redundant-direct-parent-cleanup-for-root-reset + (testing "Clean descendant Root parents when an ancestor is reset to Root" + (let [conn (db-test/create-conn-with-blocks + {:classes {:B {} + :C {:build/class-extends [:B]} + :D {:build/class-extends [:logseq.class/Root :C]}}})] + (outliner-property/set-block-property! conn + (:db/id (d/entity @conn :user.class/B)) + :logseq.property.class/extends + :logseq.class/Root) + (is (= [:user.class/C] + (:logseq.property.class/extends + (db-test/readable-properties (d/entity @conn :user.class/D)))) + "D removes the direct Root parent inherited through C")))) + (deftest delete-property-value! (let [conn (db-test/create-conn-with-blocks {:classes {:C1 {} From 53b7d9cfd12f0002bd8201ffb59c8bd19c796d54 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 14:31:03 +0800 Subject: [PATCH 0034/1400] fix: allow repeated date picker selection (#12732) * fix: allow repeated date picker selection Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- src/main/frontend/components/datepicker.cljs | 7 ++-- .../frontend/components/datepicker_test.cljs | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 src/test/frontend/components/datepicker_test.cljs diff --git a/src/main/frontend/components/datepicker.cljs b/src/main/frontend/components/datepicker.cljs index 8d8137a4c5d2..907cd6ea7fd2 100644 --- a/src/main/frontend/components/datepicker.cljs +++ b/src/main/frontend/components/datepicker.cljs @@ -16,10 +16,9 @@ (state/set-state! :date-picker/date (t/today))) state)} [dom-id format] - (let [date (state/sub :date-picker/date) + (let [selected-date (state/sub :date-picker/date) select-handler! (fn [^js d] - ;; d is nil when clicked more than once - (when d + (when-let [d (or d (state/sub :date-picker/date))] (let [gd (goog.date.Date. (.getFullYear d) (.getMonth d) (.getDate d)) journal (date/js-date->journal-title gd)] ;; similar to page reference @@ -37,7 +36,7 @@ {:mode "single" :initial-focus true :show-week-number false - :selected date + :selected selected-date :on-select select-handler! :on-day-key-down (fn [^js d _ ^js e] (when (= "Enter" (.-key e)) diff --git a/src/test/frontend/components/datepicker_test.cljs b/src/test/frontend/components/datepicker_test.cljs new file mode 100644 index 000000000000..0b6b7b88c5c6 --- /dev/null +++ b/src/test/frontend/components/datepicker_test.cljs @@ -0,0 +1,32 @@ +(ns frontend.components.datepicker-test + (:require ["react" :as react] + ["react-dom/server" :as react-dom-server] + [cljs.test :refer [deftest is]] + [frontend.commands :as commands] + [frontend.components.datepicker :as datepicker] + [frontend.date :as date] + [frontend.handler.editor :as editor-handler] + [frontend.state :as state] + [frontend.ui :as ui])) + +(deftest repeated-selected-date-click-inserts-current-date-test + (let [selected-date (js/Date. 2026 4 20) + app-state* (atom {:date-picker/date selected-date}) + calendar-opts* (atom nil) + inserted* (atom [])] + (with-redefs [state/state app-state* + state/sub (fn [k] (get @app-state* k)) + state/set-state! (fn [k v & _] (swap! app-state* assoc k v) nil) + state/clear-editor-action! (fn [] nil) + date/js-date->journal-title (constantly "May 20th, 2026") + editor-handler/insert-command! (fn [& args] + (swap! inserted* conj args)) + ui/nlp-calendar (fn [opts] + (reset! calendar-opts* opts) + (.createElement react "div"))] + (.renderToStaticMarkup react-dom-server (datepicker/date-picker "edit-block" nil)) + (reset! commands/*current-command :date-picker) + ((:on-select @calendar-opts*) nil) + (is (= [["edit-block" "[[May 20th, 2026]]" nil {:command :page-ref}]] + @inserted*)) + (is (nil? @commands/*current-command))))) From 693dd7747d7ddb30f45f1aef26ee16ed9a9b4117 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 14:35:34 +0800 Subject: [PATCH 0035/1400] fix: use modern AppImage toolset for sandbox fallback --- resources/electron-builder.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/electron-builder.yml b/resources/electron-builder.yml index 3b47b078cb99..2afb9ee73f8a 100644 --- a/resources/electron-builder.yml +++ b/resources/electron-builder.yml @@ -5,6 +5,9 @@ directories: buildResources: . output: dist +toolsets: + appimage: "1.0.3" + protocols: - name: logseq schemes: From 92b9f3980fabfeb14572711de39ec65e7be89bd1 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 14:47:01 +0800 Subject: [PATCH 0036/1400] fix: prune mobile stack on browser back (#12731) --- src/main/mobile/navigation.cljs | 11 +++++++++ src/test/mobile/navigation_test.cljs | 35 ++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/main/mobile/navigation.cljs b/src/main/mobile/navigation.cljs index 5845f7a5a333..239b5e009e8c 100644 --- a/src/main/mobile/navigation.cljs +++ b/src/main/mobile/navigation.cljs @@ -158,6 +158,17 @@ (conj (vec (butlast history)) entry) (conj history entry)) + "pop" (if-let [idx (->> history + (map-indexed vector) + (keep (fn [[idx history-entry]] + (when (= path (:path history-entry)) + idx))) + last)] + (subvec history 0 (inc idx)) + (if (seq history) + (conj (vec (butlast history)) entry) + [entry])) + history)))] (swap! stack-history update stack (fn [{:keys [history]}] diff --git a/src/test/mobile/navigation_test.cljs b/src/test/mobile/navigation_test.cljs index 2d94020bffa9..70cbf156f180 100644 --- a/src/test/mobile/navigation_test.cljs +++ b/src/test/mobile/navigation_test.cljs @@ -17,6 +17,11 @@ :route {:to name :path-params {} :query-params {}} :route-match (route-match name)}) +(defn- stack-paths + [stack] + (->> (get-in @@#'mobile-nav/stack-history [stack :history]) + (mapv :path))) + (defn- reset-navigation-state! [] (reset! @#'mobile-nav/navigation-source nil) (reset! @#'mobile-nav/initialised-stacks {}) @@ -104,6 +109,36 @@ [:page {} {}]] @replace-calls)))))) +(deftest browser-back-prunes-active-stack-before-tab-restore + (testing "a page popped by Back should not be restored when switching back to the tab" + (let [route-matches (atom []) + replace-calls (atom [])] + (reset! mobile-state/*tab "home") + (reset! @#'mobile-nav/active-stack "home") + (reset! @#'mobile-nav/initialised-stacks {"home" true + "graphs" true}) + (reset! @#'mobile-nav/stack-history + {"home" {:history [(stack-entry :home "/") + (stack-entry :page "/page/recent")]} + "graphs" {:history [(stack-entry :graphs "/__stack__/graphs")]}}) + (with-redefs [mobile-nav/orig-replace-state (fn [& args] (swap! replace-calls conj args)) + route-handler/set-route-match! (fn [match] (swap! route-matches conj match)) + mobile-util/native-platform? (constantly false)] + (reset! @#'mobile-nav/navigation-source :pop) + (mobile-nav/notify-route-change! + {:route {:to :home + :path-params {} + :query-params {}} + :route-match (route-match :home) + :path "/" + :stack "home"}) + (mobile-state/set-tab! "graphs") + (mobile-state/set-tab! "home") + (is (= ["/"] (stack-paths "home"))) + (is (= :home (get-in (last @route-matches) [:data :name]))) + (is (= [[:home {} {}]] + @replace-calls)))))) + (deftest leaving-search-does-not-clear-query-during-tab-transition (testing "native clears search state when Search opens, not while Home is appearing" (let [replace-calls (atom [])] From 97e1dfc0d85c2d4286957a6734c94c01919677ca Mon Sep 17 00:00:00 2001 From: charlie Date: Thu, 28 May 2026 15:11:17 +0800 Subject: [PATCH 0037/1400] fix(plugin): marketplace related ui --- deps/shui/src/logseq/shui/dialog/core.cljs | 23 ++++++++++++++-------- src/main/frontend/components/plugins.cljs | 3 +-- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/deps/shui/src/logseq/shui/dialog/core.cljs b/deps/shui/src/logseq/shui/dialog/core.cljs index bf9e37128224..f04aebdb5b2e 100644 --- a/deps/shui/src/logseq/shui/dialog/core.cljs +++ b/deps/shui/src/logseq/shui/dialog/core.cljs @@ -149,13 +149,20 @@ (on-open-change {:value v :set-open! set-open!}) (set-open! v))))}) (let [onPointerDownOutside (:onPointerDownOutside content-props) + onEscapeKeyDown (:onEscapeKeyDown content-props) + handle-key-escape! (fn [^js e] + (if (fn? onEscapeKeyDown) + (onEscapeKeyDown e) + ;; default handled by global Escape listener + (.preventDefault e))) + handle-pointer-down-outside! (fn [^js e] + (when (fn? onPointerDownOutside) + (onPointerDownOutside e)) + (when-not (some-> (.-target e) (.closest ".ui__dialog-overlay")) + (.preventDefault e))) content-props (assoc content-props - :onPointerDownOutside - (fn [^js e] - (when (fn? onPointerDownOutside) - (onPointerDownOutside e)) - (when-not (some-> (.-target e) (.closest ".ui__dialog-overlay")) - (.preventDefault e))))] + :onEscapeKeyDown handle-key-escape! + :onPointerDownOutside handle-pointer-down-outside!)] (dialog-content (cond-> (merge props content-props) auto-width? (assoc :data-auto-width true) @@ -279,8 +286,8 @@ (let [id (:id config) alert? (:alert? config) config (interpret-vals config - [:title :description :content :footer] - {:id id})] + [:title :description :content :footer] + {:id id})] (case alert? :default (alert-inner config) diff --git a/src/main/frontend/components/plugins.cljs b/src/main/frontend/components/plugins.cljs index e61c47e71fcd..0a15c2b50652 100644 --- a/src/main/frontend/components/plugins.cljs +++ b/src/main/frontend/components/plugins.cljs @@ -215,8 +215,7 @@ (rum/defc remote-readme-display [{:keys [repo]} _content] - (let [src (str (if (string/includes? js/location.host "logseq") - "./static/" "./") "marketplace.html?repo=" repo)] + (let [src (str "./marketplace.html?repo=" repo)] [:iframe.lsp-frame-readme {:src src}])) (defn security-warning From bd1c63777ae8567f65616ccbb781fdf92b4c24a6 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 15:59:02 +0800 Subject: [PATCH 0038/1400] fix: home/end/pageup/pagedown doesn't work Root cause: should focus on main-content-container by default --- src/main/frontend/components/container.cljs | 17 ++++++++++++++++- src/main/frontend/components/theme.cljs | 3 +-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/main/frontend/components/container.cljs b/src/main/frontend/components/container.cljs index 95825fe7fffa..1f7272f8b382 100644 --- a/src/main/frontend/components/container.cljs +++ b/src/main/frontend/components/container.cljs @@ -42,6 +42,19 @@ [reitit.frontend.easy :as rfe] [rum.core :as rum])) +(defn- focus-main-content-container-if-body! + [] + (when-let [^js element (gdom/getElement "main-content-container")] + (let [active-element (.-activeElement js/document)] + (when (and (not (state/editing?)) + (not (state/modal-opened?)) + (or (nil? active-element) + (identical? active-element (.-body js/document)))) + (.focus element #js {:preventScroll true}))))) + +(defn- schedule-main-content-focus! [] + (util/schedule focus-main-content-container-if-body!)) + (rum/defc main < {:did-mount (fn [state] (when-let [element (gdom/getElement "main-content-container")] @@ -55,6 +68,7 @@ (common-handler/listen-to-scroll! element) (when (:margin-less-pages? (first (:rum/args state))) ;; makes sure full screen pages displaying without scrollbar (set! (.. element -scrollTop) 0))) + (schedule-main-content-focus!) state) :will-unmount (fn [state] (when-let [el (gdom/getElement "main-content-container")] @@ -460,7 +474,8 @@ (d/remove-class! container "blocks-selection-mode") (when (and (> (count (state/get-selection-blocks)) 1) (not (util/input? js/document.activeElement))) - (util/clear-selection!))))} + (util/clear-selection!))) + (schedule-main-content-focus!))} [:button#skip-to-main {:on-click #(ui/focus-element (ui/main-node)) diff --git a/src/main/frontend/components/theme.cljs b/src/main/frontend/components/theme.cljs index 58e3fa4bcb4b..0d5f3c4aa703 100644 --- a/src/main/frontend/components/theme.cljs +++ b/src/main/frontend/components/theme.cljs @@ -140,8 +140,7 @@ [settings-open?]) [:div#root-container.theme-container - {:on-click on-click - :tab-index -1} + {:on-click on-click} child (pdf/default-embed-playground) From 52398ac7aa4e7a12550e60e9ed26cfaa5d9f1fa3 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 20:16:13 +0800 Subject: [PATCH 0039/1400] chore: remove old cli (#12739) --- .github/workflows/build.yml | 41 +- .github/workflows/deps-cli.yml | 113 +- .gitignore | 1 + bb.edn | 5 - deps.edn | 1 - deps/cli/.carve/ignore | 11 - deps/cli/.clj-kondo/config.edn | 29 - deps/cli/.gitignore | 2 - deps/cli/CHANGELOG.md | 46 - deps/cli/README.md | 204 -- deps/cli/bb.edn | 44 - deps/cli/cli.mjs | 15 - deps/cli/deps.edn | 7 - deps/cli/nbb.edn | 6 - deps/cli/package.json | 42 - deps/cli/pnpm-lock.yaml | 1829 ----------------- deps/cli/src/logseq/cli.cljs | 194 -- deps/cli/src/logseq/cli/commands/append.cljs | 14 - deps/cli/src/logseq/cli/commands/export.cljs | 79 - .../src/logseq/cli/commands/export_edn.cljs | 68 - deps/cli/src/logseq/cli/commands/graph.cljs | 43 - .../src/logseq/cli/commands/import_edn.cljs | 40 - .../src/logseq/cli/commands/mcp_server.cljs | 113 - deps/cli/src/logseq/cli/commands/query.cljs | 106 - deps/cli/src/logseq/cli/commands/search.cljs | 69 - .../cli/src/logseq/cli/commands/validate.cljs | 30 - deps/cli/src/logseq/cli/common/graph.cljs | 29 - deps/cli/src/logseq/cli/spec.cljs | 97 - deps/cli/src/logseq/cli/text_util.cljs | 43 - deps/cli/src/logseq/cli/util.cljs | 90 - deps/cli/test/logseq/cli/text_util_test.cljs | 35 - deps/cli/test/logseq/cli_test.cljs | 23 - deps/common/.carve/ignore | 4 + deps/common/src/logseq/common/graph.cljs | 20 + .../033-desktop-db-worker-node-backend.md | 2 +- .../db-worker/005-unified-graph-backup.md | 2 +- .../logseq-cli/004-graph-export.md | 8 +- scripts/prepare-cli-package.mjs | 118 ++ scripts/src/logseq/tasks/dev/lint.clj | 2 +- .../src/logseq/tasks/dev/lint_test_deps.clj | 7 - scripts/test-cli-release-config.mjs | 158 ++ src/electron/electron/db.cljs | 12 +- src/electron/electron/handler.cljs | 3 +- .../electron/electron/mcp_server.cljs | 10 +- src/electron/electron/server.cljs | 12 +- src/electron/electron/utils.cljs | 6 +- src/main/frontend/extensions/zip.cljs | 4 +- src/main/frontend/handler/export/common.cljs | 42 +- .../frontend/handler/export/common_impl.cljs | 8 +- src/main/frontend/handler/export/html.cljs | 8 +- src/main/frontend/handler/export/opml.cljs | 8 +- src/main/frontend/handler/export/text.cljs | 16 +- .../frontend/handler/export/text_impl.cljs | 46 +- .../main/frontend/handler/export}/util.cljc | 6 +- src/main/frontend/util/text.cljs | 20 +- src/main/frontend/worker/db_core.cljs | 12 +- src/main/frontend/worker/export.cljs | 2 +- src/main/frontend/worker/markdown_mirror.cljs | 2 +- src/main/logseq/api.cljs | 2 +- src/main/logseq/api/db_based/cli.cljs | 8 +- .../main/logseq/api/db_based}/tools.cljs | 24 +- .../main/logseq/common/export}/file.cljs | 5 +- src/main/logseq/sdk/utils.cljs | 4 +- src/test/electron/db_test.cljs | 26 +- .../handler/export_property_test.cljs | 2 +- src/test/frontend/util/text_test.cljs | 8 + src/test/frontend/worker/db_core_test.cljs | 32 +- .../logseq/{cli => }/common/graph_test.cljs | 22 +- 68 files changed, 565 insertions(+), 3575 deletions(-) delete mode 100644 deps/cli/.carve/ignore delete mode 100644 deps/cli/.clj-kondo/config.edn delete mode 100644 deps/cli/.gitignore delete mode 100644 deps/cli/CHANGELOG.md delete mode 100644 deps/cli/README.md delete mode 100644 deps/cli/bb.edn delete mode 100755 deps/cli/cli.mjs delete mode 100644 deps/cli/deps.edn delete mode 100644 deps/cli/nbb.edn delete mode 100644 deps/cli/package.json delete mode 100644 deps/cli/pnpm-lock.yaml delete mode 100644 deps/cli/src/logseq/cli.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/append.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/export.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/export_edn.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/graph.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/import_edn.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/mcp_server.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/query.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/search.cljs delete mode 100644 deps/cli/src/logseq/cli/commands/validate.cljs delete mode 100644 deps/cli/src/logseq/cli/common/graph.cljs delete mode 100644 deps/cli/src/logseq/cli/spec.cljs delete mode 100644 deps/cli/src/logseq/cli/text_util.cljs delete mode 100644 deps/cli/src/logseq/cli/util.cljs delete mode 100644 deps/cli/test/logseq/cli/text_util_test.cljs delete mode 100644 deps/cli/test/logseq/cli_test.cljs create mode 100644 scripts/prepare-cli-package.mjs create mode 100644 scripts/test-cli-release-config.mjs rename deps/cli/src/logseq/cli/common/mcp/server.cljs => src/electron/electron/mcp_server.cljs (97%) rename deps/cli/src/logseq/cli/common/export/common.cljs => src/main/frontend/handler/export/common_impl.cljs (99%) rename deps/cli/src/logseq/cli/common/export/text.cljs => src/main/frontend/handler/export/text_impl.cljs (92%) rename {deps/cli/src/logseq/cli/common => src/main/frontend/handler/export}/util.cljc (86%) rename {deps/cli/src/logseq/cli/common/mcp => src/main/logseq/api/db_based}/tools.cljs (94%) rename {deps/cli/src/logseq/cli/common => src/main/logseq/common/export}/file.cljs (99%) rename src/test/logseq/{cli => }/common/graph_test.cljs (67%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 90a8e6d412d4..2321048df900 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -208,6 +208,7 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'pnpm' cache-dependency-path: | + pnpm-lock.yaml deps/db/pnpm-lock.yaml scripts/pnpm-lock.yaml @@ -223,22 +224,46 @@ jobs: cli: ${{ env.CLOJURE_VERSION }} bb: ${{ env.BABASHKA_VERSION }} + - name: Install CLI Linux runtime deps + run: sudo apt-get update && sudo apt-get install -y libsecret-1-0 + - name: Fetch scripts pnpm deps run: cd scripts && pnpm install --frozen-lockfile + - name: Fetch root pnpm deps + run: pnpm install --frozen-lockfile + - name: Create DB graph with properties - run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs ./properties-graph + run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_properties.cljs ./cli-root/graphs/properties-graph - # TODO: Use a smaller, test-focused graph to test classes - name: Create DB graph with classes - run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs ./schema-graph + run: cd scripts && pnpm exec nbb-logseq src/logseq/tasks/db_graph/create_graph_with_schema_org.cljs ./cli-root/graphs/schema-graph - name: Fetch deps/db pnpm deps run: cd deps/db && pnpm install --frozen-lockfile - # Can run from deps/db since all JS deps for this command are available in deps/db - - name: Validate created DB graphs - run: cd deps/db && pnpm exec nbb-logseq -cp src:../cli/src -m logseq.cli validate -g ../../scripts/properties-graph ../../scripts/schema-graph + - name: Build logseq CLI runtime + run: | + clojure -M:cljs release logseq-cli + pnpm db-worker-node:release:bundle + pnpm --dir deps/db-sync build:node-adapter + node scripts/prepare-cli-package.mjs + pnpm --dir dist/cli-package install --prod + pnpm --dir dist/cli-package pack --pack-destination ../ + + - name: Smoke test packaged CLI + run: node dist/cli-package/dist/logseq.js --version - - name: Export a created DB graph and confirm the export is idempotent - run: cd deps/db && pnpm exec nbb-logseq -cp src:../cli/src -m logseq.cli export-edn -g ../../scripts/properties-graph -f properties.edn --roundtrip + - name: Validate created DB graphs + run: | + node dist/cli-package/dist/logseq.js --root-dir scripts/cli-root --graph properties-graph --timeout-ms 3000 --profile --verbose graph validate + node dist/cli-package/dist/logseq.js --root-dir scripts/cli-root --graph schema-graph --timeout-ms 120000 --profile --verbose graph validate + + - name: Print db-worker-node logs on graph validation failure + if: failure() + run: | + find scripts/cli-root/graphs -maxdepth 2 -name 'db-worker-node-*.log' -print -exec tail -n 200 {} \; || true + pgrep -af db-worker-node || true + + - name: Export a created DB graph + run: node dist/cli-package/dist/logseq.js --root-dir scripts/cli-root --graph properties-graph --timeout-ms 3000 graph export --type edn --file scripts/properties.edn diff --git a/.github/workflows/deps-cli.yml b/.github/workflows/deps-cli.yml index 1866076cc0be..2ba11567a7bc 100644 --- a/.github/workflows/deps-cli.yml +++ b/.github/workflows/deps-cli.yml @@ -1,30 +1,46 @@ name: logseq/cli CI on: - # Path filters ensure jobs only kick off if a change is made to cli or - # its local dependencies + # Path filters ensure jobs only kick off if a change is made to the CLI or + # its local dependencies. push: branches: [master] paths: - - 'deps/cli/**' + - 'src/main/logseq/cli/**' + - 'src/test/logseq/cli/**' + - 'cli-e2e/**' + - 'dist/logseq.js' + - 'scripts/prepare-cli-package.mjs' + - 'scripts/test-cli-release-config.mjs' - '.github/workflows/deps-cli.yml' - - '!deps/cli/**.md' - # Deps that logseq/cli depends on should trigger this workflow + - '!**/*.md' + # Deps that logseq/cli depends on should trigger this workflow. - 'deps/outliner/**' - 'deps/graph-parser/**' - 'deps/db/**' - 'deps/common/**' + - 'deps/db-sync/**' + - 'src/main/frontend/worker/**' + - 'src/main/logseq/db_worker/**' pull_request: branches: [master] paths: - - 'deps/cli/**' + - 'src/main/logseq/cli/**' + - 'src/test/logseq/cli/**' + - 'cli-e2e/**' + - 'dist/logseq.js' + - 'scripts/prepare-cli-package.mjs' + - 'scripts/test-cli-release-config.mjs' - '.github/workflows/deps-cli.yml' - - '!deps/cli/**.md' - # Deps that logseq/cli depends on should trigger this workflow + - '!**/*.md' + # Deps that logseq/cli depends on should trigger this workflow. - 'deps/outliner/**' - 'deps/graph-parser/**' - 'deps/db/**' - 'deps/common/**' + - 'deps/db-sync/**' + - 'src/main/frontend/worker/**' + - 'src/main/logseq/db_worker/**' workflow_dispatch: inputs: git-ref: @@ -40,15 +56,9 @@ on: - latest default: "latest" -defaults: - run: - working-directory: deps/cli - env: CLOJURE_VERSION: '1.12.4.1618' - # This is the same as 1.8. JAVA_VERSION: '21' - # This is the latest node version we can run. NODE_VERSION: '24' BABASHKA_VERSION: '1.12.215' @@ -66,19 +76,18 @@ jobs: version: 10.33.0 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'pnpm' - cache-dependency-path: deps/cli/pnpm-lock.yaml + cache-dependency-path: pnpm-lock.yaml - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: ${{ env.JAVA_VERSION }} - # Clojure needed for bb step - name: Set up Clojure uses: DeLaGuardo/setup-clojure@13.5 with: @@ -88,46 +97,16 @@ jobs: - name: Fetch pnpm deps run: pnpm install --frozen-lockfile - - name: Run nbb-logseq tests - run: pnpm test - - # In this job because it depends on an npm package - - name: Load namespaces into nbb-logseq - run: bb test:load-all-namespaces-with-nbb . - - lint: - runs-on: ubuntu-latest + - name: Build logseq CLI + run: | + clojure -M:cljs release logseq-cli + pnpm db-worker-node:release:bundle - steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Verify CLI publish config + run: node scripts/test-cli-release-config.mjs - - name: Set up Java - uses: actions/setup-java@v3 - with: - distribution: 'zulu' - java-version: ${{ env.JAVA_VERSION }} - - - name: Set up Clojure - uses: DeLaGuardo/setup-clojure@13.5 - with: - cli: ${{ env.CLOJURE_VERSION }} - bb: ${{ env.BABASHKA_VERSION }} - - - name: Run clj-kondo lint - run: clojure -M:clj-kondo --lint src test - - - name: Carve lint for unused vars - run: bb lint:carve - - - name: Lint for vars that are too large - run: bb lint:large-vars - - - name: Lint for namespaces that aren't documented - run: bb lint:ns-docstrings - - - name: Lint for public vars that are private based on usage - run: bb lint:minimize-public-vars + - name: Smoke test CLI + run: node dist/logseq.js --help release: if: ${{ github.event_name == 'workflow_dispatch' }} @@ -144,19 +123,18 @@ jobs: version: 10.33.0 - name: Set up Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} cache: 'pnpm' - cache-dependency-path: deps/cli/pnpm-lock.yaml + cache-dependency-path: pnpm-lock.yaml - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: distribution: 'zulu' java-version: ${{ env.JAVA_VERSION }} - # Clojure needed for bb step - name: Set up Clojure uses: DeLaGuardo/setup-clojure@13.5 with: @@ -166,16 +144,23 @@ jobs: - name: Fetch pnpm deps run: pnpm install --frozen-lockfile - - name: Bundle vendor deps - run: bb build:vendor-nbb-deps + - name: Build logseq CLI + run: | + clojure -M:cljs release logseq-cli + pnpm db-worker-node:release:bundle + + - name: Prepare npm package + run: node scripts/prepare-cli-package.mjs - # - name: Debug package - # run: pnpm pack && tar -tf logseq-cli-*.tgz + - name: Smoke test npm package + run: node dist/cli-package/dist/logseq.js --help - name: Authenticate with registry + working-directory: dist/cli-package env: NPM_TOKEN: ${{ secrets.NPM_CLI_TOKEN }} run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc - name: Publish package + working-directory: dist/cli-package run: npm publish --tag "${{ github.event.inputs.release-tag || 'alpha' }}" --access public diff --git a/.gitignore b/.gitignore index 988701d79e3e..5138f1bade39 100644 --- a/.gitignore +++ b/.gitignore @@ -85,6 +85,7 @@ deps/db-sync/data *.map /dist/db-worker-node.js /dist/build/ +/dist/cli-package/ /dist/db-worker-node-assets.json /dist/*.wasm /dist/cljs-runtime/ diff --git a/bb.edn b/bb.edn index bd93e1f05ab8..5065aff826c3 100644 --- a/bb.edn +++ b/bb.edn @@ -72,11 +72,6 @@ (run '-dev:publishing-dev {:parallel true}) (run '-dev:publishing-release))} - ;; legacy cli - dev:cli - {:doc "Run CLI with current deps/db code. Commands with JS deps are not usable e.g. mcp-server" - :task (apply shell {:dir "deps/db"} - "pnpm exec nbb-logseq -cp src:../cli/src:../graph-parser/src:../outliner/src -m logseq.cli" *command-line-args*)} dev:query {:doc "Query a DB graph's datascript db" :requires ([babashka.fs :as fs]) diff --git a/deps.edn b/deps.edn index 9c8cc54a6179..1ba0c10ba653 100644 --- a/deps.edn +++ b/deps.edn @@ -42,7 +42,6 @@ logseq/outliner {:local/root "deps/outliner"} logseq/db-sync {:local/root "deps/db-sync"} logseq/publishing {:local/root "deps/publishing"} - logseq/cli {:local/root "deps/cli"} logseq/shui {:local/root "deps/shui"} metosin/malli {:git/url "https://github.com/metosin/malli" :sha "52ea58a36ff5172b38dfc526ca638afa7226a4a0"} diff --git a/deps/cli/.carve/ignore b/deps/cli/.carve/ignore deleted file mode 100644 index 9a690f58e1ae..000000000000 --- a/deps/cli/.carve/ignore +++ /dev/null @@ -1,11 +0,0 @@ -;; Lazy loaded -logseq.cli.commands.export-edn/export -logseq.cli.commands.graph/show-graph -logseq.cli.commands.graph/list-graphs -logseq.cli.commands.query/query -logseq.cli.commands.search/search -logseq.cli.commands.export/export -logseq.cli.commands.append/append -logseq.cli.commands.mcp-server/start -logseq.cli.commands.import-edn/import-edn -logseq.cli.commands.validate/validate diff --git a/deps/cli/.clj-kondo/config.edn b/deps/cli/.clj-kondo/config.edn deleted file mode 100644 index 52d461f1b7f1..000000000000 --- a/deps/cli/.clj-kondo/config.edn +++ /dev/null @@ -1,29 +0,0 @@ -{:linters - {:aliased-namespace-symbol {:level :warning} - :namespace-name-mismatch {:level :warning} - :used-underscored-binding {:level :warning} - :shadowed-var {:level :warning - :exclude [meta time min meta name type]} - - :consistent-alias - {:aliases {"fs" fs - "node-path" path - clojure.pprint pprint - clojure.string string - datascript.core d - logseq.cli.commands.graph cli-graph - logseq.cli.common.mcp.server cli-common-mcp-server - logseq.cli.common.mcp.tools cli-common-mcp-tools - logseq.cli.common.graph cli-common-graph - logseq.cli.common.export.text cli-export-text - logseq.cli.common.export.common cli-export-common - logseq.cli.common.file common-file - logseq.cli.util cli-util - logseq.cli.text-util cli-text-util - logseq.common.config common-config - logseq.common.graph common-graph - logseq.common.util.date-time date-time-util - logseq.db.common.sqlite common-sqlite}}} - :lint-as {promesa.core/let clojure.core/let} - :skip-comments true - :output {:progress true}} diff --git a/deps/cli/.gitignore b/deps/cli/.gitignore deleted file mode 100644 index d0c62dc04bca..000000000000 --- a/deps/cli/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.clj-kondo/.cache -/vendor diff --git a/deps/cli/CHANGELOG.md b/deps/cli/CHANGELOG.md deleted file mode 100644 index 42b95f803bb1..000000000000 --- a/deps/cli/CHANGELOG.md +++ /dev/null @@ -1,46 +0,0 @@ -## 0.4.3 -* Add `--roundtrip` option to `export-edn` command -* Fix `list` command to only display DB graphs -* Fix `validate` command not working with latest schema - -## 0.4.2 -* Add `--help` to all commands as an alternative to `help [command]` -* Add `--validate` option to `export-edn` command -* Fix cli can't run in CI environments -* Fix `import-edn` and `mcp-server` commands not building refs for new or edited nodes - -## 0.4.1 -* Add `--open-schema` option to `validate` command -* Fix `append` command fails -* Fix `import-edn` command hangs on unexpected errors - -## 0.4.0 -* BREAKING CHANGE: Commands that call local graphs are invoked with `-g` instead of as an argument e.g. `logseq search foo -g db-name` instead of `logseq search db-name foo` -* Add `import-edn` command for local and in-app graphs -* Add `validate` command for local graphs -* Add `export-edn` command for API mode -* Fix most commands with API mode not respecting `$LOGSEQ_API_SERVER_TOKEN` -* Fix API `mcp-server` command failing lazily -* Fix commands failing confusingly when given a file graph -* Fix `query` command with multiple local graphs not switching graphs -* Fix API `search` command - -## 0.3.0 -* Add mcp-server command to run a MCP server -* All commands that have graph args and options now support local paths e.g. `logseq search $HOME/Downloads/logseq_db_yep_1751032977.sqlite foo` -* Fix: Unexpected errors don't exit with 1 - -## 0.2.0 -* Add export command to export graph as markdown -* Add append command to add text to current page -* Change export-edn command to default to writing to a file, like the export command -* Rename --api-query-token options to --api-server-token -* API related commands can also authenticate with $LOGSEQ_API_SERVER_TOKEN -* Add descriptions for most commands to explain in-depth usage - -## 0.1.0 - -* Initial release! -* Provides commands: list, show, search, query, export-edn and help -* All commands work offline. search and query have options for calling HTTP API Server of - open desktop Logseq app diff --git a/deps/cli/README.md b/deps/cli/README.md deleted file mode 100644 index b63eefe09fab..000000000000 --- a/deps/cli/README.md +++ /dev/null @@ -1,204 +0,0 @@ -## Description - -This library provides a `logseq` CLI for DB graphs created using the [database-version](/README.md#-database-version). By default, the CLI works offline with local graphs. This allows for running commands automatically on CI/CD platforms like GitHub Actions. Most CLI commands also connect to the current DB graph in a desktop app (a.k.a. in-app graph) if the [HTTP API Server](https://docs.logseq.com/#/page/local%20http%20server) is turned on. - -## Install - -Install the `logseq` CLI with `npm install -g @logseq/cli`. - -## Usage - -This section assumes you have installed the CLI from npm or via the [dev -setup](#setup). If you haven't, substitute `node cli.mjs` for `logseq` e.g. -`node.cli.mjs -h`. - -All commands work with both local graphs and the current in-app graph except for `append` (in-app graph only), `validate` (local graph only) and `export` (local graph only). For a command to work with an in-app graph, the [HTTP API Server](https://docs.logseq.com/#/page/local%20http%20server) must be turned on. - -Now let's use the CLI! - -```sh -$ logseq -h -Usage: logseq [command] [options] - -Options: - -v, --version Print version - -Commands: -list List local graphs -show Show DB graph(s) info -search [options] Search DB graph -query [options] Query DB graph(s) -export [options] Export DB graph as Markdown -export-edn [options] Export DB graph as EDN -import-edn [options] Import into DB graph with EDN -append [options] Appends text to current page -mcp-server [options] Run a MCP server -validate [options] Validate DB graph -help Print a command's help - -$ logseq list -db-test -docs -woot -... - -$ logseq show db-test - -| Name | Value | -|------------------------------+----------------------------------------------------| -| Graph directory | /Users/me/logseq/graphs/db-test | -| Graph created at | Jul 12th, 2025 | -| Graph schema version | {:major 65, :minor 7} | -| Graph initial schema version | {:major 65, :minor 7} | -| Graph created by commit | https://github.com/logseq/logseq/commit/3c93fd2637 | -| Graph imported by | :cli/create-graph | -``` - -To run a command against the current desktop graph, set `$LOGSEQ_API_SERVER_TOKEN` once or set `-a` each time with a valid token for the desktop's HTTP API server: - -```sh -# Search your current graph and print highlighted results one per line like grep -$ logseq search woot -a my-token -Search found 100 results: -dev:db-export woot woot.edn && dev:create woot2 woot.edn -dev:diff-graphs woot woot2 -... -# Can also authenticate api with $LOGSEQ_API_SERVER_TOKEN -$ export LOGSEQ_API_SERVER_TOKEN=my-token -$ logseq search woot -... -``` - -Here are more examples of all the available commands: -```sh -# Search a local graph -$ logseq search page -g woot -Search found 23 results: -Node page -Annotation page -... - -# Query a graph locally using `d/entity` id(s) like an integer or a :db/ident -# Can also specify a uuid string to fetch an entity -$ logseq query 10 :logseq.class/Tag -g woot -({:db/id 10, - :db/ident :logseq.kv/graph-git-sha, - :kv/value "f736895b1b-dirty"} - {:block/uuid #uuid "00000002-5389-0208-3000-000000000000", - :block/updated-at 1751990934670, - :logseq.property.class/extends #{{:db/id 1}}, - :block/created-at 1751990934670, - :logseq.property/built-in? true, - :block/tags #{{:db/id 2}}, - :block/title "Tag", - :db/id 2, - :db/ident :logseq.class/Tag, - :block/name "tag"}) - -# Query a graph using a datalog query -$ logseq query '[:find (pull ?b [*]) :where [?b :kv/value]]' -g woot -[{:db/id 5, :db/ident :logseq.kv/db-type, :kv/value "db"} - {:db/id 6, - :db/ident :logseq.kv/schema-version, - :kv/value {:major 65, :minor 7}} - -# Query the current graph using the api server -# An api query can be a datalog query or a simple query -$ logseq query '(task DOING)' -a my-token - [{:journalDay 20250717, - :name "jul 17th, 2025", - :title "Jul 17th, 2025", - :type "journal", - :uuid "00000001-2025-0717-0000-000000000000", - :id 36418, - :content "Jul 17th, 2025"}, - :title - "DOING Logseq CLI\nid:: 68795144-e5f6-48e8-849d-79cd6473b952\n:LOGBOOK:\nCLOCK: [2025-07-17 Thu 12:37:09]\n:END:", - :propertiesOrder ["id"], - :id 37013, - :order "aF", - :uuid "68795144-e5f6-48e8-849d-79cd6473b952"} - ... - -# Export local graph as markdown -$ logseq export -g yep -Exported 41 pages to yep_markdown_1756128259.zip - -# Export current graph as EDN -$ logseq export-edn -a my-token -Exported 16 properties, 3 classes and 16 pages to yep_1763407592.edn -# Export local graph as EDN to specified file -$ logseq export-edn -g woot -f woot.edn -Exported 16 properties, 1 classes and 36 pages to woot.edn - -# Import into current graph with EDN -$ logseq import-edn -f woot-ontology.edn -Imported 16 properties, 1 classes and 0 pages! - -# Validate a local graph. Useful to run in CI -$ logseq validate -g woot -Read graph woot with counts: {:entities 317, :pages 159, :blocks 147, :classes 17, :properties 112, :objects 64, :property-pairs 669, :datoms 3964} -Valid! - -# Append text to current page -$ logseq append add this text -a my-token -Success! - -# Start mcp-server against a local desktop graph -$ logseq mcp-server -g yep -MCP Streamable HTTP Server started on 127.0.0.1:12315 -# Start mcp-server against a local graph file -$ logseq mcp-server -g ~/Downloads/logseq_db_yep_1751032977.sqlite -MCP Streamable HTTP Server started on 127.0.0.1:12315 -``` - -## API - -This library is under the parent namespace `logseq.cli`. - -## Dev - -Most of this library is also compatible with ClojureScript for use on the -frontend. This library follows the practices that [the Logseq frontend -follows](/docs/dev-practices.md). Most of the same linters are used, with -configurations that are specific to this library. See [this library's CI -file](/.github/workflows/deps-cli.yml) for linting examples. - -### Setup - -First install the following dependencies: -* Install node.js >= 22 and pnpm. -* Run `pnpm install` to install npm dependencies. -* Install [babashka](https://github.com/babashka/babashka). - -To install the CLI locally so that local changes are immediately reflected in `logseq`, `pnpm link --global`. - -### Testing - -Testing is done with nbb-logseq and -[nbb-test-runner](https://github.com/nextjournal/nbb-test-runner). Some basic -usage: - -```sh -# Run all tests -$ pnpm test -# List available options -$ pnpm test -H -# Run tests with :focus metadata flag -$ pnpm test -i focus -``` - -### Managing dependencies - -See [standard nbb/cljs library advice in graph-parser](/deps/graph-parser/README.md#managing-dependencies). - -### Build - -To build and install a local version of the CLI: -```sh -$ bb build:vendor-nbb-deps && npm pack && npm install -g ./logseq-cli-*.tgz -# Run this to bring local code back to a clean state. Not running this will cause local dev issues -$ git checkout nbb.edn && rm -rf vendor logseq-cli*.tgz -``` - -The above is useful for testing the build process and ensuring the released tarball has no issues. \ No newline at end of file diff --git a/deps/cli/bb.edn b/deps/cli/bb.edn deleted file mode 100644 index 82299501b8d7..000000000000 --- a/deps/cli/bb.edn +++ /dev/null @@ -1,44 +0,0 @@ -{:min-bb-version "1.0.168" - :deps - {logseq/bb-tasks - #_{:local/root "../../../bb-tasks"} - {:git/url "https://github.com/logseq/bb-tasks" - :git/sha "7cc218286c03f093996539b8195de56a0ec5df6a"}} - - :pods - {clj-kondo/clj-kondo {:version "2026.04.15"}} - - :tasks - {build:vendor-nbb-deps - {:doc "Copy over latest nbb deps to vendor/ and make CLI independent of nbb.edn" - :requires ([babashka.fs :as fs]) - :task (do - (shell "pnpm exec nbb-logseq -e :load-deps") - (let [nbb-cache-dir (or (first (fs/list-dir ".nbb/.cache")) - (throw (ex-info "No nbb cache directory found" {})))] - (fs/delete-tree "vendor/src") - (fs/copy-tree (fs/path nbb-cache-dir "nbb-deps/logseq") "vendor/src/logseq") - (fs/copy-tree (fs/path nbb-cache-dir "nbb-deps/malli") "vendor/src/malli") - (fs/copy-tree (fs/path nbb-cache-dir "nbb-deps/borkdude") "vendor/src/borkdude") - (fs/copy-tree (fs/path nbb-cache-dir "nbb-deps/medley") "vendor/src/medley")) - (fs/delete-if-exists "nbb.edn") - (println "Done!"))} - test:load-all-namespaces-with-nbb - logseq.bb-tasks.nbb.test/load-all-namespaces - - lint:large-vars - logseq.bb-tasks.lint.large-vars/-main - - lint:carve - logseq.bb-tasks.lint.carve/-main - - lint:ns-docstrings - logseq.bb-tasks.lint.ns-docstrings/-main - - lint:minimize-public-vars - logseq.bb-tasks.lint.minimize-public-vars/-main} - - :tasks/config - {:large-vars - {:max-lines-count 50 - :metadata-exceptions #{:large-vars/cleanup-todo}}}} diff --git a/deps/cli/cli.mjs b/deps/cli/cli.mjs deleted file mode 100755 index b18372c9e002..000000000000 --- a/deps/cli/cli.mjs +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -import { loadFile, addClassPath } from '@logseq/nbb-logseq' -import { fileURLToPath } from 'url'; -import { dirname, resolve } from 'path'; - -const __dirname = fileURLToPath(dirname(import.meta.url)); -global.__dirname = __dirname -addClassPath(resolve(__dirname, 'src')); -addClassPath(resolve(__dirname, 'vendor/src')); -const { main } = await loadFile(resolve(__dirname, 'src/logseq/cli.cljs')); - -// Expects to be called as node X.js ... -const args = process.argv.slice(2) -main.apply(null, args); \ No newline at end of file diff --git a/deps/cli/deps.edn b/deps/cli/deps.edn deleted file mode 100644 index 6f2529a2e272..000000000000 --- a/deps/cli/deps.edn +++ /dev/null @@ -1,7 +0,0 @@ -{:paths ["src"] - :deps - {logseq/outliner {:local/root "../outliner"}} - - :aliases - {:clj-kondo {:replace-deps {clj-kondo/clj-kondo {:mvn/version "2026.04.15"}} - :main-opts ["-m" "clj-kondo.main"]}}} diff --git a/deps/cli/nbb.edn b/deps/cli/nbb.edn deleted file mode 100644 index 83f91f1901d4..000000000000 --- a/deps/cli/nbb.edn +++ /dev/null @@ -1,6 +0,0 @@ -{:paths ["src"] - :deps - {logseq/outliner - {:local/root "../outliner"} - io.github.nextjournal/nbb-test-runner - {:git/sha "b379325cfa5a3306180649da5de3bf5166414e71"}}} diff --git a/deps/cli/package.json b/deps/cli/package.json deleted file mode 100644 index 4c35144382fa..000000000000 --- a/deps/cli/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@logseq/cli", - "version": "0.4.3", - "packageManager": "pnpm@10.33.0", - "description": "Logseq CLI", - "bin": { - "logseq": "cli.mjs" - }, - "engines": { - "node": ">=22.17.0" - }, - "license": "MIT", - "dependencies": { - "@logseq/nbb-logseq": "git+https://github.com/logseq/nbb-logseq.git#feat-db-v34", - "@modelcontextprotocol/sdk": "^1.27.1", - "better-sqlite3": "^12.8.0", - "fastify": "5.8.2", - "fs-extra": "^11.3.4", - "jszip": "3.10.1", - "mldoc": "^1.5.9", - "zod": "^4.3.6" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/logseq/logseq.git", - "directory": "deps/cli" - }, - "keywords": [ - "logseq", - "knowledge graph", - "note taking", - "clojurescript", - "nbb" - ], - "files": [ - "src", - "vendor" - ], - "scripts": { - "test": "pnpm exec nbb-logseq -cp test -m nextjournal.test-runner" - } -} diff --git a/deps/cli/pnpm-lock.yaml b/deps/cli/pnpm-lock.yaml deleted file mode 100644 index 53a5acba8edf..000000000000 --- a/deps/cli/pnpm-lock.yaml +++ /dev/null @@ -1,1829 +0,0 @@ -lockfileVersion: '9.0' - -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - -importers: - - .: - dependencies: - '@logseq/nbb-logseq': - specifier: git+https://github.com/logseq/nbb-logseq.git#feat-db-v34 - version: https://codeload.github.com/logseq/nbb-logseq/tar.gz/4d9f1382ce2cec6f39bf12df49ba425f1bd5f3fb - '@modelcontextprotocol/sdk': - specifier: ^1.27.1 - version: 1.27.1(zod@4.3.6) - better-sqlite3: - specifier: ^12.8.0 - version: 12.8.0 - fastify: - specifier: 5.8.2 - version: 5.8.2 - fs-extra: - specifier: ^11.3.4 - version: 11.3.4 - jszip: - specifier: 3.10.1 - version: 3.10.1 - mldoc: - specifier: ^1.5.9 - version: 1.5.9 - zod: - specifier: ^4.3.6 - version: 4.3.6 - -packages: - - '@fastify/ajv-compiler@4.0.5': - resolution: {integrity: sha512-KoWKW+MhvfTRWL4qrhUwAAZoaChluo0m0vbiJlGMt2GXvL4LVPQEjt8kSpHI3IBq5Rez8fg+XeH3cneztq+C7A==} - - '@fastify/error@4.2.0': - resolution: {integrity: sha512-RSo3sVDXfHskiBZKBPRgnQTtIqpi/7zhJOEmAxCiBcM7d0uwdGdxLlsCaLzGs8v8NnxIRlfG0N51p5yFaOentQ==} - - '@fastify/fast-json-stringify-compiler@5.0.3': - resolution: {integrity: sha512-uik7yYHkLr6fxd8hJSZ8c+xF4WafPK+XzneQDPU+D10r5X19GW8lJcom2YijX2+qtFF1ENJlHXKFM9ouXNJYgQ==} - - '@fastify/forwarded@3.0.0': - resolution: {integrity: sha512-kJExsp4JCms7ipzg7SJ3y8DwmePaELHxKYtg+tZow+k0znUTf3cb+npgyqm8+ATZOdmfgfydIebPDWM172wfyA==} - - '@fastify/merge-json-schemas@0.2.1': - resolution: {integrity: sha512-OA3KGBCy6KtIvLf8DINC5880o5iBlDX4SxzLQS8HorJAbqluzLRn80UXU0bxZn7UOFhFgpRJDasfwn9nG4FG4A==} - - '@fastify/proxy-addr@5.0.0': - resolution: {integrity: sha512-37qVVA1qZ5sgH7KpHkkC4z9SK6StIsIcOmpjvMPXNb3vx2GQxhZocogVYbr2PbbeLCQxYIPDok307xEvRZOzGA==} - - '@hono/node-server@1.19.11': - resolution: {integrity: sha512-dr8/3zEaB+p0D2n/IUrlPF1HZm586qgJNXK1a9fhg/PzdtkK7Ksd5l312tJX2yBuALqDYBlG20QEbayqPyxn+g==} - engines: {node: '>=18.14.1'} - peerDependencies: - hono: ^4 - - '@logseq/nbb-logseq@https://codeload.github.com/logseq/nbb-logseq/tar.gz/4d9f1382ce2cec6f39bf12df49ba425f1bd5f3fb': - resolution: {tarball: https://codeload.github.com/logseq/nbb-logseq/tar.gz/4d9f1382ce2cec6f39bf12df49ba425f1bd5f3fb} - version: 1.2.173-feat-db-v34 - engines: {node: '>=20.10.0'} - hasBin: true - - '@modelcontextprotocol/sdk@1.27.1': - resolution: {integrity: sha512-sr6GbP+4edBwFndLbM60gf07z0FQ79gaExpnsjMGePXqFcSSb7t6iscpjk9DhFhwd+mTEQrzNafGP8/iGGFYaA==} - engines: {node: '>=18'} - peerDependencies: - '@cfworker/json-schema': ^4.1.1 - zod: ^3.25 || ^4.0 - peerDependenciesMeta: - '@cfworker/json-schema': - optional: true - - '@pinojs/redact@0.4.0': - resolution: {integrity: sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==} - - abstract-logging@2.0.1: - resolution: {integrity: sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==} - - accepts@2.0.0: - resolution: {integrity: sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==} - engines: {node: '>= 0.6'} - - ajv-formats@3.0.1: - resolution: {integrity: sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==} - peerDependencies: - ajv: ^8.0.0 - peerDependenciesMeta: - ajv: - optional: true - - ajv@8.18.0: - resolution: {integrity: sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==} - - ansi-regex@2.1.1: - resolution: {integrity: sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==} - engines: {node: '>=0.10.0'} - - ansi-regex@3.0.1: - resolution: {integrity: sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==} - engines: {node: '>=4'} - - atomic-sleep@1.0.0: - resolution: {integrity: sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==} - engines: {node: '>=8.0.0'} - - avvio@9.1.0: - resolution: {integrity: sha512-fYASnYi600CsH/j9EQov7lECAniYiBFiiAtBNuZYLA2leLe9qOvZzqYHFjtIj6gD2VMoMLP14834LFWvr4IfDw==} - - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - - better-sqlite3@12.8.0: - resolution: {integrity: sha512-RxD2Vd96sQDjQr20kdP+F+dK/1OUNiVOl200vKBZY8u0vTwysfolF6Hq+3ZK2+h8My9YvZhHsF+RSGZW2VYrPQ==} - engines: {node: 20.x || 22.x || 23.x || 24.x || 25.x} - - bindings@1.5.0: - resolution: {integrity: sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==} - - bl@4.1.0: - resolution: {integrity: sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==} - - body-parser@2.2.2: - resolution: {integrity: sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==} - engines: {node: '>=18'} - - buffer@5.7.1: - resolution: {integrity: sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==} - - bytes@3.1.2: - resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} - engines: {node: '>= 0.8'} - - call-bind-apply-helpers@1.0.2: - resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} - engines: {node: '>= 0.4'} - - call-bound@1.0.4: - resolution: {integrity: sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==} - engines: {node: '>= 0.4'} - - camelcase@5.3.1: - resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} - engines: {node: '>=6'} - - chownr@1.1.4: - resolution: {integrity: sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==} - - cliui@4.1.0: - resolution: {integrity: sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==} - - code-point-at@1.1.0: - resolution: {integrity: sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==} - engines: {node: '>=0.10.0'} - - content-disposition@1.0.0: - resolution: {integrity: sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==} - engines: {node: '>= 0.6'} - - content-type@1.0.5: - resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} - engines: {node: '>= 0.6'} - - cookie-signature@1.2.2: - resolution: {integrity: sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==} - engines: {node: '>=6.6.0'} - - cookie@0.7.2: - resolution: {integrity: sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==} - engines: {node: '>= 0.6'} - - cookie@1.0.2: - resolution: {integrity: sha512-9Kr/j4O16ISv8zBBhJoi4bXOYNTkFLOqSL3UDB0njXxCXNezjeyVrJyGOWtgfs/q2km1gwBcfH8q1yEGoMYunA==} - engines: {node: '>=18'} - - core-util-is@1.0.3: - resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - - cors@2.8.5: - resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} - engines: {node: '>= 0.10'} - - cross-spawn@6.0.6: - resolution: {integrity: sha512-VqCUuhcd1iB+dsv8gxPttb5iZh/D0iubSP21g36KXdEuf6I5JiioesUVjpCdHV9MZRUfVFlvwtIUyPfxo5trtw==} - engines: {node: '>=4.8'} - - cross-spawn@7.0.6: - resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} - engines: {node: '>= 8'} - - debug@4.4.3: - resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - - decamelize@1.2.0: - resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} - engines: {node: '>=0.10.0'} - - decompress-response@6.0.0: - resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} - engines: {node: '>=10'} - - deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} - engines: {node: '>=4.0.0'} - - depd@2.0.0: - resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} - engines: {node: '>= 0.8'} - - dequal@2.0.3: - resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} - engines: {node: '>=6'} - - detect-libc@2.0.4: - resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==} - engines: {node: '>=8'} - - dunder-proto@1.0.1: - resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} - engines: {node: '>= 0.4'} - - ee-first@1.1.1: - resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - - encodeurl@2.0.0: - resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} - engines: {node: '>= 0.8'} - - end-of-stream@1.4.5: - resolution: {integrity: sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==} - - es-define-property@1.0.1: - resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} - engines: {node: '>= 0.4'} - - es-errors@1.3.0: - resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} - engines: {node: '>= 0.4'} - - es-object-atoms@1.1.1: - resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} - engines: {node: '>= 0.4'} - - escape-html@1.0.3: - resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} - - etag@1.8.1: - resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} - engines: {node: '>= 0.6'} - - eventsource-parser@3.0.6: - resolution: {integrity: sha512-Vo1ab+QXPzZ4tCa8SwIHJFaSzy4R6SHf7BY79rFBDf0idraZWAkYrDjDj8uWaSm3S2TK+hJ7/t1CEmZ7jXw+pg==} - engines: {node: '>=18.0.0'} - - eventsource@3.0.7: - resolution: {integrity: sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==} - engines: {node: '>=18.0.0'} - - execa@1.0.0: - resolution: {integrity: sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==} - engines: {node: '>=6'} - - expand-template@2.0.3: - resolution: {integrity: sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==} - engines: {node: '>=6'} - - express-rate-limit@8.3.1: - resolution: {integrity: sha512-D1dKN+cmyPWuvB+G2SREQDzPY1agpBIcTa9sJxOPMCNeH3gwzhqJRDWCXW3gg0y//+LQ/8j52JbMROWyrKdMdw==} - engines: {node: '>= 16'} - peerDependencies: - express: '>= 4.11' - - express@5.2.1: - resolution: {integrity: sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==} - engines: {node: '>= 18'} - - fast-decode-uri-component@1.0.1: - resolution: {integrity: sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==} - - fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - - fast-json-stringify@6.0.1: - resolution: {integrity: sha512-s7SJE83QKBZwg54dIbD5rCtzOBVD43V1ReWXXYqBgwCwHLYAAT0RQc/FmrQglXqWPpz6omtryJQOau5jI4Nrvg==} - - fast-querystring@1.1.2: - resolution: {integrity: sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==} - - fast-uri@3.1.0: - resolution: {integrity: sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA==} - - fastify@5.8.2: - resolution: {integrity: sha512-lZmt3navvZG915IE+f7/TIVamxIwmBd+OMB+O9WBzcpIwOo6F0LTh0sluoMFk5VkrKTvvrwIaoJPkir4Z+jtAg==} - - fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - - file-uri-to-path@1.0.0: - resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} - - finalhandler@2.1.0: - resolution: {integrity: sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==} - engines: {node: '>= 0.8'} - - find-my-way@9.3.0: - resolution: {integrity: sha512-eRoFWQw+Yv2tuYlK2pjFS2jGXSxSppAs3hSQjfxVKxM5amECzIgYYc1FEI8ZmhSh/Ig+FrKEz43NLRKJjYCZVg==} - engines: {node: '>=20'} - - find-up@3.0.0: - resolution: {integrity: sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==} - engines: {node: '>=6'} - - forwarded@0.2.0: - resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} - engines: {node: '>= 0.6'} - - fresh@2.0.0: - resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} - engines: {node: '>= 0.8'} - - fs-constants@1.0.0: - resolution: {integrity: sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==} - - fs-extra@11.3.4: - resolution: {integrity: sha512-CTXd6rk/M3/ULNQj8FBqBWHYBVYybQ3VPBw0xGKFe3tuH7ytT6ACnvzpIQ3UZtB8yvUKC2cXn1a+x+5EVQLovA==} - engines: {node: '>=14.14'} - - function-bind@1.1.2: - resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} - - get-caller-file@1.0.3: - resolution: {integrity: sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==} - - get-intrinsic@1.3.0: - resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} - engines: {node: '>= 0.4'} - - get-proto@1.0.1: - resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} - engines: {node: '>= 0.4'} - - get-stream@4.1.0: - resolution: {integrity: sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==} - engines: {node: '>=6'} - - github-from-package@0.0.0: - resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} - - gopd@1.2.0: - resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} - engines: {node: '>= 0.4'} - - graceful-fs@4.2.11: - resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} - - has-symbols@1.1.0: - resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} - engines: {node: '>= 0.4'} - - hasown@2.0.2: - resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} - engines: {node: '>= 0.4'} - - hono@4.12.8: - resolution: {integrity: sha512-VJCEvtrezO1IAR+kqEYnxUOoStaQPGrCmX3j4wDTNOcD1uRPFpGlwQUIW8niPuvHXaTUxeOUl5MMDGrl+tmO9A==} - engines: {node: '>=16.9.0'} - - http-errors@2.0.1: - resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} - engines: {node: '>= 0.8'} - - iconv-lite@0.7.2: - resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} - engines: {node: '>=0.10.0'} - - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - - immediate@3.0.6: - resolution: {integrity: sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==} - - import-meta-resolve@4.1.0: - resolution: {integrity: sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw==} - - inherits@2.0.4: - resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - - ini@1.3.8: - resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - - invert-kv@2.0.0: - resolution: {integrity: sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==} - engines: {node: '>=4'} - - ip-address@10.1.0: - resolution: {integrity: sha512-XXADHxXmvT9+CRxhXg56LJovE+bmWnEWB78LB83VZTprKTmaC5QfruXocxzTZ2Kl0DNwKuBdlIhjL8LeY8Sf8Q==} - engines: {node: '>= 12'} - - ipaddr.js@1.9.1: - resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} - engines: {node: '>= 0.10'} - - ipaddr.js@2.2.0: - resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==} - engines: {node: '>= 10'} - - is-fullwidth-code-point@1.0.0: - resolution: {integrity: sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==} - engines: {node: '>=0.10.0'} - - is-fullwidth-code-point@2.0.0: - resolution: {integrity: sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==} - engines: {node: '>=4'} - - is-promise@4.0.0: - resolution: {integrity: sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==} - - is-stream@1.1.0: - resolution: {integrity: sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==} - engines: {node: '>=0.10.0'} - - isarray@1.0.0: - resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} - - isexe@2.0.0: - resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - - jose@6.2.1: - resolution: {integrity: sha512-jUaKr1yrbfaImV7R2TN/b3IcZzsw38/chqMpo2XJ7i2F8AfM/lA4G1goC3JVEwg0H7UldTmSt3P68nt31W7/mw==} - - json-schema-ref-resolver@2.0.1: - resolution: {integrity: sha512-HG0SIB9X4J8bwbxCbnd5FfPEbcXAJYTi1pBJeP/QPON+w8ovSME8iRG+ElHNxZNX2Qh6eYn1GdzJFS4cDFfx0Q==} - - json-schema-traverse@1.0.0: - resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} - - json-schema-typed@8.0.2: - resolution: {integrity: sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==} - - jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} - - jszip@3.10.1: - resolution: {integrity: sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==} - - lcid@2.0.0: - resolution: {integrity: sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==} - engines: {node: '>=6'} - - lie@3.3.0: - resolution: {integrity: sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==} - - light-my-request@6.6.0: - resolution: {integrity: sha512-CHYbu8RtboSIoVsHZ6Ye4cj4Aw/yg2oAFimlF7mNvfDV192LR7nDiKtSIfCuLT7KokPSTn/9kfVLm5OGN0A28A==} - - locate-path@3.0.0: - resolution: {integrity: sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==} - engines: {node: '>=6'} - - map-age-cleaner@0.1.3: - resolution: {integrity: sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==} - engines: {node: '>=6'} - - math-intrinsics@1.1.0: - resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} - engines: {node: '>= 0.4'} - - media-typer@1.1.0: - resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==} - engines: {node: '>= 0.8'} - - mem@4.3.0: - resolution: {integrity: sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==} - engines: {node: '>=6'} - - merge-descriptors@2.0.0: - resolution: {integrity: sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==} - engines: {node: '>=18'} - - mime-db@1.54.0: - resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} - engines: {node: '>= 0.6'} - - mime-types@3.0.1: - resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==} - engines: {node: '>= 0.6'} - - mimic-fn@2.1.0: - resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} - engines: {node: '>=6'} - - mimic-response@3.1.0: - resolution: {integrity: sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==} - engines: {node: '>=10'} - - minimist@1.2.8: - resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - - mkdirp-classic@0.5.3: - resolution: {integrity: sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==} - - mldoc@1.5.9: - resolution: {integrity: sha512-87FQ7hseS87tsk+VdpIigpu8LH+GwmbbFgpxgFwvnbH5oOjmIrc47laH4Dyggzqiy8/vMjDHkl7vsId0eXhCDQ==} - hasBin: true - - ms@2.1.3: - resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - - napi-build-utils@2.0.0: - resolution: {integrity: sha512-GEbrYkbfF7MoNaoh2iGG84Mnf/WZfB0GdGEsM8wz7Expx/LlWf5U8t9nvJKXSp3qr5IsEbK04cBGhol/KwOsWA==} - - negotiator@1.0.0: - resolution: {integrity: sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==} - engines: {node: '>= 0.6'} - - nice-try@1.0.5: - resolution: {integrity: sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==} - - node-abi@3.75.0: - resolution: {integrity: sha512-OhYaY5sDsIka7H7AtijtI9jwGYLyl29eQn/W623DiN/MIv5sUqc4g7BIDThX+gb7di9f6xK02nkp8sdfFWZLTg==} - engines: {node: '>=10'} - - npm-run-path@2.0.2: - resolution: {integrity: sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==} - engines: {node: '>=4'} - - number-is-nan@1.0.1: - resolution: {integrity: sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==} - engines: {node: '>=0.10.0'} - - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - - object-inspect@1.13.4: - resolution: {integrity: sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==} - engines: {node: '>= 0.4'} - - on-exit-leak-free@2.1.2: - resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==} - engines: {node: '>=14.0.0'} - - on-finished@2.4.1: - resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} - engines: {node: '>= 0.8'} - - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - - os-locale@3.1.0: - resolution: {integrity: sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==} - engines: {node: '>=6'} - - p-defer@1.0.0: - resolution: {integrity: sha512-wB3wfAxZpk2AzOfUMJNL+d36xothRSyj8EXOa4f6GMqYDN9BJaaSISbsk+wS9abmnebVw95C2Kb5t85UmpCxuw==} - engines: {node: '>=4'} - - p-finally@1.0.0: - resolution: {integrity: sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==} - engines: {node: '>=4'} - - p-is-promise@2.1.0: - resolution: {integrity: sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==} - engines: {node: '>=6'} - - p-limit@2.3.0: - resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} - engines: {node: '>=6'} - - p-locate@3.0.0: - resolution: {integrity: sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==} - engines: {node: '>=6'} - - p-try@2.2.0: - resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} - engines: {node: '>=6'} - - pako@1.0.11: - resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - - parseurl@1.3.3: - resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} - engines: {node: '>= 0.8'} - - path-exists@3.0.0: - resolution: {integrity: sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==} - engines: {node: '>=4'} - - path-key@2.0.1: - resolution: {integrity: sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==} - engines: {node: '>=4'} - - path-key@3.1.1: - resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} - engines: {node: '>=8'} - - path-to-regexp@8.3.0: - resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} - - pino-abstract-transport@3.0.0: - resolution: {integrity: sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==} - - pino-std-serializers@7.0.0: - resolution: {integrity: sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA==} - - pino@10.3.1: - resolution: {integrity: sha512-r34yH/GlQpKZbU1BvFFqOjhISRo1MNx1tWYsYvmj6KIRHSPMT2+yHOEb1SG6NMvRoHRF0a07kCOox/9yakl1vg==} - hasBin: true - - pkce-challenge@5.0.0: - resolution: {integrity: sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ==} - engines: {node: '>=16.20.0'} - - prebuild-install@7.1.3: - resolution: {integrity: sha512-8Mf2cbV7x1cXPUILADGI3wuhfqWvtiLA1iclTDbFRZkgRQS0NqsPZphna9V+HyTEadheuPmjaJMsbzKQFOzLug==} - engines: {node: '>=10'} - deprecated: No longer maintained. Please contact the author of the relevant native addon; alternatives are available. - hasBin: true - - process-nextick-args@2.0.1: - resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} - - process-warning@4.0.1: - resolution: {integrity: sha512-3c2LzQ3rY9d0hc1emcsHhfT9Jwz0cChib/QN89oME2R451w5fy3f0afAhERFZAwrbDU43wk12d0ORBpDVME50Q==} - - process-warning@5.0.0: - resolution: {integrity: sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA==} - - proxy-addr@2.0.7: - resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} - engines: {node: '>= 0.10'} - - pump@3.0.3: - resolution: {integrity: sha512-todwxLMY7/heScKmntwQG8CXVkWUOdYxIvY2s0VWAAMh/nd8SoYiRaKjlr7+iCs984f2P8zvrfWcDDYVb73NfA==} - - qs@6.15.0: - resolution: {integrity: sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==} - engines: {node: '>=0.6'} - - quick-format-unescaped@4.0.4: - resolution: {integrity: sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==} - - range-parser@1.2.1: - resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} - engines: {node: '>= 0.6'} - - raw-body@3.0.2: - resolution: {integrity: sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==} - engines: {node: '>= 0.10'} - - rc@1.2.8: - resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} - hasBin: true - - readable-stream@2.3.8: - resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - - readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - - real-require@0.2.0: - resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==} - engines: {node: '>= 12.13.0'} - - require-directory@2.1.1: - resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} - engines: {node: '>=0.10.0'} - - require-from-string@2.0.2: - resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} - engines: {node: '>=0.10.0'} - - require-main-filename@1.0.1: - resolution: {integrity: sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug==} - - ret@0.5.0: - resolution: {integrity: sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==} - engines: {node: '>=10'} - - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - - rfdc@1.4.1: - resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - - router@2.2.0: - resolution: {integrity: sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==} - engines: {node: '>= 18'} - - safe-buffer@5.1.2: - resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} - - safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - - safe-regex2@5.0.0: - resolution: {integrity: sha512-YwJwe5a51WlK7KbOJREPdjNrpViQBI3p4T50lfwPuDhZnE3XGVTlGvi+aolc5+RvxDD6bnUmjVsU9n1eboLUYw==} - - safe-stable-stringify@2.5.0: - resolution: {integrity: sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==} - engines: {node: '>=10'} - - safer-buffer@2.1.2: - resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - - secure-json-parse@4.0.0: - resolution: {integrity: sha512-dxtLJO6sc35jWidmLxo7ij+Eg48PM/kleBsxpC8QJE0qJICe+KawkDQmvCMZUr9u7WKVHgMW6vy3fQ7zMiFZMA==} - - semver@5.7.2: - resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} - hasBin: true - - semver@7.7.2: - resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} - engines: {node: '>=10'} - hasBin: true - - send@1.2.0: - resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} - engines: {node: '>= 18'} - - serve-static@2.2.0: - resolution: {integrity: sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==} - engines: {node: '>= 18'} - - set-blocking@2.0.0: - resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - - set-cookie-parser@2.7.1: - resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} - - setimmediate@1.0.5: - resolution: {integrity: sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==} - - setprototypeof@1.2.0: - resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} - - shebang-command@1.2.0: - resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} - engines: {node: '>=0.10.0'} - - shebang-command@2.0.0: - resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} - engines: {node: '>=8'} - - shebang-regex@1.0.0: - resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} - engines: {node: '>=0.10.0'} - - shebang-regex@3.0.0: - resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} - engines: {node: '>=8'} - - side-channel-list@1.0.0: - resolution: {integrity: sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==} - engines: {node: '>= 0.4'} - - side-channel-map@1.0.1: - resolution: {integrity: sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==} - engines: {node: '>= 0.4'} - - side-channel-weakmap@1.0.2: - resolution: {integrity: sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==} - engines: {node: '>= 0.4'} - - side-channel@1.1.0: - resolution: {integrity: sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==} - engines: {node: '>= 0.4'} - - signal-exit@3.0.7: - resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - - simple-concat@1.0.1: - resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} - - simple-get@4.0.1: - resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - - sonic-boom@4.2.0: - resolution: {integrity: sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww==} - - split2@4.2.0: - resolution: {integrity: sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==} - engines: {node: '>= 10.x'} - - statuses@2.0.2: - resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} - engines: {node: '>= 0.8'} - - string-width@1.0.2: - resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==} - engines: {node: '>=0.10.0'} - - string-width@2.1.1: - resolution: {integrity: sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==} - engines: {node: '>=4'} - - string_decoder@1.1.1: - resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - - strip-ansi@3.0.1: - resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==} - engines: {node: '>=0.10.0'} - - strip-ansi@4.0.0: - resolution: {integrity: sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==} - engines: {node: '>=4'} - - strip-eof@1.0.0: - resolution: {integrity: sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==} - engines: {node: '>=0.10.0'} - - strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} - engines: {node: '>=0.10.0'} - - tar-fs@2.1.3: - resolution: {integrity: sha512-090nwYJDmlhwFwEW3QQl+vaNnxsO2yVsd45eTKRBzSzu+hlb1w2K9inVq5b0ngXuLVqQ4ApvsUHHnu/zQNkWAg==} - - tar-stream@2.2.0: - resolution: {integrity: sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==} - engines: {node: '>=6'} - - thread-stream@4.0.0: - resolution: {integrity: sha512-4iMVL6HAINXWf1ZKZjIPcz5wYaOdPhtO8ATvZ+Xqp3BTdaqtAwQkNmKORqcIo5YkQqGXq5cwfswDwMqqQNrpJA==} - engines: {node: '>=20'} - - toad-cache@3.7.0: - resolution: {integrity: sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw==} - engines: {node: '>=12'} - - toidentifier@1.0.1: - resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} - engines: {node: '>=0.6'} - - tunnel-agent@0.6.0: - resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==} - - type-is@2.0.1: - resolution: {integrity: sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==} - engines: {node: '>= 0.6'} - - universalify@2.0.1: - resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} - engines: {node: '>= 10.0.0'} - - unpipe@1.0.0: - resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} - engines: {node: '>= 0.8'} - - util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - - vary@1.1.2: - resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} - engines: {node: '>= 0.8'} - - which-module@2.0.1: - resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} - - which@1.3.1: - resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} - hasBin: true - - which@2.0.2: - resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} - engines: {node: '>= 8'} - hasBin: true - - wrap-ansi@2.1.0: - resolution: {integrity: sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==} - engines: {node: '>=0.10.0'} - - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - - y18n@4.0.3: - resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - - yargs-parser@11.1.1: - resolution: {integrity: sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==} - - yargs@12.0.5: - resolution: {integrity: sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==} - - zod-to-json-schema@3.25.1: - resolution: {integrity: sha512-pM/SU9d3YAggzi6MtR4h7ruuQlqKtad8e9S0fmxcMi+ueAK5Korys/aWcV9LIIHTVbj01NdzxcnXSN+O74ZIVA==} - peerDependencies: - zod: ^3.25 || ^4 - - zod@4.3.6: - resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==} - -snapshots: - - '@fastify/ajv-compiler@4.0.5': - dependencies: - ajv: 8.18.0 - ajv-formats: 3.0.1(ajv@8.18.0) - fast-uri: 3.1.0 - - '@fastify/error@4.2.0': {} - - '@fastify/fast-json-stringify-compiler@5.0.3': - dependencies: - fast-json-stringify: 6.0.1 - - '@fastify/forwarded@3.0.0': {} - - '@fastify/merge-json-schemas@0.2.1': - dependencies: - dequal: 2.0.3 - - '@fastify/proxy-addr@5.0.0': - dependencies: - '@fastify/forwarded': 3.0.0 - ipaddr.js: 2.2.0 - - '@hono/node-server@1.19.11(hono@4.12.8)': - dependencies: - hono: 4.12.8 - - '@logseq/nbb-logseq@https://codeload.github.com/logseq/nbb-logseq/tar.gz/4d9f1382ce2cec6f39bf12df49ba425f1bd5f3fb': - dependencies: - import-meta-resolve: 4.1.0 - - '@modelcontextprotocol/sdk@1.27.1(zod@4.3.6)': - dependencies: - '@hono/node-server': 1.19.11(hono@4.12.8) - ajv: 8.18.0 - ajv-formats: 3.0.1(ajv@8.18.0) - content-type: 1.0.5 - cors: 2.8.5 - cross-spawn: 7.0.6 - eventsource: 3.0.7 - eventsource-parser: 3.0.6 - express: 5.2.1 - express-rate-limit: 8.3.1(express@5.2.1) - hono: 4.12.8 - jose: 6.2.1 - json-schema-typed: 8.0.2 - pkce-challenge: 5.0.0 - raw-body: 3.0.2 - zod: 4.3.6 - zod-to-json-schema: 3.25.1(zod@4.3.6) - transitivePeerDependencies: - - supports-color - - '@pinojs/redact@0.4.0': {} - - abstract-logging@2.0.1: {} - - accepts@2.0.0: - dependencies: - mime-types: 3.0.1 - negotiator: 1.0.0 - - ajv-formats@3.0.1(ajv@8.18.0): - optionalDependencies: - ajv: 8.18.0 - - ajv@8.18.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-uri: 3.1.0 - json-schema-traverse: 1.0.0 - require-from-string: 2.0.2 - - ansi-regex@2.1.1: {} - - ansi-regex@3.0.1: {} - - atomic-sleep@1.0.0: {} - - avvio@9.1.0: - dependencies: - '@fastify/error': 4.2.0 - fastq: 1.19.1 - - base64-js@1.5.1: {} - - better-sqlite3@12.8.0: - dependencies: - bindings: 1.5.0 - prebuild-install: 7.1.3 - - bindings@1.5.0: - dependencies: - file-uri-to-path: 1.0.0 - - bl@4.1.0: - dependencies: - buffer: 5.7.1 - inherits: 2.0.4 - readable-stream: 3.6.2 - - body-parser@2.2.2: - dependencies: - bytes: 3.1.2 - content-type: 1.0.5 - debug: 4.4.3 - http-errors: 2.0.1 - iconv-lite: 0.7.2 - on-finished: 2.4.1 - qs: 6.15.0 - raw-body: 3.0.2 - type-is: 2.0.1 - transitivePeerDependencies: - - supports-color - - buffer@5.7.1: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - - bytes@3.1.2: {} - - call-bind-apply-helpers@1.0.2: - dependencies: - es-errors: 1.3.0 - function-bind: 1.1.2 - - call-bound@1.0.4: - dependencies: - call-bind-apply-helpers: 1.0.2 - get-intrinsic: 1.3.0 - - camelcase@5.3.1: {} - - chownr@1.1.4: {} - - cliui@4.1.0: - dependencies: - string-width: 2.1.1 - strip-ansi: 4.0.0 - wrap-ansi: 2.1.0 - - code-point-at@1.1.0: {} - - content-disposition@1.0.0: - dependencies: - safe-buffer: 5.2.1 - - content-type@1.0.5: {} - - cookie-signature@1.2.2: {} - - cookie@0.7.2: {} - - cookie@1.0.2: {} - - core-util-is@1.0.3: {} - - cors@2.8.5: - dependencies: - object-assign: 4.1.1 - vary: 1.1.2 - - cross-spawn@6.0.6: - dependencies: - nice-try: 1.0.5 - path-key: 2.0.1 - semver: 5.7.2 - shebang-command: 1.2.0 - which: 1.3.1 - - cross-spawn@7.0.6: - dependencies: - path-key: 3.1.1 - shebang-command: 2.0.0 - which: 2.0.2 - - debug@4.4.3: - dependencies: - ms: 2.1.3 - - decamelize@1.2.0: {} - - decompress-response@6.0.0: - dependencies: - mimic-response: 3.1.0 - - deep-extend@0.6.0: {} - - depd@2.0.0: {} - - dequal@2.0.3: {} - - detect-libc@2.0.4: {} - - dunder-proto@1.0.1: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-errors: 1.3.0 - gopd: 1.2.0 - - ee-first@1.1.1: {} - - encodeurl@2.0.0: {} - - end-of-stream@1.4.5: - dependencies: - once: 1.4.0 - - es-define-property@1.0.1: {} - - es-errors@1.3.0: {} - - es-object-atoms@1.1.1: - dependencies: - es-errors: 1.3.0 - - escape-html@1.0.3: {} - - etag@1.8.1: {} - - eventsource-parser@3.0.6: {} - - eventsource@3.0.7: - dependencies: - eventsource-parser: 3.0.6 - - execa@1.0.0: - dependencies: - cross-spawn: 6.0.6 - get-stream: 4.1.0 - is-stream: 1.1.0 - npm-run-path: 2.0.2 - p-finally: 1.0.0 - signal-exit: 3.0.7 - strip-eof: 1.0.0 - - expand-template@2.0.3: {} - - express-rate-limit@8.3.1(express@5.2.1): - dependencies: - express: 5.2.1 - ip-address: 10.1.0 - - express@5.2.1: - dependencies: - accepts: 2.0.0 - body-parser: 2.2.2 - content-disposition: 1.0.0 - content-type: 1.0.5 - cookie: 0.7.2 - cookie-signature: 1.2.2 - debug: 4.4.3 - depd: 2.0.0 - encodeurl: 2.0.0 - escape-html: 1.0.3 - etag: 1.8.1 - finalhandler: 2.1.0 - fresh: 2.0.0 - http-errors: 2.0.1 - merge-descriptors: 2.0.0 - mime-types: 3.0.1 - on-finished: 2.4.1 - once: 1.4.0 - parseurl: 1.3.3 - proxy-addr: 2.0.7 - qs: 6.15.0 - range-parser: 1.2.1 - router: 2.2.0 - send: 1.2.0 - serve-static: 2.2.0 - statuses: 2.0.2 - type-is: 2.0.1 - vary: 1.1.2 - transitivePeerDependencies: - - supports-color - - fast-decode-uri-component@1.0.1: {} - - fast-deep-equal@3.1.3: {} - - fast-json-stringify@6.0.1: - dependencies: - '@fastify/merge-json-schemas': 0.2.1 - ajv: 8.18.0 - ajv-formats: 3.0.1(ajv@8.18.0) - fast-uri: 3.1.0 - json-schema-ref-resolver: 2.0.1 - rfdc: 1.4.1 - - fast-querystring@1.1.2: - dependencies: - fast-decode-uri-component: 1.0.1 - - fast-uri@3.1.0: {} - - fastify@5.8.2: - dependencies: - '@fastify/ajv-compiler': 4.0.5 - '@fastify/error': 4.2.0 - '@fastify/fast-json-stringify-compiler': 5.0.3 - '@fastify/proxy-addr': 5.0.0 - abstract-logging: 2.0.1 - avvio: 9.1.0 - fast-json-stringify: 6.0.1 - find-my-way: 9.3.0 - light-my-request: 6.6.0 - pino: 10.3.1 - process-warning: 5.0.0 - rfdc: 1.4.1 - secure-json-parse: 4.0.0 - semver: 7.7.2 - toad-cache: 3.7.0 - - fastq@1.19.1: - dependencies: - reusify: 1.1.0 - - file-uri-to-path@1.0.0: {} - - finalhandler@2.1.0: - dependencies: - debug: 4.4.3 - encodeurl: 2.0.0 - escape-html: 1.0.3 - on-finished: 2.4.1 - parseurl: 1.3.3 - statuses: 2.0.2 - transitivePeerDependencies: - - supports-color - - find-my-way@9.3.0: - dependencies: - fast-deep-equal: 3.1.3 - fast-querystring: 1.1.2 - safe-regex2: 5.0.0 - - find-up@3.0.0: - dependencies: - locate-path: 3.0.0 - - forwarded@0.2.0: {} - - fresh@2.0.0: {} - - fs-constants@1.0.0: {} - - fs-extra@11.3.4: - dependencies: - graceful-fs: 4.2.11 - jsonfile: 6.1.0 - universalify: 2.0.1 - - function-bind@1.1.2: {} - - get-caller-file@1.0.3: {} - - get-intrinsic@1.3.0: - dependencies: - call-bind-apply-helpers: 1.0.2 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.1 - function-bind: 1.1.2 - get-proto: 1.0.1 - gopd: 1.2.0 - has-symbols: 1.1.0 - hasown: 2.0.2 - math-intrinsics: 1.1.0 - - get-proto@1.0.1: - dependencies: - dunder-proto: 1.0.1 - es-object-atoms: 1.1.1 - - get-stream@4.1.0: - dependencies: - pump: 3.0.3 - - github-from-package@0.0.0: {} - - gopd@1.2.0: {} - - graceful-fs@4.2.11: {} - - has-symbols@1.1.0: {} - - hasown@2.0.2: - dependencies: - function-bind: 1.1.2 - - hono@4.12.8: {} - - http-errors@2.0.1: - dependencies: - depd: 2.0.0 - inherits: 2.0.4 - setprototypeof: 1.2.0 - statuses: 2.0.2 - toidentifier: 1.0.1 - - iconv-lite@0.7.2: - dependencies: - safer-buffer: 2.1.2 - - ieee754@1.2.1: {} - - immediate@3.0.6: {} - - import-meta-resolve@4.1.0: {} - - inherits@2.0.4: {} - - ini@1.3.8: {} - - invert-kv@2.0.0: {} - - ip-address@10.1.0: {} - - ipaddr.js@1.9.1: {} - - ipaddr.js@2.2.0: {} - - is-fullwidth-code-point@1.0.0: - dependencies: - number-is-nan: 1.0.1 - - is-fullwidth-code-point@2.0.0: {} - - is-promise@4.0.0: {} - - is-stream@1.1.0: {} - - isarray@1.0.0: {} - - isexe@2.0.0: {} - - jose@6.2.1: {} - - json-schema-ref-resolver@2.0.1: - dependencies: - dequal: 2.0.3 - - json-schema-traverse@1.0.0: {} - - json-schema-typed@8.0.2: {} - - jsonfile@6.1.0: - dependencies: - universalify: 2.0.1 - optionalDependencies: - graceful-fs: 4.2.11 - - jszip@3.10.1: - dependencies: - lie: 3.3.0 - pako: 1.0.11 - readable-stream: 2.3.8 - setimmediate: 1.0.5 - - lcid@2.0.0: - dependencies: - invert-kv: 2.0.0 - - lie@3.3.0: - dependencies: - immediate: 3.0.6 - - light-my-request@6.6.0: - dependencies: - cookie: 1.0.2 - process-warning: 4.0.1 - set-cookie-parser: 2.7.1 - - locate-path@3.0.0: - dependencies: - p-locate: 3.0.0 - path-exists: 3.0.0 - - map-age-cleaner@0.1.3: - dependencies: - p-defer: 1.0.0 - - math-intrinsics@1.1.0: {} - - media-typer@1.1.0: {} - - mem@4.3.0: - dependencies: - map-age-cleaner: 0.1.3 - mimic-fn: 2.1.0 - p-is-promise: 2.1.0 - - merge-descriptors@2.0.0: {} - - mime-db@1.54.0: {} - - mime-types@3.0.1: - dependencies: - mime-db: 1.54.0 - - mimic-fn@2.1.0: {} - - mimic-response@3.1.0: {} - - minimist@1.2.8: {} - - mkdirp-classic@0.5.3: {} - - mldoc@1.5.9: - dependencies: - yargs: 12.0.5 - - ms@2.1.3: {} - - napi-build-utils@2.0.0: {} - - negotiator@1.0.0: {} - - nice-try@1.0.5: {} - - node-abi@3.75.0: - dependencies: - semver: 7.7.2 - - npm-run-path@2.0.2: - dependencies: - path-key: 2.0.1 - - number-is-nan@1.0.1: {} - - object-assign@4.1.1: {} - - object-inspect@1.13.4: {} - - on-exit-leak-free@2.1.2: {} - - on-finished@2.4.1: - dependencies: - ee-first: 1.1.1 - - once@1.4.0: - dependencies: - wrappy: 1.0.2 - - os-locale@3.1.0: - dependencies: - execa: 1.0.0 - lcid: 2.0.0 - mem: 4.3.0 - - p-defer@1.0.0: {} - - p-finally@1.0.0: {} - - p-is-promise@2.1.0: {} - - p-limit@2.3.0: - dependencies: - p-try: 2.2.0 - - p-locate@3.0.0: - dependencies: - p-limit: 2.3.0 - - p-try@2.2.0: {} - - pako@1.0.11: {} - - parseurl@1.3.3: {} - - path-exists@3.0.0: {} - - path-key@2.0.1: {} - - path-key@3.1.1: {} - - path-to-regexp@8.3.0: {} - - pino-abstract-transport@3.0.0: - dependencies: - split2: 4.2.0 - - pino-std-serializers@7.0.0: {} - - pino@10.3.1: - dependencies: - '@pinojs/redact': 0.4.0 - atomic-sleep: 1.0.0 - on-exit-leak-free: 2.1.2 - pino-abstract-transport: 3.0.0 - pino-std-serializers: 7.0.0 - process-warning: 5.0.0 - quick-format-unescaped: 4.0.4 - real-require: 0.2.0 - safe-stable-stringify: 2.5.0 - sonic-boom: 4.2.0 - thread-stream: 4.0.0 - - pkce-challenge@5.0.0: {} - - prebuild-install@7.1.3: - dependencies: - detect-libc: 2.0.4 - expand-template: 2.0.3 - github-from-package: 0.0.0 - minimist: 1.2.8 - mkdirp-classic: 0.5.3 - napi-build-utils: 2.0.0 - node-abi: 3.75.0 - pump: 3.0.3 - rc: 1.2.8 - simple-get: 4.0.1 - tar-fs: 2.1.3 - tunnel-agent: 0.6.0 - - process-nextick-args@2.0.1: {} - - process-warning@4.0.1: {} - - process-warning@5.0.0: {} - - proxy-addr@2.0.7: - dependencies: - forwarded: 0.2.0 - ipaddr.js: 1.9.1 - - pump@3.0.3: - dependencies: - end-of-stream: 1.4.5 - once: 1.4.0 - - qs@6.15.0: - dependencies: - side-channel: 1.1.0 - - quick-format-unescaped@4.0.4: {} - - range-parser@1.2.1: {} - - raw-body@3.0.2: - dependencies: - bytes: 3.1.2 - http-errors: 2.0.1 - iconv-lite: 0.7.2 - unpipe: 1.0.0 - - rc@1.2.8: - dependencies: - deep-extend: 0.6.0 - ini: 1.3.8 - minimist: 1.2.8 - strip-json-comments: 2.0.1 - - readable-stream@2.3.8: - dependencies: - core-util-is: 1.0.3 - inherits: 2.0.4 - isarray: 1.0.0 - process-nextick-args: 2.0.1 - safe-buffer: 5.1.2 - string_decoder: 1.1.1 - util-deprecate: 1.0.2 - - readable-stream@3.6.2: - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - - real-require@0.2.0: {} - - require-directory@2.1.1: {} - - require-from-string@2.0.2: {} - - require-main-filename@1.0.1: {} - - ret@0.5.0: {} - - reusify@1.1.0: {} - - rfdc@1.4.1: {} - - router@2.2.0: - dependencies: - debug: 4.4.3 - depd: 2.0.0 - is-promise: 4.0.0 - parseurl: 1.3.3 - path-to-regexp: 8.3.0 - transitivePeerDependencies: - - supports-color - - safe-buffer@5.1.2: {} - - safe-buffer@5.2.1: {} - - safe-regex2@5.0.0: - dependencies: - ret: 0.5.0 - - safe-stable-stringify@2.5.0: {} - - safer-buffer@2.1.2: {} - - secure-json-parse@4.0.0: {} - - semver@5.7.2: {} - - semver@7.7.2: {} - - send@1.2.0: - dependencies: - debug: 4.4.3 - encodeurl: 2.0.0 - escape-html: 1.0.3 - etag: 1.8.1 - fresh: 2.0.0 - http-errors: 2.0.1 - mime-types: 3.0.1 - ms: 2.1.3 - on-finished: 2.4.1 - range-parser: 1.2.1 - statuses: 2.0.2 - transitivePeerDependencies: - - supports-color - - serve-static@2.2.0: - dependencies: - encodeurl: 2.0.0 - escape-html: 1.0.3 - parseurl: 1.3.3 - send: 1.2.0 - transitivePeerDependencies: - - supports-color - - set-blocking@2.0.0: {} - - set-cookie-parser@2.7.1: {} - - setimmediate@1.0.5: {} - - setprototypeof@1.2.0: {} - - shebang-command@1.2.0: - dependencies: - shebang-regex: 1.0.0 - - shebang-command@2.0.0: - dependencies: - shebang-regex: 3.0.0 - - shebang-regex@1.0.0: {} - - shebang-regex@3.0.0: {} - - side-channel-list@1.0.0: - dependencies: - es-errors: 1.3.0 - object-inspect: 1.13.4 - - side-channel-map@1.0.1: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - object-inspect: 1.13.4 - - side-channel-weakmap@1.0.2: - dependencies: - call-bound: 1.0.4 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - object-inspect: 1.13.4 - side-channel-map: 1.0.1 - - side-channel@1.1.0: - dependencies: - es-errors: 1.3.0 - object-inspect: 1.13.4 - side-channel-list: 1.0.0 - side-channel-map: 1.0.1 - side-channel-weakmap: 1.0.2 - - signal-exit@3.0.7: {} - - simple-concat@1.0.1: {} - - simple-get@4.0.1: - dependencies: - decompress-response: 6.0.0 - once: 1.4.0 - simple-concat: 1.0.1 - - sonic-boom@4.2.0: - dependencies: - atomic-sleep: 1.0.0 - - split2@4.2.0: {} - - statuses@2.0.2: {} - - string-width@1.0.2: - dependencies: - code-point-at: 1.1.0 - is-fullwidth-code-point: 1.0.0 - strip-ansi: 3.0.1 - - string-width@2.1.1: - dependencies: - is-fullwidth-code-point: 2.0.0 - strip-ansi: 4.0.0 - - string_decoder@1.1.1: - dependencies: - safe-buffer: 5.1.2 - - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - - strip-ansi@3.0.1: - dependencies: - ansi-regex: 2.1.1 - - strip-ansi@4.0.0: - dependencies: - ansi-regex: 3.0.1 - - strip-eof@1.0.0: {} - - strip-json-comments@2.0.1: {} - - tar-fs@2.1.3: - dependencies: - chownr: 1.1.4 - mkdirp-classic: 0.5.3 - pump: 3.0.3 - tar-stream: 2.2.0 - - tar-stream@2.2.0: - dependencies: - bl: 4.1.0 - end-of-stream: 1.4.5 - fs-constants: 1.0.0 - inherits: 2.0.4 - readable-stream: 3.6.2 - - thread-stream@4.0.0: - dependencies: - real-require: 0.2.0 - - toad-cache@3.7.0: {} - - toidentifier@1.0.1: {} - - tunnel-agent@0.6.0: - dependencies: - safe-buffer: 5.2.1 - - type-is@2.0.1: - dependencies: - content-type: 1.0.5 - media-typer: 1.1.0 - mime-types: 3.0.1 - - universalify@2.0.1: {} - - unpipe@1.0.0: {} - - util-deprecate@1.0.2: {} - - vary@1.1.2: {} - - which-module@2.0.1: {} - - which@1.3.1: - dependencies: - isexe: 2.0.0 - - which@2.0.2: - dependencies: - isexe: 2.0.0 - - wrap-ansi@2.1.0: - dependencies: - string-width: 1.0.2 - strip-ansi: 3.0.1 - - wrappy@1.0.2: {} - - y18n@4.0.3: {} - - yargs-parser@11.1.1: - dependencies: - camelcase: 5.3.1 - decamelize: 1.2.0 - - yargs@12.0.5: - dependencies: - cliui: 4.1.0 - decamelize: 1.2.0 - find-up: 3.0.0 - get-caller-file: 1.0.3 - os-locale: 3.1.0 - require-directory: 2.1.1 - require-main-filename: 1.0.1 - set-blocking: 2.0.0 - string-width: 2.1.1 - which-module: 2.0.1 - y18n: 4.0.3 - yargs-parser: 11.1.1 - - zod-to-json-schema@3.25.1(zod@4.3.6): - dependencies: - zod: 4.3.6 - - zod@4.3.6: {} diff --git a/deps/cli/src/logseq/cli.cljs b/deps/cli/src/logseq/cli.cljs deleted file mode 100644 index d53bc0bc0a6c..000000000000 --- a/deps/cli/src/logseq/cli.cljs +++ /dev/null @@ -1,194 +0,0 @@ -(ns logseq.cli - "Main ns for Logseq CLI" - (:require ["fs" :as fs] - ["path" :as node-path] - ["child_process" :as child-process] - [babashka.cli :as cli] - [clojure.string :as string] - [logseq.cli.common.graph :as cli-common-graph] - [logseq.cli.spec :as cli-spec] - [logseq.cli.text-util :as cli-text-util] - [nbb.error] - [promesa.core :as p])) - -(defn- format-commands [{:keys [table]}] - (let [table (mapv (fn [{:keys [cmds desc spec]}] - (cond-> [(str (string/join " " cmds) - (when spec " [options]"))] - desc (conj desc))) - (filter (comp seq :cmds) table))] - (cli/format-table {:rows table}))) - -(def ^:private default-spec - {:version {:coerce :boolean - :alias :v - :desc "Print version"}}) - -(declare table) -(defn- print-general-help [_m] - (println (str "Usage: logseq [command] [options]\n\nOptions:\n" - (cli/format-opts {:spec default-spec}))) - (println (str "\nCommands:\n" (format-commands {:table table})))) - -(defn- default-command - [{{:keys [version]} :opts :as m}] - (if version - (let [package-json (node-path/join js/__dirname "package.json")] - (when (fs/existsSync package-json) - (println (-> (fs/readFileSync package-json) - js/JSON.parse - (aget "version"))))) - (print-general-help m))) - -(defn- print-command-help [command cmd-map] - (println (str "Usage: logseq " command - (when (:args->opts cmd-map) - (str " " (string/join " " - (map #(str "[" (name %) "]") (:args->opts cmd-map))))) - (when (:spec cmd-map) - (str " [options]\n\nOptions:\n" - (cli/format-opts {:spec (:spec cmd-map)}))) - (when (:description cmd-map) - (str "\n\nDescription:\n" (cli-text-util/wrap-text (:description cmd-map) 80)))))) - -(defn- help-command [{{:keys [command help]} :opts}] - (if-let [cmd-map (and command (some #(when (= command (first (:cmds %))) %) table))] - (print-command-help command cmd-map) - ;; handle help --help - (if-let [cmd-map (and help (some #(when (= "help" (first (:cmds %))) %) table))] - (print-command-help "help" cmd-map) - (println "Command" (pr-str command) "does not exist")))) - -(defn- extract-graph-names - "Extract graph names from parsed opts for unlock-graph." - [{:keys [graph graphs]}] - (cond-> [] - (string? graph) (conj graph) - (sequential? graphs) (into graphs))) - -(defn- unlock-graphs! - "Stop the db-worker-node server(s) for graph-names so this CLI can open the - SQLite database directly" - [graph-names] - (doseq [graph graph-names] - (let [result (.spawnSync child-process - "logseq" - #js ["server" "stop" "-g" graph] - #js {:timeout 5000 - :stdio "pipe"})] - (if (= 0 (.-status result)) - (println "Unlocked graph:" graph) - ;; Ignore server not started - (when-not (string/includes? (str (.-stdout result)) "server-not-found") - (println "Failed to unlock graph:" (pr-str result))))))) - -(defn- lazy-load-fn - "Lazy load fn to speed up start time. After nbb requires ~30 namespaces, start time gets close to 1s. - Also handles --help on all commands" - [fn-sym] - (fn [& args] - (if (get-in (first args) [:opts :help]) - (help-command {:opts {:command (-> args first :dispatch first)}}) - (do - (when (get-in (first args) [:opts :unlock-graph]) - (let [graphs (extract-graph-names (get (first args) :opts))] - (unlock-graphs! graphs))) - (-> (p/let [_ (require (symbol (namespace fn-sym)))] - (apply (resolve fn-sym) args)) - (p/catch (fn [err] - (if (= :sci/error (:type (ex-data err))) - (nbb.error/print-error-report err) - (js/console.error "Error:" err)) - (js/process.exit 1)))))))) - -(def ^:private table* - [{:cmds ["list"] :desc "List local graphs" - :fn (lazy-load-fn 'logseq.cli.commands.graph/list-graphs)} - {:cmds ["show"] :desc "Show DB graph(s) info" - :description "For each graph, prints information related to a graph's creation and anything that is helpful for debugging." - :fn (lazy-load-fn 'logseq.cli.commands.graph/show-graph) - :args->opts [:graphs] :coerce {:graphs []} :require [:graphs]} - {:cmds ["search"] - :fn (lazy-load-fn 'logseq.cli.commands.search/search) - :desc "Search DB graph" - :description "Search a local graph or the current in-app graph if --api-server-token is given. For a local graph it only searches the :block/title of blocks." - :args->opts [:search-terms] :coerce {:search-terms []} - :spec cli-spec/search} - {:cmds ["query"] :desc "Query DB graph(s)" - :description "Query a local graph or the current in-app graph if --api-server-token is given. For a local graph, queries are a datalog query or an entity query. A datalog query can use built-in rules. An entity query consists of one or more integers, uuids or :db/ident keywords. For an in-app query, queries can be an advanced or simple query." - :fn (lazy-load-fn 'logseq.cli.commands.query/query) - :args->opts [:args] :coerce {:args []} :no-keyword-opts true - :spec cli-spec/query} - {:cmds ["export"] :desc "Export DB graph as Markdown" - :description "Export a local graph to Markdown like the in-app graph export." - :fn (lazy-load-fn 'logseq.cli.commands.export/export) - :spec cli-spec/export} - {:cmds ["export-edn"] :desc "Export DB graph as EDN" - :description "Export a local graph to EDN or the current in-app graph if --api-server-token is given. See https://github.com/logseq/docs/blob/master/db-version.md#edn-data-export for more about this export type." - :fn (lazy-load-fn 'logseq.cli.commands.export-edn/export) - :spec cli-spec/export-edn} - {:cmds ["import-edn"] :desc "Import into DB graph with EDN" - :description "Import with EDN into a local graph or the current in-app graph if --api-server-token is given. See https://github.com/logseq/docs/blob/master/db-version.md#edn-data-export for more about this import type." - :fn (lazy-load-fn 'logseq.cli.commands.import-edn/import-edn) - :spec cli-spec/import-edn} - {:cmds ["append"] :desc "Append text to current page" - :description "Append text to current page of current in-app graph." - :fn (lazy-load-fn 'logseq.cli.commands.append/append) - :args->opts [:args] :require [:args] :coerce {:args []} - :spec cli-spec/append} - {:cmds ["mcp-server"] :desc "Run a MCP server" - :description "Run a MCP server against a local graph if --graph is given or against the current in-app graph. For the in-app graph, the API server must be on in the app. By default the MCP server runs as a HTTP Streamable server. Use --stdio to run it as a stdio server." - :fn (lazy-load-fn 'logseq.cli.commands.mcp-server/start) - :spec cli-spec/mcp-server} - {:cmds ["validate"] :desc "Validate DB graph" - :description "Validate a local DB graph. Exit 1 if there are validation errors" - :fn (lazy-load-fn 'logseq.cli.commands.validate/validate) - :spec cli-spec/validate} - {:cmds ["help"] :fn help-command :desc "Print a command's help" - :args->opts [:command] :require [:command]} - {:cmds [] - :spec default-spec - :fn default-command}]) - - -;; Spec shared with all commands -(def ^:private shared-spec - {:help {:alias :h - :desc "Print help"} - :unlock-graph {:alias :u - :coerce :boolean - :desc "Unlock graph(s) before running command"}}) - -(def ^:private table - (mapv (fn [m] (update m :spec #(merge % shared-spec))) table*)) - -(defn- warn-if-db-version-not-installed - [] - (when-not (fs/existsSync (cli-common-graph/get-db-graphs-dir)) - (println "[WARN] The database version's desktop app is not installed. Please install per https://github.com/logseq/logseq/#-database-version."))) - -(defn ^:api -main [& args] - (warn-if-db-version-not-installed) - (try - (cli/dispatch table - args - {:error-fn (fn [{:keys [cause msg option opts] type' :type :as data}] - ;; Options aren't required when printing help - (when-not (:help opts) - (if (and (= :org.babashka/cli type') - (= :require cause)) - (do - (println "Error: Command missing required" - (if (get-in data [:spec option]) "option" "argument") - (pr-str (name option))) - (when-let [cmd-m (some #(when (= {:spec (:spec %) - :require (:require %)} - (select-keys data [:spec :require])) %) table)] - (print-command-help (-> cmd-m :cmds first) cmd-m))) - (throw (ex-info msg data))) - (js/process.exit 1)))}) - (catch ^:sci/error js/Error e - (nbb.error/print-error-report e) - (js/process.exit 1)))) - -#js {:main -main} \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/append.cljs b/deps/cli/src/logseq/cli/commands/append.cljs deleted file mode 100644 index c263d0b5f00c..000000000000 --- a/deps/cli/src/logseq/cli/commands/append.cljs +++ /dev/null @@ -1,14 +0,0 @@ -(ns logseq.cli.commands.append - "Command to append to a page" - (:require [clojure.string :as string] - [logseq.cli.util :as cli-util] - [promesa.core :as p])) - -(defn append - [{{:keys [api-server-token args]} :opts}] - (let [text (string/join " " args)] - (-> (p/let [resp (cli-util/api-fetch api-server-token "logseq.app.append_block_in_page" [text])] - (if (= 200 (.-status resp)) - (println "Success!") - (cli-util/api-handle-error-response resp))) - (p/catch cli-util/command-catch-handler)))) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/export.cljs b/deps/cli/src/logseq/cli/commands/export.cljs deleted file mode 100644 index 335ce0cc042f..000000000000 --- a/deps/cli/src/logseq/cli/commands/export.cljs +++ /dev/null @@ -1,79 +0,0 @@ -(ns logseq.cli.commands.export - "Export MD command" - (:require ["fs" :as fs] - [cljs.pprint] - [clojure.string :as string] - [datascript.core :as d] - [logseq.cli.common.export.common :as cli-export-common] - [logseq.cli.common.export.text :as cli-export-text] - [logseq.cli.common.file :as common-file] - [logseq.cli.common.util :as cli-common-util] - [logseq.cli.util :as cli-util] - [logseq.common.util :as common-util] - [logseq.db.common.sqlite-cli :as sqlite-cli])) - -(defn- get-content-config [db] - (let [repo-config (-> (d/q '[:find ?content - :where [?b :file/path "logseq/config.edn"] [?b :file/content ?content]] - db) - ffirst - common-util/safe-read-map-string) - indent - ;; Copy of state/get-export-bullet-indentation - (case (get repo-config :export/bullet-indentation :tab) - :eight-spaces - " " - :four-spaces - " " - :two-spaces - " " - :tab - "\t")] - {:export-bullet-indentation indent})) - -(defn- get-file-contents - "Modified version of export.common/content (common-file/get-all-page->content db content-config)] - (map (fn [[page-title content]] - {:path (str page-title "." suffix) - :content content - :title page-title - :format :markdown}) - page->content))) - -(defn- export-files-as-markdown - "Modified version of handler.export.text/export-files-as-markdown for the CLI" - [files options] - (mapv - (fn [{:keys [path title content]}] - [(or path title) (cli-export-text/export-helper content :markdown options)]) - files)) - -(defn- export-repo-as-markdown! - "Modified version of handler.export.text/export-repo-as-markdown for the CLI" - [graph db {:keys [file]}] - (let [content-config (get-content-config db) - files* (get-file-contents db content-config "md")] - (when (seq files*) - (let [files (binding [cli-export-common/*current-db* db - cli-export-common/*content-config* content-config] - (export-files-as-markdown files* nil)) - zip-file-name (if file - (string/replace-first file #"(?i)\.zip$" "") - (str graph "_markdown_" (quot (common-util/time-ms) 1000))) - file-name (or file (str zip-file-name ".zip")) - zip (cli-common-util/make-export-zip zip-file-name files) - ;; matches behavior in make-export-zip - exported-files (remove #(string/blank? (second %)) files)] - (-> (.generateNodeStream zip #js {:streamFiles true :type "nodebuffer"}) - (.pipe (fs/createWriteStream file-name))) - (println "Exported" (count exported-files) "pages to" file-name))))) - -(defn export [{{:keys [graph] :as opts} :opts}] - (when-not graph - (cli-util/error "Command missing required option 'graph'")) - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph))] - (export-repo-as-markdown! graph @conn opts)) - (cli-util/error "Graph" (pr-str graph) "does not exist"))) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/export_edn.cljs b/deps/cli/src/logseq/cli/commands/export_edn.cljs deleted file mode 100644 index be9b0b76fa4d..000000000000 --- a/deps/cli/src/logseq/cli/commands/export_edn.cljs +++ /dev/null @@ -1,68 +0,0 @@ -(ns logseq.cli.commands.export-edn - "Export edn command" - (:require ["fs" :as fs] - [clojure.pprint :as pprint] - [logseq.cli.util :as cli-util] - [logseq.common.util :as common-util] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [logseq.db.sqlite.export :as sqlite-export] - [logseq.db.sqlite.util :as sqlite-util] - [promesa.core :as p])) - -(defn- write-export-edn-map [export-map {:keys [graph file]}] - (let [file' (or file (str graph "_" (quot (common-util/time-ms) 1000) ".edn"))] - (println (str "Exported " (cli-util/summarize-build-edn export-map) " to " file')) - (fs/writeFileSync file' (with-out-str (pprint/pprint export-map))))) - -(defn- build-export-options [options] - (cond-> {:export-type (:export-type options)} - (= :graph (:export-type options)) - (assoc :graph-options - (select-keys options [:include-timestamps? :exclude-namespaces :exclude-files? :exclude-built-in-pages?])))) - -(defn- validate-export - [export-map {:keys [catch-validation-errors? roundtrip] :as options}] - (println "Validating export which can take awhile on large graphs ...") - (let [{:keys [error db]} (sqlite-export/validate-export export-map)] - (if error - (if catch-validation-errors? - (js/console.error error) - (cli-util/error error)) - (println "Valid export!")) - (when roundtrip - (let [export-map2 (sqlite-export/build-export db (build-export-options options)) - diff (sqlite-export/diff-exports export-map export-map2)] - (if diff - (do (println "The exported EDN's have the following diff:") - (pprint/pprint diff) - (when-not catch-validation-errors? (js/process.exit 1))) - (println "The exported EDN roundtrips successfully!")))))) - -(defn- local-export [{{:keys [graph validate roundtrip] :as options} :opts}] - (when-not graph - (cli-util/error "Command missing required option 'graph'")) - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - export-map (sqlite-export/build-export @conn (build-export-options options))] - (when (or validate roundtrip) - (validate-export export-map options)) - (write-export-edn-map export-map options)) - (cli-util/error "Graph" (pr-str graph) "does not exist"))) - -(defn- api-export - [{{:keys [api-server-token validate] :as options} :opts}] - (let [opts (build-export-options options)] - (-> (p/let [resp (cli-util/api-fetch api-server-token "logseq.cli.export_edn" [(clj->js opts)])] - (if (= 200 (.-status resp)) - (p/let [body (.json resp) - export-map (sqlite-util/read-transit-str (aget body "export-body"))] - (when validate - (validate-export export-map options)) - (write-export-edn-map export-map (assoc options :graph (.-graph body)))) - (cli-util/api-handle-error-response resp))) - (p/catch cli-util/command-catch-handler)))) - -(defn export [{opts :opts :as m}] - (if (cli-util/api-command? opts) - (api-export m) - (local-export m))) diff --git a/deps/cli/src/logseq/cli/commands/graph.cljs b/deps/cli/src/logseq/cli/commands/graph.cljs deleted file mode 100644 index eb764d55255c..000000000000 --- a/deps/cli/src/logseq/cli/commands/graph.cljs +++ /dev/null @@ -1,43 +0,0 @@ -(ns logseq.cli.commands.graph - "Graph related commands" - (:require ["fs" :as fs] - [cljs-time.coerce :as tc] - [clojure.pprint :as pprint] - [clojure.string :as string] - [datascript.core :as d] - [logseq.cli.common.graph :as cli-common-graph] - [logseq.cli.util :as cli-util] - [logseq.common.config :as common-config] - [logseq.common.util.date-time :as date-time-util] - [logseq.db.common.sqlite-cli :as sqlite-cli])) - -(defn- ms->journal-title - [ms] - (date-time-util/format (tc/from-long ms) "MMM do, yyyy")) - -(defn show-graph - [{{:keys [graphs]} :opts}] - (doseq [graph graphs] - (let [graph-dir (cli-util/get-graph-path graph)] - (if (fs/existsSync graph-dir) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - kv-value #(:kv/value (d/entity @conn %))] - (pprint/print-table - (map #(array-map "Name" (first %) "Value" (second %)) - (cond-> [["Graph directory" graph-dir] - ["Graph created at" (some-> (kv-value :logseq.kv/graph-created-at) ms->journal-title)] - ["Graph schema version" (kv-value :logseq.kv/schema-version)] - ["Graph initial schema version" (kv-value :logseq.kv/graph-initial-schema-version)]] - (d/entity @conn :logseq.kv/graph-git-sha) - (conj ["Graph created by commit" - (str "https://github.com/logseq/logseq/commit/" (kv-value :logseq.kv/graph-git-sha))]) - (d/entity @conn :logseq.kv/import-type) - (conj ["Graph imported by" (kv-value :logseq.kv/import-type)]))))) - (cli-util/error "Graph" (pr-str graph) "does not exist"))))) - -(defn list-graphs - [] - (let [db-graphs (->> (cli-common-graph/get-db-based-graphs) - (map common-config/strip-leading-db-version-prefix) - sort)] - (println (string/join "\n" db-graphs)))) diff --git a/deps/cli/src/logseq/cli/commands/import_edn.cljs b/deps/cli/src/logseq/cli/commands/import_edn.cljs deleted file mode 100644 index 0270de4ca1e4..000000000000 --- a/deps/cli/src/logseq/cli/commands/import_edn.cljs +++ /dev/null @@ -1,40 +0,0 @@ -(ns logseq.cli.commands.import-edn - "Import edn command" - (:require ["fs" :as fs] - [clojure.edn :as edn] - [logseq.cli.util :as cli-util] - [logseq.db :as ldb] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [logseq.db.sqlite.export :as sqlite-export] - [logseq.db.sqlite.util :as sqlite-util] - [logseq.outliner.db-pipeline :as db-pipeline] - [promesa.core :as p])) - -(defn- print-success [import-map] - (println (str "Imported " (cli-util/summarize-build-edn import-map) "!"))) - -(defn- api-import [{:keys [api-server-token]} import-map] - (-> (p/let [resp (cli-util/api-fetch api-server-token "logseq.cli.import_edn" [(sqlite-util/write-transit-str import-map)])] - (if (= 200 (.-status resp)) - (print-success import-map) - (cli-util/api-handle-error-response resp))) - (p/catch cli-util/command-catch-handler))) - -(defn- local-import [{:keys [graph]} import-map] - (when-not graph - (cli-util/error "Command missing required option 'graph'")) - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - _ (db-pipeline/add-listener conn) - {:keys [init-tx block-props-tx misc-tx]} - (sqlite-export/build-import import-map @conn {}) - txs (vec (concat init-tx block-props-tx misc-tx))] - (ldb/transact! conn txs) - (print-success import-map)) - (cli-util/error "Graph" (pr-str graph) "does not exist"))) - -(defn import-edn [{{:keys [file] :as opts} :opts}] - (let [edn (edn/read-string (str (fs/readFileSync file)))] - (if (cli-util/api-command? opts) - (api-import opts edn) - (local-import opts edn)))) diff --git a/deps/cli/src/logseq/cli/commands/mcp_server.cljs b/deps/cli/src/logseq/cli/commands/mcp_server.cljs deleted file mode 100644 index a05641368cdb..000000000000 --- a/deps/cli/src/logseq/cli/commands/mcp_server.cljs +++ /dev/null @@ -1,113 +0,0 @@ -(ns logseq.cli.commands.mcp-server - "Command to run a MCP server" - (:require ["@modelcontextprotocol/sdk/server/stdio.js" :refer [StdioServerTransport]] - ["fastify$default" :as Fastify] - ["fs" :as fs] - [logseq.cli.common.mcp.server :as cli-common-mcp-server] - [logseq.cli.common.mcp.tools :as cli-common-mcp-tools] - [logseq.cli.util :as cli-util] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [logseq.outliner.db-pipeline :as db-pipeline] - [nbb.core :as nbb] - [promesa.core :as p])) - -(defn- local-get-page [conn args] - (if-let [resp (cli-common-mcp-tools/get-page-data @conn (aget args "pageName"))] - (cli-common-mcp-server/mcp-success-response resp) - (cli-common-mcp-server/mcp-error-response (str "Error: Page " (pr-str (aget args "pageName")) " not found")))) - -(defn- local-list-pages [conn args] - (cli-common-mcp-server/mcp-success-response - (cli-common-mcp-tools/list-pages @conn {:expand (aget args "expand")}))) - -(defn- local-list-properties [conn args] - (cli-common-mcp-server/mcp-success-response - (cli-common-mcp-tools/list-properties @conn {:expand (aget args "expand")}))) - -(defn- local-list-tags [conn args] - (cli-common-mcp-server/mcp-success-response - (cli-common-mcp-tools/list-tags @conn {:expand (aget args "expand")}))) - -(defn- local-upsert-nodes [conn args] - (cli-common-mcp-server/mcp-success-response - (cli-common-mcp-tools/upsert-nodes - conn - ;; string is used by a -t invocation - (-> (if (string? (.-operations args)) (js/JSON.parse (.-operations args)) (.-operations args)) - (js->clj :keywordize-keys true)) - {:dry-run (.-dry-run args)}))) - -(def ^:private local-tools - "MCP Tools when running with a local graph" - (let [tools {:getPage {:fn local-get-page} - :listPages {:fn local-list-pages} - :listProperties {:fn local-list-properties} - :listTags {:fn local-list-tags} - :upsertNodes {:fn local-upsert-nodes}}] - (merge-with - merge - (select-keys cli-common-mcp-server/api-tools (keys tools)) - tools))) - -(defn- create-http-server - [mcp-server opts] - (let [app (Fastify. #js {:requestTimeout (* 1000 30)})] - (.post app "/mcp" #(cli-common-mcp-server/handle-post-request mcp-server opts %1 %2)) - (.get app "/mcp" cli-common-mcp-server/handle-get-request) - (.delete app "/mcp" cli-common-mcp-server/handle-delete-request) - app)) - -(defn- start-http-server [mcp-server {:keys [port host] :as opts}] - (let [app (create-http-server mcp-server opts)] - (.listen app (clj->js (select-keys opts [:port :host])) - (fn [error] - (if error - (do (js/console.error "Failed to start server:" error) - (js/process.exit 1)) - (js/console.log - (str "MCP Streamable HTTP Server started on " host ":" port))))))) - -(defn- call-api - "Calls API from CLI for use w/ cli-common-mcp-server/api-tool" - [api-server-token api-method method-args] - (p/let [resp (cli-util/api-fetch api-server-token api-method method-args)] - (if (= 200 (.-status resp)) - (.json resp) - (p/let [body (.text resp)] - #js {:error (str "Server status " (.-status resp) - "\nAPI Response: " (pr-str body))})))) - -(defn- create-mcp-server [{{:keys [api-server-token] :as opts} :opts} graph] - (if (cli-util/api-command? opts) - ;; Make an initial /api call to ensure the API server is on - (-> (p/let [_resp (call-api api-server-token "logseq.app.search" ["foo"])] - (cli-common-mcp-server/create-mcp-api-server (partial call-api api-server-token))) - (p/catch cli-util/command-catch-handler)) - (let [mcp-server (cli-common-mcp-server/create-mcp-server) - conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - _ (db-pipeline/add-listener conn)] - (doseq [[k v] local-tools] - (.registerTool mcp-server (name k) (:config v) (partial (:fn v) conn))) - mcp-server))) - -(defn start [{{:keys [debug-tool graph stdio api-server-token] :as opts} :opts :as m}] - (when (and graph (not (fs/existsSync (cli-util/get-graph-path graph)))) - (cli-util/error "Graph" (pr-str graph) "does not exist")) - (if debug-tool - (if graph - (if-let [tool-m (get local-tools debug-tool)] - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - _ (db-pipeline/add-listener conn)] - (p/let [resp ((:fn tool-m) conn (clj->js (dissoc opts :debug-tool)))] - (js/console.log (clj->js resp)))) - (cli-util/error "Tool" (pr-str debug-tool) "not found")) - (if-let [tool-m (get cli-common-mcp-server/api-tools debug-tool)] - (p/let [resp (cli-common-mcp-server/call-api-tool (:fn tool-m) - (partial call-api api-server-token) - (clj->js (dissoc opts :debug-tool)))] - (js/console.log resp)) - (cli-util/error "Tool" (pr-str debug-tool) "not found"))) - (p/let [mcp-server (create-mcp-server m graph)] - (if stdio - (nbb/await (.connect mcp-server (StdioServerTransport.))) - (start-http-server mcp-server (select-keys opts [:port :host])))))) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/query.cljs b/deps/cli/src/logseq/cli/commands/query.cljs deleted file mode 100644 index 94003228735f..000000000000 --- a/deps/cli/src/logseq/cli/commands/query.cljs +++ /dev/null @@ -1,106 +0,0 @@ -(ns logseq.cli.commands.query - "Query command" - (:require ["fs" :as fs] - [clojure.edn :as edn] - [clojure.pprint :as pprint] - [clojure.string :as string] - [datascript.core :as d] - [datascript.impl.entity :as de] - [logseq.cli.util :as cli-util] - [logseq.common.util :as common-util] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [logseq.db.frontend.property :as db-property] - [logseq.db.frontend.rules :as rules] - [promesa.core :as p])) - -(defn- api-query - [query token] - (let [datalog-query? (string/starts-with? query "[") - method (if datalog-query? "logseq.db.datascript_query" "logseq.db.q")] - (-> (p/let [resp (cli-util/api-fetch token method [query])] - (if (= 200 (.-status resp)) - (p/let [body (.json resp)] - (let [res (js->clj body :keywordize-keys true) - results (if datalog-query? - ;; Remove nesting for most queries which just have one :find binding - (if (= 1 (count (first res))) (mapv first res) res) - res)] - (pprint/pprint results))) - (cli-util/api-handle-error-response resp))) - (p/catch cli-util/command-catch-handler)))) - -(defn- readable-properties - "Expands an entity's properties and tags to be readable. Similar to - db-test/readable-properties but to be customized for CLI use" - [ent] - (->> (db-property/properties ent) - (mapv (fn [[k v]] - [k - (cond - (#{:block/tags :logseq.property.class/extends :logseq.property/classes :logseq.property.class/properties} k) - (mapv :db/ident v) - (and (set? v) (every? de/entity? v)) - (set (map db-property/property-value-content v)) - (de/entity? v) - (or (:db/ident v) (db-property/property-value-content v)) - :else - v)])) - (into {}))) - -(defn- local-entities-query - "Queries by calling d/entity" - [db properties-expand args] - (map #(when-let [ent (d/entity db - (cond - (and (string? %) (common-util/uuid-string? %)) - [:block/uuid (uuid %)] - (string? %) - (edn/read-string %) - :else - %))] - (let [m (into {:db/id (:db/id ent)} ent)] - (if properties-expand - (merge m (readable-properties m)) - m))) - args)) - -(defn- local-datalog-query [db query*] - (let [query (into query* [:in '$ '%]) ;; assumes no :in are in queries - res (d/q query db (rules/extract-rules rules/db-query-dsl-rules))] - ;; Remove nesting for most queries which just have one :find binding - (if (= 1 (count (first res))) (mapv first res) res))) - -(defn- local-query - [{{:keys [args graphs properties-readable title-query]} :opts}] - (when-not graphs - (cli-util/error "Command missing required option 'graphs'")) - (doseq [graph graphs] - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - query* (when (string? (first args)) (common-util/safe-read-string {:log-error? false} (first args))) - results (cond - ;; Run datalog query if detected - (and (vector? query*) (= :find (first query*))) - (local-datalog-query @conn query*) - ;; Runs predefined title query. Predefined queries could better off in a separate command - ;; since they could be more powerful and have different args than query command - title-query - (let [query '[:find (pull ?b [*]) - :in $ % ?search-term - :where (block-content ?b ?search-term)] - res (d/q query @conn (rules/extract-rules rules/db-query-dsl-rules) - (string/join " " args))] - ;; Remove nesting for most queries which just have one :find binding - (if (= 1 (count (first res))) (mapv first res) res)) - :else - (local-entities-query @conn properties-readable args))] - (when (> (count graphs) 1) - (println "Results for graph" (pr-str graph))) - (pprint/pprint results)) - (cli-util/error "Graph" (pr-str graph) "does not exist")))) - -(defn query - [{{:keys [args api-server-token] :as opts} :opts :as m}] - (if (cli-util/api-command? opts) - (api-query (first args) api-server-token) - (local-query m))) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/search.cljs b/deps/cli/src/logseq/cli/commands/search.cljs deleted file mode 100644 index 1e1e84d62e7f..000000000000 --- a/deps/cli/src/logseq/cli/commands/search.cljs +++ /dev/null @@ -1,69 +0,0 @@ -(ns logseq.cli.commands.search - "Search command" - (:require ["fs" :as fs] - [clojure.pprint :as pprint] - [clojure.string :as string] - [datascript.core :as d] - [logseq.cli.text-util :as cli-text-util] - [logseq.cli.util :as cli-util] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [promesa.core :as p])) - -(defn- highlight - "Shows up as soft red on terminals that support ANSI 24-bit color like iTerm" - [text] - (str "\u001b[38;2;" 242 ";" 101 ";" 106 "m" text "\u001b[0m")) - -(defn- highlight-content-query - "Return string with highlighted content FTS result. CLI version of cmdk/highlight-content-query" - [content] - (when-not (string/blank? content) - ;; why recur? because there might be multiple matches - (loop [content content] - (let [[b-cut hl-cut e-cut] (cli-text-util/cut-by content "$pfts_2lqh>$" "$> results - (map #(string/replace % "\n" "\\\\n")) - (map highlight-fn))))))) - -(defn- api-search - [search-term {{:keys [api-server-token raw limit]} :opts}] - (-> (p/let [resp (cli-util/api-fetch api-server-token "logseq.app.search" [search-term {:limit limit}])] - (if (= 200 (.-status resp)) - (p/let [body (.json resp)] - (let [{:keys [blocks]} (js->clj body :keywordize-keys true)] - (format-results (map :title blocks) search-term {:raw raw :api? true}))) - (cli-util/api-handle-error-response resp))) - (p/catch cli-util/command-catch-handler))) - -(defn- local-search [search-term {{:keys [graph raw limit]} :opts}] - (when-not graph - (cli-util/error "Command missing required option 'graph'")) - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph)) - nodes (->> (d/datoms @conn :aevt :block/title) - (filter (fn [datom] - (string/includes? (:v datom) search-term))) - (take limit) - (map :v))] - (format-results nodes search-term {:raw raw})) - (cli-util/error "Graph" (pr-str graph) "does not exist"))) - -(defn search [{{:keys [search-terms] :as opts} :opts :as m}] - (if (cli-util/api-command? opts) - (api-search (string/join " " search-terms) m) - (local-search (string/join " " search-terms) m))) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/commands/validate.cljs b/deps/cli/src/logseq/cli/commands/validate.cljs deleted file mode 100644 index 1c2e9683da91..000000000000 --- a/deps/cli/src/logseq/cli/commands/validate.cljs +++ /dev/null @@ -1,30 +0,0 @@ -(ns logseq.cli.commands.validate - "Validate graph command" - (:require ["fs" :as fs] - [cljs.pprint :as pprint] - [logseq.cli.util :as cli-util] - [logseq.db.common.sqlite-cli :as sqlite-cli] - [logseq.db.frontend.validate :as db-validate])) - -(defn- validate-db [db db-name options] - (if-let [errors (:errors - (db-validate/validate-local-db! - db - (merge options {:db-name db-name :verbose true})))] - (do - (println "Found" (count errors) - (if (= 1 (count errors)) "entity" "entities") - "with errors:") - (pprint/pprint errors) - (js/process.exit 1)) - (println "Valid!"))) - -(defn- validate-graph [graph options] - (if (fs/existsSync (cli-util/get-graph-path graph)) - (let [conn (apply sqlite-cli/open-db! (cli-util/->open-db-args graph))] - (validate-db @conn graph options)) - (cli-util/error "Graph" (pr-str graph) "does not exist"))) - -(defn validate [{{:keys [graphs] :as opts} :opts}] - (doseq [graph graphs] - (validate-graph graph opts))) diff --git a/deps/cli/src/logseq/cli/common/graph.cljs b/deps/cli/src/logseq/cli/common/graph.cljs deleted file mode 100644 index d6c15ec8a289..000000000000 --- a/deps/cli/src/logseq/cli/common/graph.cljs +++ /dev/null @@ -1,29 +0,0 @@ -(ns ^:node-only logseq.cli.common.graph - "Graph related fns shared between CLI and electron" - (:require ["fs-extra" :as fs-extra] - [clojure.string :as string] - [logseq.common.config :as common-config] - [logseq.common.graph :as common-graph] - [logseq.common.graph-dir :as graph-dir])) - -(defn ^:api graph-name->path - [graph-name] - (graph-dir/decode-graph-dir-name graph-name)) - -(defn get-db-graphs-dir - "Directory where DB graphs are stored" - [] - (common-graph/expand-home (common-graph/get-default-graphs-dir))) - -(defn get-db-based-graphs - [] - (let [dir (get-db-graphs-dir)] - (fs-extra/ensureDirSync dir) - (->> (common-graph/read-directories dir) - (remove (fn [s] (= s common-config/unlinked-graphs-dir))) - (map graph-name->path) - (keep (fn [s] - (when (and (string? s) - (not (string/starts-with? s common-config/file-version-prefix))) - (common-config/canonicalize-db-version-repo s)))) - distinct))) diff --git a/deps/cli/src/logseq/cli/spec.cljs b/deps/cli/src/logseq/cli/spec.cljs deleted file mode 100644 index 37e3d1798f9d..000000000000 --- a/deps/cli/src/logseq/cli/spec.cljs +++ /dev/null @@ -1,97 +0,0 @@ -(ns logseq.cli.spec - "Babashka.cli specs for commands. Normally these would live alongside their - commands but are separate because command namespaces are lazy loaded") - -(def export - {:graph {:alias :g - :desc "Local graph to export"} - :file {:alias :f - :desc "File to save export"}}) - -(def export-edn - {:api-server-token {:alias :a - :desc "API server token to export current graph"} - :graph {:alias :g - :desc "Local graph to export"} - :include-timestamps? {:alias :T - :desc "Include timestamps in export"} - :file {:alias :f - :desc "File to save export"} - :exclude-namespaces {:alias :e - :coerce #{} - :desc "Namespaces to exclude from properties and classes"} - :roundtrip {:alias :r - :desc "(Dev) Validate export is idempotent by importing into a temp graph and diffing its export"} - :exclude-built-in-pages? {:alias :b - :desc "Exclude built-in pages"} - :exclude-files? {:alias :F - :desc "Exclude :file/path files"} - :export-type {:alias :t - :coerce :keyword - :desc "Export type" - :default :graph} - :validate {:alias :v - :desc "(Dev) Validate export with a temp graph built on exported EDN"} - :catch-validation-errors? {:alias :c - :desc "(Dev) Catch validation errors and still write invalid EDN"}}) - -(def import-edn - {:api-server-token {:alias :a - :desc "API server token to import into current graph"} - :graph {:alias :g - :desc "Local graph to import into"} - :file {:alias :f - :require true - :desc "EDN File to import"}}) - -(def query - {:api-server-token {:alias :a - :desc "API server token to query current graph"} - :graphs {:alias :g - :coerce [] - :desc "Local graph(s) to query"} - :properties-readable {:alias :p - :coerce :boolean - :desc "Make properties on local, entity queries show property values instead of ids"} - :title-query {:alias :t - :desc "Invoke local query on :block/title"}}) - -(def search - {:api-server-token {:alias :a - :desc "API server token to search current graph"} - :graph {:alias :g - :desc "Local graph to search"} - :raw {:alias :r - :desc "Print raw response"} - :limit {:alias :l - :default 100 - :desc "Limit max number of results"}}) - -(def append - {:api-server-token {:alias :a - :desc "API server token to modify current graph"}}) - -(def mcp-server - {:api-server-token {:alias :a - :desc "API server token to connect to current graph"} - :graph {:alias :g - :desc "Local graph to use with MCP server"} - :stdio {:alias :s - :desc "Run the MCP server via stdio transport"} - :port {:alias :p - :default 12315 - :coerce :long - :desc "Port for streamable HTTP server"} - :host {:default "127.0.0.1" - :desc "Host for streamable HTTP server"} - :debug-tool {:alias :t - :coerce :keyword - :desc "Debug mcp tool with direct invocation"}}) - -(def validate - {:graphs {:alias :g - :coerce [] - :require true - :desc "Local graph(s) to validate"} - :open-schema {:alias :o - :desc "Validate with open schema to allow extra keys/attributes in an entity map"}}) \ No newline at end of file diff --git a/deps/cli/src/logseq/cli/text_util.cljs b/deps/cli/src/logseq/cli/text_util.cljs deleted file mode 100644 index 0e03e0d17e2e..000000000000 --- a/deps/cli/src/logseq/cli/text_util.cljs +++ /dev/null @@ -1,43 +0,0 @@ -(ns logseq.cli.text-util - "Text utils" - (:require [clojure.string :as string])) - -(defn cut-by - "Cut string by specified wrapping symbols, only match the first occurrence. - value - string to cut - before - cutting symbol (before) - end - cutting symbol (end)" - [value before end] - (let [b-pos (string/index-of value before) - b-len (count before)] - (if b-pos - (let [b-cut (subs value 0 b-pos) - m-cut (subs value (+ b-pos b-len)) - e-len (count end) - e-pos (string/index-of m-cut end)] - (if e-pos - (let [e-cut (subs m-cut (+ e-pos e-len)) - m-cut (subs m-cut 0 e-pos)] - [b-cut m-cut e-cut]) - [b-cut m-cut nil])) - [value nil nil]))) - -(defn wrap-text - "Wraps a string to a given width without breaking words. Returns a single string with newlines." - [s width] - (->> (loop [remaining (string/trim s) - acc []] - (if (empty? remaining) - acc - (if (<= (count remaining) width) - (conj acc remaining) - (let [substring (subs remaining 0 width) - split-idx (or (string/last-index-of substring \space) - (string/last-index-of substring \tab) - ;; fallback: hard split - 80) - line (subs remaining 0 split-idx) - rest' (subs remaining split-idx)] - (recur (string/triml rest') - (conj acc line)))))) - (string/join "\n"))) diff --git a/deps/cli/src/logseq/cli/util.cljs b/deps/cli/src/logseq/cli/util.cljs deleted file mode 100644 index 9bd9e0fc905a..000000000000 --- a/deps/cli/src/logseq/cli/util.cljs +++ /dev/null @@ -1,90 +0,0 @@ -(ns ^:node-only logseq.cli.util - "CLI only util fns" - (:require ["fs" :as fs] - ["path" :as node-path] - [clojure.string :as string] - [logseq.cli.common.graph :as cli-common-graph] - [logseq.common.graph-dir :as graph-dir] - [nbb.error] - [promesa.core :as p])) - -(defn ->open-db-args - "Creates args for sqlite-cli/open-db! given a graph. Similar to sqlite-cli/->open-db-args" - [graph] - (cond - (and (fs/existsSync graph) (.isFile (fs/statSync graph))) - [graph] - (string/includes? graph "/") - ((juxt node-path/dirname node-path/basename) graph) - :else - [(cli-common-graph/get-db-graphs-dir) (graph-dir/repo->encoded-graph-dir-name graph)])) - -(defn get-graph-path - "If graph is a file, return its path. Otherwise returns the graph's dir" - [graph] - (apply node-path/join (->open-db-args graph))) - -(defn api-fetch [token method args] - (js/fetch "http://127.0.0.1:12315/api" - (clj->js {:method "POST" - :headers {"Authorization" - (str "Bearer " (or token js/process.env.LOGSEQ_API_SERVER_TOKEN)) - "Content-Type" "application/json"} - :body (js/JSON.stringify - (clj->js {:method method - :args args}))}))) - -(defn api-handle-error-response - "Handles a non 200 response. For 500 return full response to provide more detail" - ([resp] - (api-handle-error-response - resp - (fn [msg] - (js/console.error msg) - (js/process.exit 1)))) - ([resp err-fn] - (if (= 500 (.-status resp)) - (p/let [body (.text resp)] - (err-fn (str "Error: API Server responded with status " (.-status resp) - "\nAPI Response: " (pr-str body)))) - (err-fn (str "Error: API Server responded with status " (.-status resp) - (when (.-statusText resp) (str " and body " (pr-str (.-statusText resp))))))))) - -(defn command-catch-handler - "Default p/catch handler for commands which handles sci errors and HTTP API Server connections gracefully" - [err] - (cond - (= :sci/error (:type (ex-data err))) - (nbb.error/print-error-report err) - (string/includes? (some->> err .-cause .-message str) "ECONNREFUSED") - (do (js/console.error "Error: Failed to connect to HTTP API Server with error" (pr-str (.-message err))) - (js/console.log "Make sure the HTTP API Server is turned on.")) - :else - (js/console.error "Error:" err)) - (js/process.exit 1)) - -(defn error - "Prints error and then exits" - [& strings] - (apply println "Error:" strings) - (js/process.exit 1)) - -(defn summarize-build-edn - "Given a sqlite.build EDN map, returns a string summarizing what is transacted" - [edn-map] - (let [pluralize (fn pluralize [word num] - (if (= 1 num) - word - (get {"property" "properties" - "class" "classes"} word (str word "s"))))] - (str (count (:properties edn-map)) " " (pluralize "property" (count (:properties edn-map))) ", " - (count (:classes edn-map)) " " (pluralize "class" (count (:classes edn-map))) " and " - (count (:pages-and-blocks edn-map)) " " (pluralize "page" (count (:pages-and-blocks edn-map)))))) - -(defn api-command? - "Given user options and $LOGSEQ_API_SERVER_TOKEN, determines if - given command is an api (true) or local (false) command" - [{:keys [graph graphs api-server-token]}] - (or api-server-token - ;; graph(s) check overrides env since it is more explicit - (and js/process.env.LOGSEQ_API_SERVER_TOKEN (not graph) (not graphs)))) \ No newline at end of file diff --git a/deps/cli/test/logseq/cli/text_util_test.cljs b/deps/cli/test/logseq/cli/text_util_test.cljs deleted file mode 100644 index aa899b5b0f80..000000000000 --- a/deps/cli/test/logseq/cli/text_util_test.cljs +++ /dev/null @@ -1,35 +0,0 @@ -(ns logseq.cli.text-util-test - (:require [cljs.test :refer [are deftest]] - [logseq.cli.text-util :as cli-text-util])) - -(deftest test-cut-by - (are [x y] (= x y) - ["" "" ""] - (cli-text-util/cut-by "[[]]" "[[" "]]") - - ["" "abc" ""] - (cli-text-util/cut-by "[[abc]]" "[[" "]]") - - ["012 " "6" " [[2]]"] - (cli-text-util/cut-by "012 [[6]] [[2]]" "[[" "]]") - - ["" "prop" "value"] - (cli-text-util/cut-by "prop::value" "" "::") - - ["prop" "" "value"] - (cli-text-util/cut-by "prop::value" "::" "") - - ["some " "content" " here"] - (cli-text-util/cut-by "some $pfts>$content$pfts<$ here" "$pfts>$" "$pfts<$") - - ["some " "content$pft" nil] - (cli-text-util/cut-by "some $pfts>$content$pft" "$pfts>$" "$pfts<$") - - ["some $pf" nil nil] - (cli-text-util/cut-by "some $pf" "$pfts>$" "$pfts<$") - - ["" "content" ""] - (cli-text-util/cut-by "$pfts>$content$pfts<$" "$pfts>$" "$pfts<$") - - ["" "content$p" nil] - (cli-text-util/cut-by "$pfts>$content$p" "$pfts>$" "$pfts<$"))) diff --git a/deps/cli/test/logseq/cli_test.cljs b/deps/cli/test/logseq/cli_test.cljs deleted file mode 100644 index 79af785d4480..000000000000 --- a/deps/cli/test/logseq/cli_test.cljs +++ /dev/null @@ -1,23 +0,0 @@ -(ns logseq.cli-test - (:require ["child_process" :as child-process] - [cljs.test :refer [is deftest]] - [clojure.string :as string])) - -(defn- sh - "Run shell cmd synchronously and silently. Stdout/stderr can be inspected as needed" - [cmd] - (child-process/spawnSync (first cmd) - (clj->js (rest cmd)) - #js {:stdio "pipe"})) - -(deftest basic-help - (let [start-time (cljs.core/system-time) - result (sh ["node" "cli.mjs" "--help"]) - end-time (cljs.core/system-time)] - - (is (string/includes? (str (.-stdout result)) - "Usage: logseq [command]")) - - (let [max-time (-> 0.40 (* (if js/process.env.CI 2 1)))] - (is (< (-> end-time (- start-time) (/ 1000)) max-time) - (str "Printing CLI help takes less than " max-time "s"))))) \ No newline at end of file diff --git a/deps/common/.carve/ignore b/deps/common/.carve/ignore index 5cfba1311314..ef1b84ca253e 100644 --- a/deps/common/.carve/ignore +++ b/deps/common/.carve/ignore @@ -7,6 +7,10 @@ logseq.common.graph/get-default-graphs-dir ;; API fn logseq.common.graph/expand-home ;; API fn +logseq.common.graph/get-db-graphs-dir +;; API fn +logseq.common.graph/get-db-based-graphs +;; API fn logseq.common.authorization/verify-jwt ;; Profile utils diff --git a/deps/common/src/logseq/common/graph.cljs b/deps/common/src/logseq/common/graph.cljs index a9838ebf5d98..63b9abc8e607 100644 --- a/deps/common/src/logseq/common/graph.cljs +++ b/deps/common/src/logseq/common/graph.cljs @@ -5,6 +5,7 @@ ["path" :as node-path] [clojure.string :as string] [logseq.common.config :as common-config] + [logseq.common.graph-dir :as graph-dir] [logseq.common.path :as path])) (def ^:private win32? @@ -118,3 +119,22 @@ Rules: (if (and (seq path) (string/starts-with? path "~")) (node-path/join (os/homedir) (subs path 1)) path)) + +(defn get-db-graphs-dir + "Returns the directory where DB graphs are stored." + [] + (expand-home (get-default-graphs-dir))) + +(defn get-db-based-graphs + "Returns canonical DB graph repo names from the default DB graph directory." + [] + (let [dir (get-db-graphs-dir)] + (fs/mkdirSync dir #js {:recursive true}) + (->> (read-directories dir) + (remove (fn [s] (= s common-config/unlinked-graphs-dir))) + (map graph-dir/decode-graph-dir-name) + (keep (fn [s] + (when (and (string? s) + (not (string/starts-with? s common-config/file-version-prefix))) + (common-config/canonicalize-db-version-repo s)))) + distinct))) diff --git a/docs/agent-guide/033-desktop-db-worker-node-backend.md b/docs/agent-guide/033-desktop-db-worker-node-backend.md index 592d4ed0ab57..a092ab893557 100644 --- a/docs/agent-guide/033-desktop-db-worker-node-backend.md +++ b/docs/agent-guide/033-desktop-db-worker-node-backend.md @@ -26,7 +26,7 @@ This split creates two write paths with eventual synchronization, and desktop pl The goal is to make desktop and CLI share db-worker-node semantics and lock behavior so disk SQLite becomes the single source of truth. -The desktop default DB graphs directory is `~/logseq/graphs`, defined in `deps/cli/src/logseq/cli/common/graph.cljs`, and used by Electron DB file operations in `src/electron/electron/db.cljs`. +The desktop default DB graphs directory is `~/logseq/graphs`, defined in `deps/common/src/logseq/common/config.cljs` and resolved through `deps/common/src/logseq/common/graph.cljs`, then used by Electron DB file operations in `src/electron/electron/db.cljs`. This plan focuses on backend access flow and lifecycle management, and does not change business-level thread-api semantics or SQLite schema. diff --git a/docs/agent-guide/db-worker/005-unified-graph-backup.md b/docs/agent-guide/db-worker/005-unified-graph-backup.md index a559073bb6e4..d0db12fe0fe2 100644 --- a/docs/agent-guide/db-worker/005-unified-graph-backup.md +++ b/docs/agent-guide/db-worker/005-unified-graph-backup.md @@ -259,7 +259,7 @@ Remove graph backup orchestration from `backup-db-with-sqlite-backup!` or shrink Keep `ensure-graphs-dir!`, `ensure-graph-dir!`, and `get-db` only if callers still need them. -Change `backup-db-via-worker!` so it calls the shared ` { + for (const needle of ["SHADOW_IMPORT", ".shadow-cljs", "cljs-runtime"]) { + if (content.includes(needle)) { + throw new Error( + `static/logseq-cli.js still references Shadow runtime output: ${needle}`, + ); + } + } +}; + +const dependencyNames = [ + "@js-joda/core", + "@zvec/zvec", + "better-sqlite3", + "fs-extra", + "jszip", + "keytar", + "mldoc", + "picocolors", + "string-width", + "ws", +]; + +const onlyBuiltDependencies = rootPackage.pnpm.onlyBuiltDependencies.filter( + (name) => dependencyNames.includes(name), +); + +const dependencyVersion = (name) => + rootPackage.dependencies?.[name] ?? rootPackage.devDependencies?.[name]; + +const dependencies = Object.fromEntries( + dependencyNames.map((name) => { + const version = dependencyVersion(name); + if (!version) { + throw new Error(`Missing CLI runtime dependency in package.json: ${name}`); + } + return [name, version]; + }), +); + +assertReleaseEntrypoint( + fs.readFileSync(path.join(repoRoot, "static", "logseq-cli.js"), "utf8"), +); + +fs.rmSync(packageRoot, { recursive: true, force: true }); + +for (const [sourcePath, packagePath] of copyEntries) { + const source = path.join(repoRoot, sourcePath); + if (!fs.existsSync(source)) { + throw new Error(`Missing CLI package input: ${sourcePath}`); + } + const destination = path.join(packageRoot, packagePath); + fs.mkdirSync(path.dirname(destination), { recursive: true }); + fs.copyFileSync(source, destination); +} + +const packageJson = { + name: "@logseq/cli", + version: process.env.CLI_PACKAGE_VERSION ?? rootPackage.version, + packageManager: rootPackage.packageManager, + description: "Logseq CLI", + bin: { + logseq: "dist/logseq.js", + }, + engines: rootPackage.engines, + license: "MIT", + repository: { + type: "git", + url: "git+https://github.com/logseq/logseq.git", + directory: ".", + }, + keywords: [ + "logseq", + "knowledge graph", + "note taking", + "clojurescript", + ], + files: packageFiles, + dependencies, + pnpm: { + onlyBuiltDependencies, + }, +}; + +fs.writeFileSync( + path.join(packageRoot, "package.json"), + `${JSON.stringify(packageJson, null, 2)}\n`, +); + +console.log(`Prepared ${packageJson.name}@${packageJson.version} in ${packageRoot}`); diff --git a/scripts/src/logseq/tasks/dev/lint.clj b/scripts/src/logseq/tasks/dev/lint.clj index 894ceaa80b81..e994838c821d 100644 --- a/scripts/src/logseq/tasks/dev/lint.clj +++ b/scripts/src/logseq/tasks/dev/lint.clj @@ -23,7 +23,7 @@ (defn kondo-git-changes "Run clj-kondo across dirs and only for files that git diff detects as unstaged changes" [] - (let [kondo-dirs ["src" "deps/common" "deps/db" "deps/graph-parser" "deps/outliner" "deps/publishing" "deps/publish" "deps/cli"] + (let [kondo-dirs ["src" "deps/common" "deps/db" "deps/graph-parser" "deps/outliner" "deps/publishing" "deps/publish"] dir-regex (re-pattern (str "^(" (string/join "|" kondo-dirs) ")")) dir-to-files (->> (shell {:out :string :shutdown nil} "git diff --name-only") :out diff --git a/scripts/src/logseq/tasks/dev/lint_test_deps.clj b/scripts/src/logseq/tasks/dev/lint_test_deps.clj index 402f3f82f87d..7c261b683026 100644 --- a/scripts/src/logseq/tasks/dev/lint_test_deps.clj +++ b/scripts/src/logseq/tasks/dev/lint_test_deps.clj @@ -42,13 +42,6 @@ {:runner :bb :name "lint:ns-docstrings" :cmd "lint:ns-docstrings"} ;; {:runner :bb :name "lint:minimize-public-vars" :cmd "lint:minimize-public-vars"} {:runner :cmd :name "pnpm exec nbb-logseq (-e long)" :cmd "pnpm exec nbb-logseq -cp test -m nextjournal.test-runner -e long"}]} - {:dep "deps/cli" - :steps [kondo-src-test-step - {:runner :bb :name "lint:large-vars" :cmd "lint:large-vars"} - {:runner :bb :name "lint:carve" :cmd "lint:carve"} - {:runner :bb :name "lint:ns-docstrings" :cmd "lint:ns-docstrings"} - {:runner :bb :name "lint:minimize-public-vars" :cmd "lint:minimize-public-vars"} - {:runner :cmd :name "pnpm exec nbb-logseq (-e long)" :cmd "pnpm exec nbb-logseq -cp test -m nextjournal.test-runner -e long"}]} {:dep "deps/publish" :steps [kondo-src-test-step {:runner :bb :name "lint:large-vars" :cmd "lint:large-vars"} diff --git a/scripts/test-cli-release-config.mjs b/scripts/test-cli-release-config.mjs new file mode 100644 index 000000000000..1a6ecef6dfa1 --- /dev/null +++ b/scripts/test-cli-release-config.mjs @@ -0,0 +1,158 @@ +import assert from "node:assert/strict"; +import { execFileSync } from "node:child_process"; +import fs from "node:fs"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); + +const readText = (relativePath) => + fs.readFileSync(path.join(repoRoot, relativePath), "utf8"); + +const assertNotContains = (text, needle, label) => { + assert.equal( + text.includes(needle), + false, + `${label} should not contain ${needle}`, + ); +}; + +const assertNoShadowRuntime = (text, label) => { + for (const needle of ["SHADOW_IMPORT", ".shadow-cljs", "cljs-runtime"]) { + assertNotContains(text, needle, label); + } +}; + +const filesUnder = (relativePath) => { + const absolutePath = path.join(repoRoot, relativePath); + if (!fs.existsSync(absolutePath)) { + return []; + } + const stat = fs.statSync(absolutePath); + if (stat.isFile()) { + return [relativePath]; + } + return fs + .readdirSync(absolutePath, { withFileTypes: true }) + .flatMap((entry) => { + const entryPath = path.join(relativePath, entry.name); + return entry.isDirectory() ? filesUnder(entryPath) : [entryPath]; + }); +}; + +const assertFilesDoNotMatch = (relativePaths, pattern, label) => { + const matches = relativePaths.flatMap((relativePath) => { + const text = readText(relativePath); + return pattern.test(text) ? [relativePath] : []; + }); + assert.deepEqual(matches, [], `${label} should not contain ${pattern}`); +}; + +const workflow = readText(".github/workflows/deps-cli.yml"); +assertNotContains(workflow, "deps/cli", "deps-cli workflow"); +assert.match(workflow, /src\/main\/logseq\/cli\/\*\*/, "workflow should watch new CLI sources"); +assert.match(workflow, /src\/test\/logseq\/cli\/\*\*/, "workflow should watch new CLI tests"); +assert.match(workflow, /clojure -M:cljs release logseq-cli/, "workflow should build new CLI"); +assert.match(workflow, /pnpm db-worker-node:release:bundle/, "workflow should build bundled db-worker-node runtime"); +assert.match(workflow, /node scripts\/prepare-cli-package\.mjs/, "workflow should prepare publish package"); +assert.match(workflow, /working-directory: dist\/cli-package/, "workflow should publish prepared package"); + +const buildWorkflow = readText(".github/workflows/build.yml"); +assert.match(buildWorkflow, /clojure -M:cljs release logseq-cli/, "db graph workflow should build release CLI"); +assert.match(buildWorkflow, /pnpm db-worker-node:release:bundle/, "db graph workflow should build release db-worker-node runtime"); +assert.match(buildWorkflow, /pnpm --dir dist\/cli-package install --prod/, "db graph workflow should install prepared CLI package dependencies"); +assert.match(buildWorkflow, /libsecret-1-0/, "db graph workflow should install keytar's Linux runtime dependency"); +assert.match(buildWorkflow, /pnpm --dir dist\/cli-package pack --pack-destination \.\.\//, "db graph workflow should verify the prepared CLI package with pnpm pack"); +assertNotContains(buildWorkflow, "create_graph_with_schema_org.cljs ./cli-root/graphs/schema-graph --subset", "db graph workflow"); +assert.match(buildWorkflow, /node dist\/cli-package\/dist\/logseq\.js --root-dir scripts\/cli-root/, "db graph workflow should test packaged CLI"); +assert.match(buildWorkflow, /node dist\/cli-package\/dist\/logseq\.js --root-dir scripts\/cli-root.+--timeout-ms 3000/, "db graph workflow should use a 3s CLI request timeout for packaged CLI graph commands"); +assert.match(buildWorkflow, /--graph schema-graph --timeout-ms 120000/, "db graph workflow should allow the full schema graph validation to finish in CI"); +assertNotContains(buildWorkflow, "clojure -M:cljs compile logseq-cli", "db graph workflow"); +assertNotContains(buildWorkflow, "pnpm db-worker-node:compile:bundle", "db graph workflow"); + +assert.equal( + fs.existsSync(path.join(repoRoot, "deps/cli/package.json")), + false, + "old deps/cli package should be removed", +); + +const depsEdn = readText("deps.edn"); +assertNotContains(depsEdn, 'logseq/cli', "deps.edn"); +assertNotContains(depsEdn, '"deps/cli"', "deps.edn"); + +const bbEdn = readText("bb.edn"); +assertNotContains(bbEdn, "legacy cli", "bb.edn"); +assertNotContains(bbEdn, "../cli/src", "bb.edn"); + +const lintTask = readText("scripts/src/logseq/tasks/dev/lint.clj"); +assertNotContains(lintTask, '"deps/cli"', "lint task"); + +const lintDepsTask = readText("scripts/src/logseq/tasks/dev/lint_test_deps.clj"); +assertNotContains(lintDepsTask, '"deps/cli"', "lint/test deps task"); + +assert.equal( + fs.existsSync(path.join(repoRoot, "src/main/logseq/cli/common/mcp/server.cljs")), + false, + "CLI sources should not include an MCP server", +); + +assertFilesDoNotMatch( + [ + ...filesUnder("src/main/logseq/cli"), + ...filesUnder("src/test/logseq/cli"), + "scripts/prepare-cli-package.mjs", + ], + /logseq\.cli\.common\.mcp|modelcontextprotocol|zod\/v3|mcp-server/, + "CLI sources and package preparation", +); + +execFileSync(process.execPath, ["scripts/prepare-cli-package.mjs"], { + cwd: repoRoot, + stdio: "pipe", +}); + +const packageRoot = path.join(repoRoot, "dist/cli-package"); +const packageJson = JSON.parse( + fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"), +); + +assert.equal(packageJson.name, "@logseq/cli"); +assert.equal(packageJson.bin.logseq, "dist/logseq.js"); +assert.equal(packageJson.private, undefined); +assert.equal(packageJson.dependencies?.["@modelcontextprotocol/sdk"], undefined); +assert.equal(packageJson.dependencies?.zod, undefined); +assert.ok(packageJson.dependencies?.["@js-joda/core"], "publish package should include @js-joda/core for release artifacts"); +assert.ok(packageJson.dependencies?.keytar, "publish package should include keytar for db-worker-node"); +assert.ok(packageJson.dependencies?.["string-width"], "publish package should include string-width for CLI rendering"); +assert.deepEqual(packageJson.pnpm?.onlyBuiltDependencies, [ + "@zvec/zvec", + "better-sqlite3", + "keytar", +]); +assert.deepEqual(packageJson.files, [ + "dist/logseq.js", + "static/logseq-cli.js", + "static/logseq-cli.js.map", + "static/js/db-worker-node.js", + "static/js/db-worker-node-assets.json", + ".agents/skills/logseq-cli/SKILL.md", +]); + +for (const relativePath of packageJson.files) { + assert.equal( + fs.existsSync(path.join(packageRoot, relativePath)), + true, + `publish package should include ${relativePath}`, + ); +} + +assertNoShadowRuntime(readText("static/logseq-cli.js"), "root CLI release artifact"); +assertNoShadowRuntime( + fs.readFileSync(path.join(packageRoot, "static/logseq-cli.js"), "utf8"), + "publish package CLI release artifact", +); + +assertNoShadowRuntime( + fs.readFileSync(path.join(packageRoot, "static/js/db-worker-node.js"), "utf8"), + "publish package db-worker-node release artifact", +); diff --git a/src/electron/electron/db.cljs b/src/electron/electron/db.cljs index 6c6717c439e4..e31f0615112e 100644 --- a/src/electron/electron/db.cljs +++ b/src/electron/electron/db.cljs @@ -4,8 +4,8 @@ ["path" :as node-path] [electron.db-worker :as db-worker] [lambdaisland.glogi :as log] - [logseq.cli.common.graph :as cli-common-graph] [logseq.cli.transport :as cli-transport] + [logseq.common.graph :as common-graph] [logseq.common.graph-dir :as graph-dir] [logseq.db.common.sqlite :as common-sqlite] [logseq.db.sqlite.backup :as sqlite-backup] @@ -23,12 +23,12 @@ (defn ensure-graphs-dir! [] - (fs/ensureDirSync (cli-common-graph/get-db-graphs-dir))) + (fs/ensureDirSync (common-graph/get-db-graphs-dir))) (defn ensure-graph-dir! [db-name] (ensure-graphs-dir!) - (let [graph-dir (node-path/join (cli-common-graph/get-db-graphs-dir) + (let [graph-dir (node-path/join (common-graph/get-db-graphs-dir) (graph-dir/repo->encoded-graph-dir-name db-name))] (fs/ensureDirSync graph-dir) graph-dir)) @@ -36,7 +36,7 @@ (defn get-db [db-name] (let [_ (ensure-graph-dir! db-name) - [_db-name db-path] (common-sqlite/get-db-full-path (cli-common-graph/get-db-graphs-dir) db-name)] + [_db-name db-path] (common-sqlite/get-db-full-path (common-graph/get-db-graphs-dir) db-name)] (when (fs/existsSync db-path) (fs/readFileSync db-path)))) @@ -51,7 +51,7 @@ (let [_ (ensure-graph-dir! db-name) source (backup-source opts)] (graph-backup/ {:graphs-dir (cli-common-graph/get-db-graphs-dir) + (cond-> {:graphs-dir (common-graph/get-db-graphs-dir) :repo db-name :backup-name (graph-backup/build-backup-name db-name nil) :source source @@ -62,7 +62,7 @@ (defn backup-db-with-sqlite-backup! [db-name {:keys [force-backup? sqlite-backup!]}] - (let [[_db-name db-path] (common-sqlite/get-db-full-path (cli-common-graph/get-db-graphs-dir) db-name)] + (let [[_db-name db-path] (common-sqlite/get-db-full-path (common-graph/get-db-graphs-dir) db-name)] ( res (.status 400) (.send res "Invalid or missing session ID"))))) + (-> res (.code 400) (.send "Invalid or missing session ID"))))) (defn handle-delete-request [req res] @@ -64,7 +64,7 @@ (do (.close transport) (-> res (.code 200) (.send #js {:ok true}))) - (-> res (.status 400) (.send res "Invalid or missing session ID"))))) + (-> res (.code 400) (.send "Invalid or missing session ID"))))) (defn mcp-error-response [msg] #js {:content @@ -225,4 +225,4 @@ (name k) (:config v) (partial call-api-tool (:fn v) api-fn))) - mcp-server)) \ No newline at end of file + mcp-server)) diff --git a/src/electron/electron/server.cljs b/src/electron/electron/server.cljs index 1e5c89bc2901..a392bcb07c8f 100644 --- a/src/electron/electron/server.cljs +++ b/src/electron/electron/server.cljs @@ -9,9 +9,9 @@ [clojure.string :as string] [electron.configs :as cfgs] [electron.logger :as logger] + [electron.mcp-server :as desktop-mcp-server] [electron.utils :as utils] [electron.window :as window] - [logseq.cli.common.mcp.server :as cli-common-mcp-server] [promesa.core :as p])) (defonce ^:private *win (atom nil)) @@ -137,13 +137,13 @@ (if-let [meth' (resolve-real-api-method meth)] (invoke-logseq-api! meth' args) #js {:error (str "No method found for " (pr-str meth))})) - mcp-server (cli-common-mcp-server/create-mcp-api-server api-fn)] + mcp-server (desktop-mcp-server/create-mcp-api-server api-fn)] (logger/debug "[server] MCP routes initialized") (.post server "/mcp" - #(cli-common-mcp-server/handle-post-request mcp-server {:port (get-port) - :host (get-host)} %1 %2)) - (.get server "/mcp" cli-common-mcp-server/handle-get-request) - (.delete server "/mcp" cli-common-mcp-server/handle-get-request))) + #(desktop-mcp-server/handle-post-request mcp-server {:port (get-port) + :host (get-host)} %1 %2)) + (.get server "/mcp" desktop-mcp-server/handle-get-request) + (.delete server "/mcp" desktop-mcp-server/handle-delete-request))) (defn start! [] diff --git a/src/electron/electron/utils.cljs b/src/electron/electron/utils.cljs index 9d4d07668f56..a281caa0fca0 100644 --- a/src/electron/electron/utils.cljs +++ b/src/electron/electron/utils.cljs @@ -8,9 +8,9 @@ [clojure.string :as string] [electron.configs :as cfgs] [electron.logger :as logger] - [logseq.cli.common.graph :as cli-common-graph] - [logseq.common.graph-dir :as graph-dir] [logseq.common.config :as common-config] + [logseq.common.graph :as common-graph] + [logseq.common.graph-dir :as graph-dir] [promesa.core :as p] [shadow.esm :refer [dynamic-import]])) @@ -257,7 +257,7 @@ (when (and (string? graph-name) (string/starts-with? graph-name common-config/db-version-prefix)) (let [repo (common-config/canonicalize-db-version-repo graph-name)] - (node-path/join (cli-common-graph/get-db-graphs-dir) + (node-path/join (common-graph/get-db-graphs-dir) (graph-dir/repo->encoded-graph-dir-name repo))))) (comment diff --git a/src/main/frontend/extensions/zip.cljs b/src/main/frontend/extensions/zip.cljs index b62987aee59b..acca6cc721e8 100644 --- a/src/main/frontend/extensions/zip.cljs +++ b/src/main/frontend/extensions/zip.cljs @@ -1,5 +1,5 @@ (ns frontend.extensions.zip - (:require [logseq.cli.common.util :as cli-common-util] + (:require [frontend.handler.export.util :as export-util] [promesa.core :as p])) (defn make-file [content file-name args] @@ -12,7 +12,7 @@ (defn make-zip [zip-filename file-name-content _repo & {:keys [progress-fn compression]}] (let [compression (or compression "STORE") - zip (cli-common-util/make-export-zip zip-filename + zip (export-util/make-export-zip zip-filename file-name-content {:compression compression}) opts #js {:type "blob" diff --git a/src/main/frontend/handler/export/common.cljs b/src/main/frontend/handler/export/common.cljs index cc365193d643..dedf24f2cbe2 100644 --- a/src/main/frontend/handler/export/common.cljs +++ b/src/main/frontend/handler/export/common.cljs @@ -3,7 +3,7 @@ (:require [clojure.string :as string] [frontend.db.conn :as conn] [frontend.state :as state] - [logseq.cli.common.export.common :as cli-export-common] + [frontend.handler.export.common-impl :as common-impl] [promesa.core :as p])) (defn get-content-config [] @@ -15,10 +15,10 @@ ([repo root-block-uuids] (root-block-uuids->content repo root-block-uuids nil)) ([repo root-block-uuids {:keys [open-blocks-only? include-properties?]}] - (binding [cli-export-common/*current-db* (conn/get-db repo) - cli-export-common/*content-config* (get-content-config)] + (binding [common-impl/*current-db* (conn/get-db repo) + common-impl/*content-config* (get-content-config)] (let [contents (mapv (fn [id] - (cli-export-common/get-blocks-contents id + (common-impl/get-blocks-contents id :open-blocks-only? open-blocks-only? :include-properties? include-properties?)) root-block-uuids)] @@ -29,9 +29,9 @@ ([page-uuid] (get-page-content page-uuid nil)) ([page-uuid {:keys [open-blocks-only? include-properties?]}] - (binding [cli-export-common/*current-db* (conn/get-db (state/get-current-repo)) - cli-export-common/*content-config* (get-content-config)] - (cli-export-common/get-page-content page-uuid + (binding [common-impl/*current-db* (conn/get-db (state/get-current-repo)) + common-impl/*content-config* (get-content-config)] + (common-impl/get-page-content page-uuid :open-blocks-only? open-blocks-only? :include-properties? include-properties?)))) @@ -54,19 +54,19 @@ :format :markdown}) page->content))) -;; Aliased fns requiring cli-export-common dynamic bindings e.g. cli-export-common/*current-db* -(def replace-block&page-reference&embed cli-export-common/replace-block&page-reference&embed) -(def replace-Heading-with-Paragraph cli-export-common/replace-Heading-with-Paragraph) +;; Aliased fns requiring common-impl dynamic bindings e.g. common-impl/*current-db* +(def replace-block&page-reference&embed common-impl/replace-block&page-reference&embed) +(def replace-Heading-with-Paragraph common-impl/replace-Heading-with-Paragraph) ;; Aliased fns -(def priority->string cli-export-common/priority->string) -(def timestamp-to-string cli-export-common/timestamp-to-string) -(def hashtag-value->string cli-export-common/hashtag-value->string) -(def remove-block-ast-pos cli-export-common/remove-block-ast-pos) -(def Properties-block-ast? cli-export-common/Properties-block-ast?) -(def keep-only-level<=n cli-export-common/keep-only-level<=n) -(def remove-emphasis cli-export-common/remove-emphasis) -(def remove-page-ref-brackets cli-export-common/remove-page-ref-brackets) -(def remove-tags cli-export-common/remove-tags) -(def remove-prefix-spaces-in-Plain cli-export-common/remove-prefix-spaces-in-Plain) -(def walk-block-ast cli-export-common/walk-block-ast) +(def priority->string common-impl/priority->string) +(def timestamp-to-string common-impl/timestamp-to-string) +(def hashtag-value->string common-impl/hashtag-value->string) +(def remove-block-ast-pos common-impl/remove-block-ast-pos) +(def Properties-block-ast? common-impl/Properties-block-ast?) +(def keep-only-level<=n common-impl/keep-only-level<=n) +(def remove-emphasis common-impl/remove-emphasis) +(def remove-page-ref-brackets common-impl/remove-page-ref-brackets) +(def remove-tags common-impl/remove-tags) +(def remove-prefix-spaces-in-Plain common-impl/remove-prefix-spaces-in-Plain) +(def walk-block-ast common-impl/walk-block-ast) diff --git a/deps/cli/src/logseq/cli/common/export/common.cljs b/src/main/frontend/handler/export/common_impl.cljs similarity index 99% rename from deps/cli/src/logseq/cli/common/export/common.cljs rename to src/main/frontend/handler/export/common_impl.cljs index 16fdea0828ba..71bec7af1806 100644 --- a/deps/cli/src/logseq/cli/common/export/common.cljs +++ b/src/main/frontend/handler/export/common_impl.cljs @@ -1,12 +1,12 @@ -(ns logseq.cli.common.export.common +(ns frontend.handler.export.common-impl "common fns for exporting. exclude some fns which produce lazy-seq, which can cause strange behaviors when use together with dynamic var." (:require [cljs.core.match :refer [match]] [clojure.string :as string] [datascript.core :as d] - [logseq.cli.common.file :as common-file] - [logseq.cli.common.util :as cli-common-util :refer-macros [removev concatv mapcatv]] + [frontend.handler.export.util :as export-util :refer-macros [removev concatv mapcatv]] + [logseq.common.export.file :as common-file] [logseq.common.util :as common-util] [logseq.db :as ldb] [logseq.graph-parser.mldoc :as gp-mldoc] @@ -54,7 +54,7 @@ ;; Global vars that are not explicitly passed in all fns ;; These vars must be bound in order to use most fns in this namespace (def ^:dynamic *current-db* nil) -;; Config used by logseq.cli.common.file fns +;; Config used by logseq.common.export.file fns (def ^:dynamic *content-config* nil) ;;; internal utils diff --git a/src/main/frontend/handler/export/html.cljs b/src/main/frontend/handler/export/html.cljs index a7304d961922..ad1428017cb8 100644 --- a/src/main/frontend/handler/export/html.cljs +++ b/src/main/frontend/handler/export/html.cljs @@ -12,8 +12,8 @@ goto-level]] [frontend.util :as util] [hiccups.runtime :as h] - [logseq.cli.common.export.common :as cli-export-common :refer [*state*]] - [logseq.cli.common.util :refer-macros [concatv mapcatv removev]] + [frontend.handler.export.common-impl :as common-impl :refer [*state*]] + [frontend.handler.export.util :refer-macros [concatv mapcatv removev]] [malli.core :as m])) (def ^:private hiccup-malli-schema @@ -432,8 +432,8 @@ first-block (and (coll? root-block-uuids-or-page-uuid) (db/entity [:block/uuid (first root-block-uuids-or-page-uuid)])) format (get first-block :block/format :markdown)] - (binding [cli-export-common/*current-db* (conn/get-db repo) - cli-export-common/*content-config* (common/get-content-config)] + (binding [common-impl/*current-db* (conn/get-db repo) + common-impl/*content-config* (common/get-content-config)] (export-helper content format options)))) ;;; export fns (ends) diff --git a/src/main/frontend/handler/export/opml.cljs b/src/main/frontend/handler/export/opml.cljs index 0aabbf9af1e5..9ce4462ef613 100644 --- a/src/main/frontend/handler/export/opml.cljs +++ b/src/main/frontend/handler/export/opml.cljs @@ -11,9 +11,9 @@ goto-level]] [frontend.util :as util] [hiccups.runtime :as h] - [logseq.cli.common.export.common :as cli-export-common :refer + [frontend.handler.export.common-impl :as common-impl :refer [*state* raw-text simple-asts->string space]] - [logseq.cli.common.util :refer-macros [concatv mapcatv removev]])) + [frontend.handler.export.util :refer-macros [concatv mapcatv removev]])) ;;; *opml-state* (def ^:private ^:dynamic @@ -447,8 +447,8 @@ first-block (and (coll? root-block-uuids-or-page-uuid) (db/entity [:block/uuid (first root-block-uuids-or-page-uuid)])) format (get first-block :block/format :markdown)] - (binding [cli-export-common/*current-db* (conn/get-db repo) - cli-export-common/*content-config* (common/get-content-config)] + (binding [common-impl/*current-db* (conn/get-db repo) + common-impl/*content-config* (common/get-content-config)] (export-helper content format options :title title))))) ;;; export fns (ends) diff --git a/src/main/frontend/handler/export/text.cljs b/src/main/frontend/handler/export/text.cljs index ae87f25ef7ff..354efe054fef 100644 --- a/src/main/frontend/handler/export/text.cljs +++ b/src/main/frontend/handler/export/text.cljs @@ -9,8 +9,8 @@ [frontend.state :as state] [frontend.util :as util] [goog.dom :as gdom] - [logseq.cli.common.export.common :as cli-export-common] - [logseq.cli.common.export.text :as cli-export-text] + [frontend.handler.export.common-impl :as common-impl] + [frontend.handler.export.text-impl :as text-impl] [logseq.db :as ldb] [promesa.core :as p])) @@ -48,9 +48,9 @@ first-block (and (coll? root-block-uuids-or-page-uuid) (db/entity [:block/uuid (first root-block-uuids-or-page-uuid)])) format (get first-block :block/format :markdown)] - (binding [cli-export-common/*current-db* (conn/get-db repo) - cli-export-common/*content-config* (common/get-content-config)] - (cli-export-text/export-helper content format options))) + (binding [common-impl/*current-db* (conn/get-db repo) + common-impl/*content-config* (common/get-content-config)] + (text-impl/export-helper content format options))) (catch :default e (js/console.error e))))) @@ -64,9 +64,9 @@ (fn [{:keys [path title content]}] (util/profile (print-str :export-files-as-markdown title) [(or path title) - (binding [cli-export-common/*current-db* db - cli-export-common/*content-config* content-config] - (cli-export-text/export-helper content :markdown options))])) + (binding [common-impl/*current-db* db + common-impl/*content-config* content-config] + (text-impl/export-helper content :markdown options))])) files))) (defn export-repo-as-markdown! diff --git a/deps/cli/src/logseq/cli/common/export/text.cljs b/src/main/frontend/handler/export/text_impl.cljs similarity index 92% rename from deps/cli/src/logseq/cli/common/export/text.cljs rename to src/main/frontend/handler/export/text_impl.cljs index 4b841b3579bf..9bff950bc57b 100644 --- a/deps/cli/src/logseq/cli/common/export/text.cljs +++ b/src/main/frontend/handler/export/text_impl.cljs @@ -1,9 +1,9 @@ -(ns logseq.cli.common.export.text - "Common fns between frontend and CLI for exporting as markdown" +(ns frontend.handler.export.text-impl + "Markdown export implementation for frontend exports." (:require [clojure.string :as string] - [logseq.cli.common.export.common :as cli-export-common :refer + [frontend.handler.export.common-impl :as common-impl :refer [*state* newline* indent raw-text space simple-asts->string]] - [logseq.cli.common.util :refer-macros [removev concatv mapcatv]] + [frontend.handler.export.util :refer-macros [removev concatv mapcatv]] [logseq.graph-parser.mldoc :as gp-mldoc] [logseq.graph-parser.schema.mldoc :as mldoc-schema])) @@ -24,7 +24,7 @@ (defn- block-heading-prefix [{:keys [marker level priority size]}] (let [indent-style (get-in *state* [:export-options :indent-style]) - priority* (and priority (raw-text (cli-export-common/priority->string priority))) + priority* (and priority (raw-text (common-impl/priority->string priority))) heading* (if (= indent-style "dashes") [(indent (dec level) 0) (raw-text "-")] [(indent (dec level) 0)]) @@ -373,13 +373,13 @@ [ast-content] (let [[type timestamp-content] ast-content] (-> (case type - "Scheduled" ["SCHEDULED: " (cli-export-common/timestamp-to-string timestamp-content)] - "Deadline" ["DEADLINE: " (cli-export-common/timestamp-to-string timestamp-content)] - "Date" [(cli-export-common/timestamp-to-string timestamp-content)] - "Closed" ["CLOSED: " (cli-export-common/timestamp-to-string timestamp-content)] - "Clock" ["CLOCK: " (cli-export-common/timestamp-to-string (second timestamp-content))] + "Scheduled" ["SCHEDULED: " (common-impl/timestamp-to-string timestamp-content)] + "Deadline" ["DEADLINE: " (common-impl/timestamp-to-string timestamp-content)] + "Date" [(common-impl/timestamp-to-string timestamp-content)] + "Closed" ["CLOSED: " (common-impl/timestamp-to-string timestamp-content)] + "Clock" ["CLOCK: " (common-impl/timestamp-to-string (second timestamp-content))] "Range" (let [{:keys [start stop]} timestamp-content] - [(str (cli-export-common/timestamp-to-string start) "--" (cli-export-common/timestamp-to-string stop))])) + [(str (common-impl/timestamp-to-string start) "--" (common-impl/timestamp-to-string stop))])) string/join raw-text vector))) @@ -426,7 +426,7 @@ ;; {:malli/schema ...} only works on public vars so make this public (defn ^:large-vars/cleanup-todo ^:api block-ast->simple-ast - {:malli/schema [:=> [:cat mldoc-schema/block-ast-schema] [:sequential cli-export-common/simple-ast-malli-schema]]} + {:malli/schema [:=> [:cat mldoc-schema/block-ast-schema] [:sequential common-impl/simple-ast-malli-schema]]} [block] (let [newline-after-block? (get-in *state* [:export-options :newline-after-block])] (removev @@ -499,7 +499,7 @@ "Code" [(raw-text "`" ast-content "`")] "Tag" - [(raw-text (str "#" (cli-export-common/hashtag-value->string ast-content)))] + [(raw-text (str "#" (common-impl/hashtag-value->string ast-content)))] "Spaces" ; what's this ast-type for ? nil "Plain" @@ -554,30 +554,30 @@ :keep-only-level<=N (:keep-only-level<=N other-options) :newline-after-block (:newline-after-block other-options)}})] (let [ast (gp-mldoc/->db-edn content format) - ast (mapv cli-export-common/remove-block-ast-pos ast) - ast (removev cli-export-common/Properties-block-ast? ast) - ast* (cli-export-common/replace-block&page-reference&embed ast) + ast (mapv common-impl/remove-block-ast-pos ast) + ast (removev common-impl/Properties-block-ast? ast) + ast* (common-impl/replace-block&page-reference&embed ast) keep-level<=n (get-in *state* [:export-options :keep-only-level<=N]) ast* (if (pos? keep-level<=n) - (cli-export-common/keep-only-level<=n ast* keep-level<=n) + (common-impl/keep-only-level<=n ast* keep-level<=n) ast*) ast** (if (= "no-indent" (get-in *state* [:export-options :indent-style])) - (mapv cli-export-common/replace-Heading-with-Paragraph ast*) + (mapv common-impl/replace-Heading-with-Paragraph ast*) ast*) config-for-walk-block-ast (cond-> {} (get-in *state* [:export-options :remove-emphasis?]) - (update :mapcat-fns-on-inline-ast conj cli-export-common/remove-emphasis) + (update :mapcat-fns-on-inline-ast conj common-impl/remove-emphasis) (get-in *state* [:export-options :remove-page-ref-brackets?]) - (update :map-fns-on-inline-ast conj cli-export-common/remove-page-ref-brackets) + (update :map-fns-on-inline-ast conj common-impl/remove-page-ref-brackets) (get-in *state* [:export-options :remove-tags?]) - (update :mapcat-fns-on-inline-ast conj cli-export-common/remove-tags) + (update :mapcat-fns-on-inline-ast conj common-impl/remove-tags) (= "no-indent" (get-in *state* [:export-options :indent-style])) - (update :fns-on-inline-coll conj cli-export-common/remove-prefix-spaces-in-Plain)) + (update :fns-on-inline-coll conj common-impl/remove-prefix-spaces-in-Plain)) ast*** (if-not (empty? config-for-walk-block-ast) - (mapv (partial cli-export-common/walk-block-ast config-for-walk-block-ast) ast**) + (mapv (partial common-impl/walk-block-ast config-for-walk-block-ast) ast**) ast**) ast**** (loop [remaining ast*** result []] diff --git a/deps/cli/src/logseq/cli/common/util.cljc b/src/main/frontend/handler/export/util.cljc similarity index 86% rename from deps/cli/src/logseq/cli/common/util.cljc rename to src/main/frontend/handler/export/util.cljc index 2cddc5f51042..10b4faca39b3 100644 --- a/deps/cli/src/logseq/cli/common/util.cljc +++ b/src/main/frontend/handler/export/util.cljc @@ -1,5 +1,5 @@ -(ns logseq.cli.common.util - "Common util fns between CLI and frontend" +(ns frontend.handler.export.util + "Utility functions for frontend export flows." (:require #?(:org.babashka/nbb ["jszip$default" :as JSZip] :cljs ["jszip" :as JSZip]) #_:clj-kondo/ignore @@ -7,7 +7,7 @@ #?(:cljs (defn make-export-zip - "Makes a zipfile for an exported version of graph. Removes files with blank content" + "Makes a zip file for an exported graph and removes files with blank content." [zip-filename file-name-content & {:as file-opts}] (let [zip (JSZip.) folder (.folder zip zip-filename) diff --git a/src/main/frontend/util/text.cljs b/src/main/frontend/util/text.cljs index 7c3255d5649a..1ad84102a8aa 100644 --- a/src/main/frontend/util/text.cljs +++ b/src/main/frontend/util/text.cljs @@ -4,8 +4,7 @@ (:require [clojure.string :as string] [frontend.config :as config] [frontend.util :as util] - [goog.string :as gstring] - [logseq.cli.text-util :as cli-text-util])) + [goog.string :as gstring])) (def bilibili-regex #"^((?:https?:)?//)?((?:www).)?((?:bilibili.com))(/(?:video/)?)([\w-]+)(\?p=(\d+))?(\S+)?$") (def loom-regex #"^((?:https?:)?//)?((?:www).)?((?:loom.com))(/(?:share/|embed/))([\w-]+)(\S+)?$") @@ -93,7 +92,22 @@ [] ks)))) -(def cut-by cli-text-util/cut-by) +(defn cut-by + "Cuts `value` around the first `before` and `end` marker pair." + [value before end] + (let [b-pos (string/index-of value before) + b-len (count before)] + (if b-pos + (let [b-cut (subs value 0 b-pos) + m-cut (subs value (+ b-pos b-len)) + e-len (count end) + e-pos (string/index-of m-cut end)] + (if e-pos + (let [e-cut (subs m-cut (+ e-pos e-len)) + m-cut (subs m-cut 0 e-pos)] + [b-cut m-cut e-cut]) + [b-cut m-cut nil])) + [value nil nil]))) (defn get-graph-name-from-path "Get `Dir/GraphName` style name for from repo-url. diff --git a/src/main/frontend/worker/db_core.cljs b/src/main/frontend/worker/db_core.cljs index df5261974116..3bff3fa75d4d 100644 --- a/src/main/frontend/worker/db_core.cljs +++ b/src/main/frontend/worker/db_core.cljs @@ -32,8 +32,8 @@ [frontend.worker.undo-redo :as worker-undo-redo] [goog.functions :as gfun] [lambdaisland.glogi :as log] + [logseq.api.db-based.tools :as api-tools] [logseq.cli.common.db-worker :as cli-db-worker] - [logseq.cli.common.mcp.tools :as cli-common-mcp-tools] [logseq.common.graph-dir :as graph-dir] [logseq.common.util :as common-util] [logseq.db :as ldb] @@ -1612,27 +1612,27 @@ (def-thread-api :thread-api/api-get-page-data [repo page-title] (let [conn (worker-state/get-datascript-conn repo)] - (cli-common-mcp-tools/get-page-data @conn page-title))) + (api-tools/get-page-data @conn page-title))) (def-thread-api :thread-api/api-list-properties [repo options] (let [conn (worker-state/get-datascript-conn repo)] - (cli-common-mcp-tools/list-properties @conn options))) + (api-tools/list-properties @conn options))) (def-thread-api :thread-api/api-list-tags [repo options] (let [conn (worker-state/get-datascript-conn repo)] - (cli-common-mcp-tools/list-tags @conn options))) + (api-tools/list-tags @conn options))) (def-thread-api :thread-api/api-list-pages [repo options] (let [conn (worker-state/get-datascript-conn repo)] - (cli-common-mcp-tools/list-pages @conn options))) + (api-tools/list-pages @conn options))) (def-thread-api :thread-api/api-build-upsert-nodes-edn [repo ops] (let [conn (worker-state/get-datascript-conn repo)] - (cli-common-mcp-tools/build-upsert-nodes-edn @conn ops))) + (api-tools/build-upsert-nodes-edn @conn ops))) (comment (def-thread-api :general/dangerousRemoveAllDbs diff --git a/src/main/frontend/worker/export.cljs b/src/main/frontend/worker/export.cljs index f9836c20b137..6a7eb693196b 100644 --- a/src/main/frontend/worker/export.cljs +++ b/src/main/frontend/worker/export.cljs @@ -1,7 +1,7 @@ (ns frontend.worker.export "Export data" (:require [datascript.core :as d] - [logseq.cli.common.file :as common-file] + [logseq.common.export.file :as common-file] [logseq.common.util :as common-util] [logseq.db :as ldb])) diff --git a/src/main/frontend/worker/markdown_mirror.cljs b/src/main/frontend/worker/markdown_mirror.cljs index d4cec60b66c8..d5c4fd08b00e 100644 --- a/src/main/frontend/worker/markdown_mirror.cljs +++ b/src/main/frontend/worker/markdown_mirror.cljs @@ -5,7 +5,7 @@ [frontend.worker.graph-dir :as graph-dir] [frontend.worker.platform :as platform] [lambdaisland.glogi :as log] - [logseq.cli.common.file :as common-file] + [logseq.common.export.file :as common-file] [logseq.common.util :as common-util] [logseq.db :as ldb] [logseq.db.frontend.property :as db-property] diff --git a/src/main/logseq/api.cljs b/src/main/logseq/api.cljs index ccc3fdc636ec..c2d10bc54625 100644 --- a/src/main/logseq/api.cljs +++ b/src/main/logseq/api.cljs @@ -221,7 +221,7 @@ (def ^:export set_property_node_tags db-based-api/set-property-node-tags) ;; Internal db-based CLI APIs -;; CLI APIs should use ensure-db-graph unless they have a nested check in cli-common-mcp-tools ns +;; CLI APIs should use ensure-db-graph unless they have a nested check in logseq.api.db-based.tools. (defn- ensure-db-graph [f] (fn ensure-db-graph-wrapper [& args] diff --git a/src/main/logseq/api/db_based/cli.cljs b/src/main/logseq/api/db_based/cli.cljs index af248956d0f0..31c0a2f708aa 100644 --- a/src/main/logseq/api/db_based/cli.cljs +++ b/src/main/logseq/api/db_based/cli.cljs @@ -5,7 +5,7 @@ [frontend.modules.outliner.op :as outliner-op] [frontend.modules.outliner.ui :as ui-outliner-tx] [frontend.state :as state] - [logseq.cli.common.mcp.tools :as cli-common-mcp-tools] + [logseq.api.db-based.tools :as api-tools] [logseq.common.config :as common-config] [logseq.db.sqlite.util :as sqlite-util] [promesa.core :as p])) @@ -32,7 +32,7 @@ (clj->js resp))) (defn get-page-data - "Like get_page_blocks_tree but for MCP tools" + "Like get_page_blocks_tree but for API clients." [page-title] (p/let [resp (state/clj operations :keywordize-keys true) {:keys [dry-run] :as options} (js->clj options* :keywordize-keys true) @@ -51,7 +51,7 @@ (outliner-op/batch-import-edn! edn-data {})))] (when error (throw (ex-info error {}))) (ui-handler/re-render-root!) - (cli-common-mcp-tools/summarize-upsert-operations ops options))) + (api-tools/summarize-upsert-operations ops options))) (defn import-edn "Given EDN data as a transitized string, converts to EDN and imports it." diff --git a/deps/cli/src/logseq/cli/common/mcp/tools.cljs b/src/main/logseq/api/db_based/tools.cljs similarity index 94% rename from deps/cli/src/logseq/cli/common/mcp/tools.cljs rename to src/main/logseq/api/db_based/tools.cljs index 285617733565..6edddbac975e 100644 --- a/deps/cli/src/logseq/cli/common/mcp/tools.cljs +++ b/src/main/logseq/api/db_based/tools.cljs @@ -1,5 +1,5 @@ -(ns logseq.cli.common.mcp.tools - "MCP tool related fns shared between CLI and frontend" +(ns logseq.api.db-based.tools + "Shared helpers for db-based API calls." (:require [clojure.string :as string] [datascript.core :as d] [logseq.common.util :as common-util] @@ -10,7 +10,6 @@ [logseq.db.frontend.entity-util :as entity-util] [logseq.db.frontend.property :as db-property] [logseq.db.frontend.property.type :as db-property-type] - [logseq.db.sqlite.export :as sqlite-export] [logseq.outliner.tree :as otree] [logseq.outliner.validate :as outliner-validate] [malli.core :as m] @@ -108,16 +107,6 @@ ;; upsert-nodes tool ;; ================= -(defn- import-edn-data - [conn export-map] - (let [{:keys [init-tx block-props-tx misc-tx error] :as _txs} - (sqlite-export/build-import export-map @conn {})] - ;; (cljs.pprint/pprint _txs) - (when error - (throw (ex-info (str "Error while building import data: " error) {}))) - (let [tx-meta {::sqlite-export/imported-data? true}] - (ldb/transact! conn (vec (concat init-tx block-props-tx misc-tx)) tx-meta)))) - (defn- get-ident [idents title] (or (get idents title) (throw (ex-info (str "No ident found for " (pr-str title)) {})))) @@ -384,14 +373,5 @@ (assoc :classes classes) (seq properties) (assoc :properties properties))] - (prn :debug-import-edn import-edn) (validate-import-edn import-edn) import-edn)) - -(defn upsert-nodes - "Builds import-edn from llm generated operations and then imports resulting data. Only - used for CLI. See logseq.api/upsert_nodes for API equivalent" - [conn operations* {:keys [dry-run] :as opts}] - (let [import-edn (build-upsert-nodes-edn @conn operations*)] - (when-not dry-run (import-edn-data conn import-edn)) - (summarize-upsert-operations operations* opts))) diff --git a/deps/cli/src/logseq/cli/common/file.cljs b/src/main/logseq/common/export/file.cljs similarity index 99% rename from deps/cli/src/logseq/cli/common/file.cljs rename to src/main/logseq/common/export/file.cljs index cbc2f479f323..91bb8ae3463b 100644 --- a/deps/cli/src/logseq/cli/common/file.cljs +++ b/src/main/logseq/common/export/file.cljs @@ -1,5 +1,5 @@ -(ns logseq.cli.common.file - "Convert blocks to file content. Used for frontend exports and CLI" +(ns logseq.common.export.file + "Converts blocks to file content for frontend exports." (:require [cljs-time.coerce :as tc] [cljs-time.core :as t] [clojure.string :as string] @@ -316,7 +316,6 @@ (if-let [children (seq (:block/children f))] (cons content (tree->file-content-aux db children {:init-level (inc level)} context)) [content])] - #_:clj-kondo/ignore (conj! block-contents new-content) (recur r level)))))) diff --git a/src/main/logseq/sdk/utils.cljs b/src/main/logseq/sdk/utils.cljs index 389b1ac52d90..f9008ab17d07 100644 --- a/src/main/logseq/sdk/utils.cljs +++ b/src/main/logseq/sdk/utils.cljs @@ -7,7 +7,7 @@ [frontend.handler.plugin :as plugin-handler] [frontend.util :as util] [goog.object :as gobj] - [logseq.cli.common.mcp.tools :as cli-common-mcp-tools] + [logseq.api.db-based.tools :as api-tools] [logseq.db.frontend.content :as db-content] [logseq.db.frontend.entity-util :as entity-util])) @@ -17,7 +17,7 @@ (contains? #{"block" "db" "file"}) (not))) -(def remove-hidden-properties cli-common-mcp-tools/remove-hidden-properties) +(def remove-hidden-properties api-tools/remove-hidden-properties) (def ^:private kw-tag "___kw___") ; unlikely in normal strings; change if you prefer diff --git a/src/test/electron/db_test.cljs b/src/test/electron/db_test.cljs index b3f700c753c1..d1e50f22b2e3 100644 --- a/src/test/electron/db_test.cljs +++ b/src/test/electron/db_test.cljs @@ -7,8 +7,8 @@ [electron.db-worker :as db-worker] [frontend.test.node-helper :as node-helper] [goog.object :as gobj] - [logseq.cli.common.graph :as cli-common-graph] [logseq.cli.transport :as cli-transport] + [logseq.common.graph :as common-graph] [logseq.db.common.sqlite :as common-sqlite] [logseq.db.sqlite.backup :as sqlite-backup] [logseq.db-worker.graph-backup :as graph-backup] @@ -27,7 +27,7 @@ (deftest ensure-graph-dir-uses-encoded-directory-name (let [graphs-dir (node-helper/create-tmp-dir "electron-db-graph-dir")] - (with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)] + (with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir)] (let [graph-dir (electron-db/ensure-graph-dir! "logseq_db_foo/bar")] (is (= (node-path/join graphs-dir "foo~2Fbar") graph-dir)) (is (fs/existsSync graph-dir)))))) @@ -36,7 +36,7 @@ (let [graphs-dir (node-helper/create-tmp-dir "electron-db-save") payload (.from js/Buffer "db-data") db-name "logseq_db_foo/bar"] - (with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)] + (with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir)] (let [[_ db-path] (common-sqlite/get-db-full-path graphs-dir db-name)] (fs/ensureDirSync (node-path/dirname db-path)) (fs/writeFileSync db-path payload)) @@ -69,8 +69,8 @@ (let [graphs-dir (node-helper/create-tmp-dir "electron-db-backup") db-name "logseq_db_foo/bar" DatabaseSync (resolve-database-sync-ctor) - original-get-db-graphs-dir cli-common-graph/get-db-graphs-dir] - (set! cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)) + original-get-db-graphs-dir common-graph/get-db-graphs-dir] + (set! common-graph/get-db-graphs-dir (fn [] graphs-dir)) (let [[_ db-path] (common-sqlite/get-db-full-path graphs-dir db-name)] (fs/ensureDirSync (node-path/dirname db-path)) (let [source-db (new DatabaseSync db-path)] @@ -90,7 +90,7 @@ (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] - (set! cli-common-graph/get-db-graphs-dir original-get-db-graphs-dir) + (set! common-graph/get-db-graphs-dir original-get-db-graphs-dir) (done)))))))) (deftest backup-db-uses-shared-backup-layout-and-metadata @@ -102,7 +102,7 @@ backup-calls (atom [])] (fs/ensureDirSync (node-path/dirname db-path)) (fs/writeFileSync db-path "seed") - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) sqlite-backup/backup-db-file! (fn [src dst] (swap! sqlite-calls conj [src dst]) (fs/writeFileSync dst "copied") @@ -142,7 +142,7 @@ backup-calls (atom [])] (fs/ensureDirSync (node-path/dirname db-path)) (fs/writeFileSync db-path "seed") - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) sqlite-backup/backup-db-file! (fn [src dst] (swap! fallback-calls conj [src dst]) (p/rejected (ex-info "fallback should not run" {}))) @@ -181,7 +181,7 @@ runtime {:runtime true} worker-calls (atom []) backup-calls (atom [])] - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) db-worker/ensure-runtime! (fn [repo window-id] (swap! worker-calls conj [:ensure-runtime repo window-id]) (p/resolved runtime)) @@ -221,7 +221,7 @@ db-name "logseq_db_demo" runtime {:runtime true} worker-calls (atom [])] - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) db-worker/ensure-runtime! (fn [repo window-id] (swap! worker-calls conj [:ensure-runtime repo window-id]) (p/resolved runtime)) @@ -252,7 +252,7 @@ (write-backup! graphs-dir db-name (str "auto-" idx) :electron-auto idx)) (write-backup! graphs-dir db-name "manual-old" :electron-manual 0) (write-backup! graphs-dir db-name "cli-old" :cli 0) - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) db-worker/ensure-runtime! (fn [repo window-id] (swap! worker-calls conj [:ensure-runtime repo window-id]) (p/resolved runtime)) @@ -280,7 +280,7 @@ runtime {:runtime true} worker-calls (atom []) backup-calls (atom [])] - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) db-worker/ensure-runtime! (fn [repo window-id] (swap! worker-calls conj [:ensure-runtime repo window-id]) (p/resolved runtime)) @@ -308,7 +308,7 @@ db-name "logseq_db_demo" runtime {:runtime true} worker-calls (atom [])] - (-> (p/with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir) + (-> (p/with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir) db-worker/ensure-runtime! (fn [repo window-id] (swap! worker-calls conj [:ensure-runtime repo window-id]) (p/resolved runtime)) diff --git a/src/test/frontend/handler/export_property_test.cljs b/src/test/frontend/handler/export_property_test.cljs index c45965b15cf2..5528a9c8de76 100644 --- a/src/test/frontend/handler/export_property_test.cljs +++ b/src/test/frontend/handler/export_property_test.cljs @@ -3,7 +3,7 @@ [cljs-time.core :as t] [cljs.test :refer [deftest is]] [datascript.core :as d] - [logseq.cli.common.file :as common-file] + [logseq.common.export.file :as common-file] [logseq.common.util.date-time :as date-time-util] [logseq.db.frontend.property :as db-property])) diff --git a/src/test/frontend/util/text_test.cljs b/src/test/frontend/util/text_test.cljs index f8ac05797f39..bd0b6e10f727 100644 --- a/src/test/frontend/util/text_test.cljs +++ b/src/test/frontend/util/text_test.cljs @@ -36,6 +36,14 @@ '(false false false false false false true true true true true true) (map #(text-util/wrapped-by? "prop::value" % "::" "") (take 12 (range))))) +(deftest cut-by + (are [expected value before end] (= expected (text-util/cut-by value before end)) + ["abc " " def " " ghi"] "abc def ghi" "" "" + ["abc" nil nil] "abc" "" "" + ["abc " "def" nil] "abc def" "" "" + ["a " "b" " c [d] e"] "a [b] c [d] e" "[" "]" + ["" "" "abc"] "abc" "" "")) + (deftest get-graph-name-from-path-strips-only-one-leading-db-prefix (are [input expected] (= expected (text-util/get-graph-name-from-path input)) "logseq_db_demo" "demo" diff --git a/src/test/frontend/worker/db_core_test.cljs b/src/test/frontend/worker/db_core_test.cljs index 658ccb66e818..39898c04e62f 100644 --- a/src/test/frontend/worker/db_core_test.cljs +++ b/src/test/frontend/worker/db_core_test.cljs @@ -18,8 +18,8 @@ [frontend.worker.undo-redo :as worker-undo-redo] [frontend.worker-common.util :as worker-util] [goog.object :as gobj] + [logseq.api.db-based.tools :as api-tools] [logseq.cli.common.db-worker :as cli-db-worker] - [logseq.cli.common.mcp.tools :as cli-common-mcp-tools] [logseq.db :as ldb] [logseq.db.common.initial-data :as common-initial-data] [logseq.db.common.view :as db-view] @@ -1894,21 +1894,21 @@ cli-db-worker/list-nodes (fn [db opt] (swap! calls conj [:cli-list-nodes db opt]) [:node1]) - cli-common-mcp-tools/get-page-data (fn [db title] - (swap! calls conj [:api-get-page-data db title]) - {:title title}) - cli-common-mcp-tools/list-properties (fn [db opt] - (swap! calls conj [:api-list-properties db opt]) - [:ap1]) - cli-common-mcp-tools/list-tags (fn [db opt] - (swap! calls conj [:api-list-tags db opt]) - [:at1]) - cli-common-mcp-tools/list-pages (fn [db opt] - (swap! calls conj [:api-list-pages db opt]) - [:apg1]) - cli-common-mcp-tools/build-upsert-nodes-edn (fn [db input-ops] - (swap! calls conj [:api-build-upsert-nodes-edn db input-ops]) - {:ops input-ops})] + api-tools/get-page-data (fn [db title] + (swap! calls conj [:api-get-page-data db title]) + {:title title}) + api-tools/list-properties (fn [db opt] + (swap! calls conj [:api-list-properties db opt]) + [:ap1]) + api-tools/list-tags (fn [db opt] + (swap! calls conj [:api-list-tags db opt]) + [:at1]) + api-tools/list-pages (fn [db opt] + (swap! calls conj [:api-list-pages db opt]) + [:apg1]) + api-tools/build-upsert-nodes-edn (fn [db input-ops] + (swap! calls conj [:api-build-upsert-nodes-edn db input-ops]) + {:ops input-ops})] (is (= [:p1] ((get-thread-api :thread-api/cli-list-properties) test-repo options))) (is (= [:t1] ((get-thread-api :thread-api/cli-list-tags) test-repo options))) (is (= [:pg1] ((get-thread-api :thread-api/cli-list-pages) test-repo options))) diff --git a/src/test/logseq/cli/common/graph_test.cljs b/src/test/logseq/common/graph_test.cljs similarity index 67% rename from src/test/logseq/cli/common/graph_test.cljs rename to src/test/logseq/common/graph_test.cljs index 6b61cabd922f..37dd6d26f54e 100644 --- a/src/test/logseq/cli/common/graph_test.cljs +++ b/src/test/logseq/common/graph_test.cljs @@ -1,26 +1,26 @@ -(ns logseq.cli.common.graph-test +(ns logseq.common.graph-test (:require [cljs.test :refer [deftest is]] [clojure.string :as string] [frontend.test.node-helper :as node-helper] - [logseq.cli.common.graph :as cli-common-graph] + [logseq.common.graph :as common-graph] ["fs" :as fs] ["path" :as node-path])) (deftest get-db-based-graphs-canonicalizes-legacy-prefixed-directory-names - (let [graphs-dir (node-helper/create-tmp-dir "cli-common-graph") + (let [graphs-dir (node-helper/create-tmp-dir "common-graph") _ (doseq [dir ["demo" "logseq_db_demo" "logseq_db_logseq_db_demo" "logseq_local_file-graph" "Unlinked graphs"]] (fs/mkdirSync (node-path/join graphs-dir dir) #js {:recursive true}))] - (with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)] - (let [graphs (cli-common-graph/get-db-based-graphs)] + (with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir)] + (let [graphs (common-graph/get-db-based-graphs)] (is (= #{"logseq_db_demo"} (set graphs))) (is (not-any? #(string/starts-with? % "logseq_db_logseq_db_") graphs)))))) (deftest get-db-based-graphs-decodes-encoded-graph-directories - (let [graphs-dir (node-helper/create-tmp-dir "cli-common-graph-encoded") + (let [graphs-dir (node-helper/create-tmp-dir "common-graph-encoded") _ (doseq [dir ["foo~2Fbar" "a~3Ab" "space name" @@ -28,18 +28,18 @@ "space%20name" "Unlinked graphs"]] (fs/mkdirSync (node-path/join graphs-dir dir) #js {:recursive true}))] - (with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)] - (let [graphs (set (cli-common-graph/get-db-based-graphs))] + (with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir)] + (let [graphs (set (common-graph/get-db-based-graphs))] (is (= #{"logseq_db_foo/bar" "logseq_db_a:b" "logseq_db_space name"} graphs)))))) (deftest get-db-based-graphs-ignores-legacy-graph-dir-encodings - (let [graphs-dir (node-helper/create-tmp-dir "cli-common-graph-legacy") + (let [graphs-dir (node-helper/create-tmp-dir "common-graph-legacy") _ (doseq [dir ["foo++bar" "a+3A+b" "Unlinked graphs"]] (fs/mkdirSync (node-path/join graphs-dir dir) #js {:recursive true}))] - (with-redefs [cli-common-graph/get-db-graphs-dir (fn [] graphs-dir)] - (is (= [] (cli-common-graph/get-db-based-graphs)))))) + (with-redefs [common-graph/get-db-graphs-dir (fn [] graphs-dir)] + (is (= [] (common-graph/get-db-based-graphs)))))) From fd5e004f04ce45324c1f7cb4a49e2c8b0536edd5 Mon Sep 17 00:00:00 2001 From: rcmerci Date: Thu, 28 May 2026 21:52:52 +0800 Subject: [PATCH 0040/1400] refactor(cli): agent bridge --- .agents/skills/logseq-cli/SKILL.md | 3 +- cli-e2e/scripts/agent_bridge_demo.sh | 40 +- cli-e2e/scripts/agent_bridge_e2e.py | 374 +-- cli-e2e/spec/non_sync_cases.edn | 24 +- cli-e2e/spec/non_sync_inventory.edn | 2 +- docs/agent-guide/logseq-cli/001-logseq-cli.md | 2 +- .../011-agent-bridge-master-agent.md | 572 +++++ src/main/logseq/cli/command/agent.cljs | 899 ++++--- src/main/logseq/cli/format.cljs | 2 +- src/test/logseq/cli/command/agent_test.cljs | 2119 ++++++++++------- 10 files changed, 2544 insertions(+), 1493 deletions(-) create mode 100644 docs/agent-guide/logseq-cli/011-agent-bridge-master-agent.md diff --git a/.agents/skills/logseq-cli/SKILL.md b/.agents/skills/logseq-cli/SKILL.md index e3f94b85d30e..fa132586ab5a 100644 --- a/.agents/skills/logseq-cli/SKILL.md +++ b/.agents/skills/logseq-cli/SKILL.md @@ -116,8 +116,7 @@ Use `logseq` to inspect and edit graph entities, run Datascript queries, and con ## Tips - `query list` returns both built-ins and `custom-queries` from `cli.edn`. -- `agent bridge --dry-run` checks the local bridge setup, resolves `:agent-name` or hostname, registers the AgentBridge name in the graph, finds routable `#Task` TODO blocks assigned to that AgentBridge name, and prints the Codex commands it would run without starting Codex or writing `agent-session-id`. -- `agent bridge` starts/reuses db-worker-node, listens to db-worker-node events, scans routable tasks on startup and each event, starts `codex exec --json` for matched tasks, stores the Codex session/thread id in `agent-bridge-sessions.edn`, and writes it to the task's `agent-session-id` property. +- `agent bridge` starts/reuses db-worker-node, listens to db-worker-node events, scans routable tasks on startup and each event, starts one in-process master Codex session, and dispatches matched task/comment requests to that session. - `show --id` accepts either one db/id or an EDN vector of ids. - `remove block --id` also accepts one db/id or an EDN vector. - `upsert block` enters update mode when `--id` or `--uuid` is provided. diff --git a/cli-e2e/scripts/agent_bridge_demo.sh b/cli-e2e/scripts/agent_bridge_demo.sh index 1e056c48e817..a7d90642ba3f 100755 --- a/cli-e2e/scripts/agent_bridge_demo.sh +++ b/cli-e2e/scripts/agent_bridge_demo.sh @@ -6,8 +6,8 @@ usage() { Usage: agent_bridge_demo.sh [options] Creates a fresh Logseq graph, starts `logseq agent bridge`, writes a routable -task after the bridge listener is ready, and verifies that a fake Codex worker -executed the task and that AgentBridge wrote agent-session-id. +task after the bridge listener is ready, and verifies that a fake Codex master +session received the task dispatch. Options: --cli PATH Path to static/logseq-cli.js. Default: /static/logseq-cli.js @@ -191,7 +191,27 @@ prompt = sys.argv[2] args = sys.argv[3:] log_path.parent.mkdir(parents=True, exist_ok=True) with log_path.open("a", encoding="utf8") as f: - f.write(json.dumps({"args": args, "prompt": prompt}, ensure_ascii=False) + "\n") + f.write(json.dumps({"event": "start", "args": args, "prompt": prompt}, ensure_ascii=False) + "\n") +PY + printf '{"type":"thread.started","thread_id":"thread-agent-bridge-demo"}\n' + exit 0 +fi + +if [[ "$#" -ge 8 && "$1" == "--sandbox" && "$2" == "danger-full-access" && "$3" == "exec" && "$4" == "resume" && "$5" == "--json" && "$6" == "--skip-git-repo-check" ]]; then + session_id="$7" + prompt="$8" + python3 - "$CODEX_FAKE_LOG" "$session_id" "$prompt" "$@" <<'PY' +import json +import pathlib +import sys + +log_path = pathlib.Path(sys.argv[1]) +session_id = sys.argv[2] +prompt = sys.argv[3] +args = sys.argv[4:] +log_path.parent.mkdir(parents=True, exist_ok=True) +with log_path.open("a", encoding="utf8") as f: + f.write(json.dumps({"event": "resume", "session": session_id, "args": args, "prompt": prompt}, ensure_ascii=False) + "\n") PY block_uuid="$(python3 - "$prompt" <<'PY' import re @@ -203,8 +223,9 @@ if not match: print(match.group(1)) PY )" - node "$DEMO_CLI" --root-dir "$DEMO_ROOT_DIR" --config "$DEMO_CONFIG" --output json upsert task --graph "$DEMO_GRAPH" --uuid "$block_uuid" --status done >/dev/null - printf '{"type":"thread.started","thread_id":"thread-agent-bridge-demo"}\n' + node "$DEMO_CLI" --root-dir "$DEMO_ROOT_DIR" --config "$DEMO_CONFIG" --output json upsert task --graph "$DEMO_GRAPH" --uuid "$block_uuid" --status in-review >/dev/null + node "$DEMO_CLI" --root-dir "$DEMO_ROOT_DIR" --config "$DEMO_CONFIG" --output json upsert block --graph "$DEMO_GRAPH" --uuid "$block_uuid" --update-properties '{"Agent Session ID" "thread-agent-bridge-demo"}' >/dev/null + printf '{"type":"thread.started","thread_id":"%s"}\n' "$session_id" exit 0 fi @@ -282,15 +303,18 @@ log_path = pathlib.Path(sys.argv[1]) task_title = sys.argv[2] graph = sys.argv[3] lines = [json.loads(line) for line in log_path.read_text(encoding="utf8").splitlines() if line.strip()] -if len(lines) != 1: - raise SystemExit(f"expected one Codex invocation, got {len(lines)}") -prompt = lines[0]["prompt"] +resume_lines = [line for line in lines if line.get("event") == "resume"] +if len(resume_lines) != 1: + raise SystemExit(f"expected one Codex resume invocation, got {len(resume_lines)}") +prompt = resume_lines[0]["prompt"] if task_title not in prompt: raise SystemExit("task title missing from Codex prompt") if f"Graph: {graph}" not in prompt: raise SystemExit("graph missing from Codex prompt") if "Block UUID:" not in prompt: raise SystemExit("block uuid missing from Codex prompt") +if "Request kind: task" not in prompt: + raise SystemExit("request kind missing from Codex prompt") PY echo "task status: in-review" diff --git a/cli-e2e/scripts/agent_bridge_e2e.py b/cli-e2e/scripts/agent_bridge_e2e.py index 014282e5069f..5413b063e54c 100644 --- a/cli-e2e/scripts/agent_bridge_e2e.py +++ b/cli-e2e/scripts/agent_bridge_e2e.py @@ -62,11 +62,20 @@ def write_fake_codex(fake_bin): prompt = args[7] if len(args) > 7 else "" comment_uuid_match = re.search(r"^Comment UUID: (.+)$", prompt, re.MULTILINE) comment_uuid = comment_uuid_match.group(1) if comment_uuid_match else None + block_uuid_match = re.search(r"^Block UUID: (.+)$", prompt, re.MULTILINE) + block_uuid = block_uuid_match.group(1) if block_uuid_match else None log_path = pathlib.Path(os.environ["CODEX_FAKE_LOG"]) log_path.parent.mkdir(parents=True, exist_ok=True) with log_path.open("a", encoding="utf8") as f: f.write(json.dumps( - {"event": "resume", "time": time.time(), "args": args, "prompt": prompt, "comment_uuid": comment_uuid, "session": session_id}, + {"event": "resume", "time": time.time(), "args": args, "prompt": prompt, "comment_uuid": comment_uuid, "block_uuid": block_uuid, "session": session_id}, + ensure_ascii=False) + "\\n") + delay = float(os.environ.get("CODEX_FAKE_DELAY_SECONDS", "0")) + if delay > 0: + time.sleep(delay) + with log_path.open("a", encoding="utf8") as f: + f.write(json.dumps( + {"event": "resume-complete", "time": time.time(), "comment_uuid": comment_uuid, "block_uuid": block_uuid, "session": session_id}, ensure_ascii=False) + "\\n") print(json.dumps({"type": "thread.started", "thread_id": session_id}), flush=True) sys.exit(0) @@ -321,6 +330,24 @@ def wait_for_codex_event(codex_log, event_name, bridge, bridge_log, bridge_err): raise SystemExit("codex event {!r} was not observed; events={!r}".format(event_name, events)) +def wait_for_codex_events(codex_log, event_name, count, bridge, bridge_log, bridge_err): + deadline = time.time() + 45 + events = [] + while time.time() < deadline: + events = read_codex_events(codex_log) + matches = [event for event in events if event.get("event") == event_name] + if len(matches) >= count: + return matches + if bridge.poll() is not None: + raise SystemExit( + "agent bridge exited early with {}\nstdout:\n{}\nstderr:\n{}".format( + bridge.returncode, read_text(bridge_log), read_text(bridge_err) + ) + ) + time.sleep(0.5) + raise SystemExit("codex event {!r} count {} was not observed; events={!r}".format(event_name, count, events)) + + def write_comment_blocks_file(path, task_uuid, hostname): path.write_text( """[{{:block/title "Comments" @@ -371,9 +398,14 @@ def run_comment_mention_check(cli, repo_root, root_dir, config, graph, tmp_dir): try: wait_for_log(bridge_log, "listening graph changes", bridge) assign_task(cli, repo_root, root_dir, config, graph) - session = wait_for_task_sessions( - cli, repo_root, root_dir, config, graph, [TASK_TITLE], bridge, bridge_log, bridge_err - )[TASK_TITLE] + start_events = wait_for_codex_event(codex_log, "start", bridge, bridge_log, bridge_err) + session_events = wait_for_codex_event(codex_log, "session", bridge, bridge_log, bridge_err) + session = session_events[0].get("session") + resume_events = wait_for_codex_event(codex_log, "resume", bridge, bridge_log, bridge_err) + task_prompt = resume_events[0].get("prompt", "") + assert resume_events[0].get("session") == session, resume_events[0] + assert "Request kind: task" in task_prompt, task_prompt + assert TASK_TITLE in task_prompt, task_prompt task_id = find_task_id(cli, repo_root, root_dir, config, graph, TASK_TITLE) task_uuid = find_task_uuid(cli, repo_root, root_dir, config, graph, TASK_TITLE) @@ -399,14 +431,16 @@ def run_comment_mention_check(cli, repo_root, root_dir, config, graph, tmp_dir): ], ) - resume_events = wait_for_codex_event(codex_log, "resume", bridge, bridge_log, bridge_err) - if resume_events[0].get("session") != session: - raise SystemExit("comment resumed the wrong session: {!r}".format(resume_events[0])) - prompt = resume_events[0].get("prompt", "") - assert "You are handling a Logseq AgentBridge comment request." in prompt, prompt + resume_events = wait_for_codex_events(codex_log, "resume", 2, bridge, bridge_log, bridge_err) + comment_event = resume_events[-1] + if comment_event.get("session") != session: + raise SystemExit("comment resumed the wrong master session: {!r}".format(comment_event)) + prompt = comment_event.get("prompt", "") + assert "You are handling a Logseq AgentBridge master dispatch request." in prompt, prompt + assert "Request kind: comment" in prompt, prompt assert "Comment target context:" in prompt, prompt assert "Requesting comment:" in prompt, prompt - print("agent bridge resumed comment request in " + session) + print("agent bridge dispatched comment request to master " + session) finally: if bridge.poll() is None: bridge.terminate() @@ -458,29 +492,27 @@ def run_parallel_assignment_check(cli, repo_root, root_dir, config, graph, tmp_d for title in PARALLEL_TASK_TITLES: assign_task(cli, repo_root, root_dir, config, graph, title) - sessions = wait_for_task_sessions( - cli, repo_root, root_dir, config, graph, PARALLEL_TASK_TITLES, bridge, bridge_log, bridge_err - ) events = read_codex_events(codex_log) start_events = [event for event in events if event.get("event") == "start"] - session_events = [event for event in events if event.get("event") == "session"] - if len(start_events) != 2 or len(session_events) != 2: - raise SystemExit("expected two codex starts and sessions, got: {!r}".format(events)) - - first_session_time = min(event["time"] for event in session_events) - latest_start_time = max(event["time"] for event in start_events) - if latest_start_time >= first_session_time: + resume_events = wait_for_codex_events(codex_log, "resume", 2, bridge, bridge_log, bridge_err) + complete_events = wait_for_codex_events(codex_log, "resume-complete", 2, bridge, bridge_log, bridge_err) + if len(start_events) != 1 or len(resume_events) != 2: + raise SystemExit("expected one master start and two master resumes, got: {!r}".format(read_codex_events(codex_log))) + + first_complete_time = min(event["time"] for event in complete_events) + latest_resume_time = max(event["time"] for event in resume_events) + if latest_resume_time >= first_complete_time: raise SystemExit( - "codex exec did not overlap; starts={!r}, sessions={!r}".format( - [event["time"] for event in start_events], - [event["time"] for event in session_events], + "master dispatch resumes did not overlap; resumes={!r}, completes={!r}".format( + [event["time"] for event in resume_events], + [event["time"] for event in complete_events], ) ) - prompts = "\n".join(event["prompt"] for event in start_events) + prompts = "\n".join(event["prompt"] for event in resume_events) for title in PARALLEL_TASK_TITLES: assert title in prompts, prompts - print("agent bridge routed tasks concurrently: " + ", ".join(sorted(sessions.values()))) + print("agent bridge dispatched tasks concurrently to master") finally: if bridge.poll() is None: bridge.terminate() @@ -491,198 +523,74 @@ def run_parallel_assignment_check(cli, repo_root, root_dir, config, graph, tmp_d bridge.wait(timeout=5) -def edn_string(value): - return json.dumps(value, ensure_ascii=False) - - -def write_task_template_file(path, marker): - template = "\n".join( - [ - marker, - "Graph: {{graph}}", - "Block UUID: {{block-uuid}}", - "AgentBridge name: {{agent-name}}", - "{{task-block-tree}}", - ] - ) - path.write_text( - """[{:block/title "Task prompt template" - :block/children [{:block/title "Description: Custom task template for this graph."} - {:block/title "Template variables: {{graph}}, {{block-uuid}}, {{agent-name}}, and {{task-block-tree}}."} - {:block/title %s}]}]""" - % edn_string("```text\n" + template + "\n```"), - encoding="utf8", - ) - - -def write_invalid_task_template_file(path): - path.write_text( - """[{:block/title "Task prompt template" - :block/children [{:block/title "Description: Invalid task template for lint coverage."} - {:block/title %s}]}]""" - % edn_string("```text\nBroken {{graph}} {{unknown-var}}\n```"), - encoding="utf8", - ) - - -def install_task_template(cli, repo_root, root_dir, config, graph, tmp_dir, marker): - run_cli( - cli, - repo_root, - root_dir, - config, - graph, - ["upsert", "page", "--graph", graph, "--page", "AgentBridge"], - ) - blocks_file = tmp_dir / ("task-template-" + graph + ".edn") - write_task_template_file(blocks_file, marker) - run_cli( - cli, - repo_root, - root_dir, - config, - graph, - [ - "upsert", - "block", - "--graph", - graph, - "--target-page", - "AgentBridge", - "--blocks-file", - str(blocks_file), - ], - ) - - -def install_invalid_task_template(cli, repo_root, root_dir, config, graph, tmp_dir): - run_cli( - cli, - repo_root, - root_dir, - config, - graph, - ["upsert", "page", "--graph", graph, "--page", "AgentBridge"], - ) - blocks_file = tmp_dir / ("invalid-task-template-" + graph + ".edn") - write_invalid_task_template_file(blocks_file) - run_cli( - cli, - repo_root, - root_dir, - config, - graph, - [ - "upsert", - "block", - "--graph", - graph, - "--target-page", - "AgentBridge", - "--blocks-file", - str(blocks_file), - ], - ) - - -def dry_run_prompt(cli, repo_root, root_dir, config, graph, env): - result = run_cli_with_env( - cli, - repo_root, - root_dir, - config, - ["agent", "bridge", "--graph", graph, "--dry-run"], - env, - ) - if result.returncode != 0: - raise SystemExit( - "agent bridge dry-run failed for {}\nstdout:\n{}\nstderr:\n{}".format( - graph, result.stdout, result.stderr - ) - ) - payload = json.loads(result.stdout) - commands = payload.get("data", {}).get("commands", []) - if len(commands) != 1: - raise SystemExit("expected one dry-run command for {}, got {!r}".format(graph, commands)) - command = commands[0].get("command", []) - if len(command) < 1: - raise SystemExit("dry-run command did not contain a prompt: {!r}".format(command)) - return command[-1] - - -def assert_contains(text, expected): - if expected not in text: - raise SystemExit("expected {!r} in:\n{}".format(expected, text)) - - -def assert_not_contains(text, unexpected): - if unexpected in text: - raise SystemExit("did not expect {!r} in:\n{}".format(unexpected, text)) - - -def run_prompt_template_graph_check(cli, repo_root, root_dir, config, graph, tmp_dir): - graph_a = graph - graph_b = graph + "-other" - graph_bad = graph + "-invalid" - marker_a = "CUSTOM GRAPH A TEMPLATE" - marker_b = "CUSTOM GRAPH B TEMPLATE" - +def run_duplicate_bridge_check(cli, repo_root, root_dir, config, graph, tmp_dir): fake_bin = tmp_dir / "fake-bin" + bridge_log = tmp_dir / "agent-bridge.log" + bridge_err = tmp_dir / "agent-bridge.err" + codex_log = tmp_dir / "codex-invocations.jsonl" + env = os.environ.copy() env["PATH"] = str(fake_bin) + os.pathsep + env.get("PATH", "") - env["CODEX_FAKE_LOG"] = str(tmp_dir / "codex-dry-run.jsonl") + env["CODEX_FAKE_LOG"] = str(codex_log) - for graph_name in [graph_b, graph_bad]: - run_cli( - cli, - repo_root, - root_dir, - config, - graph_name, - ["graph", "create", "--graph", graph_name], + with bridge_log.open("wb") as out, bridge_err.open("wb") as err: + bridge = subprocess.Popen( + cli + + [ + "--root-dir", + root_dir, + "--config", + config, + "--output", + "human", + "agent", + "bridge", + "--graph", + graph, + ], + cwd=repo_root, + env=env, + stdout=out, + stderr=err, ) - for graph_name in [graph_a, graph_b, graph_bad]: - create_task(cli, repo_root, root_dir, config, graph_name, TASK_TITLE) - assign_task(cli, repo_root, root_dir, config, graph_name) - - install_task_template(cli, repo_root, root_dir, config, graph_a, tmp_dir, marker_a) - prompt_a = dry_run_prompt(cli, repo_root, root_dir, config, graph_a, env) - assert_contains(prompt_a, marker_a) - assert_contains(prompt_a, "Graph: " + graph_a) - assert_not_contains(prompt_a, marker_b) - assert_not_contains(prompt_a, "You are handling a Logseq AgentBridge task.") - - prompt_b_default = dry_run_prompt(cli, repo_root, root_dir, config, graph_b, env) - assert_contains(prompt_b_default, "You are handling a Logseq AgentBridge task.") - assert_contains(prompt_b_default, "Graph: " + graph_b) - assert_not_contains(prompt_b_default, marker_a) - - install_task_template(cli, repo_root, root_dir, config, graph_b, tmp_dir, marker_b) - prompt_b = dry_run_prompt(cli, repo_root, root_dir, config, graph_b, env) - assert_contains(prompt_b, marker_b) - assert_contains(prompt_b, "Graph: " + graph_b) - assert_not_contains(prompt_b, marker_a) - assert_not_contains(prompt_b, "You are handling a Logseq AgentBridge task.") - - prompt_a_again = dry_run_prompt(cli, repo_root, root_dir, config, graph_a, env) - assert_contains(prompt_a_again, marker_a) - assert_not_contains(prompt_a_again, marker_b) - - install_invalid_task_template(cli, repo_root, root_dir, config, graph_bad, tmp_dir) - bad_result = run_cli_with_env( - cli, - repo_root, - root_dir, - config, - ["agent", "bridge", "--graph", graph_bad, "--dry-run"], - env, - ) - if bad_result.returncode == 0: - raise SystemExit("invalid graph prompt template unexpectedly passed:\n" + bad_result.stdout) - assert_contains(bad_result.stdout + bad_result.stderr, "agent-prompt-template-invalid") - - print("agent bridge graph prompt templates are isolated and linted") + try: + wait_for_log(bridge_log, "listening graph changes", bridge) + duplicate = subprocess.run( + cli + + [ + "--root-dir", + root_dir, + "--config", + config, + "--output", + "json", + "agent", + "bridge", + "--graph", + graph, + ], + cwd=repo_root, + env=env, + text=True, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, + timeout=15, + ) + output = duplicate.stdout + duplicate.stderr + if duplicate.returncode == 0: + raise SystemExit("duplicate bridge unexpectedly succeeded:\n{}".format(output)) + if "agent-bridge-already-running" not in output and "already running" not in output: + raise SystemExit("duplicate bridge did not report the expected lock error:\n{}".format(output)) + print("agent bridge rejected duplicate process") + finally: + if bridge.poll() is None: + bridge.terminate() + try: + bridge.wait(timeout=5) + except subprocess.TimeoutExpired: + bridge.kill() + bridge.wait(timeout=5) def main(): @@ -697,7 +605,7 @@ def main(): parser.add_argument("--assign-after-start", action="store_true") parser.add_argument("--parallel-assignment-check", action="store_true") parser.add_argument("--comment-mention-check", action="store_true") - parser.add_argument("--prompt-template-graph-check", action="store_true") + parser.add_argument("--duplicate-bridge-check", action="store_true") args = parser.parse_args() repo_root = pathlib.Path(args.repo_root) @@ -720,8 +628,8 @@ def main(): run_comment_mention_check(cli, repo_root, args.root_dir, args.config, args.graph, tmp_dir) return - if args.prompt_template_graph_check: - run_prompt_template_graph_check(cli, repo_root, args.root_dir, args.config, args.graph, tmp_dir) + if args.duplicate_bridge_check: + run_duplicate_bridge_check(cli, repo_root, args.root_dir, args.config, args.graph, tmp_dir) return env = os.environ.copy() @@ -754,45 +662,15 @@ def main(): wait_for_log(bridge_log, "listening graph changes", bridge) assign_task(cli, repo_root, args.root_dir, args.config, args.graph) - deadline = time.time() + 30 - session = None - query = ( - '[:find ?session . :where [?e :block/title "{}"] ' - "[?e :logseq.property.agent/session-id ?session]]" - ).format(TASK_TITLE) - - while time.time() < deadline: - session = deref_session_value( - cli, - repo_root, - args.root_dir, - args.config, - args.graph, - run_json(cli, repo_root, args.root_dir, args.config, args.graph, query), - ) - if session == EXPECTED_SESSION: - break - if bridge.poll() is not None: - raise SystemExit( - "agent bridge exited early with {}\nstdout:\n{}\nstderr:\n{}".format( - bridge.returncode, read_text(bridge_log), read_text(bridge_err) - ) - ) - time.sleep(0.5) - else: - raise SystemExit( - "agent-session-id was not written; last session={!r}\nstdout:\n{}\nstderr:\n{}".format( - session, read_text(bridge_log), read_text(bridge_err) - ) - ) - start_events = [event for event in read_codex_events(codex_log) if event.get("event") == "start"] + resume_events = wait_for_codex_event(codex_log, "resume", bridge, bridge_log, bridge_err) assert len(start_events) == 1, start_events - prompt = start_events[0]["prompt"] + prompt = resume_events[0]["prompt"] assert TASK_TITLE in prompt, prompt assert "Graph: " + args.graph in prompt, prompt assert "Block UUID:" in prompt, prompt - print("agent bridge routed task to " + session) + assert "Request kind: task" in prompt, prompt + print("agent bridge dispatched task to master " + resume_events[0]["session"]) finally: if bridge.poll() is None: bridge.terminate() diff --git a/cli-e2e/spec/non_sync_cases.edn b/cli-e2e/spec/non_sync_cases.edn index cb51a05e4bbf..639b71ceb638 100644 --- a/cli-e2e/spec/non_sync_cases.edn +++ b/cli-e2e/spec/non_sync_cases.edn @@ -1280,10 +1280,12 @@ :setup ["mkdir -p '{{tmp-dir}}/assigned-root' && printf '{:output-format :json}\\n' > '{{tmp-dir}}/assigned-root/cli.edn' && {{cli}} --root-dir '{{tmp-dir}}/assigned-root' --config '{{tmp-dir}}/assigned-root/cli.edn' --output json graph create --graph cli-e2e-agent-bridge-assigned >/dev/null && {{cli}} --root-dir '{{tmp-dir}}/assigned-root' --config '{{tmp-dir}}/assigned-root/cli.edn' --output json upsert task --graph cli-e2e-agent-bridge-assigned --target-page AgentBridgeE2E --content 'Test AgentBridge task routing and completion status' --status todo >/dev/null" "mkdir -p '{{tmp-dir}}/parallel-root' && printf '{:output-format :json}\\n' > '{{tmp-dir}}/parallel-root/cli.edn' && {{cli}} --root-dir '{{tmp-dir}}/parallel-root' --config '{{tmp-dir}}/parallel-root/cli.edn' --output json graph create --graph cli-e2e-agent-bridge-parallel >/dev/null" + "mkdir -p '{{tmp-dir}}/duplicate-root' && printf '{:output-format :json}\\n' > '{{tmp-dir}}/duplicate-root/cli.edn' && {{cli}} --root-dir '{{tmp-dir}}/duplicate-root' --config '{{tmp-dir}}/duplicate-root/cli.edn' --output json graph create --graph cli-e2e-agent-bridge-duplicate >/dev/null" "mkdir -p '{{tmp-dir}}/comment-root' && printf '{:output-format :json}\\n' > '{{tmp-dir}}/comment-root/cli.edn' && {{cli}} --root-dir '{{tmp-dir}}/comment-root' --config '{{tmp-dir}}/comment-root/cli.edn' --output json graph create --graph cli-e2e-agent-bridge-comment >/dev/null"], :cmds ["python3 '{{repo-root}}/cli-e2e/scripts/agent_bridge_e2e.py' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/assigned-root' --config '{{tmp-dir}}/assigned-root/cli.edn' --graph cli-e2e-agent-bridge-assigned --tmp-dir '{{tmp-dir}}/assigned-work' --repo-root '{{repo-root}}' --assign-after-start" "python3 '{{repo-root}}/cli-e2e/scripts/agent_bridge_e2e.py' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/parallel-root' --config '{{tmp-dir}}/parallel-root/cli.edn' --graph cli-e2e-agent-bridge-parallel --tmp-dir '{{tmp-dir}}/parallel-work' --repo-root '{{repo-root}}' --parallel-assignment-check" + "python3 '{{repo-root}}/cli-e2e/scripts/agent_bridge_e2e.py' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/duplicate-root' --config '{{tmp-dir}}/duplicate-root/cli.edn' --graph cli-e2e-agent-bridge-duplicate --tmp-dir '{{tmp-dir}}/duplicate-work' --repo-root '{{repo-root}}' --duplicate-bridge-check" "python3 '{{repo-root}}/cli-e2e/scripts/agent_bridge_e2e.py' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/comment-root' --config '{{tmp-dir}}/comment-root/cli.edn' --graph cli-e2e-agent-bridge-comment --tmp-dir '{{tmp-dir}}/comment-work' --repo-root '{{repo-root}}' --comment-mention-check" "bash '{{repo-root}}/cli-e2e/scripts/agent_bridge_demo.sh' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/demo-root' --graph cli-e2e-agent-bridge-demo --repo-root '{{repo-root}}'"], :expect @@ -1292,31 +1294,13 @@ :covers {:commands ["agent bridge"], :options - {:global ["--config" "--graph" "--root-dir" "--output"], - :agent ["--dry-run"]}}, + {:global ["--config" "--graph" "--root-dir" "--output"]}}, :cleanup ["{{cli}} --root-dir '{{tmp-dir}}/assigned-root' --config '{{tmp-dir}}/assigned-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-assigned" "{{cli}} --root-dir '{{tmp-dir}}/parallel-root' --config '{{tmp-dir}}/parallel-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-parallel" + "{{cli}} --root-dir '{{tmp-dir}}/duplicate-root' --config '{{tmp-dir}}/duplicate-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-duplicate" "{{cli}} --root-dir '{{tmp-dir}}/comment-root' --config '{{tmp-dir}}/comment-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-comment"], :tags [:agent]} - {:id "agent-bridge-prompt-template-graphs", - :setup - ["mkdir -p '{{tmp-dir}}/prompt-template-root' && printf '{:output-format :json}\\n' > '{{tmp-dir}}/prompt-template-root/cli.edn' && {{cli}} --root-dir '{{tmp-dir}}/prompt-template-root' --config '{{tmp-dir}}/prompt-template-root/cli.edn' --output json graph create --graph cli-e2e-agent-bridge-template-a >/dev/null"], - :cmds - ["python3 '{{repo-root}}/cli-e2e/scripts/agent_bridge_e2e.py' --cli '{{repo-root}}/static/logseq-cli.js' --root-dir '{{tmp-dir}}/prompt-template-root' --config '{{tmp-dir}}/prompt-template-root/cli.edn' --graph cli-e2e-agent-bridge-template-a --tmp-dir '{{tmp-dir}}/prompt-template-work' --repo-root '{{repo-root}}' --prompt-template-graph-check"], - :expect - {:exit 0, - :stdout-contains ["agent bridge graph prompt templates are isolated and linted"]}, - :covers - {:commands ["agent bridge"], - :options - {:global ["--config" "--graph" "--root-dir" "--output"], - :agent ["--dry-run"]}}, - :cleanup - ["{{cli}} --root-dir '{{tmp-dir}}/prompt-template-root' --config '{{tmp-dir}}/prompt-template-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-template-a" - "{{cli}} --root-dir '{{tmp-dir}}/prompt-template-root' --config '{{tmp-dir}}/prompt-template-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-template-a-other" - "{{cli}} --root-dir '{{tmp-dir}}/prompt-template-root' --config '{{tmp-dir}}/prompt-template-root/cli.edn' --output json server stop --graph cli-e2e-agent-bridge-template-a-invalid"], - :tags [:agent]} {:id "skill-show-human", :cmds ["{{cli}} skill show"], :expect diff --git a/cli-e2e/spec/non_sync_inventory.edn b/cli-e2e/spec/non_sync_inventory.edn index df5d25f7c2f1..4f5c4d027966 100644 --- a/cli-e2e/spec/non_sync_inventory.edn +++ b/cli-e2e/spec/non_sync_inventory.edn @@ -156,7 +156,7 @@ :agent {:commands ["agent bridge"] - :options ["--dry-run"]} + :options []} :completion {:commands ["completion"] diff --git a/docs/agent-guide/logseq-cli/001-logseq-cli.md b/docs/agent-guide/logseq-cli/001-logseq-cli.md index 6ac002880e93..36c435d357df 100644 --- a/docs/agent-guide/logseq-cli/001-logseq-cli.md +++ b/docs/agent-guide/logseq-cli/001-logseq-cli.md @@ -123,7 +123,7 @@ The top-level help groups commands into graph inspection/editing, graph manageme ### Agent bridge -`agent bridge` is the first AgentBridge command surface. It resolves the target graph using normal CLI config precedence, resolves the AgentBridge name from `:agent-name` in `cli.edn` or the machine hostname, checks that `codex` is available, starts or reuses the graph's db-worker-node, registers the AgentBridge name in the graph, scans TODO `#Task` blocks assigned to that AgentBridge name, and listens to db-worker-node events for follow-up scans. Matched tasks are routed to `codex exec --json`; the bridge records the Codex session/thread id in `agent-bridge-sessions.edn` and writes it to the task's `agent-session-id` property. `--dry-run` performs the setup and scan but only prints the Codex commands it would run. +`agent bridge` is the first AgentBridge command surface. It resolves the target graph using normal CLI config precedence, resolves the AgentBridge name from `:agent-name` in `cli.edn` or the machine hostname, checks that `codex` is available, starts or reuses the graph's db-worker-node, registers the AgentBridge name in the graph, initializes the per-agent master prompt, scans TODO `#Task` blocks assigned to that AgentBridge name, and listens to db-worker-node events for follow-up scans. Matched task and comment requests are dispatched to the master Codex session. ## Global flags and output modes diff --git a/docs/agent-guide/logseq-cli/011-agent-bridge-master-agent.md b/docs/agent-guide/logseq-cli/011-agent-bridge-master-agent.md new file mode 100644 index 000000000000..01ae2b42b987 --- /dev/null +++ b/docs/agent-guide/logseq-cli/011-agent-bridge-master-agent.md @@ -0,0 +1,572 @@ +# AgentBridge Master Agent Implementation Plan + +Goal: Redesign `logseq agent bridge` so the CLI loop initializes a graph-scoped master agent prompt and delegates task scheduling policy to a master agent that can dispatch different subagent execution modes. + +Architecture: Keep `logseq agent bridge` as the graph supervisor that resolves config, starts or reuses db-worker-node, initializes graph state, watches graph events, and holds the active master session in process memory. +Architecture: Move task scheduling policy into a master agent prompt stored in a fenced code block under the first block of the current AgentBridge name page. +Architecture: The master prompt defines subagent routing for simple tasks, read-only project tasks, and writable project tasks, while the CLI enforces graph targeting, prompt initialization, bridge locking, and graph-visible routing metadata. + +Tech Stack: ClojureScript, Node `child_process` and `fs` APIs, existing Logseq CLI command parsing, db-worker-node transport, Codex CLI JSON events, Datascript queries, CLI unit tests, CLI E2E tests, and @test-driven-development. + +Related: Builds on `/Users/rcmerci/gh-repos/logseq/docs/agent-guide/logseq-cli/001-logseq-cli.md`. + +## Problem statement + +The current AgentBridge implementation starts from `logseq agent bridge` and directly routes eligible TODO `#Task` blocks assigned to the current AgentBridge name. + +The current bridge stores task and comment prompt templates on the shared `AgentBridge` page. + +The current bridge then starts a Codex session for each routable task or comment request. + +This design works for direct task routing, but it does not give the bridge a single master agent that owns scheduling decisions across different task types. + +The requested architecture changes the model so each agent has a page named by the AgentBridge name, normally the hostname. + +The first block on that page is a master prompt wrapper, and its child contains the master agent prompt in a fenced markdown code block. + +`logseq agent bridge` must initialize that prompt when missing. + +The master prompt must describe how to classify work and how to execute subagents. + +Simple tasks with no project context, such as translation, rewrite, or simple search, should run in a clean temporary directory. + +Read-only project tasks, such as code review or implementation lookup, should run in the project directory without write access expectations. + +Read/write project tasks, such as bug fixes or feature implementation, should default to `origin/master`, create a new branch in the project directory, and run with only one writable project subagent active at a time. + +The CLI should remain responsible for the bridge loop and graph safety. + +The master agent should remain responsible for task assignment and subagent strategy. + +Only the master agent should write to graph content through Logseq CLI commands. + +Subagents should treat graph content as read-only and return graph write requests or final report content to the master agent. + +## Current implementation snapshot + +All paths in this document are under `/Users/rcmerci/gh-repos/logseq`. + +The primary CLI implementation is `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/command/agent.cljs`. + +The command table integration is `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/command/agent.cljs` and `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/commands.cljs`. + +The human and structured output formatting is `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/format.cljs`. + +The current unit tests are `/Users/rcmerci/gh-repos/logseq/src/test/logseq/cli/command/agent_test.cljs`. + +The current CLI E2E script is `/Users/rcmerci/gh-repos/logseq/cli-e2e/scripts/agent_bridge_e2e.py`. + +The current CLI E2E manifest is `/Users/rcmerci/gh-repos/logseq/cli-e2e/spec/non_sync_cases.edn`. + +The current implementation already resolves an agent name through `resolve-agent-name`. + +The current implementation already creates or keeps an agent-name page through `register-agent-bridge!`. + +The current implementation initializes task and comment prompt templates through `ensure-agent-bridge-prompt-templates!` on the shared `AgentBridge` page. + +The current implementation routes initial tasks through `process-tasks!` and event-driven tasks through `listen-forever!`. + +The current implementation prevents duplicate routing for the same block through `routing-blocks*`. + +The current implementation bounds initial task routing concurrency with `max-concurrent-routes`. + +The current implementation also prevents duplicate bridge supervisors for the same CLI root dir, target graph, and AgentBridge name with a filesystem lock. + +The current implementation writes bridge-owned started markers after master dispatch accepts work: tasks get an `eyes` reaction plus `status=doing` when the routed task is still `TODO`, and comment requests get an `eyes` reaction. + +The current implementation marks accepted task dispatches with an `eyes` reaction; the master prompt and task dispatch prompt require the master agent to remove that reaction when a subagent finishes, whether the subagent succeeded or failed. + +The new design should reuse the stable graph setup and event plumbing, then replace direct per-task Codex scheduling with a master-agent-centered dispatch path. + +## Desired behavior + +`logseq agent bridge --graph ` resolves the target graph exactly as it does today. + +The command resolves the AgentBridge name from `:agent-name` in `cli.edn` or from the hostname exactly as it does today. + +The command starts or reuses the db-worker-node server for the target graph before it touches graph data. + +The command ensures the agent-name page exists. + +The command ensures the first live child block of the agent-name page is a master prompt wrapper block. + +The master prompt wrapper block contains the prompt markdown in one child fenced code block. + +If the agent-name page has no live child block, the command inserts the default master prompt wrapper as the first child block. + +If the agent-name page has a first live child block whose title is `AgentBridge master prompt` and whose direct live children contain exactly one fenced prompt code block, the command treats that code fence as the configured master prompt and does not overwrite it. + +If the first live child block is invalid according to the master prompt lint rules, the command fails fast with an `:agent-master-prompt-invalid` error. + +The default master prompt includes the existing graph safety instructions from the current task prompt. + +The default master prompt includes explicit instructions that only the master agent may write task results back into the target graph. + +The default master prompt includes explicit instructions that subagents may read graph context but must not write graph content. + +The default master prompt includes explicit instructions to sync the graph after writing when sync is enabled. + +The default master prompt includes the task classification table for simple, read-only project, and read/write project tasks. + +The default master prompt says that writable project subagents must be serialized by the master agent. + +The default master prompt says that writable project subagents must start from `origin/master` and create a new branch before modifying the project. + +The CLI supervisor starts one master Codex session per running bridge process and keeps that master session id in memory for dispatch. + +Concurrent `codex resume ` dispatches to the same master session are supported, but they must target that single master session for the target graph and AgentBridge name. + +Starting a second `logseq agent bridge` process for the same CLI root dir, target graph, and AgentBridge name fails fast with `:agent-bridge-already-running`. + +If a bridge lock directory exists but `owner.edn` is missing or corrupt, the bridge treats that lock as stale, removes it, and retries acquisition. + +The bridge loop sends new routable task and comment context to the master agent instead of directly starting independent task or comment Codex sessions. + +Task and comment routing require an active in-process `master-session`; missing master-session state is an internal fail-fast error instead of a fallback to direct Codex routing. + +Task dispatch to the master agent marks the routed task as started after the master resume is accepted and before the routing claim is released. + +The started marker is bridge-owned progress metadata: add an `eyes` reaction for accepted task and comment dispatches, and set task `status=doing` only when the current task status is `TODO`. + +When a task or subagent finishes, remove the task block's `eyes` reaction whether the task succeeded or failed. + +The master agent decides whether to dispatch a simple, read-only project, or writable project subagent. + +The master agent owns subagent prompts and assignment policy. + +The master agent owns all Logseq CLI graph write operations. + +The exception is bridge-owned routing/progress metadata that the CLI must write synchronously to avoid duplicate dispatch. + +Subagents may receive rendered graph context and may perform read-only graph inspection when explicitly instructed, but they must not mutate graph content. + +The CLI should not silently recover from malformed master prompt state. + +The CLI should not add a new db-worker `:thread-api` unless the existing query, pull, and outliner operation APIs cannot express the required graph mutations. + +## Proposed architecture + +```text +logseq agent bridge + | + v +resolve graph and agent name + | + v +ensure db-worker-node and agent page + | + v +ensure first block contains master prompt code fence + | + v +start master Codex session + | + v +listen to graph events and initial TODO scan + | + v +send task dispatch request to master agent + | + v +master agent chooses subagent mode + | + +--> simple task in clean tmp dir + | + +--> read-only project task in project dir + | + +--> writable project task on branch from origin/master +``` + +The CLI is still the only component that watches db-worker-node events. + +The CLI is still the only component that decides whether a graph block is assigned to the current AgentBridge name. + +The CLI is still the only component that writes bridge session metadata before a Codex process has fully started. + +The master agent prompt is graph data, so operators can inspect and edit scheduling policy from Logseq. + +The master prompt is per agent-name page, so two machines can have different scheduling policy in the same graph. + +The master agent dispatch request should include the target graph, bridge name, source block UUID, rendered block tree, request kind, project directory when available, and a reminder not to operate outside the target graph. + +The master dispatch request should not include unrelated graph data. + +The master dispatch request should be rendered from a deterministic built-in template to avoid depending on mutable task prompt templates. + +The existing shared `AgentBridge` task and comment prompt template page should be left in place unless implementation proves it is obsolete. + +This avoids a broad compatibility removal in the same change. + +## Master prompt content + +The default master prompt should be a markdown document with sections for role, graph safety, graph write ownership, task intake, classification, subagent execution, writable project lock, result reporting, and failure handling. + +The default prompt should include this classification table. + +| Task type | Examples | Working directory | Write behavior | Concurrency | +| --- | --- | --- | --- | --- | +| Simple | Translation, rewrite, small lookup, simple search | Fresh temporary directory | No project writes | Can run concurrently | +| Read-only project | Code review, code explanation, implementation lookup | Project directory | No writes | Can run concurrently | +| Read/write project | Bug fix, feature implementation, test update | Project directory on new branch from `origin/master` | Writes allowed after branch setup | Only one at a time | + +The prompt should instruct the master agent to fail fast when task type is ambiguous and the consequence of choosing writable mode is material. + +The prompt should instruct the master agent to serialize writable subagents with its own policy state. + +The prompt should instruct the master agent to make the lock visible in graph reporting when a writable task waits. + +The prompt should instruct the master agent to keep graph reports short unless a blocker occurs. + +The prompt should instruct the master agent to report root cause and steps to verify only for bug fixes. + +The prompt should instruct the master agent that only it can use Logseq CLI commands to write graph content. + +The prompt should instruct subagents that graph content is read-only for them. + +The prompt should instruct subagents to return graph updates to the master agent instead of writing them directly. + +The prompt should instruct the master agent to launch task subagents with `codex exec`, capture the reported Codex session id, and write that subagent session id to the routed task block's `:logseq.property.agent/session-id` property. + +The prompt should instruct the master agent to continue child task blocks and comment requests under a task with `:logseq.property.agent/session-id` in that same subagent session. + +When a routed child task has a nearest parent or ancestor task with `:logseq.property.agent/session-id`, the master task dispatch prompt should include the inherited parent task UUID, inherited subagent session id, and an explicit instruction to continue in that inherited subagent session instead of launching a new subagent. + +The prompt should instruct the master agent to remove the task block's `eyes` reaction when the task or subagent finishes, regardless of success or failure. + +Master task dispatch prompts should carry the task result, graph sync, short report, blocker, and bugfix reporting contract from the default task prompt. + +Master comment dispatch prompts should carry the comment completion contract and the reply-placement instructions from the default comment prompt. + +## Data model + +Do not introduce new built-in properties unless the implementation cannot satisfy session tracking with existing graph-visible properties. + +The master agent must use the existing `:logseq.property.agent/session-id` for routed task blocks when it launches a concrete task subagent session. + +The value stored in `:logseq.property.agent/session-id` is the subagent Codex session id, not the graph supervisor session and not the master session id. + +The master agent writes this property after `codex exec` reports the subagent session id, before it treats the task dispatch as complete. + +Child task blocks and comment requests that belong to a task with `:logseq.property.agent/session-id` should be routed through the same subagent session. + +Do not write local session registry files for AgentBridge. In particular, do not create or update `agent-bridge-sessions.edn`. + +Avoid writing opaque process state into arbitrary graph blocks unless the state must be visible to the master agent. + +If graph-visible master state is required, store it under the agent-name page as normal blocks instead of creating hidden properties. + +Bridge-owned started state is graph-visible by design: the CLI adds the `eyes` reaction after a successful master dispatch, and advances `TODO` tasks to `DOING` so restart or rescan cannot route the same TODO again. The `eyes` reaction is progress state, not final state, and must be removed when the task or subagent finishes. + +The master agent, not the CLI supervisor, writes `:logseq.property.agent/session-id` after it launches a concrete subagent with `codex exec`. + +## Testing Plan + +I will add unit tests for master prompt initialization in `/Users/rcmerci/gh-repos/logseq/src/test/logseq/cli/command/agent_test.cljs`. + +The tests will verify that an empty agent-name page gets a first child wrapper block containing the default master prompt code fence. + +The tests will verify that an existing first child wrapper block with a valid prompt code fence is preserved and used as the master prompt. + +The tests will verify that a malformed first child block fails with `:agent-master-prompt-invalid`. + +The tests will verify that recycled agent-name pages and recycled first child blocks are ignored. + +I will add unit tests for default master prompt content in `/Users/rcmerci/gh-repos/logseq/src/test/logseq/cli/command/agent_test.cljs`. + +The tests will assert that the prompt includes graph safety instructions and the three task classification strategies. + +The tests will assert that the prompt includes the writable serialization rule and the `origin/master` branch rule. + +The tests will assert that the prompt says only the master agent can write graph content through Logseq CLI. + +The tests will assert that the prompt says subagents treat graph content as read-only. + +I will add unit tests for master dispatch prompt rendering in `/Users/rcmerci/gh-repos/logseq/src/test/logseq/cli/command/agent_test.cljs`. + +The tests will render a task dispatch request with graph name, agent name, block UUID, and task block tree. + +The tests will render a comment dispatch request with graph name, agent name, comment UUID, target context, comment thread context, and requesting comment tree. + +The tests will assert that unrelated graph data is not present in the dispatch prompt. + +I will add unit tests for bridge execution order in `/Users/rcmerci/gh-repos/logseq/src/test/logseq/cli/command/agent_test.cljs`. + +The tests will verify that `execute-bridge` ensures the server, initializes the master prompt, registers the bridge, starts the in-process master session, connects the listener, and then processes the initial scan. + +The tests will verify that a task event is sent to the master session rather than directly starting a task Codex session. + +The tests will verify that a comment mention event is sent to the master session rather than directly starting a comment Codex session. + +I will add unit tests for writable serialization policy in the default prompt. + +The tests will assert that the default prompt tells the master agent to run only one writable project subagent at a time. + +I will add CLI E2E coverage in `/Users/rcmerci/gh-repos/logseq/cli-e2e/scripts/agent_bridge_e2e.py`. + +The E2E test will create a graph, start `logseq agent bridge`, and verify that the agent-name page contains the default master prompt code fence under its first block. + +The E2E test will install a custom first-block prompt code fence on the agent-name page and verify that the bridge starts the master session with the custom master prompt. + +The E2E test will route a TODO `#Task` block assigned to the AgentBridge name and verify that Codex receives a master dispatch request containing the task tree. + +The E2E test will route an AgentBridge mention in a `Comment` block and verify that Codex receives a master dispatch request containing the comment context. + +The E2E test will cover master prompt initialization and dispatch instead of the removed dry-run prompt preview path. + +I will run the focused unit test command first. + +```bash +bb dev:test -v logseq.cli.command.agent-test/test-agent-bridge-initializes-default-master-prompt +``` + +I will then run the complete agent command unit test namespace. + +```bash +bb dev:test -v logseq.cli.command.agent-test +``` + +I will run the repository lint and unit test command before the E2E suites. + +```bash +bb dev:lint-and-test +``` + +I will then run the non-sync CLI E2E suite, which performs the required build preflight. + +```bash +bb dev:cli-e2e +``` + +I will then run the CLI sync E2E suite against the fresh build artifacts. + +```bash +bb dev:cli-e2e-sync --skip-build +``` + +NOTE: I will write *all* tests before I add any implementation behavior. + +## Implementation tasks + +1. Read `/Users/rcmerci/gh-repos/logseq/AGENTS.md`. + +2. Read `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/AGENTS.md`. + +3. Load @logseq-cli before editing CLI code. + +4. Load @test-driven-development before writing implementation behavior. + +5. Add a failing unit test for creating the default master prompt on an empty agent-name page. + +6. Add a failing unit test for preserving an existing first child block as the master prompt. + +7. Add a failing unit test for rejecting an invalid first child block. + +8. Add a failing unit test for ignoring recycled agent-name pages and recycled child blocks. + +9. Add a failing unit test that asserts the default master prompt contains all three task modes. + +10. Add a failing unit test that asserts the default master prompt contains the `origin/master` writable branch rule. + +11. Add a failing unit test that asserts the default master prompt contains the one-writable-subagent concurrency rule. + +12. Add a failing unit test for rendering a master dispatch request from a routable task. + +13. Run the focused unit tests and confirm they fail for the expected missing behavior. + +14. In `/Users/rcmerci/gh-repos/logseq/src/main/logseq/cli/command/agent.cljs`, add a `default-master-agent-prompt` value. + +15. Keep the prompt text in one namespace-local constant so tests can verify it without filesystem access. + +16. Add a `master-agent-prompt-title` for the first child wrapper block on the agent-name page. + +17. Store the prompt markdown in one child fenced code block under the wrapper block. + +18. Add a query that pulls live children of the agent-name page with `:db/id`, `:block/uuid`, `:block/title`, `:block/order`, and recycle metadata. + +19. Add a helper that returns the first live child block sorted by `:block/order`. + +20. Add a helper that validates the master prompt wrapper title and direct child fenced prompt code. + +21. Keep validation strict and fail-fast. + +22. Require the default graph safety phrases to be present only for the default prompt test, not for every custom prompt. + +23. Require custom master prompts to be non-blank markdown. + +24. Require custom master prompts to include a small set of renderable variables only if dispatch rendering needs variable substitution. + +25. Add `ensure-master-agent-prompt!` that creates the agent-name page when necessary and inserts the default prompt as the first child when no first live child exists. + +26. Reuse the existing `ensure-registry-page!` pattern where it is useful, but do not force master prompt state onto the shared `AgentBridge` page. + +27. Refactor `register-agent-bridge!` so agent page creation can return the live agent page entity. + +28. Keep existing registration behavior for tests that expect the agent-name page to be created. + +29. Update `execute-bridge` to call `ensure-master-agent-prompt!` during initialization. + +30. Remove the obsolete dry-run preview path so `agent bridge` has one execution contract. + +31. Add a `build-master-dispatch-prompt` helper that wraps task context for the master agent. + +32. Add tests for `build-master-dispatch-prompt`. + +33. Change task routing so routable task context is sent to the master session. + +34. Change comment mention routing so comment context is sent to the master session. + +35. Make task and comment routing fail fast when `:master-session` is missing, and remove obsolete direct routing execution paths. + +36. Add master prompt tests for master-only graph writes and subagent read-only graph access. + +37. Keep existing `routable-task?`, `list-routable-tasks`, event routing, and duplicate routing claims. + +38. Keep the active master session id in memory and pass it through task and comment dispatch options. + +39. Add tests that AgentBridge does not create `agent-bridge-sessions.edn`. + +40. Remove obsolete local session-store tests and helpers. + +41. Do not add CLI process locks for writable subagent serialization in the first pass; writable serialization remains a master policy rule. + +42. Assert in tests that the default prompt says writable serialization is a master agent policy responsibility. + +43. Run focused unit tests and make the smallest implementation pass. + +44. Add the E2E test for default master prompt initialization. + +45. Add the E2E test for custom first-block master prompt preservation. + +46. Add the E2E test for master dispatch prompt routing. + +47. Add the duplicate bridge process lock so only one bridge supervisor can run for a CLI root dir, target graph, and AgentBridge name. + +48. Add E2E coverage that a duplicate bridge process fails with `:agent-bridge-already-running`. + +49. Add tests that master task dispatch writes bridge-owned started metadata without writing the subagent session id. + +50. Add tests that master task and comment dispatch prompts include the simplified default task/comment contract. + +51. Run the E2E tests and fix only behavior covered by the failing tests. + +52. Update `/Users/rcmerci/gh-repos/logseq/docs/agent-guide/logseq-cli/001-logseq-cli.md` if the public current-state guide needs to mention the new master-agent architecture. + +53. Run @logseq-review-workflow on the finished change before PR handoff. + +54. Commit with a concise imperative subject such as `enhance(cli): redesign agent bridge master`. + +## Edge cases + +An agent-name page may already exist and may be recycled. + +The first child block may be recycled while a later child block is live. + +The agent-name page may contain an unrelated first live child block. + +The implementation should preserve that block and treat invalid prompt content as an explicit operator error. + +Two `logseq agent bridge` processes may start for the same graph and agent name. + +The implementation should not corrupt the first-block prompt when both processes initialize concurrently. + +A bridge lock directory may outlive its `owner.edn` file, or the owner file may contain corrupt EDN. + +The implementation should treat missing or unreadable lock owner data as stale so the next bridge process can recover. + +Task events may arrive before the initial scan completes. + +The existing `routing-blocks*` claim behavior should continue to prevent duplicate task dispatch. + +The master Codex process may exit before reporting a session id. + +The implementation should not write session metadata or task session ids before a session id exists. + +The target graph may be sync-enabled. + +The bridge prompt must continue to instruct the acting agent to sync after graph writes. + +The project directory may not be a git repository. + +Writable subagent instructions should fail fast in that case instead of creating an untracked fallback workflow. + +The project directory may have a dirty worktree. + +Writable subagent instructions should stash uncommitted changes before switching to a new branch from `origin/master`. + +The prompt should tell writable subagents to report a blocker if stashing fails. + +`origin/master` may not exist. + +Writable subagent instructions should fail fast instead of silently using another branch. + +A writable task branch name may collide with an existing branch. + +The master prompt should instruct subagents to create unique branch names derived from the task id. + +A task may be ambiguous between read-only and read/write. + +The master prompt should instruct the master agent to choose read-only unless the task explicitly requires writes, or to ask for clarification when ambiguity blocks progress. + +## Compatibility and migration + +This plan does not remove the existing shared `AgentBridge` page prompt-template mechanism in the first implementation pass. + +Keeping the old prompt-template path avoids mixing architecture redesign with template removal. + +The new master prompt lives on the agent-name page and is independent from graph-level task and comment prompt templates. + +If a later implementation removes shared task and comment templates, that removal should be a separate plan and PR. + +Existing task assignment semantics should remain the same. + +Existing comment mention requests should route through the master agent in the first pass. + +Existing `agent bridge list` behavior should remain compatible. + +New session fields should be additive. + +## Testing Details + +The unit tests will exercise real behavior in the agent command namespace by stubbing `transport/invoke`, Codex startup, and server startup only at process boundaries. + +The unit tests will assert graph operations, generated prompts, routing calls, and session records rather than internal helper call counts alone. + +The CLI E2E tests will execute the built CLI against disposable graphs and inspect graph state through CLI commands. + +The E2E tests will verify that prompt initialization and task dispatch work through the same command surface that users run. + +## Implementation Details + +- Keep graph targeting and db-worker-node startup in the CLI supervisor. +- Store the master prompt under the first live child wrapper block on the agent-name page as one fenced code block. +- Keep the shared `AgentBridge` page prompt-template mechanism in place for this pass. +- Add strict master prompt validation with clear errors. +- Send task and comment dispatch requests to the master agent instead of directly scheduling independent task or comment agents. +- Fail fast if task or comment routing is invoked without an active `master-session`. +- Keep Logseq CLI graph writes master-only. +- Allow the CLI supervisor to write bridge-owned routing/progress metadata required for duplicate prevention. +- Keep graph content read-only for subagents. +- Keep existing duplicate routing claims for task events. +- Prevent duplicate bridge supervisor processes for the same CLI root dir, target graph, and AgentBridge name. +- Do not record AgentBridge sessions in a local EDN registry. +- Do not add a new db-worker `:thread-api` unless existing transport calls cannot express the needed graph operations. +- Treat writable project branch setup and stash failures as blockers, not recoverable defaults. +- Run focused tests first, then E2E, then full lint and unit tests. + +## Question + +Resolved: Use a titled wrapper block as the first block on the agent-name page, with the prompt in a child fenced code block. + +Clarification: Comment mention routing is the path used when a user mentions an AgentBridge name inside a `Comment` block, like a review follow-up on an existing task. + +Resolved: Comment mention routing should go through the master agent in the first pass. + +Resolved: Follow-up requests from `Comment` blocks should use the same master scheduling session as assigned tasks. + +Resolved: Writable subagent serialization should be enforced by master prompt policy only in the first pass. + +Resolved: Each running bridge process for a target graph and AgentBridge name should have exactly one active master Codex session. Concurrent `codex resume ` calls to that same master session are supported, and the duplicate bridge lock prevents two supervisors from creating competing active master sessions for the same CLI root dir, target graph, and AgentBridge name. + +Resolved: Writable project tasks should use a branch in the current project directory, and writable subagents should stash uncommitted changes before switching branches. + +--- diff --git a/src/main/logseq/cli/command/agent.cljs b/src/main/logseq/cli/command/agent.cljs index 16cdb0ece4a8..51c1b59f371e 100644 --- a/src/main/logseq/cli/command/agent.cljs +++ b/src/main/logseq/cli/command/agent.cljs @@ -16,17 +16,12 @@ [logseq.db :as ldb] [promesa.core :as p])) -(def ^:private bridge-spec - {:dry-run {:desc "Print Codex commands without starting Codex or writing agent-session-id" - :coerce :boolean}}) - (def entries [(core/command-entry ["agent" "bridge"] :agent-bridge "Run task agent bridge" - bridge-spec - {:examples ["logseq agent bridge --graph my-graph" - "logseq agent bridge --graph my-graph --dry-run"]})]) + {} + {:examples ["logseq agent bridge --graph my-graph"]})]) (defn- trim-non-empty [value] @@ -52,7 +47,7 @@ "agent-name cannot be resolved from cli.edn or hostname")}})))) (defn build-action - [command options repo graph] + [command _options repo graph] (case command :agent-bridge (if-not (seq repo) @@ -62,8 +57,7 @@ {:ok? true :action {:type :agent-bridge :repo repo - :graph graph - :dry-run? (boolean (:dry-run options))}}) + :graph graph}}) {:ok? false :error {:code :unknown-command @@ -75,6 +69,13 @@ [tag] (= :logseq.class/Task (:db/ident tag))) +(defn- code-block-tag? + [tag] + (= :logseq.class/Code-block + (if (keyword? tag) + tag + (:db/ident tag)))) + (defn- assignee-values [block] (->> (:logseq.property/assignee block) @@ -121,55 +122,73 @@ (def comment-prompt-template-title "Comment prompt template") +(def ^:private graph-scope-line + "Do not operate outside the target graph.") + +(def ^:private task-result-line + "Write task results back into the graph.") + +(def ^:private task-finish-reaction-line + "When the task or subagent finishes, remove the `eyes` reaction from the task block whether it succeeded or failed.") + +(def ^:private comment-completion-line + "Complete the request from the mentioned comment.") + +(def ^:private graph-report-lines + ["If the target graph is sync-enabled, make sure it is synced after writing back to the graph." + "Keep the report short when possible." + "Report blockers only if there is a blocker." + "Report root cause and Steps to verify only for bug fixes."]) + +(def ^:private comment-reply-instruction-lines + ["Reply instructions:" + "For a short reply, append a comment after the requesting comment." + "For a long reply, write a normal block tree after the comments area and append a comment that references that tree." + "When referencing result blocks in DB graphs, reference result blocks with [[block-uuid]], not ((block-uuid))." + "If the request is blocked or fails, make that clear in the reply."]) + (def ^:private default-task-prompt-template (string/join "\n" - ["You are handling a Logseq AgentBridge task." - "" - "Graph: {{graph}}" - "Block UUID: {{block-uuid}}" - "AgentBridge name: {{agent-name}}" - "" - "Do not operate outside the target graph." - "Write task results back into the graph." - "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." - "Keep the report short when possible." - "Report blockers only if there is a blocker." - "Report root cause and Steps to verify only for bug fixes." - "" - "Task block tree:" - "{{task-block-tree}}"])) + (concat + ["You are handling a Logseq AgentBridge task." + "" + "Graph: {{graph}}" + "Block UUID: {{block-uuid}}" + "AgentBridge name: {{agent-name}}" + "" + graph-scope-line + task-result-line] + [task-finish-reaction-line] + graph-report-lines + ["" + "Task block tree:" + "{{task-block-tree}}"]))) (def ^:private default-comment-prompt-template (string/join "\n" - ["You are handling a Logseq AgentBridge comment request." - "" - "Graph: {{graph}}" - "Comment UUID: {{comment-uuid}}" - "AgentBridge name: {{agent-name}}" - "" - "Do not operate outside the target graph." - "Complete the request from the mentioned comment." - "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." - "Keep the report short when possible." - "Report blockers only if there is a blocker." - "Report root cause and Steps to verify only for bug fixes." - "" - "Comment target context:" - "{{comment-target-context}}" - "" - "Comment thread context:" - "{{comment-thread-context}}" - "" - "Requesting comment:" - "{{requesting-comment}}" - "" - "Reply instructions:" - "For a short reply, append a comment after the requesting comment." - "For a long reply, write a normal block tree after the comments area and append a comment that references that tree." - "When referencing result blocks in DB graphs, reference result blocks with [[block-uuid]], not ((block-uuid))." - "If the request is blocked or fails, make that clear in the reply."])) + (concat + ["You are handling a Logseq AgentBridge comment request." + "" + "Graph: {{graph}}" + "Comment UUID: {{comment-uuid}}" + "AgentBridge name: {{agent-name}}" + "" + graph-scope-line + comment-completion-line] + graph-report-lines + ["" + "Comment target context:" + "{{comment-target-context}}" + "" + "Comment thread context:" + "{{comment-thread-context}}" + "" + "Requesting comment:" + "{{requesting-comment}}" + ""] + comment-reply-instruction-lines))) (def ^:private prompt-template-vars {:task #{"graph" @@ -261,7 +280,7 @@ "agent-name" agent-name "task-block-tree" (or tree-text (:block/title block) "")})) -(defn- build-comment-codex-prompt +(defn build-comment-codex-prompt [{:keys [graph agent-name comment-tree-text comments-area-tree-text target-tree-texts] comment-block :comment prompt-template :prompt-template}] @@ -275,6 +294,89 @@ "comment-thread-context" (or comments-area-tree-text (:block/title (:block/parent comment-block)) "") "requesting-comment" (or comment-tree-text (:block/title comment-block) "")})) +(defn- project-dir-line + [project-dir] + (when-let [project-dir (trim-non-empty project-dir)] + (str "Project directory: " project-dir))) + +(defn- master-dispatch-header-lines + [{:keys [request-kind graph agent-name project-dir]}] + (cond-> ["You are handling a Logseq AgentBridge master dispatch request." + "" + (str "Request kind: " (name request-kind)) + (str "Graph: " graph) + (str "AgentBridge name: " agent-name)] + (project-dir-line project-dir) (conj (project-dir-line project-dir)) + true (into ["" + graph-scope-line + "Only the master agent may write task results back into the target graph." + "Subagents may read graph context but must not write graph content." + "Route this request according to the master prompt policy."]) + (= :task request-kind) (conj "After launching the subagent with `codex exec`, write that subagent session id to the task block's `:logseq.property.agent/session-id` property."))) + +(def ^:private master-task-dispatch-contract-lines + (into [task-result-line + task-finish-reaction-line] + graph-report-lines)) + +(def ^:private master-comment-dispatch-contract-lines + (into [comment-completion-line] + (concat + graph-report-lines + [""] + comment-reply-instruction-lines))) + +(defn- inherited-task-session-lines + [{:keys [parent-block-uuid session-id]}] + (when (and parent-block-uuid (seq session-id)) + ["" + (str "Inherited parent task UUID: " parent-block-uuid) + (str "Inherited subagent session id: " session-id) + "Continue this child task in the inherited subagent session instead of launching a new subagent."])) + +(defn- build-master-task-dispatch-prompt + [{:keys [graph agent-name project-dir block tree-text inherited-session]}] + (string/join + "\n" + (concat + (master-dispatch-header-lines {:request-kind :task + :graph graph + :agent-name agent-name + :project-dir project-dir}) + [""] + master-task-dispatch-contract-lines + ["" + (str "Block UUID: " (block-uuid-str block)) + ""] + (inherited-task-session-lines inherited-session) + ["" + "Task block tree:" + (or tree-text (:block/title block) "")]))) + +(defn- build-master-comment-dispatch-prompt + [{:keys [graph agent-name project-dir comment-tree-text comments-area-tree-text target-tree-texts] + comment-block :comment}] + (string/join + "\n" + (concat + (master-dispatch-header-lines {:request-kind :comment + :graph graph + :agent-name agent-name + :project-dir project-dir}) + [""] + master-comment-dispatch-contract-lines + ["" + (str "Comment UUID: " (block-uuid-str comment-block)) + "" + "Comment target context:" + (string/join "\n" (remove string/blank? target-tree-texts)) + "" + "Comment thread context:" + (or comments-area-tree-text (:block/title (:block/parent comment-block)) "") + "" + "Requesting comment:" + (or comment-tree-text (:block/title comment-block) "")]))) + (defn- codex-exec-prefix [codex-bin] [(or (trim-non-empty codex-bin) "codex") @@ -391,56 +493,6 @@ (reset! child-closed? true) (finalize!))))))) -(defn session-store-path - [{:keys [root-dir]}] - (node-path/join root-dir "agent-bridge-sessions.edn")) - -(defn- read-session-store - [config] - (let [path (session-store-path config)] - (if (fs/existsSync path) - (reader/read-string (fs/readFileSync path "utf8")) - {:sessions []}))) - -(defn- write-session-store! - [config store] - (let [path (session-store-path config) - dir (node-path/dirname path)] - (fs/mkdirSync dir #js {:recursive true}) - (fs/writeFileSync path (pr-str store) "utf8") - store)) - -(def ^:private terminal-session-statuses #{:completed :failed}) - -(defn- merge-session-record - [existing session] - (let [merged (merge existing session)] - (if (and (contains? terminal-session-statuses (:status existing)) - (= :running (:status session))) - (assoc merged :status (:status existing)) - merged))) - -(defn record-session! - [config session] - (let [store (read-session-store config) - sessions (vec (:sessions store)) - session-id (:session session) - sessions' (if (some #(= session-id (:session %)) sessions) - (mapv (fn [existing] - (if (= session-id (:session existing)) - (merge-session-record existing session) - existing)) - sessions) - (conj sessions session))] - (write-session-store! config (assoc store :sessions sessions')) - session)) - -(defn update-session-status! - [config session-id status] - (record-session! config {:session session-id - :status status - :updated-at (js/Date.now)})) - (defn- now-iso [] (.toISOString (js/Date.))) @@ -456,6 +508,92 @@ :error {:code code :message message}}) +(defn- bridge-lock-name + [graph agent-name] + (str (js/encodeURIComponent (str graph)) + "--" + (js/encodeURIComponent (str agent-name)) + ".lock")) + +(defn- bridge-lock-dir + [{:keys [root-dir]} graph agent-name] + (node-path/join root-dir "agent-bridge-locks" (bridge-lock-name graph agent-name))) + +(defn- bridge-lock-owner-path + [lock-dir] + (node-path/join lock-dir "owner.edn")) + +(defn- process-running? + [pid] + (try + (.kill js/process pid 0) + true + (catch :default e + (not= "ESRCH" (.-code e))))) + +(defn- stale-bridge-lock? + [lock-dir] + (try + (let [owner (reader/read-string + (fs/readFileSync (bridge-lock-owner-path lock-dir) "utf8")) + pid (:pid owner)] + (and (integer? pid) + (not (process-running? pid)))) + (catch :default _e + true))) + +(defn- bridge-lock-error + [graph agent-name] + {:ok? false + :error {:code :agent-bridge-already-running + :message (str "agent bridge is already running for graph '" + graph + "' and AgentBridge name '" + agent-name + "'")}}) + +(defn- acquire-bridge-lock! + ([config graph agent-name] + (acquire-bridge-lock! config graph agent-name false)) + ([config graph agent-name retried?] + (let [lock-dir (bridge-lock-dir config graph agent-name) + lock-parent (node-path/dirname lock-dir)] + (fs/mkdirSync lock-parent #js {:recursive true}) + (try + (fs/mkdirSync lock-dir) + (let [released? (atom false) + owner {:pid (.-pid js/process) + :graph graph + :agent agent-name + :started-at (now-iso)} + release! (fn [] + (when-not @released? + (reset! released? true) + (fs/rmSync lock-dir #js {:recursive true :force true})))] + (fs/writeFileSync (bridge-lock-owner-path lock-dir) (pr-str owner) "utf8") + (.once js/process "exit" (fn [& _] (release!))) + {:ok? true + :release! release!}) + (catch :default e + (if (and (= "EEXIST" (.-code e)) + (not retried?) + (stale-bridge-lock? lock-dir)) + (do + (fs/rmSync lock-dir #js {:recursive true :force true}) + (acquire-bridge-lock! config graph agent-name true)) + (bridge-lock-error graph agent-name))))))) + +(defn- with-bridge-lock! + [config graph agent-name f] + (let [lock-result (acquire-bridge-lock! config graph agent-name)] + (if-not (:ok? lock-result) + (bridge-error (get-in lock-result [:error :code]) + (get-in lock-result [:error :message])) + (-> (p/let [result (f)] + result) + (p/finally (fn [] + ((:release! lock-result)))))))) + (defn- log-bridge-exit! [{:keys [repo graph agent-name reason exit-code error]}] (log/info :agent-bridge-exit @@ -499,6 +637,85 @@ :where [?p :block/name ?agent-page-name]]) +(def master-prompt-wrapper-title "AgentBridge master prompt") + +(defn- default-master-prompt + [] + (string/join + "\n" + ["# AgentBridge Master Agent" + "" + "## Role" + "You are the graph-scoped master agent for Logseq AgentBridge." + "Classify incoming work and decide whether to dispatch a simple, read-only project, or read/write project subagent." + "" + "## Graph Safety" + "Do not operate outside the target graph." + "Only the master agent may write task results back into the target graph." + "Subagents may read graph context but must not write graph content." + "Subagents must return graph updates or final report content to the master agent instead of writing to the graph." + "When dispatching a subagent for a task, write the subagent Codex session id to the task block's `:logseq.property.agent/session-id` property." + "Child task blocks and comment requests under a task with `:logseq.property.agent/session-id` must continue in that same subagent session." + task-finish-reaction-line + "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." + "" + "## Task Classification" + "| Task type | Examples | Working directory | Write behavior | Concurrency |" + "| --- | --- | --- | --- | --- |" + "| Simple | Translation, rewrite, small lookup, simple search | Fresh temporary directory | No project writes | Can run concurrently |" + "| Read-only project | Code review, code explanation, implementation lookup | Project directory | No writes | Can run concurrently |" + "| Read/write project | Bug fix, feature implementation, test update | Project directory on new branch from `origin/master` | Writes allowed after branch setup | Only one at a time |" + "" + "Fail fast when task type is ambiguous and the consequence of choosing writable mode is material." + "" + "## Subagent Execution" + "Run simple tasks in a clean temporary directory." + "Run read-only project tasks in the project directory without write access expectations." + "Writable project subagents must start from `origin/master` and create a new branch before modifying the project." + "Serialize writable project subagents; keep only one writable project subagent active at a time." + "Make the writable lock visible in graph reporting when a writable task waits." + "" + "## Result Reporting" + "Keep graph reports short unless a blocker occurs." + "Report blockers only if there is a blocker." + "Report root cause and Steps to verify only for bug fixes." + "" + "## Failure Handling" + "Fail fast on malformed graph state or unclear dispatch requirements." + "Do not silently recover from programmer errors."])) + +(def agent-master-prompt-blocks-query + '[:find [(pull ?b [:db/id + :block/uuid + :block/title + :block/order + :logseq.property/deleted-at + {:block/parent [:db/id + :logseq.property/deleted-at + {:block/parent [:db/id + :logseq.property/deleted-at]}]} + {:block/_parent [:db/id + :block/uuid + :block/title + :block/order + :logseq.property/deleted-at + {:block/tags [:db/id + :db/ident + :block/name + :block/title]} + {:block/parent [:db/id + :logseq.property/deleted-at + {:block/parent [:db/id + :logseq.property/deleted-at]}]} + {:block/_parent [:db/id + :block/uuid + :block/title + :block/order + :logseq.property/deleted-at]}]}]) ...] + :in $ ?page-id + :where + [?b :block/parent ?page-id]]) + (declare ensure-registry-page!) (def agent-bridge-prompt-template-blocks-query @@ -617,6 +834,43 @@ (when (string? text) (map second (re-seq #"(?s)```[^\n`]*\n(.*?)```" text)))) +(defn- default-master-prompt-block + [] + {:block/title master-prompt-wrapper-title + :block/children [{:block/title (default-master-prompt) + :block/tags [:logseq.class/Code-block] + :logseq.property.node/display-type :code + :logseq.property.code/lang "markdown"}]}) + +(defn- first-live-child-block + [blocks] + (first (remove ldb/recycled? (sort-by #(or (:block/order %) "") blocks)))) + +(defn- master-prompt-from-block + [block] + (when-not (= master-prompt-wrapper-title (:block/title block)) + (throw (ex-info "agent bridge master prompt wrapper is invalid" + {:code :agent-master-prompt-invalid + :reason :invalid-master-prompt-wrapper}))) + (let [prompts (->> (child-blocks block) + (remove ldb/recycled?) + (filter #(some code-block-tag? (:block/tags %))) + (keep (comp trim-non-empty :block/title)) + vec)] + (cond + (empty? prompts) + (throw (ex-info "agent bridge master prompt code block is missing" + {:code :agent-master-prompt-invalid + :reason :missing-master-prompt-code-block})) + + (> (count prompts) 1) + (throw (ex-info "agent bridge master prompt must contain one code block" + {:code :agent-master-prompt-invalid + :reason :multiple-master-prompt-code-blocks})) + + :else + (first prompts)))) + (defn- prompt-template-from-block [template-kind block] (let [templates (vec (mapcat code-blocks-in-text (block-title-tree block))) @@ -750,6 +1004,13 @@ (registry-page-name)]])] (first-live-entity pages))) +(defn- pull-agent-page + [cfg repo agent-name] + (p/let [pages (transport/invoke cfg :thread-api/q + [repo [registered-agent-query + (agent-page-name agent-name)]])] + (first-live-entity pages))) + (defn- ensure-registry-page! [cfg repo] (p/let [existing (pull-registry-page cfg repo)] @@ -791,6 +1052,32 @@ (throw (ex-info "agent bridge agent page not found after create" {:code :agent-registration-failed}))))))))) +(defn ensure-agent-master-prompt! + [cfg repo agent-name] + (p/let [agent-page (pull-agent-page cfg repo agent-name) + page-id (:db/id agent-page) + page-uuid (:block/uuid agent-page) + _ (when-not page-id + (throw (ex-info "agent bridge agent page not found" + {:code :agent-master-prompt-initialization-failed}))) + _ (when-not page-uuid + (throw (ex-info "agent bridge agent page uuid not found" + {:code :agent-master-prompt-initialization-failed}))) + blocks (transport/invoke cfg :thread-api/q + [repo [agent-master-prompt-blocks-query page-id]])] + (if-let [first-block (first-live-child-block blocks)] + (master-prompt-from-block first-block) + (p/let [_ (transport/invoke cfg :thread-api/apply-outliner-ops + [repo [[:insert-blocks [(flatten-prompt-template-blocks + [(default-master-prompt-block)]) + page-uuid + {:outliner-op :insert-blocks + :sibling? false + :bottom? false + :keep-uuid? true}]]] + {}])] + (default-master-prompt))))) + (defn write-agent-session-id! [cfg repo block-uuid session-id] (p/let [_ (transport/invoke cfg :thread-api/apply-outliner-ops @@ -803,8 +1090,6 @@ (def ^:private task-start-reaction "eyes") (def ^:private comment-start-reaction "eyes") -(def ^:private comment-complete-reaction "white_check_mark") -(def ^:private comment-failed-reaction "x") (def ^:private reaction-query '[:find ?r . @@ -845,17 +1130,6 @@ {}]))] true))) -(defn- mark-agent-bridge-task-in-review! - [cfg repo block] - (let [block-uuid (:block/uuid block)] - (p/let [_ (transport/invoke cfg :thread-api/apply-outliner-ops - [repo [[:batch-set-property [[block-uuid] - :logseq.property/status - :logseq.property/status.in-review - {}]]] - {}])] - true))) - (def ^:private routable-task-query '[:find [(pull ?e [:db/id :block/uuid @@ -864,6 +1138,7 @@ {:logseq.property/status [:db/ident :block/title]} {:logseq.property/assignee [:db/id :block/title :block/name :db/ident]} :logseq.property.agent/session-id + {:block/parent [:db/id]} *]) ...] :in $ ?agent-name :where @@ -892,75 +1167,59 @@ (:block/title block))})) (filter #(routable-task? % agent-name) blocks))))) -(defn- dry-run-commands - [graph agent-name prompt-templates tasks] - (mapv (fn [{:keys [block tree-text]}] - (let [prompt (build-codex-prompt {:graph graph - :agent-name agent-name - :block block - :tree-text tree-text - :prompt-template (:task prompt-templates)}) - command (build-codex-command prompt {})] - {:block (block-uuid-str block) - :backend :codex - :command command - :preview (command-preview command)})) - tasks)) - (defn- emit-log! [config line] (if-let [f (:log-fn config)] (f line) (.write (.-stdout js/process) (str line "\n")))) -(defn- session-record - [graph agent-name block session-id status] - {:session session-id - :status status - :backend :codex - :graph graph - :block (block-uuid-str block) - :agent agent-name - :started-at (js/Date.now) - :updated-at (js/Date.now)}) - -(defn- route-task! - [cfg {:keys [repo graph agent-name prompt-templates]} {:keys [block tree-text]}] - (let [prompt (build-codex-prompt {:graph graph - :agent-name agent-name - :block block - :tree-text tree-text - :prompt-template (:task prompt-templates)}) - command (build-codex-command prompt {}) +(defn ensure-master-session! + [cfg {:keys [master-prompt]}] + (let [command (build-codex-command master-prompt {}) preview (command-preview command)] - (emit-log! cfg (log-line (str "Codex command prepared for " (block-uuid-str block) ": " preview))) - (p/let [{:keys [session]} (start-codex! command - {:on-exit (fn [code session-id] - (let [success? (zero? (or code 1))] - (when session-id - (update-session-status! cfg session-id - (if success? - :completed - :failed)) - (when success? - (-> (p/let [cfg* (cli-server/ensure-server! cfg repo) - _ (mark-agent-bridge-task-in-review! cfg* repo block)] - true) - (p/catch (fn [e] - (log/error :agent-bridge-task-in-review-failed e))))))))}) + (emit-log! cfg (log-line (str "Codex master command prepared: " preview))) + (p/let [{:keys [session] :as result} (start-codex! command {}) _ (when-not (seq session) - (throw (ex-info "codex session id missing" - {:code :codex-session-id-missing}))) - cfg* (cli-server/ensure-server! cfg repo) - _ (record-session! cfg* (session-record graph agent-name block session :running)) - _ (write-agent-session-id! cfg* repo (:block/uuid block) session) - _ (mark-agent-bridge-task-started! cfg* repo block)] - (emit-log! cfg (log-line (str "agent-session-id written for " (block-uuid-str block)))) - {:block (block-uuid-str block) + (throw (ex-info "codex master session id missing" + {:code :codex-session-id-missing})))] + result))) + +(defn- dispatch-to-master! + [cfg {:keys [master-session]} {:keys [prompt request block]}] + (let [command (build-codex-resume-command master-session prompt {}) + preview (command-preview command)] + (emit-log! cfg (log-line (str "Codex master dispatch prepared" + (when block (str " for " (block-uuid-str block))) + ": " preview))) + (p/let [{:keys [session]} (start-codex! command {}) + _ (when-not (seq session) + (throw (ex-info "codex master dispatch session id missing" + {:code :codex-session-id-missing})))] + {:block (some-> block block-uuid-str) :session session :backend :codex + :request request :preview preview}))) +(declare nearest-ancestor-task-session) + +(defn- dispatch-task-to-master! + [cfg {:keys [repo graph agent-name project-dir] :as opts} {:keys [block tree-text]}] + (p/let [inherited-session (nearest-ancestor-task-session cfg repo block) + result (dispatch-to-master! + cfg + opts + {:request :task + :block block + :prompt (build-master-task-dispatch-prompt {:graph graph + :agent-name agent-name + :project-dir project-dir + :block block + :tree-text tree-text + :inherited-session inherited-session})}) + _ (mark-agent-bridge-task-started! cfg repo block)] + result)) + (defn- claim-routing-block! [routing-blocks* block-id] (loop [] @@ -975,16 +1234,25 @@ :else (recur))))) +(defn- master-session-required-error + [request opts] + (when-not (seq (:master-session opts)) + (ex-info "AgentBridge routing requires an active master session" + {:code :agent-bridge-master-session-required + :request request}))) + (defn- route-task-once! [cfg {:keys [routing-blocks*] :as opts} {:keys [block] :as task}] - (let [block-id (block-uuid-str block)] - (if (and routing-blocks* block-id) - (if (claim-routing-block! routing-blocks* block-id) - (-> (route-task! cfg opts task) - (p/finally (fn [] - (swap! routing-blocks* disj block-id)))) - (p/resolved nil)) - (route-task! cfg opts task)))) + (if-let [e (master-session-required-error :task opts)] + (p/rejected e) + (let [block-id (block-uuid-str block)] + (if (and routing-blocks* block-id) + (if (claim-routing-block! routing-blocks* block-id) + (-> (dispatch-task-to-master! cfg opts task) + (p/finally (fn [] + (swap! routing-blocks* disj block-id)))) + (p/resolved nil)) + (dispatch-task-to-master! cfg opts task))))) (def ^:private max-concurrent-routes 4) @@ -998,13 +1266,15 @@ (partition-all limit coll))) (defn- process-tasks! - [cfg {:keys [repo graph agent-name prompt-templates routing-blocks*]}] + [cfg {:keys [repo graph agent-name prompt-templates routing-blocks* master-session project-dir]}] (p/let [tasks (list-routable-tasks cfg repo agent-name)] (p-map-batched max-concurrent-routes #(route-task-once! cfg {:repo repo :graph graph :agent-name agent-name :prompt-templates prompt-templates + :master-session master-session + :project-dir project-dir :routing-blocks* routing-blocks*} %) tasks))) @@ -1025,8 +1295,44 @@ {:logseq.property/status [:db/ident :block/title]} {:logseq.property/assignee [:db/id :block/title :block/name :db/ident]} :logseq.property.agent/session-id + {:block/parent [:db/id]} '*]) +(def ^:private task-ancestor-session-selector + [:db/id + :block/uuid + :block/title + {:block/tags [:db/ident :block/title]} + :logseq.property.agent/session-id + {:block/parent [:db/id]}]) + +(defn- block-db-id + [value] + (cond + (map? value) (:db/id value) + (number? value) value + :else nil)) + +(defn- parent-block-id + [block] + (block-db-id (:block/parent block))) + +(defn- nearest-ancestor-task-session + [cfg repo block] + (letfn [(step [parent-id] + (if-not parent-id + (p/resolved nil) + (p/let [parent (transport/invoke cfg :thread-api/pull + [repo task-ancestor-session-selector parent-id]) + session-id (trim-non-empty + (get parent agent-session-id-property-ident))] + (if (and session-id + (some task-tag? (:block/tags parent))) + {:parent-block-uuid (:block/uuid parent) + :session-id session-id} + (step (parent-block-id parent))))))] + (step (parent-block-id block)))) + (def ^:private comment-block-selector [:db/id :block/uuid @@ -1198,89 +1504,49 @@ [cfg repo target-uuid emoji-id] (ensure-reaction! cfg repo target-uuid emoji-id)) -(defn- comment-session-record - [graph agent-name comment-block session-id status] - (assoc (session-record graph agent-name comment-block session-id status) - :request :comment)) - -(defn- comment-target-session-id - [agent-name block] - (if (contains? (assignee-values block) agent-name) - (p/resolved (trim-non-empty (get block agent-session-id-property-ident))) - (p/resolved nil))) - -(defn- route-comment! - [cfg {:keys [repo graph agent-name prompt-templates]} comment-block] - (p/catch - (p/let [comment-uuid (:block/uuid comment-block) - _ (when-not comment-uuid - (throw (ex-info "comment block uuid is missing" - {:code :agent-comment-uuid-missing}))) - session-property-ident agent-session-id-property-ident - comments-area (pull-comments-area cfg repo comment-block session-property-ident) - _ (when-not (comments-area? comments-area) - (throw (ex-info "comment parent is not a comments area" - {:code :agent-comment-parent-invalid - :block (block-uuid-str comment-block)}))) - target-blocks (vec (:logseq.property.comments/blocks comments-area)) - _ (ensure-comment-reaction! cfg repo comment-uuid comment-start-reaction) - target-tree-texts (p/all (mapv #(show-block-tree cfg repo %) target-blocks)) - comments-area-tree-text (show-block-tree cfg repo comments-area) - comment-tree-text (show-block-tree cfg repo comment-block) - prompt (build-comment-codex-prompt {:graph graph - :agent-name agent-name - :comment comment-block - :target-tree-texts target-tree-texts - :comments-area-tree-text comments-area-tree-text - :comment-tree-text comment-tree-text - :prompt-template (:comment prompt-templates)}) - target-session-ids (p/all (mapv #(comment-target-session-id agent-name %) - target-blocks)) - resume-session-id (first (keep identity target-session-ids)) - command (if resume-session-id - (build-codex-resume-command resume-session-id prompt {}) - (build-codex-command prompt {})) - preview (command-preview command) - _ (emit-log! cfg (log-line (str "Codex command prepared for comment " (block-uuid-str comment-block) ": " preview))) - {:keys [session]} (start-codex! command - {:on-exit (fn [code session-id] - (when session-id - (update-session-status! cfg session-id - (if (zero? (or code 1)) - :completed - :failed))) - (-> (ensure-comment-reaction! cfg repo comment-uuid - (if (zero? (or code 1)) - comment-complete-reaction - comment-failed-reaction)) - (p/catch (fn [e] - (log/error :agent-bridge-comment-reaction-failed e)))))}) - _ (when-not (seq session) - (throw (ex-info "codex session id missing" - {:code :codex-session-id-missing}))) - cfg* (cli-server/ensure-server! cfg repo) - _ (record-session! cfg* (comment-session-record graph agent-name comment-block session :running))] - {:block (block-uuid-str comment-block) - :session session - :backend :codex - :preview preview - :request :comment}) - (fn [e] - (if-let [comment-uuid (:block/uuid comment-block)] - (p/let [_ (ensure-comment-reaction! cfg repo comment-uuid comment-failed-reaction)] - (throw e)) - (p/rejected e))))) +(defn- dispatch-comment-to-master! + [cfg {:keys [repo graph agent-name project-dir] :as opts} comment-block] + (p/let [comment-uuid (:block/uuid comment-block) + _ (when-not comment-uuid + (throw (ex-info "comment block uuid is missing" + {:code :agent-comment-uuid-missing}))) + comments-area (pull-comments-area cfg repo comment-block agent-session-id-property-ident) + _ (when-not (comments-area? comments-area) + (throw (ex-info "comment parent is not a comments area" + {:code :agent-comment-parent-invalid + :block (block-uuid-str comment-block)}))) + target-blocks (vec (:logseq.property.comments/blocks comments-area)) + target-tree-texts (p/all (mapv #(show-block-tree cfg repo %) target-blocks)) + comments-area-tree-text (show-block-tree cfg repo comments-area) + comment-tree-text (show-block-tree cfg repo comment-block) + result (dispatch-to-master! + cfg + opts + {:request :comment + :block comment-block + :prompt (build-master-comment-dispatch-prompt + {:graph graph + :agent-name agent-name + :project-dir project-dir + :comment comment-block + :target-tree-texts target-tree-texts + :comments-area-tree-text comments-area-tree-text + :comment-tree-text comment-tree-text})}) + _ (ensure-comment-reaction! cfg repo comment-uuid comment-start-reaction)] + result)) (defn- route-comment-once! [cfg {:keys [routing-blocks*] :as opts} comment-block] - (let [block-id (block-uuid-str comment-block)] - (if (and routing-blocks* block-id) - (if (claim-routing-block! routing-blocks* block-id) - (-> (route-comment! cfg opts comment-block) - (p/finally (fn [] - (swap! routing-blocks* disj block-id)))) - (p/resolved nil)) - (route-comment! cfg opts comment-block)))) + (if-let [e (master-session-required-error :comment opts)] + (p/rejected e) + (let [block-id (block-uuid-str comment-block)] + (if (and routing-blocks* block-id) + (if (claim-routing-block! routing-blocks* block-id) + (-> (dispatch-comment-to-master! cfg opts comment-block) + (p/finally (fn [] + (swap! routing-blocks* disj block-id)))) + (p/resolved nil)) + (dispatch-comment-to-master! cfg opts comment-block))))) (defn- route-assignee-datom! [cfg {:keys [repo agent-name] :as opts} datom] @@ -1323,7 +1589,7 @@ (p/all routing))))) (defn- listen-forever! - [cfg {:keys [repo graph agent-name prompt-templates routing-blocks*]}] + [cfg {:keys [repo graph agent-name prompt-templates routing-blocks* master-session project-dir]}] (let [routing-blocks* (or routing-blocks* (atom #{})) handle-error! (fn [e] (emit-log! cfg (log-line (str "Codex invocation failed: " @@ -1342,6 +1608,8 @@ :graph graph :agent-name agent-name :prompt-templates prompt-templates + :master-session master-session + :project-dir project-dir :routing-blocks* routing-blocks*} payload) (p/catch handle-error!)) @@ -1368,54 +1636,57 @@ logs (conj logs (log-line (str "using agent name: " agent-name)) (log-line "checking codex cli ..."))] - (if-not (codex-available? nil) - (bridge-error :codex-not-found "codex executable is not available") - (p/let [cfg (cli-server/ensure-server! config repo) - logs (conj logs (log-line "checking prompt templates ...")) - prompt-templates (ensure-agent-bridge-prompt-templates! cfg repo) - logs (conj logs (log-line "registering agent bridge ...")) - _ (register-agent-bridge! cfg repo agent-name)] - (if (:dry-run? action) - (p/let [tasks (list-routable-tasks cfg repo agent-name) - commands (dry-run-commands graph agent-name prompt-templates tasks) - logs (into (conj logs (log-line "listening graph changes ...")) - (map (fn [{:keys [block preview]}] - (log-line (str "would run Codex command for " block ": " preview))) - commands))] - {:status :ok - :command :agent-bridge - :data {:mode :dry-run - :graph graph - :agent-name agent-name - :logs logs - :commands commands}}) - (if (:process-once? action) - (do - (doseq [line (conj logs (log-line "listening graph changes ..."))] - (emit-log! cfg line)) - (let [routing-blocks* (atom #{})] - (p/let [routed (process-tasks! cfg {:repo repo - :graph graph - :agent-name agent-name - :prompt-templates prompt-templates - :routing-blocks* routing-blocks*})] - {:status :ok - :command :agent-bridge - :data {:mode :processed-once - :graph graph - :agent-name agent-name - :routed routed}}))) - (let [routing-blocks* (atom #{}) - listen-promise (listen-forever! cfg {:repo repo - :graph graph - :agent-name agent-name - :prompt-templates prompt-templates - :routing-blocks* routing-blocks*})] - (doseq [line (conj logs (log-line "listening graph changes ..."))] - (emit-log! cfg line)) - (p/let [_ (process-tasks! cfg {:repo repo - :graph graph - :agent-name agent-name - :prompt-templates prompt-templates - :routing-blocks* routing-blocks*})] - listen-promise))))))))))) + (with-bridge-lock! config graph agent-name + (fn [] + (if-not (codex-available? nil) + (bridge-error :codex-not-found "codex executable is not available") + (p/let [cfg (cli-server/ensure-server! config repo) + logs (conj logs (log-line "registering agent bridge ...")) + _ (register-agent-bridge! cfg repo agent-name) + logs (conj logs (log-line "checking master prompt ...")) + master-prompt (ensure-agent-master-prompt! cfg repo agent-name) + logs (conj logs (log-line "checking prompt templates ...")) + prompt-templates (ensure-agent-bridge-prompt-templates! cfg repo)] + (if (:process-once? action) + (p/let [master-record (ensure-master-session! cfg {:graph graph + :agent-name agent-name + :master-prompt master-prompt}) + master-session (:session master-record)] + (doseq [line (conj logs (log-line "listening graph changes ..."))] + (emit-log! cfg line)) + (let [routing-blocks* (atom #{})] + (p/let [routed (process-tasks! cfg {:repo repo + :graph graph + :agent-name agent-name + :prompt-templates prompt-templates + :master-session master-session + :project-dir (:project-dir config) + :routing-blocks* routing-blocks*})] + {:status :ok + :command :agent-bridge + :data {:mode :processed-once + :graph graph + :agent-name agent-name + :routed routed}}))) + (p/let [master-record (ensure-master-session! cfg {:graph graph + :agent-name agent-name + :master-prompt master-prompt}) + master-session (:session master-record)] + (let [routing-blocks* (atom #{}) + listen-promise (listen-forever! cfg {:repo repo + :graph graph + :agent-name agent-name + :prompt-templates prompt-templates + :master-session master-session + :project-dir (:project-dir config) + :routing-blocks* routing-blocks*})] + (doseq [line (conj logs (log-line "listening graph changes ..."))] + (emit-log! cfg line)) + (p/let [_ (process-tasks! cfg {:repo repo + :graph graph + :agent-name agent-name + :prompt-templates prompt-templates + :master-session master-session + :project-dir (:project-dir config) + :routing-blocks* routing-blocks*})] + listen-promise))))))))))))) diff --git a/src/main/logseq/cli/format.cljs b/src/main/logseq/cli/format.cljs index a5c463e3a992..611b73996a01 100644 --- a/src/main/logseq/cli/format.cljs +++ b/src/main/logseq/cli/format.cljs @@ -213,7 +213,7 @@ :server-revision-mismatch-after-restart "Logseq restarted db-worker-node, but the replacement still reports a different revision. Check the installed Logseq build and retry" :agent-name-invalid "Set :agent-name in cli.edn to a non-empty string or ensure hostname is available" :codex-not-found "Install Codex CLI and ensure `codex` is on PATH" - :bridge-listener-failed "Retry with --dry-run or check db-worker-node event support" + :bridge-listener-failed "Check db-worker-node event support and retry" nil)) (defn- format-candidates diff --git a/src/test/logseq/cli/command/agent_test.cljs b/src/test/logseq/cli/command/agent_test.cljs index 5642287023f0..d26ba54255fa 100644 --- a/src/test/logseq/cli/command/agent_test.cljs +++ b/src/test/logseq/cli/command/agent_test.cljs @@ -60,11 +60,11 @@ :block/tags [{:db/ident :logseq.class/Comments :block/title "Comments"}] :logseq.property.comments/blocks [{:db/id 70 - :block/uuid #uuid "77777777-7777-7777-7777-777777777777" - :block/title "Target block A"} - {:db/id 80 - :block/uuid #uuid "88888888-8888-8888-8888-888888888888" - :block/title "Target block B"}]} + :block/uuid #uuid "77777777-7777-7777-7777-777777777777" + :block/title "Target block A"} + {:db/id 80 + :block/uuid #uuid "88888888-8888-8888-8888-888888888888" + :block/title "Target block B"}]} overrides)) (def codex-exec-prefix @@ -73,34 +73,6 @@ (def codex-resume-prefix ["codex" "--sandbox" "danger-full-access" "exec" "resume" "--json" "--skip-git-repo-check"]) -(defn- assert-comment-request-prompt - [prompt] - (doseq [expected ["You are handling a Logseq AgentBridge comment request." - "Graph: demo" - "Comment UUID: 55555555-5555-5555-5555-555555555555" - "AgentBridge name: build-host" - "Comment target context:" - "- Target block A\n - Target A child" - "- Target block B\n - Target B child" - "Comment thread context:" - "- Comments\n - [[build-host]] please summarize the selected blocks" - "Requesting comment:" - "For a short reply, append a comment after the requesting comment." - "For a long reply, write a normal block tree after the comments area and append a comment that references that tree."]] - (is (string/includes? prompt expected)))) - -(defn- assert-basic-comment-request-prompt - [prompt] - (doseq [expected ["You are handling a Logseq AgentBridge comment request." - "Graph: demo" - "Comment UUID: 55555555-5555-5555-5555-555555555555" - "AgentBridge name: build-host" - "Comment target context:" - "Comment thread context:" - "Requesting comment:" - "Reply instructions:"]] - (is (string/includes? prompt expected)))) - (deftest test-agent-bridge-built-in-properties (testing "Assignee is public and queryable" (let [property (get db-property/built-in-properties :logseq.property/assignee)] @@ -130,11 +102,19 @@ (deftest test-agent-command-entries (testing "parse agent bridge command surface" - (let [bridge (commands/parse-args ["agent" "bridge" "--graph" "demo" "--dry-run"])] + (let [bridge (commands/parse-args ["agent" "bridge" "--graph" "demo"])] (is (true? (:ok? bridge))) (is (= :agent-bridge (:command bridge))) (is (= "demo" (get-in bridge [:options :graph]))) - (is (true? (get-in bridge [:options :dry-run]))))) + (is (not (contains? (:options bridge) :dry-run))))) + + (testing "agent bridge dry-run is not accepted" + (let [result (commands/parse-args ["agent" "bridge" "--graph" "demo" "--dry-run"])] + (is (false? (:ok? result))))) + + (testing "agent bridge help does not mention dry-run" + (let [summary (:summary (commands/parse-args ["agent" "bridge" "--help"]))] + (is (not (string/includes? summary "--dry-run"))))) (testing "agent bridge list is not a command" (let [result (commands/parse-args ["agent" "bridge" "list"])] @@ -159,14 +139,14 @@ (testing "agent bridge uses normal graph config precedence" (let [parsed {:ok? true :command :agent-bridge - :options {:dry-run true} + :options {} :args []} result (commands/build-action parsed {:graph "demo"})] (is (true? (:ok? result))) (is (= :agent-bridge (get-in result [:action :type]))) (is (= "demo" (get-in result [:action :graph]))) (is (= "logseq_db_demo" (get-in result [:action :repo]))) - (is (true? (get-in result [:action :dry-run?]))))) + (is (not (contains? (:action result) :dry-run?))))) (testing "agent bridge list action is not supported" (let [result (commands/build-action {:ok? true @@ -220,7 +200,7 @@ "build-host")))) (is (= :assignee-mismatch (:reason (agent-command/routable-task-decision (task-block {:logseq.property/assignee [{:db/id 102 - :block/title "other-host"}]}) + :block/title "other-host"}]}) "build-host")))) (is (= :already-routed (:reason (agent-command/routable-task-decision (task-block {:logseq.property.agent/session-id "codex-1"}) @@ -310,36 +290,36 @@ (let [calls* (atom []) page-uuid (uuid "33333333-3333-3333-3333-333333333333")] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls* conj [method args]) - (case method - :thread-api/q - (let [[_ [query & _query-args]] args] - (cond - (= query agent-command/agent-bridge-registry-page-query) - (p/resolved []) - - (= query agent-command/agent-bridge-prompt-template-blocks-query) - (p/resolved []) - - :else - (p/rejected (ex-info "unexpected query" - {:query query})))) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (if (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) - (p/resolved [agent-command/agent-bridge-registry-page page-uuid]) - (p/resolved {:ok true}))) - - :thread-api/pull - (p/resolved {:db/id 300 - :block/uuid page-uuid - :block/title agent-command/agent-bridge-registry-page}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & _query-args]] args] + (cond + (= query agent-command/agent-bridge-registry-page-query) + (p/resolved []) + + (= query agent-command/agent-bridge-prompt-template-blocks-query) + (p/resolved []) + + :else + (p/rejected (ex-info "unexpected query" + {:query query})))) + + :thread-api/apply-outliner-ops + (let [[_ ops _] args] + (if (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) + (p/resolved [agent-command/agent-bridge-registry-page page-uuid]) + (p/resolved {:ok true}))) + + :thread-api/pull + (p/resolved {:db/id 300 + :block/uuid page-uuid + :block/title agent-command/agent-bridge-registry-page}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (p/let [templates (agent-command/ensure-agent-bridge-prompt-templates! {:root-dir "/tmp/logseq"} "logseq_db_demo")] @@ -383,34 +363,34 @@ :block/name "agentbridge" :block/title agent-command/agent-bridge-registry-page}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls* conj [method args]) - (case method - :thread-api/q - (let [[_ [query & _query-args]] args] - (cond - (= query agent-command/agent-bridge-registry-page-query) - (p/resolved [recycled-page]) - - (= query agent-command/agent-bridge-prompt-template-blocks-query) - (p/resolved []) - - :else - (p/rejected (ex-info "unexpected query" - {:query query})))) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (if (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) - (p/resolved [agent-command/agent-bridge-registry-page live-page-uuid]) - (p/resolved {:ok true}))) - - :thread-api/pull - (p/resolved live-page) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & _query-args]] args] + (cond + (= query agent-command/agent-bridge-registry-page-query) + (p/resolved [recycled-page]) + + (= query agent-command/agent-bridge-prompt-template-blocks-query) + (p/resolved []) + + :else + (p/rejected (ex-info "unexpected query" + {:query query})))) + + :thread-api/apply-outliner-ops + (let [[_ ops _] args] + (if (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) + (p/resolved [agent-command/agent-bridge-registry-page live-page-uuid]) + (p/resolved {:ok true}))) + + :thread-api/pull + (p/resolved live-page) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (p/let [templates (agent-command/ensure-agent-bridge-prompt-templates! {:root-dir "/tmp/logseq"} "logseq_db_demo")] @@ -419,7 +399,7 @@ ["logseq_db_demo" [[:create-page [agent-command/agent-bridge-registry-page {}]]] {}]] - %) + %) @calls*)))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) @@ -437,28 +417,28 @@ :block/uuid comment-template-uuid :block/title agent-command/comment-prompt-template-title}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls* conj [method args]) - (case method - :thread-api/q - (let [[_ [query & _query-args]] args] - (cond - (= query agent-command/agent-bridge-registry-page-query) - (p/resolved [page]) - - (= query agent-command/agent-bridge-prompt-template-blocks-query) - (p/resolved [broken-comment-template]) - - :else - (p/rejected (ex-info "unexpected query" - {:query query})))) - - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & _query-args]] args] + (cond + (= query agent-command/agent-bridge-registry-page-query) + (p/resolved [page]) + + (= query agent-command/agent-bridge-prompt-template-blocks-query) + (p/resolved [broken-comment-template]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query})))) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (p/let [templates (agent-command/ensure-agent-bridge-prompt-templates! {:root-dir "/tmp/logseq"} "logseq_db_demo")] @@ -468,7 +448,7 @@ (filter #(= :thread-api/apply-outliner-ops (first %))) (mapv (comp second second))) child-repair-op (first (filter #(= comment-template-uuid - (-> % first second second)) + (-> % first second second)) insert-ops))] (is (some? child-repair-op)) (is (some #(string/includes? (:block/title %) "{{requesting-comment}}") @@ -487,27 +467,27 @@ :block/uuid (uuid "33333333-3333-3333-3333-333333333333") :block/title agent-command/agent-bridge-registry-page}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (case method - :thread-api/q - (let [[_ [query & _query-args]] args] - (cond - (= query agent-command/agent-bridge-registry-page-query) - (p/resolved [page]) - - (= query agent-command/agent-bridge-prompt-template-blocks-query) - (p/resolved [bad-template-block]) - - :else - (p/rejected (ex-info "unexpected query" - {:query query})))) - - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_cfg method args] + (case method + :thread-api/q + (let [[_ [query & _query-args]] args] + (cond + (= query agent-command/agent-bridge-registry-page-query) + (p/resolved [page]) + + (= query agent-command/agent-bridge-prompt-template-blocks-query) + (p/resolved [bad-template-block]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query})))) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (agent-command/ensure-agent-bridge-prompt-templates! {:root-dir "/tmp/logseq"} "logseq_db_demo")) @@ -520,6 +500,516 @@ (:template (ex-data e)))))) (p/finally done))))) +(deftest test-default-master-prompt-documents-routing-policy + (let [prompt (#'agent-command/default-master-prompt)] + (doseq [expected ["Do not operate outside the target graph." + "Only the master agent may write task results back into the target graph." + "Subagents may read graph context but must not write graph content." + "When dispatching a subagent for a task, write the subagent Codex session id to the task block's `:logseq.property.agent/session-id` property." + "Child task blocks and comment requests under a task with `:logseq.property.agent/session-id` must continue in that same subagent session." + "When the task or subagent finishes, remove the `eyes` reaction from the task block whether it succeeded or failed." + "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." + "| Simple | Translation, rewrite, small lookup, simple search | Fresh temporary directory | No project writes | Can run concurrently |" + "| Read-only project | Code review, code explanation, implementation lookup | Project directory | No writes | Can run concurrently |" + "| Read/write project | Bug fix, feature implementation, test update | Project directory on new branch from `origin/master` | Writes allowed after branch setup | Only one at a time |" + "Writable project subagents must start from `origin/master` and create a new branch before modifying the project." + "Serialize writable project subagents; keep only one writable project subagent active at a time." + "Keep graph reports short unless a blocker occurs." + "Report root cause and Steps to verify only for bug fixes."]] + (is (string/includes? prompt expected))))) + +(deftest test-agent-bridge-initializes-master-prompt-on-empty-agent-page + (async done + (let [calls* (atom []) + agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved []) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (p/let [prompt (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")] + (is (string/includes? prompt "Only the master agent may write task results back")) + (let [insert-op (some (fn [[method args]] + (when (= :thread-api/apply-outliner-ops method) + (second args))) + @calls*) + inserted-blocks (-> insert-op first second first) + wrapper (some #(when (= agent-command/master-prompt-wrapper-title + (:block/title %)) + %) + inserted-blocks) + prompt-block (some #(when (some #{:logseq.class/Code-block} + (:block/tags %)) + %) + inserted-blocks)] + (is (= [[:insert-blocks [inserted-blocks + (:block/uuid agent-page) + {:outliner-op :insert-blocks + :sibling? false + :bottom? false + :keep-uuid? true}]]] + insert-op)) + (is (some? wrapper)) + (is (some? prompt-block)) + (is (string/includes? (:block/title prompt-block) + "Only the master agent may write task results back")) + (is (= :code (:logseq.property.node/display-type prompt-block))) + (is (= "markdown" (:logseq.property.code/lang prompt-block))) + (is (= (:block/uuid wrapper) + (second (:block/parent prompt-block))))))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest test-agent-bridge-reads-initialized-master-prompt-on-next-start + (async done + (let [inserted-blocks* (atom nil) + agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + inserted-master-blocks (fn [blocks] + (let [wrapper (first (filter #(= agent-command/master-prompt-wrapper-title + (:block/title %)) + blocks))] + [(assoc wrapper + :block/order "a0" + :block/_parent (filter #(= [:block/uuid (:block/uuid wrapper)] + (:block/parent %)) + blocks))]))] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved (if-let [blocks @inserted-blocks*] + (inserted-master-blocks blocks) + [])) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (let [[_ [[_ [blocks]]]] args] + (reset! inserted-blocks* blocks) + (p/resolved {:ok true})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (p/let [first-prompt (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host") + second-prompt (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")] + (is (= first-prompt second-prompt)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest test-agent-bridge-keeps-existing-master-prompt-code-block + (async done + (let [calls* (atom []) + agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + custom-prompt "Custom master prompt" + prompt-block {:db/id 402 + :block/uuid (uuid "66666666-6666-6666-6666-666666666666") + :block/title custom-prompt + :block/tags [{:db/ident :logseq.class/Code-block + :block/title "Code"}]} + wrapper {:db/id 401 + :block/uuid (uuid "55555555-5555-5555-5555-555555555555") + :block/title agent-command/master-prompt-wrapper-title + :block/order "a0" + :block/_parent [prompt-block]}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved [wrapper]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/rejected (ex-info "should not write existing prompt" + {:args args})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (p/let [prompt (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")] + (is (= custom-prompt prompt)) + (is (not-any? #(= :thread-api/apply-outliner-ops (first %)) @calls*)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest test-agent-bridge-master-prompt-fails-on-plain-fenced-child + (async done + (let [agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + prompt-block {:db/id 402 + :block/uuid (uuid "66666666-6666-6666-6666-666666666666") + :block/title "```markdown\nPlain fenced prompt\n```"} + wrapper {:db/id 401 + :block/uuid (uuid "55555555-5555-5555-5555-555555555555") + :block/title agent-command/master-prompt-wrapper-title + :block/order "a0" + :block/_parent [prompt-block]}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved [wrapper]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/rejected (ex-info "should not accept plain fenced prompt" + {:args args})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")) + (p/then (fn [_] + (is false "expected plain fenced master prompt to fail"))) + (p/catch (fn [e] + (is (= :agent-master-prompt-invalid (:code (ex-data e)))) + (is (= :missing-master-prompt-code-block (:reason (ex-data e)))))) + (p/finally done))))) + +(deftest test-agent-bridge-master-prompt-fails-on-invalid-first-block + (async done + (let [agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + malformed-wrapper {:db/id 401 + :block/uuid (uuid "55555555-5555-5555-5555-555555555555") + :block/title "Not a prompt" + :block/order "a0" + :block/_parent [{:db/id 402 + :block/uuid (uuid "66666666-6666-6666-6666-666666666666") + :block/title "```markdown\nWrong prompt\n```"}]}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved [malformed-wrapper]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/rejected (ex-info "should not repair invalid first block" + {:args args})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")) + (p/then (fn [_] + (is false "expected invalid master prompt to fail"))) + (p/catch (fn [e] + (is (= :agent-master-prompt-invalid (:code (ex-data e)))) + (is (= :invalid-master-prompt-wrapper (:reason (ex-data e)))))) + (p/finally done))))) + +(deftest test-agent-bridge-master-prompt-fails-on-nested-prompt-code + (async done + (let [agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + nested-prompt {:db/id 403 + :block/uuid (uuid "77777777-7777-7777-7777-777777777777") + :block/title "Nested prompt" + :block/tags [{:db/ident :logseq.class/Code-block + :block/title "Code"}]} + wrapper {:db/id 401 + :block/uuid (uuid "55555555-5555-5555-5555-555555555555") + :block/title agent-command/master-prompt-wrapper-title + :block/order "a0" + :block/_parent [{:db/id 402 + :block/uuid (uuid "66666666-6666-6666-6666-666666666666") + :block/title "Prompt notes" + :block/_parent [nested-prompt]}]}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved [wrapper]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/rejected (ex-info "should not repair invalid prompt shape" + {:args args})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")) + (p/then (fn [_] + (is false "expected nested master prompt code to fail"))) + (p/catch (fn [e] + (is (= :agent-master-prompt-invalid (:code (ex-data e)))) + (is (= :missing-master-prompt-code-block (:reason (ex-data e)))))) + (p/finally done))))) + +(deftest test-agent-bridge-master-prompt-ignores-recycled-first-block + (async done + (let [calls* (atom []) + agent-page {:db/id 400 + :block/uuid (uuid "44444444-4444-4444-4444-444444444444") + :block/name "build-host" + :block/title "build-host"} + recycled-wrapper {:db/id 401 + :block/uuid (uuid "55555555-5555-5555-5555-555555555555") + :block/title "Recycled bad prompt" + :block/order "a0" + :block/parent {:db/id 499 + :logseq.property/deleted-at 1}}] + (-> (p/with-redefs [transport/invoke + (fn [_ method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + (= query agent-command/agent-master-prompt-blocks-query) + (p/resolved [recycled-wrapper]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] + (p/let [prompt (agent-command/ensure-agent-master-prompt! + {:root-dir "/tmp/logseq"} + "logseq_db_demo" + "build-host")] + (is (string/includes? prompt "Only the master agent may write task results back")) + (is (some #(= :thread-api/apply-outliner-ops (first %)) @calls*)))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally done))))) + +(deftest test-master-dispatch-prompts + (testing "task dispatch prompt is deterministic and scoped" + (let [prompt (#'agent-command/build-master-task-dispatch-prompt + {:graph "demo" + :agent-name "build-host" + :project-dir "/repo/logseq" + :block (task-block {}) + :tree-text "- Ship the CLI bridge\n - Add tests"})] + (doseq [expected ["You are handling a Logseq AgentBridge master dispatch request." + "Request kind: task" + "Graph: demo" + "AgentBridge name: build-host" + "Block UUID: 11111111-1111-1111-1111-111111111111" + "Project directory: /repo/logseq" + "Do not operate outside the target graph." + "Only the master agent may write task results back into the target graph." + "Write task results back into the graph." + "When the task or subagent finishes, remove the `eyes` reaction from the task block whether it succeeded or failed." + "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." + "Keep the report short when possible." + "Report blockers only if there is a blocker." + "Report root cause and Steps to verify only for bug fixes." + "After launching the subagent with `codex exec`, write that subagent session id to the task block's `:logseq.property.agent/session-id` property." + "Task block tree:" + "- Ship the CLI bridge\n - Add tests"]] + (is (string/includes? prompt expected))) + (is (not (string/includes? prompt "unrelated graph data"))))) + (testing "comment dispatch prompt includes comment and target context" + (let [prompt (#'agent-command/build-master-comment-dispatch-prompt + {:graph "demo" + :agent-name "build-host" + :project-dir "/repo/logseq" + :comment (comment-block {}) + :target-tree-texts ["- Target block A" "- Target block B"] + :comments-area-tree-text "- Comments\n - [[build-host]] please summarize" + :comment-tree-text "- [[build-host]] please summarize"})] + (doseq [expected ["You are handling a Logseq AgentBridge master dispatch request." + "Request kind: comment" + "Graph: demo" + "Comment UUID: 55555555-5555-5555-5555-555555555555" + "AgentBridge name: build-host" + "Project directory: /repo/logseq" + "Complete the request from the mentioned comment." + "If the target graph is sync-enabled, make sure it is synced after writing back to the graph." + "Keep the report short when possible." + "Report blockers only if there is a blocker." + "Report root cause and Steps to verify only for bug fixes." + "Comment target context:" + "- Target block A\n- Target block B" + "Comment thread context:" + "- Comments\n - [[build-host]] please summarize" + "Requesting comment:" + "- [[build-host]] please summarize" + "Reply instructions:" + "For a short reply, append a comment after the requesting comment." + "For a long reply, write a normal block tree after the comments area and append a comment that references that tree." + "When referencing result blocks in DB graphs, reference result blocks with [[block-uuid]], not ((block-uuid))." + "If the request is blocked or fails, make that clear in the reply."]] + (is (string/includes? prompt expected))) + (is (not (string/includes? prompt "Task block tree:")))))) + +(deftest test-master-task-dispatch-prompt-omits-inherited-session-for-root-task + (let [prompt (#'agent-command/build-master-task-dispatch-prompt + {:graph "demo" + :agent-name "build-host" + :project-dir "/repo/logseq" + :block (task-block {}) + :tree-text "- Ship the CLI bridge"})] + (is (not (string/includes? prompt "Inherited parent task UUID:"))) + (is (not (string/includes? prompt "Inherited subagent session id:"))) + (is (not (string/includes? prompt "Continue this child task"))))) + +(deftest test-agent-bridge-master-session-starts-without-local-session-store + (async done + (let [root (temp-root) + session-store-path (node-path/join root "agent-bridge-sessions.edn") + session-counter* (atom 0) + calls* (atom [])] + (try + (-> (p/with-redefs [agent-command/start-codex! + (fn [command _opts] + (swap! calls* conj [:codex command]) + (p/resolved {:session (str "master-session-" (swap! session-counter* inc)) + :status :running}))] + (p/let [started (#'agent-command/ensure-master-session! + {:root-dir root} + {:graph "demo" + :agent-name "build-host" + :master-prompt "Master prompt"}) + resumed (#'agent-command/ensure-master-session! + {:root-dir root} + {:graph "demo" + :agent-name "build-host" + :master-prompt "Changed prompt"})] + (is (= "master-session-1" (:session started))) + (is (= "master-session-2" (:session resumed))) + (is (= [[:codex (conj codex-exec-prefix "Master prompt")] + [:codex (conj codex-exec-prefix "Changed prompt")]] + @calls*)) + (is (false? (fs/existsSync session-store-path))))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (fs/rmSync root #js {:recursive true :force true}) + (done)))) + (catch :default e + (fs/rmSync root #js {:recursive true :force true}) + (is false (str "unexpected setup error: " e)) + (done)))))) + (deftest test-agent-bridge-listener-routes-id-valued-task-routability-datoms (async done (let [calls* (atom []) @@ -527,50 +1017,47 @@ route-opts {:repo "logseq_db_demo" :graph "demo" :agent-name "build-host" - :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"} + :master-session "master-session-123" :routing-blocks* (atom #{})}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls* conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 42 (p/resolved task) - 900 (p/resolved {:db/id 900 - :db/ident :logseq.class/Task}) - 901 (p/resolved {:db/id 901 - :db/ident :logseq.property/status.todo}) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - - :thread-api/q - (p/resolved :logseq.property/status.todo) - - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [_action _cfg] - (p/resolved {:status :ok - :data {:message "- Ship the CLI bridge"}})) - cli-server/ensure-server! - (fn [cfg _repo] - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! - (fn [_command _opts] - (swap! calls* conj [:codex]) - (p/resolved {:session "session-123" - :status :running})) - agent-command/record-session! - (fn [_cfg _session-record] - true) - agent-command/write-agent-session-id! - (fn [_cfg _repo _block-uuid _session-id] - (p/resolved true))] + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (case lookup + 42 (p/resolved task) + 900 (p/resolved {:db/id 900 + :db/ident :logseq.class/Task}) + 901 (p/resolved {:db/id 901 + :db/ident :logseq.property/status.todo}) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + + :thread-api/q + (p/resolved :logseq.property/status.todo) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [_action _cfg] + (p/resolved {:status :ok + :data {:message "- Ship the CLI bridge"}})) + cli-server/ensure-server! + (fn [cfg _repo] + (assoc cfg :base-url "http://127.0.0.1:1234")) + agent-command/start-codex! + (fn [command _opts] + (swap! calls* conj [:codex command]) + (p/resolved {:session "master-session-123" + :status :running})) + agent-command/write-agent-session-id! + (fn [_cfg _repo _block-uuid _session-id] + (p/resolved true))] (#'agent-command/process-sync-db-changes-event! {:root-dir "/tmp/logseq" :base-url "http://127.0.0.1:1234" @@ -585,273 +1072,307 @@ :v 901 :added true}]})) (p/then (fn [_] - (is (= 1 (count (filter #(= [:codex] %) @calls*)))))) + (let [[_ command] (some #(when (= :codex (first %)) %) @calls*)] + (is (= (conj codex-resume-prefix "master-session-123") + (vec (take 8 command))))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally done))))) -(deftest test-agent-bridge-listener-routes-comment-mention-with-context-and-reactions +(defn- expected-task-started-ops + [block-uuid] + [[[:toggle-reaction [block-uuid "eyes" nil]]] + [[:batch-set-property [[block-uuid] :logseq.property/status :logseq.property/status.doing {}]]]]) + +(deftest test-agent-bridge-listener-dispatches-task-event-to-master-session (async done - (let [root (temp-root) - calls (atom []) - start-on-exit* (atom nil) - request-comment (comment-block {}) - comments-area (comments-area-block {}) - comment-uuid (:block/uuid request-comment) - tree-by-uuid {"55555555-5555-5555-5555-555555555555" - "- [[build-host]] please summarize the selected blocks" - "66666666-6666-6666-6666-666666666666" - "- Comments\n - [[build-host]] please summarize the selected blocks\n - Earlier comment" - "77777777-7777-7777-7777-777777777777" - "- Target block A\n - Target A child" - "88888888-8888-8888-8888-888888888888" - "- Target block B\n - Target B child"}] - (-> (p/with-redefs [agent-command/list-routable-tasks - (fn [_cfg repo agent-name] - (swap! calls conj [:broad-scan repo agent-name]) - (p/resolved [])) - transport/invoke - (fn [_cfg method args] - (swap! calls conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 50 (p/resolved request-comment) - 60 (p/resolved comments-area) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - - :thread-api/q - (p/resolved nil) - - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [action _cfg] - (swap! calls conj [:show action]) - (p/resolved {:status :ok - :data {:message (get tree-by-uuid (:uuid action))}})) - cli-server/ensure-server! - (fn [cfg repo] - (swap! calls conj [:ensure-server (:root-dir cfg) repo]) - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! - (fn [command opts] - (swap! calls conj [:codex command]) - (reset! start-on-exit* (:on-exit opts)) - ((:on-exit opts) 0 "comment-session-123") - (p/resolved {:session "comment-session-123" - :status :running}))] + (let [calls* (atom []) + task (task-block {}) + route-opts {:repo "logseq_db_demo" + :graph "demo" + :agent-name "build-host" + :master-session "master-session-123" + :routing-blocks* (atom #{})}] + (-> (p/with-redefs [transport/invoke + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (case lookup + 42 (p/resolved task) + 900 (p/resolved {:db/id 900 + :db/ident :logseq.class/Task}) + 901 (p/resolved {:db/id 901 + :db/ident :logseq.property/status.todo}) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + + :thread-api/q + (if (string/includes? (pr-str args) ":logseq.property/status") + (p/resolved :logseq.property/status.todo) + (p/resolved nil)) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [_action _cfg] + (p/resolved {:status :ok + :data {:message "- Ship the CLI bridge"}})) + agent-command/start-codex! + (fn [command _opts] + (swap! calls* conj [:codex command]) + (p/resolved {:session "master-session-123" + :status :running}))] (#'agent-command/process-sync-db-changes-event! - {:root-dir root + {:root-dir "/tmp/logseq" :base-url "http://127.0.0.1:1234" :log-fn (fn [_] nil)} - {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :routing-blocks* (atom #{})} - {:tx-data [{:e 50 - :a :block/title - :v (:block/title request-comment) + route-opts + {:tx-data [{:e 42 + :a :block/tags + :v 900 + :added true} + {:e 42 + :a :logseq.property/status + :v 901 :added true}]})) (p/then (fn [_] - (is (not-any? #(= :broad-scan (first %)) @calls)) - (is (some #(= [:thread-api/apply-outliner-ops - ["logseq_db_demo" - [[:toggle-reaction [comment-uuid "eyes" nil]]] - {}]] - %) - @calls)) - (let [[_ command] (some #(when (= :codex (first %)) %) @calls)] - (is (some? command)) - (when command - (assert-comment-request-prompt (last command)))) - (is (fn? @start-on-exit*)) - (p/let [_ (p/delay 10)] - (is (some #(= [:thread-api/apply-outliner-ops - ["logseq_db_demo" - [[:toggle-reaction [comment-uuid "white_check_mark" nil]]] - {}]] - %) - @calls))))) + (let [[_ command] (some #(when (= :codex (first %)) %) @calls*)] + (is (= codex-resume-prefix + (vec (take (count codex-resume-prefix) command)))) + (is (= "master-session-123" + (nth command (count codex-resume-prefix)))) + (is (string/includes? (last command) "Request kind: task")) + (is (string/includes? (last command) "- Ship the CLI bridge"))) + (is (= (expected-task-started-ops (:block/uuid task)) + (mapv (comp second second) + (filter #(= :thread-api/apply-outliner-ops (first %)) @calls*)))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) - (p/finally (fn [] - (fs/rmSync root #js {:recursive true :force true}) - (done))))))) + (p/finally done))))) -(deftest test-agent-bridge-listener-routes-normalized-comment-mention-ref +(deftest test-agent-bridge-listener-includes-inherited-parent-session-for-child-task (async done - (let [root (temp-root) - calls (atom []) - request-comment (comment-block {:block/title "[[aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa]] please summarize" - :block/refs [{:db/id 101 - :block/title "build-host"}]}) - comments-area (comments-area-block {}) - comment-uuid (:block/uuid request-comment)] + (let [calls* (atom []) + parent-uuid (uuid "22222222-2222-2222-2222-222222222222") + child-task (task-block {:block/title "Follow up in same subagent" + :block/parent {:db/id 700}}) + parent-task {:db/id 700 + :block/uuid parent-uuid + :block/title "Parent task" + :block/tags [{:db/ident :logseq.class/Task + :block/title "Task"}] + :logseq.property.agent/session-id "subagent-session-123" + :block/parent {:db/id 800}} + route-opts {:repo "logseq_db_demo" + :graph "demo" + :agent-name "build-host" + :master-session "master-session-123" + :routing-blocks* (atom #{})}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 50 (p/resolved request-comment) - 60 (p/resolved comments-area) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - :thread-api/q - (p/resolved nil) - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [_action _cfg] - (p/resolved {:status :ok - :data {:message "- context"}})) - cli-server/ensure-server! - (fn [cfg _repo] cfg) - agent-command/start-codex! - (fn [command _opts] - (swap! calls conj [:codex command]) - (p/resolved {:session "comment-session-ref" - :status :running}))] + (fn [_cfg method args] + (swap! calls* conj [method args]) + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (case lookup + 42 (p/resolved child-task) + 700 (p/resolved parent-task) + 900 (p/resolved {:db/id 900 + :db/ident :logseq.class/Task}) + 901 (p/resolved {:db/id 901 + :db/ident :logseq.property/status.todo}) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + + :thread-api/q + (if (string/includes? (pr-str args) ":logseq.property/status") + (p/resolved :logseq.property/status.todo) + (p/resolved nil)) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [_action _cfg] + (p/resolved {:status :ok + :data {:message "- Follow up in same subagent"}})) + agent-command/start-codex! + (fn [command _opts] + (swap! calls* conj [:codex command]) + (p/resolved {:session "master-session-123" + :status :running}))] (#'agent-command/process-sync-db-changes-event! - {:root-dir root + {:root-dir "/tmp/logseq" :base-url "http://127.0.0.1:1234" :log-fn (fn [_] nil)} - {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :routing-blocks* (atom #{})} - {:tx-data [{:e 50 - :a :block/title - :v (:block/title request-comment) + route-opts + {:tx-data [{:e 42 + :a :block/tags + :v 900 + :added true} + {:e 42 + :a :logseq.property/status + :v 901 :added true}]})) (p/then (fn [_] - (is (some #(= :codex (first %)) @calls)) - (is (some #(= [:thread-api/apply-outliner-ops - ["logseq_db_demo" - [[:toggle-reaction [comment-uuid "eyes" nil]]] - {}]] - %) - @calls)))) + (let [[_ command] (some #(when (= :codex (first %)) %) @calls*) + prompt (last command)] + (is (string/includes? prompt "Request kind: task")) + (is (string/includes? prompt (str "Inherited parent task UUID: " parent-uuid))) + (is (string/includes? prompt "Inherited subagent session id: subagent-session-123")) + (is (string/includes? prompt "Continue this child task in the inherited subagent session instead of launching a new subagent.")) + (is (string/includes? prompt "- Follow up in same subagent"))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) - (p/finally (fn [] - (fs/rmSync root #js {:recursive true :force true}) - (done))))))) + (p/finally done))))) -(deftest test-agent-bridge-listener-resumes-commented-block-session-when-assignee-matches +(deftest test-agent-bridge-task-route-requires-master-session (async done - (let [root (temp-root) - calls (atom []) + (let [codex-started?* (atom false) + block (task-block {}) + route-opts {:repo "logseq_db_demo" + :graph "demo" + :agent-name "build-host" + :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"} + :routing-blocks* (atom #{})}] + (-> (p/with-redefs [agent-command/start-codex! + (fn [_command _opts] + (reset! codex-started?* true) + (p/resolved {:session "session-123" + :status :running})) + agent-command/write-agent-session-id! + (fn [_cfg _repo _block-uuid _session-id] + (p/resolved true)) + transport/invoke + (fn [_ method _args] + (case method + :thread-api/q (p/resolved nil) + :thread-api/apply-outliner-ops (p/resolved {:ok true}) + (p/rejected (ex-info "unexpected invoke" + {:method method})))) + cli-server/ensure-server! + (fn [cfg _repo] + (assoc cfg :base-url "http://127.0.0.1:1234"))] + (#'agent-command/route-task-once! + {:root-dir "/tmp/logseq"} + route-opts + {:block block + :tree-text "- Ship the CLI bridge"})) + (p/then (fn [_] + (is false "expected task route without master-session to fail"))) + (p/catch (fn [e] + (is (= :agent-bridge-master-session-required (:code (ex-data e)))) + (is (= :task (:request (ex-data e)))) + (is (false? @codex-started?*)))) + (p/finally done))))) + +(deftest test-agent-bridge-comment-route-requires-master-session + (async done + (let [codex-started?* (atom false) request-comment (comment-block {}) - commented-block (assoc (first (:logseq.property.comments/blocks (comments-area-block {}))) - :logseq.property.agent/session-id "existing-session-123" - :logseq.property/assignee [{:db/id 101 - :block/title "build-host"}]) - comments-area (comments-area-block {:logseq.property.comments/blocks [commented-block]})] - (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 50 (p/resolved request-comment) - 60 (p/resolved comments-area) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - :thread-api/q - (p/resolved nil) - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [_action _cfg] - (p/resolved {:status :ok - :data {:message "- context"}})) - cli-server/ensure-server! - (fn [cfg _repo] cfg) - agent-command/start-codex! - (fn [command _opts] - (swap! calls conj [:codex command]) - (p/resolved {:session "existing-session-123" - :status :running}))] - (#'agent-command/process-sync-db-changes-event! - {:root-dir root - :base-url "http://127.0.0.1:1234" - :log-fn (fn [_] nil)} - {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :routing-blocks* (atom #{})} - {:tx-data [{:e 50 - :a :block/title - :v (:block/title request-comment) - :added true}]})) + comments-area (comments-area-block {}) + route-opts {:repo "logseq_db_demo" + :graph "demo" + :agent-name "build-host" + :prompt-templates {:comment "Comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"} + :routing-blocks* (atom #{})}] + (-> (p/with-redefs [agent-command/start-codex! + (fn [_command _opts] + (reset! codex-started?* true) + (p/resolved {:session "comment-session-123" + :status :running})) + transport/invoke + (fn [_ method args] + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (if (= (:db/id (:block/parent request-comment)) lookup) + (p/resolved comments-area) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + + :thread-api/q + (p/resolved nil) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [_action _cfg] + (p/resolved {:status :ok + :data {:message "- comment context"}})) + cli-server/ensure-server! + (fn [cfg _repo] + (assoc cfg :base-url "http://127.0.0.1:1234"))] + (#'agent-command/route-comment-once! + {:root-dir "/tmp/logseq"} + route-opts + request-comment)) (p/then (fn [_] - (let [[_ command] (some #(when (= :codex (first %)) %) @calls)] - (is (some? command)) - (is (= (conj codex-resume-prefix "existing-session-123") - (vec (take 8 command)))) - (when command - (assert-basic-comment-request-prompt (last command)))))) + (is false "expected comment route without master-session to fail"))) (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally (fn [] - (fs/rmSync root #js {:recursive true :force true}) - (done))))))) + (is (= :agent-bridge-master-session-required (:code (ex-data e)))) + (is (= :comment (:request (ex-data e)))) + (is (false? @codex-started?*)))) + (p/finally done))))) -(deftest test-agent-bridge-listener-starts-temporary-comment-session-when-assignee-mismatches +(deftest test-agent-bridge-listener-dispatches-comment-event-to-master-session (async done (let [root (temp-root) calls (atom []) request-comment (comment-block {}) - commented-block (assoc (first (:logseq.property.comments/blocks (comments-area-block {}))) - :logseq.property.agent/session-id "existing-session-123" - :logseq.property/assignee [{:db/id 101 - :block/title "other-host"}]) - comments-area (comments-area-block {:logseq.property.comments/blocks [commented-block]})] + comments-area (comments-area-block {}) + comment-uuid (:block/uuid request-comment) + tree-by-uuid {"55555555-5555-5555-5555-555555555555" + "- [[build-host]] please summarize the selected blocks" + "66666666-6666-6666-6666-666666666666" + "- Comments\n - [[build-host]] please summarize the selected blocks" + "77777777-7777-7777-7777-777777777777" + "- Target block A" + "88888888-8888-8888-8888-888888888888" + "- Target block B"}] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 50 (p/resolved request-comment) - 60 (p/resolved comments-area) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - :thread-api/q - (p/resolved nil) - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [_action _cfg] - (p/resolved {:status :ok - :data {:message "- context"}})) - cli-server/ensure-server! - (fn [cfg _repo] cfg) - agent-command/start-codex! - (fn [command _opts] - (swap! calls conj [:codex command]) - (p/resolved {:session "comment-session-789" - :status :running}))] + (fn [_cfg method args] + (swap! calls conj [method args]) + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (case lookup + 50 (p/resolved request-comment) + 60 (p/resolved comments-area) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + + :thread-api/q + (p/resolved nil) + + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [action _cfg] + (p/resolved {:status :ok + :data {:message (get tree-by-uuid (:uuid action))}})) + agent-command/start-codex! + (fn [command _opts] + (swap! calls conj [:codex command]) + (p/resolved {:session "master-session-123" + :status :running}))] (#'agent-command/process-sync-db-changes-event! {:root-dir root :base-url "http://127.0.0.1:1234" @@ -859,6 +1380,7 @@ {:repo "logseq_db_demo" :graph "demo" :agent-name "build-host" + :master-session "master-session-123" :routing-blocks* (atom #{})} {:tx-data [{:e 50 :a :block/title @@ -866,55 +1388,62 @@ :added true}]})) (p/then (fn [_] (let [[_ command] (some #(when (= :codex (first %)) %) @calls)] - (is (some? command)) - (is (= codex-exec-prefix - (vec (take (count codex-exec-prefix) command)))) - (when command - (assert-basic-comment-request-prompt (last command)))))) + (is (= codex-resume-prefix + (vec (take (count codex-resume-prefix) command)))) + (is (= "master-session-123" + (nth command (count codex-resume-prefix)))) + (is (string/includes? (last command) "Request kind: comment")) + (is (string/includes? (last command) "Comment target context:")) + (is (string/includes? (last command) "- Target block A"))) + (is (= [[:thread-api/apply-outliner-ops + ["logseq_db_demo" + [[:toggle-reaction [comment-uuid "eyes" nil]]] + {}]]] + (filterv #(= :thread-api/apply-outliner-ops (first %)) @calls))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] (fs/rmSync root #js {:recursive true :force true}) (done))))))) -(deftest test-agent-bridge-listener-adds-failure-reaction-when-comment-codex-exits-nonzero +(deftest test-agent-bridge-listener-routes-normalized-comment-mention-ref (async done (let [root (temp-root) calls (atom []) - start-on-exit* (atom nil) - request-comment (comment-block {}) + request-comment (comment-block {:block/title "[[aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa]] please summarize" + :block/refs [{:db/id 101 + :block/title "build-host"}]}) comments-area (comments-area-block {}) comment-uuid (:block/uuid request-comment)] (-> (p/with-redefs [transport/invoke - (fn [_cfg method args] - (swap! calls conj [method args]) - (case method - :thread-api/pull - (let [[_repo _selector lookup] args] - (case lookup - 50 (p/resolved request-comment) - 60 (p/resolved comments-area) - (p/rejected (ex-info "unexpected pull" - {:lookup lookup})))) - :thread-api/q - (p/resolved nil) - :thread-api/apply-outliner-ops - (p/resolved {:ok true}) - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - show-command/execute-show - (fn [_action _cfg] - (p/resolved {:status :ok - :data {:message "- context"}})) - cli-server/ensure-server! - (fn [cfg _repo] cfg) - agent-command/start-codex! - (fn [_command opts] - (reset! start-on-exit* (:on-exit opts)) - ((:on-exit opts) 1 "comment-session-456") - (p/resolved {:session "comment-session-456" - :status :running}))] + (fn [_cfg method args] + (swap! calls conj [method args]) + (case method + :thread-api/pull + (let [[_repo _selector lookup] args] + (case lookup + 50 (p/resolved request-comment) + 60 (p/resolved comments-area) + (p/rejected (ex-info "unexpected pull" + {:lookup lookup})))) + :thread-api/q + (p/resolved nil) + :thread-api/apply-outliner-ops + (p/resolved {:ok true}) + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args})))) + show-command/execute-show + (fn [_action _cfg] + (p/resolved {:status :ok + :data {:message "- context"}})) + cli-server/ensure-server! + (fn [cfg _repo] cfg) + agent-command/start-codex! + (fn [command _opts] + (swap! calls conj [:codex command]) + (p/resolved {:session "comment-session-ref" + :status :running}))] (#'agent-command/process-sync-db-changes-event! {:root-dir root :base-url "http://127.0.0.1:1234" @@ -922,20 +1451,23 @@ {:repo "logseq_db_demo" :graph "demo" :agent-name "build-host" + :master-session "master-session-123" :routing-blocks* (atom #{})} {:tx-data [{:e 50 :a :block/title :v (:block/title request-comment) :added true}]})) (p/then (fn [_] - (is (fn? @start-on-exit*)) - (p/let [_ (p/delay 10)] - (is (some #(= [:thread-api/apply-outliner-ops - ["logseq_db_demo" - [[:toggle-reaction [comment-uuid "x" nil]]] - {}]] - %) - @calls))))) + (is (some #(= :codex (first %)) @calls)) + (let [[_ command] (some #(when (= :codex (first %)) %) @calls)] + (is (= (conj codex-resume-prefix "master-session-123") + (vec (take 8 command))))) + (is (some #(= [:thread-api/apply-outliner-ops + ["logseq_db_demo" + [[:toggle-reaction [comment-uuid "eyes" nil]]] + {}]] + %) + @calls)))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] @@ -968,7 +1500,8 @@ :log-fn (fn [_] nil)} {:repo "logseq_db_demo" :graph "demo" - :agent-name "build-host"}) + :agent-name "build-host" + :master-session "master-session-123"}) (@handler* :sync-db-changes {:tx-data [{:e 50 :a :block/title :v (:block/title non-comment) @@ -1079,44 +1612,44 @@ registry-page-uuid (uuid "33333333-3333-3333-3333-333333333333") agent-page-uuid (uuid "44444444-4444-4444-4444-444444444444")] (-> (p/with-redefs [transport/invoke - (fn [_ method args] - (swap! calls* conj [method args]) - (case method - :thread-api/q - (let [[_ [query & query-args]] args] - (cond - (= query agent-command/agent-bridge-registry-page-query) - (p/resolved []) - - (= query agent-command/registered-agent-query) - (p/resolved []) - - :else - (p/rejected (ex-info "unexpected query" - {:query query - :query-args query-args})))) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (cond - (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) - (p/resolved [agent-command/agent-bridge-registry-page registry-page-uuid]) - - (= [[:create-page ["build-host" {}]]] ops) - (p/resolved ["build-host" agent-page-uuid]) - - :else - (p/rejected (ex-info "unexpected apply-outliner-ops" - {:ops ops})))) - - :thread-api/pull - (p/resolved {:db/id 300 - :block/uuid registry-page-uuid - :block/title agent-command/agent-bridge-registry-page}) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_ method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (= query agent-command/agent-bridge-registry-page-query) + (p/resolved []) + + (= query agent-command/registered-agent-query) + (p/resolved []) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (let [[_ ops _] args] + (cond + (= [[:create-page [agent-command/agent-bridge-registry-page {}]]] ops) + (p/resolved [agent-command/agent-bridge-registry-page registry-page-uuid]) + + (= [[:create-page ["build-host" {}]]] ops) + (p/resolved ["build-host" agent-page-uuid]) + + :else + (p/rejected (ex-info "unexpected apply-outliner-ops" + {:ops ops})))) + + :thread-api/pull + (p/resolved {:db/id 300 + :block/uuid registry-page-uuid + :block/title agent-command/agent-bridge-registry-page}) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (p/let [_ (agent-command/register-agent-bridge! {:root-dir "/tmp/logseq"} "logseq_db_demo" "build-host")] (let [apply-ops (->> @calls* (filter #(= :thread-api/apply-outliner-ops (first %))) @@ -1142,32 +1675,32 @@ :block/name "build-host" :block/title "build-host"}] (-> (p/with-redefs [transport/invoke - (fn [_ method args] - (swap! calls* conj [method args]) - (case method - :thread-api/q - (let [[_ [query & query-args]] args] - (cond - (and (= query agent-command/agent-bridge-registry-page-query) - (= ["agentbridge"] query-args)) - (p/resolved [registry-page]) - - (and (= query agent-command/registered-agent-query) - (= ["build-host"] query-args)) - (p/resolved [agent-page]) - - :else - (p/rejected (ex-info "unexpected query" - {:query query - :query-args query-args})))) - - :thread-api/apply-outliner-ops - (p/rejected (ex-info "unexpected apply-outliner-ops" - {:args args})) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args}))))] + (fn [_ method args] + (swap! calls* conj [method args]) + (case method + :thread-api/q + (let [[_ [query & query-args]] args] + (cond + (and (= query agent-command/agent-bridge-registry-page-query) + (= ["agentbridge"] query-args)) + (p/resolved [registry-page]) + + (and (= query agent-command/registered-agent-query) + (= ["build-host"] query-args)) + (p/resolved [agent-page]) + + :else + (p/rejected (ex-info "unexpected query" + {:query query + :query-args query-args})))) + + :thread-api/apply-outliner-ops + (p/rejected (ex-info "unexpected apply-outliner-ops" + {:args args})) + + (p/rejected (ex-info "unexpected invoke" + {:method method + :args args}))))] (p/let [result (agent-command/register-agent-bridge! {:root-dir "/tmp/logseq"} "logseq_db_demo" "build-host")] (is (true? result)) (is (not-any? #(= :thread-api/apply-outliner-ops (first %)) @calls*)))) @@ -1206,290 +1739,6 @@ (is false (str "unexpected error: " e)))) (p/finally done))))) -(deftest test-agent-bridge-task-route-marks-started - (async done - (let [calls* (atom []) - block (task-block {}) - block-without-status (dissoc block :logseq.property/status) - route-opts {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"}} - route! (fn [block] - (#'agent-command/route-task! {:root-dir "/tmp/logseq"} - route-opts - {:block block - :tree-text "- Ship the CLI bridge"}))] - (-> (p/with-redefs [transport/invoke (fn [_ method args] - (case method - :thread-api/q - (if (string/includes? (pr-str args) ":logseq.property/status") - (p/resolved :logseq.property/status.todo) - (p/resolved nil)) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (swap! calls* conj [:apply-ops ops]) - (p/resolved {:ok true})) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - cli-server/ensure-server! (fn [cfg _repo] - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! (fn [_command _opts] - (swap! calls* conj [:codex]) - (p/resolved {:session "session-123" - :status :running})) - agent-command/record-session! (fn [_cfg _session-record] - (swap! calls* conj [:record-session]) - true) - agent-command/write-agent-session-id! (fn [_cfg _repo block-uuid session-id] - (swap! calls* conj [:write-session block-uuid session-id]) - (p/resolved true))] - (p/let [_ (route! block) - _ (route! block-without-status)] - (is (= [[:codex] - [:record-session] - [:write-session (:block/uuid block) "session-123"] - [:apply-ops [[:toggle-reaction [(:block/uuid block) "eyes" nil]]]] - [:apply-ops [[:batch-set-property [[(:block/uuid block)] - :logseq.property/status - :logseq.property/status.doing - {}]]]] - [:codex] - [:record-session] - [:write-session (:block/uuid block) "session-123"] - [:apply-ops [[:toggle-reaction [(:block/uuid block) "eyes" nil]]]]] - @calls*)))) - (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally done))))) - -(deftest test-agent-bridge-task-route-marks-successful-completion-in-review - (async done - (let [block (task-block {}) - route-opts {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"}} - route! (fn [] - (#'agent-command/route-task! {:root-dir "/tmp/logseq"} - route-opts - {:block block - :tree-text "- Ship the CLI bridge"})) - run-scenario - (fn [exit-code] - (let [ops* (atom []) - session-statuses* (atom [])] - (p/let [_ (p/with-redefs [transport/invoke - (fn [_ method args] - (case method - :thread-api/q - (if (string/includes? (pr-str args) ":logseq.property/status") - (p/resolved :logseq.property/status.todo) - (p/resolved nil)) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (swap! ops* into ops) - (p/resolved {:ok true})) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - cli-server/ensure-server! (fn [cfg _repo] - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! (fn [_command opts] - ((:on-exit opts) exit-code "session-123") - (p/resolved {:session "session-123" - :status :running})) - agent-command/record-session! (fn [_cfg _session-record] - true) - agent-command/update-session-status! (fn [_cfg session-id status] - (swap! session-statuses* conj [session-id status]) - true) - agent-command/write-agent-session-id! (fn [_cfg _repo _block-uuid _session-id] - (p/resolved true))] - (p/let [_ (route!) - _ (p/delay 10)] - true))] - {:ops @ops* - :session-statuses @session-statuses*}))) - in-review-op [:batch-set-property [[(:block/uuid block)] - :logseq.property/status - :logseq.property/status.in-review - {}]]] - (-> (p/let [success (run-scenario 0) - failure (run-scenario 1)] - (is (= [["session-123" :completed]] - (:session-statuses success))) - (is (some #(= in-review-op %) (:ops success))) - (is (= [["session-123" :failed]] - (:session-statuses failure))) - (is (not-any? #(= in-review-op %) (:ops failure)))) - (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally done))))) - -(deftest test-agent-bridge-task-route-does-not-mark-started-before-session-id-is-written - (async done - (let [block (task-block {}) - route-opts {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"}} - route! (fn [] - (#'agent-command/route-task! {:root-dir "/tmp/logseq"} - route-opts - {:block block - :tree-text "- Ship the CLI bridge"})) - run-scenario (fn [{:keys [start-codex record-session write-session]}] - (let [ops* (atom [])] - (p/with-redefs [transport/invoke (fn [_ method args] - (case method - :thread-api/q - (p/resolved nil) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (swap! ops* into ops) - (p/resolved {:ok true})) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - cli-server/ensure-server! (fn [cfg _repo] - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! start-codex - agent-command/record-session! record-session - agent-command/write-agent-session-id! write-session] - (p/let [result (p/catch (route!) - (fn [_e] :rejected))] - {:result result - :ops @ops*})))) - started {:start-codex (fn [_command _opts] - (p/resolved {:session "session-123" - :status :running})) - :record-session (fn [_cfg _session-record] - true) - :write-session (fn [_cfg _repo _block-uuid _session-id] - (p/resolved true))}] - (-> (p/let [start-failure (run-scenario (assoc started :start-codex - (fn [_command _opts] - (p/rejected (ex-info "codex failed" - {:code :codex-failed}))))) - record-failure (run-scenario (assoc started :record-session - (fn [_cfg _session-record] - (p/rejected (ex-info "record failed" - {:code :record-failed}))))) - write-failure (run-scenario (assoc started :write-session - (fn [_cfg _repo _block-uuid _session-id] - (p/rejected (ex-info "write failed" - {:code :write-failed})))))] - (is (= {:result :rejected :ops []} start-failure)) - (is (= {:result :rejected :ops []} record-failure)) - (is (= {:result :rejected :ops []} write-failure))) - (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally done))))) - -(deftest test-agent-bridge-task-route-does-not-regress-completed-task-status - (async done - (let [ops* (atom []) - block (task-block {}) - route-opts {:repo "logseq_db_demo" - :graph "demo" - :agent-name "build-host" - :prompt-templates {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}"}} - route! (fn [] - (#'agent-command/route-task! {:root-dir "/tmp/logseq"} - route-opts - {:block block - :tree-text "- Ship the CLI bridge"}))] - (-> (p/with-redefs [transport/invoke (fn [_ method args] - (case method - :thread-api/q - (if (string/includes? (pr-str args) ":logseq.property/status") - (p/resolved :logseq.property/status.done) - (p/resolved nil)) - - :thread-api/apply-outliner-ops - (let [[_ ops _] args] - (swap! ops* into ops) - (p/resolved {:ok true})) - - (p/rejected (ex-info "unexpected invoke" - {:method method - :args args})))) - cli-server/ensure-server! (fn [cfg _repo] - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! (fn [_command _opts] - (p/resolved {:session "session-123" - :status :running})) - agent-command/record-session! (fn [_cfg _session-record] - true) - agent-command/write-agent-session-id! (fn [_cfg _repo _block-uuid _session-id] - (p/resolved true))] - (p/let [_ (route!)] - (is (= [[:toggle-reaction [(:block/uuid block) "eyes" nil]]] - @ops*)))) - (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally done))))) - -(deftest test-session-store - (let [root (temp-root) - config {:root-dir root}] - (try - (agent-command/record-session! config {:session "codex-running" - :status :running - :backend :codex - :graph "demo" - :block "11111111-1111-1111-1111-111111111111" - :agent "build-host" - :started-at 1000 - :updated-at 2000}) - (agent-command/record-session! config {:session "codex-done" - :status :completed - :backend :codex - :graph "demo" - :block "22222222-2222-2222-2222-222222222222" - :agent "build-host" - :started-at 1000 - :updated-at 3000}) - (testing "session file is EDN data" - (let [payload (reader/read-string (fs/readFileSync (agent-command/session-store-path config) "utf8"))] - (is (= ["codex-running" "codex-done"] - (mapv :session (:sessions payload)))))) - (finally - (fs/rmSync root #js {:recursive true :force true}))))) - -(deftest test-session-store-keeps-terminal-status-after-late-running-record - (let [root (temp-root) - config {:root-dir root}] - (try - (agent-command/update-session-status! config "codex-fast" :completed) - (agent-command/record-session! config {:session "codex-fast" - :status :running - :backend :codex - :graph "demo" - :block "11111111-1111-1111-1111-111111111111" - :agent "build-host" - :started-at 1000 - :updated-at 2000}) - (let [payload (reader/read-string (fs/readFileSync (agent-command/session-store-path config) "utf8")) - session (first (:sessions payload))] - (is (= :completed (:status session))) - (is (= :codex (:backend session))) - (is (= "demo" (:graph session))) - (is (= "11111111-1111-1111-1111-111111111111" (:block session))) - (is (= "build-host" (:agent session))) - (is (= 1000 (:started-at session))) - (is (= 2000 (:updated-at session)))) - (finally - (fs/rmSync root #js {:recursive true :force true}))))) - (deftest test-format-agent-bridge-logs (let [output (cli-format/format-result {:status :ok :command :agent-bridge @@ -1499,52 +1748,7 @@ (is (= "2026-05-16T00:00:00.000Z checking the environment ...\n2026-05-16T00:00:01.000Z listening graph changes ..." output)))) -(deftest test-execute-agent-bridge-dry-run - (async done - (let [calls (atom [])] - (-> (p/with-redefs [agent-command/codex-available? (fn [_] true) - cli-server/ensure-server! (fn [cfg repo] - (swap! calls conj [:ensure-server (:root-dir cfg) repo]) - (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/register-agent-bridge! (fn [cfg repo agent-name] - (swap! calls conj [:register (:root-dir cfg) repo agent-name]) - (p/resolved true)) - agent-command/ensure-agent-bridge-prompt-templates! - (fn [cfg repo] - (swap! calls conj [:prompt-templates (:root-dir cfg) repo]) - (p/resolved {:task "Custom task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}" - :comment "Custom comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"})) - agent-command/list-routable-tasks (fn [_cfg repo agent-name] - (swap! calls conj [:list repo agent-name]) - (p/resolved [{:block (task-block {}) - :tree-text "- Ship the CLI bridge"}]))] - (p/let [result (agent-command/execute-bridge {:type :agent-bridge - :repo "logseq_db_demo" - :graph "demo" - :dry-run? true} - {:root-dir "/tmp/logseq" - :agent-name "build-host"})] - (is (= :ok (:status result))) - (is (= :dry-run (get-in result [:data :mode]))) - (is (= [[:ensure-server "/tmp/logseq" "logseq_db_demo"] - [:prompt-templates "/tmp/logseq" "logseq_db_demo"] - [:register "/tmp/logseq" "logseq_db_demo" "build-host"] - [:list "logseq_db_demo" "build-host"]] - @calls)) - (is (= 1 (count (get-in result [:data :commands])))) - (is (string/includes? (last (get-in result [:data :commands 0 :command])) - "Custom task demo")) - (is (not (string/includes? (last (get-in result [:data :commands 0 :command])) - "You are handling a Logseq AgentBridge task."))) - (is (string/includes? (first (get-in result [:data :logs])) - "checking the environment")) - (is (string/includes? (last (get-in result [:data :logs])) - "would run Codex command")))) - (p/catch (fn [e] - (is false (str "unexpected error: " e)))) - (p/finally done))))) - -(deftest test-execute-agent-bridge-non-dry-run-routes-task +(deftest test-execute-agent-bridge-routes-task (async done (let [root (temp-root) calls (atom []) @@ -1559,6 +1763,10 @@ agent-command/register-agent-bridge! (fn [_cfg repo agent-name] (swap! calls conj [:register repo agent-name]) (p/resolved true)) + agent-command/ensure-agent-master-prompt! + (fn [_cfg repo agent-name] + (swap! calls conj [:master-prompt repo agent-name]) + (p/resolved "Master prompt")) agent-command/ensure-agent-bridge-prompt-templates! (fn [_cfg repo] (swap! calls conj [:prompt-templates repo]) @@ -1593,7 +1801,6 @@ (p/let [result (agent-command/execute-bridge {:type :agent-bridge :repo "logseq_db_demo" :graph "demo" - :dry-run? false :process-once? true} {:root-dir root :agent-name "build-host" @@ -1601,27 +1808,26 @@ (is (= :ok (:status result))) (is (= :processed-once (get-in result [:data :mode]))) (is (= [[:ensure-server root "logseq_db_demo"] - [:prompt-templates "logseq_db_demo"] [:register "logseq_db_demo" "build-host"] - [:list "logseq_db_demo" "build-host"] - [:codex (conj codex-exec-prefix "Task demo 11111111-1111-1111-1111-111111111111 build-host\n- Ship the CLI bridge")] - [:ensure-server root "logseq_db_demo"] - [:write-session "logseq_db_demo" (:block/uuid block) "session-123"] - [:apply-ops "logseq_db_demo" [[:toggle-reaction [(:block/uuid block) "eyes" nil]]]] - [:apply-ops "logseq_db_demo" [[:batch-set-property [[(:block/uuid block)] - :logseq.property/status - :logseq.property/status.doing - {}]]]]] - @calls)) - (let [payload (reader/read-string (fs/readFileSync (agent-command/session-store-path {:root-dir root}) "utf8")) - sessions (:sessions payload)] - (is (= [{:session "session-123" - :status :running - :backend :codex - :graph "demo" - :block "11111111-1111-1111-1111-111111111111" - :agent "build-host"}] - (mapv #(select-keys % [:session :status :backend :graph :block :agent]) sessions)))))) + [:master-prompt "logseq_db_demo" "build-host"] + [:prompt-templates "logseq_db_demo"] + [:codex (conj codex-exec-prefix "Master prompt")] + [:list "logseq_db_demo" "build-host"]] + (vec (take 6 @calls)))) + (let [[_ dispatch-command] (some #(when (= :codex (first %)) %) (reverse @calls))] + (is (= codex-resume-prefix + (vec (take (count codex-resume-prefix) dispatch-command)))) + (is (= "session-123" + (nth dispatch-command (count codex-resume-prefix)))) + (is (string/includes? (last dispatch-command) + "Request kind: task")) + (is (string/includes? (last dispatch-command) + "Task block tree:\n- Ship the CLI bridge"))) + (is (not-any? #(= :write-session (first %)) @calls)) + (is (= (mapv (fn [ops] [:apply-ops "logseq_db_demo" ops]) + (expected-task-started-ops (:block/uuid block))) + (filterv #(= :apply-ops (first %)) @calls))) + (is (false? (fs/existsSync (node-path/join root "agent-bridge-sessions.edn")))))) (fn [e] (is false (str "unexpected error: " e)))) (fn [] @@ -1646,11 +1852,19 @@ agent-command/register-agent-bridge! (fn [_cfg repo agent-name] (swap! calls conj [:register repo agent-name]) (p/resolved true)) + agent-command/ensure-agent-master-prompt! + (fn [_cfg repo agent-name] + (swap! calls conj [:master-prompt repo agent-name]) + (p/resolved "Master prompt")) agent-command/ensure-agent-bridge-prompt-templates! (fn [_cfg repo] (swap! calls conj [:prompt-templates repo]) (p/resolved {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}" :comment "Comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"})) + agent-command/ensure-master-session! + (fn [_cfg {:keys [graph agent-name master-prompt]}] + (swap! calls conj [:master-session graph agent-name master-prompt]) + (p/resolved {:session "master-session-123"})) transport/connect-events! (fn [_cfg _handler] (swap! calls conj [:connect]) {:close! (fn [] nil)}) @@ -1660,8 +1874,7 @@ (do (agent-command/execute-bridge {:type :agent-bridge :repo "logseq_db_demo" - :graph "demo" - :dry-run? false} + :graph "demo"} {:root-dir "/tmp/logseq" :agent-name "build-host" :log-fn (fn [line] @@ -1680,6 +1893,93 @@ (is false (str "unexpected error: " e)))) (p/finally done))))) +(deftest test-execute-agent-bridge-rejects-duplicate-running-bridge + (async done + (let [root (temp-root) + calls (atom [])] + (try + (-> (p/with-redefs [agent-command/codex-available? (fn [_] true) + cli-server/ensure-server! (fn [cfg repo] + (swap! calls conj [:ensure-server repo]) + (assoc cfg :base-url "http://127.0.0.1:1234")) + agent-command/register-agent-bridge! (fn [_cfg repo agent-name] + (swap! calls conj [:register repo agent-name]) + (p/resolved true)) + agent-command/ensure-agent-master-prompt! + (fn [_cfg repo agent-name] + (swap! calls conj [:master-prompt repo agent-name]) + (p/resolved "Master prompt")) + agent-command/ensure-agent-bridge-prompt-templates! + (fn [_cfg repo] + (swap! calls conj [:prompt-templates repo]) + (p/resolved {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}" + :comment "Comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"})) + agent-command/ensure-master-session! + (fn [_cfg {:keys [graph agent-name master-prompt]}] + (swap! calls conj [:master-session graph agent-name master-prompt]) + (p/resolved {:session "master-session-123"})) + transport/connect-events! (fn [_cfg _handler] + (swap! calls conj [:connect]) + {:close! (fn [] nil)}) + agent-command/list-routable-tasks (fn [_cfg repo agent-name] + (swap! calls conj [:list repo agent-name]) + (p/resolved []))] + (do + (agent-command/execute-bridge {:type :agent-bridge + :repo "logseq_db_demo" + :graph "demo"} + {:root-dir root + :agent-name "build-host" + :log-fn (fn [_] nil)}) + (p/let [_ (p/delay 10) + duplicate (agent-command/execute-bridge {:type :agent-bridge + :repo "logseq_db_demo" + :graph "demo" + :process-once? true} + {:root-dir root + :agent-name "build-host" + :log-fn (fn [_] nil)})] + (is (= :error (:status duplicate))) + (is (= :agent-bridge-already-running + (get-in duplicate [:error :code]))) + (let [message (get-in duplicate [:error :message])] + (is (and (string? message) + (string/includes? message "already running"))))))) + (p/catch (fn [e] + (is false (str "unexpected error: " e)))) + (p/finally (fn [] + (fs/rmSync root #js {:recursive true :force true}) + (done)))) + (catch :default e + (fs/rmSync root #js {:recursive true :force true}) + (is false (str "unexpected setup error: " e)) + (done)))))) + +(deftest test-agent-bridge-lock-recovers-when-owner-file-is-missing + (let [root (temp-root) + lock-dir (#'agent-command/bridge-lock-dir {:root-dir root} "demo" "build-host")] + (try + (fs/mkdirSync lock-dir #js {:recursive true}) + (let [result (#'agent-command/acquire-bridge-lock! {:root-dir root} "demo" "build-host")] + (is (true? (:ok? result))) + (is (fs/existsSync (#'agent-command/bridge-lock-owner-path lock-dir))) + ((:release! result))) + (finally + (fs/rmSync root #js {:recursive true :force true}))))) + +(deftest test-agent-bridge-lock-recovers-when-owner-file-is-corrupt + (let [root (temp-root) + lock-dir (#'agent-command/bridge-lock-dir {:root-dir root} "demo" "build-host")] + (try + (fs/mkdirSync lock-dir #js {:recursive true}) + (fs/writeFileSync (#'agent-command/bridge-lock-owner-path lock-dir) "{:pid" "utf8") + (let [result (#'agent-command/acquire-bridge-lock! {:root-dir root} "demo" "build-host")] + (is (true? (:ok? result))) + (is (fs/existsSync (#'agent-command/bridge-lock-owner-path lock-dir))) + ((:release! result))) + (finally + (fs/rmSync root #js {:recursive true :force true}))))) + (deftest test-execute-agent-bridge-shares-routing-claims-between-listener-and-initial-scan (async done (let [root (temp-root) @@ -1693,10 +1993,16 @@ (assoc cfg :base-url "http://127.0.0.1:1234")) agent-command/register-agent-bridge! (fn [_cfg _repo _agent-name] (p/resolved true)) + agent-command/ensure-agent-master-prompt! + (fn [_cfg _repo _agent-name] + (p/resolved "Master prompt")) agent-command/ensure-agent-bridge-prompt-templates! (fn [_cfg _repo] (p/resolved {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}" :comment "Comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"})) + agent-command/ensure-master-session! + (fn [_cfg _opts] + (p/resolved {:session "master-session-123"})) transport/connect-events! (fn [_cfg handler] (reset! handler* handler) {:close! (fn [] nil)}) @@ -1741,15 +2047,13 @@ (do (agent-command/execute-bridge {:type :agent-bridge :repo "logseq_db_demo" - :graph "demo" - :dry-run? false} + :graph "demo"} {:root-dir root :agent-name "build-host" :log-fn (fn [_] nil)}) (p/let [_ (p/delay 60)] (is (= 1 @starts*)) - (is (= [["logseq_db_demo" (:block/uuid block) "session-1"]] - @session-writes*))))) + (is (= [] @session-writes*))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] @@ -1767,29 +2071,36 @@ max-active* (atom 0) routed* (atom []) blocks (mapv (fn [idx] - (task-block {:db/id (+ 42 idx) - :block/uuid (uuid (str "11111111-1111-1111-1111-11111111111" idx))})) - (range 5))] + (task-block {:db/id (+ 42 idx) + :block/uuid (uuid (str "11111111-1111-1111-1111-11111111111" idx))})) + (range 5))] (try (-> (p/with-redefs [agent-command/codex-available? (fn [_] true) cli-server/ensure-server! (fn [cfg _repo] (assoc cfg :base-url "http://127.0.0.1:1234")) agent-command/register-agent-bridge! (fn [_cfg _repo _agent-name] (p/resolved true)) + agent-command/ensure-agent-master-prompt! + (fn [_cfg _repo _agent-name] + (p/resolved "Master prompt")) agent-command/ensure-agent-bridge-prompt-templates! (fn [_cfg _repo] (p/resolved {:task "Task {{graph}} {{block-uuid}} {{agent-name}}\n{{task-block-tree}}" :comment "Comment {{graph}} {{comment-uuid}} {{agent-name}}\n{{comment-target-context}}\n{{comment-thread-context}}\n{{requesting-comment}}"})) + agent-command/ensure-master-session! + (fn [_cfg _opts] + (p/resolved {:session "master-session-123"})) agent-command/list-routable-tasks (fn [_cfg _repo _agent-name] (p/resolved (mapv (fn [block] {:block block :tree-text (:block/title block)}) blocks))) - agent-command/start-codex! (fn [_command _opts] + agent-command/start-codex! (fn [command _opts] (let [active (swap! active* inc)] (swap! max-active* max active) (p/let [_ (p/delay 20)] (swap! active* dec) + (swap! routed* conj (last command)) {:session (str "session-" (random-uuid)) :status :running}))) transport/invoke (fn [_cfg method _args] @@ -1808,13 +2119,13 @@ (p/let [result (agent-command/execute-bridge {:type :agent-bridge :repo "logseq_db_demo" :graph "demo" - :dry-run? false :process-once? true} {:root-dir root :agent-name "build-host" :log-fn (fn [_] nil)})] (is (= :ok (:status result))) (is (= 5 (count @routed*))) + (is (every? #(string/includes? % "Request kind: task") @routed*)) (is (<= @max-active* 4)))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) @@ -1978,7 +2289,7 @@ (assoc cfg :base-url "http://127.0.0.1:1234")) agent-command/start-codex! (fn [command _opts] (swap! calls conj [:codex command]) - (p/resolved {:session "session-123" + (p/resolved {:session "master-session-123" :status :running})) agent-command/write-agent-session-id! (fn [_cfg repo block-uuid session-id] (swap! calls conj [:write-session repo block-uuid session-id]) @@ -1989,7 +2300,8 @@ :log-fn (fn [_] nil)} {:repo "logseq_db_demo" :graph "demo" - :agent-name "build-host"}) + :agent-name "build-host" + :master-session "master-session-123"}) (@handler* :sync-db-changes {:tx-data [{:e 42 :a 900 :v 101 @@ -2000,8 +2312,11 @@ @calls)) (is (some #(= [:thread-api/pull ["logseq_db_demo" [:db/id :block/title :block/name] 101]] %) @calls)) - (is (some #(= [:write-session "logseq_db_demo" (:block/uuid block) "session-123"] %) - @calls))))) + (let [[_ command] (some #(when (= :codex (first %)) %) @calls)] + (is (= (conj codex-resume-prefix "master-session-123") + (vec (take 8 command)))) + (is (string/includes? (last command) + (str "Block UUID: " (:block/uuid block)))))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] @@ -2053,8 +2368,9 @@ cli-server/ensure-server! (fn [cfg repo] (swap! calls conj [:ensure-server (:root-dir cfg) repo]) (assoc cfg :base-url "http://127.0.0.1:1234")) - agent-command/start-codex! (fn [_command _opts] - (p/resolved {:session (str "session-" (random-uuid)) + agent-command/start-codex! (fn [command _opts] + (swap! calls conj [:codex command]) + (p/resolved {:session "master-session-123" :status :running})) agent-command/write-agent-session-id! (fn [_cfg repo block-uuid session-id] (swap! calls conj [:write-session repo block-uuid session-id]) @@ -2065,7 +2381,8 @@ :log-fn (fn [_] nil)} {:repo "logseq_db_demo" :graph "demo" - :agent-name "build-host"}) + :agent-name "build-host" + :master-session "master-session-123"}) (@handler* :sync-db-changes {:tx-data [{:e 42 :a :logseq.property/status :v :logseq.property/status.todo @@ -2078,8 +2395,14 @@ (is (not-any? #(= :broad-scan (first %)) @calls)) (is (= #{(:block/uuid status-block) (:block/uuid tag-block)} - (set (map #(nth % 2) - (filter #(= :write-session (first %)) @calls)))))))) + (set (keep (fn [[kind command]] + (when (= :codex kind) + (some (fn [block] + (when (string/includes? (last command) + (str "Block UUID: " (:block/uuid block))) + (:block/uuid block))) + [status-block tag-block]))) + @calls))))))) (p/catch (fn [e] (is false (str "unexpected error: " e)))) (p/finally (fn [] From 32652458e1145cfd507dc5ef3dec5f1777d96e4e Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Thu, 28 May 2026 22:20:14 +0800 Subject: [PATCH 0041/1400] fix: package zvec native bindings --- package.json | 8 ++++- pnpm-lock.yaml | 20 +++++++++++-- resources/package.json | 8 ++++- resources/pnpm-lock.yaml | 24 ++++++++++++--- scripts/prepare-cli-package.mjs | 33 ++++++++++++++++----- scripts/test-cli-release-config.mjs | 46 +++++++++++++++++++++++++++++ 6 files changed, 122 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 6ffecb2df750..3b41f6d747b3 100644 --- a/package.json +++ b/package.json @@ -154,7 +154,6 @@ "@sentry/react": "^10.51.0", "@sqlite.org/sqlite-wasm": "3.51.2-build9", "@tabler/icons-react": "2.47.0", - "@zvec/zvec": "0.4.0", "bignumber.js": "^9.3.1", "chrono-node": "2.9.0", "codemirror": "5.65.18", @@ -195,6 +194,13 @@ "url": "^0.11.4", "util": "^0.12.5" }, + "optionalDependencies": { + "@zvec/bindings-darwin-arm64": "0.4.0", + "@zvec/bindings-linux-arm64": "0.4.0", + "@zvec/bindings-linux-x64": "0.4.0", + "@zvec/bindings-win32-x64": "0.4.0", + "@zvec/zvec": "0.4.0" + }, "pnpm": { "ignoredBuiltDependencies": [ "canvas", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f076d6327f2b..2a3acc74ee21 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -113,9 +113,6 @@ importers: '@tabler/icons-react': specifier: 2.47.0 version: 2.47.0(react@18.3.1) - '@zvec/zvec': - specifier: 0.4.0 - version: 0.4.0 bignumber.js: specifier: ^9.3.1 version: 9.3.1 @@ -336,6 +333,22 @@ importers: ws: specifier: ^8.20.0 version: 8.20.0 + optionalDependencies: + '@zvec/bindings-darwin-arm64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-linux-arm64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-linux-x64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-win32-x64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/zvec': + specifier: 0.4.0 + version: 0.4.0 packages: @@ -5828,6 +5841,7 @@ snapshots: '@zvec/bindings-linux-arm64': 0.4.0 '@zvec/bindings-linux-x64': 0.4.0 '@zvec/bindings-win32-x64': 0.4.0 + optional: true JSONStream@1.3.5: dependencies: diff --git a/resources/package.json b/resources/package.json index c5f031aeec42..e828abd60b8b 100644 --- a/resources/package.json +++ b/resources/package.json @@ -23,7 +23,6 @@ "@fastify/cors": "11.2.0", "@js-joda/core": "3.2.0", "@modelcontextprotocol/sdk": "^1.27.1", - "@zvec/zvec": "0.4.0", "abort-controller": "3.0.0", "command-exists": "1.2.9", "diff-match-patch": "1.0.5", @@ -54,6 +53,13 @@ "electron-builder": "26.8.2", "electron-devtools-installer": "4.0.0" }, + "optionalDependencies": { + "@zvec/bindings-darwin-arm64": "0.4.0", + "@zvec/bindings-linux-arm64": "0.4.0", + "@zvec/bindings-linux-x64": "0.4.0", + "@zvec/bindings-win32-x64": "0.4.0", + "@zvec/zvec": "0.4.0" + }, "resolutions": { "node-abi": "4.28.0" }, diff --git a/resources/pnpm-lock.yaml b/resources/pnpm-lock.yaml index f9d4dd0accae..d8653b222ac6 100644 --- a/resources/pnpm-lock.yaml +++ b/resources/pnpm-lock.yaml @@ -20,9 +20,6 @@ importers: '@modelcontextprotocol/sdk': specifier: ^1.27.1 version: 1.29.0(zod@4.3.6) - '@zvec/zvec': - specifier: 0.4.0 - version: 0.4.0 abort-controller: specifier: 3.0.0 version: 3.0.0 @@ -105,6 +102,22 @@ importers: electron-devtools-installer: specifier: 4.0.0 version: 4.0.0 + optionalDependencies: + '@zvec/bindings-darwin-arm64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-linux-arm64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-linux-x64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/bindings-win32-x64': + specifier: 0.4.0 + version: 0.4.0 + '@zvec/zvec': + specifier: 0.4.0 + version: 0.4.0 packages: @@ -2534,6 +2547,7 @@ snapshots: '@zvec/bindings-linux-arm64': 0.4.0 '@zvec/bindings-linux-x64': 0.4.0 '@zvec/bindings-win32-x64': 0.4.0 + optional: true abbrev@3.0.1: {} @@ -2665,6 +2679,7 @@ snapshots: bindings@1.5.0: dependencies: file-uri-to-path: 1.0.0 + optional: true bl@4.1.0: dependencies: @@ -3278,7 +3293,8 @@ snapshots: node-domexception: 1.0.0 web-streams-polyfill: 3.3.3 - file-uri-to-path@1.0.0: {} + file-uri-to-path@1.0.0: + optional: true filelist@1.0.6: dependencies: diff --git a/scripts/prepare-cli-package.mjs b/scripts/prepare-cli-package.mjs index b127aedff7b9..9f1000b84340 100644 --- a/scripts/prepare-cli-package.mjs +++ b/scripts/prepare-cli-package.mjs @@ -38,6 +38,10 @@ const assertReleaseEntrypoint = (content) => { const dependencyNames = [ "@js-joda/core", + "@zvec/bindings-darwin-arm64", + "@zvec/bindings-linux-arm64", + "@zvec/bindings-linux-x64", + "@zvec/bindings-win32-x64", "@zvec/zvec", "better-sqlite3", "fs-extra", @@ -54,16 +58,28 @@ const onlyBuiltDependencies = rootPackage.pnpm.onlyBuiltDependencies.filter( ); const dependencyVersion = (name) => - rootPackage.dependencies?.[name] ?? rootPackage.devDependencies?.[name]; + rootPackage.dependencies?.[name] ?? + rootPackage.optionalDependencies?.[name] ?? + rootPackage.devDependencies?.[name]; + +const dependencyEntries = dependencyNames.map((name) => { + const version = dependencyVersion(name); + if (!version) { + throw new Error(`Missing CLI runtime dependency in package.json: ${name}`); + } + return [name, version]; +}); + +const optionalDependencyNames = new Set( + Object.keys(rootPackage.optionalDependencies ?? {}), +); const dependencies = Object.fromEntries( - dependencyNames.map((name) => { - const version = dependencyVersion(name); - if (!version) { - throw new Error(`Missing CLI runtime dependency in package.json: ${name}`); - } - return [name, version]; - }), + dependencyEntries.filter(([name]) => !optionalDependencyNames.has(name)), +); + +const optionalDependencies = Object.fromEntries( + dependencyEntries.filter(([name]) => optionalDependencyNames.has(name)), ); assertReleaseEntrypoint( @@ -105,6 +121,7 @@ const packageJson = { ], files: packageFiles, dependencies, + optionalDependencies, pnpm: { onlyBuiltDependencies, }, diff --git a/scripts/test-cli-release-config.mjs b/scripts/test-cli-release-config.mjs index 1a6ecef6dfa1..81f01c513c01 100644 --- a/scripts/test-cli-release-config.mjs +++ b/scripts/test-cli-release-config.mjs @@ -9,6 +9,20 @@ const repoRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".." const readText = (relativePath) => fs.readFileSync(path.join(repoRoot, relativePath), "utf8"); +const readJson = (relativePath) => + JSON.parse(readText(relativePath)); + +const rootPackage = readJson("package.json"); +const desktopPackage = readJson("resources/package.json"); + +const zvecOptionalRuntimeDependencies = [ + "@zvec/bindings-darwin-arm64", + "@zvec/bindings-linux-arm64", + "@zvec/bindings-linux-x64", + "@zvec/bindings-win32-x64", + "@zvec/zvec", +]; + const assertNotContains = (text, needle, label) => { assert.equal( text.includes(needle), @@ -90,6 +104,27 @@ assertNotContains(lintTask, '"deps/cli"', "lint task"); const lintDepsTask = readText("scripts/src/logseq/tasks/dev/lint_test_deps.clj"); assertNotContains(lintDepsTask, '"deps/cli"', "lint/test deps task"); +for (const dependencyName of zvecOptionalRuntimeDependencies) { + assert.equal( + rootPackage.dependencies?.[dependencyName], + undefined, + `${dependencyName} should not be a hard root runtime dependency`, + ); + assert.ok( + rootPackage.optionalDependencies?.[dependencyName], + `${dependencyName} should be an optional root runtime dependency`, + ); + assert.equal( + desktopPackage.dependencies?.[dependencyName], + undefined, + `${dependencyName} should not be a hard desktop runtime dependency`, + ); + assert.ok( + desktopPackage.optionalDependencies?.[dependencyName], + `${dependencyName} should be an optional desktop runtime dependency`, + ); +} + assert.equal( fs.existsSync(path.join(repoRoot, "src/main/logseq/cli/common/mcp/server.cljs")), false, @@ -124,6 +159,17 @@ assert.equal(packageJson.dependencies?.zod, undefined); assert.ok(packageJson.dependencies?.["@js-joda/core"], "publish package should include @js-joda/core for release artifacts"); assert.ok(packageJson.dependencies?.keytar, "publish package should include keytar for db-worker-node"); assert.ok(packageJson.dependencies?.["string-width"], "publish package should include string-width for CLI rendering"); +for (const dependencyName of zvecOptionalRuntimeDependencies) { + assert.equal( + packageJson.dependencies?.[dependencyName], + undefined, + `${dependencyName} should not be a hard publish package dependency`, + ); + assert.ok( + packageJson.optionalDependencies?.[dependencyName], + `${dependencyName} should be an optional publish package dependency`, + ); +} assert.deepEqual(packageJson.pnpm?.onlyBuiltDependencies, [ "@zvec/zvec", "better-sqlite3", From 19a929475cc5dfe291c3cf859e6bc9ebb3e4f3ee Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Fri, 29 May 2026 12:08:11 +0800 Subject: [PATCH 0042/1400] fix(i18n): correct Brazilian Portuguese search label --- src/resources/dicts/pt-br.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/resources/dicts/pt-br.edn b/src/resources/dicts/pt-br.edn index 708400ad9432..cda14fd8acd7 100644 --- a/src/resources/dicts/pt-br.edn +++ b/src/resources/dicts/pt-br.edn @@ -982,7 +982,7 @@ :nav/invalid-jump-error "Salto inválido" :nav/journals "Diários" :nav/plugins "Plugins" - :nav/search "Produrar" + :nav/search "Buscar" :nav/settings "Configurações" :nav/skip-to-main-content "Pular para o conteúdo principal" :nav/tasks "Tarefas" From bc13d20dc6be5c8c1a5b834919ee393b5ad494ed Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 16:13:31 +0800 Subject: [PATCH 0043/1400] ci: add snap publishing for desktop releases --- .github/workflows/build-desktop-release.yml | 36 ++++++++++++++++++++- resources/electron-builder.yml | 4 +++ resources/package.json | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index ba9d405eb03c..a9f7b0e3f4a4 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -309,6 +309,40 @@ jobs: name: logseq-linux-arm64-builds path: builds + publish-linux-snap: + runs-on: ubuntu-22.04 + needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] + if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }} + steps: + - name: Download The Static Asset + uses: actions/download-artifact@v4 + with: + name: static + path: static + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.33.0 + + - name: Publish Snap (beta only) + run: | + if [ -z "${SNAPCRAFT_STORE_CREDENTIALS:-}" ]; then + echo "::error title=CheckFail::SNAPCRAFT_STORE_CREDENTIALS is required to publish beta snap" + exit 1 + fi + + pnpm install --frozen-lockfile + pnpm electron:publish-snap -- --config.snap.grade=devel --config.snap.publish.channels=beta + working-directory: ./static + env: + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} + build-windows-x64: runs-on: windows-latest needs: [ compile-cljs ] @@ -720,7 +754,7 @@ jobs: release: # NOTE: For now, we only have beta channel to be released on GitHub if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }} - needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] + needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, publish-linux-snap, build-windows-x64, build-windows-arm64 ] runs-on: ubuntu-22.04 steps: - name: Download MacOS x64 Artifacts diff --git a/resources/electron-builder.yml b/resources/electron-builder.yml index 2afb9ee73f8a..274a39c48625 100644 --- a/resources/electron-builder.yml +++ b/resources/electron-builder.yml @@ -59,3 +59,7 @@ linux: - zip mimeTypes: - x-scheme-handler/logseq + +snap: + publish: + provider: snapStore diff --git a/resources/package.json b/resources/package.json index e828abd60b8b..09aacd8724da 100644 --- a/resources/package.json +++ b/resources/package.json @@ -13,6 +13,7 @@ "electron:debug": "electron --inspect=9229 .", "electron:make": "electron-builder --config electron-builder.yml --publish never", "electron:make-linux-arm64": "electron-builder --config electron-builder.yml --linux AppImage zip --arm64 --publish never", + "electron:publish-snap": "electron-builder --config electron-builder.yml --linux snap --x64 --publish always", "electron:make-macos-arm64": "electron-builder --config electron-builder.yml --mac dmg zip --arm64 --publish never", "electron:make-win-arm64": "electron-builder --config electron-builder.yml --win nsis zip --arm64 --publish never", "electron:publish:github": "electron-builder --config electron-builder.yml --publish always", From 3801b4a4e3e4e28af4ebefca5fc3a56825610d34 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 16:14:27 +0800 Subject: [PATCH 0044/1400] ci: prepare desktop release workflow for stable releases --- .github/workflows/build-desktop-release.yml | 30 ++++++++++++++------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index a9f7b0e3f4a4..aae2214485b9 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -10,6 +10,8 @@ on: type: choice required: true options: + # NOTE: For now, we only have beta channel to be released on GitHub + # - stable - beta - nightly - non-release @@ -56,9 +58,9 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Check build options - if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'nightly' || github.event.inputs.build-target == 'beta') && github.event.inputs.git-ref != 'master' }} + if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'nightly' || github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') && github.event.inputs.git-ref != 'master' }} run: | - echo "::error title=CheckFail::Nightly and Beta Release MUST be built from master" + echo "::error title=CheckFail::Nightly, Beta and Stable Release MUST be built from master" exit 1 - name: Check out Git repository @@ -115,7 +117,7 @@ jobs: echo "version=$pkgver" >> $GITHUB_OUTPUT - name: Do Not Overwrite Existing Release - if: ${{ github.event.inputs.build-target == 'beta' }} + if: ${{ github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable' }} run: | if curl -f "https://api.github.com/repos/${{ github.repository }}/releases/tags/${{ steps.ref.outputs.version }}" &>/dev/null; then echo "::error title=CheckFail::Release already exists" @@ -312,7 +314,7 @@ jobs: publish-linux-snap: runs-on: ubuntu-22.04 needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }} + if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} steps: - name: Download The Static Asset uses: actions/download-artifact@v4 @@ -330,17 +332,26 @@ jobs: with: version: 10.33.0 - - name: Publish Snap (beta only) + - name: Publish Snap run: | if [ -z "${SNAPCRAFT_STORE_CREDENTIALS:-}" ]; then - echo "::error title=CheckFail::SNAPCRAFT_STORE_CREDENTIALS is required to publish beta snap" + echo "::error title=CheckFail::SNAPCRAFT_STORE_CREDENTIALS is required to publish snap" exit 1 fi + if [ "${BUILD_TARGET}" = "stable" ]; then + snap_grade=stable + snap_channel=stable + else + snap_grade=devel + snap_channel=beta + fi + pnpm install --frozen-lockfile - pnpm electron:publish-snap -- --config.snap.grade=devel --config.snap.publish.channels=beta + pnpm electron:publish-snap -- --config.snap.grade="${snap_grade}" --config.snap.publish.channels="${snap_channel}" working-directory: ./static env: + BUILD_TARGET: ${{ github.event.inputs.build-target }} SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} build-windows-x64: @@ -752,8 +763,7 @@ jobs: ./*.apk release: - # NOTE: For now, we only have beta channel to be released on GitHub - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.build-target == 'beta' }} + if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, publish-linux-snap, build-windows-x64, build-windows-arm64 ] runs-on: ubuntu-22.04 steps: @@ -823,7 +833,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: ${{ steps.ref.outputs.version }} - name: Desktop APP ${{ steps.ref.outputs.version }} (Beta Testing) + name: ${{ github.event.inputs.build-target == 'beta' && format('Desktop APP {0} (Beta Testing)', steps.ref.outputs.version) || format('Desktop APP {0}', steps.ref.outputs.version) }} body: "TODO: Fill this changelog. Sorry for the inconvenience!" draft: ${{ github.event.inputs.is-draft }} prerelease: ${{ github.event.inputs.is-pre-release }} From a53743fcbc9ddc9f92d525184a7fad44cd2d1099 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 16:33:39 +0800 Subject: [PATCH 0045/1400] ci: trigger Flathub release from desktop release workflow --- .github/workflows/build-desktop-release.yml | 29 +++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index aae2214485b9..8707da403bd0 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -847,3 +847,32 @@ jobs: ./*.blockmap ./*.AppImage ./*.apk + + - name: Trigger Flathub release + run: | + if [ -z "${FLATHUB_WORKFLOW_TOKEN:-}" ]; then + echo "::error title=CheckFail::FLATHUB_WORKFLOW_TOKEN is required to trigger Flathub release" + exit 1 + fi + + if [ "${BUILD_TARGET}" = "stable" ]; then + flathub_ref=master + else + flathub_ref=beta + fi + + payload=$(jq -n \ + --arg ref "$flathub_ref" \ + --arg version "$VERSION" \ + '{ref: $ref, inputs: {force: true, version: $version}}') + + curl -fsS -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${FLATHUB_WORKFLOW_TOKEN}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/flathub/com.logseq.Logseq/actions/workflows/update.yml/dispatches \ + -d "$payload" + env: + BUILD_TARGET: ${{ github.event.inputs.build-target }} + VERSION: ${{ steps.ref.outputs.version }} + FLATHUB_WORKFLOW_TOKEN: ${{ secrets.FLATHUB_WORKFLOW_TOKEN }} From 0d6c043f7417863cbfde916d089114ac0b879a5a Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 16:43:58 +0800 Subject: [PATCH 0046/1400] chore: update dependencies for linux snap publishing --- .github/workflows/build-desktop-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index 8707da403bd0..b2f26e6031c3 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -313,7 +313,7 @@ jobs: publish-linux-snap: runs-on: ubuntu-22.04 - needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] + needs: [ build-linux-x64, build-linux-arm64 ] if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} steps: - name: Download The Static Asset From 88d0832664a336b8cc7c240e618858da41d2a36a Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 17:05:59 +0800 Subject: [PATCH 0047/1400] fix(ci): generate snap config file instead of overriding via CLI args --- .github/workflows/build-desktop-release.yml | 12 +++++++++++- resources/electron-builder.yml | 4 ---- resources/package.json | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index b2f26e6031c3..283e88cc9ee0 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -347,8 +347,18 @@ jobs: snap_channel=beta fi + printf '%s\n' \ + 'extends: ./electron-builder.yml' \ + 'snap:' \ + " grade: ${snap_grade}" \ + ' publish:' \ + ' provider: snapStore' \ + ' channels:' \ + " - ${snap_channel}" \ + > electron-builder.snap.yml + pnpm install --frozen-lockfile - pnpm electron:publish-snap -- --config.snap.grade="${snap_grade}" --config.snap.publish.channels="${snap_channel}" + pnpm electron:publish-snap -- --config electron-builder.snap.yml working-directory: ./static env: BUILD_TARGET: ${{ github.event.inputs.build-target }} diff --git a/resources/electron-builder.yml b/resources/electron-builder.yml index 274a39c48625..2afb9ee73f8a 100644 --- a/resources/electron-builder.yml +++ b/resources/electron-builder.yml @@ -59,7 +59,3 @@ linux: - zip mimeTypes: - x-scheme-handler/logseq - -snap: - publish: - provider: snapStore diff --git a/resources/package.json b/resources/package.json index 09aacd8724da..532a49c14d34 100644 --- a/resources/package.json +++ b/resources/package.json @@ -13,7 +13,7 @@ "electron:debug": "electron --inspect=9229 .", "electron:make": "electron-builder --config electron-builder.yml --publish never", "electron:make-linux-arm64": "electron-builder --config electron-builder.yml --linux AppImage zip --arm64 --publish never", - "electron:publish-snap": "electron-builder --config electron-builder.yml --linux snap --x64 --publish always", + "electron:publish-snap": "electron-builder --linux snap --x64 --publish always", "electron:make-macos-arm64": "electron-builder --config electron-builder.yml --mac dmg zip --arm64 --publish never", "electron:make-win-arm64": "electron-builder --config electron-builder.yml --win nsis zip --arm64 --publish never", "electron:publish:github": "electron-builder --config electron-builder.yml --publish always", From e6bdd9f774cccd759c0553d19467f5e9d3d282cc Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 17:18:44 +0800 Subject: [PATCH 0048/1400] ci: align snap publish job with static artifact dependency --- .github/workflows/build-desktop-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index 283e88cc9ee0..110c80e53d46 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -313,7 +313,7 @@ jobs: publish-linux-snap: runs-on: ubuntu-22.04 - needs: [ build-linux-x64, build-linux-arm64 ] + needs: [ compile-cljs ] if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} steps: - name: Download The Static Asset From ea7ec123cd357848241739ec52804a4e14596568 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 17:24:00 +0800 Subject: [PATCH 0049/1400] ci: decouple snap publishing from GitHub release --- .github/workflows/build-desktop-release.yml | 108 ++++++++++---------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index 110c80e53d46..a0ee1b730adf 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -311,59 +311,6 @@ jobs: name: logseq-linux-arm64-builds path: builds - publish-linux-snap: - runs-on: ubuntu-22.04 - needs: [ compile-cljs ] - if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} - steps: - - name: Download The Static Asset - uses: actions/download-artifact@v4 - with: - name: static - path: static - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - - name: Set up pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.33.0 - - - name: Publish Snap - run: | - if [ -z "${SNAPCRAFT_STORE_CREDENTIALS:-}" ]; then - echo "::error title=CheckFail::SNAPCRAFT_STORE_CREDENTIALS is required to publish snap" - exit 1 - fi - - if [ "${BUILD_TARGET}" = "stable" ]; then - snap_grade=stable - snap_channel=stable - else - snap_grade=devel - snap_channel=beta - fi - - printf '%s\n' \ - 'extends: ./electron-builder.yml' \ - 'snap:' \ - " grade: ${snap_grade}" \ - ' publish:' \ - ' provider: snapStore' \ - ' channels:' \ - " - ${snap_channel}" \ - > electron-builder.snap.yml - - pnpm install --frozen-lockfile - pnpm electron:publish-snap -- --config electron-builder.snap.yml - working-directory: ./static - env: - BUILD_TARGET: ${{ github.event.inputs.build-target }} - SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} - build-windows-x64: runs-on: windows-latest needs: [ compile-cljs ] @@ -774,7 +721,7 @@ jobs: release: if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} - needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, publish-linux-snap, build-windows-x64, build-windows-arm64 ] + needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] runs-on: ubuntu-22.04 steps: - name: Download MacOS x64 Artifacts @@ -886,3 +833,56 @@ jobs: BUILD_TARGET: ${{ github.event.inputs.build-target }} VERSION: ${{ steps.ref.outputs.version }} FLATHUB_WORKFLOW_TOKEN: ${{ secrets.FLATHUB_WORKFLOW_TOKEN }} + + publish-linux-snap: + runs-on: ubuntu-22.04 + needs: [ release ] + if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} + steps: + - name: Download The Static Asset + uses: actions/download-artifact@v4 + with: + name: static + path: static + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10.33.0 + + - name: Publish Snap + run: | + if [ -z "${SNAPCRAFT_STORE_CREDENTIALS:-}" ]; then + echo "::error title=CheckFail::SNAPCRAFT_STORE_CREDENTIALS is required to publish snap" + exit 1 + fi + + if [ "${BUILD_TARGET}" = "stable" ]; then + snap_grade=stable + snap_channel=stable + else + snap_grade=devel + snap_channel=beta + fi + + printf '%s\n' \ + 'extends: ./electron-builder.yml' \ + 'snap:' \ + " grade: ${snap_grade}" \ + ' publish:' \ + ' provider: snapStore' \ + ' channels:' \ + " - ${snap_channel}" \ + > electron-builder.snap.yml + + pnpm install --frozen-lockfile + pnpm electron:publish-snap -- --config electron-builder.snap.yml + working-directory: ./static + env: + BUILD_TARGET: ${{ github.event.inputs.build-target }} + SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }} From a1d7c18bd23b58f320dbf9011358d87605900ed8 Mon Sep 17 00:00:00 2001 From: Mega Yu Date: Thu, 28 May 2026 17:36:08 +0800 Subject: [PATCH 0050/1400] ci: decouple Flathub dispatch from release job --- .github/workflows/build-desktop-release.yml | 24 ++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-desktop-release.yml b/.github/workflows/build-desktop-release.yml index a0ee1b730adf..f75314ae3447 100644 --- a/.github/workflows/build-desktop-release.yml +++ b/.github/workflows/build-desktop-release.yml @@ -723,6 +723,8 @@ jobs: if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} needs: [ build-macos-x64, build-macos-arm64, build-linux-x64, build-linux-arm64, build-windows-x64, build-windows-arm64 ] runs-on: ubuntu-22.04 + outputs: + version: ${{ steps.ref.outputs.version }} steps: - name: Download MacOS x64 Artifacts uses: actions/download-artifact@v4 @@ -805,6 +807,11 @@ jobs: ./*.AppImage ./*.apk + trigger-flathub-release: + runs-on: ubuntu-22.04 + needs: [ release ] + if: ${{ github.event_name == 'workflow_dispatch' && (github.event.inputs.build-target == 'beta' || github.event.inputs.build-target == 'stable') }} + steps: - name: Trigger Flathub release run: | if [ -z "${FLATHUB_WORKFLOW_TOKEN:-}" ]; then @@ -823,15 +830,26 @@ jobs: --arg version "$VERSION" \ '{ref: $ref, inputs: {force: true, version: $version}}') - curl -fsS -X POST \ + response=$(mktemp) + status=$(curl -sS -o "$response" -w "%{http_code}" -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer ${FLATHUB_WORKFLOW_TOKEN}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/flathub/com.logseq.Logseq/actions/workflows/update.yml/dispatches \ - -d "$payload" + -d "$payload") || status=000 + + echo "Flathub dispatch returned HTTP ${status}" + if [ -s "$response" ]; then + cat "$response" + fi + + if [ "$status" != "204" ]; then + echo "::error title=FlathubDispatchFailed::Failed to trigger Flathub release workflow" + exit 1 + fi env: BUILD_TARGET: ${{ github.event.inputs.build-target }} - VERSION: ${{ steps.ref.outputs.version }} + VERSION: ${{ needs.release.outputs.version }} FLATHUB_WORKFLOW_TOKEN: ${{ secrets.FLATHUB_WORKFLOW_TOKEN }} publish-linux-snap: From 2ecffff759e030d78e06eafd6e5bc3bf849cd039 Mon Sep 17 00:00:00 2001 From: Jarema Date: Mon, 1 Jun 2026 07:21:02 +0300 Subject: [PATCH 0051/1400] feat(i18n): add partial Vietnamese (vi) translation (#12752) * add partial Vietnamese (vi) translation * fix(i18n): remove function logic from vi.edn --- src/main/frontend/dicts.cljc | 2 + src/resources/dicts/vi.edn | 539 +++++++++++++++++++++++++++++++++++ 2 files changed, 541 insertions(+) create mode 100644 src/resources/dicts/vi.edn diff --git a/src/main/frontend/dicts.cljc b/src/main/frontend/dicts.cljc index 54ffcb8da58b..edd86dd6553e 100644 --- a/src/main/frontend/dicts.cljc +++ b/src/main/frontend/dicts.cljc @@ -51,6 +51,7 @@ :ko (edn-resource "dicts/ko.edn") :pl (edn-resource "dicts/pl.edn") :sk (edn-resource "dicts/sk.edn") + :vi (edn-resource "dicts/vi.edn") :uk (edn-resource "dicts/uk.edn") :fa (edn-resource "dicts/fa.edn") :id (edn-resource "dicts/id.edn") @@ -68,6 +69,7 @@ {:label "Afrikaans" :value :af} {:label "Català" :value :ca} {:label "Español" :value :es} + {:label "Tiếng Việt" :value :vi} {:label "Norsk (bokmål)" :value :nb-NO} {:label "Polski" :value :pl} {:label "Português (Brasileiro)" :value :pt-BR} diff --git a/src/resources/dicts/vi.edn b/src/resources/dicts/vi.edn new file mode 100644 index 000000000000..786e3bb88779 --- /dev/null +++ b/src/resources/dicts/vi.edn @@ -0,0 +1,539 @@ +{ + :account/authentication "Xác thực" + :account/benefits-desc "Với tài khoản Logseq, bạn có thể truy cập các dịch vụ đám mây như Logseq Sync và các tính năng alpha/beta." + :account/billing "Thanh toán" + :account/billing-expired-on-label "Gói Pro đã hết hạn vào: {1}" + :account/billing-expires-on-label "Gói Pro sẽ hết hạn vào: {1}" + :account/billing-next-date-label "Ngày thanh toán tiếp theo: {1}" + :account/core-features "Truy cập các tính năng cốt lõi của Logseq" + :account/current-plan "Gói hiện tại" + :account/delete-account "Xoá tài khoản" + :account/discover-sync-desc "Khám phá sức mạnh của {1}" + :account/early-access-alpha-beta "Truy cập sớm các tính năng alpha/beta" + :account/first-name "Tên" + :account/free-plan-sync-limit "1 đồ thị đồng bộ (tối đa 50MB, chỉ ghi chú)" + :account/last-name "Họ" + :account/manage-plan "Quản lý gói" + :account/month "tháng" + :account/no-asset-syncing "Không đồng bộ tệp đính kèm" + :account/open-invoices "Xem hoá đơn" + :account/plan-free "Miễn phí" + :account/plan-free-summary "Bắt đầu với đồng bộ cơ bản" + :account/plan-pro "Pro" + :account/plan-pro-summary "Mở khoá đồng bộ nâng cao và nhiều hơn nữa" + :account/pro-plan-sync-limit "10 đồ thị đồng bộ (tối đa 5GB mỗi đồ thị)" + :account/profile "Hồ sơ" + :account/refresh-token-warning "điều bất thường xảy ra khi làm mới token" + :account/reset-password "Đặt lại mật khẩu" + :account/sign-up "Đăng ký" + :account/sync-assets-limit "Đồng bộ tệp đính kèm tối đa 100MB mỗi tệp" + :account/synced-status "Đã đồng bộ" + :account/unlimited-unsynced-graphs "Không giới hạn đồ thị không đồng bộ" + :account/upcoming-cloud-features "Các tính năng đám mây sắp ra mắt, bao gồm Logseq Publish" + :account/upgrade-plan "Nâng cấp gói" + :account/username "Tên người dùng" + + :asset/acceptable-file-extensions "Định dạng tệp được chấp nhận" + :asset/add-assets "Thêm tệp đính kèm" + :asset/add-directory "Thêm thư mục" + :asset/alias-already-exists "Tên bí danh \"{1}\" đã tồn tại!" + :asset/alias-directories "Thư mục bí danh" + :asset/alias-directory-path-label "Đường dẫn thư mục:" + :asset/alias-name-dialog-title "Tên bí danh của thư mục được chọn là gì?" + :asset/alias-name-label "Tên bí danh:" + :asset/alias-name-placeholder "ví dụ: Sách" + :asset/align "Căn chỉnh" + :asset/align-center "Căn giữa" + :asset/align-left "Căn trái" + :asset/align-right "Căn phải" + :asset/already-exists "Tệp đính kèm đã tồn tại, tiêu đề: {1}, nút tham chiếu: [[{2}]]" + :asset/cannot-embed-parent-as-own-property "Không thể nhúng khối gốc làm thuộc tính của chính nó" + :asset/confirm-delete-image "Bạn có chắc muốn xoá hình ảnh này không?" + :asset/copy "Sao chép hình ảnh" + :asset/copy-image-unsupported-extension "Sao chép hình ảnh không được hỗ trợ với tệp {1}" + :asset/create-local-copy-warning "Đang tạo bản sao cục bộ từ tệp bên ngoài. Chú thích PDF yêu cầu tệp cục bộ để hoạt động đúng cách." + :asset/create-title "Tạo tệp đính kèm" + :asset/delete "Xoá hình ảnh" + :asset/downloading "Đang tải xuống" + :asset/drop-hint "Kéo và thả tệp vào đây, hoặc nhấp để chọn tệp" + :asset/edit-title "Chỉnh sửa tệp đính kèm" + :asset/external-url-label "URL bên ngoài của tệp đính kèm:" + :asset/file-extension-placeholder "ví dụ: mp3" + :asset/maximize "Phóng to hình ảnh" + :asset/open-in-browser "Mở hình ảnh trong trình duyệt" + :asset/physical-delete "Xoá cả tệp (lưu ý không thể khôi phục)" + :asset/picker-empty "Không tìm thấy tệp đính kèm" + :asset/picker-empty-hint "Thêm tệp đính kèm để chọn ở đây." + :asset/picker-fallback-type "tệp" + :asset/picker-open "Chọn tệp đính kèm" + :asset/picker-set-failed "Không thể đặt thuộc tính tệp đính kèm" + :asset/ref-block "Khối tham chiếu tệp đính kèm" + :asset/select-file "Chọn tệp đính kèm" + :asset/select-from-disk "Chọn từ ổ đĩa" + :asset/selected-directories "Thư mục đã chọn:" + :asset/show-file-in-folder "Hiện tệp trong thư mục" + :asset/size-too-large "Kích thước tệp không được vượt quá 100MB" + :asset/syncing "Đang đồng bộ" + :asset/title-label "Tiêu đề tệp đính kèm:" + :asset/transfer-placeholder "{1} tệp đính kèm..." + :asset/uploading "Đang tải lên" + + :block/click-to-fix-query "Nhấp để sửa truy vấn: {1}" + :block/copy-ref "Sao chép tham chiếu khối" + :block/copy-url "Sao chép URL khối" + :block/created-label "Tạo lúc: {1}" + :block/deprecated-latex-export "'#+BEGIN_EXPORT latex' đã lỗi thời. Hãy dùng lệnh '/Math block' thay thế." + :block/deprecated-query-syntax "#+BEGIN_QUERY đã lỗi thời. Hãy dùng lệnh '/Advanced Query' thay thế." + :block/deprecated-quote "#+BEGIN_QUOTE đã lỗi thời. Hãy dùng lệnh '/Quote' thay thế." + :block/empty-url "URL trống" + :block/excalidraw-no-longer-supported "Excalidraw không còn được hỗ trợ mặc định, chúng tôi dự định hỗ trợ thông qua plugin." + :block/extraction-error "Đã xảy ra lỗi không mong đợi khi trích xuất khối." + :block/hide-query "Ẩn truy vấn" + :block/invalid-hiccup "Hiccup không hợp lệ" + :block/invalid-link "Liên kết không hợp lệ" + :block/invalid-url "URL không hợp lệ" + :block/large-block-warning "Khối lớn sẽ không thể chỉnh sửa hoặc tìm kiếm để tránh làm chậm ứng dụng, hãy dùng trình soạn thảo khác để chỉnh sửa khối này." + :block/last-edited-label "Chỉnh sửa lần cuối: {1}" + :block/not-found-warning "Không tìm thấy khối" + :block/open-block-references "Mở tham chiếu khối" + :block/practice "Ôn tập" + :block/practice-cards "Thẻ ôn tập" + :block/remove-tag "Xoá thẻ" + :block/remove-this-tag "Xoá thẻ này" + :block/render-error "Lỗi hiển thị khối:" + :block/retry-plugin-renderer "Thử lại trình kết xuất plugin" + :block/set-query "Đặt truy vấn" + :block/set-query-label "Đặt truy vấn:" + :block/sort-order "Thứ tự sắp xếp" + :block/status-history "Lịch sử trạng thái" + :block/switch-to-outline-view "Chuyển sang chế độ đề cương" + :block/switch-to-plugin-renderer "Chuyển sang trình kết xuất plugin" + :block/untitled-query "Truy vấn chưa đặt tên" + + :block.comments/add-comment "Thêm bình luận" + :block.comments/add-comment-command-desc "Thêm bình luận vào khối này." + :block.comments/collapsed-summary "{1} bình luận · mới nhất từ {2}" + :block.comments/date-at-time "{1} lúc {2}" + :block.comments/label "Bình luận" + :block.comments/on-those-blocks "Trên các khối đó" + :block.comments/placeholder "Trả lời..." + :block.comments/save-error "Không thể lưu bình luận." + :block.comments/yesterday-at "Hôm qua lúc {1}" + + :block.macro/embed-deprecated "{{embed}} đã lỗi thời. Hãy dùng lệnh '/Node embed' thay thế." + :block.macro/namespace-deprecated "{{namespace}} đã lỗi thời. Hãy dùng tính năng {1} thay thế." + :block.macro/query-deprecated "{{query}} đã lỗi thời. Hãy dùng lệnh '/Query' thay thế." + :block.macro/unsupported-name "Tên macro không được hỗ trợ: {1}" + + :block.reaction/emoji-required-warning "Vui lòng chọn một emoji phản ứng." + :block.reaction/unsupported-emoji-warning "Emoji phản ứng không được hỗ trợ." + + :breadcrumb/more-ancestors "Hiện thêm cấp trên" + + :bug-report/desc "Bạn có thể giúp chúng tôi bằng cách gửi báo cáo lỗi không? Chúng tôi sẽ xử lý sớm nhất có thể." + :bug-report/title "Báo cáo lỗi" + + :bug-report.clipboard/action-desc "Kiểm tra và thu thập dữ liệu bảng nhớ tạm" + :bug-report.clipboard/action-title "Công cụ hỗ trợ bảng nhớ tạm" + :bug-report.clipboard/desc "Bạn có thể dùng các công cụ tiện lợi này để cung cấp thêm thông tin cho chúng tôi." + :bug-report.clipboard/title "Lỗi bạn gặp phải có liên quan đến các tính năng này không?" + + :bug-report.inspector/back "Quay lại" + :bug-report.inspector/clipboard-desc "Đây là dữ liệu đọc từ bảng nhớ tạm." + :bug-report.inspector/copied "Đã sao chép vào bảng nhớ tạm!" + :bug-report.inspector/copy "Sao chép kết quả" + :bug-report.inspector/copy-desc "Nếu bạn không phiền chia sẻ nội dung này, hãy nhấn nút sao chép." + :bug-report.inspector/create-issue "Tạo báo cáo lỗi" + :bug-report.inspector/create-issue-desc "Bây giờ bạn có thể báo cáo kết quả đã sao chép vào bảng nhớ tạm. Hãy dán kết quả vào phần 'Additional Context' và ghi rõ nội dung gốc được sao chép từ đâu. Cảm ơn bạn nhiều!" + :bug-report.inspector/desc "Nhấn {1} để kiểm tra dữ liệu bảng nhớ tạm\nhoặc nhấp vào đây để dán nếu bạn đang dùng phiên bản di động" + :bug-report.inspector/placeholder "Nhấn giữ ở đây để dán nếu bạn đang dùng thiết bị di động" + :bug-report.inspector/tip "Có gì đó không đúng? Không sao, nhấp để quay lại bước trước." + :bug-report.inspector/title "Công cụ kiểm tra dữ liệu bảng nhớ tạm" + + :bug-report.issue/action-desc "Giúp Logseq tốt hơn!" + :bug-report.issue/action-title "Gửi báo cáo lỗi" + :bug-report.issue/desc "Nếu không có công cụ nào giúp bạn thu thập thêm thông tin, hãy gửi báo cáo lỗi trực tiếp." + :bug-report.issue/report-link "Báo cáo sự cố" + :bug-report.issue/title "Hoặc..." + + :class/add-property "Thêm thuộc tính thẻ" + :class/tag-properties-desc "Thuộc tính thẻ được kế thừa bởi tất cả các nút sử dụng thẻ đó. Ví dụ mỗi nút #Task kế thừa 'Trạng thái' và 'Ưu tiên'." + :class/tagged-nodes "Các nút được gắn thẻ" + + :class.built-in/asset "Tệp đính kèm" + :class.built-in/card "Thẻ" + :class.built-in/cards "Các thẻ" + :class.built-in/code-block "Mã nguồn" + :class.built-in/comments "Bình luận" + :class.built-in/journal "Nhật ký" + :class.built-in/math-block "Toán" + :class.built-in/page "Trang" + :class.built-in/pdf-annotation "Chú thích PDF" + :class.built-in/property "Thuộc tính" + :class.built-in/query "Truy vấn" + :class.built-in/quote-block "Trích dẫn" + :class.built-in/root "Thẻ gốc" + :class.built-in/tag "Thẻ" + :class.built-in/task "Nhiệm vụ" + :class.built-in/template "Mẫu" + :class.built-in/whiteboard "Bảng trắng" + + :class.validation/built-in-extends-change "Không thể thay đổi phần mở rộng của thẻ tích hợp sẵn." + :class.validation/cant-add-tag-on-built-in "Không thể thêm thẻ vào mục tích hợp sẵn \"{1}\"." + :class.validation/cant-remove-private-tags "Không thể xoá thẻ riêng tư: {1}." + :class.validation/cant-remove-tag-built-in "Không thể xoá thẻ với mục tích hợp sẵn #{1}." + :class.validation/cant-remove-tag-on-built-in "Không thể xoá thẻ khỏi mục tích hợp sẵn \"{1}\"." + :class.validation/cant-set-tag-built-in "Không thể đặt thẻ với mục tích hợp sẵn #{1}." + :class.validation/duplicate "Một thẻ khác tên \"{1}\" đã tồn tại." + :class.validation/extends-cycle "Vòng lặp kế thừa thẻ." + :class.validation/invalid-extends-type "Không thể mở rộng trang này vì nó không phải là thẻ hoặc đang kế thừa từ một trang không phải thẻ." + :class.validation/parents-must-be-tags "Không thể tạo thẻ này trừ khi tất cả các cấp trên đều là thẻ." + :class.validation/tag-with-non-tag "Không thể đặt thẻ với trang tích hợp sẵn không phải là thẻ \"{1}\"." + + :cmdk.action/apply-theme "Áp dụng chủ đề" + :cmdk.action/copy-ref "Sao chép tham chiếu" + :cmdk.action/create "Tạo" + :cmdk.action/filter "Lọc" + :cmdk.action/open "Mở" + :cmdk.action/open-in-sidebar "Mở trong thanh bên" + :cmdk.action/search "Tìm kiếm" + :cmdk.action/trigger "Kích hoạt" + + :cmdk.create/configure-tag "Cấu hình thẻ" + :cmdk.create/page "Tạo trang" + :cmdk.create/tag "Tạo thẻ" + + :cmdk.error/no-block-link "Không tìm thấy liên kết trong nội dung khối này." + :cmdk.error/no-page-link "Không tìm thấy liên kết trong thuộc tính trang này." + :cmdk.error/no-search-item-link "Không có liên kết cho mục tìm kiếm này." + + :cmdk.filter/add "Thêm bộ lọc vào tìm kiếm" + :cmdk.filter/codes "Chỉ tìm kiếm mã nguồn" + :cmdk.filter/commands "Chỉ tìm kiếm lệnh" + :cmdk.filter/current-page "Chỉ tìm kiếm trang hiện tại" + :cmdk.filter/files "Chỉ tìm kiếm tệp" + :cmdk.filter/nodes "Chỉ tìm kiếm nút" + :cmdk.filter/only-label "Chỉ tìm kiếm:" + :cmdk.filter/themes "Chỉ tìm kiếm chủ đề" + + :cmdk.group/codes "Mã nguồn" + :cmdk.group/commands "Lệnh" + :cmdk.group/create "Tạo" + :cmdk.group/current-page "Trang hiện tại" + :cmdk.group/files "Tệp" + :cmdk.group/filters "Bộ lọc" + :cmdk.group/nodes "Các nút" + :cmdk.group/recently-updated "Cập nhật gần đây" + :cmdk.group/themes "Chủ đề" + + :cmdk.info/configure-tag "Cấu hình #{1}" + :cmdk.info/create-page "Tạo trang có tên '{1}'" + :cmdk.info/create-tag "Tạo thẻ có tên '{1}'" + + :cmdk.input/default-placeholder "Bạn đang tìm kiếm gì?" + :cmdk.input/move-blocks-placeholder "Di chuyển khối đến" + :cmdk.input/type-page-name-placeholder "Nhập tên trang để tạo" + + :cmdk.tip/clear-filter "Nhấn {1} để xoá bộ lọc tìm kiếm" + :cmdk.tip/filter-results "Nhấn {1} để lọc kết quả tìm kiếm" + :cmdk.tip/label "Mẹo:" + :cmdk.tip/open-sidebar "Nhấn {1} để mở tìm kiếm trong thanh bên" + + :collaboration/email-address "Địa chỉ email" + :collaboration/invite "Mời" + :collaboration/members "Thành viên:" + :collaboration/remove-access "Xoá quyền truy cập" + :collaboration/remove-access-error "Không thể xoá thành viên." + + :color/blue "Xanh dương" + :color/crimson "Đỏ thẫm" + :color/cyan "Xanh lam" + :color/grass "Xanh lá" + :color/gray "Xám" + :color/green "Xanh lục" + :color/indigo "Chàm" + :color/orange "Cam" + :color/pink "Hồng" + :color/plum "Mận" + :color/purple "Tím" + :color/red "Đỏ" + :color/teal "Xanh mòng két" + :color/tomato "Đỏ cà chua" + :color/violet "Tím hoa cà" + :color/yellow "Vàng" + + :command.auto-complete/complete "Tự động hoàn thành: Chọn mục đang được chọn" + :command.auto-complete/meta-complete "Tự động hoàn thành: Cmd + Enter để chọn mục đang được chọn" + :command.auto-complete/next "Tự động hoàn thành: Chọn mục tiếp theo" + :command.auto-complete/prev "Tự động hoàn thành: Chọn mục trước" + :command.auto-complete/shift-complete "Tự động hoàn thành: Mở mục được chọn trong thanh bên" + + :command.command-palette/toggle "Tìm kiếm lệnh" + + :command.editor/add-comment "Thêm bình luận" + :command.editor/add-property "Thêm thuộc tính" + :command.editor/add-property-deadline "Thêm hạn chót nhiệm vụ vào khối được chọn" + :command.editor/add-property-icon "Thêm biểu tượng" + :command.editor/add-property-priority "Thêm độ ưu tiên nhiệm vụ vào khối được chọn" + :command.editor/add-property-status "Thêm trạng thái nhiệm vụ vào khối được chọn" + :command.editor/add-reaction "Thêm phản ứng" + :command.editor/backspace "Backspace / Xoá về phía sau" + :command.editor/backward-kill-word "Xoá một từ về phía sau" + :command.editor/backward-word "Di chuyển con trỏ lùi một từ" + :command.editor/beginning-of-block "Di chuyển con trỏ đến đầu khối" + :command.editor/bold "In đậm" + :command.editor/clear-block "Xoá toàn bộ nội dung khối" + :command.editor/collapse-block-children "Thu gọn" + :command.editor/copy "Sao chép (sao chép vùng chọn hoặc tham chiếu khối)" + :command.editor/copy-embed "Sao chép nhúng khối trỏ đến khối hiện tại" + :command.editor/copy-page-url "Sao chép URL trang" + :command.editor/copy-text "Sao chép vùng chọn dưới dạng văn bản" + :command.editor/cut "Cắt" + :command.editor/cycle-todo "Xoay vòng trạng thái TODO" + :command.editor/delete "Xoá / Xoá về phía trước" + :command.editor/delete-selection "Xoá các khối được chọn" + :command.editor/down "Di chuyển con trỏ xuống / Chọn xuống" + :command.editor/end-of-block "Di chuyển con trỏ đến cuối khối" + :command.editor/escape-editing "Thoát chỉnh sửa" + :command.editor/expand-block-children "Mở rộng" + :command.editor/follow-link "Theo liên kết dưới con trỏ" + :command.editor/forward-kill-word "Xoá một từ về phía trước" + :command.editor/forward-word "Di chuyển con trỏ tiến một từ" + :command.editor/highlight "Đánh dấu" + :command.editor/indent "Thụt lề khối" + :command.editor/insert-link "Liên kết HTML" + :command.editor/insert-youtube-timestamp "Chèn mốc thời gian YouTube" + :command.editor/italics "In nghiêng" + :command.editor/jump "Nhảy đến khoá hoặc giá trị thuộc tính" + :command.editor/kill-line-after "Xoá dòng sau vị trí con trỏ" + :command.editor/kill-line-before "Xoá dòng trước vị trí con trỏ" + :command.editor/left "Di chuyển con trỏ sang trái / Mở khối được chọn từ đầu" + :command.editor/move-block-down "Di chuyển khối xuống" + :command.editor/move-block-up "Di chuyển khối lên" + :command.editor/move-blocks "Di chuyển khối đến" + :command.editor/new-block "Tạo khối mới" + :command.editor/new-line "Dòng mới trong khối hiện tại" + :command.editor/open-edit "Chỉnh sửa khối được chọn" + :command.editor/open-link-in-sidebar "Mở liên kết trong thanh bên" + :command.editor/open-selected-blocks-in-sidebar "Mở (các) khối được chọn trong thanh bên" + :command.editor/outdent "Giảm thụt lề khối" + :command.editor/paste-text-in-one-block-at-point "Dán văn bản vào một khối tại vị trí con trỏ" + :command.editor/quick-add "Thêm nhanh" + :command.editor/redo "Làm lại" + :command.editor/right "Di chuyển con trỏ sang phải / Mở khối được chọn từ cuối" + :command.editor/select-all-blocks "Chọn tất cả khối" + :command.editor/select-block-down "Chọn khối bên dưới" + :command.editor/select-block-up "Chọn khối bên trên" + :command.editor/select-down "Chọn nội dung bên dưới" + :command.editor/select-parent "Chọn khối cha" + :command.editor/select-up "Chọn nội dung bên trên" + :command.editor/set-tags "Đặt thẻ cho (các) khối được chọn" + :command.editor/strike-through "Gạch ngang" + :command.editor/toggle-block-children "Chuyển đổi mở rộng/thu gọn" + :command.editor/toggle-display-hidden-properties "Chuyển đổi hiển thị thuộc tính ẩn" + :command.editor/toggle-number-list "Chuyển đổi danh sách có số" + :command.editor/toggle-open-blocks "Chuyển đổi mở khối (thu gọn hoặc mở rộng tất cả khối)" + :command.editor/undo "Hoàn tác" + :command.editor/up "Di chuyển con trỏ lên / Chọn lên" + :command.editor/zoom-in "Phóng to khối đang chỉnh sửa / Tiến về phía trước khi không chỉnh sửa" + :command.editor/zoom-out "Thu nhỏ khối đang chỉnh sửa / Lùi về phía sau khi không chỉnh sửa" + + :command.go/all-graphs "Đi đến tất cả đồ thị" + :command.go/all-pages "Đi đến tất cả trang" + :command.go/backward "Quay lại" + :command.go/electron-find-in-page "Tìm văn bản trong trang" + :command.go/electron-jump-to-the-next "Nhảy đến kết quả khớp tiếp theo trong thanh tìm kiếm" + :command.go/electron-jump-to-the-previous "Nhảy đến kết quả khớp trước trong thanh tìm kiếm" + :command.go/flashcards "Chuyển đổi thẻ ghi nhớ" + :command.go/forward "Tiến" + :command.go/graph-view "Đi đến chế độ xem đồ thị" + :command.go/home "Đi đến trang chủ" + :command.go/journals "Đi đến nhật ký" + :command.go/keyboard-shortcuts "Đi đến phím tắt" + :command.go/next-journal "Đi đến nhật ký tiếp theo" + :command.go/prev-journal "Đi đến nhật ký trước" + :command.go/search "Tìm kiếm trang và khối" + :command.go/search-in-page "Tìm kiếm khối trong trang" + :command.go/search-themes "Tìm kiếm chủ đề" + :command.go/tomorrow "Đi đến ngày mai" + + :command.graph/add "Thêm đồ thị" + :command.graph/db-add "Thêm đồ thị cơ sở dữ liệu" + :command.graph/db-save "Lưu cơ sở dữ liệu hiện tại ra ổ đĩa (~/logseq/graphs/your-current-graph)" + :command.graph/export-as-html "Xuất các trang đồ thị công khai dưới dạng HTML" + :command.graph/open "Chọn đồ thị để mở" + :command.graph/remove "Xoá đồ thị" + + :command.misc/copy "Sao chép" + :command.misc/export-block-data "Xuất dữ liệu EDN khối" + :command.misc/export-graph-ontology-data "Xuất dữ liệu EDN thẻ và thuộc tính của đồ thị" + :command.misc/export-page-data "Xuất dữ liệu EDN trang" + :command.misc/import-edn-data "Nhập dữ liệu EDN" + + :command.page/toggle-favorite "Thêm vào/xoá khỏi mục yêu thích" + + :command.pdf/close "PDF: Đóng tài liệu PDF hiện tại" + :command.pdf/find "PDF: Tìm kiếm văn bản trong tài liệu PDF hiện tại" + :command.pdf/next-page "PDF: Trang tiếp theo của tài liệu PDF hiện tại" + :command.pdf/previous-page "PDF: Trang trước của tài liệu PDF hiện tại" + + :command.publish/open-dialog "Mở hộp thoại xuất bản cho trang hiện tại" + + :command.search/re-index "Xây dựng lại chỉ mục tìm kiếm" + + :command.shell/run "Chạy lệnh git" + + :command.sidebar/clear "Xoá tất cả trong thanh bên phải" + :command.sidebar/close-top "Đóng mục trên cùng trong thanh bên phải" + :command.sidebar/open-today-page "Mở trang hôm nay trong thanh bên phải" + + :command.ui/clear-all-notifications "Xoá tất cả thông báo" + :command.ui/customize-appearance "Tuỳ chỉnh giao diện" + :command.ui/goto-plugins "Đi đến bảng điều khiển plugin" + :command.ui/highlight-recent-blocks "Chuyển đổi đánh dấu khối gần đây" + :command.ui/install-plugin-from-github "Cài đặt plugin từ bản phát hành GitHub" + :command.ui/install-plugins-from-file "Cài đặt plugin từ plugins.edn" + :command.ui/select-theme-color "Chọn màu chủ đề có sẵn" + :command.ui/toggle-brackets "Chuyển đổi hiển thị dấu ngoặc" + :command.ui/toggle-contents "Chuyển đổi mục lục trong thanh bên" + :command.ui/toggle-document-mode "Chuyển đổi chế độ tài liệu" + :command.ui/toggle-help "Chuyển đổi trợ giúp" + :command.ui/toggle-left-sidebar "Chuyển đổi thanh bên trái" + :command.ui/toggle-right-sidebar "Chuyển đổi thanh bên phải" + :command.ui/toggle-settings "Chuyển đổi cài đặt" + :command.ui/toggle-theme "Chuyển đổi giữa chủ đề tối/sáng" + :command.ui/toggle-wide-mode "Chuyển đổi chế độ rộng" + + :command.window/close "Đóng cửa sổ" + + :context-menu/developer-tools "Công cụ nhà phát triển" + :context-menu/make-a-flashcard "Tạo thẻ ghi nhớ" + :context-menu/set-icon "Đặt biểu tượng" + :context-menu/toggle-number-list "Chuyển đổi danh sách có số" + + :date/invalid-date-warning "{1} không phải ngày hợp lệ. Vui lòng thử lại" + + :date.nlp/last-friday "Thứ Sáu tuần trước" + :date.nlp/last-monday "Thứ Hai tuần trước" + :date.nlp/last-month "Tháng trước" + :date.nlp/last-saturday "Thứ Bảy tuần trước" + :date.nlp/last-sunday "Chủ Nhật tuần trước" + :date.nlp/last-thursday "Thứ Năm tuần trước" + :date.nlp/last-tuesday "Thứ Ba tuần trước" + :date.nlp/last-wednesday "Thứ Tư tuần trước" + :date.nlp/last-week "Tuần trước" + :date.nlp/last-year "Năm ngoái" + :date.nlp/next-friday "Thứ Sáu tuần sau" + :date.nlp/next-monday "Thứ Hai tuần sau" + :date.nlp/next-month "Tháng sau" + :date.nlp/next-saturday "Thứ Bảy tuần sau" + :date.nlp/next-sunday "Chủ Nhật tuần sau" + :date.nlp/next-thursday "Thứ Năm tuần sau" + :date.nlp/next-tuesday "Thứ Ba tuần sau" + :date.nlp/next-wednesday "Thứ Tư tuần sau" + :date.nlp/next-week "Tuần sau" + :date.nlp/next-year "Năm sau" + :date.nlp/this-friday "Thứ Sáu này" + :date.nlp/this-monday "Thứ Hai này" + :date.nlp/this-month "Tháng này" + :date.nlp/this-saturday "Thứ Bảy này" + :date.nlp/this-sunday "Chủ Nhật này" + :date.nlp/this-thursday "Thứ Năm này" + :date.nlp/this-tuesday "Thứ Ba này" + :date.nlp/this-wednesday "Thứ Tư này" + :date.nlp/this-week "Tuần này" + :date.nlp/this-year "Năm nay" + :date.nlp/today "Hôm nay" + :date.nlp/tomorrow "Ngày mai" + :date.nlp/yesterday "Hôm qua" + + :deeplink/open-block-error "Mở liên kết thất bại. Block-id `{1}` không tồn tại trong đồ thị." + :deeplink/open-graph-error "Mở đồ thị thất bại. Đồ thị `{1}` không tồn tại." + :deeplink/open-page-error "Mở liên kết thất bại. Trang `{1}` không tồn tại trong đồ thị." + + :editor/add-content-first-warning "Vui lòng thêm nội dung trước." + :editor/auto-heading "Tiêu đề tự động" + :editor/block-search "Tìm kiếm khối" + :editor/click-to-edit "Nhấp để chỉnh sửa" + :editor/code-language-placeholder "Chọn ngôn ngữ" + :editor/collapse-block-children "Thu gọn tất cả" + :editor/cut "Cắt" + :editor/cycle-todo "Xoay vòng trạng thái TODO" + :editor/delete-selection "Xoá các khối được chọn" + :editor/display-tag-inline-hint "để hiển thị thẻ này cùng dòng thay vì ở cuối nút này." + :editor/expand-block-children "Mở rộng tất cả" + :editor/heading "Tiêu đề {1}" + :editor/moving-blocks-count "Đang di chuyển {1} khối" + :editor/new-page "Trang mới" + :editor/new-tag "Thẻ mới" + :editor/no-block-selected-warning "Không có khối nào được chọn, vui lòng chọn khối trước." + :editor/paste "Dán" + :editor/reference-node-use-page-ref "Để tham chiếu một nút, hãy dùng `[[]]`." + :editor/remove-heading "Xoá tiêu đề" + :editor/search-for-node "Tìm kiếm nút" + :editor/search-for-tag "Tìm kiếm thẻ" + :editor/search-template-placeholder "Tìm kiếm mẫu" + :editor/template-insert-error "Lỗi chèn mẫu: {1}" + + :editor.document-mode/new-block-hint "{1} để tạo khối mới" + :editor.document-mode/title "Chế độ tài liệu" + :editor.document-mode/toggle-desc "Nhấp `D` hoặc nhập {1} để chuyển đổi chế độ tài liệu" + + :editor.quick-add/add-to-today "Thêm vào hôm nay" + :editor.quick-add/title "Thêm nhanh" + + :editor.slash/advanced-query "Truy vấn nâng cao" + :editor.slash/advanced-query-desc "Tạo khối truy vấn nâng cao" + :editor.slash/calculator "Máy tính" + :editor.slash/calculator-desc "Chèn máy tính" + :editor.slash/cloze "Cloze" + :editor.slash/code-block "Khối mã nguồn" + :editor.slash/code-block-desc "Chèn khối mã nguồn" + :editor.slash/current-time "Thời gian hiện tại" + :editor.slash/current-time-desc "Chèn thời gian hiện tại" + :editor.slash/date-picker "Chọn ngày" + :editor.slash/date-picker-desc "Chọn một ngày và chèn vào đây" + :editor.slash/embed-html "Nhúng HTML" + :editor.slash/embed-twitter-tweet "Nhúng bài đăng Twitter" + :editor.slash/embed-video-url "Nhúng URL video" + :editor.slash/embed-youtube-timestamp "Nhúng mốc thời gian YouTube" + :editor.slash/group-advanced "NÂNG CAO" + :editor.slash/group-basic "CƠ BẢN" + :editor.slash/group-format "ĐỊNH DẠNG" + :editor.slash/group-heading "Tiêu đề" + :editor.slash/group-list-type "KIỂU DANH SÁCH" + :editor.slash/group-plugins "PLUGIN" + :editor.slash/group-priority "ƯU TIÊN" + :editor.slash/group-task-date "NGÀY NHIỆM VỤ" + :editor.slash/group-task-status "TRẠNG THÁI NHIỆM VỤ" + :editor.slash/group-time-and-date "THỜI GIAN & NGÀY" + :editor.slash/heading-label "Tiêu đề {1}" + :editor.slash/image-link "Liên kết hình ảnh" + :editor.slash/image-link-desc "Tạo liên kết HTTP đến hình ảnh" + :editor.slash/link-desc "Tạo liên kết HTTP" + :editor.slash/math-block "Khối toán học" + :editor.slash/math-block-desc "Tạo khối LaTeX" + :editor.slash/no-priority "Không có ưu tiên" + :editor.slash/node-embed "Nhúng nút" + :editor.slash/node-embed-desc "Nhúng một nút vào đây" + :editor.slash/node-reference "Tham chiếu nút" + :editor.slash/node-reference-desc "Tạo liên kết ngược đến một nút (trang hoặc khối)" + :editor.slash/normal-text "Văn bản thường" + :editor.slash/normal-text-desc "Xoá tiêu đề và đặt lại văn bản thường" + :editor.slash/number-children "Đánh số các con" + :editor.slash/number-list "Danh sách có số" + :editor.slash/priority-desc "Đặt ưu tiên thành {1}" + :editor.slash/priority-label "Ưu tiên {1}" + :editor.slash/query-function "Hàm truy vấn" + :editor.slash/query-function-desc "Tạo hàm truy vấn" + :editor.slash/quote-desc "Tạo khối trích dẫn" + :editor.slash/status-desc "Đặt trạng thái thành {1}" + :editor.slash/template-desc "Chèn mẫu đã tạo vào đây" + :editor.slash/today-desc "Chèn ngày hôm nay" + :editor.slash/tomorrow-desc "Chèn ngày mai" + :editor.slash/underline "Gạch dưới" + :editor.slash/underline-desc "Tạo định dạng gạch dưới cho văn bản" + :editor.slash/upload-asset "Tải lên tệp đính kèm" + :editor.slash/upload-asset-desc "Tải lên các loại tệp như hình ảnh, PDF, DOCX, v.v." + :editor.slash/yesterday-desc "Chèn ngày hôm qua" +} From 2663d7b70a093bd7c0796a434c086d92bfcc3ca1 Mon Sep 17 00:00:00 2001 From: benjypng <47936793+benjypng@users.noreply.github.com> Date: Mon, 1 Jun 2026 15:00:28 +0800 Subject: [PATCH 0052/1400] fix: use callable APIs instead of exper_request (#12753) --- libs/src/modules/LSPlugin.Net.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libs/src/modules/LSPlugin.Net.ts b/libs/src/modules/LSPlugin.Net.ts index 08e36c1aa66e..4e4f969a13ed 100644 --- a/libs/src/modules/LSPlugin.Net.ts +++ b/libs/src/modules/LSPlugin.Net.ts @@ -455,9 +455,8 @@ export class LSPluginNet { } const abortable = Boolean(options.abortable || options.signal) - // TODO: instead exper_request of callable apis - const reqId = this._ctx.Experiments.invokeExperMethod( - 'request', + const reqId = await this._ctx._execCallableAPIAsync( + 'exper_request', this._ctx.baseInfo.id, { url: options.url, From 69cb8a96a5037f2f41c20d584578beb5a678d611 Mon Sep 17 00:00:00 2001 From: megayu Date: Mon, 1 Jun 2026 16:19:36 +0800 Subject: [PATCH 0053/1400] enhance: reduce desktop release package size (#12754) * chore: skip development react assets in release * chore: prune mobile assets from desktop package * chore: filter non-runtime files from desktop package * chore: exclude publishing build from desktop package * chore: exclude duplicate sqlite wasm from desktop package * chore: keep only woff2 tabler font in desktop package * chore: exclude development react files from desktop package * chore: exclude node module sources from desktop package * chore: use supported appimage toolset * chore: keep publishing runtime scripts in desktop package * fix: export publishing assets without source maps * fix: trim publishing export assets * fix: guard stale desktop worker bundle * fix: preserve missing runtime file error --- .../src/logseq/publishing/export.cljs | 17 ++++++---- .../test/logseq/publishing/export_test.cljs | 10 +++++- gulpfile.js | 29 ++++++++++++----- resources/electron-builder.yml | 32 ++++++++++++++++++- scripts/prepare-desktop-runtime-js.mjs | 18 +++++++++++ 5 files changed, 90 insertions(+), 16 deletions(-) diff --git a/deps/publishing/src/logseq/publishing/export.cljs b/deps/publishing/src/logseq/publishing/export.cljs index 0bff45a96cd3..b2799cb2fb6c 100644 --- a/deps/publishing/src/logseq/publishing/export.cljs +++ b/deps/publishing/src/logseq/publishing/export.cljs @@ -8,14 +8,18 @@ (def ^:api js-files "js files from publishing release build" - (->> ["main.js" "code-editor.js"] - ;; Add source maps for all js files as it doesn't affect initial load time - (mapcat #(vector % (str % ".map"))) - vec)) + ["main.js" "code-editor.js"]) (def ^:api static-dirs "dirs under static dir to copy over" - ["css" "fonts" "icons" "img" "js"]) + ["css" "icons" "img" "js"]) + +(defn- remove-js-source-maps + [output-static-dir] + (let [js-dir (node-path/join output-static-dir "js")] + (doseq [file (fs/readdirSync js-dir)] + (when (.endsWith file ".map") + (fs/rmSync (node-path/join js-dir file) #js {:force true}))))) (defn- default-notification [msg] @@ -27,7 +31,8 @@ "Moves used js files to the correct dir and removes unused js files" [output-static-dir source-static-dir {:keys [dev?]}] (let [publishing-dir (node-path/join output-static-dir "js" "publishing")] - (p/let [_ (p/all (map (fn [file] + (p/let [_ (when-not dev? (remove-js-source-maps output-static-dir)) + _ (p/all (map (fn [file] (fs/rmSync (node-path/join output-static-dir "js" file) #js {:force true})) js-files)) _ (when dev? diff --git a/deps/publishing/test/logseq/publishing/export_test.cljs b/deps/publishing/test/logseq/publishing/export_test.cljs index 988c5ac551e6..4cae6f652cc7 100644 --- a/deps/publishing/test/logseq/publishing/export_test.cljs +++ b/deps/publishing/test/logseq/publishing/export_test.cljs @@ -35,6 +35,9 @@ (reduce concat) (concat (get-files dir))))) +(defn- js-map-files [] + (map #(str % ".map") publish-export/js-files)) + (defn- create-export [static-dir graph-dir output-dir {:keys [html assets] :or {html "" @@ -56,6 +59,8 @@ (fs/mkdirSync (path/join dir "js" "publishing")) (mapv #(fs/writeFileSync (path/join dir "js" "publishing" %) %) (conj publish-export/js-files "manifest.edn")) + (doseq [file (conj (vec (js-map-files)) "db-worker.js.map")] + (fs/writeFileSync (path/join dir "js" file) file)) (fs/writeFileSync (path/join dir "404.html") "")) (defn- create-logseq-graph @@ -81,7 +86,10 @@ "index.html is copied correctly") (is (= "main.js" (str (fs/readFileSync "tmp/published-graph/static/js/main.js"))) - "cljs frontend compiled as main.js is copied correctly")))) + "cljs frontend compiled as main.js is copied correctly") + (is (empty? (filter #(.endsWith (path/basename %) ".map") + (get-files "tmp/published-graph/static/js"))) + "source maps are not copied")))) (deftest-async create-export-with-css-files (create-static-dir "tmp/static") diff --git a/gulpfile.js b/gulpfile.js index bb28278610c9..a5af184997a6 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -117,9 +117,7 @@ const common = { 'packages/ui/dist/ui.js', 'node_modules/@sqlite.org/sqlite-wasm/dist/sqlite3.wasm', 'node_modules/react/umd/react.production.min.js', - 'node_modules/react/umd/react.development.js', 'node_modules/react-dom/umd/react-dom.production.min.js', - 'node_modules/react-dom/umd/react-dom.development.js', 'node_modules/prop-types/prop-types.min.js', 'node_modules/dompurify/dist/purify.js', ]).pipe(gulp.dest(path.join(outputPath, 'js'))), @@ -157,9 +155,7 @@ const common = { 'node_modules/@highlightjs/cdn-assets/highlight.min.js', 'node_modules/@isomorphic-git/lightning-fs/dist/lightning-fs.min.js', 'node_modules/react/umd/react.production.min.js', - 'node_modules/react/umd/react.development.js', 'node_modules/react-dom/umd/react-dom.production.min.js', - 'node_modules/react-dom/umd/react-dom.development.js', 'node_modules/prop-types/prop-types.min.js', 'node_modules/interactjs/dist/interact.min.js', 'node_modules/photoswipe/dist/umd/*.js', @@ -257,15 +253,17 @@ const common = { switchReactDevelopmentMode (cb) { try { - const reactFrom = path.join(outputPath, 'js', 'react.development.js') + const reactFrom = path.join(__dirname, 'node_modules', 'react', 'umd', + 'react.development.js') const reactTo = path.join(outputPath, 'js', 'react.production.min.js') - fs.renameSync(reactFrom, reactTo) + fs.copyFileSync(reactFrom, reactTo) - const reactDomFrom = path.join(outputPath, 'js', + const reactDomFrom = path.join(__dirname, 'node_modules', 'react-dom', + 'umd', 'react-dom.development.js') const reactDomTo = path.join(outputPath, 'js', 'react-dom.production.min.js') - fs.renameSync(reactDomFrom, reactDomTo) + fs.copyFileSync(reactDomFrom, reactDomTo) cb() } catch (err) { @@ -273,6 +271,19 @@ const common = { cb(err) } }, + + pruneDesktopPackageFiles () { + for (const entry of ['mobile', 'android', 'ios']) { + fs.rmSync(path.join(outputPath, entry), { + recursive: true, + force: true, + maxRetries: 10, + retryDelay: 100, + }) + } + + return Promise.resolve() + }, } exports.electron = () => { @@ -309,6 +320,8 @@ exports.electronMaker = async () => { pkg.version = version fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, 2)) + await common.pruneDesktopPackageFiles() + if (!fs.existsSync(path.join(outputPath, 'node_modules'))) { cp.execSync('pnpm install --frozen-lockfile', { cwd: outputPath, diff --git a/resources/electron-builder.yml b/resources/electron-builder.yml index 2afb9ee73f8a..eaaccc1c9fbf 100644 --- a/resources/electron-builder.yml +++ b/resources/electron-builder.yml @@ -5,8 +5,38 @@ directories: buildResources: . output: dist +files: + - "**/*" + - "!dist/**" + - "!mobile/**" + - "!android/**" + - "!ios/**" + - "!js/react.development.js" + - "!js/react-dom.development.js" + - "!js/publishing/*.map" + - "!js/publishing/manifest.edn" + - "!js/publishing/module-loader.*" + - "!js/sqlite3.wasm" + - "!css/fonts/tabler-icons.eot" + - "!css/fonts/tabler-icons.ttf" + - "!css/fonts/tabler-icons.woff" + - "!**/node_modules/**/*.map" + - "!**/node_modules/**/*.d.ts" + - "!**/node_modules/**/*.d.cts" + - "!**/node_modules/**/*.d.mts" + - "!**/node_modules/**/*.{ts,cts,mts}" + - "!**/node_modules/**/*.{c,cc,cpp,h,hpp,gyp}" + - "!**/node_modules/**/*.test-d.ts" + - "!**/node_modules/**/*.test-d.cts" + - "!**/node_modules/**/*.test-d.mts" + - "!**/node_modules/**/*.{test,spec}.{js,cjs,mjs,ts,cts,mts}" + - "!**/node_modules/**/*{example,benchmark,bench,tests,runkit}*.{js,cjs,mjs,ts,cts,mts}" + - "!**/node_modules/**/*.{md,markdown}" + - "!**/node_modules/**/{test,tests,__tests__,powered-test,example,examples,benchmark,benchmarks}/**" + - "!**/node_modules/**/{tsconfig.json,eslint.config.js,.editorconfig}" + toolsets: - appimage: "1.0.3" + appimage: "1.0.2" protocols: - name: logseq diff --git a/scripts/prepare-desktop-runtime-js.mjs b/scripts/prepare-desktop-runtime-js.mjs index c34d09188b99..940874646aba 100644 --- a/scripts/prepare-desktop-runtime-js.mjs +++ b/scripts/prepare-desktop-runtime-js.mjs @@ -27,6 +27,8 @@ const copyPairs = [ { from: path.join(distDir, "db-worker-node.js"), to: path.join(staticJsDir, "db-worker-node.js"), + generatedFrom: path.join(staticDir, "db-worker-node.js"), + refreshCommand: "pnpm db-worker-node:bundle", }, { from: path.join(skillSourceDir, "SKILL.md"), @@ -52,10 +54,26 @@ async function copyOne({ from, to, optional = false }) { await fs.copyFile(from, to); } +async function assertFreshRuntime({ from, generatedFrom, refreshCommand }) { + if (!generatedFrom || !(await exists(generatedFrom)) || !(await exists(from))) return; + + const [sourceStats, generatedStats] = await Promise.all([ + fs.stat(from), + fs.stat(generatedFrom), + ]); + + if (sourceStats.mtimeMs + 1000 < generatedStats.mtimeMs) { + throw new Error( + `${from} is older than ${generatedFrom}; run \`${refreshCommand}\` before preparing desktop runtime JS` + ); + } +} + async function main() { await fs.mkdir(staticJsDir, { recursive: true }); for (const pair of copyPairs) { + await assertFreshRuntime(pair); await copyOne(pair); } From 1f78e70799e54a14bdf9136a43d1b090c4813e42 Mon Sep 17 00:00:00 2001 From: Tienson Qin Date: Mon, 1 Jun 2026 21:39:27 +0800 Subject: [PATCH 0054/1400] chore: bump electron (#12741) * chore: bump electron * chore: add unsigned desktop build script * fix: allow db worker cors preflight * fix: load local plugins through lsp scheme * fix: normalize effect plugin entries * fix: normalize local plugin entries in sdk source * fix: keep local plugin frames same-origin * fix: use legacy plugin origin for desktop runtime * fix: align db worker cors origin * fix: strip plugin prefix in lsp file route * fix: load external local plugins through lsp * fix: preserve plugin effect origin boundary * fix(plugin): marketplace related ui * chore: build libs core --------- Co-authored-by: charlie --- gulpfile.js | 16 +++- libs/src/LSPlugin.core.ts | 72 +++++++++++++++--- libs/src/common.ts | 5 +- package.json | 1 + resources/js/lsplugin.core.js | 2 +- resources/package.json | 3 +- resources/pnpm-lock.yaml | 62 +++++++-------- scripts/electron-builder-unsigned.mjs | 79 ++++++++++++++++++++ src/electron/electron/core.cljs | 39 ++++++++-- src/electron/electron/window.cljs | 5 +- src/main/frontend/worker/db_worker_node.cljs | 27 +++++-- 11 files changed, 251 insertions(+), 60 deletions(-) create mode 100644 scripts/electron-builder-unsigned.mjs diff --git a/gulpfile.js b/gulpfile.js index a5af184997a6..d0dd40138956 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -298,7 +298,7 @@ exports.electron = () => { }) } -exports.electronMaker = async () => { +const prepareElectronMaker = async () => { cp.execSync('pnpm cljs:release-electron', { stdio: 'inherit', }) @@ -328,13 +328,25 @@ exports.electronMaker = async () => { stdio: 'inherit', }) } +} - cp.execSync('pnpm electron:make', { +const runStaticScript = (script) => { + cp.execSync(`pnpm ${script}`, { cwd: outputPath, stdio: 'inherit', }) } +exports.electronMaker = async () => { + await prepareElectronMaker() + runStaticScript('electron:make') +} + +exports.electronMakerUnsigned = async () => { + await prepareElectronMaker() + runStaticScript('electron:make-unsigned') +} + exports.cap = common.runCapWithLocalDevServerEntry exports.clean = common.clean exports.watch = gulp.series( diff --git a/libs/src/LSPlugin.core.ts b/libs/src/LSPlugin.core.ts index 288fdee08b88..839864a78047 100644 --- a/libs/src/LSPlugin.core.ts +++ b/libs/src/LSPlugin.core.ts @@ -11,6 +11,9 @@ import { getSDKPathRoot, PROTOCOL_FILE, URL_LSP, + URL_LSP_EXTERNAL, + URL_LSP_HOST, + URL_LSP_HOST_EXTERNAL, safetyPathJoin, path, safetyPathNormalize, @@ -451,16 +454,43 @@ function initApiProxyHandlers(pluginLocal: PluginLocal) { }) } -function convertToLSPResource(fullUrl: string, dotPluginRoot: string) { - if (dotPluginRoot && fullUrl.startsWith(PROTOCOL_FILE + dotPluginRoot)) { +function convertToLSPResource( + fullUrl: string, + localRoot: string, + lspRoot = URL_LSP +) { + if (localRoot && fullUrl.startsWith(PROTOCOL_FILE + localRoot)) { fullUrl = safetyPathJoin( - URL_LSP, - fullUrl.substr(PROTOCOL_FILE.length + dotPluginRoot.length) + lspRoot, + fullUrl.substr(PROTOCOL_FILE.length + localRoot.length) ) } return fullUrl } +function getPluginLSPRoot(effect?: boolean) { + return effect ? URL_LSP_HOST : URL_LSP +} + +function getExternalLSPRoot(localRoot: string, effect?: boolean) { + return safetyPathJoin( + effect === false ? URL_LSP_EXTERNAL : URL_LSP_HOST_EXTERNAL, + encodeURIComponent(localRoot) + ) +} + +function convertToExternalLSPResource( + fullUrl: string, + localRoot: string, + effect?: boolean +) { + return convertToLSPResource( + fullUrl, + localRoot, + getExternalLSPRoot(localRoot, effect) + ) +} + class IllegalPluginPackageError extends Error { url?: string packageJsonPath?: string @@ -610,9 +640,19 @@ class PluginLocal extends EventEmitter< const url = path.join(localRoot, filePath) filePath = reg.test(url) ? url : PROTOCOL_FILE + url } - return !this.options.effect && this.isInstalledInLocalDotRoot - ? convertToLSPResource(filePath, this.dotPluginsRoot) - : filePath + if (this.isInstalledInLocalDotRoot) { + return convertToLSPResource( + filePath, + this.dotPluginsRoot, + getPluginLSPRoot(this.options.effect) + ) + } + + return convertToExternalLSPResource( + filePath, + localRoot, + this.options.effect + ) } async _preparePackageConfigs() { @@ -682,7 +722,7 @@ class PluginLocal extends EventEmitter< if (logseq.devEntry) { // development mode entry this._options.devEntry = logseq.devEntry - this._options.entry = logseq.devEntry + this._options.entry = this._resolveResourceFullUrl(logseq.devEntry, localRoot) } else { // theme has no main this._options.entry = this._resolveResourceFullUrl(entry, localRoot) @@ -747,7 +787,10 @@ class PluginLocal extends EventEmitter< devEntry = devEntry || settings?.get('_devEntry') if (devEntry) { - this._options.entry = devEntry + this._options.entry = this._resolveResourceFullUrl( + devEntry, + this._localRoot + ) return } @@ -787,10 +830,17 @@ class PluginLocal extends EventEmitter< entry = withFileProtocol(path.normalize(entryPath)) - if (!this._options.effect) { + if (this.isInstalledInLocalDotRoot) { entry = convertToLSPResource( entry, - this.dotPluginsRoot + this.dotPluginsRoot, + getPluginLSPRoot(this.options.effect) + ) + } else { + entry = convertToExternalLSPResource( + entry, + path.dirname(entryPath), + this.options.effect ) } diff --git a/libs/src/common.ts b/libs/src/common.ts index ad72bbbbfe62..abc90d6a58bd 100644 --- a/libs/src/common.ts +++ b/libs/src/common.ts @@ -19,7 +19,10 @@ export const path = export const IS_DEV = process.env.NODE_ENV === 'development' export const PROTOCOL_FILE = 'file://' export const PROTOCOL_LSP = 'lsp://' -export const URL_LSP = PROTOCOL_LSP + 'logseq.io/' +export const URL_LSP = PROTOCOL_LSP + 'logseq.io/plugins/' +export const URL_LSP_EXTERNAL = PROTOCOL_LSP + 'logseq.io/external/' +export const URL_LSP_HOST = PROTOCOL_LSP + 'logseq.com/plugins/' +export const URL_LSP_HOST_EXTERNAL = PROTOCOL_LSP + 'logseq.com/external/' let _appPathRoot: string diff --git a/package.json b/package.json index 3b41f6d747b3..d5a3fed6598e 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "dev-release-app": "run-s gulp:build cljs:dev-release-app webpack-app-build", "dev-electron-app": "gulp electron", "release-electron": "run-s gulp:build && pnpm db-worker-node:release:bundle webpack-app-build && gulp electronMaker", + "release-electron:unsigned": "run-s gulp:build && pnpm db-worker-node:release:bundle webpack-app-build && gulp electronMakerUnsigned", "debug-electron": "cd static/ && pnpm electron:debug", "webpack-watch": "webpack --watch", "webpack-app-watch": "pnpm exec webpack --watch --config-name app", diff --git a/resources/js/lsplugin.core.js b/resources/js/lsplugin.core.js index 66842ed7a6f2..03f5afab950b 100644 --- a/resources/js/lsplugin.core.js +++ b/resources/js/lsplugin.core.js @@ -1,2 +1,2 @@ /*! For license information please see lsplugin.core.js.LICENSE.txt */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.LSPlugin=t():e.LSPlugin=t()}(self,()=>(()=>{var e={221(e,t,n){var r=n(558);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let r=0,s=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(r++,"%c"===e&&(s=r))}),t.splice(s,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==r&&"env"in r&&(e=r.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=n(156)(t);const{formatters:s}=e.exports;s.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},156(e,t,n){e.exports=function(e){function t(e){let n,s,i,o=null;function a(...e){if(!a.enabled)return;const r=a,s=Number(new Date),i=s-(n||s);r.diff=i,r.prev=n,r.curr=s,n=s,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,s)=>{if("%%"===n)return"%";o++;const i=t.formatters[s];if("function"==typeof i){const t=e[o];n=i.call(r,t),e.splice(o,1),o--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(s!==t.namespaces&&(s=t.namespaces,i=t.enabled(e)),i),set:e=>{o=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,n){const r=t(this.namespace+(void 0===n?":":n)+e);return r.log=this.log,r}function s(e,t){let n=0,r=0,s=-1,i=0;for(;n"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of n)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const n of t.skips)if(s(e,n))return!1;for(const n of t.names)if(s(e,n))return!0;return!1},t.humanize=n(49),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t=1.5*n;return Math.round(e/n)+" "+r+(s?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(o){var a=parseFloat(o[1]);switch((o[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*i;case"days":case"day":case"d":return a*s;case"hours":case"hour":case"hrs":case"hr":case"h":return a*r;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=s?o(l,c,s,"day"):c>=r?o(l,c,r,"hour"):c>=n?o(l,c,n,"minute"):c>=t?o(l,c,t,"second"):l+" ms"):function(e){var i=Math.abs(e);return i>=s?Math.round(e/s)+"d":i>=r?Math.round(e/r)+"h":i>=n?Math.round(e/n)+"m":i>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},528(e,t,n){"use strict";var r=n(558),s="win32"===r.platform,i=n(496);function o(e,t){for(var n=[],r=0;r=0&&!e[r];r--);return 0===n&&r===t?e:n>r?[]:e.slice(n,r+1)}var l=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,c=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,u={};function h(e){var t=l.exec(e),n=(t[1]||"")+(t[2]||""),r=t[3]||"",s=c.exec(r);return[n,s[1],s[2],s[3]]}function d(e){var t=l.exec(e),n=t[1]||"",r=!!n&&":"!==n[1];return{device:n,isUnc:r,isAbsolute:r||!!t[2],tail:t[3]}}function p(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}u.resolve=function(){for(var e="",t="",n=!1,s=arguments.length-1;s>=-1;s--){var a;if(s>=0?a=arguments[s]:e?(a=r.env["="+e])&&a.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(a=e+"\\"):a=r.cwd(),!i.isString(a))throw new TypeError("Arguments to path.resolve must be strings");if(a){var l=d(a),c=l.device,u=l.isUnc,h=l.isAbsolute,f=l.tail;if((!c||!e||c.toLowerCase()===e.toLowerCase())&&(e||(e=c),n||(t=f+"\\"+t,n=h),e&&n))break}}return u&&(e=p(e)),e+(n?"\\":"")+(t=o(t.split(/[\\\/]+/),!n).join("\\"))||"."},u.normalize=function(e){var t=d(e),n=t.device,r=t.isUnc,s=t.isAbsolute,i=t.tail,a=/[\\\/]$/.test(i);return(i=o(i.split(/[\\\/]+/),!s).join("\\"))||s||(i="."),i&&a&&(i+="\\"),r&&(n=p(n)),n+(s?"\\":"")+i},u.isAbsolute=function(e){return d(e).isAbsolute},u.join=function(){for(var e=[],t=0;t=-1&&!t;n--){var s=n>=0?arguments[n]:r.cwd();if(!i.isString(s))throw new TypeError("Arguments to path.resolve must be strings");s&&(e=s+"/"+e,t="/"===s[0])}return(t?"/":"")+(e=o(e.split("/"),!t).join("/"))||"."},g.normalize=function(e){var t=g.isAbsolute(e),n=e&&"/"===e[e.length-1];return(e=o(e.split("/"),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e},g.isAbsolute=function(e){return"/"===e.charAt(0)},g.join=function(){for(var e="",t=0;t1)for(var n=1;n=i)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),l=r[n];n=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),f(n)?r.showHidden=n:n&&t._extend(r,n),_(r.showHidden)&&(r.showHidden=!1),_(r.depth)&&(r.depth=2),_(r.colors)&&(r.colors=!1),_(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=l),u(r,e,r.depth)}function l(e,t){var n=a.styles[t];return n?"["+a.colors[n][0]+"m"+e+"["+a.colors[n][1]+"m":e}function c(e,t){return e}function u(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var s=n.inspect(r,e);return y(s)||(s=u(e,s,r)),s}var i=function(e,t){if(_(t))return e.stylize("undefined","undefined");if(y(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return m(t)?e.stylize(""+t,"number"):f(t)?e.stylize(""+t,"boolean"):g(t)?e.stylize("null","null"):void 0}(e,n);if(i)return i;var o=Object.keys(n),a=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(n)),S(n)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return h(n);if(0===o.length){if(x(n)){var l=n.name?": "+n.name:"";return e.stylize("[Function"+l+"]","special")}if(b(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(w(n))return e.stylize(Date.prototype.toString.call(n),"date");if(S(n))return h(n)}var c,v="",C=!1,E=["{","}"];return p(n)&&(C=!0,E=["[","]"]),x(n)&&(v=" [Function"+(n.name?": "+n.name:"")+"]"),b(n)&&(v=" "+RegExp.prototype.toString.call(n)),w(n)&&(v=" "+Date.prototype.toUTCString.call(n)),S(n)&&(v=" "+h(n)),0!==o.length||C&&0!=n.length?r<0?b(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),c=C?function(e,t,n,r,s){for(var i=[],o=0,a=t.length;o60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,v,E)):E[0]+v+E[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,n,r,s,i){var o,a,l;if((l=Object.getOwnPropertyDescriptor(t,s)||{value:t[s]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),T(r,s)||(o="["+s+"]"),a||(e.seen.indexOf(l.value)<0?(a=g(n)?u(e,l.value,null):u(e,l.value,n-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),_(o)){if(i&&s.match(/^\d+$/))return a;(o=JSON.stringify(""+s)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+a}function p(e){return Array.isArray(e)}function f(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function _(e){return void 0===e}function b(e){return v(e)&&"[object RegExp]"===C(e)}function v(e){return"object"==typeof e&&null!==e}function w(e){return v(e)&&"[object Date]"===C(e)}function S(e){return v(e)&&("[object Error]"===C(e)||e instanceof Error)}function x(e){return"function"==typeof e}function C(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(_(i)&&(i=r.env.NODE_DEBUG||""),e=e.toUpperCase(),!o[e])if(new RegExp("\\b"+e+"\\b","i").test(i)){var n=r.pid;o[e]=function(){var r=t.format.apply(t,arguments);console.error("%s %d: %s",e,n,r)}}else o[e]=function(){};return o[e]},t.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=f,t.isNull=g,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=y,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=_,t.isRegExp=b,t.isObject=v,t.isDate=w,t.isError=S,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(80);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,n;console.log("%s - %s",(n=[E((e=new Date).getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),A[e.getMonth()],n].join(" ")),t.format.apply(t,arguments))},t.inherits=n(543),t._extend=function(e,t){if(!t||!v(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{PluginLocal:()=>Ss,pluginHelpers:()=>t,setupPluginCore:()=>Cs});var e={};n.r(e),n.d(e,{setSDKMetadata:()=>ye});var t={};n.r(t),n.d(t,{IS_DEV:()=>be,PROTOCOL_FILE:()=>ve,PROTOCOL_LSP:()=>we,PluginLogger:()=>Le,URL_LSP:()=>Se,cleanInjectedScripts:()=>qe,cleanInjectedUI:()=>We,deepMerge:()=>Oe,deferred:()=>Ue,genID:()=>je,getAppPathRoot:()=>Ee,getSDKPathRoot:()=>Ae,injectTheme:()=>Ge,invokeHostExportedApi:()=>Fe,isObject:()=>Te,isValidUUID:()=>Ie,mergeSettingsWithSchema:()=>Je,normalizeKeyStr:()=>Ye,path:()=>_e,safeSnakeCase:()=>Ce,safetyPathJoin:()=>De,safetyPathNormalize:()=>Ne,setupInjectedStyle:()=>$e,setupInjectedUI:()=>He,transformableEvent:()=>Be,ucFirst:()=>Re,withFileProtocol:()=>Me});var s=n(138);const i=s;var o=n(528);const{entries:a,setPrototypeOf:l,isFrozen:c,getPrototypeOf:u,getOwnPropertyDescriptor:h}=Object;let{freeze:d,seal:p,create:f}=Object,{apply:g,construct:m}="undefined"!=typeof Reflect&&Reflect;d||(d=function(e){return e}),p||(p=function(e){return e}),g||(g=function(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),s=2;s1?t-1:0),r=1;r1?n-1:0),s=1;s2&&void 0!==arguments[2]?arguments[2]:S;l&&l(e,null);let r=t.length;for(;r--;){let s=t[r];if("string"==typeof s){const e=n(s);e!==s&&(c(t)||(t[r]=e),s=e)}e[s]=!0}return e}function R(e){for(let t=0;t/gm),V=p(/\$\{[\w\W]*/gm),X=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Z=p(/^aria-[\-\w]+$/),Q=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ee=p(/^(?:\w+script|data):/i),te=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ne=p(/^html$/i),re=p(/^[a-z][.\w]*(-[.\w]+)+$/i);var se=Object.freeze({__proto__:null,ARIA_ATTR:Z,ATTR_WHITESPACE:te,CUSTOM_ELEMENT:re,DATA_ATTR:X,DOCTYPE_NAME:ne,ERB_EXPR:K,IS_ALLOWED_URI:Q,IS_SCRIPT_OR_DATA:ee,MUSTACHE_EXPR:Y,TMPLIT_EXPR:V});const ie=function(){return"undefined"==typeof window?null:window};var oe=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ie();const n=t=>e(t);if(n.version="3.3.3",n.removed=[],!t||!t.document||9!==t.document.nodeType||!t.Element)return n.isSupported=!1,n;let{document:r}=t;const s=r,i=s.currentScript,{DocumentFragment:o,HTMLTemplateElement:l,Node:c,Element:u,NodeFilter:h,NamedNodeMap:p=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:g,DOMParser:m,trustedTypes:L}=t,I=u.prototype,R=D(I,"cloneNode"),Y=D(I,"remove"),K=D(I,"nextSibling"),V=D(I,"childNodes"),X=D(I,"parentNode");if("function"==typeof l){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let Z,ee="";const{implementation:te,createNodeIterator:re,createDocumentFragment:oe,getElementsByTagName:ae}=r,{importNode:le}=s;let ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof a&&"function"==typeof X&&te&&void 0!==te.createHTMLDocument;const{MUSTACHE_EXPR:ue,ERB_EXPR:he,TMPLIT_EXPR:de,DATA_ATTR:pe,ARIA_ATTR:fe,IS_SCRIPT_OR_DATA:ge,ATTR_WHITESPACE:me,CUSTOM_ELEMENT:ye}=se;let{IS_ALLOWED_URI:_e}=se,be=null;const ve=j({},[...N,...U,...F,...z,...W]);let we=null;const Se=j({},[...q,...B,...G,...J]);let xe=Object.seal(f(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,Ee=null;const Ae=Object.seal(f(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Te=!0,Oe=!0,ke=!1,Pe=!0,Le=!1,Ie=!0,je=!1,Re=!1,Me=!1,De=!1,Ne=!1,Ue=!1,Fe=!0,$e=!1,ze=!0,He=!1,We={},qe=null;const Be=j({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Ge=null;const Je=j({},["audio","video","img","source","image","track"]);let Ye=null;const Ke=j({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ve="http://www.w3.org/1998/Math/MathML",Xe="http://www.w3.org/2000/svg",Ze="http://www.w3.org/1999/xhtml";let Qe=Ze,et=!1,tt=null;const nt=j({},[Ve,Xe,Ze],x);let rt=j({},["mi","mo","mn","ms","mtext"]),st=j({},["annotation-xml"]);const it=j({},["title","style","font","a","script"]);let ot=null;const at=["application/xhtml+xml","text/html"];let lt=null,ct=null;const ut=r.createElement("form"),ht=function(e){return e instanceof RegExp||e instanceof Function},dt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ct||ct!==e){if(e&&"object"==typeof e||(e={}),e=M(e),ot=-1===at.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,lt="application/xhtml+xml"===ot?x:S,be=O(e,"ALLOWED_TAGS")?j({},e.ALLOWED_TAGS,lt):ve,we=O(e,"ALLOWED_ATTR")?j({},e.ALLOWED_ATTR,lt):Se,tt=O(e,"ALLOWED_NAMESPACES")?j({},e.ALLOWED_NAMESPACES,x):nt,Ye=O(e,"ADD_URI_SAFE_ATTR")?j(M(Ke),e.ADD_URI_SAFE_ATTR,lt):Ke,Ge=O(e,"ADD_DATA_URI_TAGS")?j(M(Je),e.ADD_DATA_URI_TAGS,lt):Je,qe=O(e,"FORBID_CONTENTS")?j({},e.FORBID_CONTENTS,lt):Be,Ce=O(e,"FORBID_TAGS")?j({},e.FORBID_TAGS,lt):M({}),Ee=O(e,"FORBID_ATTR")?j({},e.FORBID_ATTR,lt):M({}),We=!!O(e,"USE_PROFILES")&&e.USE_PROFILES,Te=!1!==e.ALLOW_ARIA_ATTR,Oe=!1!==e.ALLOW_DATA_ATTR,ke=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Pe=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Le=e.SAFE_FOR_TEMPLATES||!1,Ie=!1!==e.SAFE_FOR_XML,je=e.WHOLE_DOCUMENT||!1,De=e.RETURN_DOM||!1,Ne=e.RETURN_DOM_FRAGMENT||!1,Ue=e.RETURN_TRUSTED_TYPE||!1,Me=e.FORCE_BODY||!1,Fe=!1!==e.SANITIZE_DOM,$e=e.SANITIZE_NAMED_PROPS||!1,ze=!1!==e.KEEP_CONTENT,He=e.IN_PLACE||!1,_e=e.ALLOWED_URI_REGEXP||Q,Qe=e.NAMESPACE||Ze,rt=e.MATHML_TEXT_INTEGRATION_POINTS||rt,st=e.HTML_INTEGRATION_POINTS||st,xe=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(xe.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&ht(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(xe.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(xe.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Le&&(Oe=!1),Ne&&(De=!0),We&&(be=j({},W),we=f(null),!0===We.html&&(j(be,N),j(we,q)),!0===We.svg&&(j(be,U),j(we,B),j(we,J)),!0===We.svgFilters&&(j(be,F),j(we,B),j(we,J)),!0===We.mathMl&&(j(be,z),j(we,G),j(we,J))),O(e,"ADD_TAGS")||(Ae.tagCheck=null),O(e,"ADD_ATTR")||(Ae.attributeCheck=null),e.ADD_TAGS&&("function"==typeof e.ADD_TAGS?Ae.tagCheck=e.ADD_TAGS:(be===ve&&(be=M(be)),j(be,e.ADD_TAGS,lt))),e.ADD_ATTR&&("function"==typeof e.ADD_ATTR?Ae.attributeCheck=e.ADD_ATTR:(we===Se&&(we=M(we)),j(we,e.ADD_ATTR,lt))),e.ADD_URI_SAFE_ATTR&&j(Ye,e.ADD_URI_SAFE_ATTR,lt),e.FORBID_CONTENTS&&(qe===Be&&(qe=M(qe)),j(qe,e.FORBID_CONTENTS,lt)),e.ADD_FORBID_CONTENTS&&(qe===Be&&(qe=M(qe)),j(qe,e.ADD_FORBID_CONTENTS,lt)),ze&&(be["#text"]=!0),je&&j(be,["html","head","body"]),be.table&&(j(be,["tbody"]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw P('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');Z=e.TRUSTED_TYPES_POLICY,ee=Z.createHTML("")}else void 0===Z&&(Z=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const s="dompurify"+(n?"#"+n:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(L,i)),null!==Z&&"string"==typeof ee&&(ee=Z.createHTML(""));d&&d(e),ct=e}},pt=j({},[...U,...F,...$]),ft=j({},[...z,...H]),gt=function(e){v(n.removed,{element:e});try{X(e).removeChild(e)}catch(t){Y(e)}},mt=function(e,t){try{v(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){v(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e)if(De||Ne)try{gt(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},yt=function(e){let t=null,n=null;if(Me)e=""+e;else{const t=C(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ot&&Qe===Ze&&(e=''+e+"");const s=Z?Z.createHTML(e):e;if(Qe===Ze)try{t=(new m).parseFromString(s,ot)}catch(e){}if(!t||!t.documentElement){t=te.createDocument(Qe,"template",null);try{t.documentElement.innerHTML=et?ee:s}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),Qe===Ze?ae.call(t,je?"html":"body")[0]:je?t.documentElement:i},_t=function(e){return re.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},bt=function(e){return e instanceof g&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof p)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},vt=function(e){return"function"==typeof c&&e instanceof c};function wt(e,t,r){y(e,e=>{e.call(n,t,r,ct)})}const St=function(e){let t=null;if(wt(ce.beforeSanitizeElements,e,null),bt(e))return gt(e),!0;const r=lt(e.nodeName);if(wt(ce.uponSanitizeElement,e,{tagName:r,allowedTags:be}),Ie&&e.hasChildNodes()&&!vt(e.firstElementChild)&&k(/<[/\w!]/g,e.innerHTML)&&k(/<[/\w!]/g,e.textContent))return gt(e),!0;if(7===e.nodeType)return gt(e),!0;if(Ie&&8===e.nodeType&&k(/<[/\w]/g,e.data))return gt(e),!0;if(!(Ae.tagCheck instanceof Function&&Ae.tagCheck(r))&&(!be[r]||Ce[r])){if(!Ce[r]&&Ct(r)){if(xe.tagNameCheck instanceof RegExp&&k(xe.tagNameCheck,r))return!1;if(xe.tagNameCheck instanceof Function&&xe.tagNameCheck(r))return!1}if(ze&&!qe[r]){const t=X(e)||e.parentNode,n=V(e)||e.childNodes;if(n&&t)for(let r=n.length-1;r>=0;--r){const s=R(n[r],!0);s.__removalCount=(e.__removalCount||0)+1,t.insertBefore(s,K(e))}}return gt(e),!0}return e instanceof u&&!function(e){let t=X(e);t&&t.tagName||(t={namespaceURI:Qe,tagName:"template"});const n=S(e.tagName),r=S(t.tagName);return!!tt[e.namespaceURI]&&(e.namespaceURI===Xe?t.namespaceURI===Ze?"svg"===n:t.namespaceURI===Ve?"svg"===n&&("annotation-xml"===r||rt[r]):Boolean(pt[n]):e.namespaceURI===Ve?t.namespaceURI===Ze?"math"===n:t.namespaceURI===Xe?"math"===n&&st[r]:Boolean(ft[n]):e.namespaceURI===Ze?!(t.namespaceURI===Xe&&!st[r])&&!(t.namespaceURI===Ve&&!rt[r])&&!ft[n]&&(it[n]||!pt[n]):!("application/xhtml+xml"!==ot||!tt[e.namespaceURI]))}(e)?(gt(e),!0):"noscript"!==r&&"noembed"!==r&&"noframes"!==r||!k(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le&&3===e.nodeType&&(t=e.textContent,y([ue,he,de],e=>{t=E(t,e," ")}),e.textContent!==t&&(v(n.removed,{element:e.cloneNode()}),e.textContent=t)),wt(ce.afterSanitizeElements,e,null),!1):(gt(e),!0)},xt=function(e,t,n){if(Ee[t])return!1;if(Fe&&("id"===t||"name"===t)&&(n in r||n in ut))return!1;if(Oe&&!Ee[t]&&k(pe,t));else if(Te&&k(fe,t));else if(Ae.attributeCheck instanceof Function&&Ae.attributeCheck(t,e));else if(!we[t]||Ee[t]){if(!(Ct(e)&&(xe.tagNameCheck instanceof RegExp&&k(xe.tagNameCheck,e)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(e))&&(xe.attributeNameCheck instanceof RegExp&&k(xe.attributeNameCheck,t)||xe.attributeNameCheck instanceof Function&&xe.attributeNameCheck(t,e))||"is"===t&&xe.allowCustomizedBuiltInElements&&(xe.tagNameCheck instanceof RegExp&&k(xe.tagNameCheck,n)||xe.tagNameCheck instanceof Function&&xe.tagNameCheck(n))))return!1}else if(Ye[t]);else if(k(_e,E(n,me,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==A(n,"data:")||!Ge[e])if(ke&&!k(ge,E(n,me,"")));else if(n)return!1;return!0},Ct=function(e){return"annotation-xml"!==e&&C(e,ye)},Et=function(e){wt(ce.beforeSanitizeAttributes,e,null);const{attributes:t}=e;if(!t||bt(e))return;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:we,forceKeepAttr:void 0};let s=t.length;for(;s--;){const i=t[s],{name:o,namespaceURI:a,value:l}=i,c=lt(o),u=l;let h="value"===o?u:T(u);if(r.attrName=c,r.attrValue=h,r.keepAttr=!0,r.forceKeepAttr=void 0,wt(ce.uponSanitizeAttribute,e,r),h=r.attrValue,!$e||"id"!==c&&"name"!==c||(mt(o,e),h="user-content-"+h),Ie&&k(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,h)){mt(o,e);continue}if("attributename"===c&&C(h,"href")){mt(o,e);continue}if(r.forceKeepAttr)continue;if(!r.keepAttr){mt(o,e);continue}if(!Pe&&k(/\/>/i,h)){mt(o,e);continue}Le&&y([ue,he,de],e=>{h=E(h,e," ")});const d=lt(e.nodeName);if(xt(d,c,h)){if(Z&&"object"==typeof L&&"function"==typeof L.getAttributeType)if(a);else switch(L.getAttributeType(d,c)){case"TrustedHTML":h=Z.createHTML(h);break;case"TrustedScriptURL":h=Z.createScriptURL(h)}if(h!==u)try{a?e.setAttributeNS(a,o,h):e.setAttribute(o,h),bt(e)?gt(e):b(n.removed)}catch(t){mt(o,e)}}else mt(o,e)}wt(ce.afterSanitizeAttributes,e,null)},At=function e(t){let n=null;const r=_t(t);for(wt(ce.beforeSanitizeShadowDOM,t,null);n=r.nextNode();)wt(ce.uponSanitizeShadowNode,n,null),St(n),Et(n),n.content instanceof o&&e(n.content);wt(ce.afterSanitizeShadowDOM,t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,a=null,l=null;if(et=!e,et&&(e="\x3c!--\x3e"),"string"!=typeof e&&!vt(e)){if("function"!=typeof e.toString)throw P("toString is not a function");if("string"!=typeof(e=e.toString()))throw P("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Re||dt(t),n.removed=[],"string"==typeof e&&(He=!1),He){if(e.nodeName){const t=lt(e.nodeName);if(!be[t]||Ce[t])throw P("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof c)r=yt("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!De&&!Le&&!je&&-1===e.indexOf("<"))return Z&&Ue?Z.createHTML(e):e;if(r=yt(e),!r)return De?null:Ue?ee:""}r&&Me&>(r.firstChild);const u=_t(He?e:r);for(;a=u.nextNode();)St(a),Et(a),a.content instanceof o&&At(a.content);if(He)return e;if(De){if(Ne)for(l=oe.call(r.ownerDocument);r.firstChild;)l.appendChild(r.firstChild);else l=r;return(we.shadowroot||we.shadowrootmode)&&(l=le.call(s,l,!0)),l}let h=je?r.outerHTML:r.innerHTML;return je&&be["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&k(ne,r.ownerDocument.doctype.name)&&(h="\n"+h),Le&&y([ue,he,de],e=>{h=E(h,e," ")}),Z&&Ue?Z.createHTML(h):h},n.setConfig=function(){dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Re=!0},n.clearConfig=function(){ct=null,Re=!1},n.isValidAttribute=function(e,t,n){ct||dt({});const r=lt(e),s=lt(t);return xt(r,s,n)},n.addHook=function(e,t){"function"==typeof t&&v(ce[e],t)},n.removeHook=function(e,t){if(void 0!==t){const n=_(ce[e],t);return-1===n?void 0:w(ce[e],n,1)[0]}return b(ce[e])},n.removeHooks=function(e){ce[e]=[]},n.removeAllHooks=function(){ce={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}(),ae=n(314),le=n.n(ae);const ce=/([\p{Ll}\d])(\p{Lu})/gu,ue=/(\p{Lu})([\p{Lu}][\p{Ll}])/gu,he=/(\d)\p{Ll}|(\p{L})\d/u,de=/[^\p{L}\d]+/giu,pe="$1\0$2";function fe(e){let t=e.trim();t=t.replace(ce,pe).replace(ue,pe),t=t.replace(de,"\0");let n=0,r=t.length;for(;"\0"===t.charAt(n);)n++;if(n===r)return[];for(;"\0"===t.charAt(r-1);)r--;return t.slice(n,r).split(/\0/g)}function ge(e){const t=fe(e);for(let e=0;ei;){const t=o-1,n=e.charAt(t);if(!s.includes(n))break;o=t}return[e.slice(0,i),n(e.slice(i,o)),e.slice(o)]}(e,t);return n+r.map((i=t?.locale,!1===i?e=>e.toLowerCase():e=>e.toLocaleLowerCase(i))).join(t?.delimiter??" ")+s;var i}function ye(e){this?.sdk&&e&&(this.sdk=Object.assign({},this.sdk,e))}const _e="win32"===navigator.platform.toLowerCase()?o.win32:o.posix,be=!1,ve="file://",we="lsp://",Se=we+"logseq.io/";let xe;const Ce=function(e,t){return me(e,{delimiter:"_",...t})};async function Ee(){return xe||(xe=await Fe("_callApplication","getAppPath"))}async function Ae(){return be?localStorage.getItem("LSP_DEV_SDK_ROOT")||"http://localhost:8080":De(await Ee(),"js")}function Te(e){return e===Object(e)&&!Array.isArray(e)}function Oe(e,t){return le()(e,t,{arrayMerge:(e,t)=>t})}const ke={DEBUG:10,INFO:20,WARN:30,ERROR:40};function Pe(e){if(null==e)return String(e);if(e instanceof Error)return`${e.message}${e.stack?"\n"+e.stack:""}`;if("string"==typeof e)return e;if("object"==typeof e)try{const t=new WeakSet;return JSON.stringify(e,(e,n)=>{if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular]";t.add(n)}return n})}catch(t){try{return String(e)}catch(e){return"[Unserializable]"}}try{return String(e)}catch(e){return"[Unserializable]"}}class Le extends i{_tag;_opts;_logs=[];_maxSize;_level;constructor(e,t){super(),this._tag=e,this._opts=t,this._maxSize=Math.max(50,t?.maxSize??500),this._level=t?.level??"DEBUG"}write(e,t,n){Array.isArray(t)&&t.length&&!0===t[t.length-1]&&(n=!0,t=t.slice(0,-1));const r="string"==typeof e?e.toUpperCase():e,s=r in ke?r:"INFO";if(ke[s]this._maxSize&&this._logs.splice(0,this._logs.length-this._maxSize),n||this._opts?.console){const e="ERROR"===s?"error":"WARN"===s?"warn":"DEBUG"===s?"debug":"info";try{console[e](`[${o.tag}][${new Date(o.ts).toLocaleTimeString()}] ${s}: ${i}`)}catch(e){}}this.emit("append",o),this.emit("change")}clear(){this._logs=[],this.emit("clear"),this.emit("change")}debug(...e){this.write("DEBUG",e)}info(...e){this.write("INFO",e)}warn(...e){this.write("WARN",e)}error(...e){this.write("ERROR",e)}setTag(e){this._tag=e}getTag(){return this._tag}setLevel(e){e in ke&&(this._level=e)}getLevel(){return this._level}setMaxSize(e){this._maxSize=Math.max(50,0|e),this._logs.length>this._maxSize&&(this._logs.splice(0,this._logs.length-this._maxSize),this.emit("change"))}getEntries(){return this._logs.slice()}toJSON(){return this._logs.map(e=>[e.level,`[${e.tag}][${new Date(e.ts).toLocaleTimeString()}] ${e.message}`])}}function Ie(e){return"string"==typeof e&&36===e.length&&/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/gi.test(e)}function je(){return"_"+Math.random().toString(36).substr(2,9)}function Re(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Me(e){return e?(/^(http|file|lsp)/.test(e)||(e=ve+e),e):""}function De(e,...t){try{const n=new URL(e);if(!n.origin)throw new Error(null);const r=_e.join(e.substr(n.origin.length),...t);return n.origin+r}catch(n){return _e.join(e,...t)}}function Ne(e){return e?.match(/^(http?|lsp|assets):/)||(e=_e.normalize(e)),e}function Ue(e,t){let n,r,s=!1;const i=t=>n=>{e&&clearTimeout(e),t(n),s=!0},o=new Promise((s,o)=>{n=i(s),r=i(o),e&&(e=setTimeout(()=>r(new Error(`[deferred timeout] ${t}`)),e))});return{created:Date.now(),setTag:e=>t=e,resolve:n,reject:r,promise:o,get settled(){return s}}}function Fe(t,...n){t=t?.startsWith("_call")?t:t?.replace(/^[_$]+/,"");let r=Ce(t);const s=window.logseq?.sdk,i=s&&Object.keys(s);let o={};const a=r?.split("_")?.[0];a&&i.includes(a)&&(r=r.replace(new RegExp(`^${a}_`),""),o=s?.[a]);const l=Object.assign({},window.logseq?.api,o,e),c=l[r]||window.apis[r]||l[t]||window.apis[t];if(!c)throw new Error(`Not existed method #${t}`);return"function"!=typeof c?c:c.apply(this,n)}function $e(e,t){const n=t["data-injected-style"];let r=n&&document.querySelector(`[data-injected-style=${n}]`);if(!r)return r=document.createElement("style"),r.textContent=e,t&&Object.entries(t).forEach(([e,t])=>{r.setAttribute(e,t)}),document.head.append(r),()=>{document.head.removeChild(r)};r.textContent=e}const ze=new Map;function He(e,t,n){let r,s,i="";const o=this;"slot"in e?(i=e.slot,r=`#${i}`):"path"in e?r=e.path:s=!0;const a=`${o.id}--${e.key||je()}`,l=a,c=s?document.body:r&&document.querySelector(r);if(!c)return console.error(`${this.debugTag} can not resolve selector target ${r}`),!1;if(!e.template)return void ze.get(a)?.call(null);e.template=oe.sanitize(e.template,{ADD_TAGS:["iframe"],ALLOW_UNKNOWN_PROTOCOLS:!0,ADD_ATTR:["allow","src","allowfullscreen","frameborder","scrolling","target"]});let u,h,d=document.querySelector(`#${a}`),p=s?d?.querySelector(".ls-ui-float-content"):d;if(p){p.innerHTML=e.template,t&&Object.entries(t).forEach(([e,t])=>{d.setAttribute(e,t)});let n=null!=d.dataset.dx;return void(e.style&&Object.entries(e.style).forEach(([e,t])=>{n&&["left","top","bottom","right","width","height"].includes(e)||(d.style[e]=t)}))}if(d=document.createElement("div"),d.id=a,d.dataset.injectedUi=l||"",s?(p=document.createElement("div"),p.classList.add("ls-ui-float-content"),d.appendChild(p)):p=d,p.innerHTML=e.template,t&&Object.entries(t).forEach(([e,t])=>{d.setAttribute(e,t)}),e.style&&Object.entries(e.style).forEach(([e,t])=>{d.style[e]=t}),s&&(d.setAttribute("draggable","true"),d.setAttribute("resizable","true"),e.close&&(d.dataset.close=e.close),d.classList.add("lsp-ui-float-container","visible"),o._setupResizableContainer(d,l),h=o._setupDraggableContainer(d,{key:l,close:()=>u(),title:t?.title})),i&&e.reset){const e=Array.from(c.querySelectorAll("[data-injected-ui]")).map(e=>e.id);e?.forEach(e=>{ze.get(e)?.call(null)})}return c.appendChild(d),["click","focus","focusin","focusout","blur","dblclick","keyup","keypress","keydown","change","input","contextmenu"].forEach(e=>{d.addEventListener(e,t=>{const n=t.target.closest(`[data-on-${e}]`);if(!n)return;const{preventDefault:r}=n.dataset,s=n.dataset[`on${Re(e)}`];s&&o.caller?.callUserModel(s,Be(n,t)),"true"===r?.toLowerCase()&&t.preventDefault()},!1)}),n?.({el:d,float:s}),u=()=>{h?.(),ze.delete(a),c.removeChild(d)},ze.set(a,u),u}function We(e){if(!ze.has(e))return;const t=ze.get(e);try{t()}catch(t){console.warn("[CLEAN Injected UI] ",e,t)}}function qe(){const e=document.head.querySelectorAll(`script[data-ref=${this.id}]`);e?.forEach(e=>e.remove())}function Be(e,t){const n={};if(e){n.type=t.type;const r=e.dataset,s="rect";["value","id","className","dataset",s].forEach(t=>{let i;if(t===s){if(!r.hasOwnProperty(s))return;i=e.getBoundingClientRect().toJSON()}else i=e[t];"object"==typeof i&&(i={...i}),n[t]=i})}return n}function Ge(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=e,document.head.appendChild(t),()=>{try{document.head.removeChild(t)}catch(e){console.error(e)}}}function Je(e,t){const n=(t||[]).reduce((e,t)=>("default"in t&&(e[t.key]=t.default),e),{});return Object.assign(n,e)}function Ye(e){if("string"==typeof e)return e.trim().replace(/\s/g,"_").toLowerCase()}window.__injectedUIEffects=ze;var Ke=n(221),Ve=n.n(Ke);const Xe="application/x-postmate-v1+json";let Ze=0;const Qe={handshake:1,"handshake-reply":1,call:1,emit:1,reply:1,request:1},et=(e,t)=>!("string"==typeof t&&"*"!==t&&e.origin!==t||!e.data||"object"==typeof e.data&&!("postmate"in e.data)||e.data.type!==Xe||!Qe[e.data.postmate]);class tt{parent;frame;child;events={};childOrigin;listener;messagePort;addTransportListener(e){this.messagePort?(console.debug("[DEBUG] Using MessagePort for communication:",this.frame.src),this.messagePort.addEventListener("message",e),this.messagePort.start?.()):(console.debug("[DEBUG] Using postMessage for communication:",this.frame.src),this.parent.addEventListener("message",e,!1))}removeTransportListener(e){this.messagePort?this.messagePort.removeEventListener("message",e):this.parent.removeEventListener("message",e,!1)}postToChild(e){this.messagePort?this.messagePort.postMessage(e):this.child.postMessage(e,this.childOrigin)}constructor(e){this.parent=e.parent,this.frame=e.frame,this.child=e.child,this.childOrigin=e.childOrigin,this.messagePort=e.messagePort,this.listener=e=>{if(this.messagePort){if(!e?.data)return!1;if("object"==typeof e.data&&!("postmate"in e.data))return!1;if(e.data.type!==Xe)return!1;if(!Qe[e.data.postmate])return!1}else if(!et(e,this.childOrigin))return!1;const{data:t,name:n}=((e||{}).data||{}).value||{};"emit"===e.data.postmate&&n in this.events&&this.events[n].forEach(e=>{e.call(this,t)})},this.addTransportListener(this.listener)}get(e,...t){return new Promise((n,r)=>{const s=++Ze,i="number"==typeof rt.requestTimeout?rt.requestTimeout:1e4;let o;const a=e=>{e?.data?.uid===s&&"reply"===e.data.postmate&&(this.removeTransportListener(a),o&&clearTimeout(o),e.data.error?r(e.data.error):n(e.data.value))};this.addTransportListener(a),i>0&&(o=setTimeout(()=>{this.removeTransportListener(a),r(new Error(`Postmate: request timeout (${i}ms)`))},i)),this.postToChild({postmate:"request",type:Xe,property:e,args:t,uid:s})})}call(e,t){this.postToChild({postmate:"call",type:Xe,property:e,data:t})}on(e,t){this.events[e]||(this.events[e]=[]),this.events[e].push(t)}destroy(){this.removeTransportListener(this.listener);try{this.messagePort?.close()}catch(e){}this.frame.parentNode.removeChild(this.frame)}}class nt{model;parent;parentOrigin;child;messagePort;listener;addTransportListener(e){this.messagePort?(this.messagePort.addEventListener("message",e),this.messagePort.start?.()):this.child.addEventListener("message",e,!1)}postToParent(e,t){if(this.messagePort)this.messagePort.postMessage(e);else if(t?.source){const n="null"===t.origin?"*":t.origin;t.source.postMessage(e,n)}else this.parent.postMessage(e,this.parentOrigin)}constructor(e){if(this.model=e.model,this.parent=e.parent,this.parentOrigin=e.parentOrigin,this.child=e.child,this.messagePort=e.messagePort,this.listener=e=>{if(this.messagePort){if(!e?.data)return;if("object"==typeof e.data&&!("postmate"in e.data))return;if(e.data.type!==Xe)return;if(!Qe[e.data.postmate])return}else if(!et(e,this.parentOrigin))return;const{property:t,uid:n,data:r,args:s}=e.data;"call"!==e.data.postmate?((e,t,n)=>{const r="function"==typeof e[t]?e[t].apply(null,n):e[t];return Promise.resolve(r)})(this.model,t,s).then(r=>{this.postToParent({property:t,postmate:"reply",type:Xe,uid:n,value:r},e)}).catch(r=>{this.postToParent({property:t,postmate:"reply",type:Xe,uid:n,error:r},e)}):t in this.model&&"function"==typeof this.model[t]&&this.model[t](r)},this.addTransportListener(this.listener),!this.messagePort){const e=t=>{const n=t.detail?.port;n&&(this.child.removeEventListener("message",this.listener,!1),this.messagePort=n,this.messagePort.addEventListener("message",this.listener),this.messagePort.start?.(),this.child.removeEventListener("postmate:channel-ready",e))};this.child.addEventListener("postmate:channel-ready",e)}}emit(e,t){this.postToParent({postmate:"emit",type:Xe,value:{name:e,data:t}})}}class rt{static debug=!1;static requestTimeout=1e4;container;parent;frame;child;childOrigin;url;model;static Model;messagePort;enableMessageChannel;constructor(e){this.container=e.container,this.url=e.url,this.parent=window,this.frame=document.createElement("iframe"),e.id&&(this.frame.id=e.id),e.name&&(this.frame.name=e.name),e.allow&&(this.frame.allow=e.allow),this.frame.classList.add.apply(this.frame.classList,e.classListArray||[]),this.container.appendChild(this.frame),this.child=this.frame.contentWindow,this.model=e.model||{},this.enableMessageChannel=!!e.enableMessageChannel}sendHandshake(e){const t=(e=>{const t=document.createElement("a");if(t.href=e,"file:"===t.protocol)return"*";const n=t.protocol.length>4?t.protocol:window.location.protocol,r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host;return t.origin||`${n}//${r}`})(e=e||this.url);let n,r=0;return new Promise((s,i)=>{const o="undefined"!=typeof MessageChannel&&"function"==typeof MessageChannel,a=this.enableMessageChannel&&o,l=e=>{if(!et(e,t))return!1;if("handshake-reply"===e.data.postmate){if(clearInterval(n),this.parent.removeEventListener("message",l,!1),this.childOrigin=e.origin,a)if(e?.ports?.length){const t=e.ports[0];t&&(this.messagePort=t,this.messagePort.start?.())}else if(e.data.acceptsMessageChannel){const e=new MessageChannel;this.messagePort=e.port1,this.messagePort.start?.(),this.child.postMessage({postmate:"setup-channel",type:Xe},t,[e.port2])}return s(new tt(this))}return i("Failed handshake")};this.parent.addEventListener("message",l,!1);const c=()=>{r++;const e={postmate:"handshake",type:Xe,model:this.model,enableMessageChannel:a?1:0};this.child.postMessage(e,t),5===r&&clearInterval(n)};this.frame.addEventListener("load",()=>{c(),n=setInterval(c,500)}),this.frame.src=e})}destroy(){try{this.messagePort?.close()}catch(e){}this.frame.parentNode.removeChild(this.frame)}}class st{child;model;parent;parentOrigin;messagePort;enableMessageChannel;constructor(e){this.child=window,this.model=e,this.parent=this.child.parent,this.enableMessageChannel=!1}sendHandshakeReply(){return new Promise((e,t)=>{const n=r=>{if(r.data.postmate){if("handshake"===r.data.postmate){this.child.removeEventListener("message",n,!1),this.enableMessageChannel=!!r.data?.enableMessageChannel,this.parentOrigin=r.origin;const t="undefined"!=typeof MessageChannel&&"function"==typeof MessageChannel;r.source.postMessage({postmate:"handshake-reply",type:Xe,acceptsMessageChannel:this.enableMessageChannel&&t?1:0},"null"===r.origin?"*":r.origin);const s=r.data.model;if(s&&Object.keys(s).forEach(e=>{this.model[e]=s[e]}),this.enableMessageChannel&&t){const e=t=>{if("setup-channel"===t.data?.postmate&&t.data?.type===Xe&&t.origin===this.parentOrigin){const n=t?.ports?.[0];n&&(this.messagePort=n,this.messagePort.start?.(),this.child.dispatchEvent(new CustomEvent("postmate:channel-ready",{detail:{port:this.messagePort}}))),this.child.removeEventListener("message",e,!1)}};this.child.addEventListener("message",e,!1)}return e(new nt(this))}return t("Handshake Reply Failed")}};this.child.addEventListener("message",n,!1)})}}class it{ctx;opts;constructor(e,t){this.ctx=e,this.opts=t}get ctxId(){return this.ctx.baseInfo.id}setItem(e,t){return this.ctx.caller.callAsync("api:call",{method:"write-plugin-storage-file",args:[this.ctxId,e,t,this.opts?.assets]})}getItem(e){return this.ctx.caller.callAsync("api:call",{method:"read-plugin-storage-file",args:[this.ctxId,e,this.opts?.assets]})}removeItem(e){return this.ctx.caller.call("api:call",{method:"unlink-plugin-storage-file",args:[this.ctxId,e,this.opts?.assets]})}allKeys(){return this.ctx.caller.callAsync("api:call",{method:"list-plugin-storage-files",args:[this.ctxId,this.opts?.assets]})}clear(){return this.ctx.caller.call("api:call",{method:"clear-plugin-storage-files",args:[this.ctxId,this.opts?.assets]})}hasItem(e){return this.ctx.caller.callAsync("api:call",{method:"exist-plugin-storage-file",args:[this.ctxId,e,this.opts?.assets]})}}class ot{ctx;constructor(e){this.ctx=e}get React(){return this.ensureHostScope().React}get ReactDOM(){return this.ensureHostScope().ReactDOM}get Components(){return{Editor:this.ensureHostScope().logseq.sdk.experiments.cp_page_editor}}get Utils(){const e=this.ensureHostScope().logseq.sdk.utils,t=t=>e[Ce(t)];return{toClj:t("toClj"),jsxToClj:t("jsxToClj"),toJs:t("toJs"),toKeyword:t("toKeyword"),toSymbol:t("toSymbol")}}get pluginLocal(){return this.ensureHostScope().LSPluginCore.ensurePlugin(this.ctx.baseInfo.id)}invokeExperMethod(e,...t){const n=this.ensureHostScope();e=Ce(e)?.toLowerCase();const r=n.logseq.api["exper_"+e]||n.logseq.sdk.experiments[e];return r?.apply(n,t)}async loadScripts(...e){(e=e.map(e=>e?.startsWith("http")?e:this.ctx.resolveResourceFullUrl(e))).unshift(this.ctx.baseInfo.id),await this.invokeExperMethod("loadScripts",...e)}registerFencedCodeRenderer(e,t){return this.invokeExperMethod("registerFencedCodeRenderer",this.ctx.baseInfo.id,e,t)}registerDaemonRenderer(e,t){return this.invokeExperMethod("registerDaemonRenderer",this.ctx.baseInfo.id,e,t)}registerHostedRenderer(e,t){return this.invokeExperMethod("registerHostedRenderer",this.ctx.baseInfo.id,e,t)}registerSidebarRenderer(e,t){return e=`_sidebar.${e}`,t.type="sidebar",this.registerHostedRenderer(e,t)}registerRouteRenderer(e,t){return this.invokeExperMethod("registerRouteRenderer",this.ctx.baseInfo.id,e,t)}registerBlockPropertiesRenderer(e,t){return this.invokeExperMethod("registerBlockPropertiesRenderer",this.ctx.baseInfo.id,e,t)}registerBlockRenderer(e,t){return this.invokeExperMethod("registerBlockRenderer",this.ctx.baseInfo.id,e,t)}registerExtensionsEnhancer(e,t){const n=this.ensureHostScope();return"katex"===e&&n.katex&&t(n.katex).catch(console.error),this.invokeExperMethod("registerExtensionsEnhancer",this.ctx.baseInfo.id,e,t)}ensureHostScope(){try{window.top}catch(e){console.error("Can not access host scope!")}return window.top}}const at=e=>`task_callback_${e}`;class lt{_client;_requestId;_requestOptions;_promise;_aborted=!1;constructor(e,t,n={}){this._client=e,this._requestId=t,this._requestOptions=n,this._promise=new Promise((e,t)=>{if(!this._requestId)return t(null);this._client.once(at(this._requestId),n=>{n&&n instanceof Error?t(n):e(n)})});const{success:r,fail:s,final:i}=this._requestOptions;this._promise.then(e=>{r?.(e)}).catch(e=>{s?.(e)}).finally(()=>{i?.()})}abort(){this._requestOptions.abortable&&!this._aborted&&(this._client.ctx._execCallableAPI("http_request_abort",this._requestId),this._aborted=!0)}get promise(){return this._promise}get client(){return this._client}get requestId(){return this._requestId}}class ct extends s{_ctx;constructor(e){super(),this._ctx=e,this.ctx.caller.on("#lsp#request#callback",e=>{const t=e?.requestId;t&&this.emit(at(t),e?.payload)})}static createRequestTask(e,t,n){return new lt(e,t,n)}async _request(e){const t=this.ctx.baseInfo.id,{success:n,fail:r,final:s,...i}=e,o=this.ctx.Experiments.invokeExperMethod("request",t,i),a=ct.createRequestTask(this.ctx.Request,o,e);return i.abortable?a:a.promise}get ctx(){return this._ctx}}const ut=Array.isArray,ht="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;var dt="object"==typeof self&&self&&self.Object===Object&&self;const pt=ht||dt||Function("return this")(),ft=pt.Symbol;var gt=Object.prototype,mt=gt.hasOwnProperty,yt=gt.toString,_t=ft?ft.toStringTag:void 0;var bt=Object.prototype.toString;var vt=ft?ft.toStringTag:void 0;const wt=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":vt&&vt in Object(e)?function(e){var t=mt.call(e,_t),n=e[_t];try{e[_t]=void 0;var r=!0}catch(e){}var s=yt.call(e);return r&&(t?e[_t]=n:delete e[_t]),s}(e):function(e){return bt.call(e)}(e)},St=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},xt=function(e){if(!St(e))return!1;var t=wt(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},Ct=pt["__core-js_shared__"];var Et,At=(Et=/[^.]+$/.exec(Ct&&Ct.keys&&Ct.keys.IE_PROTO||""))?"Symbol(src)_1."+Et:"";var Tt=Function.prototype.toString;const Ot=function(e){if(null!=e){try{return Tt.call(e)}catch(e){}try{return e+""}catch(e){}}return""};var kt=/^\[object .+?Constructor\]$/,Pt=Function.prototype,Lt=Object.prototype,It=Pt.toString,jt=Lt.hasOwnProperty,Rt=RegExp("^"+It.call(jt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const Mt=function(e){return!(!St(e)||(t=e,At&&At in t))&&(xt(e)?Rt:kt).test(Ot(e));var t},Dt=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Mt(n)?n:void 0},Nt=function(){try{var e=Dt(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ut=function(e,t,n){for(var r=-1,s=Object(e),i=n(e),o=i.length;o--;){var a=i[++r];if(!1===t(s[a],a,s))break}return e},Ft=function(e){return null!=e&&"object"==typeof e},$t=function(e){return Ft(e)&&"[object Arguments]"==wt(e)};var zt=Object.prototype,Ht=zt.hasOwnProperty,Wt=zt.propertyIsEnumerable;const qt=$t(function(){return arguments}())?$t:function(e){return Ft(e)&&Ht.call(e,"callee")&&!Wt.call(e,"callee")};var Bt="object"==typeof exports&&exports&&!exports.nodeType&&exports,Gt=Bt&&"object"==typeof module&&module&&!module.nodeType&&module,Jt=Gt&&Gt.exports===Bt?pt.Buffer:void 0;const Yt=(Jt?Jt.isBuffer:void 0)||function(){return!1};var Kt=/^(?:0|[1-9]\d*)$/;const Vt=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&Kt.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991};var Zt={};Zt["[object Float32Array]"]=Zt["[object Float64Array]"]=Zt["[object Int8Array]"]=Zt["[object Int16Array]"]=Zt["[object Int32Array]"]=Zt["[object Uint8Array]"]=Zt["[object Uint8ClampedArray]"]=Zt["[object Uint16Array]"]=Zt["[object Uint32Array]"]=!0,Zt["[object Arguments]"]=Zt["[object Array]"]=Zt["[object ArrayBuffer]"]=Zt["[object Boolean]"]=Zt["[object DataView]"]=Zt["[object Date]"]=Zt["[object Error]"]=Zt["[object Function]"]=Zt["[object Map]"]=Zt["[object Number]"]=Zt["[object Object]"]=Zt["[object RegExp]"]=Zt["[object Set]"]=Zt["[object String]"]=Zt["[object WeakMap]"]=!1;var Qt="object"==typeof exports&&exports&&!exports.nodeType&&exports,en=Qt&&"object"==typeof module&&module&&!module.nodeType&&module,tn=en&&en.exports===Qt&&ht.process,nn=function(){try{return en&&en.require&&en.require("util").types||tn&&tn.binding&&tn.binding("util")}catch(e){}}(),rn=nn&&nn.isTypedArray;const sn=rn?(on=rn,function(e){return on(e)}):function(e){return Ft(e)&&Xt(e.length)&&!!Zt[wt(e)]};var on,an=Object.prototype.hasOwnProperty;const ln=function(e,t){var n=ut(e),r=!n&&qt(e),s=!n&&!r&&Yt(e),i=!n&&!r&&!s&&sn(e),o=n||r||s||i,a=o?function(e,t){for(var n=-1,r=Array(e);++n-1},yn.prototype.set=function(e,t){var n=this.__data__,r=gn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const _n=yn,bn=Dt(pt,"Map"),vn=Dt(Object,"create");var wn=Object.prototype.hasOwnProperty;var Sn=Object.prototype.hasOwnProperty;function xn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++ta))return!1;var c=i.get(e),u=i.get(t);if(c&&u)return c==t&&u==e;var h=-1,d=!0,p=2&n?new Ln:void 0;for(i.set(e,t),i.set(t,e);++h(ut(e?.blocks)&&(e.blocks=e.blocks.map(e=>e&&Dr(e,(e,t)=>`block/${t}`))),e)},rebuildBlocksIndice:{f:"onIndiceInit",args:["graph","blocks"]},transactBlocks:{f:"onBlocksChanged",args:["graph","data"]},truncateBlocks:{f:"onIndiceReset",args:["graph"]},removeDb:{f:"onGraph",args:["graph"]}}).forEach(([n,r])=>{const s=(e=>`service:search:${e}:${t.name}`)(n);e.caller.on(s,async n=>{if(xt(t?.[r.f])){let i=null;try{i=await t[r.f].apply(t,(r.args||[]).map(e=>{if(n){if(!0===e)return n;if(n.hasOwnProperty(e)){const t=n[e];return delete n[e],t}}})),r.transformOutput&&(i=r.transformOutput(i))}catch(e){console.error("[SearchService] ",e),i=e}finally{r.reply&&e.caller.call(`${s}:reply`,i)}}})})}}const Ur=Symbol.for("proxy-continue"),Fr=Ve()("LSPlugin:user"),$r=new Le("",{console:!0});function zr(e,t,n){const{key:r,label:s,desc:i,palette:o,keybinding:a,extras:l}=t;if("function"!=typeof n)return this.logger.error(`${r||s}: command action should be function.`),!1;const c=Ye(r);if(!c)return this.logger.error(`${s}: command key is required.`),!1;const u=`SimpleCommandHook${c}${++Gr}`;this.Editor["on"+u](n),this.caller?.call("api:call",{method:"register-plugin-simple-command",args:[this.baseInfo.id,[{key:c,label:s,type:e,desc:i,keybinding:a,extras:l},["editor/hook",u]],o]})}function Hr(e){return!!Ie(e)||($r.error(`#${e} is not a valid UUID string.`),!1)}let Wr=null,qr=new Map;const Br={async getInfo(e){return Wr||(Wr=await this._execCallableAPIAsync("get-app-info")),"string"==typeof e?Wr[e]:Wr},registerCommand:zr,registerSearchService(e){if(qr.has(e.name))throw new Error(`SearchService: #${e.name} has registered!`);qr.set(e.name,new Nr(this,e))},registerCommandPalette(e,t){const{key:n,label:r,keybinding:s}=e;return zr.call(this,"$palette$",{key:n,label:r,palette:!0,keybinding:s},t)},registerCommandShortcut(e,t,n={}){"string"==typeof e&&(e={mode:"global",binding:e});const{binding:r}=e,s="$shortcut$",i=n.key||s+Ce(r?.toString());return zr.call(this,s,{...n,key:i,palette:!1,keybinding:e},t)},registerUIItem(e,t){const n=this.baseInfo.id;this.caller?.call("api:call",{method:"register-plugin-ui-item",args:[n,e,t]})},registerPageMenuItem(e,t){if("function"!=typeof t)return!1;const n=e+"_"+this.baseInfo.id,r=e;zr.call(this,"page-menu-item",{key:n,label:r},t)},onBlockRendererSlotted(e,t){if(!Hr(e))return;const n=this.baseInfo.id,r=`hook:editor:${Ce(`slot:${e}`)}`;return this.caller.on(r,t),this.App._installPluginHook(n,r),()=>{this.caller.off(r,t),this.App._uninstallPluginHook(n,r)}},invokeExternalPlugin(e,...t){if(e=e?.trim(),!e)return;let[n,r]=e.split(".");if(!["models","commands"].includes(r?.toLowerCase()))throw new Error("Type only support '.models' or '.commands' currently.");const s=e.replace(`${n}.${r}.`,"");if(!n||!r||!s)throw new Error(`Illegal type of #${e} to invoke external plugin.`);return this._execCallableAPIAsync("invoke_external_plugin_cmd",n,r.toLowerCase(),s,t)},setFullScreen(e){const t=(...e)=>this._callWin("setFullScreen",...e);"toggle"===e?this._callWin("isFullScreen").then(e=>{e?t():t(!0)}):e?t(!0):t()}};let Gr=0;const Jr={newBlockUUID(){return this._execCallableAPIAsync("new_block_uuid")},isPageBlock:e=>e.uuid&&e.hasOwnProperty("name"),registerSlashCommand(e,t){Fr("Register slash command #",this.baseInfo.id,e,t),"function"==typeof t&&(t=[["editor/clear-current-slash",!1],["editor/restore-saved-cursor"],["editor/hook",t]]),t=t.map(e=>{const[t,...n]=e;if("editor/hook"===t){let r=n[0],s=()=>{this.caller?.callUserModel(r)};"function"==typeof r&&(s=r);const i=`SlashCommandHook${t}${++Gr}`;e[1]=i,this.Editor["on"+i](s)}return e}),this.caller?.call("api:call",{method:"register-plugin-slash-command",args:[this.baseInfo.id,[e,t]]})},registerBlockContextMenuItem(e,t){if("function"!=typeof t)return!1;const n=e+"_"+this.baseInfo.id;zr.call(this,"block-context-menu-item",{key:n,label:e},t)},registerHighlightContextMenuItem(e,t,n){if("function"!=typeof t)return!1;const r=e+"_"+this.baseInfo.id;zr.call(this,"highlight-context-menu-item",{key:r,label:e,extras:n},t)},scrollToBlockInPage(e,t,n){const r="block-content-"+t;n?.replaceState?this.App.replaceState("page",{name:e},{anchor:r}):this.App.pushState("page",{name:e},{anchor:r})}},Yr={onBlockChanged(e,t){if(!Hr(e))return;const n=this.baseInfo.id,r=`hook:db:${Ce(`block:${e}`)}`,s=({block:n,txData:r,txMeta:s})=>{n.uuid===e&&t(n,r,s)};return this.caller.on(r,s),this.App._installPluginHook(n,r),()=>{this.caller.off(r,s),this.App._uninstallPluginHook(n,r)}},datascriptQuery(e,...t){return t.pop(),t?.some(e=>"function"==typeof e)?this.Experiments.ensureHostScope().logseq.api.datascript_query(e,...t):this._execCallableAPIAsync("datascript_query",e,...t)}},Kr={},Vr={},Xr={},Zr={makeSandboxStorage(){return new it(this,{assets:!0})}};class Qr extends i{_baseInfo;_caller;_version=LIB_VERSION;_debugTag="";_settingsSchema;_connected=!1;_ui=new Map;_mFileStorage;_mRequest;_mExperiments;_beforeunloadCallback;constructor(e,t){super(),this._baseInfo=e,this._caller=t,t.on("sys:ui:visible",e=>{e?.toggle&&this.toggleMainUI()}),t.on("settings:changed",e=>{const t={...this.settings||{}},n={...e||{}};this._baseInfo={...this._baseInfo,settings:n},this.emit("settings:changed",n,t)}),t.on("beforeunload",async e=>{const{actor:t,...n}=e,r=this._beforeunloadCallback;try{r&&await r(n),t?.resolve(null)}catch(e){this.logger.error("[beforeunload] ",e),t?.reject(e)}})}async ready(e,t){if(!this._connected)try{"function"==typeof e&&(t=e,e={});let n=await this._caller.connectToParent(e);const r=n?.settings;this._connected=!0,n=Oe(this._baseInfo,n),void 0!==r&&(n.settings=r),this._baseInfo=n,n?.id&&(this._debugTag=this._caller.debugTag=`#${n.id} [${n.name}]`,this.logger.setTag(this._debugTag)),this._settingsSchema&&(n.settings=Je(n.settings,this._settingsSchema),await this.useSettingsSchema(this._settingsSchema));try{await this._execCallableAPIAsync("setSDKMetadata",{version:this._version,runtime:"js"})}catch(e){console.warn(e)}t&&t.call(this,n)}catch(e){console.error(`${this._debugTag} [Ready Error]`,e)}}ensureConnected(){if(!this._connected)throw new Error("not connected")}beforeunload(e){"function"==typeof e&&(this._beforeunloadCallback=e)}provideModel(e){return this.caller._extendUserModel(e),this}provideTheme(e){return this.caller.call("provider:theme",e),this}provideStyle(e){return this.caller.call("provider:style",e),this}provideUI(e){return this.caller.call("provider:ui",e),this}useSettingsSchema(e){return this.connected&&this.caller.call("settings:schema",{schema:e,isSync:!0}),this._settingsSchema=e,this}updateSettings(e){this.caller.call("settings:update",e)}onSettingsChanged(e){const t="settings:changed";return this.on(t,e),()=>this.off(t,e)}showSettingsUI(){this.caller.call("settings:visible:changed",{visible:!0})}hideSettingsUI(){this.caller.call("settings:visible:changed",{visible:!1})}setMainUIAttrs(e){this.caller.call("main-ui:attrs",e)}setMainUIInlineStyle(e){this.caller.call("main-ui:style",e)}hideMainUI(e){const t={key:0,visible:!1,cursor:e?.restoreEditingCursor};this.caller.call("main-ui:visible",t),this.emit("ui:visible:changed",t),this._ui.set(t.key,t)}showMainUI(e){const t={key:0,visible:!0,autoFocus:e?.autoFocus};this.caller.call("main-ui:visible",t),this.emit("ui:visible:changed",t),this._ui.set(t.key,t)}toggleMainUI(){const e=this._ui.get(0);e&&e.visible?this.hideMainUI():this.showMainUI()}get version(){return this._version}get isMainUIVisible(){const e=this._ui.get(0);return Boolean(e&&e.visible)}get connected(){return this._connected}get baseInfo(){return this._baseInfo}get effect(){return this&&(this.baseInfo?.effect||!this.baseInfo?.iir)}get logger(){return $r}get settings(){return this.baseInfo?.settings}get caller(){return this._caller}resolveResourceFullUrl(e){if(this.ensureConnected(),e)return e=e.replace(/^[.\\/]+/,""),De(this._baseInfo.lsr,e)}_makeUserProxy(e,t){const n=this,r=this.caller;return new Proxy(e,{get(e,s,i){const o=e[s];return function(...e){if(o){0!==e?.length&&e.push(t);const r=o.apply(n,e);if(r!==Ur)return r}if(t){const i=s.toString().match(/^(once|off|on)/i);if(null!=i){const s=i[0].toLowerCase(),o=i.input,a="off"===s,l=n.baseInfo.id;let c=o.slice(s.length),u=e[0],h=e[1];"string"==typeof u&&"function"==typeof h&&(u=u.replace(/^logseq./,":"),c=`${c}${u}`,u=h,h=e[2]),c=`hook:${t}:${Ce(c)}`,r[s](c,u);const d=()=>{r.off(c,u),r.listenerCount(c)||n.App._uninstallPluginHook(l,c)};return a?void d():(n.App._installPluginHook(l,c,h),d)}}let i=s;return["git","ui","assets","utils"].includes(t)&&(i=t+"_"+i),r.callAsync("api:call",{tag:t,method:i,args:e})}}})}_execCallableAPIAsync(e,...t){return this._caller.callAsync("api:call",{method:e,args:t})}_execCallableAPI(e,...t){this._caller.call("api:call",{method:e,args:t})}_callWin(...e){return this._execCallableAPIAsync("_callMainWin",...e)}#e;#t;#n;#r;#s;get App(){return this.#e?this.#e:this.#e=this._makeUserProxy(Br,"app")}get Editor(){return this.#t?this.#t:this.#t=this._makeUserProxy(Jr,"editor")}get DB(){return this.#n?this.#n:this.#n=this._makeUserProxy(Yr,"db")}get UI(){return this.#r?this.#r:this.#r=this._makeUserProxy(Vr,"ui")}get Utils(){return this.#s?this.#s:this.#s=this._makeUserProxy(Xr,"utils")}get Git(){return this._makeUserProxy(Kr,"git")}get Assets(){return this._makeUserProxy(Zr,"assets")}get FileStorage(){let e=this._mFileStorage;return e||(e=this._mFileStorage=new it(this)),e}get Request(){let e=this._mRequest;return e||(e=this._mRequest=new ct(this)),e}get Experiments(){let e=this._mExperiments;return e||(e=this._mExperiments=new ot(this)),e}}if(null==window.__LSP__HOST__){const e=new fs(null);window.logseq=new Qr({},e)}const{importHTML:es,createSandboxContainer:ts}=window.QSandbox||{};function ns(e,t){return e.startsWith("http")?fetch(e,t):(e=e.replace("file://",""),new Promise(async(t,n)=>{try{const n=await window.apis.doAction(["readFile",e]);t({text:()=>n})}catch(e){console.error(e),n(e)}}))}class rs extends i{_pluginLocal;_frame;_root;_loaded=!1;_unmountFns=[];constructor(e){super(),this._pluginLocal=e,e._dispose(()=>{this._unmount()})}async load(){const{name:e,entry:t}=this._pluginLocal.options;if(this.loaded||!t)return;const{template:n,execScripts:r}=await es(t,{fetch:ns});this._mount(n,document.body);const s=ts(e,{elementGetter:()=>this._root?.firstChild}).instance.proxy;s.__shadow_mode__=!0,s.LSPluginLocal=this._pluginLocal,s.LSPluginShadow=this,s.LSPluginUser=s.logseq=new Qr(this._pluginLocal.toJSON(),this._pluginLocal.caller);const i=await r(s,!0);this._unmountFns.push(i.unmount),this._loaded=!0}_mount(e,t){const n=this._frame=document.createElement("div");n.classList.add("lsp-shadow-sandbox"),n.id=this._pluginLocal.id,this._root=n.attachShadow({mode:"open"}),this._root.innerHTML=`
${e}
`,t.appendChild(n),this.emit("mounted")}_unmount(){for(const e of this._unmountFns)e&&e.call(null)}destroy(){this.frame?.parentNode?.removeChild(this.frame)}get loaded(){return this._loaded}get document(){return this._root?.firstChild}get frame(){return this._frame}}const ss=Ve()("LSPlugin:caller"),is="#await#response#",os="#lspmsg#",as="#lspmsg#error#",ls="#lspmsg#settings#",cs="#lspmsg#beforeunload#",us="#lspmsg#reply#",hs="#lspmsg#ready#",ds=e=>`${os}${e}`,ps=e=>`${is}${e}`;class fs extends i{_pluginLocal;_connected=!1;_parent;_child;_shadow;_status;_userModel={};_syncGCTimer=null;_call;_callUserModel;_debugTag="";constructor(e){super(),this._pluginLocal=e,e&&(this._debugTag=e.debugTag)}async connectToChild(){if(this._connected)return;const{shadow:e}=this._pluginLocal;e?await this._setupShadowSandbox():await this._setupIframeSandbox()}async connectToParent(e={}){if(this._connected)return;const t=this,n=null!=this._pluginLocal;let r=0;const s=new Map,i=Ue(6e4),o=this._extendUserModel({[hs]:async e=>{o[ds(e?.pid)]=({type:e,payload:n})=>{ss(`[host (_call) -> *user] ${this._debugTag}`,e,n),t.emit(e,n)},await i.resolve()},[cs]:async e=>{const n=Ue(1e4);t.emit("beforeunload",Object.assign({actor:n},e)),await n.promise},[ls]:async({payload:e})=>{t.emit("settings:changed",e)},[os]:async({ns:e,type:n,payload:r})=>{ss(`[host (async) -> *user] ${this._debugTag} ns=${e} type=${n}`,r),e&&e.startsWith("hook")?t.emit(`${e}:${n}`,r):t.emit(n,r)},[us]:({_sync:e,result:t})=>{if(ss(`[sync host -> *user] #${e}`,t),s.has(e)){const n=s.get(e);n&&(t?.hasOwnProperty(as)?n.reject(t[as]):n.resolve(t),s.delete(e))}},...e});if(n)return await i.promise,JSON.parse(JSON.stringify(this._pluginLocal?.toJSON()));const a=new st(o).sendHandshakeReply();return this._status="pending",await a.then(e=>{this._child=e,this._connected=!0,this._call=async(t,n={},i)=>{if(i){const e=++r;s.set(e,i),n._sync=e,i.setTag(`async call #${e}`),ss(`async call #${e}`)}return e.emit(ds(o.baseInfo.id),{type:t,payload:n}),i?.promise},this._callUserModel=async(e,t)=>{try{o[e](t)}catch(t){ss(`call user model(${e}) not exist. #${this._debugTag}`)}},this._syncGCTimer=setInterval(()=>{if(s.size>100)for(const[e,t]of s)t.settled&&s.delete(e)},18e5)}).finally(()=>{this._status=void 0}),await i.promise,o.baseInfo}async call(e,t={}){return this._call?.call(this,e,t)}async callAsync(e,t={}){const n=Ue(1e4);return this._call?.call(this,e,t,n)}async callUserModel(e,...t){return this._callUserModel?.apply(this,[e,...t])}async callUserModelAsync(e,...t){return e=ps(e),this._callUserModel?.apply(this,[e,...t])}_calcLayoutPosition(e,t,n=0){const r=Math.max(e,n);return"number"==typeof t?`${Math.min(100*r/t,99)}%`:`${r}px`}async _applyContainerLayout(e){const t=(await(this._pluginLocal?._loadLayoutsData()))?.$$0;if(!t)return;const{width:n,height:r,left:s,top:i,vw:o,vh:a}=t;e.dataset.inited_layout="true",Object.assign(e.style,{width:`${n}px`,height:`${r}px`,left:this._calcLayoutPosition(s,o),top:this._calcLayoutPosition(i,a,45)})}async _setupIframeSandbox(){const e=this._pluginLocal,t=e.id,n=`${t}_lsp_main`,r=new URL(e.options.entry);r.searchParams.set("__v__",be?Date.now().toString():e.options.version),document.querySelector(`#${n}`)?.remove();const s=document.createElement("div");s.classList.add("lsp-iframe-sandbox-container"),s.id=n,s.dataset.pid=t;try{await this._applyContainerLayout(s)}catch(e){console.error("[Restore Layout Error]",e)}document.body.appendChild(s);const i=new rt({id:t+"_iframe",container:s,url:r.href,classListArray:["lsp-iframe-sandbox"],model:{baseInfo:JSON.parse(JSON.stringify(e.toJSON()))},allow:e.options.allow,enableMessageChannel:!0});let o;this._status="pending";const a=new Promise((e,t)=>{o=setTimeout(()=>{i.destroy(),t(new Error("handshake Timeout"))},8e3)});try{const t=await Promise.race([i.sendHandshake(),a]);this._parent=t,this._connected=!0,this.emit("connected"),t.on(ds(e.id),({type:e,payload:t})=>{ss("[user -> *host] ",e,t),this._pluginLocal?.emit(e,t||{}),this._pluginLocal?.caller.emit(e,t||{})}),this._call=async(...n)=>{t.call(ds(e.id),{type:n[0],payload:Object.assign(n[1]||{},{$$pid:e.id})})},this._callUserModel=async(e,...n)=>{if(e.startsWith(is))return await t.get(e.replace(is,""),...n);t.call(e,n?.[0])}}catch(e){throw ss("[iframe sandbox] error",e),e}finally{clearTimeout(o),this._status=void 0}}async _setupShadowSandbox(){const e=this._pluginLocal,t=this._shadow=new rs(e);try{this._status="pending",await t.load(),this._connected=!0,this.emit("connected"),this._call=async(t,n={},r)=>(r&&(n.actor=r),this._pluginLocal?.emit(t,Object.assign(n,{$$pid:e.id})),r?.promise),this._callUserModel=async(...e)=>{let t=e[0];t?.startsWith(is)&&(t=t.replace(is,""));const n=e[1]||{},r=this._userModel[t];"function"==typeof r&&await r.call(null,n)}}catch(e){throw ss("[shadow sandbox] error",e),e}finally{this._status=void 0}}_extendUserModel(e){return Object.assign(this._userModel,e)}_getSandboxIframeContainer(){return this._parent?.frame.parentNode}_getSandboxShadowContainer(){return this._shadow?.frame}_getSandboxIframeRoot(){return this._parent?.frame}_getSandboxShadowRoot(){return this._shadow?.frame}set debugTag(e){this._debugTag=e}async destroy(){let e=null;this._parent&&(e=this._getSandboxIframeContainer(),this._parent.destroy()),this._shadow&&(e=this._getSandboxShadowContainer(),this._shadow.destroy()),e?.parentNode?.removeChild(e),this._syncGCTimer&&(clearInterval(this._syncGCTimer),this._syncGCTimer=null),this._connected=!1,this._parent=void 0,this._child=void 0,this._shadow=void 0,this._call=void 0,this._callUserModel=void 0,this._status=void 0}}const gs=Ve()("LSPlugin:core"),ms="plugins";class ys extends i{_userPluginSettings;_schema;_settings={disabled:!1};constructor(e,t){super(),this._userPluginSettings=e,this._schema=t,Object.assign(this._settings,e)}get(e){return this._settings[e]}set(e,t){const n=Oe({},this._settings);this._settings[e]!==t&&(this._settings={...this._settings,[e]:t},this.emit("change",{...this._settings},n))}patch(e){if(!Te(e))return;const t=Oe({},this._settings);this._settings=Oe(this._settings,e),this.emit("change",{...this._settings},t)}replace(e){const t=Oe({},this._settings);this._settings={disabled:!1,...e||{}},this.emit("change",{...this._settings},t)}set settings(e){this.replace(e)}get settings(){return this._settings}setSchema(e,t){this._schema=e,t&&this.replace(Je(this._settings,e))}reset(){const e=this.settings,t={};this._schema,this.replace(t),this.emit("reset",t,e)}toJSON(){return this._settings}}var _s;function bs(e,t){return t&&e.startsWith(ve+t)&&(e=De(Se,e.substr(ve.length+t.length))),e}!function(e){e.LOADING="loading",e.UNLOADING="unloading",e.LOADED="loaded",e.UNLOADED="unload",e.ERROR="error"}(_s||(_s={}));class vs extends Error{url;packageJsonPath;constructor(e,t={}){super(e),this.name="IllegalPluginPackageError",Object.assign(this,t)}}class ws extends Error{constructor(e){super(e),this.name="ExistedImportedPluginPackageError"}}class Ss extends i{_options;_themeMgr;_ctx;_sdk={};_runtimeDisposes=[];_registrationDisposes=[];_id;_status=_s.UNLOADED;_loadErr;_localRoot;_dotSettingsFile;_caller;_logger=new Le("PluginLocal");_disposeSettingsObserver;constructor(e,t,n){var r;super(),this._options=e,this._themeMgr=t,this._ctx=n,this._id=e.key||je(),this._disposeRegistration(async()=>{this._disposeSettingsObserver?.(),this._disposeSettingsObserver=void 0}),function(e){const t=e=>`settings:${e}`;e.on(t("schema"),({schema:t,isSync:n})=>{e.settingsSchema=t,e.settings?.setSchema(t,n)}),e.on(t("update"),t=>{t&&e.settings?.patch(t)}),e.on(t("visible:changed"),t=>{const n=t?.visible;Fe("set_focused_settings",n?e.id:null)})}(this),function(e){const t=e=>`main-ui:${e}`;e.on(t("visible"),({visible:t,toggle:n,cursor:r,autoFocus:s})=>{const i=e.getMainUIContainer();i?.classList[n?"toggle":t?"add":"remove"]("visible"),t?!e.shadow&&i&&!1!==s&&i.querySelector("iframe")?.contentWindow?.focus():i.ownerDocument.activeElement.blur(),r&&Fe("restore_editing_cursor")}),e.on(t("attrs"),t=>{const n=e.getMainUIContainer();Object.entries(t).forEach(([t,r])=>{n?.setAttribute(t,String(r)),"draggable"===t&&r&&e._dispose(e._setupDraggableContainer(n,{title:e.options.name,close:()=>{e.caller.call("sys:ui:visible",{toggle:!0})}})),"resizable"===t&&r&&e._dispose(e._setupResizableContainer(n))})}),e.on(t("style"),t=>{const n=e.getMainUIContainer(),r=!!n.dataset.inited_layout;Object.entries(t).forEach(([e,t])=>{r&&["left","top","bottom","right","width","height"].includes(e)||(n.style[e]=t)})})}(this),function(e){const t=e=>`provider:${e}`;let n=!1;e.on(t("theme"),t=>{e.themeMgr.registerTheme(e.id,t),n||(e._dispose(()=>{e.themeMgr.unregisterTheme(e.id)}),n=!0)}),e.on(t("style"),t=>{let n;"string"!=typeof t&&(n=t.key,t=t.style),t&&t.trim()&&e._dispose($e(t,{"data-injected-style":n?`${n}-${e.id}`:"","data-ref":e.id}))}),e.on(t("ui"),t=>{e._onHostMounted(()=>{const n=He.call(e,t,Object.assign({"data-ref":e.id},t.attrs||{}),({el:t,float:n})=>{if(!n)return;const r=t.dataset.identity;e.layoutCore.move_container_to_top(r)});"function"==typeof n&&e._dispose(n)})})}(this),(r=this).on("api:call",async e=>{let t;try{window.$$callerPluginID=r.id,t=await Fe.apply(r,[e.method,...e.args])}catch(e){t={[as]:e}}finally{window.$$callerPluginID=void 0}if(r.shadow)return void(e.actor&&(t?.hasOwnProperty(as)?e.actor.reject(t[as]):e.actor.resolve(t)));const{_sync:n}=e;if(null!=n){const e=e=>{r.caller?.callUserModel(us,{result:e,_sync:n})};Promise.resolve(t).then(e,e)}})}async _setupUserSettings(e){const{_options:t}=this;this._logger||(this._logger=new Le("Loader"));const n=this._logger;if(!t.settings||e||!this._disposeSettingsObserver)try{const r=()=>Fe("load_plugin_user_settings",this.id),[s,i]=await r();this._dotSettingsFile=s;let o=t.settings;o||(o=t.settings=new ys(i)),this._disposeSettingsObserver?.(),this._disposeSettingsObserver=void 0,e&&o.replace(i);const a=async(e,t)=>{const r=function(e,t){e=e||{},t=t||{};const n=new Set([...Object.keys(e),...Object.keys(t)]),r=[],s=e=>{if(void 0===e)return"undefined";try{const t=JSON.stringify(e);return t&&t.length>80?t.slice(0,77)+"...":t}catch(t){return String(e)}};for(const i of n){const n=e[i],o=t[i];if(n!==o)if(i in e)if(i in t){try{if(JSON.stringify(n)===JSON.stringify(o))continue}catch(e){}r.push(`${i}: ${s(n)} -> ${s(o)}`)}else r.push(`-${i}`);else r.push(`+${i}: ${s(o)}`)}return r.length?r.join(", "):null}(t,e);r&&n.debug("settings changed",r),e&&Fe("save_plugin_user_settings",this.id,e)};o.on("change",a);const l=()=>{o.off("change",a),this._disposeSettingsObserver===l&&(this._disposeSettingsObserver=void 0)};this._disposeSettingsObserver=l}catch(e){gs("[load plugin user settings Error]",e),n?.error("load user settings failed",e)}}getMainUIContainer(){return this.shadow?this.caller?._getSandboxShadowContainer():this.caller?._getSandboxIframeContainer()}_resolveResourceFullUrl(e,t){if(!e?.trim())return;if(t=t||this._localRoot,this.isWebPlugin)return this.installedFromUserWebUrl?`${this.installedFromUserWebUrl}/${e}`:`https://pub-80f42b85b62c40219354a834fcf2bbfa.r2.dev/${_e.join(t,e)}`;const n=/^(http|file)/;if(!n.test(e)){const r=_e.join(t,e);e=n.test(r)?r:ve+r}return!this.options.effect&&this.isInstalledInLocalDotRoot?bs(e,this.dotPluginsRoot):e}async _preparePackageConfigs(){const{url:e,webPkg:t}=this._options;let n=t;if(!n){let t;if(e){gs("prepare package root",e),this._logger?.debug("prepare package root",e);try{n=await Fe("load_plugin_config",e),n?(n=JSON.parse(n),n||(t=`Parse package config error #${e}/package.json`)):t=`Parse package config error #${e}/package.json`}catch(e){t=e?.message||String(e)}}else t="Can not resolve package config location";if(t)throw new vs(t,{url:e,packageJsonPath:e?_e.join(e,"package.json"):void 0})}["name","author","repository","version","description","repo","title","effect","sponsors"].concat(this.isInstalledInLocalDotRoot?[]:["devEntry"]).forEach(e=>{this._options[e]=n[e]});const{repo:r,version:s}=this._options,i=this._localRoot=this.isWebPlugin?`${r||e}/${s}`:Ne(e),o=n.logseq||{},a=o.entry||o.main||n.main;o.devEntry?(this._options.devEntry=o.devEntry,this._options.entry=o.devEntry):this._options.entry=this._resolveResourceFullUrl(a,i),o.mode&&(this._options.mode=o.mode);const l=o.title||n.title,c=o.icon||n.icon;if(this._options.title=l,this._options.icon=c&&this._resolveResourceFullUrl(c),this._options.theme=Boolean(o.theme||!!o.themes),this.isInstalledInLocalDotRoot)this._id=_e.basename(i);else if(!this.isWebPlugin)if(o.id)this._id=o.id;else{o.id=this.id;try{await Fe("save_plugin_package_json",e,{...n,logseq:o})}catch(e){gs("[save plugin ID Error] ",e),this._logger?.warn("save plugin id failed",e)}}const{registeredPlugins:u,isRegistering:h}=this._ctx;if(h&&u.has(this.id))throw new ws(this.id);return async()=>{try{const e=o.themes;e&&await this._loadConfigThemes(Array.isArray(e)?e:[e])}catch(e){gs("[prepare package effect Error]",e),this._logger?.error("prepare package effect failed",e)}}}async _tryToNormalizeEntry(){let{entry:e,settings:t,devEntry:n}=this.options;if(n=n||t?.get("_devEntry"),n)return void(this._options.entry=n);if(!e.endsWith(".js"))return;let r=null,s="write_user_tmp_file";this.isInstalledInLocalDotRoot&&(s="write_dotdir_file",r=this._localRoot.replace(this.dotPluginsRoot,""),r=_e.join(ms,r));const i=(new Date).getDay(),o=await Ae(),a=await Fe(s,`${this._id}_index.html`,`\n\n \n \n logseq plugin entry\n ${this.isWebPlugin?` + + + diff --git a/resources/index.html b/resources/index.html index 399763d822f7..0f6aa2d4fd02 100644 --- a/resources/index.html +++ b/resources/index.html @@ -45,6 +45,9 @@ + + + diff --git a/resources/js/tabler.ext.js b/resources/js/tabler.ext.js index e2d1a89abcc2..7559a6ccf8de 100644 --- a/resources/js/tabler.ext.js +++ b/resources/js/tabler.ext.js @@ -1 +1 @@ -(()=>{function o(o,e,n,r){Object.defineProperty(o,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=globalThis,n={},r={},t=e.parcelRequiree92c;null==t&&((t=function(o){if(o in n)return n[o].exports;if(o in r){var e=r[o];delete r[o];var t={id:o,exports:{}};return n[o]=t,e.call(t.exports,t,t.exports),t.exports}var i=Error("Cannot find module '"+o+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(o,e){r[o]=e},e.parcelRequiree92c=t);var i=t.register;i("9Hk4c",function(e,n){o(e.exports,"Fragment",()=>r,o=>r=o),o(e.exports,"jsx",()=>i,o=>i=o),o(e.exports,"jsxs",()=>s,o=>s=o);var r,i,s,l=t("a46g0"),C=Symbol.for("react.element"),c=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function w(o,e,n){var r,t={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==e.key&&(i=""+e.key),void 0!==e.ref&&(s=e.ref),e)d.call(e,r)&&!h.hasOwnProperty(r)&&(t[r]=e[r]);if(o&&o.defaultProps)for(r in e=o.defaultProps)void 0===t[r]&&(t[r]=e[r]);return{$$typeof:C,type:o,key:i,ref:s,props:t,_owner:a.current}}r=c,i=w,s=w}),i("a46g0",function(o,e){o.exports=React});var s={};s=t("9Hk4c"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),window.tablerIcons=window.tablerIcons||{},window.tablerIcons.IconAddLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAddLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2933 4.29278C13.1438 3.4422 14.2975 2.96436 15.5004 2.96436C16.7033 2.96436 17.8569 3.4422 18.7075 4.29278C19.5581 5.14336 20.0359 6.29699 20.0359 7.49989C20.0359 8.70279 19.5581 9.85642 18.7075 10.707L14.7109 14.7036C14.2927 15.1294 13.7939 15.4678 13.2436 15.699C12.6917 15.9309 12.099 16.0504 11.5004 16.0504C10.9017 16.0504 10.309 15.9309 9.7571 15.699C9.20517 15.4671 8.70507 15.1274 8.28608 14.6997C7.89956 14.3053 7.90602 13.6721 8.30051 13.2856C8.695 12.8991 9.32813 12.9055 9.71465 13.3C9.94742 13.5376 10.2253 13.7263 10.5319 13.8552C10.8385 13.984 11.1678 14.0504 11.5004 14.0504C11.833 14.0504 12.1622 13.984 12.4688 13.8552C12.7755 13.7263 13.0533 13.5376 13.2861 13.3L13.2932 13.2927L13.2933 13.2928L17.2933 9.29278C17.7688 8.81728 18.0359 8.17235 18.0359 7.49989C18.0359 6.82742 17.7688 6.1825 17.2933 5.707C16.8178 5.23149 16.1728 4.96436 15.5004 4.96436C14.8279 4.96436 14.183 5.23149 13.7075 5.707L13.2075 6.207C12.8169 6.59752 12.1838 6.59752 11.7933 6.207C11.4027 5.81647 11.4027 5.18331 11.7933 4.79278L12.2933 4.29278ZM8.75711 8.30085C9.30904 8.06892 9.9017 7.94946 10.5004 7.94946C11.0991 7.94946 11.6917 8.06892 12.2436 8.30085C12.7956 8.53277 13.2957 8.87249 13.7147 9.30012C14.1012 9.69461 14.0947 10.3277 13.7002 10.7143C13.3057 11.1008 12.6726 11.0943 12.2861 10.6998C12.0533 10.4623 11.7755 10.2735 11.4689 10.1447C11.1622 10.0158 10.833 9.94946 10.5004 9.94946C10.1678 9.94946 9.83853 10.0158 9.5319 10.1447C9.22527 10.2735 8.94743 10.4623 8.71466 10.6998L8.70752 10.7071L8.70748 10.7071L4.70748 14.7071C4.23198 15.1826 3.96484 15.8275 3.96484 16.5C3.96484 17.1724 4.23198 17.8174 4.70748 18.2929C5.18299 18.7684 5.82791 19.0355 6.50038 19.0355C7.17284 19.0355 7.81777 18.7684 8.29327 18.2929L8.79327 17.7929C9.18379 17.4023 9.81696 17.4023 10.2075 17.7929C10.598 18.1834 10.598 18.8166 10.2075 19.2071L9.70748 19.7071C8.85691 20.5577 7.70328 21.0355 6.50038 21.0355C5.29748 21.0355 4.14385 20.5577 3.29327 19.7071C2.44269 18.8565 1.96484 17.7029 1.96484 16.5C1.96484 15.2971 2.44269 14.1434 3.29327 13.2929L7.28985 9.29629C7.70807 8.87046 8.20683 8.53208 8.75711 8.30085ZM19.0005 14C19.5528 14 20.0005 14.4477 20.0005 15V17H22.0005C22.5528 17 23.0005 17.4477 23.0005 18C23.0005 18.5523 22.5528 19 22.0005 19H20.0005V21C20.0005 21.5523 19.5528 22 19.0005 22C18.4482 22 18.0005 21.5523 18.0005 21V19H16.0005C15.4482 19 15.0005 18.5523 15.0005 18C15.0005 17.4477 15.4482 17 16.0005 17H18.0005V15C18.0005 14.4477 18.4482 14 19.0005 14Z",fill:e})})},window.tablerIcons.IconAppFeature=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAppFeature",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7C2 5.34315 3.34315 4 5 4H19C20.6569 4 22 5.34315 22 7V17C22 18.6569 20.6569 20 19 20H15.0209C15.0064 20.0003 14.992 20.0003 14.9776 20H9.02243C9.00802 20.0003 8.99357 20.0003 8.97908 20H5C3.34315 20 2 18.6569 2 17V7ZM13.7192 18L13.5299 17.2425C13.4447 16.9018 13.5445 16.5413 13.7929 16.2929L14.8787 15.2071L13.3586 14.9899C13.0337 14.9435 12.7523 14.7407 12.6056 14.4472L12 13.2361L11.3944 14.4472C11.2477 14.7407 10.9663 14.9435 10.6414 14.9899L9.12132 15.2071L10.2071 16.2929C10.4555 16.5413 10.5553 16.9018 10.4701 17.2425L10.2808 18H13.7192ZM15.7808 18H19C19.5523 18 20 17.5523 20 17V7C20 6.44772 19.5523 6 19 6H5C4.44772 6 4 6.44772 4 7V17C4 17.5523 4.44772 18 5 18H8.21922L8.39254 17.3067L6.29289 15.2071C6.02506 14.9393 5.93154 14.5431 6.05132 14.1838C6.17109 13.8244 6.48361 13.5636 6.85858 13.5101L9.83989 13.0841L11.1056 10.5528C11.275 10.214 11.6212 10 12 10C12.3788 10 12.725 10.214 12.8944 10.5528L14.1601 13.0841L17.1414 13.5101C17.5164 13.5636 17.8289 13.8244 17.9487 14.1838C18.0685 14.5431 17.9749 14.9393 17.7071 15.2071L15.6075 17.3067L15.7808 18Z",fill:e}),(0,s.jsx)("path",{d:"M6 6.99C6.55228 6.99 7 7.43771 7 7.99V8C7 8.55229 6.55228 9 6 9C5.44772 9 5 8.55229 5 8V7.99C5 7.43771 5.44772 6.99 6 6.99Z",fill:e}),(0,s.jsx)("path",{d:"M9 6.99C9.55228 6.99 10 7.43771 10 7.99V8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8V7.99C8 7.43771 8.44772 6.99 9 6.99Z",fill:e})]})},window.tablerIcons.IconBacklog=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBacklog",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2",strokeDasharray:"4 4"})})},window.tablerIcons.IconBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 10C9 9.44772 9.44772 9 10 9H22C22.5523 9 23 9.44772 23 10V14C23 14.5523 22.5523 15 22 15H10C9.44772 15 9 14.5523 9 14V10ZM11 11V13H21V11H11ZM1 12C1 10.8954 1.89543 10 3 10C4.10457 10 5 10.8954 5 12C5 13.1046 4.10457 14 3 14C1.89543 14 1 13.1046 1 12Z",fill:e})})},window.tablerIcons.IconBlockEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M22 10H13V14H22M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM11 17V19H21V17H11ZM9 16C9 15.4477 9.44772 15 10 15H22C22.5523 15 23 15.4477 23 16V20C23 20.5523 22.5523 21 22 21H10C9.44772 21 9 20.5523 9 20V16ZM1 18C1 16.8954 1.89543 16 3 16C4.10457 16 5 16.8954 5 18C5 19.1046 4.10457 20 3 20C1.89543 20 1 19.1046 1 18Z",fill:e})})},window.tablerIcons.IconBlockRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 14H10V10H22V12M18 16C17.3581 17.6049 17.3581 19.3951 18 21M22 16C22.6419 17.6049 22.6419 19.3951 22 21M4 12C4 12.5523 3.55228 13 3 13C2.44772 13 2 12.5523 2 12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H14C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconCalendarDots=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCalendarDots",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 4H6C4.89543 4 4 4.89543 4 6V10M8 4H16M8 4V2M8 4V6M16 4H18C19.1046 4 20 4.89543 20 6V10M16 4V2M16 4V6M4 10H20M4 10V14M20 10V14M6 20C6 20.5523 5.55228 21 5 21C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19C5.55228 19 6 19.4477 6 20ZM13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20C11 19.4477 11.4477 19 12 19C12.5523 19 13 19.4477 13 20ZM20 20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20C18 19.4477 18.4477 19 19 19C19.5523 19 20 19.4477 20 20Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconCancelled=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCancelled",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M13 7L7 13M7 7L13 13",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconCloudExclamation=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCloudExclamation",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4366 6.03387C12.8308 5.92373 12.2062 5.92205 11.5997 6.02894C10.9931 6.13582 10.4204 6.34848 9.91384 6.65116C8.89016 7.26279 8.20994 8.19494 7.98007 9.21902C7.87759 9.67556 7.47225 10 7.00435 10C6.00786 10 5.06063 10.3791 4.36896 11.0407C3.6788 11.7008 3.2998 12.5864 3.2998 13.5C3.2998 14.4136 3.6788 15.2992 4.36896 15.9593C5.06063 16.6209 6.00786 17 7.00435 17H8C8.55228 17 9 17.4477 9 18C9 18.5523 8.55228 19 8 19H7.00435C5.5054 19 4.05939 18.4308 2.98651 17.4046C1.91213 16.3769 1.2998 14.9734 1.2998 13.5C1.2998 12.0266 1.91213 10.6231 2.98651 9.59538C3.87696 8.74365 5.02444 8.20677 6.24589 8.04882C6.72397 6.76252 7.65926 5.66843 8.88803 4.93427C9.60923 4.50337 10.4128 4.20727 11.2526 4.05929C12.0923 3.91131 12.9556 3.91362 13.7943 4.06613C14.6332 4.21864 15.4349 4.5191 16.1534 4.95398C16.8721 5.38893 17.4955 5.95128 17.9839 6.61332C18.4724 7.27568 18.8155 8.02416 18.988 8.817C19.0731 9.20796 19.1156 9.60469 19.1155 10.0014C20.2687 10.0298 21.3686 10.5003 22.1863 11.318C23.0302 12.1619 23.5044 13.3065 23.5044 14.5C23.5044 15.6935 23.0302 16.8381 22.1863 17.682C21.3424 18.5259 20.1978 19 19.0044 19H16C15.4477 19 15 18.5523 15 18C15 17.4477 15.4477 17 16 17H19.0044C19.6674 17 20.3033 16.7366 20.7721 16.2678C21.241 15.7989 21.5044 15.163 21.5044 14.5C21.5044 13.837 21.241 13.2011 20.7721 12.7322C20.3033 12.2634 19.6674 12 19.0044 12H18.0044C17.7007 12 17.4134 11.862 17.2236 11.6249C17.0339 11.3878 16.9621 11.0773 17.0286 10.781C17.1427 10.273 17.1444 9.75071 17.0337 9.24219C16.9231 8.7334 16.7009 8.24319 16.3744 7.80054C16.0476 7.35756 15.6221 6.9702 15.1178 6.66498C14.6134 6.35969 14.0423 6.144 13.4366 6.03387ZM12 14C12.5523 14 13 14.4477 13 15V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V15C11 14.4477 11.4477 14 12 14ZM12 21C12.5523 21 13 21.4477 13 22V22.01C13 22.5623 12.5523 23.01 12 23.01C11.4477 23.01 11 22.5623 11 22.01V22C11 21.4477 11.4477 21 12 21Z",fill:e})})},window.tablerIcons.IconConnector=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtConnector",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5C11 4.44772 11.4477 4 12 4H19C19.5523 4 20 4.44772 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V7.41421L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L16.5858 6H12C11.4477 6 11 5.55228 11 5Z",fill:e})})},window.tablerIcons.IconDeselectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDeselectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 9L12 12M12 12L9 15M12 12L9 9M12 12L15 15M3 3H21V21H3V3ZM2 2H4V4H2V2ZM20 2H22V4H20V2ZM20 20H22V22H20V20ZM2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconDone=function({size:o=24,color:e="currentColor",color2:n="white",stroke:r=0,...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:r,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDone",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M6.5 10L9 12.5L14 7.5",stroke:n,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconGroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtGroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2C1 1.44772 1.44772 1 2 1H4C4.55228 1 5 1.44772 5 2H19C19 1.44772 19.4477 1 20 1H22C22.5523 1 23 1.44772 23 2V4C23 4.55228 22.5523 5 22 5V19C22.5523 19 23 19.4477 23 20V22C23 22.5523 22.5523 23 22 23H20C19.4477 23 19 22.5523 19 22H5C5 22.5523 4.55228 23 4 23H2C1.44772 23 1 22.5523 1 22V20C1 19.4477 1.44772 19 2 19V5C1.44772 5 1 4.55228 1 4V2ZM4 5V19C4.55228 19 5 19.4477 5 20H19C19 19.4477 19.4477 19 20 19V5C19.4477 5 19 4.55228 19 4H5C5 4.55228 4.55228 5 4 5ZM6 7C6 6.44772 6.44772 6 7 6H13C13.5523 6 14 6.44772 14 7V9H17C17.5523 9 18 9.44772 18 10V17C18 17.5523 17.5523 18 17 18H10C9.44772 18 9 17.5523 9 17V14H7C6.44772 14 6 13.5523 6 13V7ZM11 14V16H16V11H14V13C14 13.5523 13.5523 14 13 14H11ZM12 8H8V12H12V8Z",fill:e})})},window.tablerIcons.IconHAuto=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtH-auto",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H5C5.55228 5 6 5.44772 6 6C6 6.55228 5.55228 7 5 7V11H11V7C10.4477 7 10 6.55228 10 6C10 5.44772 10.4477 5 11 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7V17C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18C10 17.4477 10.4477 17 11 17V13H5V17C5.55228 17 6 17.4477 6 18C6 18.5523 5.55228 19 5 19H3C2.44772 19 2 18.5523 2 18C2 17.4477 2.44772 17 3 17V7C2.44772 7 2 6.55228 2 6ZM19 11C18.7348 11 18.4804 11.1054 18.2929 11.2929C18.1054 11.4804 18 11.7348 18 12V14H20V12C20 11.7348 19.8946 11.4804 19.7071 11.2929C19.5196 11.1054 19.2652 11 19 11ZM22 12C22 11.2043 21.6839 10.4413 21.1213 9.87868C20.5587 9.31607 19.7957 9 19 9C18.2043 9 17.4413 9.31607 16.8787 9.87868C16.3161 10.4413 16 11.2043 16 12V18C16 18.5523 16.4477 19 17 19C17.5523 19 18 18.5523 18 18V16H20V18C20 18.5523 20.4477 19 21 19C21.5523 19 22 18.5523 22 18V12Z",fill:e})})},window.tablerIcons.IconHeadingOff=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHeadingOff",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.29289 2.29289C2.68342 1.90237 3.31658 1.90237 3.70711 2.29289L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L18.5858 20H15C14.4477 20 14 19.5523 14 19C14 18.4477 14.4477 18 15 18H16V17.4142L11.5858 13H8V18H9C9.55228 18 10 18.4477 10 19C10 19.5523 9.55228 20 9 20H5C4.44772 20 4 19.5523 4 19C4 18.4477 4.44772 18 5 18H6V7.41421L2.29289 3.70711C1.90237 3.31658 1.90237 2.68342 2.29289 2.29289ZM8 9.41421V11H9.58579L8 9.41421ZM8 5C8 4.44772 8.44772 4 9 4H10C10.5523 4 11 4.44772 11 5C11 5.55228 10.5523 6 10 6H9C8.44772 6 8 5.55228 8 5ZM14 5C14 4.44772 14.4477 4 15 4H19C19.5523 4 20 4.44772 20 5C20 5.55228 19.5523 6 19 6H18V12C18 12.5523 17.5523 13 17 13C16.4477 13 16 12.5523 16 12V6H15C14.4477 6 14 5.55228 14 5Z",fill:e})})},window.tablerIcons.IconHtmlEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHtmlEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.22222 10L5 12L7.22222 14M16.7778 10L19 12L16.7778 14M13.1111 8L10.8889 16M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconInProgress25=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress25",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M15 10C15 9.34339 14.8707 8.69321 14.6194 8.08658C14.3681 7.47995 13.9998 6.92876 13.5355 6.46447C13.0712 6.00017 12.52 5.63188 11.9134 5.3806C11.3068 5.12933 10.6566 5 10 5V10H15Z",fill:e})]})},window.tablerIcons.IconInProgress50=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress50",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M10 15C11.3261 15 12.5979 14.4732 13.5355 13.5355C14.4732 12.5979 15 11.3261 15 10C15 8.67392 14.4732 7.40215 13.5355 6.46447C12.5979 5.52678 11.3261 5 10 5L10 10V15Z",fill:e})]})},window.tablerIcons.IconInProgress75=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress75",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M5 10C5 10.9889 5.29324 11.9556 5.84265 12.7779C6.39206 13.6001 7.17295 14.241 8.08658 14.6194C9.00021 14.9978 10.0055 15.0969 10.9755 14.9039C11.9454 14.711 12.8363 14.2348 13.5355 13.5355C14.2348 12.8363 14.711 11.9454 14.9039 10.9755C15.0969 10.0055 14.9978 9.00021 14.6194 8.08658C14.241 7.17295 13.6001 6.39206 12.7779 5.84265C11.9556 5.29325 10.9889 5 10 5L10 10L5 10Z",fill:e})]})},window.tablerIcons.IconInReview=function({size:o=24,color:e="currentColor",stroke:n=0,color2:r="white",...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInReview",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M14 9.5V11C14 11.3978 13.842 11.7794 13.5607 12.0607C13.2794 12.342 12.8978 12.5 12.5 12.5H8L6 14.5V8C6 7.60218 6.15804 7.22064 6.43934 6.93934C6.72064 6.65804 7.10218 6.5 7.5 6.5H11M12.5 6H14.5M14.5 6V8M14.5 6L12 8.5",stroke:r,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconInternalLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInternalLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H18C19.6569 3 21 4.34315 21 6V17C21 18.6569 19.6569 20 18 20H11C10.4477 20 10 19.5523 10 19C10 18.4477 10.4477 18 11 18H18C18.5523 18 19 17.5523 19 17V6C19 5.44772 18.5523 5 18 5H7C6.44772 5 6 5.44772 6 6V13C6 13.5523 5.55228 14 5 14C4.44772 14 4 13.5523 4 13V6ZM8 10C8 9.44772 8.44772 9 9 9H14C14.5523 9 15 9.44772 15 10V15C15 15.5523 14.5523 16 14 16C13.4477 16 13 15.5523 13 15V12.4142L4.70711 20.7071C4.31658 21.0976 3.68342 21.0976 3.29289 20.7071C2.90237 20.3166 2.90237 19.6834 3.29289 19.2929L11.5858 11H9C8.44772 11 8 10.5523 8 10Z",fill:e})})},window.tablerIcons.IconLinkToBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 8C9 7.44772 9.44772 7 10 7H22C22.5523 7 23 7.44772 23 8V12C23 12.5523 22.5523 13 22 13C21.4477 13 21 12.5523 21 12V9H11V12C11 12.5523 10.5523 13 10 13C9.44772 13 9 12.5523 9 12V8ZM1 10C1 8.89543 1.89543 8 3 8C4.10457 8 5 8.89543 5 10C5 11.1046 4.10457 12 3 12C1.89543 12 1 11.1046 1 10ZM15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929L19.7071 14.2929C20.0976 14.6834 20.0976 15.3166 19.7071 15.7071C19.3166 16.0976 18.6834 16.0976 18.2929 15.7071L17 14.4142V17C17 18.1046 17.8954 19 19 19H23C23.5523 19 24 19.4477 24 20C24 20.5523 23.5523 21 23 21H19C16.7909 21 15 19.2091 15 17V14.4142L13.7071 15.7071C13.3166 16.0976 12.6834 16.0976 12.2929 15.7071C11.9024 15.3166 11.9024 14.6834 12.2929 14.2929L15.2929 11.2929Z",fill:e})})},window.tablerIcons.IconLinkToPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C4 2.34315 5.34315 1 7 1H17C18.6569 1 20 2.34315 20 4V18C20 18.5523 19.5523 19 19 19C18.4477 19 18 18.5523 18 18V4C18 3.44772 17.5523 3 17 3H7C6.44772 3 6 3.44772 6 4V18C6 18.5523 5.55228 19 5 19C4.44772 19 4 18.5523 4 18V4ZM8 6C8 5.44772 8.44772 5 9 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7H9C8.44772 7 8 6.55228 8 6ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L15.7071 16.2929C16.0976 16.6834 16.0976 17.3166 15.7071 17.7071C15.3166 18.0976 14.6834 18.0976 14.2929 17.7071L13 16.4142V19C13 20.1046 13.8954 21 15 21H19C19.5523 21 20 21.4477 20 22C20 22.5523 19.5523 23 19 23H15C12.7909 23 11 21.2091 11 19L11 16.4142L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071C7.90237 17.3166 7.90237 16.6834 8.29289 16.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconLinkToWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V15C22 16.6569 20.6569 18 19 18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19C19.5523 16 20 15.5523 20 15V5C20 4.44772 19.5523 4 19 4H14V7C14 7.55228 13.5523 8 13 8H7C6.44772 8 6 7.55228 6 7V4H5C4.44772 4 4 4.44772 4 5V17C4 17.5523 3.55228 18 3 18C2.44772 18 2 17.5523 2 17V5ZM8 4V6H12V4H8ZM17 6C17.5523 6 18 6.44772 18 7V13C18 13.5523 17.5523 14 17 14C16.4477 14 16 13.5523 16 13V7C16 6.44772 16.4477 6 17 6ZM9.29289 12.2929C9.68342 11.9024 10.3166 11.9024 10.7071 12.2929L13.7071 15.2929C14.0976 15.6834 14.0976 16.3166 13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L11 15.4142V18C11 19.1046 11.8954 20 13 20H17C17.5523 20 18 20.4477 18 21C18 21.5523 17.5523 22 17 22H13C10.7909 22 9 20.2091 9 18L9 15.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071C5.90237 16.3166 5.90237 15.6834 6.29289 15.2929L9.29289 12.2929Z",fill:e})})},window.tablerIcons.IconNewBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H16C16.5523 12 17 12.4477 17 13C17 13.5523 16.5523 14 16 14H13V16C13.5523 16 14 16.4477 14 17C14 17.5523 13.5523 18 13 18H12C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13Z",fill:e})})},window.tablerIcons.IconNewClass=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewClass",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.24254 3.02986C9.77833 3.16381 10.1041 3.70674 9.97014 4.24254L9.03078 8H12.9692L14.0299 3.75746C14.1638 3.22167 14.7067 2.89591 15.2425 3.02986C15.7783 3.16381 16.1041 3.70674 15.9701 4.24254L15.0308 8H17C17.5523 8 18 8.44772 18 9C18 9.55228 17.5523 10 17 10H14.5308L11.9701 20.2425C11.8362 20.7783 11.2933 21.1041 10.7575 20.9701C10.2217 20.8362 9.89591 20.2933 10.0299 19.7575L10.9692 16H7.03078L5.97014 20.2425C5.83619 20.7783 5.29326 21.1041 4.75746 20.9701C4.22167 20.8362 3.89591 20.2933 4.02986 19.7575L4.96922 16H3C2.44772 16 2 15.5523 2 15C2 14.4477 2.44772 14 3 14H5.46922L6.46922 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H6.96922L8.02986 3.75746C8.16381 3.22167 8.70674 2.89591 9.24254 3.02986ZM8.53078 10L7.53078 14H11.4692L12.4692 10H8.53078ZM19 13C19.5523 13 20 13.4477 20 14V16H22C22.5523 16 23 16.4477 23 17C23 17.5523 22.5523 18 22 18H20V20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20V18H16C15.4477 18 15 17.5523 15 17C15 16.4477 15.4477 16 16 16H18V14C18 13.4477 18.4477 13 19 13Z",fill:e})})},window.tablerIcons.IconNewObject=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewObject",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5181 2.12378C11.8182 1.95874 12.1818 1.95874 12.4819 2.12378L14.4819 3.22378C14.9658 3.48994 15.1424 4.098 14.8762 4.58192C14.6101 5.06584 14.002 5.24237 13.5181 4.97622L12 4.14127L10.4819 4.97622C9.998 5.24237 9.38994 5.06584 9.12378 4.58192C8.85763 4.098 9.03416 3.48994 9.51808 3.22378L11.5181 2.12378ZM6.87622 5.91811C7.14237 6.40203 6.96584 7.01008 6.48192 7.27624L6.07506 7.50001L6.48191 7.72378C6.96583 7.98993 7.14237 8.59799 6.87622 9.08191C6.61007 9.56583 6.00201 9.74237 5.51809 9.47622L5 9.19128V10C5 10.5523 4.55228 11 4 11C3.44772 11 3 10.5523 3 10V7.50002C3 7.13533 3.19853 6.79956 3.51808 6.62381L5.51808 5.52381C6.002 5.25765 6.61006 5.43419 6.87622 5.91811ZM17.1238 5.91811C17.3899 5.43419 17.998 5.25765 18.4819 5.52381L20.4819 6.62381C20.8015 6.79956 21 7.13533 21 7.50002V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V9.19128L18.4819 9.47622C17.998 9.74237 17.3899 9.56583 17.1238 9.08191C16.8576 8.59799 17.0342 7.98993 17.5181 7.72378L17.9249 7.50001L17.5181 7.27624C17.0342 7.01008 16.8576 6.40203 17.1238 5.91811ZM9.1275 10.3914C9.39735 9.90952 10.0067 9.73765 10.4886 10.0075L12.0044 10.8563L13.5181 10.0238C14.002 9.75765 14.6101 9.93418 14.8762 10.4181C15.1424 10.902 14.9658 11.5101 14.4819 11.7762L13 12.5913V14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5V12.5861L9.51139 11.7525C9.02952 11.4827 8.85765 10.8733 9.1275 10.3914ZM4 13C4.55228 13 5 13.4477 5 14V15.9087L6.48192 16.7238C6.96584 16.9899 7.14237 17.598 6.87622 18.0819C6.61006 18.5658 6.002 18.7424 5.51808 18.4762L3.51808 17.3762C3.19853 17.2005 3 16.8647 3 16.5V14C3 13.4477 3.44772 13 4 13ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13ZM12 17.5C12.5523 17.5 13 17.9477 13 18.5V19.3088L13.5181 19.0238C14.002 18.7577 14.6101 18.9342 14.8762 19.4181C15.1424 19.902 14.9658 20.5101 14.4819 20.7762L12.4819 21.8762C12.1818 22.0413 11.8182 22.0413 11.5181 21.8762L9.51808 20.7762C9.03416 20.5101 8.85763 19.902 9.12378 19.4181C9.38994 18.9342 9.998 18.7577 10.4819 19.0238L11 19.3088V18.5C11 17.9477 11.4477 17.5 12 17.5Z",fill:e})})},window.tablerIcons.IconNewPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V5C18 4.44772 17.5523 4 17 4H7C6.44772 4 6 4.44772 6 5V17C6 17.5523 6.44772 18 7 18H12C12.5523 18 13 18.4477 13 19C13 19.5523 12.5523 20 12 20H7C5.34315 20 4 18.6569 4 17V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7ZM19 15C19.5523 15 20 15.4477 20 16V18H22C22.5523 18 23 18.4477 23 19C23 19.5523 22.5523 20 22 20H20V22C20 22.5523 19.5523 23 19 23C18.4477 23 18 22.5523 18 22V20H16C15.4477 20 15 19.5523 15 19C15 18.4477 15.4477 18 16 18H18V16C18 15.4477 18.4477 15 19 15Z",fill:e})})},window.tablerIcons.IconNewWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H13C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM20 14C20.5523 14 21 14.4477 21 15V17H23C23.5523 17 24 17.4477 24 18C24 18.5523 23.5523 19 23 19H21V21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21V19H17C16.4477 19 16 18.5523 16 18C16 17.4477 16.4477 17 17 17H19V15C19 14.4477 19.4477 14 20 14Z",fill:e})})},window.tablerIcons.IconNewWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4C5.44772 4 5 4.44772 5 5V6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6V5C3 3.34315 4.34315 2 6 2H8C8.55228 2 9 2.44772 9 3C9 3.55228 8.55228 4 8 4H6ZM15 3C15 2.44772 15.4477 2 16 2H18C19.6569 2 21 3.34315 21 5V6C21 6.55228 20.5523 7 20 7C19.4477 7 19 6.55228 19 6V5C19 4.44772 18.5523 4 18 4H16C15.4477 4 15 3.55228 15 3ZM7 9C7 8.44772 7.44772 8 8 8H16C16.5523 8 17 8.44772 17 9V13C17 13.5523 16.5523 14 16 14H8C7.44772 14 7 13.5523 7 13V9ZM9 10V12H15V10H9ZM4 15C4.55228 15 5 15.4477 5 16V17C5 17.5523 5.44772 18 6 18H8C8.55228 18 9 18.4477 9 19C9 19.5523 8.55228 20 8 20H6C4.34315 20 3 18.6569 3 17V16C3 15.4477 3.44772 15 4 15ZM20 15C20.5523 15 21 15.4477 21 16V18H23C23.5523 18 24 18.4477 24 19C24 19.5523 23.5523 20 23 20H21V22C21 22.5523 20.5523 23 20 23C19.4477 23 19 22.5523 19 22V20H17C16.4477 20 16 19.5523 16 19C16 18.4477 16.4477 18 17 18H19V16C19 15.4477 19.4477 15 20 15Z",fill:e})})},window.tablerIcons.IconNumberedChildren=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedChildren",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M12 12H20M12 18H20M4 6L20 6M8 11V13M8 17V19M5 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconNumberedParents=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedParents",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 6H20M14 12H20M14 18H20M10 5V7M10 11V13M7 11V13M10 17V19M7 17V19M4 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconObjectCompact=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectCompact",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V9C21 9.55228 20.5523 10 20 10H18C17.4477 10 17 9.55228 17 9C17 8.44772 17.4477 8 18 8H19V4H5V8H6C6.55228 8 7 8.44772 7 9C7 9.55228 6.55228 10 6 10H4C3.44772 10 3 9.55228 3 9V3ZM11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289L16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071C16.3166 13.0976 15.6834 13.0976 15.2929 12.7071L13 10.4142V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V10.4142L8.70711 12.7071C8.31658 13.0976 7.68342 13.0976 7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L11.2929 7.29289Z",fill:e})})},window.tablerIcons.IconObjectExpanded=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectExpanded",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V3ZM5 4V8H8C8.55228 8 9 8.44772 9 9C9 9.55228 8.55228 10 8 10H5V20H19V10H16C15.4477 10 15 9.55228 15 9C15 8.44772 15.4477 8 16 8H19V4H5ZM12 6C12.5523 6 13 6.44772 13 7V14.5858L15.2929 12.2929C15.6834 11.9024 16.3166 11.9024 16.7071 12.2929C17.0976 12.6834 17.0976 13.3166 16.7071 13.7071L12.7071 17.7071C12.3166 18.0976 11.6834 18.0976 11.2929 17.7071L7.29289 13.7071C6.90237 13.3166 6.90237 12.6834 7.29289 12.2929C7.68342 11.9024 8.31658 11.9024 8.70711 12.2929L11 14.5858V7C11 6.44772 11.4477 6 12 6Z",fill:e})})},window.tablerIcons.IconOpenAsPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtOpenAsPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V18C20 19.6569 18.6569 21 17 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H17C17.5523 19 18 18.5523 18 18V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L14.7071 15.2929C15.0976 15.6834 15.0976 16.3166 14.7071 16.7071C14.3166 17.0976 13.6834 17.0976 13.2929 16.7071L13 16.4142V23C13 23.5523 12.5523 24 12 24C11.4477 24 11 23.5523 11 23L11 16.4142L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C6.44772 4 6 4.44772 6 5V19C6 19.5523 6.44771 20 7 20H17C17.5523 20 18 19.5523 18 19V5C18 4.44772 17.5523 4 17 4H7ZM4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7Z",fill:e})})},window.tablerIcons.IconPageEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 19V10C5 8.89543 5.89543 8 7 8H17C18.1046 8 19 8.89543 19 10V19M9 12H13M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM7 17C6.44772 17 6 17.4477 6 18V23C6 23.5523 5.55228 24 5 24C4.44772 24 4 23.5523 4 23V18C4 16.3431 5.34315 15 7 15H17C18.6569 15 20 16.3431 20 18V23C20 23.5523 19.5523 24 19 24C18.4477 24 18 23.5523 18 23V18C18 17.4477 17.5523 17 17 17H7ZM8 20C8 19.4477 8.44772 19 9 19H13C13.5523 19 14 19.4477 14 20C14 20.5523 13.5523 21 13 21H9C8.44772 21 8 20.5523 8 20Z",fill:e})})},window.tablerIcons.IconPageRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M9 7H13M12 21H7C5.89543 21 5 20.1046 5 19V5C5 3.89543 5.89543 3 7 3H17C18.1046 3 19 3.89543 19 5V14M17 18H16V23H17M21 18H22V23H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM16.5 16C15.6716 16 15 16.6716 15 17.5C15 18.3284 15.6716 19 16.5 19C17.3284 19 18 18.3284 18 17.5C18 16.6716 17.3284 16 16.5 16ZM13 17.5C13 15.567 14.567 14 16.5 14C18.433 14 20 15.567 20 17.5C20 18.1028 19.8476 18.6699 19.5793 19.1651L21.7071 21.2929C22.0976 21.6834 22.0976 22.3166 21.7071 22.7071C21.3166 23.0976 20.6834 23.0976 20.2929 22.7071L18.1651 20.5793C17.6699 20.8476 17.1028 21 16.5 21C14.567 21 13 19.433 13 17.5Z",fill:e})})},window.tablerIcons.IconPasteAsLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPasteAsLink",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{clipPath:"url(#clip0_3328_925)",children:(0,s.jsx)("path",{d:"M9 5H7C6.46957 5 5.96086 5.21071 5.58579 5.58579C5.21071 5.96086 5 6.46957 5 7V19C5 19.5304 5.21071 20.0391 5.58579 20.4142C5.96086 20.7893 6.46957 21 7 21H8M9 5C9 4.46957 9.21071 3.96086 9.58579 3.58579C9.96086 3.21071 10.4696 3 11 3H13C13.5304 3 14.0391 3.21071 14.4142 3.58579C14.7893 3.96086 15 4.46957 15 5M9 5C9 5.53043 9.21071 6.03914 9.58579 6.41421C9.96086 6.78929 10.4696 7 11 7H13C13.5304 7 14.0391 6.78929 14.4142 6.41421C14.7893 6.03914 15 5.53043 15 5M15 5H17C17.5304 5 18.0391 5.21071 18.4142 5.58579C18.7893 5.96086 19 6.46957 19 7V9M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_3328_925",children:(0,s.jsx)("rect",{width:o,height:o,fill:"white"})})})]})},window.tablerIcons.IconPaused=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPaused",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M8.5 6.5H7.5C7.22386 6.5 7 6.72386 7 7V13C7 13.2761 7.22386 13.5 7.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V7C9 6.72386 8.77614 6.5 8.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12.5 6.5H11.5C11.2239 6.5 11 6.72386 11 7V13C11 13.2761 11.2239 13.5 11.5 13.5H12.5C12.7761 13.5 13 13.2761 13 13V7C13 6.72386 12.7761 6.5 12.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconPhotoLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPhotoLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 8H15.01M4 15V17C4 18.6569 5.34315 20 7 20H8M4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V9M4 15L8 11C8.45606 10.5611 8.97339 10.3301 9.5 10.3301C10.0266 10.3301 10.5439 10.5611 11 11L13.5 13.5M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlHigh=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlHigh",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlLow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlLow",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlMedium=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlMedium",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlNone=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlNone",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 12H7M19 12H17M11 12H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlUrgent=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlUrgent",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3H6ZM13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8V12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12V8ZM13 15.99C13 15.4377 12.5523 14.99 12 14.99C11.4477 14.99 11 15.4377 11 15.99V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V15.99Z",fill:e})})},window.tablerIcons.IconQuery=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQuery",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.1429 13.1429L16 16M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21ZM13.7143 10.8571C13.7143 12.4351 12.4351 13.7143 10.8571 13.7143C9.27919 13.7143 8 12.4351 8 10.8571C8 9.27919 9.27919 8 10.8571 8C12.4351 8 13.7143 9.27919 13.7143 10.8571Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconQueryCode=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQueryCode",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M11.1429 11.1429L14 14M13 19H3C1.89543 19 1 18.1046 1 17V3C1 1.89543 1.89543 1 3 1H17C18.1046 1 19 1.89543 19 3V14M18 18H17V23H18M22 18H23V23H22M11.7143 8.85714C11.7143 10.4351 10.4351 11.7143 8.85714 11.7143C7.27919 11.7143 6 10.4351 6 8.85714C6 7.27919 7.27919 6 8.85714 6C10.4351 6 11.7143 7.27919 11.7143 8.85714Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconReferencesHide=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesHide",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 2.29289C11.6834 1.90237 12.3166 1.90237 12.7071 2.29289L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711C14.3166 6.09763 13.6834 6.09763 13.2929 5.70711L12 4.41421L10.7071 5.70711C10.3166 6.09763 9.68342 6.09763 9.29289 5.70711C8.90237 5.31658 8.90237 4.68342 9.29289 4.29289L11.2929 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconReferencesShow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesShow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 2.29289C9.68342 1.90237 10.3166 1.90237 10.7071 2.29289L12 3.58579L13.2929 2.29289C13.6834 1.90237 14.3166 1.90237 14.7071 2.29289C15.0976 2.68342 15.0976 3.31658 14.7071 3.70711L12.7071 5.70711C12.3166 6.09763 11.6834 6.09763 11.2929 5.70711L9.29289 3.70711C8.90237 3.31658 8.90237 2.68342 9.29289 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconResetPassword=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtResetPassword",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C11.2044 4 10.4413 4.31607 9.87868 4.87868C9.31607 5.44129 9 6.20435 9 7V10H15V7C15 6.20435 14.6839 5.44129 14.1213 4.87868C13.5587 4.31607 12.7956 4 12 4ZM16 12C16.5523 12 17 11.5523 17 11V7C17 5.67392 16.4732 4.40215 15.5355 3.46447C14.5979 2.52678 13.3261 2 12 2C10.6739 2 9.40215 2.52678 8.46447 3.46447C7.52678 4.40215 7 5.67392 7 7V10C5.34315 10 4 11.3431 4 13V19C4 20.6569 5.34315 22 7 22H10C10.5523 22 11 21.5523 11 21C11 20.4477 10.5523 20 10 20H7C6.44772 20 6 19.5523 6 19V13C6 12.4477 6.44772 12 7 12H16ZM23 13C23.5523 13 24 13.4477 24 14V18C24 18.5523 23.5523 19 23 19H21.8952C21.8805 19.0003 21.8659 19.0003 21.8514 19H19C18.4477 19 18 18.5523 18 18C18 17.4477 18.4477 17 19 17H20.2363C19.6867 16.3861 18.8879 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22C18.8959 22 19.6991 21.6086 20.2503 20.9841C20.6157 20.57 21.2477 20.5306 21.6617 20.8961C22.0758 21.2616 22.1152 21.8935 21.7497 22.3076C20.835 23.3439 19.4935 24 18 24C15.2386 24 13 21.7614 13 19C13 16.2386 15.2386 14 18 14C19.6364 14 21.0881 14.7857 22 15.9999V14C22 13.4477 22.4477 13 23 13Z",fill:e})})},window.tablerIcons.IconSelectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M3 3H21V21H3V3Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 2H4V4H2V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 2H22V4H20V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 20H22V22H20V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 7H10V10H7V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 7H17V10H14V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 14H10V17H7V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 14H17V17H14V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconSelectCursor=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectCursor",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.29292 4.29289C4.56075 4.02506 4.95692 3.93154 5.31625 4.05132L19.3163 8.71798C19.7 8.84589 19.9688 9.19233 19.9975 9.59578C20.0262 9.99922 19.809 10.3802 19.4472 10.5611L16.6659 11.9518L19.4483 14.7343C19.8389 15.1248 19.8389 15.758 19.4483 16.1485L16.1485 19.4483C15.758 19.8388 15.1248 19.8388 14.7343 19.4483L11.9518 16.6658L10.5611 19.4472C10.3802 19.809 9.99925 20.0262 9.5958 19.9975C9.19236 19.9688 8.84591 19.6999 8.71801 19.3162L4.05134 5.31623C3.93157 4.95689 4.02509 4.56073 4.29292 4.29289ZM6.58117 6.58114L9.85194 16.3934L10.7834 14.5305C10.9272 14.2429 11.2004 14.0421 11.5177 13.9906C11.835 13.9391 12.1577 14.0433 12.385 14.2706L15.4414 17.327L17.327 15.4414L14.2706 12.3849C14.0433 12.1576 13.9391 11.8349 13.9906 11.5177C14.0421 11.2004 14.243 10.9272 14.5305 10.7834L16.3935 9.85191L6.58117 6.58114Z",fill:e})})},window.tablerIcons.IconStackPop=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPop",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7 9.5L4 11L12 15L20 11L17 9.5M4 15L12 19L20 15M12 11V4M12 4L9 7M12 4L15 7",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconStackPull=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPull",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6 10L4 11L12 15L20 11L18 10M4 15L12 19L20 15M12 4V11M12 11L15 8M12 11L9 8",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconText=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtText",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V7C19 7.55228 18.5523 8 18 8C17.4477 8 17 7.55228 17 7V6H13V18H14C14.5523 18 15 18.4477 15 19C15 19.5523 14.5523 20 14 20H10C9.44772 20 9 19.5523 9 19C9 18.4477 9.44772 18 10 18H11V6H7V7C7 7.55228 6.55228 8 6 8C5.44772 8 5 7.55228 5 7V5Z",fill:e})})},window.tablerIcons.IconTodo=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTodo",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"})})},window.tablerIcons.IconTomorrow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTomorrow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M20 15V7C20 5.89543 19.1046 5 18 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H11M20 19L22 21M22 21L20 23M22 21H15M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconUngroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtUngroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3C2 2.44772 2.44772 2 3 2H5C5.55228 2 6 2.44772 6 3H12C12 2.44772 12.4477 2 13 2H15C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6V8H18C18 7.44772 18.4477 7 19 7H21C21.5523 7 22 7.44772 22 8V10C22 10.5523 21.5523 11 21 11V18C21.5523 18 22 18.4477 22 19V21C22 21.5523 21.5523 22 21 22H19C18.4477 22 18 21.5523 18 21H11C11 21.5523 10.5523 22 10 22H8C7.44772 22 7 21.5523 7 21V19C7 18.4477 7.44772 18 8 18V15H6C6 15.5523 5.55228 16 5 16H3C2.44772 16 2 15.5523 2 15V13C2 12.4477 2.44772 12 3 12V6C2.44772 6 2 5.55228 2 5V3ZM5 6V12C5.55228 12 6 12.4477 6 13H12C12 12.4477 12.4477 12 13 12V6C12.4477 6 12 5.55228 12 5H6C6 5.55228 5.55228 6 5 6ZM15 12V10H18C18 10.5523 18.4477 11 19 11V18C18.4477 18 18 18.4477 18 19H11C11 18.4477 10.5523 18 10 18V15H12C12 15.5523 12.4477 16 13 16H15C15.5523 16 16 15.5523 16 15V13C16 12.4477 15.5523 12 15 12Z",fill:e})})},window.tablerIcons.IconVideoEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtVideoEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M10.5 9V15L14.5 12L10.5 9Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1 10C1 6.68629 3.68629 4 7 4H17C20.3137 4 23 6.68629 23 10V14C23 17.3137 20.3137 20 17 20H7C3.68629 20 1 17.3137 1 14V10Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18 9C18 8.44772 17.5523 8 17 8C16.4477 8 16 8.44772 16 9H18ZM16 15C16 15.5523 16.4477 16 17 16C17.5523 16 18 15.5523 18 15H16ZM3 14C2.44772 14 2 14.4477 2 15C2 15.5523 2.44772 16 3 16V14ZM11 15H12C12 14.4477 11.5523 14 11 14V15ZM10 19C10 19.5523 10.4477 20 11 20C11.5523 20 12 19.5523 12 19H10ZM14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5H14ZM13 9V10C13.5523 10 14 9.55228 14 9H13ZM7 9H6C6 9.55228 6.44772 10 7 10V9ZM8 5C8 4.44772 7.55228 4 7 4C6.44772 4 6 4.44772 6 5H8ZM5 6H19V4H5V6ZM20 7V17H22V7H20ZM19 18H5V20H19V18ZM4 17V7H2V17H4ZM5 18C4.44772 18 4 17.5523 4 17H2C2 18.6569 3.34315 20 5 20V18ZM20 17C20 17.5523 19.5523 18 19 18V20C20.6569 20 22 18.6569 22 17H20ZM19 6C19.5523 6 20 6.44772 20 7H22C22 5.34315 20.6569 4 19 4V6ZM5 4C3.34315 4 2 5.34315 2 7H4C4 6.44772 4.44772 6 5 6V4ZM16 9V15H18V9H16ZM3 16H11V14H3V16ZM10 15V19H12V15H10ZM12 5V9H14V5H12ZM13 8H7V10H13V8ZM8 9V5H6V9H8Z",fill:e})})},window.tablerIcons.IconWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5C5.44772 5 5 5.44772 5 6V7C5 7.55228 4.55228 8 4 8C3.44772 8 3 7.55228 3 7V6C3 4.34315 4.34315 3 6 3H8C8.55228 3 9 3.44772 9 4C9 4.55228 8.55228 5 8 5H6ZM15 4C15 3.44772 15.4477 3 16 3H18C19.6569 3 21 4.34315 21 6V7C21 7.55228 20.5523 8 20 8C19.4477 8 19 7.55228 19 7V6C19 5.44772 18.5523 5 18 5H16C15.4477 5 15 4.55228 15 4ZM7 10C7 9.44772 7.44772 9 8 9H16C16.5523 9 17 9.44772 17 10V14C17 14.5523 16.5523 15 16 15H8C7.44772 15 7 14.5523 7 14V10ZM9 11V13H15V11H9ZM4 16C4.55228 16 5 16.4477 5 17V18C5 18.5523 5.44772 19 6 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H6C4.34315 21 3 19.6569 3 18V17C3 16.4477 3.44772 16 4 16ZM20 16C20.5523 16 21 16.4477 21 17V18C21 19.6569 19.6569 21 18 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H18C18.5523 19 19 18.5523 19 18V17C19 16.4477 19.4477 16 20 16Z",fill:e})})},window.tablerIcons.IconWhiteboardFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM2 18C2 16.3431 3.34315 15 5 15H19C20.6569 15 22 16.3431 22 18V23C22 23.5523 21.5523 24 21 24C20.4477 24 20 23.5523 20 23V18C20 17.4477 19.5523 17 19 17H14V20C14 20.5523 13.5523 21 13 21H7C6.44772 21 6 20.5523 6 20V17H5C4.44772 17 4 17.4477 4 18V23C4 23.5523 3.55228 24 3 24C2.44772 24 2 23.5523 2 23V18ZM8 17V19H12V17H8ZM17 19C17.5523 19 18 19.4477 18 20V23C18 23.5523 17.5523 24 17 24C16.4477 24 16 23.5523 16 23V20C16 19.4477 16.4477 19 17 19Z",fill:e})})},window.tablerIcons.IconWhiteboardSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H12C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconXEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtX-embed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 16L11.384 12.616M12.614 11.386L16 8M10.2084 8.10216L15.7083 15.6022C15.8294 15.7673 15.7114 16 15.5067 16H13.9932C13.9135 16 13.8387 15.9621 13.7916 15.8978L8.29174 8.39784C8.17065 8.23271 8.28857 8 8.49334 8H10.0068C10.0865 8 10.1613 8.03794 10.2084 8.10216ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconYesterday=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtYesterday",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M4 15V7C4 5.89543 4.89543 5 6 5H18C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H13M4 19L2 21M2 21L4 23M2 21H9M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconZoomToFit=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtZoomToFit",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M20 4H16H18C18.5304 4 19.0391 4.21071 19.4142 4.58579C19.7893 4.96086 20 5.46957 20 6V8V4ZM20 4L14 10M4 20H8H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V16V20ZM4 20L10 14M4 8V6C4 5.46957 4.21071 4.96086 4.58579 4.58579C4.96086 4.21071 5.46957 4 6 4H8M16 20H18C18.5304 20 19.0391 19.7893 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 18V16",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}})(); \ No newline at end of file +(()=>{function o(o,e,n,r){Object.defineProperty(o,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=globalThis,n={},r={},t=e.parcelRequiree92c;null==t&&((t=function(o){if(o in n)return n[o].exports;if(o in r){var e=r[o];delete r[o];var t={id:o,exports:{}};return n[o]=t,e.call(t.exports,t,t.exports),t.exports}var i=Error("Cannot find module '"+o+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(o,e){r[o]=e},e.parcelRequiree92c=t);var i=t.register;i("9Hk4c",function(e,n){o(e.exports,"Fragment",()=>r,o=>r=o),o(e.exports,"jsx",()=>i,o=>i=o),o(e.exports,"jsxs",()=>s,o=>s=o);var r,i,s,l=t("a46g0"),C=Symbol.for("react.element"),c=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a={current:null},h={key:!0,ref:!0,__self:!0,__source:!0};function w(o,e,n){var r,t={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==e.key&&(i=""+e.key),void 0!==e.ref&&(s=e.ref),e)d.call(e,r)&&!h.hasOwnProperty(r)&&(t[r]=e[r]);if(o&&o.defaultProps)for(r in e=o.defaultProps)void 0===t[r]&&(t[r]=e[r]);return{$$typeof:C,type:o,key:i,ref:s,props:t,_owner:a.current}}r=c,i=w,s=w}),i("a46g0",function(o,e){o.exports=React});var s=ReactJSXRuntime;t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),window.tablerIcons=window.tablerIcons||{},window.tablerIcons.IconAddLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAddLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2933 4.29278C13.1438 3.4422 14.2975 2.96436 15.5004 2.96436C16.7033 2.96436 17.8569 3.4422 18.7075 4.29278C19.5581 5.14336 20.0359 6.29699 20.0359 7.49989C20.0359 8.70279 19.5581 9.85642 18.7075 10.707L14.7109 14.7036C14.2927 15.1294 13.7939 15.4678 13.2436 15.699C12.6917 15.9309 12.099 16.0504 11.5004 16.0504C10.9017 16.0504 10.309 15.9309 9.7571 15.699C9.20517 15.4671 8.70507 15.1274 8.28608 14.6997C7.89956 14.3053 7.90602 13.6721 8.30051 13.2856C8.695 12.8991 9.32813 12.9055 9.71465 13.3C9.94742 13.5376 10.2253 13.7263 10.5319 13.8552C10.8385 13.984 11.1678 14.0504 11.5004 14.0504C11.833 14.0504 12.1622 13.984 12.4688 13.8552C12.7755 13.7263 13.0533 13.5376 13.2861 13.3L13.2932 13.2927L13.2933 13.2928L17.2933 9.29278C17.7688 8.81728 18.0359 8.17235 18.0359 7.49989C18.0359 6.82742 17.7688 6.1825 17.2933 5.707C16.8178 5.23149 16.1728 4.96436 15.5004 4.96436C14.8279 4.96436 14.183 5.23149 13.7075 5.707L13.2075 6.207C12.8169 6.59752 12.1838 6.59752 11.7933 6.207C11.4027 5.81647 11.4027 5.18331 11.7933 4.79278L12.2933 4.29278ZM8.75711 8.30085C9.30904 8.06892 9.9017 7.94946 10.5004 7.94946C11.0991 7.94946 11.6917 8.06892 12.2436 8.30085C12.7956 8.53277 13.2957 8.87249 13.7147 9.30012C14.1012 9.69461 14.0947 10.3277 13.7002 10.7143C13.3057 11.1008 12.6726 11.0943 12.2861 10.6998C12.0533 10.4623 11.7755 10.2735 11.4689 10.1447C11.1622 10.0158 10.833 9.94946 10.5004 9.94946C10.1678 9.94946 9.83853 10.0158 9.5319 10.1447C9.22527 10.2735 8.94743 10.4623 8.71466 10.6998L8.70752 10.7071L8.70748 10.7071L4.70748 14.7071C4.23198 15.1826 3.96484 15.8275 3.96484 16.5C3.96484 17.1724 4.23198 17.8174 4.70748 18.2929C5.18299 18.7684 5.82791 19.0355 6.50038 19.0355C7.17284 19.0355 7.81777 18.7684 8.29327 18.2929L8.79327 17.7929C9.18379 17.4023 9.81696 17.4023 10.2075 17.7929C10.598 18.1834 10.598 18.8166 10.2075 19.2071L9.70748 19.7071C8.85691 20.5577 7.70328 21.0355 6.50038 21.0355C5.29748 21.0355 4.14385 20.5577 3.29327 19.7071C2.44269 18.8565 1.96484 17.7029 1.96484 16.5C1.96484 15.2971 2.44269 14.1434 3.29327 13.2929L7.28985 9.29629C7.70807 8.87046 8.20683 8.53208 8.75711 8.30085ZM19.0005 14C19.5528 14 20.0005 14.4477 20.0005 15V17H22.0005C22.5528 17 23.0005 17.4477 23.0005 18C23.0005 18.5523 22.5528 19 22.0005 19H20.0005V21C20.0005 21.5523 19.5528 22 19.0005 22C18.4482 22 18.0005 21.5523 18.0005 21V19H16.0005C15.4482 19 15.0005 18.5523 15.0005 18C15.0005 17.4477 15.4482 17 16.0005 17H18.0005V15C18.0005 14.4477 18.4482 14 19.0005 14Z",fill:e})})},window.tablerIcons.IconAppFeature=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAppFeature",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7C2 5.34315 3.34315 4 5 4H19C20.6569 4 22 5.34315 22 7V17C22 18.6569 20.6569 20 19 20H15.0209C15.0064 20.0003 14.992 20.0003 14.9776 20H9.02243C9.00802 20.0003 8.99357 20.0003 8.97908 20H5C3.34315 20 2 18.6569 2 17V7ZM13.7192 18L13.5299 17.2425C13.4447 16.9018 13.5445 16.5413 13.7929 16.2929L14.8787 15.2071L13.3586 14.9899C13.0337 14.9435 12.7523 14.7407 12.6056 14.4472L12 13.2361L11.3944 14.4472C11.2477 14.7407 10.9663 14.9435 10.6414 14.9899L9.12132 15.2071L10.2071 16.2929C10.4555 16.5413 10.5553 16.9018 10.4701 17.2425L10.2808 18H13.7192ZM15.7808 18H19C19.5523 18 20 17.5523 20 17V7C20 6.44772 19.5523 6 19 6H5C4.44772 6 4 6.44772 4 7V17C4 17.5523 4.44772 18 5 18H8.21922L8.39254 17.3067L6.29289 15.2071C6.02506 14.9393 5.93154 14.5431 6.05132 14.1838C6.17109 13.8244 6.48361 13.5636 6.85858 13.5101L9.83989 13.0841L11.1056 10.5528C11.275 10.214 11.6212 10 12 10C12.3788 10 12.725 10.214 12.8944 10.5528L14.1601 13.0841L17.1414 13.5101C17.5164 13.5636 17.8289 13.8244 17.9487 14.1838C18.0685 14.5431 17.9749 14.9393 17.7071 15.2071L15.6075 17.3067L15.7808 18Z",fill:e}),(0,s.jsx)("path",{d:"M6 6.99C6.55228 6.99 7 7.43771 7 7.99V8C7 8.55229 6.55228 9 6 9C5.44772 9 5 8.55229 5 8V7.99C5 7.43771 5.44772 6.99 6 6.99Z",fill:e}),(0,s.jsx)("path",{d:"M9 6.99C9.55228 6.99 10 7.43771 10 7.99V8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8V7.99C8 7.43771 8.44772 6.99 9 6.99Z",fill:e})]})},window.tablerIcons.IconBacklog=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBacklog",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2",strokeDasharray:"4 4"})})},window.tablerIcons.IconBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 10C9 9.44772 9.44772 9 10 9H22C22.5523 9 23 9.44772 23 10V14C23 14.5523 22.5523 15 22 15H10C9.44772 15 9 14.5523 9 14V10ZM11 11V13H21V11H11ZM1 12C1 10.8954 1.89543 10 3 10C4.10457 10 5 10.8954 5 12C5 13.1046 4.10457 14 3 14C1.89543 14 1 13.1046 1 12Z",fill:e})})},window.tablerIcons.IconBlockEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M22 10H13V14H22M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM11 17V19H21V17H11ZM9 16C9 15.4477 9.44772 15 10 15H22C22.5523 15 23 15.4477 23 16V20C23 20.5523 22.5523 21 22 21H10C9.44772 21 9 20.5523 9 20V16ZM1 18C1 16.8954 1.89543 16 3 16C4.10457 16 5 16.8954 5 18C5 19.1046 4.10457 20 3 20C1.89543 20 1 19.1046 1 18Z",fill:e})})},window.tablerIcons.IconBlockRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 14H10V10H22V12M18 16C17.3581 17.6049 17.3581 19.3951 18 21M22 16C22.6419 17.6049 22.6419 19.3951 22 21M4 12C4 12.5523 3.55228 13 3 13C2.44772 13 2 12.5523 2 12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H14C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconCalendarDots=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCalendarDots",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 4H6C4.89543 4 4 4.89543 4 6V10M8 4H16M8 4V2M8 4V6M16 4H18C19.1046 4 20 4.89543 20 6V10M16 4V2M16 4V6M4 10H20M4 10V14M20 10V14M6 20C6 20.5523 5.55228 21 5 21C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19C5.55228 19 6 19.4477 6 20ZM13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20C11 19.4477 11.4477 19 12 19C12.5523 19 13 19.4477 13 20ZM20 20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20C18 19.4477 18.4477 19 19 19C19.5523 19 20 19.4477 20 20Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconCancelled=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCancelled",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M13 7L7 13M7 7L13 13",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconCloudExclamation=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCloudExclamation",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4366 6.03387C12.8308 5.92373 12.2062 5.92205 11.5997 6.02894C10.9931 6.13582 10.4204 6.34848 9.91384 6.65116C8.89016 7.26279 8.20994 8.19494 7.98007 9.21902C7.87759 9.67556 7.47225 10 7.00435 10C6.00786 10 5.06063 10.3791 4.36896 11.0407C3.6788 11.7008 3.2998 12.5864 3.2998 13.5C3.2998 14.4136 3.6788 15.2992 4.36896 15.9593C5.06063 16.6209 6.00786 17 7.00435 17H8C8.55228 17 9 17.4477 9 18C9 18.5523 8.55228 19 8 19H7.00435C5.5054 19 4.05939 18.4308 2.98651 17.4046C1.91213 16.3769 1.2998 14.9734 1.2998 13.5C1.2998 12.0266 1.91213 10.6231 2.98651 9.59538C3.87696 8.74365 5.02444 8.20677 6.24589 8.04882C6.72397 6.76252 7.65926 5.66843 8.88803 4.93427C9.60923 4.50337 10.4128 4.20727 11.2526 4.05929C12.0923 3.91131 12.9556 3.91362 13.7943 4.06613C14.6332 4.21864 15.4349 4.5191 16.1534 4.95398C16.8721 5.38893 17.4955 5.95128 17.9839 6.61332C18.4724 7.27568 18.8155 8.02416 18.988 8.817C19.0731 9.20796 19.1156 9.60469 19.1155 10.0014C20.2687 10.0298 21.3686 10.5003 22.1863 11.318C23.0302 12.1619 23.5044 13.3065 23.5044 14.5C23.5044 15.6935 23.0302 16.8381 22.1863 17.682C21.3424 18.5259 20.1978 19 19.0044 19H16C15.4477 19 15 18.5523 15 18C15 17.4477 15.4477 17 16 17H19.0044C19.6674 17 20.3033 16.7366 20.7721 16.2678C21.241 15.7989 21.5044 15.163 21.5044 14.5C21.5044 13.837 21.241 13.2011 20.7721 12.7322C20.3033 12.2634 19.6674 12 19.0044 12H18.0044C17.7007 12 17.4134 11.862 17.2236 11.6249C17.0339 11.3878 16.9621 11.0773 17.0286 10.781C17.1427 10.273 17.1444 9.75071 17.0337 9.24219C16.9231 8.7334 16.7009 8.24319 16.3744 7.80054C16.0476 7.35756 15.6221 6.9702 15.1178 6.66498C14.6134 6.35969 14.0423 6.144 13.4366 6.03387ZM12 14C12.5523 14 13 14.4477 13 15V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V15C11 14.4477 11.4477 14 12 14ZM12 21C12.5523 21 13 21.4477 13 22V22.01C13 22.5623 12.5523 23.01 12 23.01C11.4477 23.01 11 22.5623 11 22.01V22C11 21.4477 11.4477 21 12 21Z",fill:e})})},window.tablerIcons.IconConnector=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtConnector",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5C11 4.44772 11.4477 4 12 4H19C19.5523 4 20 4.44772 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V7.41421L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L16.5858 6H12C11.4477 6 11 5.55228 11 5Z",fill:e})})},window.tablerIcons.IconDeselectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDeselectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 9L12 12M12 12L9 15M12 12L9 9M12 12L15 15M3 3H21V21H3V3ZM2 2H4V4H2V2ZM20 2H22V4H20V2ZM20 20H22V22H20V20ZM2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconDone=function({size:o=24,color:e="currentColor",color2:n="white",stroke:r=0,...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:r,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDone",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M6.5 10L9 12.5L14 7.5",stroke:n,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconGroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtGroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2C1 1.44772 1.44772 1 2 1H4C4.55228 1 5 1.44772 5 2H19C19 1.44772 19.4477 1 20 1H22C22.5523 1 23 1.44772 23 2V4C23 4.55228 22.5523 5 22 5V19C22.5523 19 23 19.4477 23 20V22C23 22.5523 22.5523 23 22 23H20C19.4477 23 19 22.5523 19 22H5C5 22.5523 4.55228 23 4 23H2C1.44772 23 1 22.5523 1 22V20C1 19.4477 1.44772 19 2 19V5C1.44772 5 1 4.55228 1 4V2ZM4 5V19C4.55228 19 5 19.4477 5 20H19C19 19.4477 19.4477 19 20 19V5C19.4477 5 19 4.55228 19 4H5C5 4.55228 4.55228 5 4 5ZM6 7C6 6.44772 6.44772 6 7 6H13C13.5523 6 14 6.44772 14 7V9H17C17.5523 9 18 9.44772 18 10V17C18 17.5523 17.5523 18 17 18H10C9.44772 18 9 17.5523 9 17V14H7C6.44772 14 6 13.5523 6 13V7ZM11 14V16H16V11H14V13C14 13.5523 13.5523 14 13 14H11ZM12 8H8V12H12V8Z",fill:e})})},window.tablerIcons.IconHAuto=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtH-auto",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H5C5.55228 5 6 5.44772 6 6C6 6.55228 5.55228 7 5 7V11H11V7C10.4477 7 10 6.55228 10 6C10 5.44772 10.4477 5 11 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7V17C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18C10 17.4477 10.4477 17 11 17V13H5V17C5.55228 17 6 17.4477 6 18C6 18.5523 5.55228 19 5 19H3C2.44772 19 2 18.5523 2 18C2 17.4477 2.44772 17 3 17V7C2.44772 7 2 6.55228 2 6ZM19 11C18.7348 11 18.4804 11.1054 18.2929 11.2929C18.1054 11.4804 18 11.7348 18 12V14H20V12C20 11.7348 19.8946 11.4804 19.7071 11.2929C19.5196 11.1054 19.2652 11 19 11ZM22 12C22 11.2043 21.6839 10.4413 21.1213 9.87868C20.5587 9.31607 19.7957 9 19 9C18.2043 9 17.4413 9.31607 16.8787 9.87868C16.3161 10.4413 16 11.2043 16 12V18C16 18.5523 16.4477 19 17 19C17.5523 19 18 18.5523 18 18V16H20V18C20 18.5523 20.4477 19 21 19C21.5523 19 22 18.5523 22 18V12Z",fill:e})})},window.tablerIcons.IconHeadingOff=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHeadingOff",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.29289 2.29289C2.68342 1.90237 3.31658 1.90237 3.70711 2.29289L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L18.5858 20H15C14.4477 20 14 19.5523 14 19C14 18.4477 14.4477 18 15 18H16V17.4142L11.5858 13H8V18H9C9.55228 18 10 18.4477 10 19C10 19.5523 9.55228 20 9 20H5C4.44772 20 4 19.5523 4 19C4 18.4477 4.44772 18 5 18H6V7.41421L2.29289 3.70711C1.90237 3.31658 1.90237 2.68342 2.29289 2.29289ZM8 9.41421V11H9.58579L8 9.41421ZM8 5C8 4.44772 8.44772 4 9 4H10C10.5523 4 11 4.44772 11 5C11 5.55228 10.5523 6 10 6H9C8.44772 6 8 5.55228 8 5ZM14 5C14 4.44772 14.4477 4 15 4H19C19.5523 4 20 4.44772 20 5C20 5.55228 19.5523 6 19 6H18V12C18 12.5523 17.5523 13 17 13C16.4477 13 16 12.5523 16 12V6H15C14.4477 6 14 5.55228 14 5Z",fill:e})})},window.tablerIcons.IconHtmlEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHtmlEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.22222 10L5 12L7.22222 14M16.7778 10L19 12L16.7778 14M13.1111 8L10.8889 16M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconInProgress25=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress25",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M15 10C15 9.34339 14.8707 8.69321 14.6194 8.08658C14.3681 7.47995 13.9998 6.92876 13.5355 6.46447C13.0712 6.00017 12.52 5.63188 11.9134 5.3806C11.3068 5.12933 10.6566 5 10 5V10H15Z",fill:e})]})},window.tablerIcons.IconInProgress50=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress50",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M10 15C11.3261 15 12.5979 14.4732 13.5355 13.5355C14.4732 12.5979 15 11.3261 15 10C15 8.67392 14.4732 7.40215 13.5355 6.46447C12.5979 5.52678 11.3261 5 10 5L10 10V15Z",fill:e})]})},window.tablerIcons.IconInProgress75=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress75",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M5 10C5 10.9889 5.29324 11.9556 5.84265 12.7779C6.39206 13.6001 7.17295 14.241 8.08658 14.6194C9.00021 14.9978 10.0055 15.0969 10.9755 14.9039C11.9454 14.711 12.8363 14.2348 13.5355 13.5355C14.2348 12.8363 14.711 11.9454 14.9039 10.9755C15.0969 10.0055 14.9978 9.00021 14.6194 8.08658C14.241 7.17295 13.6001 6.39206 12.7779 5.84265C11.9556 5.29325 10.9889 5 10 5L10 10L5 10Z",fill:e})]})},window.tablerIcons.IconInReview=function({size:o=24,color:e="currentColor",stroke:n=0,color2:r="white",...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInReview",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M14 9.5V11C14 11.3978 13.842 11.7794 13.5607 12.0607C13.2794 12.342 12.8978 12.5 12.5 12.5H8L6 14.5V8C6 7.60218 6.15804 7.22064 6.43934 6.93934C6.72064 6.65804 7.10218 6.5 7.5 6.5H11M12.5 6H14.5M14.5 6V8M14.5 6L12 8.5",stroke:r,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconInternalLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInternalLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H18C19.6569 3 21 4.34315 21 6V17C21 18.6569 19.6569 20 18 20H11C10.4477 20 10 19.5523 10 19C10 18.4477 10.4477 18 11 18H18C18.5523 18 19 17.5523 19 17V6C19 5.44772 18.5523 5 18 5H7C6.44772 5 6 5.44772 6 6V13C6 13.5523 5.55228 14 5 14C4.44772 14 4 13.5523 4 13V6ZM8 10C8 9.44772 8.44772 9 9 9H14C14.5523 9 15 9.44772 15 10V15C15 15.5523 14.5523 16 14 16C13.4477 16 13 15.5523 13 15V12.4142L4.70711 20.7071C4.31658 21.0976 3.68342 21.0976 3.29289 20.7071C2.90237 20.3166 2.90237 19.6834 3.29289 19.2929L11.5858 11H9C8.44772 11 8 10.5523 8 10Z",fill:e})})},window.tablerIcons.IconLinkToBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 8C9 7.44772 9.44772 7 10 7H22C22.5523 7 23 7.44772 23 8V12C23 12.5523 22.5523 13 22 13C21.4477 13 21 12.5523 21 12V9H11V12C11 12.5523 10.5523 13 10 13C9.44772 13 9 12.5523 9 12V8ZM1 10C1 8.89543 1.89543 8 3 8C4.10457 8 5 8.89543 5 10C5 11.1046 4.10457 12 3 12C1.89543 12 1 11.1046 1 10ZM15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929L19.7071 14.2929C20.0976 14.6834 20.0976 15.3166 19.7071 15.7071C19.3166 16.0976 18.6834 16.0976 18.2929 15.7071L17 14.4142V17C17 18.1046 17.8954 19 19 19H23C23.5523 19 24 19.4477 24 20C24 20.5523 23.5523 21 23 21H19C16.7909 21 15 19.2091 15 17V14.4142L13.7071 15.7071C13.3166 16.0976 12.6834 16.0976 12.2929 15.7071C11.9024 15.3166 11.9024 14.6834 12.2929 14.2929L15.2929 11.2929Z",fill:e})})},window.tablerIcons.IconLinkToPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C4 2.34315 5.34315 1 7 1H17C18.6569 1 20 2.34315 20 4V18C20 18.5523 19.5523 19 19 19C18.4477 19 18 18.5523 18 18V4C18 3.44772 17.5523 3 17 3H7C6.44772 3 6 3.44772 6 4V18C6 18.5523 5.55228 19 5 19C4.44772 19 4 18.5523 4 18V4ZM8 6C8 5.44772 8.44772 5 9 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7H9C8.44772 7 8 6.55228 8 6ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L15.7071 16.2929C16.0976 16.6834 16.0976 17.3166 15.7071 17.7071C15.3166 18.0976 14.6834 18.0976 14.2929 17.7071L13 16.4142V19C13 20.1046 13.8954 21 15 21H19C19.5523 21 20 21.4477 20 22C20 22.5523 19.5523 23 19 23H15C12.7909 23 11 21.2091 11 19L11 16.4142L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071C7.90237 17.3166 7.90237 16.6834 8.29289 16.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconLinkToWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V15C22 16.6569 20.6569 18 19 18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19C19.5523 16 20 15.5523 20 15V5C20 4.44772 19.5523 4 19 4H14V7C14 7.55228 13.5523 8 13 8H7C6.44772 8 6 7.55228 6 7V4H5C4.44772 4 4 4.44772 4 5V17C4 17.5523 3.55228 18 3 18C2.44772 18 2 17.5523 2 17V5ZM8 4V6H12V4H8ZM17 6C17.5523 6 18 6.44772 18 7V13C18 13.5523 17.5523 14 17 14C16.4477 14 16 13.5523 16 13V7C16 6.44772 16.4477 6 17 6ZM9.29289 12.2929C9.68342 11.9024 10.3166 11.9024 10.7071 12.2929L13.7071 15.2929C14.0976 15.6834 14.0976 16.3166 13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L11 15.4142V18C11 19.1046 11.8954 20 13 20H17C17.5523 20 18 20.4477 18 21C18 21.5523 17.5523 22 17 22H13C10.7909 22 9 20.2091 9 18L9 15.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071C5.90237 16.3166 5.90237 15.6834 6.29289 15.2929L9.29289 12.2929Z",fill:e})})},window.tablerIcons.IconNewBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H16C16.5523 12 17 12.4477 17 13C17 13.5523 16.5523 14 16 14H13V16C13.5523 16 14 16.4477 14 17C14 17.5523 13.5523 18 13 18H12C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13Z",fill:e})})},window.tablerIcons.IconNewClass=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewClass",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.24254 3.02986C9.77833 3.16381 10.1041 3.70674 9.97014 4.24254L9.03078 8H12.9692L14.0299 3.75746C14.1638 3.22167 14.7067 2.89591 15.2425 3.02986C15.7783 3.16381 16.1041 3.70674 15.9701 4.24254L15.0308 8H17C17.5523 8 18 8.44772 18 9C18 9.55228 17.5523 10 17 10H14.5308L11.9701 20.2425C11.8362 20.7783 11.2933 21.1041 10.7575 20.9701C10.2217 20.8362 9.89591 20.2933 10.0299 19.7575L10.9692 16H7.03078L5.97014 20.2425C5.83619 20.7783 5.29326 21.1041 4.75746 20.9701C4.22167 20.8362 3.89591 20.2933 4.02986 19.7575L4.96922 16H3C2.44772 16 2 15.5523 2 15C2 14.4477 2.44772 14 3 14H5.46922L6.46922 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H6.96922L8.02986 3.75746C8.16381 3.22167 8.70674 2.89591 9.24254 3.02986ZM8.53078 10L7.53078 14H11.4692L12.4692 10H8.53078ZM19 13C19.5523 13 20 13.4477 20 14V16H22C22.5523 16 23 16.4477 23 17C23 17.5523 22.5523 18 22 18H20V20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20V18H16C15.4477 18 15 17.5523 15 17C15 16.4477 15.4477 16 16 16H18V14C18 13.4477 18.4477 13 19 13Z",fill:e})})},window.tablerIcons.IconNewObject=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewObject",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5181 2.12378C11.8182 1.95874 12.1818 1.95874 12.4819 2.12378L14.4819 3.22378C14.9658 3.48994 15.1424 4.098 14.8762 4.58192C14.6101 5.06584 14.002 5.24237 13.5181 4.97622L12 4.14127L10.4819 4.97622C9.998 5.24237 9.38994 5.06584 9.12378 4.58192C8.85763 4.098 9.03416 3.48994 9.51808 3.22378L11.5181 2.12378ZM6.87622 5.91811C7.14237 6.40203 6.96584 7.01008 6.48192 7.27624L6.07506 7.50001L6.48191 7.72378C6.96583 7.98993 7.14237 8.59799 6.87622 9.08191C6.61007 9.56583 6.00201 9.74237 5.51809 9.47622L5 9.19128V10C5 10.5523 4.55228 11 4 11C3.44772 11 3 10.5523 3 10V7.50002C3 7.13533 3.19853 6.79956 3.51808 6.62381L5.51808 5.52381C6.002 5.25765 6.61006 5.43419 6.87622 5.91811ZM17.1238 5.91811C17.3899 5.43419 17.998 5.25765 18.4819 5.52381L20.4819 6.62381C20.8015 6.79956 21 7.13533 21 7.50002V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V9.19128L18.4819 9.47622C17.998 9.74237 17.3899 9.56583 17.1238 9.08191C16.8576 8.59799 17.0342 7.98993 17.5181 7.72378L17.9249 7.50001L17.5181 7.27624C17.0342 7.01008 16.8576 6.40203 17.1238 5.91811ZM9.1275 10.3914C9.39735 9.90952 10.0067 9.73765 10.4886 10.0075L12.0044 10.8563L13.5181 10.0238C14.002 9.75765 14.6101 9.93418 14.8762 10.4181C15.1424 10.902 14.9658 11.5101 14.4819 11.7762L13 12.5913V14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5V12.5861L9.51139 11.7525C9.02952 11.4827 8.85765 10.8733 9.1275 10.3914ZM4 13C4.55228 13 5 13.4477 5 14V15.9087L6.48192 16.7238C6.96584 16.9899 7.14237 17.598 6.87622 18.0819C6.61006 18.5658 6.002 18.7424 5.51808 18.4762L3.51808 17.3762C3.19853 17.2005 3 16.8647 3 16.5V14C3 13.4477 3.44772 13 4 13ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13ZM12 17.5C12.5523 17.5 13 17.9477 13 18.5V19.3088L13.5181 19.0238C14.002 18.7577 14.6101 18.9342 14.8762 19.4181C15.1424 19.902 14.9658 20.5101 14.4819 20.7762L12.4819 21.8762C12.1818 22.0413 11.8182 22.0413 11.5181 21.8762L9.51808 20.7762C9.03416 20.5101 8.85763 19.902 9.12378 19.4181C9.38994 18.9342 9.998 18.7577 10.4819 19.0238L11 19.3088V18.5C11 17.9477 11.4477 17.5 12 17.5Z",fill:e})})},window.tablerIcons.IconNewPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V5C18 4.44772 17.5523 4 17 4H7C6.44772 4 6 4.44772 6 5V17C6 17.5523 6.44772 18 7 18H12C12.5523 18 13 18.4477 13 19C13 19.5523 12.5523 20 12 20H7C5.34315 20 4 18.6569 4 17V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7ZM19 15C19.5523 15 20 15.4477 20 16V18H22C22.5523 18 23 18.4477 23 19C23 19.5523 22.5523 20 22 20H20V22C20 22.5523 19.5523 23 19 23C18.4477 23 18 22.5523 18 22V20H16C15.4477 20 15 19.5523 15 19C15 18.4477 15.4477 18 16 18H18V16C18 15.4477 18.4477 15 19 15Z",fill:e})})},window.tablerIcons.IconNewWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H13C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM20 14C20.5523 14 21 14.4477 21 15V17H23C23.5523 17 24 17.4477 24 18C24 18.5523 23.5523 19 23 19H21V21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21V19H17C16.4477 19 16 18.5523 16 18C16 17.4477 16.4477 17 17 17H19V15C19 14.4477 19.4477 14 20 14Z",fill:e})})},window.tablerIcons.IconNewWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4C5.44772 4 5 4.44772 5 5V6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6V5C3 3.34315 4.34315 2 6 2H8C8.55228 2 9 2.44772 9 3C9 3.55228 8.55228 4 8 4H6ZM15 3C15 2.44772 15.4477 2 16 2H18C19.6569 2 21 3.34315 21 5V6C21 6.55228 20.5523 7 20 7C19.4477 7 19 6.55228 19 6V5C19 4.44772 18.5523 4 18 4H16C15.4477 4 15 3.55228 15 3ZM7 9C7 8.44772 7.44772 8 8 8H16C16.5523 8 17 8.44772 17 9V13C17 13.5523 16.5523 14 16 14H8C7.44772 14 7 13.5523 7 13V9ZM9 10V12H15V10H9ZM4 15C4.55228 15 5 15.4477 5 16V17C5 17.5523 5.44772 18 6 18H8C8.55228 18 9 18.4477 9 19C9 19.5523 8.55228 20 8 20H6C4.34315 20 3 18.6569 3 17V16C3 15.4477 3.44772 15 4 15ZM20 15C20.5523 15 21 15.4477 21 16V18H23C23.5523 18 24 18.4477 24 19C24 19.5523 23.5523 20 23 20H21V22C21 22.5523 20.5523 23 20 23C19.4477 23 19 22.5523 19 22V20H17C16.4477 20 16 19.5523 16 19C16 18.4477 16.4477 18 17 18H19V16C19 15.4477 19.4477 15 20 15Z",fill:e})})},window.tablerIcons.IconNumberedChildren=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedChildren",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M12 12H20M12 18H20M4 6L20 6M8 11V13M8 17V19M5 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconNumberedParents=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedParents",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 6H20M14 12H20M14 18H20M10 5V7M10 11V13M7 11V13M10 17V19M7 17V19M4 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconObjectCompact=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectCompact",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V9C21 9.55228 20.5523 10 20 10H18C17.4477 10 17 9.55228 17 9C17 8.44772 17.4477 8 18 8H19V4H5V8H6C6.55228 8 7 8.44772 7 9C7 9.55228 6.55228 10 6 10H4C3.44772 10 3 9.55228 3 9V3ZM11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289L16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071C16.3166 13.0976 15.6834 13.0976 15.2929 12.7071L13 10.4142V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V10.4142L8.70711 12.7071C8.31658 13.0976 7.68342 13.0976 7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L11.2929 7.29289Z",fill:e})})},window.tablerIcons.IconObjectExpanded=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectExpanded",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V3ZM5 4V8H8C8.55228 8 9 8.44772 9 9C9 9.55228 8.55228 10 8 10H5V20H19V10H16C15.4477 10 15 9.55228 15 9C15 8.44772 15.4477 8 16 8H19V4H5ZM12 6C12.5523 6 13 6.44772 13 7V14.5858L15.2929 12.2929C15.6834 11.9024 16.3166 11.9024 16.7071 12.2929C17.0976 12.6834 17.0976 13.3166 16.7071 13.7071L12.7071 17.7071C12.3166 18.0976 11.6834 18.0976 11.2929 17.7071L7.29289 13.7071C6.90237 13.3166 6.90237 12.6834 7.29289 12.2929C7.68342 11.9024 8.31658 11.9024 8.70711 12.2929L11 14.5858V7C11 6.44772 11.4477 6 12 6Z",fill:e})})},window.tablerIcons.IconOpenAsPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtOpenAsPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V18C20 19.6569 18.6569 21 17 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H17C17.5523 19 18 18.5523 18 18V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L14.7071 15.2929C15.0976 15.6834 15.0976 16.3166 14.7071 16.7071C14.3166 17.0976 13.6834 17.0976 13.2929 16.7071L13 16.4142V23C13 23.5523 12.5523 24 12 24C11.4477 24 11 23.5523 11 23L11 16.4142L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C6.44772 4 6 4.44772 6 5V19C6 19.5523 6.44771 20 7 20H17C17.5523 20 18 19.5523 18 19V5C18 4.44772 17.5523 4 17 4H7ZM4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7Z",fill:e})})},window.tablerIcons.IconPageEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 19V10C5 8.89543 5.89543 8 7 8H17C18.1046 8 19 8.89543 19 10V19M9 12H13M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM7 17C6.44772 17 6 17.4477 6 18V23C6 23.5523 5.55228 24 5 24C4.44772 24 4 23.5523 4 23V18C4 16.3431 5.34315 15 7 15H17C18.6569 15 20 16.3431 20 18V23C20 23.5523 19.5523 24 19 24C18.4477 24 18 23.5523 18 23V18C18 17.4477 17.5523 17 17 17H7ZM8 20C8 19.4477 8.44772 19 9 19H13C13.5523 19 14 19.4477 14 20C14 20.5523 13.5523 21 13 21H9C8.44772 21 8 20.5523 8 20Z",fill:e})})},window.tablerIcons.IconPageRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M9 7H13M12 21H7C5.89543 21 5 20.1046 5 19V5C5 3.89543 5.89543 3 7 3H17C18.1046 3 19 3.89543 19 5V14M17 18H16V23H17M21 18H22V23H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM16.5 16C15.6716 16 15 16.6716 15 17.5C15 18.3284 15.6716 19 16.5 19C17.3284 19 18 18.3284 18 17.5C18 16.6716 17.3284 16 16.5 16ZM13 17.5C13 15.567 14.567 14 16.5 14C18.433 14 20 15.567 20 17.5C20 18.1028 19.8476 18.6699 19.5793 19.1651L21.7071 21.2929C22.0976 21.6834 22.0976 22.3166 21.7071 22.7071C21.3166 23.0976 20.6834 23.0976 20.2929 22.7071L18.1651 20.5793C17.6699 20.8476 17.1028 21 16.5 21C14.567 21 13 19.433 13 17.5Z",fill:e})})},window.tablerIcons.IconPasteAsLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPasteAsLink",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{clipPath:"url(#clip0_3328_925)",children:(0,s.jsx)("path",{d:"M9 5H7C6.46957 5 5.96086 5.21071 5.58579 5.58579C5.21071 5.96086 5 6.46957 5 7V19C5 19.5304 5.21071 20.0391 5.58579 20.4142C5.96086 20.7893 6.46957 21 7 21H8M9 5C9 4.46957 9.21071 3.96086 9.58579 3.58579C9.96086 3.21071 10.4696 3 11 3H13C13.5304 3 14.0391 3.21071 14.4142 3.58579C14.7893 3.96086 15 4.46957 15 5M9 5C9 5.53043 9.21071 6.03914 9.58579 6.41421C9.96086 6.78929 10.4696 7 11 7H13C13.5304 7 14.0391 6.78929 14.4142 6.41421C14.7893 6.03914 15 5.53043 15 5M15 5H17C17.5304 5 18.0391 5.21071 18.4142 5.58579C18.7893 5.96086 19 6.46957 19 7V9M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_3328_925",children:(0,s.jsx)("rect",{width:o,height:o,fill:"white"})})})]})},window.tablerIcons.IconPaused=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPaused",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M8.5 6.5H7.5C7.22386 6.5 7 6.72386 7 7V13C7 13.2761 7.22386 13.5 7.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V7C9 6.72386 8.77614 6.5 8.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12.5 6.5H11.5C11.2239 6.5 11 6.72386 11 7V13C11 13.2761 11.2239 13.5 11.5 13.5H12.5C12.7761 13.5 13 13.2761 13 13V7C13 6.72386 12.7761 6.5 12.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconPhotoLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPhotoLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 8H15.01M4 15V17C4 18.6569 5.34315 20 7 20H8M4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V9M4 15L8 11C8.45606 10.5611 8.97339 10.3301 9.5 10.3301C10.0266 10.3301 10.5439 10.5611 11 11L13.5 13.5M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlHigh=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlHigh",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlLow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlLow",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlMedium=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlMedium",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlNone=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlNone",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 12H7M19 12H17M11 12H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlUrgent=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlUrgent",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3H6ZM13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8V12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12V8ZM13 15.99C13 15.4377 12.5523 14.99 12 14.99C11.4477 14.99 11 15.4377 11 15.99V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V15.99Z",fill:e})})},window.tablerIcons.IconQuery=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQuery",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.1429 13.1429L16 16M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21ZM13.7143 10.8571C13.7143 12.4351 12.4351 13.7143 10.8571 13.7143C9.27919 13.7143 8 12.4351 8 10.8571C8 9.27919 9.27919 8 10.8571 8C12.4351 8 13.7143 9.27919 13.7143 10.8571Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconQueryCode=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQueryCode",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M11.1429 11.1429L14 14M13 19H3C1.89543 19 1 18.1046 1 17V3C1 1.89543 1.89543 1 3 1H17C18.1046 1 19 1.89543 19 3V14M18 18H17V23H18M22 18H23V23H22M11.7143 8.85714C11.7143 10.4351 10.4351 11.7143 8.85714 11.7143C7.27919 11.7143 6 10.4351 6 8.85714C6 7.27919 7.27919 6 8.85714 6C10.4351 6 11.7143 7.27919 11.7143 8.85714Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconReferencesHide=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesHide",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 2.29289C11.6834 1.90237 12.3166 1.90237 12.7071 2.29289L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711C14.3166 6.09763 13.6834 6.09763 13.2929 5.70711L12 4.41421L10.7071 5.70711C10.3166 6.09763 9.68342 6.09763 9.29289 5.70711C8.90237 5.31658 8.90237 4.68342 9.29289 4.29289L11.2929 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconReferencesShow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesShow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 2.29289C9.68342 1.90237 10.3166 1.90237 10.7071 2.29289L12 3.58579L13.2929 2.29289C13.6834 1.90237 14.3166 1.90237 14.7071 2.29289C15.0976 2.68342 15.0976 3.31658 14.7071 3.70711L12.7071 5.70711C12.3166 6.09763 11.6834 6.09763 11.2929 5.70711L9.29289 3.70711C8.90237 3.31658 8.90237 2.68342 9.29289 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconResetPassword=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtResetPassword",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C11.2044 4 10.4413 4.31607 9.87868 4.87868C9.31607 5.44129 9 6.20435 9 7V10H15V7C15 6.20435 14.6839 5.44129 14.1213 4.87868C13.5587 4.31607 12.7956 4 12 4ZM16 12C16.5523 12 17 11.5523 17 11V7C17 5.67392 16.4732 4.40215 15.5355 3.46447C14.5979 2.52678 13.3261 2 12 2C10.6739 2 9.40215 2.52678 8.46447 3.46447C7.52678 4.40215 7 5.67392 7 7V10C5.34315 10 4 11.3431 4 13V19C4 20.6569 5.34315 22 7 22H10C10.5523 22 11 21.5523 11 21C11 20.4477 10.5523 20 10 20H7C6.44772 20 6 19.5523 6 19V13C6 12.4477 6.44772 12 7 12H16ZM23 13C23.5523 13 24 13.4477 24 14V18C24 18.5523 23.5523 19 23 19H21.8952C21.8805 19.0003 21.8659 19.0003 21.8514 19H19C18.4477 19 18 18.5523 18 18C18 17.4477 18.4477 17 19 17H20.2363C19.6867 16.3861 18.8879 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22C18.8959 22 19.6991 21.6086 20.2503 20.9841C20.6157 20.57 21.2477 20.5306 21.6617 20.8961C22.0758 21.2616 22.1152 21.8935 21.7497 22.3076C20.835 23.3439 19.4935 24 18 24C15.2386 24 13 21.7614 13 19C13 16.2386 15.2386 14 18 14C19.6364 14 21.0881 14.7857 22 15.9999V14C22 13.4477 22.4477 13 23 13Z",fill:e})})},window.tablerIcons.IconSelectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M3 3H21V21H3V3Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 2H4V4H2V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 2H22V4H20V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 20H22V22H20V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 7H10V10H7V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 7H17V10H14V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 14H10V17H7V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 14H17V17H14V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconSelectCursor=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectCursor",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.29292 4.29289C4.56075 4.02506 4.95692 3.93154 5.31625 4.05132L19.3163 8.71798C19.7 8.84589 19.9688 9.19233 19.9975 9.59578C20.0262 9.99922 19.809 10.3802 19.4472 10.5611L16.6659 11.9518L19.4483 14.7343C19.8389 15.1248 19.8389 15.758 19.4483 16.1485L16.1485 19.4483C15.758 19.8388 15.1248 19.8388 14.7343 19.4483L11.9518 16.6658L10.5611 19.4472C10.3802 19.809 9.99925 20.0262 9.5958 19.9975C9.19236 19.9688 8.84591 19.6999 8.71801 19.3162L4.05134 5.31623C3.93157 4.95689 4.02509 4.56073 4.29292 4.29289ZM6.58117 6.58114L9.85194 16.3934L10.7834 14.5305C10.9272 14.2429 11.2004 14.0421 11.5177 13.9906C11.835 13.9391 12.1577 14.0433 12.385 14.2706L15.4414 17.327L17.327 15.4414L14.2706 12.3849C14.0433 12.1576 13.9391 11.8349 13.9906 11.5177C14.0421 11.2004 14.243 10.9272 14.5305 10.7834L16.3935 9.85191L6.58117 6.58114Z",fill:e})})},window.tablerIcons.IconStackPop=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPop",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7 9.5L4 11L12 15L20 11L17 9.5M4 15L12 19L20 15M12 11V4M12 4L9 7M12 4L15 7",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconStackPull=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPull",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6 10L4 11L12 15L20 11L18 10M4 15L12 19L20 15M12 4V11M12 11L15 8M12 11L9 8",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconText=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtText",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V7C19 7.55228 18.5523 8 18 8C17.4477 8 17 7.55228 17 7V6H13V18H14C14.5523 18 15 18.4477 15 19C15 19.5523 14.5523 20 14 20H10C9.44772 20 9 19.5523 9 19C9 18.4477 9.44772 18 10 18H11V6H7V7C7 7.55228 6.55228 8 6 8C5.44772 8 5 7.55228 5 7V5Z",fill:e})})},window.tablerIcons.IconTodo=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTodo",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"})})},window.tablerIcons.IconTomorrow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTomorrow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M20 15V7C20 5.89543 19.1046 5 18 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H11M20 19L22 21M22 21L20 23M22 21H15M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconUngroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtUngroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3C2 2.44772 2.44772 2 3 2H5C5.55228 2 6 2.44772 6 3H12C12 2.44772 12.4477 2 13 2H15C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6V8H18C18 7.44772 18.4477 7 19 7H21C21.5523 7 22 7.44772 22 8V10C22 10.5523 21.5523 11 21 11V18C21.5523 18 22 18.4477 22 19V21C22 21.5523 21.5523 22 21 22H19C18.4477 22 18 21.5523 18 21H11C11 21.5523 10.5523 22 10 22H8C7.44772 22 7 21.5523 7 21V19C7 18.4477 7.44772 18 8 18V15H6C6 15.5523 5.55228 16 5 16H3C2.44772 16 2 15.5523 2 15V13C2 12.4477 2.44772 12 3 12V6C2.44772 6 2 5.55228 2 5V3ZM5 6V12C5.55228 12 6 12.4477 6 13H12C12 12.4477 12.4477 12 13 12V6C12.4477 6 12 5.55228 12 5H6C6 5.55228 5.55228 6 5 6ZM15 12V10H18C18 10.5523 18.4477 11 19 11V18C18.4477 18 18 18.4477 18 19H11C11 18.4477 10.5523 18 10 18V15H12C12 15.5523 12.4477 16 13 16H15C15.5523 16 16 15.5523 16 15V13C16 12.4477 15.5523 12 15 12Z",fill:e})})},window.tablerIcons.IconVideoEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtVideoEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M10.5 9V15L14.5 12L10.5 9Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1 10C1 6.68629 3.68629 4 7 4H17C20.3137 4 23 6.68629 23 10V14C23 17.3137 20.3137 20 17 20H7C3.68629 20 1 17.3137 1 14V10Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18 9C18 8.44772 17.5523 8 17 8C16.4477 8 16 8.44772 16 9H18ZM16 15C16 15.5523 16.4477 16 17 16C17.5523 16 18 15.5523 18 15H16ZM3 14C2.44772 14 2 14.4477 2 15C2 15.5523 2.44772 16 3 16V14ZM11 15H12C12 14.4477 11.5523 14 11 14V15ZM10 19C10 19.5523 10.4477 20 11 20C11.5523 20 12 19.5523 12 19H10ZM14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5H14ZM13 9V10C13.5523 10 14 9.55228 14 9H13ZM7 9H6C6 9.55228 6.44772 10 7 10V9ZM8 5C8 4.44772 7.55228 4 7 4C6.44772 4 6 4.44772 6 5H8ZM5 6H19V4H5V6ZM20 7V17H22V7H20ZM19 18H5V20H19V18ZM4 17V7H2V17H4ZM5 18C4.44772 18 4 17.5523 4 17H2C2 18.6569 3.34315 20 5 20V18ZM20 17C20 17.5523 19.5523 18 19 18V20C20.6569 20 22 18.6569 22 17H20ZM19 6C19.5523 6 20 6.44772 20 7H22C22 5.34315 20.6569 4 19 4V6ZM5 4C3.34315 4 2 5.34315 2 7H4C4 6.44772 4.44772 6 5 6V4ZM16 9V15H18V9H16ZM3 16H11V14H3V16ZM10 15V19H12V15H10ZM12 5V9H14V5H12ZM13 8H7V10H13V8ZM8 9V5H6V9H8Z",fill:e})})},window.tablerIcons.IconWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5C5.44772 5 5 5.44772 5 6V7C5 7.55228 4.55228 8 4 8C3.44772 8 3 7.55228 3 7V6C3 4.34315 4.34315 3 6 3H8C8.55228 3 9 3.44772 9 4C9 4.55228 8.55228 5 8 5H6ZM15 4C15 3.44772 15.4477 3 16 3H18C19.6569 3 21 4.34315 21 6V7C21 7.55228 20.5523 8 20 8C19.4477 8 19 7.55228 19 7V6C19 5.44772 18.5523 5 18 5H16C15.4477 5 15 4.55228 15 4ZM7 10C7 9.44772 7.44772 9 8 9H16C16.5523 9 17 9.44772 17 10V14C17 14.5523 16.5523 15 16 15H8C7.44772 15 7 14.5523 7 14V10ZM9 11V13H15V11H9ZM4 16C4.55228 16 5 16.4477 5 17V18C5 18.5523 5.44772 19 6 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H6C4.34315 21 3 19.6569 3 18V17C3 16.4477 3.44772 16 4 16ZM20 16C20.5523 16 21 16.4477 21 17V18C21 19.6569 19.6569 21 18 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H18C18.5523 19 19 18.5523 19 18V17C19 16.4477 19.4477 16 20 16Z",fill:e})})},window.tablerIcons.IconWhiteboardFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM2 18C2 16.3431 3.34315 15 5 15H19C20.6569 15 22 16.3431 22 18V23C22 23.5523 21.5523 24 21 24C20.4477 24 20 23.5523 20 23V18C20 17.4477 19.5523 17 19 17H14V20C14 20.5523 13.5523 21 13 21H7C6.44772 21 6 20.5523 6 20V17H5C4.44772 17 4 17.4477 4 18V23C4 23.5523 3.55228 24 3 24C2.44772 24 2 23.5523 2 23V18ZM8 17V19H12V17H8ZM17 19C17.5523 19 18 19.4477 18 20V23C18 23.5523 17.5523 24 17 24C16.4477 24 16 23.5523 16 23V20C16 19.4477 16.4477 19 17 19Z",fill:e})})},window.tablerIcons.IconWhiteboardSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H12C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconXEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtX-embed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 16L11.384 12.616M12.614 11.386L16 8M10.2084 8.10216L15.7083 15.6022C15.8294 15.7673 15.7114 16 15.5067 16H13.9932C13.9135 16 13.8387 15.9621 13.7916 15.8978L8.29174 8.39784C8.17065 8.23271 8.28857 8 8.49334 8H10.0068C10.0865 8 10.1613 8.03794 10.2084 8.10216ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconYesterday=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtYesterday",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M4 15V7C4 5.89543 4.89543 5 6 5H18C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H13M4 19L2 21M2 21L4 23M2 21H9M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconZoomToFit=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtZoomToFit",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M20 4H16H18C18.5304 4 19.0391 4.21071 19.4142 4.58579C19.7893 4.96086 20 5.46957 20 6V8V4ZM20 4L14 10M4 20H8H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V16V20ZM4 20L10 14M4 8V6C4 5.46957 4.21071 4.96086 4.58579 4.58579C4.96086 4.21071 5.46957 4 6 4H8M16 20H18C18.5304 20 19.0391 19.7893 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 18V16",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}})(); \ No newline at end of file diff --git a/resources/mobile/index.html b/resources/mobile/index.html index 236c77ece7dc..1052ef4c19a4 100644 --- a/resources/mobile/index.html +++ b/resources/mobile/index.html @@ -18,6 +18,9 @@ + + + diff --git a/resources/mobile/js/tabler.ext.js b/resources/mobile/js/tabler.ext.js index e2d1a89abcc2..7559a6ccf8de 100644 --- a/resources/mobile/js/tabler.ext.js +++ b/resources/mobile/js/tabler.ext.js @@ -1 +1 @@ -(()=>{function o(o,e,n,r){Object.defineProperty(o,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=globalThis,n={},r={},t=e.parcelRequiree92c;null==t&&((t=function(o){if(o in n)return n[o].exports;if(o in r){var e=r[o];delete r[o];var t={id:o,exports:{}};return n[o]=t,e.call(t.exports,t,t.exports),t.exports}var i=Error("Cannot find module '"+o+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(o,e){r[o]=e},e.parcelRequiree92c=t);var i=t.register;i("9Hk4c",function(e,n){o(e.exports,"Fragment",()=>r,o=>r=o),o(e.exports,"jsx",()=>i,o=>i=o),o(e.exports,"jsxs",()=>s,o=>s=o);var r,i,s,l=t("a46g0"),C=Symbol.for("react.element"),c=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,h={key:!0,ref:!0,__self:!0,__source:!0};function w(o,e,n){var r,t={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==e.key&&(i=""+e.key),void 0!==e.ref&&(s=e.ref),e)d.call(e,r)&&!h.hasOwnProperty(r)&&(t[r]=e[r]);if(o&&o.defaultProps)for(r in e=o.defaultProps)void 0===t[r]&&(t[r]=e[r]);return{$$typeof:C,type:o,key:i,ref:s,props:t,_owner:a.current}}r=c,i=w,s=w}),i("a46g0",function(o,e){o.exports=React});var s={};s=t("9Hk4c"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),window.tablerIcons=window.tablerIcons||{},window.tablerIcons.IconAddLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAddLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2933 4.29278C13.1438 3.4422 14.2975 2.96436 15.5004 2.96436C16.7033 2.96436 17.8569 3.4422 18.7075 4.29278C19.5581 5.14336 20.0359 6.29699 20.0359 7.49989C20.0359 8.70279 19.5581 9.85642 18.7075 10.707L14.7109 14.7036C14.2927 15.1294 13.7939 15.4678 13.2436 15.699C12.6917 15.9309 12.099 16.0504 11.5004 16.0504C10.9017 16.0504 10.309 15.9309 9.7571 15.699C9.20517 15.4671 8.70507 15.1274 8.28608 14.6997C7.89956 14.3053 7.90602 13.6721 8.30051 13.2856C8.695 12.8991 9.32813 12.9055 9.71465 13.3C9.94742 13.5376 10.2253 13.7263 10.5319 13.8552C10.8385 13.984 11.1678 14.0504 11.5004 14.0504C11.833 14.0504 12.1622 13.984 12.4688 13.8552C12.7755 13.7263 13.0533 13.5376 13.2861 13.3L13.2932 13.2927L13.2933 13.2928L17.2933 9.29278C17.7688 8.81728 18.0359 8.17235 18.0359 7.49989C18.0359 6.82742 17.7688 6.1825 17.2933 5.707C16.8178 5.23149 16.1728 4.96436 15.5004 4.96436C14.8279 4.96436 14.183 5.23149 13.7075 5.707L13.2075 6.207C12.8169 6.59752 12.1838 6.59752 11.7933 6.207C11.4027 5.81647 11.4027 5.18331 11.7933 4.79278L12.2933 4.29278ZM8.75711 8.30085C9.30904 8.06892 9.9017 7.94946 10.5004 7.94946C11.0991 7.94946 11.6917 8.06892 12.2436 8.30085C12.7956 8.53277 13.2957 8.87249 13.7147 9.30012C14.1012 9.69461 14.0947 10.3277 13.7002 10.7143C13.3057 11.1008 12.6726 11.0943 12.2861 10.6998C12.0533 10.4623 11.7755 10.2735 11.4689 10.1447C11.1622 10.0158 10.833 9.94946 10.5004 9.94946C10.1678 9.94946 9.83853 10.0158 9.5319 10.1447C9.22527 10.2735 8.94743 10.4623 8.71466 10.6998L8.70752 10.7071L8.70748 10.7071L4.70748 14.7071C4.23198 15.1826 3.96484 15.8275 3.96484 16.5C3.96484 17.1724 4.23198 17.8174 4.70748 18.2929C5.18299 18.7684 5.82791 19.0355 6.50038 19.0355C7.17284 19.0355 7.81777 18.7684 8.29327 18.2929L8.79327 17.7929C9.18379 17.4023 9.81696 17.4023 10.2075 17.7929C10.598 18.1834 10.598 18.8166 10.2075 19.2071L9.70748 19.7071C8.85691 20.5577 7.70328 21.0355 6.50038 21.0355C5.29748 21.0355 4.14385 20.5577 3.29327 19.7071C2.44269 18.8565 1.96484 17.7029 1.96484 16.5C1.96484 15.2971 2.44269 14.1434 3.29327 13.2929L7.28985 9.29629C7.70807 8.87046 8.20683 8.53208 8.75711 8.30085ZM19.0005 14C19.5528 14 20.0005 14.4477 20.0005 15V17H22.0005C22.5528 17 23.0005 17.4477 23.0005 18C23.0005 18.5523 22.5528 19 22.0005 19H20.0005V21C20.0005 21.5523 19.5528 22 19.0005 22C18.4482 22 18.0005 21.5523 18.0005 21V19H16.0005C15.4482 19 15.0005 18.5523 15.0005 18C15.0005 17.4477 15.4482 17 16.0005 17H18.0005V15C18.0005 14.4477 18.4482 14 19.0005 14Z",fill:e})})},window.tablerIcons.IconAppFeature=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAppFeature",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7C2 5.34315 3.34315 4 5 4H19C20.6569 4 22 5.34315 22 7V17C22 18.6569 20.6569 20 19 20H15.0209C15.0064 20.0003 14.992 20.0003 14.9776 20H9.02243C9.00802 20.0003 8.99357 20.0003 8.97908 20H5C3.34315 20 2 18.6569 2 17V7ZM13.7192 18L13.5299 17.2425C13.4447 16.9018 13.5445 16.5413 13.7929 16.2929L14.8787 15.2071L13.3586 14.9899C13.0337 14.9435 12.7523 14.7407 12.6056 14.4472L12 13.2361L11.3944 14.4472C11.2477 14.7407 10.9663 14.9435 10.6414 14.9899L9.12132 15.2071L10.2071 16.2929C10.4555 16.5413 10.5553 16.9018 10.4701 17.2425L10.2808 18H13.7192ZM15.7808 18H19C19.5523 18 20 17.5523 20 17V7C20 6.44772 19.5523 6 19 6H5C4.44772 6 4 6.44772 4 7V17C4 17.5523 4.44772 18 5 18H8.21922L8.39254 17.3067L6.29289 15.2071C6.02506 14.9393 5.93154 14.5431 6.05132 14.1838C6.17109 13.8244 6.48361 13.5636 6.85858 13.5101L9.83989 13.0841L11.1056 10.5528C11.275 10.214 11.6212 10 12 10C12.3788 10 12.725 10.214 12.8944 10.5528L14.1601 13.0841L17.1414 13.5101C17.5164 13.5636 17.8289 13.8244 17.9487 14.1838C18.0685 14.5431 17.9749 14.9393 17.7071 15.2071L15.6075 17.3067L15.7808 18Z",fill:e}),(0,s.jsx)("path",{d:"M6 6.99C6.55228 6.99 7 7.43771 7 7.99V8C7 8.55229 6.55228 9 6 9C5.44772 9 5 8.55229 5 8V7.99C5 7.43771 5.44772 6.99 6 6.99Z",fill:e}),(0,s.jsx)("path",{d:"M9 6.99C9.55228 6.99 10 7.43771 10 7.99V8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8V7.99C8 7.43771 8.44772 6.99 9 6.99Z",fill:e})]})},window.tablerIcons.IconBacklog=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBacklog",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2",strokeDasharray:"4 4"})})},window.tablerIcons.IconBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 10C9 9.44772 9.44772 9 10 9H22C22.5523 9 23 9.44772 23 10V14C23 14.5523 22.5523 15 22 15H10C9.44772 15 9 14.5523 9 14V10ZM11 11V13H21V11H11ZM1 12C1 10.8954 1.89543 10 3 10C4.10457 10 5 10.8954 5 12C5 13.1046 4.10457 14 3 14C1.89543 14 1 13.1046 1 12Z",fill:e})})},window.tablerIcons.IconBlockEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M22 10H13V14H22M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM11 17V19H21V17H11ZM9 16C9 15.4477 9.44772 15 10 15H22C22.5523 15 23 15.4477 23 16V20C23 20.5523 22.5523 21 22 21H10C9.44772 21 9 20.5523 9 20V16ZM1 18C1 16.8954 1.89543 16 3 16C4.10457 16 5 16.8954 5 18C5 19.1046 4.10457 20 3 20C1.89543 20 1 19.1046 1 18Z",fill:e})})},window.tablerIcons.IconBlockRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 14H10V10H22V12M18 16C17.3581 17.6049 17.3581 19.3951 18 21M22 16C22.6419 17.6049 22.6419 19.3951 22 21M4 12C4 12.5523 3.55228 13 3 13C2.44772 13 2 12.5523 2 12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H14C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconCalendarDots=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCalendarDots",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 4H6C4.89543 4 4 4.89543 4 6V10M8 4H16M8 4V2M8 4V6M16 4H18C19.1046 4 20 4.89543 20 6V10M16 4V2M16 4V6M4 10H20M4 10V14M20 10V14M6 20C6 20.5523 5.55228 21 5 21C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19C5.55228 19 6 19.4477 6 20ZM13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20C11 19.4477 11.4477 19 12 19C12.5523 19 13 19.4477 13 20ZM20 20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20C18 19.4477 18.4477 19 19 19C19.5523 19 20 19.4477 20 20Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconCancelled=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCancelled",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M13 7L7 13M7 7L13 13",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconCloudExclamation=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCloudExclamation",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4366 6.03387C12.8308 5.92373 12.2062 5.92205 11.5997 6.02894C10.9931 6.13582 10.4204 6.34848 9.91384 6.65116C8.89016 7.26279 8.20994 8.19494 7.98007 9.21902C7.87759 9.67556 7.47225 10 7.00435 10C6.00786 10 5.06063 10.3791 4.36896 11.0407C3.6788 11.7008 3.2998 12.5864 3.2998 13.5C3.2998 14.4136 3.6788 15.2992 4.36896 15.9593C5.06063 16.6209 6.00786 17 7.00435 17H8C8.55228 17 9 17.4477 9 18C9 18.5523 8.55228 19 8 19H7.00435C5.5054 19 4.05939 18.4308 2.98651 17.4046C1.91213 16.3769 1.2998 14.9734 1.2998 13.5C1.2998 12.0266 1.91213 10.6231 2.98651 9.59538C3.87696 8.74365 5.02444 8.20677 6.24589 8.04882C6.72397 6.76252 7.65926 5.66843 8.88803 4.93427C9.60923 4.50337 10.4128 4.20727 11.2526 4.05929C12.0923 3.91131 12.9556 3.91362 13.7943 4.06613C14.6332 4.21864 15.4349 4.5191 16.1534 4.95398C16.8721 5.38893 17.4955 5.95128 17.9839 6.61332C18.4724 7.27568 18.8155 8.02416 18.988 8.817C19.0731 9.20796 19.1156 9.60469 19.1155 10.0014C20.2687 10.0298 21.3686 10.5003 22.1863 11.318C23.0302 12.1619 23.5044 13.3065 23.5044 14.5C23.5044 15.6935 23.0302 16.8381 22.1863 17.682C21.3424 18.5259 20.1978 19 19.0044 19H16C15.4477 19 15 18.5523 15 18C15 17.4477 15.4477 17 16 17H19.0044C19.6674 17 20.3033 16.7366 20.7721 16.2678C21.241 15.7989 21.5044 15.163 21.5044 14.5C21.5044 13.837 21.241 13.2011 20.7721 12.7322C20.3033 12.2634 19.6674 12 19.0044 12H18.0044C17.7007 12 17.4134 11.862 17.2236 11.6249C17.0339 11.3878 16.9621 11.0773 17.0286 10.781C17.1427 10.273 17.1444 9.75071 17.0337 9.24219C16.9231 8.7334 16.7009 8.24319 16.3744 7.80054C16.0476 7.35756 15.6221 6.9702 15.1178 6.66498C14.6134 6.35969 14.0423 6.144 13.4366 6.03387ZM12 14C12.5523 14 13 14.4477 13 15V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V15C11 14.4477 11.4477 14 12 14ZM12 21C12.5523 21 13 21.4477 13 22V22.01C13 22.5623 12.5523 23.01 12 23.01C11.4477 23.01 11 22.5623 11 22.01V22C11 21.4477 11.4477 21 12 21Z",fill:e})})},window.tablerIcons.IconConnector=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtConnector",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5C11 4.44772 11.4477 4 12 4H19C19.5523 4 20 4.44772 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V7.41421L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L16.5858 6H12C11.4477 6 11 5.55228 11 5Z",fill:e})})},window.tablerIcons.IconDeselectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDeselectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 9L12 12M12 12L9 15M12 12L9 9M12 12L15 15M3 3H21V21H3V3ZM2 2H4V4H2V2ZM20 2H22V4H20V2ZM20 20H22V22H20V20ZM2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconDone=function({size:o=24,color:e="currentColor",color2:n="white",stroke:r=0,...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:r,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDone",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M6.5 10L9 12.5L14 7.5",stroke:n,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconGroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtGroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2C1 1.44772 1.44772 1 2 1H4C4.55228 1 5 1.44772 5 2H19C19 1.44772 19.4477 1 20 1H22C22.5523 1 23 1.44772 23 2V4C23 4.55228 22.5523 5 22 5V19C22.5523 19 23 19.4477 23 20V22C23 22.5523 22.5523 23 22 23H20C19.4477 23 19 22.5523 19 22H5C5 22.5523 4.55228 23 4 23H2C1.44772 23 1 22.5523 1 22V20C1 19.4477 1.44772 19 2 19V5C1.44772 5 1 4.55228 1 4V2ZM4 5V19C4.55228 19 5 19.4477 5 20H19C19 19.4477 19.4477 19 20 19V5C19.4477 5 19 4.55228 19 4H5C5 4.55228 4.55228 5 4 5ZM6 7C6 6.44772 6.44772 6 7 6H13C13.5523 6 14 6.44772 14 7V9H17C17.5523 9 18 9.44772 18 10V17C18 17.5523 17.5523 18 17 18H10C9.44772 18 9 17.5523 9 17V14H7C6.44772 14 6 13.5523 6 13V7ZM11 14V16H16V11H14V13C14 13.5523 13.5523 14 13 14H11ZM12 8H8V12H12V8Z",fill:e})})},window.tablerIcons.IconHAuto=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtH-auto",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H5C5.55228 5 6 5.44772 6 6C6 6.55228 5.55228 7 5 7V11H11V7C10.4477 7 10 6.55228 10 6C10 5.44772 10.4477 5 11 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7V17C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18C10 17.4477 10.4477 17 11 17V13H5V17C5.55228 17 6 17.4477 6 18C6 18.5523 5.55228 19 5 19H3C2.44772 19 2 18.5523 2 18C2 17.4477 2.44772 17 3 17V7C2.44772 7 2 6.55228 2 6ZM19 11C18.7348 11 18.4804 11.1054 18.2929 11.2929C18.1054 11.4804 18 11.7348 18 12V14H20V12C20 11.7348 19.8946 11.4804 19.7071 11.2929C19.5196 11.1054 19.2652 11 19 11ZM22 12C22 11.2043 21.6839 10.4413 21.1213 9.87868C20.5587 9.31607 19.7957 9 19 9C18.2043 9 17.4413 9.31607 16.8787 9.87868C16.3161 10.4413 16 11.2043 16 12V18C16 18.5523 16.4477 19 17 19C17.5523 19 18 18.5523 18 18V16H20V18C20 18.5523 20.4477 19 21 19C21.5523 19 22 18.5523 22 18V12Z",fill:e})})},window.tablerIcons.IconHeadingOff=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHeadingOff",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.29289 2.29289C2.68342 1.90237 3.31658 1.90237 3.70711 2.29289L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L18.5858 20H15C14.4477 20 14 19.5523 14 19C14 18.4477 14.4477 18 15 18H16V17.4142L11.5858 13H8V18H9C9.55228 18 10 18.4477 10 19C10 19.5523 9.55228 20 9 20H5C4.44772 20 4 19.5523 4 19C4 18.4477 4.44772 18 5 18H6V7.41421L2.29289 3.70711C1.90237 3.31658 1.90237 2.68342 2.29289 2.29289ZM8 9.41421V11H9.58579L8 9.41421ZM8 5C8 4.44772 8.44772 4 9 4H10C10.5523 4 11 4.44772 11 5C11 5.55228 10.5523 6 10 6H9C8.44772 6 8 5.55228 8 5ZM14 5C14 4.44772 14.4477 4 15 4H19C19.5523 4 20 4.44772 20 5C20 5.55228 19.5523 6 19 6H18V12C18 12.5523 17.5523 13 17 13C16.4477 13 16 12.5523 16 12V6H15C14.4477 6 14 5.55228 14 5Z",fill:e})})},window.tablerIcons.IconHtmlEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHtmlEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.22222 10L5 12L7.22222 14M16.7778 10L19 12L16.7778 14M13.1111 8L10.8889 16M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconInProgress25=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress25",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M15 10C15 9.34339 14.8707 8.69321 14.6194 8.08658C14.3681 7.47995 13.9998 6.92876 13.5355 6.46447C13.0712 6.00017 12.52 5.63188 11.9134 5.3806C11.3068 5.12933 10.6566 5 10 5V10H15Z",fill:e})]})},window.tablerIcons.IconInProgress50=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress50",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M10 15C11.3261 15 12.5979 14.4732 13.5355 13.5355C14.4732 12.5979 15 11.3261 15 10C15 8.67392 14.4732 7.40215 13.5355 6.46447C12.5979 5.52678 11.3261 5 10 5L10 10V15Z",fill:e})]})},window.tablerIcons.IconInProgress75=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress75",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M5 10C5 10.9889 5.29324 11.9556 5.84265 12.7779C6.39206 13.6001 7.17295 14.241 8.08658 14.6194C9.00021 14.9978 10.0055 15.0969 10.9755 14.9039C11.9454 14.711 12.8363 14.2348 13.5355 13.5355C14.2348 12.8363 14.711 11.9454 14.9039 10.9755C15.0969 10.0055 14.9978 9.00021 14.6194 8.08658C14.241 7.17295 13.6001 6.39206 12.7779 5.84265C11.9556 5.29325 10.9889 5 10 5L10 10L5 10Z",fill:e})]})},window.tablerIcons.IconInReview=function({size:o=24,color:e="currentColor",stroke:n=0,color2:r="white",...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInReview",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M14 9.5V11C14 11.3978 13.842 11.7794 13.5607 12.0607C13.2794 12.342 12.8978 12.5 12.5 12.5H8L6 14.5V8C6 7.60218 6.15804 7.22064 6.43934 6.93934C6.72064 6.65804 7.10218 6.5 7.5 6.5H11M12.5 6H14.5M14.5 6V8M14.5 6L12 8.5",stroke:r,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconInternalLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInternalLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H18C19.6569 3 21 4.34315 21 6V17C21 18.6569 19.6569 20 18 20H11C10.4477 20 10 19.5523 10 19C10 18.4477 10.4477 18 11 18H18C18.5523 18 19 17.5523 19 17V6C19 5.44772 18.5523 5 18 5H7C6.44772 5 6 5.44772 6 6V13C6 13.5523 5.55228 14 5 14C4.44772 14 4 13.5523 4 13V6ZM8 10C8 9.44772 8.44772 9 9 9H14C14.5523 9 15 9.44772 15 10V15C15 15.5523 14.5523 16 14 16C13.4477 16 13 15.5523 13 15V12.4142L4.70711 20.7071C4.31658 21.0976 3.68342 21.0976 3.29289 20.7071C2.90237 20.3166 2.90237 19.6834 3.29289 19.2929L11.5858 11H9C8.44772 11 8 10.5523 8 10Z",fill:e})})},window.tablerIcons.IconLinkToBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 8C9 7.44772 9.44772 7 10 7H22C22.5523 7 23 7.44772 23 8V12C23 12.5523 22.5523 13 22 13C21.4477 13 21 12.5523 21 12V9H11V12C11 12.5523 10.5523 13 10 13C9.44772 13 9 12.5523 9 12V8ZM1 10C1 8.89543 1.89543 8 3 8C4.10457 8 5 8.89543 5 10C5 11.1046 4.10457 12 3 12C1.89543 12 1 11.1046 1 10ZM15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929L19.7071 14.2929C20.0976 14.6834 20.0976 15.3166 19.7071 15.7071C19.3166 16.0976 18.6834 16.0976 18.2929 15.7071L17 14.4142V17C17 18.1046 17.8954 19 19 19H23C23.5523 19 24 19.4477 24 20C24 20.5523 23.5523 21 23 21H19C16.7909 21 15 19.2091 15 17V14.4142L13.7071 15.7071C13.3166 16.0976 12.6834 16.0976 12.2929 15.7071C11.9024 15.3166 11.9024 14.6834 12.2929 14.2929L15.2929 11.2929Z",fill:e})})},window.tablerIcons.IconLinkToPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C4 2.34315 5.34315 1 7 1H17C18.6569 1 20 2.34315 20 4V18C20 18.5523 19.5523 19 19 19C18.4477 19 18 18.5523 18 18V4C18 3.44772 17.5523 3 17 3H7C6.44772 3 6 3.44772 6 4V18C6 18.5523 5.55228 19 5 19C4.44772 19 4 18.5523 4 18V4ZM8 6C8 5.44772 8.44772 5 9 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7H9C8.44772 7 8 6.55228 8 6ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L15.7071 16.2929C16.0976 16.6834 16.0976 17.3166 15.7071 17.7071C15.3166 18.0976 14.6834 18.0976 14.2929 17.7071L13 16.4142V19C13 20.1046 13.8954 21 15 21H19C19.5523 21 20 21.4477 20 22C20 22.5523 19.5523 23 19 23H15C12.7909 23 11 21.2091 11 19L11 16.4142L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071C7.90237 17.3166 7.90237 16.6834 8.29289 16.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconLinkToWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V15C22 16.6569 20.6569 18 19 18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19C19.5523 16 20 15.5523 20 15V5C20 4.44772 19.5523 4 19 4H14V7C14 7.55228 13.5523 8 13 8H7C6.44772 8 6 7.55228 6 7V4H5C4.44772 4 4 4.44772 4 5V17C4 17.5523 3.55228 18 3 18C2.44772 18 2 17.5523 2 17V5ZM8 4V6H12V4H8ZM17 6C17.5523 6 18 6.44772 18 7V13C18 13.5523 17.5523 14 17 14C16.4477 14 16 13.5523 16 13V7C16 6.44772 16.4477 6 17 6ZM9.29289 12.2929C9.68342 11.9024 10.3166 11.9024 10.7071 12.2929L13.7071 15.2929C14.0976 15.6834 14.0976 16.3166 13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L11 15.4142V18C11 19.1046 11.8954 20 13 20H17C17.5523 20 18 20.4477 18 21C18 21.5523 17.5523 22 17 22H13C10.7909 22 9 20.2091 9 18L9 15.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071C5.90237 16.3166 5.90237 15.6834 6.29289 15.2929L9.29289 12.2929Z",fill:e})})},window.tablerIcons.IconNewBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H16C16.5523 12 17 12.4477 17 13C17 13.5523 16.5523 14 16 14H13V16C13.5523 16 14 16.4477 14 17C14 17.5523 13.5523 18 13 18H12C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13Z",fill:e})})},window.tablerIcons.IconNewClass=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewClass",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.24254 3.02986C9.77833 3.16381 10.1041 3.70674 9.97014 4.24254L9.03078 8H12.9692L14.0299 3.75746C14.1638 3.22167 14.7067 2.89591 15.2425 3.02986C15.7783 3.16381 16.1041 3.70674 15.9701 4.24254L15.0308 8H17C17.5523 8 18 8.44772 18 9C18 9.55228 17.5523 10 17 10H14.5308L11.9701 20.2425C11.8362 20.7783 11.2933 21.1041 10.7575 20.9701C10.2217 20.8362 9.89591 20.2933 10.0299 19.7575L10.9692 16H7.03078L5.97014 20.2425C5.83619 20.7783 5.29326 21.1041 4.75746 20.9701C4.22167 20.8362 3.89591 20.2933 4.02986 19.7575L4.96922 16H3C2.44772 16 2 15.5523 2 15C2 14.4477 2.44772 14 3 14H5.46922L6.46922 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H6.96922L8.02986 3.75746C8.16381 3.22167 8.70674 2.89591 9.24254 3.02986ZM8.53078 10L7.53078 14H11.4692L12.4692 10H8.53078ZM19 13C19.5523 13 20 13.4477 20 14V16H22C22.5523 16 23 16.4477 23 17C23 17.5523 22.5523 18 22 18H20V20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20V18H16C15.4477 18 15 17.5523 15 17C15 16.4477 15.4477 16 16 16H18V14C18 13.4477 18.4477 13 19 13Z",fill:e})})},window.tablerIcons.IconNewObject=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewObject",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5181 2.12378C11.8182 1.95874 12.1818 1.95874 12.4819 2.12378L14.4819 3.22378C14.9658 3.48994 15.1424 4.098 14.8762 4.58192C14.6101 5.06584 14.002 5.24237 13.5181 4.97622L12 4.14127L10.4819 4.97622C9.998 5.24237 9.38994 5.06584 9.12378 4.58192C8.85763 4.098 9.03416 3.48994 9.51808 3.22378L11.5181 2.12378ZM6.87622 5.91811C7.14237 6.40203 6.96584 7.01008 6.48192 7.27624L6.07506 7.50001L6.48191 7.72378C6.96583 7.98993 7.14237 8.59799 6.87622 9.08191C6.61007 9.56583 6.00201 9.74237 5.51809 9.47622L5 9.19128V10C5 10.5523 4.55228 11 4 11C3.44772 11 3 10.5523 3 10V7.50002C3 7.13533 3.19853 6.79956 3.51808 6.62381L5.51808 5.52381C6.002 5.25765 6.61006 5.43419 6.87622 5.91811ZM17.1238 5.91811C17.3899 5.43419 17.998 5.25765 18.4819 5.52381L20.4819 6.62381C20.8015 6.79956 21 7.13533 21 7.50002V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V9.19128L18.4819 9.47622C17.998 9.74237 17.3899 9.56583 17.1238 9.08191C16.8576 8.59799 17.0342 7.98993 17.5181 7.72378L17.9249 7.50001L17.5181 7.27624C17.0342 7.01008 16.8576 6.40203 17.1238 5.91811ZM9.1275 10.3914C9.39735 9.90952 10.0067 9.73765 10.4886 10.0075L12.0044 10.8563L13.5181 10.0238C14.002 9.75765 14.6101 9.93418 14.8762 10.4181C15.1424 10.902 14.9658 11.5101 14.4819 11.7762L13 12.5913V14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5V12.5861L9.51139 11.7525C9.02952 11.4827 8.85765 10.8733 9.1275 10.3914ZM4 13C4.55228 13 5 13.4477 5 14V15.9087L6.48192 16.7238C6.96584 16.9899 7.14237 17.598 6.87622 18.0819C6.61006 18.5658 6.002 18.7424 5.51808 18.4762L3.51808 17.3762C3.19853 17.2005 3 16.8647 3 16.5V14C3 13.4477 3.44772 13 4 13ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13ZM12 17.5C12.5523 17.5 13 17.9477 13 18.5V19.3088L13.5181 19.0238C14.002 18.7577 14.6101 18.9342 14.8762 19.4181C15.1424 19.902 14.9658 20.5101 14.4819 20.7762L12.4819 21.8762C12.1818 22.0413 11.8182 22.0413 11.5181 21.8762L9.51808 20.7762C9.03416 20.5101 8.85763 19.902 9.12378 19.4181C9.38994 18.9342 9.998 18.7577 10.4819 19.0238L11 19.3088V18.5C11 17.9477 11.4477 17.5 12 17.5Z",fill:e})})},window.tablerIcons.IconNewPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V5C18 4.44772 17.5523 4 17 4H7C6.44772 4 6 4.44772 6 5V17C6 17.5523 6.44772 18 7 18H12C12.5523 18 13 18.4477 13 19C13 19.5523 12.5523 20 12 20H7C5.34315 20 4 18.6569 4 17V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7ZM19 15C19.5523 15 20 15.4477 20 16V18H22C22.5523 18 23 18.4477 23 19C23 19.5523 22.5523 20 22 20H20V22C20 22.5523 19.5523 23 19 23C18.4477 23 18 22.5523 18 22V20H16C15.4477 20 15 19.5523 15 19C15 18.4477 15.4477 18 16 18H18V16C18 15.4477 18.4477 15 19 15Z",fill:e})})},window.tablerIcons.IconNewWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H13C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM20 14C20.5523 14 21 14.4477 21 15V17H23C23.5523 17 24 17.4477 24 18C24 18.5523 23.5523 19 23 19H21V21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21V19H17C16.4477 19 16 18.5523 16 18C16 17.4477 16.4477 17 17 17H19V15C19 14.4477 19.4477 14 20 14Z",fill:e})})},window.tablerIcons.IconNewWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4C5.44772 4 5 4.44772 5 5V6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6V5C3 3.34315 4.34315 2 6 2H8C8.55228 2 9 2.44772 9 3C9 3.55228 8.55228 4 8 4H6ZM15 3C15 2.44772 15.4477 2 16 2H18C19.6569 2 21 3.34315 21 5V6C21 6.55228 20.5523 7 20 7C19.4477 7 19 6.55228 19 6V5C19 4.44772 18.5523 4 18 4H16C15.4477 4 15 3.55228 15 3ZM7 9C7 8.44772 7.44772 8 8 8H16C16.5523 8 17 8.44772 17 9V13C17 13.5523 16.5523 14 16 14H8C7.44772 14 7 13.5523 7 13V9ZM9 10V12H15V10H9ZM4 15C4.55228 15 5 15.4477 5 16V17C5 17.5523 5.44772 18 6 18H8C8.55228 18 9 18.4477 9 19C9 19.5523 8.55228 20 8 20H6C4.34315 20 3 18.6569 3 17V16C3 15.4477 3.44772 15 4 15ZM20 15C20.5523 15 21 15.4477 21 16V18H23C23.5523 18 24 18.4477 24 19C24 19.5523 23.5523 20 23 20H21V22C21 22.5523 20.5523 23 20 23C19.4477 23 19 22.5523 19 22V20H17C16.4477 20 16 19.5523 16 19C16 18.4477 16.4477 18 17 18H19V16C19 15.4477 19.4477 15 20 15Z",fill:e})})},window.tablerIcons.IconNumberedChildren=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedChildren",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M12 12H20M12 18H20M4 6L20 6M8 11V13M8 17V19M5 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconNumberedParents=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedParents",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 6H20M14 12H20M14 18H20M10 5V7M10 11V13M7 11V13M10 17V19M7 17V19M4 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconObjectCompact=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectCompact",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V9C21 9.55228 20.5523 10 20 10H18C17.4477 10 17 9.55228 17 9C17 8.44772 17.4477 8 18 8H19V4H5V8H6C6.55228 8 7 8.44772 7 9C7 9.55228 6.55228 10 6 10H4C3.44772 10 3 9.55228 3 9V3ZM11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289L16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071C16.3166 13.0976 15.6834 13.0976 15.2929 12.7071L13 10.4142V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V10.4142L8.70711 12.7071C8.31658 13.0976 7.68342 13.0976 7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L11.2929 7.29289Z",fill:e})})},window.tablerIcons.IconObjectExpanded=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectExpanded",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V3ZM5 4V8H8C8.55228 8 9 8.44772 9 9C9 9.55228 8.55228 10 8 10H5V20H19V10H16C15.4477 10 15 9.55228 15 9C15 8.44772 15.4477 8 16 8H19V4H5ZM12 6C12.5523 6 13 6.44772 13 7V14.5858L15.2929 12.2929C15.6834 11.9024 16.3166 11.9024 16.7071 12.2929C17.0976 12.6834 17.0976 13.3166 16.7071 13.7071L12.7071 17.7071C12.3166 18.0976 11.6834 18.0976 11.2929 17.7071L7.29289 13.7071C6.90237 13.3166 6.90237 12.6834 7.29289 12.2929C7.68342 11.9024 8.31658 11.9024 8.70711 12.2929L11 14.5858V7C11 6.44772 11.4477 6 12 6Z",fill:e})})},window.tablerIcons.IconOpenAsPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtOpenAsPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V18C20 19.6569 18.6569 21 17 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H17C17.5523 19 18 18.5523 18 18V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L14.7071 15.2929C15.0976 15.6834 15.0976 16.3166 14.7071 16.7071C14.3166 17.0976 13.6834 17.0976 13.2929 16.7071L13 16.4142V23C13 23.5523 12.5523 24 12 24C11.4477 24 11 23.5523 11 23L11 16.4142L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C6.44772 4 6 4.44772 6 5V19C6 19.5523 6.44771 20 7 20H17C17.5523 20 18 19.5523 18 19V5C18 4.44772 17.5523 4 17 4H7ZM4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7Z",fill:e})})},window.tablerIcons.IconPageEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 19V10C5 8.89543 5.89543 8 7 8H17C18.1046 8 19 8.89543 19 10V19M9 12H13M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM7 17C6.44772 17 6 17.4477 6 18V23C6 23.5523 5.55228 24 5 24C4.44772 24 4 23.5523 4 23V18C4 16.3431 5.34315 15 7 15H17C18.6569 15 20 16.3431 20 18V23C20 23.5523 19.5523 24 19 24C18.4477 24 18 23.5523 18 23V18C18 17.4477 17.5523 17 17 17H7ZM8 20C8 19.4477 8.44772 19 9 19H13C13.5523 19 14 19.4477 14 20C14 20.5523 13.5523 21 13 21H9C8.44772 21 8 20.5523 8 20Z",fill:e})})},window.tablerIcons.IconPageRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M9 7H13M12 21H7C5.89543 21 5 20.1046 5 19V5C5 3.89543 5.89543 3 7 3H17C18.1046 3 19 3.89543 19 5V14M17 18H16V23H17M21 18H22V23H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM16.5 16C15.6716 16 15 16.6716 15 17.5C15 18.3284 15.6716 19 16.5 19C17.3284 19 18 18.3284 18 17.5C18 16.6716 17.3284 16 16.5 16ZM13 17.5C13 15.567 14.567 14 16.5 14C18.433 14 20 15.567 20 17.5C20 18.1028 19.8476 18.6699 19.5793 19.1651L21.7071 21.2929C22.0976 21.6834 22.0976 22.3166 21.7071 22.7071C21.3166 23.0976 20.6834 23.0976 20.2929 22.7071L18.1651 20.5793C17.6699 20.8476 17.1028 21 16.5 21C14.567 21 13 19.433 13 17.5Z",fill:e})})},window.tablerIcons.IconPasteAsLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPasteAsLink",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{clipPath:"url(#clip0_3328_925)",children:(0,s.jsx)("path",{d:"M9 5H7C6.46957 5 5.96086 5.21071 5.58579 5.58579C5.21071 5.96086 5 6.46957 5 7V19C5 19.5304 5.21071 20.0391 5.58579 20.4142C5.96086 20.7893 6.46957 21 7 21H8M9 5C9 4.46957 9.21071 3.96086 9.58579 3.58579C9.96086 3.21071 10.4696 3 11 3H13C13.5304 3 14.0391 3.21071 14.4142 3.58579C14.7893 3.96086 15 4.46957 15 5M9 5C9 5.53043 9.21071 6.03914 9.58579 6.41421C9.96086 6.78929 10.4696 7 11 7H13C13.5304 7 14.0391 6.78929 14.4142 6.41421C14.7893 6.03914 15 5.53043 15 5M15 5H17C17.5304 5 18.0391 5.21071 18.4142 5.58579C18.7893 5.96086 19 6.46957 19 7V9M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_3328_925",children:(0,s.jsx)("rect",{width:o,height:o,fill:"white"})})})]})},window.tablerIcons.IconPaused=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPaused",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M8.5 6.5H7.5C7.22386 6.5 7 6.72386 7 7V13C7 13.2761 7.22386 13.5 7.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V7C9 6.72386 8.77614 6.5 8.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12.5 6.5H11.5C11.2239 6.5 11 6.72386 11 7V13C11 13.2761 11.2239 13.5 11.5 13.5H12.5C12.7761 13.5 13 13.2761 13 13V7C13 6.72386 12.7761 6.5 12.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconPhotoLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPhotoLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 8H15.01M4 15V17C4 18.6569 5.34315 20 7 20H8M4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V9M4 15L8 11C8.45606 10.5611 8.97339 10.3301 9.5 10.3301C10.0266 10.3301 10.5439 10.5611 11 11L13.5 13.5M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlHigh=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlHigh",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlLow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlLow",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlMedium=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlMedium",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlNone=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlNone",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 12H7M19 12H17M11 12H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlUrgent=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlUrgent",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3H6ZM13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8V12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12V8ZM13 15.99C13 15.4377 12.5523 14.99 12 14.99C11.4477 14.99 11 15.4377 11 15.99V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V15.99Z",fill:e})})},window.tablerIcons.IconQuery=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQuery",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.1429 13.1429L16 16M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21ZM13.7143 10.8571C13.7143 12.4351 12.4351 13.7143 10.8571 13.7143C9.27919 13.7143 8 12.4351 8 10.8571C8 9.27919 9.27919 8 10.8571 8C12.4351 8 13.7143 9.27919 13.7143 10.8571Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconQueryCode=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQueryCode",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M11.1429 11.1429L14 14M13 19H3C1.89543 19 1 18.1046 1 17V3C1 1.89543 1.89543 1 3 1H17C18.1046 1 19 1.89543 19 3V14M18 18H17V23H18M22 18H23V23H22M11.7143 8.85714C11.7143 10.4351 10.4351 11.7143 8.85714 11.7143C7.27919 11.7143 6 10.4351 6 8.85714C6 7.27919 7.27919 6 8.85714 6C10.4351 6 11.7143 7.27919 11.7143 8.85714Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconReferencesHide=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesHide",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 2.29289C11.6834 1.90237 12.3166 1.90237 12.7071 2.29289L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711C14.3166 6.09763 13.6834 6.09763 13.2929 5.70711L12 4.41421L10.7071 5.70711C10.3166 6.09763 9.68342 6.09763 9.29289 5.70711C8.90237 5.31658 8.90237 4.68342 9.29289 4.29289L11.2929 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconReferencesShow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesShow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 2.29289C9.68342 1.90237 10.3166 1.90237 10.7071 2.29289L12 3.58579L13.2929 2.29289C13.6834 1.90237 14.3166 1.90237 14.7071 2.29289C15.0976 2.68342 15.0976 3.31658 14.7071 3.70711L12.7071 5.70711C12.3166 6.09763 11.6834 6.09763 11.2929 5.70711L9.29289 3.70711C8.90237 3.31658 8.90237 2.68342 9.29289 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconResetPassword=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtResetPassword",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C11.2044 4 10.4413 4.31607 9.87868 4.87868C9.31607 5.44129 9 6.20435 9 7V10H15V7C15 6.20435 14.6839 5.44129 14.1213 4.87868C13.5587 4.31607 12.7956 4 12 4ZM16 12C16.5523 12 17 11.5523 17 11V7C17 5.67392 16.4732 4.40215 15.5355 3.46447C14.5979 2.52678 13.3261 2 12 2C10.6739 2 9.40215 2.52678 8.46447 3.46447C7.52678 4.40215 7 5.67392 7 7V10C5.34315 10 4 11.3431 4 13V19C4 20.6569 5.34315 22 7 22H10C10.5523 22 11 21.5523 11 21C11 20.4477 10.5523 20 10 20H7C6.44772 20 6 19.5523 6 19V13C6 12.4477 6.44772 12 7 12H16ZM23 13C23.5523 13 24 13.4477 24 14V18C24 18.5523 23.5523 19 23 19H21.8952C21.8805 19.0003 21.8659 19.0003 21.8514 19H19C18.4477 19 18 18.5523 18 18C18 17.4477 18.4477 17 19 17H20.2363C19.6867 16.3861 18.8879 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22C18.8959 22 19.6991 21.6086 20.2503 20.9841C20.6157 20.57 21.2477 20.5306 21.6617 20.8961C22.0758 21.2616 22.1152 21.8935 21.7497 22.3076C20.835 23.3439 19.4935 24 18 24C15.2386 24 13 21.7614 13 19C13 16.2386 15.2386 14 18 14C19.6364 14 21.0881 14.7857 22 15.9999V14C22 13.4477 22.4477 13 23 13Z",fill:e})})},window.tablerIcons.IconSelectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M3 3H21V21H3V3Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 2H4V4H2V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 2H22V4H20V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 20H22V22H20V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 7H10V10H7V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 7H17V10H14V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 14H10V17H7V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 14H17V17H14V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconSelectCursor=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectCursor",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.29292 4.29289C4.56075 4.02506 4.95692 3.93154 5.31625 4.05132L19.3163 8.71798C19.7 8.84589 19.9688 9.19233 19.9975 9.59578C20.0262 9.99922 19.809 10.3802 19.4472 10.5611L16.6659 11.9518L19.4483 14.7343C19.8389 15.1248 19.8389 15.758 19.4483 16.1485L16.1485 19.4483C15.758 19.8388 15.1248 19.8388 14.7343 19.4483L11.9518 16.6658L10.5611 19.4472C10.3802 19.809 9.99925 20.0262 9.5958 19.9975C9.19236 19.9688 8.84591 19.6999 8.71801 19.3162L4.05134 5.31623C3.93157 4.95689 4.02509 4.56073 4.29292 4.29289ZM6.58117 6.58114L9.85194 16.3934L10.7834 14.5305C10.9272 14.2429 11.2004 14.0421 11.5177 13.9906C11.835 13.9391 12.1577 14.0433 12.385 14.2706L15.4414 17.327L17.327 15.4414L14.2706 12.3849C14.0433 12.1576 13.9391 11.8349 13.9906 11.5177C14.0421 11.2004 14.243 10.9272 14.5305 10.7834L16.3935 9.85191L6.58117 6.58114Z",fill:e})})},window.tablerIcons.IconStackPop=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPop",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7 9.5L4 11L12 15L20 11L17 9.5M4 15L12 19L20 15M12 11V4M12 4L9 7M12 4L15 7",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconStackPull=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPull",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6 10L4 11L12 15L20 11L18 10M4 15L12 19L20 15M12 4V11M12 11L15 8M12 11L9 8",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconText=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtText",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V7C19 7.55228 18.5523 8 18 8C17.4477 8 17 7.55228 17 7V6H13V18H14C14.5523 18 15 18.4477 15 19C15 19.5523 14.5523 20 14 20H10C9.44772 20 9 19.5523 9 19C9 18.4477 9.44772 18 10 18H11V6H7V7C7 7.55228 6.55228 8 6 8C5.44772 8 5 7.55228 5 7V5Z",fill:e})})},window.tablerIcons.IconTodo=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTodo",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"})})},window.tablerIcons.IconTomorrow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTomorrow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M20 15V7C20 5.89543 19.1046 5 18 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H11M20 19L22 21M22 21L20 23M22 21H15M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconUngroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtUngroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3C2 2.44772 2.44772 2 3 2H5C5.55228 2 6 2.44772 6 3H12C12 2.44772 12.4477 2 13 2H15C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6V8H18C18 7.44772 18.4477 7 19 7H21C21.5523 7 22 7.44772 22 8V10C22 10.5523 21.5523 11 21 11V18C21.5523 18 22 18.4477 22 19V21C22 21.5523 21.5523 22 21 22H19C18.4477 22 18 21.5523 18 21H11C11 21.5523 10.5523 22 10 22H8C7.44772 22 7 21.5523 7 21V19C7 18.4477 7.44772 18 8 18V15H6C6 15.5523 5.55228 16 5 16H3C2.44772 16 2 15.5523 2 15V13C2 12.4477 2.44772 12 3 12V6C2.44772 6 2 5.55228 2 5V3ZM5 6V12C5.55228 12 6 12.4477 6 13H12C12 12.4477 12.4477 12 13 12V6C12.4477 6 12 5.55228 12 5H6C6 5.55228 5.55228 6 5 6ZM15 12V10H18C18 10.5523 18.4477 11 19 11V18C18.4477 18 18 18.4477 18 19H11C11 18.4477 10.5523 18 10 18V15H12C12 15.5523 12.4477 16 13 16H15C15.5523 16 16 15.5523 16 15V13C16 12.4477 15.5523 12 15 12Z",fill:e})})},window.tablerIcons.IconVideoEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtVideoEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M10.5 9V15L14.5 12L10.5 9Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1 10C1 6.68629 3.68629 4 7 4H17C20.3137 4 23 6.68629 23 10V14C23 17.3137 20.3137 20 17 20H7C3.68629 20 1 17.3137 1 14V10Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18 9C18 8.44772 17.5523 8 17 8C16.4477 8 16 8.44772 16 9H18ZM16 15C16 15.5523 16.4477 16 17 16C17.5523 16 18 15.5523 18 15H16ZM3 14C2.44772 14 2 14.4477 2 15C2 15.5523 2.44772 16 3 16V14ZM11 15H12C12 14.4477 11.5523 14 11 14V15ZM10 19C10 19.5523 10.4477 20 11 20C11.5523 20 12 19.5523 12 19H10ZM14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5H14ZM13 9V10C13.5523 10 14 9.55228 14 9H13ZM7 9H6C6 9.55228 6.44772 10 7 10V9ZM8 5C8 4.44772 7.55228 4 7 4C6.44772 4 6 4.44772 6 5H8ZM5 6H19V4H5V6ZM20 7V17H22V7H20ZM19 18H5V20H19V18ZM4 17V7H2V17H4ZM5 18C4.44772 18 4 17.5523 4 17H2C2 18.6569 3.34315 20 5 20V18ZM20 17C20 17.5523 19.5523 18 19 18V20C20.6569 20 22 18.6569 22 17H20ZM19 6C19.5523 6 20 6.44772 20 7H22C22 5.34315 20.6569 4 19 4V6ZM5 4C3.34315 4 2 5.34315 2 7H4C4 6.44772 4.44772 6 5 6V4ZM16 9V15H18V9H16ZM3 16H11V14H3V16ZM10 15V19H12V15H10ZM12 5V9H14V5H12ZM13 8H7V10H13V8ZM8 9V5H6V9H8Z",fill:e})})},window.tablerIcons.IconWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5C5.44772 5 5 5.44772 5 6V7C5 7.55228 4.55228 8 4 8C3.44772 8 3 7.55228 3 7V6C3 4.34315 4.34315 3 6 3H8C8.55228 3 9 3.44772 9 4C9 4.55228 8.55228 5 8 5H6ZM15 4C15 3.44772 15.4477 3 16 3H18C19.6569 3 21 4.34315 21 6V7C21 7.55228 20.5523 8 20 8C19.4477 8 19 7.55228 19 7V6C19 5.44772 18.5523 5 18 5H16C15.4477 5 15 4.55228 15 4ZM7 10C7 9.44772 7.44772 9 8 9H16C16.5523 9 17 9.44772 17 10V14C17 14.5523 16.5523 15 16 15H8C7.44772 15 7 14.5523 7 14V10ZM9 11V13H15V11H9ZM4 16C4.55228 16 5 16.4477 5 17V18C5 18.5523 5.44772 19 6 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H6C4.34315 21 3 19.6569 3 18V17C3 16.4477 3.44772 16 4 16ZM20 16C20.5523 16 21 16.4477 21 17V18C21 19.6569 19.6569 21 18 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H18C18.5523 19 19 18.5523 19 18V17C19 16.4477 19.4477 16 20 16Z",fill:e})})},window.tablerIcons.IconWhiteboardFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM2 18C2 16.3431 3.34315 15 5 15H19C20.6569 15 22 16.3431 22 18V23C22 23.5523 21.5523 24 21 24C20.4477 24 20 23.5523 20 23V18C20 17.4477 19.5523 17 19 17H14V20C14 20.5523 13.5523 21 13 21H7C6.44772 21 6 20.5523 6 20V17H5C4.44772 17 4 17.4477 4 18V23C4 23.5523 3.55228 24 3 24C2.44772 24 2 23.5523 2 23V18ZM8 17V19H12V17H8ZM17 19C17.5523 19 18 19.4477 18 20V23C18 23.5523 17.5523 24 17 24C16.4477 24 16 23.5523 16 23V20C16 19.4477 16.4477 19 17 19Z",fill:e})})},window.tablerIcons.IconWhiteboardSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H12C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconXEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtX-embed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 16L11.384 12.616M12.614 11.386L16 8M10.2084 8.10216L15.7083 15.6022C15.8294 15.7673 15.7114 16 15.5067 16H13.9932C13.9135 16 13.8387 15.9621 13.7916 15.8978L8.29174 8.39784C8.17065 8.23271 8.28857 8 8.49334 8H10.0068C10.0865 8 10.1613 8.03794 10.2084 8.10216ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconYesterday=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtYesterday",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M4 15V7C4 5.89543 4.89543 5 6 5H18C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H13M4 19L2 21M2 21L4 23M2 21H9M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconZoomToFit=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtZoomToFit",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M20 4H16H18C18.5304 4 19.0391 4.21071 19.4142 4.58579C19.7893 4.96086 20 5.46957 20 6V8V4ZM20 4L14 10M4 20H8H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V16V20ZM4 20L10 14M4 8V6C4 5.46957 4.21071 4.96086 4.58579 4.58579C4.96086 4.21071 5.46957 4 6 4H8M16 20H18C18.5304 20 19.0391 19.7893 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 18V16",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}})(); \ No newline at end of file +(()=>{function o(o,e,n,r){Object.defineProperty(o,e,{get:n,set:r,enumerable:!0,configurable:!0})}var e=globalThis,n={},r={},t=e.parcelRequiree92c;null==t&&((t=function(o){if(o in n)return n[o].exports;if(o in r){var e=r[o];delete r[o];var t={id:o,exports:{}};return n[o]=t,e.call(t.exports,t,t.exports),t.exports}var i=Error("Cannot find module '"+o+"'");throw i.code="MODULE_NOT_FOUND",i}).register=function(o,e){r[o]=e},e.parcelRequiree92c=t);var i=t.register;i("9Hk4c",function(e,n){o(e.exports,"Fragment",()=>r,o=>r=o),o(e.exports,"jsx",()=>i,o=>i=o),o(e.exports,"jsxs",()=>s,o=>s=o);var r,i,s,l=t("a46g0"),C=Symbol.for("react.element"),c=Symbol.for("react.fragment"),d=Object.prototype.hasOwnProperty,a={current:null},h={key:!0,ref:!0,__self:!0,__source:!0};function w(o,e,n){var r,t={},i=null,s=null;for(r in void 0!==n&&(i=""+n),void 0!==e.key&&(i=""+e.key),void 0!==e.ref&&(s=e.ref),e)d.call(e,r)&&!h.hasOwnProperty(r)&&(t[r]=e[r]);if(o&&o.defaultProps)for(r in e=o.defaultProps)void 0===t[r]&&(t[r]=e[r]);return{$$typeof:C,type:o,key:i,ref:s,props:t,_owner:a.current}}r=c,i=w,s=w}),i("a46g0",function(o,e){o.exports=React});var s=ReactJSXRuntime;t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),t("a46g0"),window.tablerIcons=window.tablerIcons||{},window.tablerIcons.IconAddLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAddLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.2933 4.29278C13.1438 3.4422 14.2975 2.96436 15.5004 2.96436C16.7033 2.96436 17.8569 3.4422 18.7075 4.29278C19.5581 5.14336 20.0359 6.29699 20.0359 7.49989C20.0359 8.70279 19.5581 9.85642 18.7075 10.707L14.7109 14.7036C14.2927 15.1294 13.7939 15.4678 13.2436 15.699C12.6917 15.9309 12.099 16.0504 11.5004 16.0504C10.9017 16.0504 10.309 15.9309 9.7571 15.699C9.20517 15.4671 8.70507 15.1274 8.28608 14.6997C7.89956 14.3053 7.90602 13.6721 8.30051 13.2856C8.695 12.8991 9.32813 12.9055 9.71465 13.3C9.94742 13.5376 10.2253 13.7263 10.5319 13.8552C10.8385 13.984 11.1678 14.0504 11.5004 14.0504C11.833 14.0504 12.1622 13.984 12.4688 13.8552C12.7755 13.7263 13.0533 13.5376 13.2861 13.3L13.2932 13.2927L13.2933 13.2928L17.2933 9.29278C17.7688 8.81728 18.0359 8.17235 18.0359 7.49989C18.0359 6.82742 17.7688 6.1825 17.2933 5.707C16.8178 5.23149 16.1728 4.96436 15.5004 4.96436C14.8279 4.96436 14.183 5.23149 13.7075 5.707L13.2075 6.207C12.8169 6.59752 12.1838 6.59752 11.7933 6.207C11.4027 5.81647 11.4027 5.18331 11.7933 4.79278L12.2933 4.29278ZM8.75711 8.30085C9.30904 8.06892 9.9017 7.94946 10.5004 7.94946C11.0991 7.94946 11.6917 8.06892 12.2436 8.30085C12.7956 8.53277 13.2957 8.87249 13.7147 9.30012C14.1012 9.69461 14.0947 10.3277 13.7002 10.7143C13.3057 11.1008 12.6726 11.0943 12.2861 10.6998C12.0533 10.4623 11.7755 10.2735 11.4689 10.1447C11.1622 10.0158 10.833 9.94946 10.5004 9.94946C10.1678 9.94946 9.83853 10.0158 9.5319 10.1447C9.22527 10.2735 8.94743 10.4623 8.71466 10.6998L8.70752 10.7071L8.70748 10.7071L4.70748 14.7071C4.23198 15.1826 3.96484 15.8275 3.96484 16.5C3.96484 17.1724 4.23198 17.8174 4.70748 18.2929C5.18299 18.7684 5.82791 19.0355 6.50038 19.0355C7.17284 19.0355 7.81777 18.7684 8.29327 18.2929L8.79327 17.7929C9.18379 17.4023 9.81696 17.4023 10.2075 17.7929C10.598 18.1834 10.598 18.8166 10.2075 19.2071L9.70748 19.7071C8.85691 20.5577 7.70328 21.0355 6.50038 21.0355C5.29748 21.0355 4.14385 20.5577 3.29327 19.7071C2.44269 18.8565 1.96484 17.7029 1.96484 16.5C1.96484 15.2971 2.44269 14.1434 3.29327 13.2929L7.28985 9.29629C7.70807 8.87046 8.20683 8.53208 8.75711 8.30085ZM19.0005 14C19.5528 14 20.0005 14.4477 20.0005 15V17H22.0005C22.5528 17 23.0005 17.4477 23.0005 18C23.0005 18.5523 22.5528 19 22.0005 19H20.0005V21C20.0005 21.5523 19.5528 22 19.0005 22C18.4482 22 18.0005 21.5523 18.0005 21V19H16.0005C15.4482 19 15.0005 18.5523 15.0005 18C15.0005 17.4477 15.4482 17 16.0005 17H18.0005V15C18.0005 14.4477 18.4482 14 19.0005 14Z",fill:e})})},window.tablerIcons.IconAppFeature=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtAppFeature",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 7C2 5.34315 3.34315 4 5 4H19C20.6569 4 22 5.34315 22 7V17C22 18.6569 20.6569 20 19 20H15.0209C15.0064 20.0003 14.992 20.0003 14.9776 20H9.02243C9.00802 20.0003 8.99357 20.0003 8.97908 20H5C3.34315 20 2 18.6569 2 17V7ZM13.7192 18L13.5299 17.2425C13.4447 16.9018 13.5445 16.5413 13.7929 16.2929L14.8787 15.2071L13.3586 14.9899C13.0337 14.9435 12.7523 14.7407 12.6056 14.4472L12 13.2361L11.3944 14.4472C11.2477 14.7407 10.9663 14.9435 10.6414 14.9899L9.12132 15.2071L10.2071 16.2929C10.4555 16.5413 10.5553 16.9018 10.4701 17.2425L10.2808 18H13.7192ZM15.7808 18H19C19.5523 18 20 17.5523 20 17V7C20 6.44772 19.5523 6 19 6H5C4.44772 6 4 6.44772 4 7V17C4 17.5523 4.44772 18 5 18H8.21922L8.39254 17.3067L6.29289 15.2071C6.02506 14.9393 5.93154 14.5431 6.05132 14.1838C6.17109 13.8244 6.48361 13.5636 6.85858 13.5101L9.83989 13.0841L11.1056 10.5528C11.275 10.214 11.6212 10 12 10C12.3788 10 12.725 10.214 12.8944 10.5528L14.1601 13.0841L17.1414 13.5101C17.5164 13.5636 17.8289 13.8244 17.9487 14.1838C18.0685 14.5431 17.9749 14.9393 17.7071 15.2071L15.6075 17.3067L15.7808 18Z",fill:e}),(0,s.jsx)("path",{d:"M6 6.99C6.55228 6.99 7 7.43771 7 7.99V8C7 8.55229 6.55228 9 6 9C5.44772 9 5 8.55229 5 8V7.99C5 7.43771 5.44772 6.99 6 6.99Z",fill:e}),(0,s.jsx)("path",{d:"M9 6.99C9.55228 6.99 10 7.43771 10 7.99V8C10 8.55228 9.55228 9 9 9C8.44772 9 8 8.55228 8 8V7.99C8 7.43771 8.44772 6.99 9 6.99Z",fill:e})]})},window.tablerIcons.IconBacklog=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBacklog",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2",strokeDasharray:"4 4"})})},window.tablerIcons.IconBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 10C9 9.44772 9.44772 9 10 9H22C22.5523 9 23 9.44772 23 10V14C23 14.5523 22.5523 15 22 15H10C9.44772 15 9 14.5523 9 14V10ZM11 11V13H21V11H11ZM1 12C1 10.8954 1.89543 10 3 10C4.10457 10 5 10.8954 5 12C5 13.1046 4.10457 14 3 14C1.89543 14 1 13.1046 1 12Z",fill:e})})},window.tablerIcons.IconBlockEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M22 10H13V14H22M7 12C7 12.5523 6.55228 13 6 13C5.44772 13 5 12.5523 5 12C5 11.4477 5.44772 11 6 11C6.55228 11 7 11.4477 7 12ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM11 17V19H21V17H11ZM9 16C9 15.4477 9.44772 15 10 15H22C22.5523 15 23 15.4477 23 16V20C23 20.5523 22.5523 21 22 21H10C9.44772 21 9 20.5523 9 20V16ZM1 18C1 16.8954 1.89543 16 3 16C4.10457 16 5 16.8954 5 18C5 19.1046 4.10457 20 3 20C1.89543 20 1 19.1046 1 18Z",fill:e})})},window.tablerIcons.IconBlockRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 14H10V10H22V12M18 16C17.3581 17.6049 17.3581 19.3951 18 21M22 16C22.6419 17.6049 22.6419 19.3951 22 21M4 12C4 12.5523 3.55228 13 3 13C2.44772 13 2 12.5523 2 12C2 11.4477 2.44772 11 3 11C3.55228 11 4 11.4477 4 12Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconBlockSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtBlockSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H14C14.5523 12 15 12.4477 15 13C15 13.5523 14.5523 14 14 14H13V17C13 17.5523 12.5523 18 12 18C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconCalendarDots=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCalendarDots",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 4H6C4.89543 4 4 4.89543 4 6V10M8 4H16M8 4V2M8 4V6M16 4H18C19.1046 4 20 4.89543 20 6V10M16 4V2M16 4V6M4 10H20M4 10V14M20 10V14M6 20C6 20.5523 5.55228 21 5 21C4.44772 21 4 20.5523 4 20C4 19.4477 4.44772 19 5 19C5.55228 19 6 19.4477 6 20ZM13 20C13 20.5523 12.5523 21 12 21C11.4477 21 11 20.5523 11 20C11 19.4477 11.4477 19 12 19C12.5523 19 13 19.4477 13 20ZM20 20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20C18 19.4477 18.4477 19 19 19C19.5523 19 20 19.4477 20 20Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconCancelled=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCancelled",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M13 7L7 13M7 7L13 13",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconCloudExclamation=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtCloudExclamation",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M13.4366 6.03387C12.8308 5.92373 12.2062 5.92205 11.5997 6.02894C10.9931 6.13582 10.4204 6.34848 9.91384 6.65116C8.89016 7.26279 8.20994 8.19494 7.98007 9.21902C7.87759 9.67556 7.47225 10 7.00435 10C6.00786 10 5.06063 10.3791 4.36896 11.0407C3.6788 11.7008 3.2998 12.5864 3.2998 13.5C3.2998 14.4136 3.6788 15.2992 4.36896 15.9593C5.06063 16.6209 6.00786 17 7.00435 17H8C8.55228 17 9 17.4477 9 18C9 18.5523 8.55228 19 8 19H7.00435C5.5054 19 4.05939 18.4308 2.98651 17.4046C1.91213 16.3769 1.2998 14.9734 1.2998 13.5C1.2998 12.0266 1.91213 10.6231 2.98651 9.59538C3.87696 8.74365 5.02444 8.20677 6.24589 8.04882C6.72397 6.76252 7.65926 5.66843 8.88803 4.93427C9.60923 4.50337 10.4128 4.20727 11.2526 4.05929C12.0923 3.91131 12.9556 3.91362 13.7943 4.06613C14.6332 4.21864 15.4349 4.5191 16.1534 4.95398C16.8721 5.38893 17.4955 5.95128 17.9839 6.61332C18.4724 7.27568 18.8155 8.02416 18.988 8.817C19.0731 9.20796 19.1156 9.60469 19.1155 10.0014C20.2687 10.0298 21.3686 10.5003 22.1863 11.318C23.0302 12.1619 23.5044 13.3065 23.5044 14.5C23.5044 15.6935 23.0302 16.8381 22.1863 17.682C21.3424 18.5259 20.1978 19 19.0044 19H16C15.4477 19 15 18.5523 15 18C15 17.4477 15.4477 17 16 17H19.0044C19.6674 17 20.3033 16.7366 20.7721 16.2678C21.241 15.7989 21.5044 15.163 21.5044 14.5C21.5044 13.837 21.241 13.2011 20.7721 12.7322C20.3033 12.2634 19.6674 12 19.0044 12H18.0044C17.7007 12 17.4134 11.862 17.2236 11.6249C17.0339 11.3878 16.9621 11.0773 17.0286 10.781C17.1427 10.273 17.1444 9.75071 17.0337 9.24219C16.9231 8.7334 16.7009 8.24319 16.3744 7.80054C16.0476 7.35756 15.6221 6.9702 15.1178 6.66498C14.6134 6.35969 14.0423 6.144 13.4366 6.03387ZM12 14C12.5523 14 13 14.4477 13 15V18C13 18.5523 12.5523 19 12 19C11.4477 19 11 18.5523 11 18V15C11 14.4477 11.4477 14 12 14ZM12 21C12.5523 21 13 21.4477 13 22V22.01C13 22.5623 12.5523 23.01 12 23.01C11.4477 23.01 11 22.5623 11 22.01V22C11 21.4477 11.4477 21 12 21Z",fill:e})})},window.tablerIcons.IconConnector=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtConnector",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11 5C11 4.44772 11.4477 4 12 4H19C19.5523 4 20 4.44772 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V7.41421L5.70711 19.7071C5.31658 20.0976 4.68342 20.0976 4.29289 19.7071C3.90237 19.3166 3.90237 18.6834 4.29289 18.2929L16.5858 6H12C11.4477 6 11 5.55228 11 5Z",fill:e})})},window.tablerIcons.IconDeselectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDeselectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 9L12 12M12 12L9 15M12 12L9 9M12 12L15 15M3 3H21V21H3V3ZM2 2H4V4H2V2ZM20 2H22V4H20V2ZM20 20H22V22H20V20ZM2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconDone=function({size:o=24,color:e="currentColor",color2:n="white",stroke:r=0,...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:r,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtDone",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M6.5 10L9 12.5L14 7.5",stroke:n,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconGroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtGroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 2C1 1.44772 1.44772 1 2 1H4C4.55228 1 5 1.44772 5 2H19C19 1.44772 19.4477 1 20 1H22C22.5523 1 23 1.44772 23 2V4C23 4.55228 22.5523 5 22 5V19C22.5523 19 23 19.4477 23 20V22C23 22.5523 22.5523 23 22 23H20C19.4477 23 19 22.5523 19 22H5C5 22.5523 4.55228 23 4 23H2C1.44772 23 1 22.5523 1 22V20C1 19.4477 1.44772 19 2 19V5C1.44772 5 1 4.55228 1 4V2ZM4 5V19C4.55228 19 5 19.4477 5 20H19C19 19.4477 19.4477 19 20 19V5C19.4477 5 19 4.55228 19 4H5C5 4.55228 4.55228 5 4 5ZM6 7C6 6.44772 6.44772 6 7 6H13C13.5523 6 14 6.44772 14 7V9H17C17.5523 9 18 9.44772 18 10V17C18 17.5523 17.5523 18 17 18H10C9.44772 18 9 17.5523 9 17V14H7C6.44772 14 6 13.5523 6 13V7ZM11 14V16H16V11H14V13C14 13.5523 13.5523 14 13 14H11ZM12 8H8V12H12V8Z",fill:e})})},window.tablerIcons.IconHAuto=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtH-auto",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 6C2 5.44772 2.44772 5 3 5H5C5.55228 5 6 5.44772 6 6C6 6.55228 5.55228 7 5 7V11H11V7C10.4477 7 10 6.55228 10 6C10 5.44772 10.4477 5 11 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7V17C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H11C10.4477 19 10 18.5523 10 18C10 17.4477 10.4477 17 11 17V13H5V17C5.55228 17 6 17.4477 6 18C6 18.5523 5.55228 19 5 19H3C2.44772 19 2 18.5523 2 18C2 17.4477 2.44772 17 3 17V7C2.44772 7 2 6.55228 2 6ZM19 11C18.7348 11 18.4804 11.1054 18.2929 11.2929C18.1054 11.4804 18 11.7348 18 12V14H20V12C20 11.7348 19.8946 11.4804 19.7071 11.2929C19.5196 11.1054 19.2652 11 19 11ZM22 12C22 11.2043 21.6839 10.4413 21.1213 9.87868C20.5587 9.31607 19.7957 9 19 9C18.2043 9 17.4413 9.31607 16.8787 9.87868C16.3161 10.4413 16 11.2043 16 12V18C16 18.5523 16.4477 19 17 19C17.5523 19 18 18.5523 18 18V16H20V18C20 18.5523 20.4477 19 21 19C21.5523 19 22 18.5523 22 18V12Z",fill:e})})},window.tablerIcons.IconHeadingOff=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHeadingOff",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.29289 2.29289C2.68342 1.90237 3.31658 1.90237 3.70711 2.29289L21.7071 20.2929C22.0976 20.6834 22.0976 21.3166 21.7071 21.7071C21.3166 22.0976 20.6834 22.0976 20.2929 21.7071L18.5858 20H15C14.4477 20 14 19.5523 14 19C14 18.4477 14.4477 18 15 18H16V17.4142L11.5858 13H8V18H9C9.55228 18 10 18.4477 10 19C10 19.5523 9.55228 20 9 20H5C4.44772 20 4 19.5523 4 19C4 18.4477 4.44772 18 5 18H6V7.41421L2.29289 3.70711C1.90237 3.31658 1.90237 2.68342 2.29289 2.29289ZM8 9.41421V11H9.58579L8 9.41421ZM8 5C8 4.44772 8.44772 4 9 4H10C10.5523 4 11 4.44772 11 5C11 5.55228 10.5523 6 10 6H9C8.44772 6 8 5.55228 8 5ZM14 5C14 4.44772 14.4477 4 15 4H19C19.5523 4 20 4.44772 20 5C20 5.55228 19.5523 6 19 6H18V12C18 12.5523 17.5523 13 17 13C16.4477 13 16 12.5523 16 12V6H15C14.4477 6 14 5.55228 14 5Z",fill:e})})},window.tablerIcons.IconHtmlEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtHtmlEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.22222 10L5 12L7.22222 14M16.7778 10L19 12L16.7778 14M13.1111 8L10.8889 16M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconInProgress25=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress25",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M15 10C15 9.34339 14.8707 8.69321 14.6194 8.08658C14.3681 7.47995 13.9998 6.92876 13.5355 6.46447C13.0712 6.00017 12.52 5.63188 11.9134 5.3806C11.3068 5.12933 10.6566 5 10 5V10H15Z",fill:e})]})},window.tablerIcons.IconInProgress50=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress50",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M10 15C11.3261 15 12.5979 14.4732 13.5355 13.5355C14.4732 12.5979 15 11.3261 15 10C15 8.67392 14.4732 7.40215 13.5355 6.46447C12.5979 5.52678 11.3261 5 10 5L10 10V15Z",fill:e})]})},window.tablerIcons.IconInProgress75=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInProgress75",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M5 10C5 10.9889 5.29324 11.9556 5.84265 12.7779C6.39206 13.6001 7.17295 14.241 8.08658 14.6194C9.00021 14.9978 10.0055 15.0969 10.9755 14.9039C11.9454 14.711 12.8363 14.2348 13.5355 13.5355C14.2348 12.8363 14.711 11.9454 14.9039 10.9755C15.0969 10.0055 14.9978 9.00021 14.6194 8.08658C14.241 7.17295 13.6001 6.39206 12.7779 5.84265C11.9556 5.29325 10.9889 5 10 5L10 10L5 10Z",fill:e})]})},window.tablerIcons.IconInReview=function({size:o=24,color:e="currentColor",stroke:n=0,color2:r="white",...t}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInReview",...t,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"9",fill:e}),(0,s.jsx)("path",{d:"M14 9.5V11C14 11.3978 13.842 11.7794 13.5607 12.0607C13.2794 12.342 12.8978 12.5 12.5 12.5H8L6 14.5V8C6 7.60218 6.15804 7.22064 6.43934 6.93934C6.72064 6.65804 7.10218 6.5 7.5 6.5H11M12.5 6H14.5M14.5 6V8M14.5 6L12 8.5",stroke:r,strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconInternalLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtInternalLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H18C19.6569 3 21 4.34315 21 6V17C21 18.6569 19.6569 20 18 20H11C10.4477 20 10 19.5523 10 19C10 18.4477 10.4477 18 11 18H18C18.5523 18 19 17.5523 19 17V6C19 5.44772 18.5523 5 18 5H7C6.44772 5 6 5.44772 6 6V13C6 13.5523 5.55228 14 5 14C4.44772 14 4 13.5523 4 13V6ZM8 10C8 9.44772 8.44772 9 9 9H14C14.5523 9 15 9.44772 15 10V15C15 15.5523 14.5523 16 14 16C13.4477 16 13 15.5523 13 15V12.4142L4.70711 20.7071C4.31658 21.0976 3.68342 21.0976 3.29289 20.7071C2.90237 20.3166 2.90237 19.6834 3.29289 19.2929L11.5858 11H9C8.44772 11 8 10.5523 8 10Z",fill:e})})},window.tablerIcons.IconLinkToBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9 8C9 7.44772 9.44772 7 10 7H22C22.5523 7 23 7.44772 23 8V12C23 12.5523 22.5523 13 22 13C21.4477 13 21 12.5523 21 12V9H11V12C11 12.5523 10.5523 13 10 13C9.44772 13 9 12.5523 9 12V8ZM1 10C1 8.89543 1.89543 8 3 8C4.10457 8 5 8.89543 5 10C5 11.1046 4.10457 12 3 12C1.89543 12 1 11.1046 1 10ZM15.2929 11.2929C15.6834 10.9024 16.3166 10.9024 16.7071 11.2929L19.7071 14.2929C20.0976 14.6834 20.0976 15.3166 19.7071 15.7071C19.3166 16.0976 18.6834 16.0976 18.2929 15.7071L17 14.4142V17C17 18.1046 17.8954 19 19 19H23C23.5523 19 24 19.4477 24 20C24 20.5523 23.5523 21 23 21H19C16.7909 21 15 19.2091 15 17V14.4142L13.7071 15.7071C13.3166 16.0976 12.6834 16.0976 12.2929 15.7071C11.9024 15.3166 11.9024 14.6834 12.2929 14.2929L15.2929 11.2929Z",fill:e})})},window.tablerIcons.IconLinkToPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 4C4 2.34315 5.34315 1 7 1H17C18.6569 1 20 2.34315 20 4V18C20 18.5523 19.5523 19 19 19C18.4477 19 18 18.5523 18 18V4C18 3.44772 17.5523 3 17 3H7C6.44772 3 6 3.44772 6 4V18C6 18.5523 5.55228 19 5 19C4.44772 19 4 18.5523 4 18V4ZM8 6C8 5.44772 8.44772 5 9 5H13C13.5523 5 14 5.44772 14 6C14 6.55228 13.5523 7 13 7H9C8.44772 7 8 6.55228 8 6ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L15.7071 16.2929C16.0976 16.6834 16.0976 17.3166 15.7071 17.7071C15.3166 18.0976 14.6834 18.0976 14.2929 17.7071L13 16.4142V19C13 20.1046 13.8954 21 15 21H19C19.5523 21 20 21.4477 20 22C20 22.5523 19.5523 23 19 23H15C12.7909 23 11 21.2091 11 19L11 16.4142L9.70711 17.7071C9.31658 18.0976 8.68342 18.0976 8.29289 17.7071C7.90237 17.3166 7.90237 16.6834 8.29289 16.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconLinkToWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtLinkToWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 5C2 3.34315 3.34315 2 5 2H19C20.6569 2 22 3.34315 22 5V15C22 16.6569 20.6569 18 19 18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19C19.5523 16 20 15.5523 20 15V5C20 4.44772 19.5523 4 19 4H14V7C14 7.55228 13.5523 8 13 8H7C6.44772 8 6 7.55228 6 7V4H5C4.44772 4 4 4.44772 4 5V17C4 17.5523 3.55228 18 3 18C2.44772 18 2 17.5523 2 17V5ZM8 4V6H12V4H8ZM17 6C17.5523 6 18 6.44772 18 7V13C18 13.5523 17.5523 14 17 14C16.4477 14 16 13.5523 16 13V7C16 6.44772 16.4477 6 17 6ZM9.29289 12.2929C9.68342 11.9024 10.3166 11.9024 10.7071 12.2929L13.7071 15.2929C14.0976 15.6834 14.0976 16.3166 13.7071 16.7071C13.3166 17.0976 12.6834 17.0976 12.2929 16.7071L11 15.4142V18C11 19.1046 11.8954 20 13 20H17C17.5523 20 18 20.4477 18 21C18 21.5523 17.5523 22 17 22H13C10.7909 22 9 20.2091 9 18L9 15.4142L7.70711 16.7071C7.31658 17.0976 6.68342 17.0976 6.29289 16.7071C5.90237 16.3166 5.90237 15.6834 6.29289 15.2929L9.29289 12.2929Z",fill:e})})},window.tablerIcons.IconNewBlock=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewBlock",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8 5C8 4.44772 8.44772 4 9 4H20C20.5523 4 21 4.44772 21 5V9C21 9.55228 20.5523 10 20 10H9C8.44772 10 8 9.55228 8 9V5ZM10 6V8H19V6H10ZM0 7C0 5.89543 0.89543 5 2 5C3.10457 5 4 5.89543 4 7C4 8.10457 3.10457 9 2 9C0.89543 9 0 8.10457 0 7ZM11 13C11 12.4477 11.4477 12 12 12H16C16.5523 12 17 12.4477 17 13C17 13.5523 16.5523 14 16 14H13V16C13.5523 16 14 16.4477 14 17C14 17.5523 13.5523 18 13 18H12C11.4477 18 11 17.5523 11 17V13ZM3 15C3 13.8954 3.89543 13 5 13C6.10457 13 7 13.8954 7 15C7 16.1046 6.10457 17 5 17C3.89543 17 3 16.1046 3 15ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13Z",fill:e})})},window.tablerIcons.IconNewClass=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewClass",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.24254 3.02986C9.77833 3.16381 10.1041 3.70674 9.97014 4.24254L9.03078 8H12.9692L14.0299 3.75746C14.1638 3.22167 14.7067 2.89591 15.2425 3.02986C15.7783 3.16381 16.1041 3.70674 15.9701 4.24254L15.0308 8H17C17.5523 8 18 8.44772 18 9C18 9.55228 17.5523 10 17 10H14.5308L11.9701 20.2425C11.8362 20.7783 11.2933 21.1041 10.7575 20.9701C10.2217 20.8362 9.89591 20.2933 10.0299 19.7575L10.9692 16H7.03078L5.97014 20.2425C5.83619 20.7783 5.29326 21.1041 4.75746 20.9701C4.22167 20.8362 3.89591 20.2933 4.02986 19.7575L4.96922 16H3C2.44772 16 2 15.5523 2 15C2 14.4477 2.44772 14 3 14H5.46922L6.46922 10H3C2.44772 10 2 9.55228 2 9C2 8.44772 2.44772 8 3 8H6.96922L8.02986 3.75746C8.16381 3.22167 8.70674 2.89591 9.24254 3.02986ZM8.53078 10L7.53078 14H11.4692L12.4692 10H8.53078ZM19 13C19.5523 13 20 13.4477 20 14V16H22C22.5523 16 23 16.4477 23 17C23 17.5523 22.5523 18 22 18H20V20C20 20.5523 19.5523 21 19 21C18.4477 21 18 20.5523 18 20V18H16C15.4477 18 15 17.5523 15 17C15 16.4477 15.4477 16 16 16H18V14C18 13.4477 18.4477 13 19 13Z",fill:e})})},window.tablerIcons.IconNewObject=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewObject",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5181 2.12378C11.8182 1.95874 12.1818 1.95874 12.4819 2.12378L14.4819 3.22378C14.9658 3.48994 15.1424 4.098 14.8762 4.58192C14.6101 5.06584 14.002 5.24237 13.5181 4.97622L12 4.14127L10.4819 4.97622C9.998 5.24237 9.38994 5.06584 9.12378 4.58192C8.85763 4.098 9.03416 3.48994 9.51808 3.22378L11.5181 2.12378ZM6.87622 5.91811C7.14237 6.40203 6.96584 7.01008 6.48192 7.27624L6.07506 7.50001L6.48191 7.72378C6.96583 7.98993 7.14237 8.59799 6.87622 9.08191C6.61007 9.56583 6.00201 9.74237 5.51809 9.47622L5 9.19128V10C5 10.5523 4.55228 11 4 11C3.44772 11 3 10.5523 3 10V7.50002C3 7.13533 3.19853 6.79956 3.51808 6.62381L5.51808 5.52381C6.002 5.25765 6.61006 5.43419 6.87622 5.91811ZM17.1238 5.91811C17.3899 5.43419 17.998 5.25765 18.4819 5.52381L20.4819 6.62381C20.8015 6.79956 21 7.13533 21 7.50002V10C21 10.5523 20.5523 11 20 11C19.4477 11 19 10.5523 19 10V9.19128L18.4819 9.47622C17.998 9.74237 17.3899 9.56583 17.1238 9.08191C16.8576 8.59799 17.0342 7.98993 17.5181 7.72378L17.9249 7.50001L17.5181 7.27624C17.0342 7.01008 16.8576 6.40203 17.1238 5.91811ZM9.1275 10.3914C9.39735 9.90952 10.0067 9.73765 10.4886 10.0075L12.0044 10.8563L13.5181 10.0238C14.002 9.75765 14.6101 9.93418 14.8762 10.4181C15.1424 10.902 14.9658 11.5101 14.4819 11.7762L13 12.5913V14.5C13 15.0523 12.5523 15.5 12 15.5C11.4477 15.5 11 15.0523 11 14.5V12.5861L9.51139 11.7525C9.02952 11.4827 8.85765 10.8733 9.1275 10.3914ZM4 13C4.55228 13 5 13.4477 5 14V15.9087L6.48192 16.7238C6.96584 16.9899 7.14237 17.598 6.87622 18.0819C6.61006 18.5658 6.002 18.7424 5.51808 18.4762L3.51808 17.3762C3.19853 17.2005 3 16.8647 3 16.5V14C3 13.4477 3.44772 13 4 13ZM20 13C20.5523 13 21 13.4477 21 14V16H23C23.5523 16 24 16.4477 24 17C24 17.5523 23.5523 18 23 18H21V20C21 20.5523 20.5523 21 20 21C19.4477 21 19 20.5523 19 20V18H17C16.4477 18 16 17.5523 16 17C16 16.4477 16.4477 16 17 16H19V14C19 13.4477 19.4477 13 20 13ZM12 17.5C12.5523 17.5 13 17.9477 13 18.5V19.3088L13.5181 19.0238C14.002 18.7577 14.6101 18.9342 14.8762 19.4181C15.1424 19.902 14.9658 20.5101 14.4819 20.7762L12.4819 21.8762C12.1818 22.0413 11.8182 22.0413 11.5181 21.8762L9.51808 20.7762C9.03416 20.5101 8.85763 19.902 9.12378 19.4181C9.38994 18.9342 9.998 18.7577 10.4819 19.0238L11 19.3088V18.5C11 17.9477 11.4477 17.5 12 17.5Z",fill:e})})},window.tablerIcons.IconNewPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V12C20 12.5523 19.5523 13 19 13C18.4477 13 18 12.5523 18 12V5C18 4.44772 17.5523 4 17 4H7C6.44772 4 6 4.44772 6 5V17C6 17.5523 6.44772 18 7 18H12C12.5523 18 13 18.4477 13 19C13 19.5523 12.5523 20 12 20H7C5.34315 20 4 18.6569 4 17V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7ZM19 15C19.5523 15 20 15.4477 20 16V18H22C22.5523 18 23 18.4477 23 19C23 19.5523 22.5523 20 22 20H20V22C20 22.5523 19.5523 23 19 23C18.4477 23 18 22.5523 18 22V20H16C15.4477 20 15 19.5523 15 19C15 18.4477 15.4477 18 16 18H18V16C18 15.4477 18.4477 15 19 15Z",fill:e})})},window.tablerIcons.IconNewWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H13C13.5523 17 14 17.4477 14 18C14 18.5523 13.5523 19 13 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM20 14C20.5523 14 21 14.4477 21 15V17H23C23.5523 17 24 17.4477 24 18C24 18.5523 23.5523 19 23 19H21V21C21 21.5523 20.5523 22 20 22C19.4477 22 19 21.5523 19 21V19H17C16.4477 19 16 18.5523 16 18C16 17.4477 16.4477 17 17 17H19V15C19 14.4477 19.4477 14 20 14Z",fill:e})})},window.tablerIcons.IconNewWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNewWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 4C5.44772 4 5 4.44772 5 5V6C5 6.55228 4.55228 7 4 7C3.44772 7 3 6.55228 3 6V5C3 3.34315 4.34315 2 6 2H8C8.55228 2 9 2.44772 9 3C9 3.55228 8.55228 4 8 4H6ZM15 3C15 2.44772 15.4477 2 16 2H18C19.6569 2 21 3.34315 21 5V6C21 6.55228 20.5523 7 20 7C19.4477 7 19 6.55228 19 6V5C19 4.44772 18.5523 4 18 4H16C15.4477 4 15 3.55228 15 3ZM7 9C7 8.44772 7.44772 8 8 8H16C16.5523 8 17 8.44772 17 9V13C17 13.5523 16.5523 14 16 14H8C7.44772 14 7 13.5523 7 13V9ZM9 10V12H15V10H9ZM4 15C4.55228 15 5 15.4477 5 16V17C5 17.5523 5.44772 18 6 18H8C8.55228 18 9 18.4477 9 19C9 19.5523 8.55228 20 8 20H6C4.34315 20 3 18.6569 3 17V16C3 15.4477 3.44772 15 4 15ZM20 15C20.5523 15 21 15.4477 21 16V18H23C23.5523 18 24 18.4477 24 19C24 19.5523 23.5523 20 23 20H21V22C21 22.5523 20.5523 23 20 23C19.4477 23 19 22.5523 19 22V20H17C16.4477 20 16 19.5523 16 19C16 18.4477 16.4477 18 17 18H19V16C19 15.4477 19.4477 15 20 15Z",fill:e})})},window.tablerIcons.IconNumberedChildren=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedChildren",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M12 12H20M12 18H20M4 6L20 6M8 11V13M8 17V19M5 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconNumberedParents=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtNumberedParents",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M14 6H20M14 12H20M14 18H20M10 5V7M10 11V13M7 11V13M10 17V19M7 17V19M4 17V19",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconObjectCompact=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectCompact",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V9C21 9.55228 20.5523 10 20 10H18C17.4477 10 17 9.55228 17 9C17 8.44772 17.4477 8 18 8H19V4H5V8H6C6.55228 8 7 8.44772 7 9C7 9.55228 6.55228 10 6 10H4C3.44772 10 3 9.55228 3 9V3ZM11.2929 7.29289C11.6834 6.90237 12.3166 6.90237 12.7071 7.29289L16.7071 11.2929C17.0976 11.6834 17.0976 12.3166 16.7071 12.7071C16.3166 13.0976 15.6834 13.0976 15.2929 12.7071L13 10.4142V19C13 19.5523 12.5523 20 12 20C11.4477 20 11 19.5523 11 19V10.4142L8.70711 12.7071C8.31658 13.0976 7.68342 13.0976 7.29289 12.7071C6.90237 12.3166 6.90237 11.6834 7.29289 11.2929L11.2929 7.29289Z",fill:e})})},window.tablerIcons.IconObjectExpanded=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtObjectExpanded",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 3C3 2.44772 3.44772 2 4 2H20C20.5523 2 21 2.44772 21 3V21C21 21.5523 20.5523 22 20 22H4C3.44772 22 3 21.5523 3 21V3ZM5 4V8H8C8.55228 8 9 8.44772 9 9C9 9.55228 8.55228 10 8 10H5V20H19V10H16C15.4477 10 15 9.55228 15 9C15 8.44772 15.4477 8 16 8H19V4H5ZM12 6C12.5523 6 13 6.44772 13 7V14.5858L15.2929 12.2929C15.6834 11.9024 16.3166 11.9024 16.7071 12.2929C17.0976 12.6834 17.0976 13.3166 16.7071 13.7071L12.7071 17.7071C12.3166 18.0976 11.6834 18.0976 11.2929 17.7071L7.29289 13.7071C6.90237 13.3166 6.90237 12.6834 7.29289 12.2929C7.68342 11.9024 8.31658 11.9024 8.70711 12.2929L11 14.5858V7C11 6.44772 11.4477 6 12 6Z",fill:e})})},window.tablerIcons.IconOpenAsPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtOpenAsPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V18C20 19.6569 18.6569 21 17 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H17C17.5523 19 18 18.5523 18 18V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM11.2929 13.2929C11.6834 12.9024 12.3166 12.9024 12.7071 13.2929L14.7071 15.2929C15.0976 15.6834 15.0976 16.3166 14.7071 16.7071C14.3166 17.0976 13.6834 17.0976 13.2929 16.7071L13 16.4142V23C13 23.5523 12.5523 24 12 24C11.4477 24 11 23.5523 11 23L11 16.4142L10.7071 16.7071C10.3166 17.0976 9.68342 17.0976 9.29289 16.7071C8.90237 16.3166 8.90237 15.6834 9.29289 15.2929L11.2929 13.2929Z",fill:e})})},window.tablerIcons.IconPage=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPage",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7 4C6.44772 4 6 4.44772 6 5V19C6 19.5523 6.44771 20 7 20H17C17.5523 20 18 19.5523 18 19V5C18 4.44772 17.5523 4 17 4H7ZM4 5C4 3.34315 5.34315 2 7 2H17C18.6569 2 20 3.34315 20 5V19C20 20.6569 18.6569 22 17 22H7C5.34315 22 4 20.6569 4 19V5ZM8 7C8 6.44772 8.44772 6 9 6H13C13.5523 6 14 6.44772 14 7C14 7.55228 13.5523 8 13 8H9C8.44772 8 8 7.55228 8 7Z",fill:e})})},window.tablerIcons.IconPageEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 19V10C5 8.89543 5.89543 8 7 8H17C18.1046 8 19 8.89543 19 10V19M9 12H13M7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM7 17C6.44772 17 6 17.4477 6 18V23C6 23.5523 5.55228 24 5 24C4.44772 24 4 23.5523 4 23V18C4 16.3431 5.34315 15 7 15H17C18.6569 15 20 16.3431 20 18V23C20 23.5523 19.5523 24 19 24C18.4477 24 18 23.5523 18 23V18C18 17.4477 17.5523 17 17 17H7ZM8 20C8 19.4477 8.44772 19 9 19H13C13.5523 19 14 19.4477 14 20C14 20.5523 13.5523 21 13 21H9C8.44772 21 8 20.5523 8 20Z",fill:e})})},window.tablerIcons.IconPageRef=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageRef",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M9 7H13M12 21H7C5.89543 21 5 20.1046 5 19V5C5 3.89543 5.89543 3 7 3H17C18.1046 3 19 3.89543 19 5V14M17 18H16V23H17M21 18H22V23H21",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPageSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPageSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4 6C4 4.34315 5.34315 3 7 3H17C18.6569 3 20 4.34315 20 6V11C20 11.5523 19.5523 12 19 12C18.4477 12 18 11.5523 18 11V6C18 5.44772 17.5523 5 17 5H7C6.44772 5 6 5.44772 6 6V18C6 18.5523 6.44772 19 7 19H10C10.5523 19 11 19.4477 11 20C11 20.5523 10.5523 21 10 21H7C5.34315 21 4 19.6569 4 18V6ZM8 8C8 7.44772 8.44772 7 9 7H13C13.5523 7 14 7.44772 14 8C14 8.55228 13.5523 9 13 9H9C8.44772 9 8 8.55228 8 8ZM16.5 16C15.6716 16 15 16.6716 15 17.5C15 18.3284 15.6716 19 16.5 19C17.3284 19 18 18.3284 18 17.5C18 16.6716 17.3284 16 16.5 16ZM13 17.5C13 15.567 14.567 14 16.5 14C18.433 14 20 15.567 20 17.5C20 18.1028 19.8476 18.6699 19.5793 19.1651L21.7071 21.2929C22.0976 21.6834 22.0976 22.3166 21.7071 22.7071C21.3166 23.0976 20.6834 23.0976 20.2929 22.7071L18.1651 20.5793C17.6699 20.8476 17.1028 21 16.5 21C14.567 21 13 19.433 13 17.5Z",fill:e})})},window.tablerIcons.IconPasteAsLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPasteAsLink",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("g",{clipPath:"url(#clip0_3328_925)",children:(0,s.jsx)("path",{d:"M9 5H7C6.46957 5 5.96086 5.21071 5.58579 5.58579C5.21071 5.96086 5 6.46957 5 7V19C5 19.5304 5.21071 20.0391 5.58579 20.4142C5.96086 20.7893 6.46957 21 7 21H8M9 5C9 4.46957 9.21071 3.96086 9.58579 3.58579C9.96086 3.21071 10.4696 3 11 3H13C13.5304 3 14.0391 3.21071 14.4142 3.58579C14.7893 3.96086 15 4.46957 15 5M9 5C9 5.53043 9.21071 6.03914 9.58579 6.41421C9.96086 6.78929 10.4696 7 11 7H13C13.5304 7 14.0391 6.78929 14.4142 6.41421C14.7893 6.03914 15 5.53043 15 5M15 5H17C17.5304 5 18.0391 5.21071 18.4142 5.58579C18.7893 5.96086 19 6.46957 19 7V9M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,s.jsx)("defs",{children:(0,s.jsx)("clipPath",{id:"clip0_3328_925",children:(0,s.jsx)("rect",{width:o,height:o,fill:"white"})})})]})},window.tablerIcons.IconPaused=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPaused",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"}),(0,s.jsx)("path",{d:"M8.5 6.5H7.5C7.22386 6.5 7 6.72386 7 7V13C7 13.2761 7.22386 13.5 7.5 13.5H8.5C8.77614 13.5 9 13.2761 9 13V7C9 6.72386 8.77614 6.5 8.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M12.5 6.5H11.5C11.2239 6.5 11 6.72386 11 7V13C11 13.2761 11.2239 13.5 11.5 13.5H12.5C12.7761 13.5 13 13.2761 13 13V7C13 6.72386 12.7761 6.5 12.5 6.5Z",strokeWidth:"1.333",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconPhotoLink=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPhotoLink",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M15 8H15.01M4 15V17C4 18.6569 5.34315 20 7 20H8M4 15V7C4 5.34315 5.34315 4 7 4H17C18.6569 4 20 5.34315 20 7V9M4 15L8 11C8.45606 10.5611 8.97339 10.3301 9.5 10.3301C10.0266 10.3301 10.5439 10.5611 11 11L13.5 13.5M16.7555 19.2444C16.9583 19.4514 17.2003 19.6158 17.4674 19.728C17.7346 19.8403 18.0214 19.8981 18.3111 19.8981C18.6009 19.8981 18.8877 19.8403 19.1548 19.728C19.4219 19.6158 19.6639 19.4514 19.8667 19.2444L22.3557 16.7555C22.7682 16.3429 23 15.7834 23 15.1999C23 14.6165 22.7682 14.0569 22.3557 13.6443C21.9431 13.2318 21.3835 13 20.8001 13C20.2166 13 19.657 13.2318 19.2445 13.6443L18.9334 13.9555M18.2445 16.7556C18.0417 16.5486 17.7997 16.3842 17.5326 16.272C17.2654 16.1597 16.9786 16.1019 16.6889 16.1019C16.3991 16.1019 16.1123 16.1597 15.8452 16.272C15.5781 16.3842 15.3361 16.5486 15.1333 16.7556L12.6443 19.2445C12.2318 19.6571 12 20.2166 12 20.8001C12 21.3835 12.2318 21.9431 12.6443 22.3557C13.0569 22.7682 13.6165 23 14.1999 23C14.7834 23 15.343 22.7682 15.7555 22.3557L16.0666 22.0445",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlHigh=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlHigh",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlLow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlLow",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlMedium=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlMedium",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("rect",{x:"4",y:"12",width:"4",height:"8",rx:"1",fill:e}),(0,s.jsx)("rect",{x:"10",y:"8",width:"4",height:"12",rx:"1",fill:e}),(0,s.jsx)("rect",{opacity:"0.3",x:"16",y:"4",width:"4",height:"16",rx:"1",fill:e})]})},window.tablerIcons.IconPriorityLvlNone=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlNone",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M5 12H7M19 12H17M11 12H13",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconPriorityLvlUrgent=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtPriorityLvlUrgent",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 3C4.34315 3 3 4.34315 3 6V18C3 19.6569 4.34315 21 6 21H18C19.6569 21 21 19.6569 21 18V6C21 4.34315 19.6569 3 18 3H6ZM13 8C13 7.44772 12.5523 7 12 7C11.4477 7 11 7.44772 11 8V12C11 12.5523 11.4477 13 12 13C12.5523 13 13 12.5523 13 12V8ZM13 15.99C13 15.4377 12.5523 14.99 12 14.99C11.4477 14.99 11 15.4377 11 15.99V16C11 16.5523 11.4477 17 12 17C12.5523 17 13 16.5523 13 16V15.99Z",fill:e})})},window.tablerIcons.IconQuery=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQuery",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M13.1429 13.1429L16 16M5 21H19C20.1046 21 21 20.1046 21 19V5C21 3.89543 20.1046 3 19 3H5C3.89543 3 3 3.89543 3 5V19C3 20.1046 3.89543 21 5 21ZM13.7143 10.8571C13.7143 12.4351 12.4351 13.7143 10.8571 13.7143C9.27919 13.7143 8 12.4351 8 10.8571C8 9.27919 9.27919 8 10.8571 8C12.4351 8 13.7143 9.27919 13.7143 10.8571Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconQueryCode=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtQueryCode",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M11.1429 11.1429L14 14M13 19H3C1.89543 19 1 18.1046 1 17V3C1 1.89543 1.89543 1 3 1H17C18.1046 1 19 1.89543 19 3V14M18 18H17V23H18M22 18H23V23H22M11.7143 8.85714C11.7143 10.4351 10.4351 11.7143 8.85714 11.7143C7.27919 11.7143 6 10.4351 6 8.85714C6 7.27919 7.27919 6 8.85714 6C10.4351 6 11.7143 7.27919 11.7143 8.85714Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconReferencesHide=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesHide",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.2929 2.29289C11.6834 1.90237 12.3166 1.90237 12.7071 2.29289L14.7071 4.29289C15.0976 4.68342 15.0976 5.31658 14.7071 5.70711C14.3166 6.09763 13.6834 6.09763 13.2929 5.70711L12 4.41421L10.7071 5.70711C10.3166 6.09763 9.68342 6.09763 9.29289 5.70711C8.90237 5.31658 8.90237 4.68342 9.29289 4.29289L11.2929 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconReferencesShow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtReferencesShow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.29289 2.29289C9.68342 1.90237 10.3166 1.90237 10.7071 2.29289L12 3.58579L13.2929 2.29289C13.6834 1.90237 14.3166 1.90237 14.7071 2.29289C15.0976 2.68342 15.0976 3.31658 14.7071 3.70711L12.7071 5.70711C12.3166 6.09763 11.6834 6.09763 11.2929 5.70711L9.29289 3.70711C8.90237 3.31658 8.90237 2.68342 9.29289 2.29289ZM1 11C1 9.34315 2.34315 8 4 8H20C21.6569 8 23 9.34315 23 11V19C23 20.6569 21.6569 22 20 22H4C2.34315 22 1 20.6569 1 19V11ZM4 10C3.44772 10 3 10.4477 3 11V19C3 19.5523 3.44772 20 4 20H20C20.5523 20 21 19.5523 21 19V11C21 10.4477 20.5523 10 20 10H4ZM5 13C5 12.4477 5.44772 12 6 12H10C10.5523 12 11 12.4477 11 13C11 13.5523 10.5523 14 10 14H6C5.44772 14 5 13.5523 5 13ZM8 16C8.55228 16 9 16.4477 9 17V17.01C9 17.5623 8.55228 18.01 8 18.01C7.44772 18.01 7 17.5623 7 17.01V17C7 16.4477 7.44772 16 8 16ZM18 18H12C11.4477 18 11 17.5523 11 17C11 16.4477 11.4477 16 12 16H18C18.5523 16 19 16.4477 19 17C19 17.5523 18.5523 18 18 18Z",fill:e})})},window.tablerIcons.IconResetPassword=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtResetPassword",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4C11.2044 4 10.4413 4.31607 9.87868 4.87868C9.31607 5.44129 9 6.20435 9 7V10H15V7C15 6.20435 14.6839 5.44129 14.1213 4.87868C13.5587 4.31607 12.7956 4 12 4ZM16 12C16.5523 12 17 11.5523 17 11V7C17 5.67392 16.4732 4.40215 15.5355 3.46447C14.5979 2.52678 13.3261 2 12 2C10.6739 2 9.40215 2.52678 8.46447 3.46447C7.52678 4.40215 7 5.67392 7 7V10C5.34315 10 4 11.3431 4 13V19C4 20.6569 5.34315 22 7 22H10C10.5523 22 11 21.5523 11 21C11 20.4477 10.5523 20 10 20H7C6.44772 20 6 19.5523 6 19V13C6 12.4477 6.44772 12 7 12H16ZM23 13C23.5523 13 24 13.4477 24 14V18C24 18.5523 23.5523 19 23 19H21.8952C21.8805 19.0003 21.8659 19.0003 21.8514 19H19C18.4477 19 18 18.5523 18 18C18 17.4477 18.4477 17 19 17H20.2363C19.6867 16.3861 18.8879 16 18 16C16.3431 16 15 17.3431 15 19C15 20.6569 16.3431 22 18 22C18.8959 22 19.6991 21.6086 20.2503 20.9841C20.6157 20.57 21.2477 20.5306 21.6617 20.8961C22.0758 21.2616 22.1152 21.8935 21.7497 22.3076C20.835 23.3439 19.4935 24 18 24C15.2386 24 13 21.7614 13 19C13 16.2386 15.2386 14 18 14C19.6364 14 21.0881 14.7857 22 15.9999V14C22 13.4477 22.4477 13 23 13Z",fill:e})})},window.tablerIcons.IconSelectAll=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectAll",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M3 3H21V21H3V3Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 2H4V4H2V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 2H22V4H20V2Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M20 20H22V22H20V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M2 20H4V22H2V20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 7H10V10H7V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 7H17V10H14V7Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M7 14H10V17H7V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M14 14H17V17H14V14Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconSelectCursor=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtSelectCursor",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.29292 4.29289C4.56075 4.02506 4.95692 3.93154 5.31625 4.05132L19.3163 8.71798C19.7 8.84589 19.9688 9.19233 19.9975 9.59578C20.0262 9.99922 19.809 10.3802 19.4472 10.5611L16.6659 11.9518L19.4483 14.7343C19.8389 15.1248 19.8389 15.758 19.4483 16.1485L16.1485 19.4483C15.758 19.8388 15.1248 19.8388 14.7343 19.4483L11.9518 16.6658L10.5611 19.4472C10.3802 19.809 9.99925 20.0262 9.5958 19.9975C9.19236 19.9688 8.84591 19.6999 8.71801 19.3162L4.05134 5.31623C3.93157 4.95689 4.02509 4.56073 4.29292 4.29289ZM6.58117 6.58114L9.85194 16.3934L10.7834 14.5305C10.9272 14.2429 11.2004 14.0421 11.5177 13.9906C11.835 13.9391 12.1577 14.0433 12.385 14.2706L15.4414 17.327L17.327 15.4414L14.2706 12.3849C14.0433 12.1576 13.9391 11.8349 13.9906 11.5177C14.0421 11.2004 14.243 10.9272 14.5305 10.7834L16.3935 9.85191L6.58117 6.58114Z",fill:e})})},window.tablerIcons.IconStackPop=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPop",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7 9.5L4 11L12 15L20 11L17 9.5M4 15L12 19L20 15M12 11V4M12 4L9 7M12 4L15 7",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconStackPull=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtStackPull",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M6 10L4 11L12 15L20 11L18 10M4 15L12 19L20 15M12 4V11M12 11L15 8M12 11L9 8",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconText=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtText",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5 5C5 4.44772 5.44772 4 6 4H18C18.5523 4 19 4.44772 19 5V7C19 7.55228 18.5523 8 18 8C17.4477 8 17 7.55228 17 7V6H13V18H14C14.5523 18 15 18.4477 15 19C15 19.5523 14.5523 20 14 20H10C9.44772 20 9 19.5523 9 19C9 18.4477 9.44772 18 10 18H11V6H7V7C7 7.55228 6.55228 8 6 8C5.44772 8 5 7.55228 5 7V5Z",fill:e})})},window.tablerIcons.IconTodo=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 20 20",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTodo",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("circle",{cx:"10",cy:"10",r:"8",strokeWidth:"2"})})},window.tablerIcons.IconTomorrow=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtTomorrow",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M20 15V7C20 5.89543 19.1046 5 18 5H6C4.89543 5 4 5.89543 4 7V19C4 20.1046 4.89543 21 6 21H11M20 19L22 21M22 21L20 23M22 21H15M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconUngroup=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtUngroup",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2 3C2 2.44772 2.44772 2 3 2H5C5.55228 2 6 2.44772 6 3H12C12 2.44772 12.4477 2 13 2H15C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6V8H18C18 7.44772 18.4477 7 19 7H21C21.5523 7 22 7.44772 22 8V10C22 10.5523 21.5523 11 21 11V18C21.5523 18 22 18.4477 22 19V21C22 21.5523 21.5523 22 21 22H19C18.4477 22 18 21.5523 18 21H11C11 21.5523 10.5523 22 10 22H8C7.44772 22 7 21.5523 7 21V19C7 18.4477 7.44772 18 8 18V15H6C6 15.5523 5.55228 16 5 16H3C2.44772 16 2 15.5523 2 15V13C2 12.4477 2.44772 12 3 12V6C2.44772 6 2 5.55228 2 5V3ZM5 6V12C5.55228 12 6 12.4477 6 13H12C12 12.4477 12.4477 12 13 12V6C12.4477 6 12 5.55228 12 5H6C6 5.55228 5.55228 6 5 6ZM15 12V10H18C18 10.5523 18.4477 11 19 11V18C18.4477 18 18 18.4477 18 19H11C11 18.4477 10.5523 18 10 18V15H12C12 15.5523 12.4477 16 13 16H15C15.5523 16 16 15.5523 16 15V13C16 12.4477 15.5523 12 15 12Z",fill:e})})},window.tablerIcons.IconVideoEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsxs)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtVideoEmbed",...r,xmlns:"http://www.w3.org/2000/svg",children:[(0,s.jsx)("path",{d:"M10.5 9V15L14.5 12L10.5 9Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,s.jsx)("path",{d:"M1 10C1 6.68629 3.68629 4 7 4H17C20.3137 4 23 6.68629 23 10V14C23 17.3137 20.3137 20 17 20H7C3.68629 20 1 17.3137 1 14V10Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})},window.tablerIcons.IconWhiteboard=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboard",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M18 9C18 8.44772 17.5523 8 17 8C16.4477 8 16 8.44772 16 9H18ZM16 15C16 15.5523 16.4477 16 17 16C17.5523 16 18 15.5523 18 15H16ZM3 14C2.44772 14 2 14.4477 2 15C2 15.5523 2.44772 16 3 16V14ZM11 15H12C12 14.4477 11.5523 14 11 14V15ZM10 19C10 19.5523 10.4477 20 11 20C11.5523 20 12 19.5523 12 19H10ZM14 5C14 4.44772 13.5523 4 13 4C12.4477 4 12 4.44772 12 5H14ZM13 9V10C13.5523 10 14 9.55228 14 9H13ZM7 9H6C6 9.55228 6.44772 10 7 10V9ZM8 5C8 4.44772 7.55228 4 7 4C6.44772 4 6 4.44772 6 5H8ZM5 6H19V4H5V6ZM20 7V17H22V7H20ZM19 18H5V20H19V18ZM4 17V7H2V17H4ZM5 18C4.44772 18 4 17.5523 4 17H2C2 18.6569 3.34315 20 5 20V18ZM20 17C20 17.5523 19.5523 18 19 18V20C20.6569 20 22 18.6569 22 17H20ZM19 6C19.5523 6 20 6.44772 20 7H22C22 5.34315 20.6569 4 19 4V6ZM5 4C3.34315 4 2 5.34315 2 7H4C4 6.44772 4.44772 6 5 6V4ZM16 9V15H18V9H16ZM3 16H11V14H3V16ZM10 15V19H12V15H10ZM12 5V9H14V5H12ZM13 8H7V10H13V8ZM8 9V5H6V9H8Z",fill:e})})},window.tablerIcons.IconWhiteboardElement=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardElement",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 5C5.44772 5 5 5.44772 5 6V7C5 7.55228 4.55228 8 4 8C3.44772 8 3 7.55228 3 7V6C3 4.34315 4.34315 3 6 3H8C8.55228 3 9 3.44772 9 4C9 4.55228 8.55228 5 8 5H6ZM15 4C15 3.44772 15.4477 3 16 3H18C19.6569 3 21 4.34315 21 6V7C21 7.55228 20.5523 8 20 8C19.4477 8 19 7.55228 19 7V6C19 5.44772 18.5523 5 18 5H16C15.4477 5 15 4.55228 15 4ZM7 10C7 9.44772 7.44772 9 8 9H16C16.5523 9 17 9.44772 17 10V14C17 14.5523 16.5523 15 16 15H8C7.44772 15 7 14.5523 7 14V10ZM9 11V13H15V11H9ZM4 16C4.55228 16 5 16.4477 5 17V18C5 18.5523 5.44772 19 6 19H8C8.55228 19 9 19.4477 9 20C9 20.5523 8.55228 21 8 21H6C4.34315 21 3 19.6569 3 18V17C3 16.4477 3.44772 16 4 16ZM20 16C20.5523 16 21 16.4477 21 17V18C21 19.6569 19.6569 21 18 21H16C15.4477 21 15 20.5523 15 20C15 19.4477 15.4477 19 16 19H18C18.5523 19 19 18.5523 19 18V17C19 16.4477 19.4477 16 20 16Z",fill:e})})},window.tablerIcons.IconWhiteboardFilter=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardFilter",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.07612 0.617317C5.2309 0.243642 5.59554 0 6 0H18C18.4045 0 18.7691 0.243642 18.9239 0.617317C19.0787 0.990991 18.9931 1.42111 18.7071 1.70711L15 5.41421V11C15 11.3466 14.8205 11.6684 14.5257 11.8507C14.2309 12.0329 13.8628 12.0494 13.5528 11.8944L9.55279 9.89443C9.214 9.72503 9 9.37877 9 9V5.41421L5.29289 1.70711C5.0069 1.42111 4.92134 0.990991 5.07612 0.617317ZM8.41421 2L10.7071 4.29289C10.8946 4.48043 11 4.73478 11 5V8.38197L13 9.38197V5C13 4.73478 13.1054 4.48043 13.2929 4.29289L15.5858 2H8.41421ZM2 18C2 16.3431 3.34315 15 5 15H19C20.6569 15 22 16.3431 22 18V23C22 23.5523 21.5523 24 21 24C20.4477 24 20 23.5523 20 23V18C20 17.4477 19.5523 17 19 17H14V20C14 20.5523 13.5523 21 13 21H7C6.44772 21 6 20.5523 6 20V17H5C4.44772 17 4 17.4477 4 18V23C4 23.5523 3.55228 24 3 24C2.44772 24 2 23.5523 2 23V18ZM8 17V19H12V17H8ZM17 19C17.5523 19 18 19.4477 18 20V23C18 23.5523 17.5523 24 17 24C16.4477 24 16 23.5523 16 23V20C16 19.4477 16.4477 19 17 19Z",fill:e})})},window.tablerIcons.IconWhiteboardSearch=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtWhiteboardSearch",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1 6C1 4.34315 2.34315 3 4 3H18C19.6569 3 21 4.34315 21 6V11C21 11.5523 20.5523 12 20 12C19.4477 12 19 11.5523 19 11V6C19 5.44772 18.5523 5 18 5H13V8C13 8.55228 12.5523 9 12 9H6C5.44772 9 5 8.55228 5 8V5H4C3.44772 5 3 5.44772 3 6V13H10C10.5523 13 11 13.4477 11 14V17H12C12.5523 17 13 17.4477 13 18C13 18.5523 12.5523 19 12 19H4C2.34315 19 1 17.6569 1 16V6ZM9 17V15H3V16C3 16.5523 3.44772 17 4 17H9ZM7 5V7H11V5H7ZM18.5 16C17.6716 16 17 16.6716 17 17.5C17 18.3284 17.6716 19 18.5 19C19.3284 19 20 18.3284 20 17.5C20 16.6716 19.3284 16 18.5 16ZM15 17.5C15 15.567 16.567 14 18.5 14C20.433 14 22 15.567 22 17.5C22 18.1028 21.8476 18.6699 21.5793 19.1651L23.7071 21.2929C24.0976 21.6834 24.0976 22.3166 23.7071 22.7071C23.3166 23.0976 22.6834 23.0976 22.2929 22.7071L20.1651 20.5793C19.6699 20.8476 19.1028 21 18.5 21C16.567 21 15 19.433 15 17.5Z",fill:e})})},window.tablerIcons.IconXEmbed=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtX-embed",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M8 16L11.384 12.616M12.614 11.386L16 8M10.2084 8.10216L15.7083 15.6022C15.8294 15.7673 15.7114 16 15.5067 16H13.9932C13.9135 16 13.8387 15.9621 13.7916 15.8978L8.29174 8.39784C8.17065 8.23271 8.28857 8 8.49334 8H10.0068C10.0865 8 10.1613 8.03794 10.2084 8.10216ZM7 20H17C20.3137 20 23 17.3137 23 14V10C23 6.68629 20.3137 4 17 4H7C3.68629 4 1 6.68629 1 10V14C1 17.3137 3.68629 20 7 20Z",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconYesterday=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtYesterday",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M16 3V7M8 3V7M4 11H20M4 15V7C4 5.89543 4.89543 5 6 5H18C19.1046 5 20 5.89543 20 7V19C20 20.1046 19.1046 21 18 21H13M4 19L2 21M2 21L4 23M2 21H9M8 15H10V17H8V15Z",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},window.tablerIcons.IconZoomToFit=function({size:o=24,color:e="currentColor",stroke:n=0,...r}){return(0,s.jsx)("svg",{width:o,height:o,viewBox:"0 0 24 24",fill:"none",strokeWidth:n,stroke:e,strokeLinecap:"round",strokeLinejoin:"round",className:"icon iconTabler iconTablerExtZoomToFit",...r,xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M20 4H16H18C18.5304 4 19.0391 4.21071 19.4142 4.58579C19.7893 4.96086 20 5.46957 20 6V8V4ZM20 4L14 10M4 20H8H6C5.46957 20 4.96086 19.7893 4.58579 19.4142C4.21071 19.0391 4 18.5304 4 18V16V20ZM4 20L10 14M4 8V6C4 5.46957 4.21071 4.96086 4.58579 4.58579C4.96086 4.21071 5.46957 4 6 4H8M16 20H18C18.5304 20 19.0391 19.7893 19.4142 19.4142C19.7893 19.0391 20 18.5304 20 18V16",stroke:e,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}})(); \ No newline at end of file diff --git a/scripts/browser-globals/react-dom-client.js b/scripts/browser-globals/react-dom-client.js new file mode 100644 index 000000000000..03587a52b7d9 --- /dev/null +++ b/scripts/browser-globals/react-dom-client.js @@ -0,0 +1,3 @@ +import * as ReactDOMClient from 'react-dom/client' + +window.ReactDOMClient = ReactDOMClient diff --git a/scripts/browser-globals/react-dom.js b/scripts/browser-globals/react-dom.js new file mode 100644 index 000000000000..d90cefcc0376 --- /dev/null +++ b/scripts/browser-globals/react-dom.js @@ -0,0 +1,3 @@ +import * as ReactDOM from 'react-dom' + +window.ReactDOM = ReactDOM diff --git a/scripts/browser-globals/react-jsx-dev-runtime.js b/scripts/browser-globals/react-jsx-dev-runtime.js new file mode 100644 index 000000000000..3c93396f1790 --- /dev/null +++ b/scripts/browser-globals/react-jsx-dev-runtime.js @@ -0,0 +1,3 @@ +import * as ReactJSXDevRuntime from 'react/jsx-dev-runtime' + +window.ReactJSXDevRuntime = ReactJSXDevRuntime diff --git a/scripts/browser-globals/react-jsx-runtime.js b/scripts/browser-globals/react-jsx-runtime.js new file mode 100644 index 000000000000..c2381b93c5a9 --- /dev/null +++ b/scripts/browser-globals/react-jsx-runtime.js @@ -0,0 +1,3 @@ +import * as ReactJSXRuntime from 'react/jsx-runtime' + +window.ReactJSXRuntime = ReactJSXRuntime diff --git a/scripts/browser-globals/react.js b/scripts/browser-globals/react.js new file mode 100644 index 000000000000..3dd10cd95781 --- /dev/null +++ b/scripts/browser-globals/react.js @@ -0,0 +1,3 @@ +import * as React from 'react' + +window.React = React diff --git a/scripts/browser-globals/tabler-icons-react.js b/scripts/browser-globals/tabler-icons-react.js new file mode 100644 index 000000000000..dd45f6b3750a --- /dev/null +++ b/scripts/browser-globals/tabler-icons-react.js @@ -0,0 +1,3 @@ +import * as tablerIcons from '@tabler/icons-react' + +window.tablerIcons = tablerIcons diff --git a/shadow-cljs.edn b/shadow-cljs.edn index 62f4522183c6..5a44275650a3 100644 --- a/shadow-cljs.edn +++ b/shadow-cljs.edn @@ -20,7 +20,13 @@ :resolve {"react" {:target :global :global "React"} "react-dom" {:target :global - :global "ReactDOM"}}} + :global "ReactDOM"} + "react-dom/client" {:target :global + :global "ReactDOMClient"} + "react/jsx-runtime" {:target :global + :global "ReactJSXRuntime"} + "react/jsx-dev-runtime" {:target :global + :global "ReactJSXDevRuntime"}}} :modules {:main {:init-fn frontend.core/init} :code-editor @@ -117,7 +123,13 @@ :resolve {"react" {:target :global :global "React"} "react-dom" {:target :global - :global "ReactDOM"}}} + :global "ReactDOM"} + "react-dom/client" {:target :global + :global "ReactDOMClient"} + "react/jsx-runtime" {:target :global + :global "ReactJSXRuntime"} + "react/jsx-dev-runtime" {:target :global + :global "ReactJSXDevRuntime"}}} ;; handle `require(xxx.css)` :modules {:main {:init-fn mobile.core/init} @@ -209,7 +221,13 @@ :resolve {"react" {:target :global :global "React"} "react-dom" {:target :global - :global "ReactDOM"}}} + :global "ReactDOM"} + "react-dom/client" {:target :global + :global "ReactDOMClient"} + "react/jsx-runtime" {:target :global + :global "ReactJSXRuntime"} + "react/jsx-dev-runtime" {:target :global + :global "ReactJSXDevRuntime"}}} :modules {:main {:init-fn frontend.publishing/init} :code-editor diff --git a/src/main/electron/listener.cljs b/src/main/electron/listener.cljs index 88010f0c0bd7..28eceef033e2 100644 --- a/src/main/electron/listener.cljs +++ b/src/main/electron/listener.cljs @@ -140,4 +140,4 @@ (defn listen! [] (listen-to-electron!) - (electron-locale/push-locale! (state/sub :preferred-language))) + (electron-locale/push-locale! (state/get-state :preferred-language))) diff --git a/src/main/frontend/components/all_pages.cljs b/src/main/frontend/components/all_pages.cljs index d9009c5f7ea5..f830a102c479 100644 --- a/src/main/frontend/components/all_pages.cljs +++ b/src/main/frontend/components/all_pages.cljs @@ -5,7 +5,7 @@ [frontend.context.i18n :refer [t]] [frontend.db :as db] [logseq.common.config :as common-config] - [rum.core :as rum])) + [io.factorhouse.hsx.core :as hsx])) (defn- columns [] @@ -24,7 +24,7 @@ (remove nil?) vec)) -(rum/defc all-pages < rum/static +(hsx/defc all-pages [] (let [columns' (views/build-columns {} (columns) {:with-object-name? false diff --git a/src/main/frontend/components/assets.cljs b/src/main/frontend/components/assets.cljs index 730c5d3fad4d..32b6c72ba18b 100644 --- a/src/main/frontend/components/assets.cljs +++ b/src/main/frontend/components/assets.cljs @@ -19,7 +19,7 @@ [logseq.shui.ui :as shui] [medley.core :as medley] [promesa.core :as p] - [rum.core :as rum])) + [io.factorhouse.hsx.core :as hsx])) (defn -get-all-formats [] @@ -30,12 +30,12 @@ config/markup-formats) (map #(hash-map :id % :value (name %))))) -(rum/defc input-auto-complete +(hsx/defc input-auto-complete [{:keys [items item-cp class on-chosen on-keydown input-opts]}] - (let [[*input-val, set-*input-val] (rum/use-state (atom nil)) - [input-empty?, set-input-empty?] (rum/use-state true)] + (let [[*input-val, set-*input-val] (hooks/use-state (atom nil)) + [input-empty?, set-input-empty?] (hooks/use-state true)] (hooks/use-effect! #(set-input-empty? (string/blank? @*input-val)) @@ -59,10 +59,10 @@ (fn? on-keydown) (assoc :on-key-down #(on-keydown % *input-val)))}))) -(rum/defc confirm-dir-with-alias-name +(hsx/defc confirm-dir-with-alias-name [dir set-dir!] - (let [[val set-val!] (rum/use-state "") + (let [[val set-val!] (hooks/use-state "") on-submit (fn [] (when-not (string/blank? val) (if-not (assets-handler/get-alias-by-name val) @@ -94,18 +94,16 @@ :disabled (string/blank? val) :on-click on-submit)]])) -(rum/defc restart-button +(hsx/defc restart-button [] (ui/button (t :plugin/restart) :on-click #(js/logseq.api.relaunch) :small? true :intent "logseq")) -(rum/defcs ^:large-vars/data-var alias-directories - < rum/reactive - (rum/local nil ::ext-editing-dir) - [_state] - (let [*ext-editing-dir (::ext-editing-dir _state) - directories (into [] (state/sub :assets/alias-dirs)) +(hsx/defc ^:large-vars/data-var alias-directories + [] + (let [[ext-editing-dir set-ext-editing-dir!] (hooks/use-state nil) + directories (into [] (state/use-sub :assets/alias-dirs)) pick-exist assets-handler/get-alias-by-dir set-dir! (fn [name dir exts] (when (and name dir) @@ -159,7 +157,7 @@ {:key ext :on-click #(del-ext dir ext)} [:span ext] (ui/icon "circle-minus")]) - (if (= dir @*ext-editing-dir) + (if (= dir ext-editing-dir) (input-auto-complete {:items (-get-all-formats) @@ -169,24 +167,24 @@ :on-chosen (fn [{:keys [value]}] (add-ext dir value) - (reset! *ext-editing-dir nil)) + (set-ext-editing-dir! nil)) :on-keydown (fn [^js e *input-val] (let [^js input (.-target e)] (case (.-which e) 27 ;; esc (do (if-not (string/blank? (.-value input)) (reset! *input-val "") - (reset! *ext-editing-dir nil)) + (set-ext-editing-dir! nil)) (util/stop e)) :dune))) - :input-opts {:class "cp__assets-alias-ext-input" + :input-opts {:class "cp__assets-alias-ext-input" :placeholder (t :asset/file-extension-placeholder) :on-blur - #(reset! *ext-editing-dir nil)}}) + #(set-ext-editing-dir! nil)}}) [:small.ext-label.is-plus - {:on-click #(reset! *ext-editing-dir dir)} + {:on-click #(set-ext-editing-dir! dir)} (ui/icon "plus") (t :asset/acceptable-file-extensions)])] [:span.ctrls.flex.space-x-3.text-xs.opacity-30.hover:opacity-100.whitespace-nowrap.hidden.mt-1 @@ -201,14 +199,11 @@ (confirm-dir path set-dir!))) :small? true)]])) -(rum/defcs settings-content - < rum/reactive - (rum/local (state/sub :assets/alias-enabled?) ::alias-enabled?) - [_state] - - (let [*pre-alias-enabled? (::alias-enabled? _state) - alias-enabled? (state/sub :assets/alias-enabled?) - alias-enabled-changed? (not= @*pre-alias-enabled? alias-enabled?)] +(hsx/defc settings-content + [] + (let [alias-enabled? (state/use-sub :assets/alias-enabled?) + [pre-alias-enabled?] (hooks/use-state alias-enabled?) + alias-enabled-changed? (not= pre-alias-enabled? alias-enabled?)] [:div.cp__assets-settings.panel-wrap [:div.it @@ -226,9 +221,9 @@ [:h2.font-bold.opacity-80 (t :asset/selected-directories)] (alias-directories)])])) -(rum/defc edit-external-url-form +(hsx/defc edit-external-url-form [asset-block {:keys [url title on-saved]}] - (let [[saving? set-saving?] (rum/use-state false) + (let [[saving? set-saving?] (hooks/use-state false) create? (nil? asset-block)] [:form.pt-3.flex.flex-col.gap-2 {:on-submit (fn [^js e] @@ -281,7 +276,7 @@ [:div.flex.justify-end.pt-3 (ui/button (if create? (t :ui/create) (t :ui/save)) {:disabled saving?})]])) -(rum/defc edit-external-url-content +(hsx/defc edit-external-url-content [asset-block pdf-current] [:div.edit-external-url-content (let [on-saved! (fn [asset-block update?] diff --git a/src/main/frontend/components/avatar.cljs b/src/main/frontend/components/avatar.cljs index bc04ded5afa2..c311ef7472d9 100644 --- a/src/main/frontend/components/avatar.cljs +++ b/src/main/frontend/components/avatar.cljs @@ -1,8 +1,8 @@ (ns frontend.components.avatar (:require [clojure.string :as string] + [io.factorhouse.hsx.core :as hsx] [logseq.shui.ui :as shui] - [logseq.shui.util :as shui-util] - [rum.core :as rum])) + [logseq.shui.util :as shui-util])) (defonce ^:private latin-or-number-re (js/RegExp. "^[\\p{Script=Latin}\\p{Number}]" "u")) @@ -39,7 +39,7 @@ letters)) string/upper-case))))))) -(rum/defc user-avatar +(hsx/defc user-avatar [{:keys [name title uuid avatar-src class style fallback fallback-length fallback-props image-props] :or {fallback-length 2}}] (let [color (when uuid (shui-util/uuid-color uuid)) diff --git a/src/main/frontend/components/block.cljs b/src/main/frontend/components/block.cljs index 473abe5699d3..58f22e81e8cc 100644 --- a/src/main/frontend/components/block.cljs +++ b/src/main/frontend/components/block.cljs @@ -33,7 +33,7 @@ [frontend.context.i18n :refer [t]] [frontend.date :as date] [frontend.db :as db] - [frontend.db-mixins :as db-mixins] + [frontend.db.hooks :as db-hooks] [frontend.db.async :as db-async] [frontend.db.model :as model] [frontend.db.react :as react] @@ -63,7 +63,6 @@ [frontend.handler.search :as search-handler] [frontend.handler.ui :as ui-handler] [frontend.handler.user :as user-handler] - [frontend.mixins :as mixins] [frontend.mobile.haptics :as haptics] [frontend.mobile.intent :as mobile-intent] [frontend.mobile.util :as mobile-util] @@ -97,7 +96,7 @@ [medley.core :as medley] [missionary.core :as m] [promesa.core :as p] - [rum.core :as rum])) + [io.factorhouse.hsx.core :as hsx])) ;; local state (defonce *dragging? @@ -177,7 +176,7 @@ (when (seq images) (lightbox/preview-images! images)))) -(rum/defc resize-image-handles +(hsx/defc resize-image-handles [dx-fn] (let [handle-props {} add-resizing-class! #(dom/add-class! js/document.documentElement "is-resizing-buf") @@ -225,7 +224,7 @@ (defonce *resizing-image? (atom false)) -(rum/defc ^:large-vars/cleanup-todo asset-container +(hsx/defc ^:large-vars/cleanup-todo asset-container [asset-block src title metadata {:keys [breadcrumb? positioned? local? full-text gallery-view?]}] (let [asset-width (:logseq.property.asset/width asset-block) asset-height (:logseq.property.asset/height asset-block) @@ -243,7 +242,7 @@ :logseq.property.asset/height height})))))) (fn [])) []) - (let [*el-ref (rum/use-ref nil) + (let [*el-ref (hooks/use-ref nil) image-src (when (seq src) (fs/asset-path-normalize src)) src' (if (and (seq src) @@ -251,7 +250,7 @@ (string/starts-with? src "~"))) (str "file://" src) src) - get-blockid #(some-> (rum/deref *el-ref) (.closest "[blockid]") (.getAttribute "blockid") (uuid))] + get-blockid #(some-> (hooks/deref *el-ref) (.closest "[blockid]") (.getAttribute "blockid") (uuid))] [:div.asset-container {:key "resize-asset-container" :on-pointer-down util/stop @@ -393,20 +392,21 @@ [:span.flex.items-center.gap-1.text-red-700 (ui/icon "trash") (t :asset/delete)])])))]))])]))) -(rum/defcs ^:large-vars/cleanup-todo resizable-image < - (rum/local nil ::size) - {:will-unmount (fn [state] - (reset! *resizing-image? false) - state)} - [state config title src metadata full-text local?] +(hsx/defc ^:large-vars/cleanup-todo resizable-image + [config title src metadata full-text local?] + (hooks/use-effect! + (fn [] + #(reset! *resizing-image? false)) + []) (let [breadcrumb? (:breadcrumb? config) positioned? (:property-position config) asset-block (:asset-block config) asset-align (normalize-asset-align (:logseq.property.asset/align asset-block)) metadata (block-image/effective-image-metadata config asset-block metadata) width (:width metadata) - *width (get state ::size) - width (or @*width width) + *width (hooks/use-memo #(atom nil) []) + [local-width] (hooks/use-atom *width) + width (or local-width width) metadata' (assoc metadata :width width) resizable? (and (not (mobile-util/native-platform?)) (not breadcrumb?) @@ -458,7 +458,7 @@ (editor-handler/resize-image! config block-id metadata full-text {:width width'}))) (reset! *resizing-image? false))))))]]))) -(rum/defc audio-cp +(hsx/defc audio-cp ([src] (audio-cp src nil)) ([src ext] ;; Change protocol to allow media fragment uris to play @@ -503,10 +503,10 @@ (p/then load$))))) (js/console.error _e)))))))) -(rum/defcs asset-link < rum/reactive - (rum/local nil ::src) - [state config title href metadata full_text] - (let [src (::src state) +(hsx/defc asset-link + [config title href metadata full_text] + (let [src* (hooks/use-memo #(atom nil) [href]) + [src] (hooks/use-atom src*) href (cond-> href (common-config/local-relative-asset? href) (config/get-local-asset-absolute-path)) @@ -515,15 +515,18 @@ (try (js/URL. href) (catch :default _ nil))))] - (when (nil? @src) - (-> (assets-handler/ (assets-handler/ (:block/title entity) util/page-name-sanity-lc) - inner (page-inner config entity children label) - modal? (shui-dialog/has-modal?)] - (if (and (not (util/mobile?)) - (not= page-name (:id config)) - (not (false? preview?)) - (not disable-preview?) - (not modal?)) - (page-preview-trigger (assoc config :children inner) entity) - inner)) - - (and (:block/name page) show-non-exists-page?) - (page-inner config (merge - {:block/title (or (:block/title page) - (:block/name page)) - :block/name (:block/name page)} - page) children label) - - (:block/name page) - [:span - (when tag? "#") - (when-not tag? - [:span.text-gray-500.bracket page-ref/left-brackets]) - (or label (:block/name page)) - (when-not tag? - [:span.text-gray-500.bracket page-ref/right-brackets])] + [{:keys [label children preview? disable-preview? show-non-exists-page? tag? _skip-async-load?] :as config} page] + (let [page-id-or-name (or (:db/id page) + (:block/uuid page) + (when-let [s (:block/name page)] + (string/trim s))) + page-entity (if (e/entity? page) page (db/get-page page-id-or-name)) + initial-entity (cond + page-entity + page-entity + + (or (:skip-async-load? config) (:table-view? config)) + page + + :else + nil) + *entity (hooks/use-memo #(atom initial-entity) [page-id-or-name]) + [entity'] (hooks/use-atom *entity)] + (hooks/use-effect! + (fn [] + (cond + page-entity + nil + + (or (:skip-async-load? config) (:table-view? config)) + nil + + :else + (p/let [result ( (:block/title entity) util/page-name-sanity-lc) + inner (page-inner config entity children label) + modal? (shui-dialog/has-modal?)] + (if (and (not (util/mobile?)) + (not= page-name (:id config)) + (not (false? preview?)) + (not disable-preview?) + (not modal?)) + (page-preview-trigger (assoc config :children inner) entity) + inner)) + + (and (:block/name page) show-non-exists-page?) + (page-inner config (merge + {:block/title (or (:block/title page) + (:block/name page)) + :block/name (:block/name page)} + page) children label) + + (:block/name page) + [:span + (when tag? "#") + (when-not tag? + [:span.text-gray-500.bracket page-ref/left-brackets]) + (or label (:block/name page)) + (when-not tag? + [:span.text-gray-500.bracket page-ref/right-brackets])] - :else - nil))) + :else + nil)))) -(rum/defc page-cp +(hsx/defc page-cp [config page] (let [id (or (:db/id page) (:block/uuid page) (:block/name page))] - (rum/with-key (page-cp-inner config page) - (str id)))) + ^{:key (str id)} + [page-cp-inner config page])) -(rum/defc asset-reference +(hsx/defc asset-reference [config title path] (let [repo (state/get-current-repo) real-path-url (cond @@ -1067,10 +1079,8 @@ title-or-path])])) (defn- maybe-request-asset-download! - [state block] + [file-exists? requested? block] (let [repo (state/get-current-repo) - file-exists? @(::file-exists? state) - requested? (get state ::download-requested?) asset-file-write-finish @(get @state/state :assets/asset-file-write-finish) asset-file-write-finished? (get-in asset-file-write-finish [repo (str (:block/uuid block))]) file-ready? (or file-exists? asset-file-write-finished?)] @@ -1078,37 +1088,21 @@ (reset! requested? false)) (when (and (not @requested?) (assets-handler/maybe-request-remote-asset-download! repo block file-ready?)) - (reset! requested? true))) - state) - -(rum/defcs asset-cp < rum/reactive - (rum/local nil ::file-exists?) - (rum/local false ::download-requested?) - {:will-mount (fn [state] - (let [block (last (:rum/args state)) - asset-type (:logseq.property.asset/type block) - external-url? (not (string/blank? (:logseq.property.asset/external-url block))) - path (path/path-join common-config/local-assets-dir (str (:block/uuid block) "." asset-type))] - (p/let [result (if (or external-url? config/publishing?) - ;; publishing doesn't have window.pfs defined - true - (fs/file-exists? (config/get-repo-dir (state/get-current-repo)) path))] - (reset! (::file-exists? state) result)) - state)) - :did-mount (fn [state] - (maybe-request-asset-download! state (last (:rum/args state)))) - :did-update (fn [state] - (maybe-request-asset-download! state (last (:rum/args state))))} - [state config block] + (reset! requested? true)))) + +(hsx/defc asset-cp + [config block] (let [asset-type (:logseq.property.asset/type block) file (str (:block/uuid block) "." asset-type) - file-exists? @(::file-exists? state) + file-exists?* (hooks/use-memo #(atom nil) [(:block/uuid block) asset-type]) + requested?* (hooks/use-memo #(atom false) [(:block/uuid block)]) + [file-exists?] (hooks/use-atom file-exists?*) repo (state/get-current-repo) - asset-file-write-finished? (state/sub :assets/asset-file-write-finish - {:path-in-sub-atom [repo (str (:block/uuid block))]}) + asset-file-write-finished? (state/use-sub :assets/asset-file-write-finish + :path-in-sub-atom [repo (str (:block/uuid block))]) file-ready? (or file-exists? asset-file-write-finished?) - progress-entry (state/sub :rtc/asset-upload-download-progress - {:path-in-sub-atom [repo (str (:block/uuid block))]}) + progress-entry (state/use-sub :rtc/asset-upload-download-progress + :path-in-sub-atom [repo (str (:block/uuid block))]) {:keys [direction loaded total]} progress-entry in-progress? (and (number? loaded) (number? total) (pos? total) (not= loaded total)) percent (when in-progress? @@ -1145,6 +1139,18 @@ ;; and graph-root-relative paths. href (or (:logseq.property.asset/external-url block) (path/path-join (str "../" common-config/local-assets-dir) file)) + _ (hooks/use-effect! + (fn [] + (let [external-url? (not (string/blank? (:logseq.property.asset/external-url block))) + path (path/path-join common-config/local-assets-dir file)] + (p/let [result (if (or external-url? config/publishing?) + ;; publishing doesn't have window.pfs defined + true + (fs/file-exists? (config/get-repo-dir (state/get-current-repo)) path))] + (reset! file-exists?* result)))) + [file]) + _ (hooks/use-effect! + #(maybe-request-asset-download! file-exists? requested?* block)) content (cond (or file-ready? gallery-image?) (asset-link (cond-> (assoc config :asset-block block) @@ -1172,18 +1178,21 @@ (declare block-positioned-properties) -(rum/defc page-reference < rum/reactive db-mixins/query +(hsx/defc page-reference "Component for page reference" [{:keys [html-export? nested-link? show-brackets? id] :as config*} uuid-or-title* label] - (when uuid-or-title* - (let [uuid-or-title (if (string? uuid-or-title*) + (let [uuid-or-title (when uuid-or-title* + (if (string? uuid-or-title*) (let [str-id (string/trim uuid-or-title*)] (if (util/uuid-string? str-id) (parse-uuid str-id) str-id)) - uuid-or-title*) - self-reference? (when (set? (:ref-set config*)) - (contains? (:ref-set config*) uuid-or-title))] + uuid-or-title*)) + block* (when uuid-or-title (db/get-page uuid-or-title)) + reactive-block (db/sub-block (:db/id block*)) + self-reference? (when (set? (:ref-set config*)) + (contains? (:ref-set config*) uuid-or-title))] + (when uuid-or-title* (when-not self-reference? (let [config (update config* :ref-set (fn [s] (let [bid (:block/uuid (:block config*))] @@ -1192,8 +1201,7 @@ (conj s bid uuid-or-title))))) show-brackets? (if (some? show-brackets?) show-brackets? (state/show-brackets?)) contents-page? (= "contents" (string/lower-case (str id))) - block* (db/get-page uuid-or-title) - block (or (some-> (:db/id block*) db/sub-block) block*) + block (or reactive-block block*) config' (assoc config :label (mldoc/plain->text label) :contents-page? contents-page? @@ -1264,7 +1272,7 @@ (declare block-content) (declare breadcrumb) -(rum/defc block-reference +(hsx/defc block-reference [config id label] (let [block-id (and id (if (uuid? id) id (parse-uuid id))) [_block set-block!] (hooks/use-state (db/entity [:block/uuid block-id])) @@ -1301,9 +1309,9 @@ [:span.warning {:title (t :block.macro/unsupported-name name)} (macro->text name arguments)]])))) -(rum/defc nested-link < rum/reactive +(hsx/defc nested-link [config html-export? link] - (let [show-brackets? (state/show-brackets?) + (let [show-brackets? (not (false? (:ui/show-brackets? (state/use-sub-config)))) {:keys [content children]} link] [:span.page-reference.nested (when (and show-brackets? @@ -1354,7 +1362,7 @@ file-path (relative-assets-path->absolute-path file-path)))) -(rum/defc audio-link +(hsx/defc audio-link [config url href _label metadata full_text] (if (common-config/local-relative-asset? href) (asset-link config nil href metadata full_text) @@ -1535,12 +1543,15 @@ :map-inline map-inline :inline inline})) -(rum/defc macro-function-cp < rum/reactive +(hsx/defc macro-function-cp [config arguments] - (or - (some-> (:query-result config) rum/react (block-macros/function-macro arguments)) - [:span.warning - (util/format "{{function %s}}" (first arguments))])) + (let [fallback* (hooks/use-memo #(atom nil) []) + query-result* (or (:query-result config) fallback*) + [query-result] (hooks/use-atom query-result*)] + (or + (some-> query-result (block-macros/function-macro arguments)) + [:span.warning + (util/format "{{function %s}}" (first arguments))]))) (defn- macro-vimeo-cp [_config arguments] @@ -1860,7 +1871,7 @@ :else "")) -(rum/defc block-child +(hsx/defc block-child [block] block) @@ -1966,7 +1977,7 @@ ;; Keep one child visible for progressive feedback. (if (zero? idx) 1 idx))))))) -(rum/defc block-children +(hsx/defc block-children [config block children collapsed?] (let [ref? (:ref? config) query? (:custom-query? config) @@ -2125,10 +2136,9 @@ (declare flush-comment-thread-presence!) (defn- schedule-comment-thread-presence-check! - [state block] + [*comment-thread-present? block] (when-let [cache-key (comment-thread-presence-key block)] - (let [*comment-thread-present? (get state ::comment-thread-present?) - cached-entry (fresh-comment-thread-presence cache-key)] + (let [cached-entry (fresh-comment-thread-presence cache-key)] (cond (or (comments-model/protected-comment-block? block) (ui-comment-thread-for-block block)) @@ -2213,20 +2223,19 @@ :uuid uuid :fallback-props {:style {:font-size 9}}})]))) -(rum/defcs ^:large-vars/cleanup-todo block-control < rum/reactive - (rum/local false ::dragging?) - [state config block {:keys [uuid block-id collapsed? *control-show? edit? selected? top? bottom?]}] - (let [*bullet-dragging? (::dragging? state) - doc-mode? (state/sub :document/mode?) - control-show? (util/react *control-show?) - rtc-state (state/sub :rtc/state) +(hsx/defc ^:large-vars/cleanup-todo block-control + [config block {:keys [uuid block-id collapsed? *control-show? edit? selected? top? bottom?]}] + (let [*bullet-dragging? (hooks/use-memo #(atom false) []) + doc-mode? (state/use-sub :document/mode?) + [control-show?] (hooks/use-atom *control-show?) + rtc-state (state/use-sub :rtc/state) online-users (:online-users rtc-state) current-user-uuid (user-handler/user-uuid) editing-user (editing-user-for-block uuid online-users current-user-uuid) ref? (:ref? config) container-id (:container-id config) empty-content? (block-content-empty? block) - fold-button-right? (state/enable-fold-button-right?) + fold-button-right? (state/use-enable-fold-button-right?) own-number-list? (:own-order-number-list? config) order-list? (boolean own-number-list?) order-list-idx (:own-order-list-index config) @@ -2341,7 +2350,7 @@ [:div (t :block/created-label (date/int->local-time-2 (:block/created-at block)))] [:div (t :block/last-edited-label (date/int->local-time-2 (:block/updated-at block)))]]))))])) -(rum/defc dnd-separator +(hsx/defc dnd-separator [move-to] [:div.relative [:div.dnd-separator.absolute @@ -2366,7 +2375,7 @@ (declare src-cp) -(rum/defc ^:large-vars/cleanup-todo text-block-title +(hsx/defc ^:large-vars/cleanup-todo text-block-title [config block] (let [format :markdown block (if-not (:block.temp/ast-title block) @@ -2427,9 +2436,9 @@ (assoc :parent-heading heading))] (map-inline config' block-ast-title)))))))) -(rum/defc block-title-aux +(hsx/defc block-title-aux [config block {:keys [query? *show-query?]}] - (let [[hover? set-hover?] (rum/use-state false) + (let [[hover? set-hover?] (hooks/use-state false) blank? (string/blank? (:block/title block)) opacity (if hover? "opacity-100" "opacity-0") query (:logseq.property/query block) @@ -2469,16 +2478,16 @@ (when (ldb/class-instance? (entity-plus/entity-memoized (db/get-db) :logseq.class/Cards) block) - [(ui/tooltip - (shui/button - {:variant :ghost - :size :sm - :class "!px-1 text-xs text-muted-foreground" - :on-click (fn [e] - (util/stop e) - (state/pub-event! [:modal/show-cards (:db/id block)]))} - (t :block/practice)) - [:div (t :block/practice-cards)])]) + (ui/tooltip + (shui/button + {:variant :ghost + :size :sm + :class "!px-1 text-xs text-muted-foreground" + :on-click (fn [e] + (util/stop e) + (state/pub-event! [:modal/show-cards (:db/id block)]))} + (t :block/practice)) + [:div (t :block/practice-cards)])) (when-let [property (:logseq.property/created-from-property block)] (when-let [message (when (= :url (:logseq.property/type property)) (first (outliner-property/validate-property-value (db/get-db) property (:db/id block))))] @@ -2490,13 +2499,13 @@ (ui/icon "alert-triangle")) [:div.opacity-75 message])))])) -(rum/defc block-title < rum/reactive db-mixins/query +(hsx/defc block-title [config block {:keys [*show-query?]}] (let [block' (db/entity (:db/id block)) - node-display-type (:logseq.property.node/display-type block') - display-title (:display-title config) - db (db/get-db) - query? (ldb/class-instance? (entity-plus/entity-memoized db :logseq.class/Query) block')] + node-display-type (:logseq.property.node/display-type block') + display-title (:display-title config) + db (db/get-db) + query? (ldb/class-instance? (entity-plus/entity-memoized db :logseq.class/Query) block')] (cond (and (:page-title? config) (ldb/page? block) (string/blank? (:block/title block))) [:div.opacity-75 (t :ui/untitled)] @@ -2530,22 +2539,21 @@ (block-title-aux config block {:query? query? :*show-query? *show-query?})))) -(rum/defcs db-properties-cp < rum/static - {:init (fn [state] - (let [container-id (or (:container-id (first (:rum/args state))) - (state/get-next-container-id))] - (assoc state ::initial-container-id container-id)))} - [state config block opts] - (property-component/properties-area block - (merge - config - {:inline-text inline-text - :page-cp page-cp - :block-cp blocks-container - :editor-box (state/get-component :editor/box) - :container-id (or (:container-id config) - (::initial-container-id state))} - opts))) +(hsx/defc db-properties-cp + [config block opts] + (let [initial-container-id (hooks/use-memo #(or (:container-id config) + (state/get-next-container-id)) + [(:container-id config)])] + (property-component/properties-area block + (merge + config + {:inline-text inline-text + :page-cp page-cp + :block-cp blocks-container + :editor-box (state/get-component :editor/box) + :container-id (or (:container-id config) + initial-container-id)} + opts)))) (defn- target-forbidden-edit? [target] @@ -2638,6 +2646,9 @@ (mobile-util/mobile-focus-hidden-input) (editor-handler/clear-selection!) (editor-handler/unhighlight-blocks!) + (when-let [editing-block (state/get-edit-block)] + (when-not (= (:block/uuid editing-block) (:block/uuid block)) + (editor-handler/save-current-block!))) (p/do! (state/pub-event! [:editor/save-code-editor]) @@ -2659,11 +2670,11 @@ (state/set-selection-start-block! block-dom-element))))))))))) -(rum/defc dnd-separator-wrapper < rum/reactive +(hsx/defc dnd-separator-wrapper [_block block-id top?] - (let [dragging? (rum/react *dragging?) - drag-to-block (rum/react *drag-to-block) - move-to (rum/react *move-to)] + (let [[dragging?] (hooks/use-atom *dragging?) + [drag-to-block] (hooks/use-atom *drag-to-block) + [move-to] (hooks/use-atom *move-to)] (when (and dragging? (= block-id drag-to-block) @@ -2696,20 +2707,20 @@ config (if deprecated-org-quote? (assoc config :deprecated-org-quote? true) config)] (for [[idx child] (medley/indexed body)] (when-let [block (markup-element-cp config child)] - (rum/with-key (block-child block) - (str uuid "-" idx)))))]))))) - -(rum/defcs block-tag < - (rum/local false ::hover?) - (rum/local false ::hover-container?) - [state block tag config popup-opts] - (let [*hover? (::hover? state) - *hover-container? (::hover-container? state) + ^{:key (str uuid "-" idx)} + [block-child block])))]))))) + +(hsx/defc block-tag + [block tag config popup-opts] + (let [*hover? (hooks/use-memo #(atom false) []) + *hover-container? (hooks/use-memo #(atom false) []) + [hover?] (hooks/use-atom *hover?) + [_hover-container?] (hooks/use-atom *hover-container?) private-tag? (ldb/private-tags (:db/ident tag))] [:div.block-tag {:key (str "tag-" (:db/id tag)) :class (str (when private-tag? "private-tag ") - (when @*hover? + (when hover? (if private-tag? "!px-1" "!pl-0"))) :on-mouse-over #(reset! *hover-container? true) :on-mouse-out #(reset! *hover-container? false)} @@ -2743,7 +2754,7 @@ :on-click #(db-property-handler/delete-property-value! (:db/id block) :block/tags (:db/id tag))} (t :block/remove-tag)))]) popup-opts))} - (if (and @*hover? (not private-tag?) (not config/publishing?)) + (if (and hover? (not private-tag?) (not config/publishing?)) [:a.inline-flex.text-muted-foreground {:title (t :block/remove-this-tag) :style {:margin-top 1 @@ -2762,7 +2773,7 @@ :hide-tag-symbol? true) tag)])])) -(rum/defc tags-cp +(hsx/defc tags-cp "Tags without inline or hidden tags" [config block] (when (:block/raw-title block) @@ -2782,11 +2793,10 @@ tags-count (count block-tags)] (when (seq block-tags) (if (< tags-count 3) - [:div.block-tags.gap-1 + [:div.block-tags.gap-1 (for [tag block-tags] - (rum/with-key - (block-tag block tag config popup-opts) - (str "tag-" (:db/id tag))))] + ^{:key (str "tag-" (:db/id tag))} + [block-tag block tag config popup-opts])] [:div.block-tags.cursor-pointer {:on-pointer-down (fn [e] (shui/popup-show! e @@ -2815,7 +2825,7 @@ [:div.text-sm.opacity-50.ml-1 (str "+" (- tags-count 2))]]))))) -(rum/defc block-positioned-properties +(hsx/defc block-positioned-properties [config block position] (let [properties (outliner-property/get-block-positioned-properties (db/get-db) (:db/id block) position) opts (merge config @@ -2841,22 +2851,22 @@ [:div.positioned-properties.flex.flex-row.gap-1.select-none.h-6.self-start {:class (name position)} (for [property properties] - (rum/with-key - (pv/property-value block property (assoc opts :show-tooltip? true)) - (str (:db/id block) "-" (:db/id property))))])))) + ^{:key (str (:db/id block) "-" (:db/id property))} + [:<> (pv/property-value block property (assoc opts :show-tooltip? true))])])))) -(rum/defc block-reactions < rum/reactive db-mixins/query +(hsx/defc block-reactions [block] (let [repo (state/get-current-repo) target-id (:db/id block) - reactions-ref (react/q repo [:frontend.worker.react/block-reactions target-id] - {} - '[:find (pull ?r [*]) - :in $ ?target - :where - [?r :logseq.property.reaction/target ?target]] - target-id) - reactions (->> (or (util/react reactions-ref) []) + reactions-result (db-hooks/use-query + (react/q repo [:frontend.worker.react/block-reactions target-id] + {} + '[:find (pull ?r [*]) + :in $ ?target + :where + [?r :logseq.property.reaction/target ?target]] + target-id)) + reactions (->> (or reactions-result []) (map first)) user-db-id (when-let [id-str (user-handler/user-uuid)] (when-let [user-id (uuid id-str)] @@ -2910,11 +2920,11 @@ :on-click open-picker! :on-pointer-down (fn [e] (util/stop e))} - (ui/icon "plus" {:size 14})))]))) + (ui/icon "plus" {:size 14})))]))) -(rum/defc status-history-cp +(hsx/defc status-history-cp [status-history] - (let [[sort-desc? set-sort-desc!] (rum/use-state true)] + (let [[sort-desc? set-sort-desc!] (hooks/use-state true)] [:div.p-2.text-muted-foreground.text-sm.max-h-96 [:div.font-medium.mb-2.flex.flex-row.gap-2.items-center [:div (t :block/status-history)] @@ -2932,10 +2942,10 @@ [:div (:block/title status)]] [:div (date/int->local-time-2 (:block/created-at item))]]))]])) -(rum/defc task-spent-time-cp +(hsx/defc task-spent-time-cp [block] (when (ldb/class-instance? (db/entity :logseq.class/Task) block) - (let [[result set-result!] (rum/use-state nil) + (let [[result set-result!] (hooks/use-state nil) repo (state/get-current-repo) [status-history time-spent] result] (hooks/use-effect! @@ -2968,7 +2978,7 @@ (= value (get block attr)))) vec)) -(rum/defc sync-conflict-item +(hsx/defc sync-conflict-item [{:keys [id attr value created-at]}] [:div.border.rounded.p-3 {:key id} [:div.flex.flex-row.items-center.justify-between.gap-3.mb-2.text-xs.text-muted-foreground @@ -2984,7 +2994,7 @@ (notification/show! (t :notification/copied) :success))} (t :ui/copy))]]) -(rum/defc sync-conflicts-popup +(hsx/defc sync-conflicts-popup [conflicts on-mark-resolved] [:div.p-3.w-96 {:style {:max-width "90vw"}} @@ -3006,7 +3016,7 @@ (map #(get-in % path)) (dedupe))))) -(rum/defc sync-conflicts-warning-button +(hsx/defc sync-conflicts-warning-button [block] (let [repo (state/get-current-repo) block-id (:block/uuid block) @@ -3044,7 +3054,7 @@ (ui/icon "alert-triangle" {:size 14})) [:div (t :sync/show-conflicts)])))) -(rum/defc ^:large-vars/cleanup-todo block-content < rum/reactive +(hsx/defc ^:large-vars/cleanup-todo block-content [config {:block/keys [uuid] :as block} edit-input-id block-id *show-query?] (let [repo (state/get-current-repo) format :markdown @@ -3125,7 +3135,7 @@ (block-content-inner config block ast-body plugin-slotted? collapsed? block-ref-with-title?)]])) -(rum/defc block-refs-count < rum/static +(hsx/defc block-refs-count [block block-refs-count' *hide-block-refs?] (when (> block-refs-count' 0) [:div.h-6 @@ -3152,7 +3162,7 @@ (state/set-editing! edit-input-id content block content {:db (db/get-db) :container-id (:container-id config)}))) -(rum/defc block-content-with-error +(hsx/defc block-content-with-error [config block edit-input-id block-id *show-query? editor-box custom-block-content] (let [[editing? set-editing!] (hooks/use-state false) query (:logseq.property/query block)] @@ -3178,8 +3188,8 @@ {:on-click #(edit-block-content config block edit-input-id)}})]) (or custom-block-content (block-content config block edit-input-id block-id *show-query?))))) -(rum/defcs ^:large-vars/cleanup-todo block-content-or-editor < rum/reactive - [state config {:block/keys [uuid] :as block} {:keys [edit-input-id block-id edit? hide-block-refs-count? refs-count *hide-block-refs? *show-query?]}] +(hsx/defc ^:large-vars/cleanup-todo block-content-or-editor + [config {:block/keys [uuid] :as block} {:keys [edit-input-id block-id edit? hide-block-refs-count? refs-count *hide-block-refs? *show-query?]}] (let [format :markdown editor-box (state/get-component :editor/box) editor-id (str "editor-" edit-input-id) @@ -3189,7 +3199,7 @@ block-ref/block-ref?) named? (some? (:block/name block)) table? (:table? config) - raw-mode-block (state/sub :editor/raw-mode-block) + raw-mode-block (state/use-sub :editor/raw-mode-block) type-block-editor? (and (contains? #{:code} (:logseq.property.node/display-type block)) (not= (:db/id block) (:db/id raw-mode-block))) config (assoc config :block-parent-id block-id) @@ -3318,7 +3328,7 @@ (-> (or (:on-redirect-to-page config) route-handler/redirect-to-page!) (apply [(str uuid)]))))) -(rum/defc breadcrumb-fragment +(hsx/defc breadcrumb-fragment [config block label opts] [:a {:on-pointer-down (fn [e] (when (some? (:sidebar-key config)) (util/stop e))) @@ -3326,12 +3336,12 @@ (handle-breadcrumb-activate! config block opts e))} label]) -(rum/defc breadcrumb-separator +(hsx/defc breadcrumb-separator [] [:span.opacity-50.px-1 "/"]) -(rum/defc breadcrumb-segment-label +(hsx/defc breadcrumb-segment-label "Renders the visual label (icon + text) for a breadcrumb segment. Icon priority: 1. code/query/note/quote/math → always show their fixed structural icon @@ -3428,7 +3438,7 @@ (when (seq ref-ids) (db-async/