Skip to content

Commit e5903e1

Browse files
committed
enhance(apis): add tag related apis
1 parent 5593b9b commit e5903e1

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

libs/src/LSPlugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,8 +785,12 @@ export interface IEditorProxy extends Record<string, any> {
785785
getTag: (nameOrIdent: string) => Promise<PageEntity | null>
786786
addTagProperty: (tagId: BlockIdentity, propertyIdOrName: BlockIdentity) => Promise<void>
787787
removeTagProperty: (tagId: BlockIdentity, propertyIdOrName: BlockIdentity) => Promise<void>
788+
addTagExtends: (tagId: BlockIdentity, parentTagIdOrName: BlockIdentity) => Promise<void>
789+
removeTagExtends: (tagId: BlockIdentity, parentTagIdOrName: BlockIdentity) => Promise<void>
788790
addBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
789791
removeBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise<void>
792+
setBlockIcon: (blockId: BlockIdentity, iconType: 'tabler-icon' | 'emoji', iconName: string) => Promise<void>
793+
removeBlockIcon: (blockId: BlockIdentity) => Promise<void>
790794

791795
prependBlockInPage: (
792796
page: PageIdentity,

src/main/logseq/api/db_based.cljs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@
233233
{:tag tag}))))
234234

235235
(defn add-tag-extends [tag-id extend-id]
236-
(let [tag (db-async/<get-block (state/get-current-repo) tag-id)
237-
extend (db-async/<get-block (state/get-current-repo) extend-id)]
236+
(p/let [tag (db-async/<get-block (state/get-current-repo) tag-id)
237+
extend (db-async/<get-block (state/get-current-repo) extend-id)]
238238
(throw-error-if-not-tag! tag tag-id)
239239
(throw-error-if-not-tag! extend extend-id)
240240
(when (ldb/built-in? tag)
@@ -244,8 +244,8 @@
244244
(:db/id extend))))
245245

246246
(defn remove-tag-extends [tag-id extend-id]
247-
(let [tag (db-async/<get-block (state/get-current-repo) tag-id)
248-
extend (db-async/<get-block (state/get-current-repo) extend-id)]
247+
(p/let [tag (db-async/<get-block (state/get-current-repo) tag-id)
248+
extend (db-async/<get-block (state/get-current-repo) extend-id)]
249249
(throw-error-if-not-tag! tag tag-id)
250250
(throw-error-if-not-tag! extend extend-id)
251251
(when (ldb/built-in? tag)

0 commit comments

Comments
 (0)