mirror of
https://github.com/logseq/logseq.git
synced 2026-04-24 14:14:55 +00:00
improve(plugin): api to create block uuid
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@logseq/libs",
|
||||
"version": "0.0.7",
|
||||
"version": "0.0.8",
|
||||
"description": "Logseq SDK libraries",
|
||||
"main": "dist/lsplugin.user.js",
|
||||
"typings": "index.d.ts",
|
||||
|
||||
@@ -551,6 +551,12 @@ export interface IEditorProxy extends Record<string, any> {
|
||||
namespace: BlockPageName
|
||||
) => Promise<Array<PageEntity> | null>
|
||||
|
||||
/**
|
||||
* Create an uuid string for specific block id(uuid)
|
||||
* @added 0.0.8
|
||||
*/
|
||||
newBlockUUID: () => Promise<string>
|
||||
|
||||
/**
|
||||
* @example https://github.com/logseq/logseq-plugin-samples/tree/master/logseq-reddit-hot-news
|
||||
*
|
||||
|
||||
@@ -189,6 +189,10 @@ const app: Partial<IAppProxy> = {
|
||||
let registeredCmdUid = 0
|
||||
|
||||
const editor: Partial<IEditorProxy> = {
|
||||
newBlockUUID(this: LSPluginUser): Promise<string> {
|
||||
return this._execCallableAPIAsync('new_block_uuid')
|
||||
},
|
||||
|
||||
registerSlashCommand(
|
||||
this: LSPluginUser,
|
||||
tag: string,
|
||||
@@ -273,7 +277,7 @@ const editor: Partial<IEditorProxy> = {
|
||||
} else {
|
||||
this.App.pushState('page', { name: pageName }, { anchor })
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
const db: Partial<IDBProxy> = {
|
||||
|
||||
Reference in New Issue
Block a user