@pptx-editor. dev/ pro/ react
@pptx-editor.dev/pro/react: the comments pane and the review hooks for the React adapter, and the review module, so a host imports one path, as DOCX Editor's @docx-editor.dev/pro/react. @pptx-editor.dev/core and @pptx-editor.dev/react stay peers, so one engine instance loads.
Functions (5)
reviewModulefunctionSource ↗
The review module. Register it with createPptxEditor({ modules: [reviewModule()] }): the editor snapshot then reports the current slide's comment threads (comments), the slide shows a marker for each thread, and collectReviewItems reads every comment of the deck. Render PptxEditorReview from @pptx-editor.dev/pro/react or /vue for the comments pane.
declare function reviewModule(options?: ReviewModuleOptions): EditorModule;useReviewfunctionSource ↗
Read the comments of the current slide and act on them, in the editor root. For headless or server work, use the comment commands of @pptx-editor.dev/core or @pptx-editor.dev/editor-api.
declare function useReview(): UseReviewReturn;useReviewAuthorfunctionSource ↗
The look of one comment author, from the editor's review roster (getReviewAuthors): the slot and the CSS color of the thread's marker, band, ring, and card, or undefined without an author or for an author the roster does not hold. A custom card draws with it, so it keeps the colors of the rest of the review chrome.
declare function useReviewAuthor(author: string | undefined): ReviewAuthorInfo | undefined;useReviewItemfunctionSource ↗
The comment that the surrounding card (or reply) renders, or null outside one. A host's own card content reads its item here, as the packaged parts do.
declare function useReviewItem(): ReviewItemView | null;useReviewOffunctionSource ↗
useReview over an explicit editor, for a host that holds its own.
declare function useReviewOf(editor: PptxEditorInstance | null): UseReviewReturn;Interfaces (12)
PptxEditorReviewNamespaceinterfaceSource ↗
The comments pane compound.
interface PptxEditorReviewNamespace| Member | Type | Summary |
|---|---|---|
| (member-0) | | |
| AddComment | typeof ReviewAddComment | The **New comment** button. A root part. |
| Anchor | typeof ReviewAnchor | The element that the thread points at. |
| Author | typeof ReviewAuthor | |
| Avatar | typeof ReviewAvatar | |
| Card | typeof ReviewCard | |
| Delete | typeof ReviewDelete | |
| Draft | typeof ReviewDraft | The compose box of a new comment, while a draft is open. A root part. |
| Edit | typeof ReviewEdit | |
| Empty | typeof ReviewEmpty | |
| List | typeof ReviewList | The list of the slide's threads. A root part. |
| Reopen | typeof ReviewReopen | |
| Replies | typeof ReviewReplies | |
| Reply | typeof ReviewReply | The reply line of the picked thread. |
| Resolve | typeof ReviewResolve | |
| Summary | typeof ReviewSummary | |
| Time | typeof ReviewTime |
ProLicenseOptionsinterfaceSource ↗
Accepted by every pro entry point.
interface ProLicenseOptions| Member | Type | Summary |
|---|---|---|
| licenseKey? | string | Your license key. Optional: evaluation use is permitted, production use requires a commercial agreement under the EigenPal Pro License (see LICENSE.md). |
ReviewActionPropsinterfaceSource ↗
Props of the action parts, which also take an icon.
interface ReviewActionProps extends ReviewPartProps| Member | Type | Summary |
|---|---|---|
| icon? | ReactNode | The icon. Default: the part's Material Symbol; `children` also replace it. |
ReviewActivationOptionsinterfaceSource ↗
Options of UseReviewReturn.setActive.
interface ReviewActivationOptions| Member | Type | Summary |
|---|---|---|
| announce? | boolean | Also ask for the **Comments** tab of the side panel (`requestPane`), as a press on the thread's marker does. Default `false`. |
| identity? | string | The `identity` of the thread as your view shows it. The pick is refused when the thread under `key` has another identity: the view is older than the snapshot. |
ReviewCommentTargetinterfaceSource ↗
The element that a new comment points at: the one selected element of the slide's top level. Null when the comment points at the slide.
interface ReviewCommentTarget| Member | Type | Summary |
|---|---|---|
| name | string | |
| nodeId | string | |
| range? | CommentTextRange | The selected text of the element, when the comment points at a range of its text. |
ReviewDraftPropsinterfaceSource ↗
Props of PptxEditorReview.Draft, the compose box of a new comment.
interface ReviewDraftProps extends ReviewPartProps| Member | Type | Summary |
|---|---|---|
| nodeId? | string | The element that the new comment points at. Default: the selected element, else the slide. |
ReviewItemViewinterfaceSource ↗
One comment or reply of the current slide, as the review hooks and parts read it. A thread's replies follow it in UseReviewReturn.items, and the thread names them in replyIds. Text and names come from the file: render them as text, never as markup.
interface ReviewItemView| Member | Type | Summary |
|---|---|---|
| anchor | CommentAnchor | Where the thread points on the slide. A reply reports its thread's anchor. |
| anchorName? | string | The name of the element the thread points at, or absent for the slide or a place. |
| author | string | The author's display name, or an empty string when the file names none. |
| date? | string | The date as the file stores it (ISO 8601), or absent. |
| editable | boolean | Whether `edit` can replace the text. False for content that the editor cannot write back. |
| format | CommentFormat | The file format of the thread. |
| id | string | The comment id, as the comment commands take it. Equal to `key`. |
| identity | string | The comment's `identity` (`SlideComment.identity` says what keeps it), which can stay where `id` changes. The pane keys its cards, its open fields, and the selected thread by it. The actions send the item's author, date, and text as the command's `expect`. |
| initials | string | The avatar text: the file's initials, else the first letters of the author's name. |
| isActive | boolean | Whether the thread is the picked one (`activeKey`). A reply reports its thread's state. |
| key | string | The key the actions take: the comment id. |
| kind | 'comment' | Always `comment`: PresentationML has no tracked-change markup. |
| parent? | CommentExpect | For a reply, what the item list showed of its thread: the author, date, text, and identity. The thread actions on a reply item (`reply`, `resolve`, `reopen`) send it as `expect`, so they refuse a thread that is no longer the one shown. Absent on a thread. |
| parentId? | string | For a reply, the id of its thread; absent on a thread. |
| replyIds | readonly string[] | For a thread, the ids of its replies, oldest first; empty on a reply. |
| resolvable | boolean | Whether `resolve` and `reopen` apply. False for the legacy format, which has no state. |
| resolved | boolean | Whether the thread is resolved. A reply reports its thread's state. |
| text | string | The text, with one line feed between paragraphs. |
ReviewListPropsinterfaceSource ↗
Props of PptxEditorReview.List.
interface ReviewListProps extends Omit<ReviewPartProps, 'children' | 'asChild'>| Member | Type | Summary |
|---|---|---|
| children? | ReactNode | ((item: ReviewItemView) => ReactNode) | The card template (a `Card`, or parts that replace the packaged ones), or a render callback. |
ReviewModuleOptionsinterfaceSource ↗
Options of reviewModule.
interface ReviewModuleOptions extends ProLicenseOptions| Member | Type | Summary |
|---|---|---|
| displayModes? | readonly ReviewDisplayMode[] | Display modes to unlock. Default: `final` and `markup`. |
| pane? | ReviewPaneOptions | The comment view settings, as DOCX Editor's `pane` option: `commentMarkers` (`'icon'`, the default, or `'initials'`) sets how a comment marker on the slide looks, and `opening` (`'auto'`, the default, or `'manual'`) sets whether a press on a marker asks for the **Comments** tab of the side panel. An unknown field or value throws a `TypeError`. |
ReviewPartPropsinterfaceSource ↗
Shared props of every part.
interface ReviewPartProps| Member | Type | Summary |
|---|---|---|
| asChild? | boolean | Merge the part's wiring onto its single child element instead of the default element. |
| children? | ReactNode | |
| className? | string | A class name added to the part's element. |
ReviewPropsinterfaceSource ↗
Props of PptxEditorReview.
interface ReviewProps extends Omit<ReviewPartProps, 'children' | 'asChild'>| Member | Type | Summary |
|---|---|---|
| card? | {
className?: string;
} | A class name for each card. `className` styles the pane; this styles the cards in it. |
| children? | ReactNode | ((item: ReviewItemView) => ReactNode) | The parts of the pane and of its cards. Root parts (`List`, `AddComment`, `Draft`) put as direct children replace the packaged ones. Other children become the card template of the list. A function is the list's render callback, with one call for each thread. |
| filter? | (item: ReviewItemView) => boolean | Show only some threads, for example the open ones. Replies follow their thread. |
| preset? | boolean | Render the packaged arrangement: the **New comment** button, the compose box, and the list. `false` renders only the root parts you pass, with the pane's data and context. |
| t? | ReviewTranslate | Label resolver, as the toolbar and menus take one. A key it does not resolve falls back to the bundled catalog. Placeholders such as `{author}` are filled in. |
UseReviewReturninterfaceSource ↗
What useReview returns: the comments of the current slide and the things a card can do. Every action reports whether the editor applied it. A refused action changes nothing, and the editor publishes its reason (lastRejection), which the edit notice shows.
interface UseReviewReturn| Member | Type | Summary |
|---|---|---|
| activeKey | string | null | The key of the picked thread (a marker press, `setActive`), or null. |
| author | string | null | The name that signs a new comment or reply, or null. Without one, `comment` is refused. |
| comment | (text: string, author?: string, target?: {
readonly nodeId: string;
readonly range?: CommentTextRange;
}) => boolean | Add a thread on the current slide. It points at `target.range` of the text of `target.nodeId`, at `target.nodeId`, else at the selected text or element (`commentTarget`), else at the slide. `author` overrides `author` for this comment. |
| commentTarget | ReviewCommentTarget | null | The element that a new comment points at, or null for the slide. |
| edit | (item: ReviewItemView, text: string) => boolean | Replace the text of a comment or a reply. False when `item.editable` is false. |
| items | readonly ReviewItemView[] | The comments of the current slide, in file order: each thread, then its replies. Empty without a review module or a deck. |
| readOnly | boolean | True while no deck is open for editing: in view mode, and before a deck opens. |
| ready | boolean | False until the editor has a deck. |
| remove | (item: ReviewItemView) => boolean | Delete a reply, or a thread with all of its replies. |
| reopen | (item: ReviewItemView) => boolean | Reopen the thread of `item`. An open thread reports true with no write. |
| reply | (item: ReviewItemView, text: string, author?: string) => boolean | Reply to a thread, or to the thread of a reply. |
| resolve | (item: ReviewItemView) => boolean | Resolve the thread of `item`. A resolved thread reports true with no write. |
| setActive | (key: string | null, options?: ReviewActivationOptions) => boolean | Pick a thread, as a press on its marker does, or `null` for none. With `{ announce: true }` it also asks for the **Comments** tab of the side panel. False for a key that is not a thread of the current slide. |
| setAuthor | (author: string | undefined) => void | Set the name that signs later comments and replies (`editor.setAuthor`). |
Type aliases (1)
ReviewTranslatetypeSource ↗
The label resolver of PptxEditorReview: a string for a key, or undefined for the default.
type ReviewTranslate = (key: string) => string | undefined;Variables (1)
PptxEditorReviewconstSource ↗
The comments pane as a compound component: PptxEditorReview is the root, and every part hangs off it, as DOCX Editor's DocxEditorReview. Root parts (List, AddComment, Draft) go as direct children of the root. Card parts go in List, or as other direct children, which become the card template.
PptxEditorReview: PptxEditorReviewNamespace```tsx
<PptxEditorReview>
<PptxEditorReview.List>
<PptxEditorReview.Card>
<PptxEditorReview.Delete hidden />
</PptxEditorReview.Card>
</PptxEditorReview.List>
</PptxEditorReview>
```