Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
huchenlei committed Sep 26, 2024
1 parent 6927df8 commit ed5c521
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 20 deletions.
49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,33 +137,21 @@ https://github.com/user-attachments/assets/c142c43f-2fe9-4030-8196-b3bfd4c6977d
</details>

### Node developers API

<details>
<summary>v1.2.4: Extension API to register custom sidebar tab</summary>
<summary>v1.3.1: Extension API to register custom topbar menu items</summary>

Extensions now can call the following API to register a sidebar tab.
Extensions can call the following API to register custom topbar menu items.

```js
app.extensionManager.registerSidebarTab({
id: "search",
icon: "pi pi-search",
title: "search",
tooltip: "search",
type: "custom",
render: (el) => {
el.innerHTML = "<div>Custom search tab</div>";
},
});
app.extensionManager.menu.registerTopbarCommands(["ext", "ext2"], [{id:"foo", label: "foo", function: () => alert(1)}])
```

The list of supported icons can be found here: <https://primevue.org/icons/#list>

We will support custom icons later.

![image](https://github.com/user-attachments/assets/7bff028a-bf91-4cab-bf97-55c243b3f5e0)
![image](https://github.com/user-attachments/assets/ae7b082f-7ce9-4549-a446-4563567102fe)
</details>

<details>
<summary>v1.2.27: Extension API to add toast message</summary>
<summary>v1.2.27: Extension API to add toast message</summary>i

Extensions can call the following API to add toast messages.

Expand All @@ -180,6 +168,31 @@ Documentation of all supported options can be found here: <https://primevue.org/
![image](https://github.com/user-attachments/assets/de02cd7e-cd81-43d1-a0b0-bccef92ff487)
</details>

<details>
<summary>v1.2.4: Extension API to register custom sidebar tab</summary>

Extensions now can call the following API to register a sidebar tab.

```js
app.extensionManager.registerSidebarTab({
id: "search",
icon: "pi pi-search",
title: "search",
tooltip: "search",
type: "custom",
render: (el) => {
el.innerHTML = "<div>Custom search tab</div>";
},
});
```

The list of supported icons can be found here: <https://primevue.org/icons/#list>

We will support custom icons later.

![image](https://github.com/user-attachments/assets/7bff028a-bf91-4cab-bf97-55c243b3f5e0)
</details>

## Road Map

### What has been done
Expand Down
3 changes: 1 addition & 2 deletions src/stores/workspaceStateStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export const useWorkspaceStore = defineStore('workspace', {
},
menu() {
return {
registerMenuGroup: useMenuItemStore().registerMenuGroup,
registerCommands: useMenuItemStore().registerCommands
registerTopbarCommands: useMenuItemStore().registerCommands
}
}
},
Expand Down

0 comments on commit ed5c521

Please sign in to comment.