mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 14:14:55 +00:00
enhance(apis): rename tag functions to block tag for clarity and update version
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@logseq/libs",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"description": "Logseq SDK libraries",
|
||||
"main": "dist/lsplugin.user.js",
|
||||
"typings": "index.d.ts",
|
||||
|
||||
@@ -781,8 +781,8 @@ export interface IEditorProxy extends Record<string, any> {
|
||||
getAllProperties: () => Promise<PageEntity[] | null>
|
||||
getTagObjects: (PageIdentity) => Promise<BlockEntity[] | null>
|
||||
createTag: (tagName: string) => Promise<PageEntity | null>
|
||||
addTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
|
||||
removeTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
|
||||
addBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
|
||||
removeBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
|
||||
|
||||
prependBlockInPage: (
|
||||
page: PageIdentity,
|
||||
|
||||
@@ -201,8 +201,8 @@
|
||||
(def ^:export get_all_properties db-based-api/get-all-properties)
|
||||
(def ^:export get_tag_objects db-based-api/get-tag-objects)
|
||||
(def ^:export create_tag db-based-api/create-tag)
|
||||
(def ^:export add_tag db-based-api/add-tag)
|
||||
(def ^:export remove_tag db-based-api/remove-tag)
|
||||
(def ^:export add_block_tag db-based-api/add-block-tag)
|
||||
(def ^:export remove_block_tag db-based-api/remove-block-tag)
|
||||
|
||||
;; Internal db-based CLI APIs
|
||||
(def ^:export list_tags cli-based-api/list-tags)
|
||||
|
||||
@@ -202,14 +202,14 @@
|
||||
(when tag
|
||||
(sdk-utils/result->js tag))))
|
||||
|
||||
(defn add-tag [id-or-name tag-id]
|
||||
(defn add-block-tag [id-or-name tag-id]
|
||||
(p/let [repo (state/get-current-repo)
|
||||
tag (db-async/<get-block repo tag-id)
|
||||
block (db-async/<get-block repo id-or-name)]
|
||||
(when (and tag block)
|
||||
(db-page-handler/add-tag repo (:db/id block) tag))))
|
||||
|
||||
(defn remove-tag [id-or-name tag-id]
|
||||
(defn remove-block-tag [id-or-name tag-id]
|
||||
(p/let [repo (state/get-current-repo)
|
||||
block (db-async/<get-block repo id-or-name)
|
||||
tag (db-async/<get-block repo tag-id)]
|
||||
|
||||
Reference in New Issue
Block a user