mirror of
https://github.com/penpot/penpot-plugins.git
synced 2025-01-04 13:50:13 -05:00
feat(docs): add examples for new permissions
This commit is contained in:
parent
5adbee2b23
commit
2f0f7a601c
3 changed files with 14 additions and 7 deletions
|
@ -27,11 +27,11 @@ Next, create a `manifest.json` file inside the `/src/assets` directory. This fil
|
|||
"code": "/assets/plugin.js",
|
||||
"icon": "/assets/icon.png",
|
||||
"permissions": [
|
||||
"content:read",
|
||||
"content:write",
|
||||
"library:read",
|
||||
"library:write",
|
||||
"user:read"
|
||||
"user:read",
|
||||
"comment:read",
|
||||
"allow:downloads"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
|
@ -31,11 +31,11 @@ Next, create a `manifest.json` file inside the `/public` directory. This file is
|
|||
"code": "/plugin.js",
|
||||
"icon": "/icon.png",
|
||||
"permissions": [
|
||||
"content:read",
|
||||
"content:write",
|
||||
"library:read",
|
||||
"library:write",
|
||||
"user:read"
|
||||
"user:read",
|
||||
"comment:read",
|
||||
"allow:downloads"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
|
9
libs/plugin-types/index.d.ts
vendored
9
libs/plugin-types/index.d.ts
vendored
|
@ -497,6 +497,7 @@ export interface Comment {
|
|||
|
||||
/**
|
||||
* Remove the current comment from its comment thread. Only the owner can remove their comments.
|
||||
* Requires the `comment:write` permission.
|
||||
*/
|
||||
remove(): void;
|
||||
}
|
||||
|
@ -535,18 +536,21 @@ export interface CommentThread {
|
|||
|
||||
/**
|
||||
* List of `comments` ordered by creation date.
|
||||
* Requires the `comment:read` o `comment:write` permission.
|
||||
*/
|
||||
findComments(): Promise<Comment[]>;
|
||||
|
||||
/**
|
||||
* Creates a new comment after the last one in the thread. The current user will
|
||||
* be used as the creation user.
|
||||
* Requires the `comment:write` permission.
|
||||
*/
|
||||
reply(content: string): Promise<Comment>;
|
||||
|
||||
/**
|
||||
* Removes the current comment thread. Only the user that created the thread can
|
||||
* remove it.
|
||||
* Requires the `comment:write` permission.
|
||||
*/
|
||||
remove(): void;
|
||||
}
|
||||
|
@ -2840,11 +2844,13 @@ export interface Page extends PluginData {
|
|||
* Creates a new comment thread in the `position`. Optionaly adds
|
||||
* it into the `board`.
|
||||
* Returns the thread created.
|
||||
* Requires the `comment:write` permission.
|
||||
*/
|
||||
addCommentThread(content: string, position: Point): Promise<CommentThread>;
|
||||
|
||||
/**
|
||||
* Removes the comment thread.
|
||||
* Requires the `comment:read` or `comment:write` permission.
|
||||
*/
|
||||
removeCommentThread(commentThread: CommentThread): Promise<void>;
|
||||
|
||||
|
@ -2854,8 +2860,9 @@ export interface Page extends PluginData {
|
|||
* user has engaged.
|
||||
* - `showResolved`: by default resolved comments will be hidden. If `true`
|
||||
* the resolved will be returned.
|
||||
* Requires the `comment:read` or `comment:write` permission.
|
||||
*/
|
||||
findCommentThreads(criteria: {
|
||||
findCommentThreads(criteria?: {
|
||||
onlyYours: boolean;
|
||||
showResolved: boolean;
|
||||
}): Promise<CommentThread[]>;
|
||||
|
|
Loading…
Reference in a new issue