diff --git a/libs/package.json b/libs/package.json index e21f0582d2..4feec63620 100644 --- a/libs/package.json +++ b/libs/package.json @@ -1,6 +1,6 @@ { "name": "@logseq/libs", - "version": "0.2.5", + "version": "0.2.6", "description": "Logseq SDK libraries", "main": "dist/lsplugin.user.js", "typings": "index.d.ts", diff --git a/libs/src/LSPlugin.ts b/libs/src/LSPlugin.ts index a1bc78faa5..0eb51c9d0f 100644 --- a/libs/src/LSPlugin.ts +++ b/libs/src/LSPlugin.ts @@ -781,6 +781,12 @@ export interface IEditorProxy extends Record { getAllProperties: () => Promise getTagObjects: (PageIdentity) => Promise createTag: (tagName: string) => Promise + addTagClassProperty: (tagId: BlockIdentity, propertyIdOrName: BlockIdentity, + opts?: Partial<{ + type: stirng + [key: string]: any + }>) => Promise + removeTagClassProperty: (tagId: BlockIdentity, propertyIdOrName: BlockIdentity) => Promise addBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise removeBlockTag: (blockId: BlockIdentity, tagId: BlockIdentity) => Promise diff --git a/src/main/logseq/api/db_based.cljs b/src/main/logseq/api/db_based.cljs index 54553731d9..88829606ef 100644 --- a/src/main/logseq/api/db_based.cljs +++ b/src/main/logseq/api/db_based.cljs @@ -204,7 +204,7 @@ (when tag (sdk-utils/result->js tag)))) -(defn upsert-property-to-tag [tag-id property-id-or-name & {:keys [schema]}] +(defn add-tag-class-property [tag-id property-id-or-name & {:keys [schema]}] (p/let [repo (state/get-current-repo) tag-entity (db-async/ tag-entity (ldb/class?)) @@ -236,6 +236,9 @@ (sdk-utils/result->js property') ))) +(defn remove-tag-class-property [tag-id property-id-or-name] + (throw (ex-info "TODO: implement remove-tag-class-property" {tag-id property-id-or-name}))) + (defn add-block-tag [id-or-name tag-id] (p/let [repo (state/get-current-repo) tag (db-async/