API Referencev1.0.2
@eigenpal/docx-editor-core/utils/comments
Framework-agnostic comment + tracked-change helpers shared by the React and Vue adapters. The data shapes and string-formatting rules here are part of the visible UI (avatar colors, date strings) so keep this file as the single source of truth — both adapters import from here. CSS-property factories live in adapter-specific files (sidebar/cardUtils.ts in React, sidebar/sidebarUtils.ts in Vue).
Functions(5)
fn
packages/core/src/docx/fieldParser.ts:618formatDate
declare function formatDate(dateStr?: string): string;fn
packages/core/src/utils/comments.ts:63getAvatarColor
declare function getAvatarColor(name: string): string;fn
packages/core/src/utils/comments.ts:14getCommentText
Extract plain text from a Comment's paragraph content.
declare function getCommentText(paragraphs?: Paragraph[]): string;fn
packages/core/src/utils/comments.ts:38getInitials
declare function getInitials(name: string): string;fn
packages/core/src/utils/comments.ts:71truncateText
declare function truncateText(text: string, maxLength?: number): string;Interfaces(1)
interface
packages/core/src/utils/comments.ts:75TrackedChangeEntry
interface TrackedChangeEntry| Member | Type | Summary |
|---|---|---|
| author | string | |
| date? | string | |
| deletedText? | string | For replacements: the deleted text that was replaced |
| from | number | |
| insertionRevisionId? | number | For replacements: the insertion part's revisionId (different from the deletion's) |
| revisionId | number | |
| text | string | |
| to | number | |
| type | 'insertion' | 'deletion' | 'replacement' |