@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
MemberTypeSummary
(member-0)
AddCommenttypeof ReviewAddCommentThe **New comment** button. A root part.
Anchortypeof ReviewAnchorThe element that the thread points at.
Authortypeof ReviewAuthor
Avatartypeof ReviewAvatar
Cardtypeof ReviewCard
Deletetypeof ReviewDelete
Drafttypeof ReviewDraftThe compose box of a new comment, while a draft is open. A root part.
Edittypeof ReviewEdit
Emptytypeof ReviewEmpty
Listtypeof ReviewListThe list of the slide's threads. A root part.
Reopentypeof ReviewReopen
Repliestypeof ReviewReplies
Replytypeof ReviewReplyThe reply line of the picked thread.
Resolvetypeof ReviewResolve
Summarytypeof ReviewSummary
Timetypeof ReviewTime

ProLicenseOptionsinterfaceSource ↗

Accepted by every pro entry point.

interface ProLicenseOptions
MemberTypeSummary
licenseKey?stringYour 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
MemberTypeSummary
icon?ReactNodeThe icon. Default: the part's Material Symbol; `children` also replace it.

ReviewActivationOptionsinterfaceSource ↗

Options of UseReviewReturn.setActive.

interface ReviewActivationOptions
MemberTypeSummary
announce?booleanAlso ask for the **Comments** tab of the side panel (`requestPane`), as a press on the thread's marker does. Default `false`.
identity?stringThe `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
MemberTypeSummary
namestring
nodeIdstring
range?CommentTextRangeThe 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
MemberTypeSummary
nodeId?stringThe 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
MemberTypeSummary
anchorCommentAnchorWhere the thread points on the slide. A reply reports its thread's anchor.
anchorName?stringThe name of the element the thread points at, or absent for the slide or a place.
authorstringThe author's display name, or an empty string when the file names none.
date?stringThe date as the file stores it (ISO 8601), or absent.
editablebooleanWhether `edit` can replace the text. False for content that the editor cannot write back.
formatCommentFormatThe file format of the thread.
idstringThe comment id, as the comment commands take it. Equal to `key`.
identitystringThe 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`.
initialsstringThe avatar text: the file's initials, else the first letters of the author's name.
isActivebooleanWhether the thread is the picked one (`activeKey`). A reply reports its thread's state.
keystringThe key the actions take: the comment id.
kind'comment'Always `comment`: PresentationML has no tracked-change markup.
parent?CommentExpectFor 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?stringFor a reply, the id of its thread; absent on a thread.
replyIdsreadonly string[]For a thread, the ids of its replies, oldest first; empty on a reply.
resolvablebooleanWhether `resolve` and `reopen` apply. False for the legacy format, which has no state.
resolvedbooleanWhether the thread is resolved. A reply reports its thread's state.
textstringThe text, with one line feed between paragraphs.

ReviewListPropsinterfaceSource ↗

Props of PptxEditorReview.List.

interface ReviewListProps extends Omit<ReviewPartProps, 'children' | 'asChild'>
MemberTypeSummary
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
MemberTypeSummary
displayModes?readonly ReviewDisplayMode[]Display modes to unlock. Default: `final` and `markup`.
pane?ReviewPaneOptionsThe 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
MemberTypeSummary
asChild?booleanMerge the part's wiring onto its single child element instead of the default element.
children?ReactNode
className?stringA class name added to the part's element.
hidden?booleanRender nothing. Inside the packaged card, this removes the part.

ReviewPropsinterfaceSource ↗

Props of PptxEditorReview.

interface ReviewProps extends Omit<ReviewPartProps, 'children' | 'asChild'>
MemberTypeSummary
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) => booleanShow only some threads, for example the open ones. Replies follow their thread.
preset?booleanRender 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?ReviewTranslateLabel 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
MemberTypeSummary
activeKeystring | nullThe key of the picked thread (a marker press, `setActive`), or null.
authorstring | nullThe 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; }) => booleanAdd 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.
commentTargetReviewCommentTarget | nullThe element that a new comment points at, or null for the slide.
edit(item: ReviewItemView, text: string) => booleanReplace the text of a comment or a reply. False when `item.editable` is false.
itemsreadonly ReviewItemView[]The comments of the current slide, in file order: each thread, then its replies. Empty without a review module or a deck.
readOnlybooleanTrue while no deck is open for editing: in view mode, and before a deck opens.
readybooleanFalse until the editor has a deck.
remove(item: ReviewItemView) => booleanDelete a reply, or a thread with all of its replies.
reopen(item: ReviewItemView) => booleanReopen the thread of `item`. An open thread reports true with no write.
reply(item: ReviewItemView, text: string, author?: string) => booleanReply to a thread, or to the thread of a reply.
resolve(item: ReviewItemView) => booleanResolve the thread of `item`. A resolved thread reports true with no write.
setActive(key: string | null, options?: ReviewActivationOptions) => booleanPick 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) => voidSet 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>
```