Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/more ns plugin api #4828

Merged
merged 127 commits into from Apr 21, 2022
Merged

Enhance/more ns plugin api #4828

merged 127 commits into from Apr 21, 2022

Conversation

xyhp915
Copy link
Collaborator

@xyhp915 xyhp915 commented Apr 6, 2022

Added NS entries

  • entry of git related apis - logseq.Git

    • execCommand: (args: string[]) => Promise<IGitResult>
    • loadIgnoreFile: () => Promise<string>
    • saveIgnoreFile: (content: string) => Promise<void>
  • entry of ui related apis - logseq.UI

    • showMsg: ( content: string, status?: 'success' | 'warning' | 'error' | string, opts?: Partial<UIMsgOptions> ) => Promise<UIMsgKey>
    • closeMsg: (key: UIMsgKey) => void
  • entry of assets releated apis - logseq.Assets

    • listFilesOfCurrentGraph(exts: string | string[]): Promise<{ path: string, size: number, accessTime: number, modifiedTime: number, changeTime: number, birthTime: number }>
  • entry of experiment related apis - logseq.Experiments

Added apis

  • Hook all transaction data of DB
logseq.DB.onChanged: IUserHook<{
    blocks: Array<BlockEntity>
    txData: Array<IDatom>
    txMeta?: { outlinerOp: string; [key: string]: any }
  }>
  • Subscribe a specific block changed event
logseq.DB.onBlockChanged(
  uuid: BlockUUID,
  callback: (
    block: BlockEntity,
    txData: Array<IDatom>,
    txMeta?: { outlinerOp: string; [key: string]: any }) => void
): IUserOffHook

Improvements & Fixes

  • Using subscribe strategy instead of broadcast for plugin hooks. ( Performance related)
  • Updated new version of 0.0.2 but it's back compatible for old SDK. ( Upgrade is recommended to developer)
  • api of setBlockCollapsed not work. [[ref link]]
  • sometimes disable plugin not work.
  • illegal return value of moveBlock
  • slash command list not updated for initial resgistration of plugin api
  • more friendly tips for marketplace network issues
  • input ux of settings UI

# Conflicts:
#	src/main/frontend/components/plugins.cljs
#	src/main/frontend/components/settings.cljs
@xyhp915 xyhp915 changed the title WIP: Enhance/more ns plugin api Enhance/more ns plugin api Apr 15, 2022
Copy link
Collaborator

@andelf andelf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tiensonqin tiensonqin merged commit 79bc33e into master Apr 21, 2022
@tiensonqin tiensonqin deleted the enhance/more-ns-plugin-api branch April 21, 2022 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:type/enhancement Enhancement to product. Does not affect the overall basic use.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants